@sentry/angular 8.0.0-alpha.3 → 8.0.0-alpha.5

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.
@@ -0,0 +1,515 @@
1
+ import * as Sentry from '@sentry/browser';
2
+ import { getDefaultIntegrations, init as init$1, setContext, browserTracingIntegration as browserTracingIntegration$1, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getClient, startBrowserTracingNavigationSpan, startInactiveSpan, getCurrentScope, getActiveSpan, getRootSpan } from '@sentry/browser';
3
+ export * from '@sentry/browser';
4
+ import * as i0 from '@angular/core';
5
+ import { VERSION, Injectable, Inject, Directive, Input, NgModule } from '@angular/core';
6
+ import { applySdkMetadata } from '@sentry/core';
7
+ import { logger, isString, stripUrlQueryAndFragment, timestampInSeconds } from '@sentry/utils';
8
+ import { HttpErrorResponse } from '@angular/common/http';
9
+ import * as i1 from '@angular/router';
10
+ import { NavigationStart, ResolveEnd, NavigationEnd, NavigationCancel, NavigationError } from '@angular/router';
11
+ import { Subscription } from 'rxjs';
12
+ import { filter, tap } from 'rxjs/operators';
13
+
14
+ /*
15
+ * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking
16
+ * for users.
17
+ *
18
+ * We define "magic strings" like `__SENTRY_DEBUG__` that may get replaced with actual values during our, or the user's
19
+ * build process. Take care when introducing new flags - they must not throw if they are not replaced. See the Debug
20
+ * Build Flags section in CONTRIBUTING.md.
21
+ */
22
+ /** Flag that is true for debug builds, false otherwise. */
23
+ const IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;
24
+
25
+ /**
26
+ * Inits the Angular SDK
27
+ */
28
+ function init(options) {
29
+ const opts = {
30
+ // Filter out BrowserApiErrors integration as it interferes with our Angular `ErrorHandler`:
31
+ // BrowserApiErrors would catch certain errors before they reach the `ErrorHandler` and thus provide a
32
+ // lower fidelity error than what `SentryErrorHandler` (see errorhandler.ts) would provide.
33
+ // see:
34
+ // - https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1453407097
35
+ // - https://github.com/getsentry/sentry-javascript/issues/2744
36
+ defaultIntegrations: getDefaultIntegrations(options).filter(integration => {
37
+ return integration.name !== 'BrowserApiErrors';
38
+ }),
39
+ ...options,
40
+ };
41
+ applySdkMetadata(opts, 'angular');
42
+ checkAndSetAngularVersion();
43
+ init$1(opts);
44
+ }
45
+ function checkAndSetAngularVersion() {
46
+ const ANGULAR_MINIMUM_VERSION = 14;
47
+ const angularVersion = VERSION && VERSION.major ? parseInt(VERSION.major, 10) : undefined;
48
+ if (angularVersion) {
49
+ if (angularVersion < ANGULAR_MINIMUM_VERSION) {
50
+ IS_DEBUG_BUILD &&
51
+ logger.warn(`This Sentry SDK does not officially support Angular ${angularVersion}.`, `This SDK only supports Angular ${ANGULAR_MINIMUM_VERSION} and above.`, "If you're using lower Angular versions, check the Angular Version Compatibility table in our docs: https://docs.sentry.io/platforms/javascript/guides/angular/#angular-version-compatibility.", 'Otherwise, please consider upgrading your Angular version.');
52
+ }
53
+ setContext('angular', { version: angularVersion });
54
+ }
55
+ }
56
+
57
+ // There're 2 types of Angular applications:
58
+ // 1) zone-full (by default)
59
+ // 2) zone-less
60
+ // The developer can avoid importing the `zone.js` package and tells Angular that
61
+ // he is responsible for running the change detection by himself. This is done by
62
+ // "nooping" the zone through `CompilerOptions` when bootstrapping the root module.
63
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
64
+ const isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.current;
65
+ /**
66
+ * The function that does the same job as `NgZone.runOutsideAngular`.
67
+ */
68
+ function runOutsideAngular(callback) {
69
+ // The `Zone.root.run` basically will run the `callback` in the most parent zone.
70
+ // Any asynchronous API used inside the `callback` won't catch Angular's zone
71
+ // since `Zone.current` will reference `Zone.root`.
72
+ // The Angular's zone is forked from the `Zone.root`. In this case, `zone.js` won't
73
+ // trigger change detection, and `ApplicationRef.tick()` will not be run.
74
+ // Caretaker note: we're using `Zone.root` except `NgZone.runOutsideAngular` since this
75
+ // will require injecting the `NgZone` facade. That will create a breaking change for
76
+ // projects already using the `@sentry/angular`.
77
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
78
+ return isNgZoneEnabled ? Zone.root.run(callback) : callback();
79
+ }
80
+
81
+ // https://github.com/angular/angular/blob/master/packages/core/src/util/errors.ts
82
+ function tryToUnwrapZonejsError(error) {
83
+ // TODO: once Angular14 is the minimum requirement ERROR_ORIGINAL_ERROR and
84
+ // getOriginalError from error.ts can be used directly.
85
+ return error && error.ngOriginalError
86
+ ? error.ngOriginalError
87
+ : error;
88
+ }
89
+ function extractHttpModuleError(error) {
90
+ // The `error` property of http exception can be either an `Error` object, which we can use directly...
91
+ if (isErrorOrErrorLikeObject(error.error)) {
92
+ return error.error;
93
+ }
94
+ // ... or an`ErrorEvent`, which can provide us with the message but no stack...
95
+ if (error.error instanceof ErrorEvent && error.error.message) {
96
+ return error.error.message;
97
+ }
98
+ // ...or the request body itself, which we can use as a message instead.
99
+ if (typeof error.error === 'string') {
100
+ return `Server returned code ${error.status} with body "${error.error}"`;
101
+ }
102
+ // If we don't have any detailed information, fallback to the request message itself.
103
+ return error.message;
104
+ }
105
+ function isErrorOrErrorLikeObject(value) {
106
+ if (value instanceof Error) {
107
+ return true;
108
+ }
109
+ if (value === null || typeof value !== 'object') {
110
+ return false;
111
+ }
112
+ const candidate = value;
113
+ return (isString(candidate.name) &&
114
+ isString(candidate.message) &&
115
+ (undefined === candidate.stack || isString(candidate.stack)));
116
+ }
117
+ /**
118
+ * Implementation of Angular's ErrorHandler provider that can be used as a drop-in replacement for the stock one.
119
+ */
120
+ class SentryErrorHandler {
121
+ constructor(options) {
122
+ this._registeredAfterSendEventHandler = false;
123
+ this._options = {
124
+ logErrors: true,
125
+ ...options,
126
+ };
127
+ }
128
+ /**
129
+ * Method called for every value captured through the ErrorHandler
130
+ */
131
+ handleError(error) {
132
+ const extractedError = this._extractError(error) || 'Handled unknown error';
133
+ // Capture handled exception and send it to Sentry.
134
+ const eventId = runOutsideAngular(() => Sentry.captureException(extractedError, {
135
+ mechanism: { type: 'angular', handled: false },
136
+ }));
137
+ // When in development mode, log the error to console for immediate feedback.
138
+ if (this._options.logErrors) {
139
+ // eslint-disable-next-line no-console
140
+ console.error(extractedError);
141
+ }
142
+ // Optionally show user dialog to provide details on what happened.
143
+ if (this._options.showDialog) {
144
+ const client = Sentry.getClient();
145
+ if (client && !this._registeredAfterSendEventHandler) {
146
+ client.on('afterSendEvent', (event) => {
147
+ if (!event.type && event.event_id) {
148
+ Sentry.showReportDialog({ ...this._options.dialogOptions, eventId: event.event_id });
149
+ }
150
+ });
151
+ // We only want to register this hook once in the lifetime of the error handler
152
+ this._registeredAfterSendEventHandler = true;
153
+ }
154
+ else if (!client) {
155
+ Sentry.showReportDialog({ ...this._options.dialogOptions, eventId });
156
+ }
157
+ }
158
+ }
159
+ /**
160
+ * Used to pull a desired value that will be used to capture an event out of the raw value captured by ErrorHandler.
161
+ */
162
+ _extractError(error) {
163
+ // Allow custom overrides of extracting function
164
+ if (this._options.extractor) {
165
+ const defaultExtractor = this._defaultExtractor.bind(this);
166
+ return this._options.extractor(error, defaultExtractor);
167
+ }
168
+ return this._defaultExtractor(error);
169
+ }
170
+ /**
171
+ * Default implementation of error extraction that handles default error wrapping, HTTP responses, ErrorEvent and few other known cases.
172
+ */
173
+ _defaultExtractor(errorCandidate) {
174
+ const error = tryToUnwrapZonejsError(errorCandidate);
175
+ // If it's http module error, extract as much information from it as we can.
176
+ if (error instanceof HttpErrorResponse) {
177
+ return extractHttpModuleError(error);
178
+ }
179
+ // We can handle messages and Error objects directly.
180
+ if (typeof error === 'string' || isErrorOrErrorLikeObject(error)) {
181
+ return error;
182
+ }
183
+ // Nothing was extracted, fallback to default error message.
184
+ return null;
185
+ }
186
+ }
187
+ SentryErrorHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SentryErrorHandler, deps: [{ token: 'errorHandlerOptions' }], target: i0.ɵɵFactoryTarget.Injectable });
188
+ SentryErrorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SentryErrorHandler, providedIn: 'root' });
189
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: SentryErrorHandler, decorators: [{
190
+ type: Injectable,
191
+ args: [{ providedIn: 'root' }]
192
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
193
+ type: Inject,
194
+ args: ['errorHandlerOptions']
195
+ }] }]; } });
196
+ /**
197
+ * Factory function that creates an instance of a preconfigured ErrorHandler provider.
198
+ */
199
+ function createErrorHandler(config) {
200
+ return new SentryErrorHandler(config);
201
+ }
202
+
203
+ const ANGULAR_ROUTING_OP = 'ui.angular.routing';
204
+ const ANGULAR_INIT_OP = 'ui.angular.init';
205
+ const ANGULAR_OP = 'ui.angular';
206
+
207
+ let instrumentationInitialized;
208
+ /**
209
+ * A custom browser tracing integration for Angular.
210
+ *
211
+ * Use this integration in combination with `TraceService`
212
+ */
213
+ function browserTracingIntegration(options = {}) {
214
+ // If the user opts out to set this up, we just don't initialize this.
215
+ // That way, the TraceService will not actually do anything, functionally disabling this.
216
+ if (options.instrumentNavigation !== false) {
217
+ instrumentationInitialized = true;
218
+ }
219
+ return browserTracingIntegration$1({
220
+ ...options,
221
+ instrumentNavigation: false,
222
+ });
223
+ }
224
+ /**
225
+ * This function is extracted to make unit testing easier.
226
+ */
227
+ function _updateSpanAttributesForParametrizedUrl(route, span) {
228
+ const attributes = (span && spanToJSON(span).data) || {};
229
+ if (span && attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'url') {
230
+ span.updateName(route);
231
+ span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');
232
+ span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, `auto.${spanToJSON(span).op}.angular`);
233
+ }
234
+ }
235
+ /**
236
+ * Angular's Service responsible for hooking into Angular Router and tracking current navigation process.
237
+ * Creates a new transaction for every route change and measures a duration of routing process.
238
+ */
239
+ class TraceService {
240
+ constructor(_router) {
241
+ this._router = _router;
242
+ this.navStart$ = this._router.events.pipe(filter((event) => event instanceof NavigationStart), tap(navigationEvent => {
243
+ if (!instrumentationInitialized) {
244
+ IS_DEBUG_BUILD &&
245
+ logger.error('Angular integration has tracing enabled, but Tracing integration is not configured');
246
+ return;
247
+ }
248
+ if (this._routingSpan) {
249
+ this._routingSpan.end();
250
+ this._routingSpan = null;
251
+ }
252
+ const client = getClient();
253
+ const strippedUrl = stripUrlQueryAndFragment(navigationEvent.url);
254
+ if (client) {
255
+ // see comment in `_isPageloadOngoing` for rationale
256
+ if (!this._isPageloadOngoing()) {
257
+ startBrowserTracingNavigationSpan(client, {
258
+ name: strippedUrl,
259
+ attributes: {
260
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.angular',
261
+ [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
262
+ },
263
+ });
264
+ }
265
+ else {
266
+ // The first time we end up here, we set the pageload flag to false
267
+ // Subsequent navigations are going to get their own navigation root span
268
+ // even if the pageload root span is still ongoing.
269
+ this._pageloadOngoing = false;
270
+ }
271
+ this._routingSpan =
272
+ startInactiveSpan({
273
+ name: `${navigationEvent.url}`,
274
+ op: ANGULAR_ROUTING_OP,
275
+ attributes: {
276
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular',
277
+ [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',
278
+ url: strippedUrl,
279
+ ...(navigationEvent.navigationTrigger && {
280
+ navigationTrigger: navigationEvent.navigationTrigger,
281
+ }),
282
+ },
283
+ }) || null;
284
+ return;
285
+ }
286
+ }));
287
+ // The ResolveEnd event is fired when the Angular router has resolved the URL and
288
+ // the parameter<->value mapping. It holds the new resolved router state with
289
+ // the mapping and the new URL.
290
+ // Only After this event, the route is activated, meaning that the transaction
291
+ // can be updated with the parameterized route name before e.g. the route's root
292
+ // component is initialized. This should be early enough before outgoing requests
293
+ // are made from the new route, with the exceptions of requests being made during
294
+ // a navigation.
295
+ this.resEnd$ = this._router.events.pipe(filter((event) => event instanceof ResolveEnd), tap(event => {
296
+ const route = getParameterizedRouteFromSnapshot(event.state.root);
297
+ if (route) {
298
+ getCurrentScope().setTransactionName(route);
299
+ }
300
+ const activeSpan = getActiveSpan();
301
+ const rootSpan = activeSpan && getRootSpan(activeSpan);
302
+ _updateSpanAttributesForParametrizedUrl(route, rootSpan);
303
+ }));
304
+ this.navEnd$ = this._router.events.pipe(filter(event => event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError), tap(() => {
305
+ if (this._routingSpan) {
306
+ runOutsideAngular(() => {
307
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
308
+ this._routingSpan.end();
309
+ });
310
+ this._routingSpan = null;
311
+ }
312
+ }));
313
+ this._routingSpan = null;
314
+ this._pageloadOngoing = true;
315
+ this._subscription = new Subscription();
316
+ this._subscription.add(this.navStart$.subscribe());
317
+ this._subscription.add(this.resEnd$.subscribe());
318
+ this._subscription.add(this.navEnd$.subscribe());
319
+ }
320
+ /**
321
+ * This is used to prevent memory leaks when the root view is created and destroyed multiple times,
322
+ * since `subscribe` callbacks capture `this` and prevent many resources from being GC'd.
323
+ */
324
+ ngOnDestroy() {
325
+ this._subscription.unsubscribe();
326
+ }
327
+ /**
328
+ * We only _avoid_ creating a navigation root span in one case:
329
+ *
330
+ * There is an ongoing pageload span AND the router didn't yet emit the first navigation start event
331
+ *
332
+ * The first navigation start event will create the child routing span
333
+ * and update the pageload root span name on ResolveEnd.
334
+ *
335
+ * There's an edge case we need to avoid here: If the router fires the first navigation start event
336
+ * _after_ the pageload root span finished. This is why we check for the pageload root span.
337
+ * Possible real-world scenario: Angular application and/or router is bootstrapped after the pageload
338
+ * idle root span finished
339
+ *
340
+ * The overall rationale is:
341
+ * - if we already avoided creating a navigation root span once, we don't avoid it again
342
+ * (i.e. set `_pageloadOngoing` to `false`)
343
+ * - if `_pageloadOngoing` is already `false`, create a navigation root span
344
+ * - if there's no active/pageload root span, create a navigation root span
345
+ * - only if there's an ongoing pageload root span AND `_pageloadOngoing` is still `true,
346
+ * don't create a navigation root span
347
+ */
348
+ _isPageloadOngoing() {
349
+ if (!this._pageloadOngoing) {
350
+ // pageload is already finished, no need to update
351
+ return false;
352
+ }
353
+ const activeSpan = getActiveSpan();
354
+ if (!activeSpan) {
355
+ this._pageloadOngoing = false;
356
+ return false;
357
+ }
358
+ const rootSpan = getRootSpan(activeSpan);
359
+ this._pageloadOngoing = spanToJSON(rootSpan).op === 'pageload';
360
+ return this._pageloadOngoing;
361
+ }
362
+ }
363
+ TraceService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TraceService, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable });
364
+ TraceService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TraceService, providedIn: 'root' });
365
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TraceService, decorators: [{
366
+ type: Injectable,
367
+ args: [{ providedIn: 'root' }]
368
+ }], ctorParameters: function () { return [{ type: i1.Router }]; } });
369
+ const UNKNOWN_COMPONENT = 'unknown';
370
+ /**
371
+ * A directive that can be used to capture initialization lifecycle of the whole component.
372
+ */
373
+ class TraceDirective {
374
+ /**
375
+ * Implementation of OnInit lifecycle method
376
+ * @inheritdoc
377
+ */
378
+ ngOnInit() {
379
+ if (!this.componentName) {
380
+ this.componentName = UNKNOWN_COMPONENT;
381
+ }
382
+ if (getActiveSpan()) {
383
+ this._tracingSpan = startInactiveSpan({
384
+ name: `<${this.componentName}>`,
385
+ op: ANGULAR_INIT_OP,
386
+ attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive' },
387
+ });
388
+ }
389
+ }
390
+ /**
391
+ * Implementation of AfterViewInit lifecycle method
392
+ * @inheritdoc
393
+ */
394
+ ngAfterViewInit() {
395
+ if (this._tracingSpan) {
396
+ this._tracingSpan.end();
397
+ }
398
+ }
399
+ }
400
+ TraceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TraceDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
401
+ TraceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.3.0", type: TraceDirective, selector: "[trace]", inputs: { componentName: ["trace", "componentName"] }, ngImport: i0 });
402
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TraceDirective, decorators: [{
403
+ type: Directive,
404
+ args: [{ selector: '[trace]' }]
405
+ }], propDecorators: { componentName: [{
406
+ type: Input,
407
+ args: ['trace']
408
+ }] } });
409
+ /**
410
+ * A module serves as a single compilation unit for the `TraceDirective` and can be re-used by any other module.
411
+ */
412
+ class TraceModule {
413
+ }
414
+ TraceModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TraceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
415
+ TraceModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.3.0", ngImport: i0, type: TraceModule, declarations: [TraceDirective], exports: [TraceDirective] });
416
+ TraceModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TraceModule });
417
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.3.0", ngImport: i0, type: TraceModule, decorators: [{
418
+ type: NgModule,
419
+ args: [{
420
+ declarations: [TraceDirective],
421
+ exports: [TraceDirective],
422
+ }]
423
+ }] });
424
+ /**
425
+ * Decorator function that can be used to capture initialization lifecycle of the whole component.
426
+ */
427
+ function TraceClass(options) {
428
+ let tracingSpan;
429
+ /* eslint-disable @typescript-eslint/no-unsafe-member-access */
430
+ return target => {
431
+ const originalOnInit = target.prototype.ngOnInit;
432
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
433
+ target.prototype.ngOnInit = function (...args) {
434
+ tracingSpan = startInactiveSpan({
435
+ onlyIfParent: true,
436
+ name: `<${options && options.name ? options.name : 'unnamed'}>`,
437
+ op: ANGULAR_INIT_OP,
438
+ attributes: {
439
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_class_decorator',
440
+ },
441
+ });
442
+ if (originalOnInit) {
443
+ return originalOnInit.apply(this, args);
444
+ }
445
+ };
446
+ const originalAfterViewInit = target.prototype.ngAfterViewInit;
447
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
448
+ target.prototype.ngAfterViewInit = function (...args) {
449
+ if (tracingSpan) {
450
+ tracingSpan.end();
451
+ }
452
+ if (originalAfterViewInit) {
453
+ return originalAfterViewInit.apply(this, args);
454
+ }
455
+ };
456
+ };
457
+ /* eslint-enable @typescript-eslint/no-unsafe-member-access */
458
+ }
459
+ /**
460
+ * Decorator function that can be used to capture a single lifecycle methods of the component.
461
+ */
462
+ function TraceMethod(options) {
463
+ // eslint-disable-next-line @typescript-eslint/ban-types
464
+ return (target, propertyKey, descriptor) => {
465
+ const originalMethod = descriptor.value;
466
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
467
+ descriptor.value = function (...args) {
468
+ const now = timestampInSeconds();
469
+ startInactiveSpan({
470
+ onlyIfParent: true,
471
+ name: `<${options && options.name ? options.name : 'unnamed'}>`,
472
+ op: `${ANGULAR_OP}.${String(propertyKey)}`,
473
+ startTime: now,
474
+ attributes: {
475
+ [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_method_decorator',
476
+ },
477
+ }).end(now);
478
+ if (originalMethod) {
479
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
480
+ return originalMethod.apply(this, args);
481
+ }
482
+ };
483
+ return descriptor;
484
+ };
485
+ }
486
+ /**
487
+ * Takes the parameterized route from a given ActivatedRouteSnapshot and concatenates the snapshot's
488
+ * child route with its parent to produce the complete parameterized URL of the activated route.
489
+ * This happens recursively until the last child (i.e. the end of the URL) is reached.
490
+ *
491
+ * @param route the ActivatedRouteSnapshot of which its path and its child's path is concatenated
492
+ *
493
+ * @returns the concatenated parameterized route string
494
+ */
495
+ function getParameterizedRouteFromSnapshot(route) {
496
+ const parts = [];
497
+ let currentRoute = route && route.firstChild;
498
+ while (currentRoute) {
499
+ const path = currentRoute && currentRoute.routeConfig && currentRoute.routeConfig.path;
500
+ if (path === null || path === undefined) {
501
+ break;
502
+ }
503
+ parts.push(path);
504
+ currentRoute = currentRoute.firstChild;
505
+ }
506
+ const fullPath = parts.filter(part => part).join('/');
507
+ return fullPath ? `/${fullPath}/` : '/';
508
+ }
509
+
510
+ /**
511
+ * Generated bundle index. Do not edit.
512
+ */
513
+
514
+ export { SentryErrorHandler, TraceClass, TraceDirective, TraceMethod, TraceModule, TraceService, browserTracingIntegration, createErrorHandler, init };
515
+ //# sourceMappingURL=sentry-angular.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentry-angular.mjs","sources":["../../src/flags.ts","../../src/sdk.ts","../../src/zone.ts","../../src/errorhandler.ts","../../src/constants.ts","../../src/tracing.ts","../../src/sentry-angular.ts"],"sourcesContent":["/*\n * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking\n * for users.\n *\n * We define \"magic strings\" like `__SENTRY_DEBUG__` that may get replaced with actual values during our, or the user's\n * build process. Take care when introducing new flags - they must not throw if they are not replaced. See the Debug\n * Build Flags section in CONTRIBUTING.md.\n */\n\ndeclare const __SENTRY_DEBUG__: boolean;\n\n/** Flag that is true for debug builds, false otherwise. */\nexport const IS_DEBUG_BUILD = typeof __SENTRY_DEBUG__ === 'undefined' ? true : __SENTRY_DEBUG__;\n","import { VERSION } from '@angular/core';\nimport type { BrowserOptions } from '@sentry/browser';\nimport { getDefaultIntegrations, init as browserInit, setContext } from '@sentry/browser';\nimport { applySdkMetadata } from '@sentry/core';\nimport { logger } from '@sentry/utils';\n\nimport { IS_DEBUG_BUILD } from './flags';\n\n/**\n * Inits the Angular SDK\n */\nexport function init(options: BrowserOptions): void {\n const opts = {\n // Filter out BrowserApiErrors integration as it interferes with our Angular `ErrorHandler`:\n // BrowserApiErrors would catch certain errors before they reach the `ErrorHandler` and thus provide a\n // lower fidelity error than what `SentryErrorHandler` (see errorhandler.ts) would provide.\n // see:\n // - https://github.com/getsentry/sentry-javascript/issues/5417#issuecomment-1453407097\n // - https://github.com/getsentry/sentry-javascript/issues/2744\n defaultIntegrations: getDefaultIntegrations(options).filter(integration => {\n return integration.name !== 'BrowserApiErrors';\n }),\n ...options,\n };\n\n applySdkMetadata(opts, 'angular');\n\n checkAndSetAngularVersion();\n browserInit(opts);\n}\n\nfunction checkAndSetAngularVersion(): void {\n const ANGULAR_MINIMUM_VERSION = 14;\n\n const angularVersion = VERSION && VERSION.major ? parseInt(VERSION.major, 10) : undefined;\n\n if (angularVersion) {\n if (angularVersion < ANGULAR_MINIMUM_VERSION) {\n IS_DEBUG_BUILD &&\n logger.warn(\n `This Sentry SDK does not officially support Angular ${angularVersion}.`,\n `This SDK only supports Angular ${ANGULAR_MINIMUM_VERSION} and above.`,\n \"If you're using lower Angular versions, check the Angular Version Compatibility table in our docs: https://docs.sentry.io/platforms/javascript/guides/angular/#angular-version-compatibility.\",\n 'Otherwise, please consider upgrading your Angular version.',\n );\n }\n setContext('angular', { version: angularVersion });\n }\n}\n","// That's the `global.Zone` exposed when the `zone.js` package is used.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ndeclare const Zone: any;\n\n// There're 2 types of Angular applications:\n// 1) zone-full (by default)\n// 2) zone-less\n// The developer can avoid importing the `zone.js` package and tells Angular that\n// he is responsible for running the change detection by himself. This is done by\n// \"nooping\" the zone through `CompilerOptions` when bootstrapping the root module.\n// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\nconst isNgZoneEnabled = typeof Zone !== 'undefined' && !!Zone.current;\n\n/**\n * The function that does the same job as `NgZone.runOutsideAngular`.\n */\nexport function runOutsideAngular<T>(callback: () => T): T {\n // The `Zone.root.run` basically will run the `callback` in the most parent zone.\n // Any asynchronous API used inside the `callback` won't catch Angular's zone\n // since `Zone.current` will reference `Zone.root`.\n // The Angular's zone is forked from the `Zone.root`. In this case, `zone.js` won't\n // trigger change detection, and `ApplicationRef.tick()` will not be run.\n // Caretaker note: we're using `Zone.root` except `NgZone.runOutsideAngular` since this\n // will require injecting the `NgZone` facade. That will create a breaking change for\n // projects already using the `@sentry/angular`.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return isNgZoneEnabled ? Zone.root.run(callback) : callback();\n}\n","import { HttpErrorResponse } from '@angular/common/http';\nimport type { ErrorHandler as AngularErrorHandler } from '@angular/core';\nimport { Inject, Injectable } from '@angular/core';\nimport * as Sentry from '@sentry/browser';\nimport type { ReportDialogOptions } from '@sentry/browser';\nimport type { Event } from '@sentry/types';\nimport { isString } from '@sentry/utils';\n\nimport { runOutsideAngular } from './zone';\n\n/**\n * Options used to configure the behavior of the Angular ErrorHandler.\n */\nexport interface ErrorHandlerOptions {\n logErrors?: boolean;\n showDialog?: boolean;\n dialogOptions?: Omit<ReportDialogOptions, 'eventId'>;\n /**\n * Custom implementation of error extraction from the raw value captured by the Angular.\n * @param error Value captured by Angular's ErrorHandler provider\n * @param defaultExtractor Default implementation that can be used as the fallback in case of custom implementation\n */\n extractor?(error: unknown, defaultExtractor: (error: unknown) => unknown): unknown;\n}\n\n// https://github.com/angular/angular/blob/master/packages/core/src/util/errors.ts\nfunction tryToUnwrapZonejsError(error: unknown): unknown | Error {\n // TODO: once Angular14 is the minimum requirement ERROR_ORIGINAL_ERROR and\n // getOriginalError from error.ts can be used directly.\n return error && (error as { ngOriginalError: Error }).ngOriginalError\n ? (error as { ngOriginalError: Error }).ngOriginalError\n : error;\n}\n\nfunction extractHttpModuleError(error: HttpErrorResponse): string | Error {\n // The `error` property of http exception can be either an `Error` object, which we can use directly...\n if (isErrorOrErrorLikeObject(error.error)) {\n return error.error;\n }\n\n // ... or an`ErrorEvent`, which can provide us with the message but no stack...\n if (error.error instanceof ErrorEvent && error.error.message) {\n return error.error.message;\n }\n\n // ...or the request body itself, which we can use as a message instead.\n if (typeof error.error === 'string') {\n return `Server returned code ${error.status} with body \"${error.error}\"`;\n }\n\n // If we don't have any detailed information, fallback to the request message itself.\n return error.message;\n}\n\ntype ErrorCandidate = {\n name?: unknown;\n message?: unknown;\n stack?: unknown;\n};\n\nfunction isErrorOrErrorLikeObject(value: unknown): value is Error {\n if (value instanceof Error) {\n return true;\n }\n\n if (value === null || typeof value !== 'object') {\n return false;\n }\n\n const candidate = value as ErrorCandidate;\n\n return (\n isString(candidate.name) &&\n isString(candidate.message) &&\n (undefined === candidate.stack || isString(candidate.stack))\n );\n}\n\n/**\n * Implementation of Angular's ErrorHandler provider that can be used as a drop-in replacement for the stock one.\n */\n@Injectable({ providedIn: 'root' })\nclass SentryErrorHandler implements AngularErrorHandler {\n protected readonly _options: ErrorHandlerOptions;\n\n /* indicates if we already registered our the afterSendEvent handler */\n private _registeredAfterSendEventHandler;\n\n public constructor(@Inject('errorHandlerOptions') options?: ErrorHandlerOptions) {\n this._registeredAfterSendEventHandler = false;\n\n this._options = {\n logErrors: true,\n ...options,\n };\n }\n\n /**\n * Method called for every value captured through the ErrorHandler\n */\n public handleError(error: unknown): void {\n const extractedError = this._extractError(error) || 'Handled unknown error';\n\n // Capture handled exception and send it to Sentry.\n const eventId = runOutsideAngular(() =>\n Sentry.captureException(extractedError, {\n mechanism: { type: 'angular', handled: false },\n }),\n );\n\n // When in development mode, log the error to console for immediate feedback.\n if (this._options.logErrors) {\n // eslint-disable-next-line no-console\n console.error(extractedError);\n }\n\n // Optionally show user dialog to provide details on what happened.\n if (this._options.showDialog) {\n const client = Sentry.getClient();\n\n if (client && !this._registeredAfterSendEventHandler) {\n client.on('afterSendEvent', (event: Event) => {\n if (!event.type && event.event_id) {\n Sentry.showReportDialog({ ...this._options.dialogOptions, eventId: event.event_id });\n }\n });\n\n // We only want to register this hook once in the lifetime of the error handler\n this._registeredAfterSendEventHandler = true;\n } else if (!client) {\n Sentry.showReportDialog({ ...this._options.dialogOptions, eventId });\n }\n }\n }\n\n /**\n * Used to pull a desired value that will be used to capture an event out of the raw value captured by ErrorHandler.\n */\n protected _extractError(error: unknown): unknown {\n // Allow custom overrides of extracting function\n if (this._options.extractor) {\n const defaultExtractor = this._defaultExtractor.bind(this);\n return this._options.extractor(error, defaultExtractor);\n }\n\n return this._defaultExtractor(error);\n }\n\n /**\n * Default implementation of error extraction that handles default error wrapping, HTTP responses, ErrorEvent and few other known cases.\n */\n protected _defaultExtractor(errorCandidate: unknown): unknown {\n const error = tryToUnwrapZonejsError(errorCandidate);\n\n // If it's http module error, extract as much information from it as we can.\n if (error instanceof HttpErrorResponse) {\n return extractHttpModuleError(error);\n }\n\n // We can handle messages and Error objects directly.\n if (typeof error === 'string' || isErrorOrErrorLikeObject(error)) {\n return error;\n }\n\n // Nothing was extracted, fallback to default error message.\n return null;\n }\n}\n\n/**\n * Factory function that creates an instance of a preconfigured ErrorHandler provider.\n */\nfunction createErrorHandler(config?: ErrorHandlerOptions): SentryErrorHandler {\n return new SentryErrorHandler(config);\n}\n\nexport { createErrorHandler, SentryErrorHandler };\n","export const ANGULAR_ROUTING_OP = 'ui.angular.routing';\n\nexport const ANGULAR_INIT_OP = 'ui.angular.init';\n\nexport const ANGULAR_OP = 'ui.angular';\n","import type { AfterViewInit, OnDestroy, OnInit } from '@angular/core';\nimport { Directive, Injectable, Input, NgModule } from '@angular/core';\nimport type { ActivatedRouteSnapshot, Event, RouterState } from '@angular/router';\n// Duplicated import to work around a TypeScript bug where it'd complain that `Router` isn't imported as a type.\n// We need to import it as a value to satisfy Angular dependency injection. So:\n// eslint-disable-next-line @typescript-eslint/consistent-type-imports\nimport { NavigationCancel, NavigationError, Router } from '@angular/router';\nimport { NavigationEnd, NavigationStart, ResolveEnd } from '@angular/router';\nimport {\n SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,\n SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,\n browserTracingIntegration as originalBrowserTracingIntegration,\n getActiveSpan,\n getClient,\n getCurrentScope,\n getRootSpan,\n spanToJSON,\n startBrowserTracingNavigationSpan,\n startInactiveSpan,\n} from '@sentry/browser';\nimport type { Integration, Span } from '@sentry/types';\nimport { logger, stripUrlQueryAndFragment, timestampInSeconds } from '@sentry/utils';\nimport type { Observable } from 'rxjs';\nimport { Subscription } from 'rxjs';\nimport { filter, tap } from 'rxjs/operators';\n\nimport { ANGULAR_INIT_OP, ANGULAR_OP, ANGULAR_ROUTING_OP } from './constants';\nimport { IS_DEBUG_BUILD } from './flags';\nimport { runOutsideAngular } from './zone';\n\nlet instrumentationInitialized: boolean;\n\n/**\n * A custom browser tracing integration for Angular.\n *\n * Use this integration in combination with `TraceService`\n */\nexport function browserTracingIntegration(\n options: Parameters<typeof originalBrowserTracingIntegration>[0] = {},\n): Integration {\n // If the user opts out to set this up, we just don't initialize this.\n // That way, the TraceService will not actually do anything, functionally disabling this.\n if (options.instrumentNavigation !== false) {\n instrumentationInitialized = true;\n }\n\n return originalBrowserTracingIntegration({\n ...options,\n instrumentNavigation: false,\n });\n}\n\n/**\n * This function is extracted to make unit testing easier.\n */\nexport function _updateSpanAttributesForParametrizedUrl(route: string, span?: Span): void {\n const attributes = (span && spanToJSON(span).data) || {};\n\n if (span && attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === 'url') {\n span.updateName(route);\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'route');\n span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, `auto.${spanToJSON(span).op}.angular`);\n }\n}\n\n/**\n * Angular's Service responsible for hooking into Angular Router and tracking current navigation process.\n * Creates a new transaction for every route change and measures a duration of routing process.\n */\n@Injectable({ providedIn: 'root' })\nexport class TraceService implements OnDestroy {\n public navStart$: Observable<Event> = this._router.events.pipe(\n filter((event): event is NavigationStart => event instanceof NavigationStart),\n tap(navigationEvent => {\n if (!instrumentationInitialized) {\n IS_DEBUG_BUILD &&\n logger.error('Angular integration has tracing enabled, but Tracing integration is not configured');\n return;\n }\n\n if (this._routingSpan) {\n this._routingSpan.end();\n this._routingSpan = null;\n }\n\n const client = getClient();\n const strippedUrl = stripUrlQueryAndFragment(navigationEvent.url);\n\n if (client) {\n // see comment in `_isPageloadOngoing` for rationale\n if (!this._isPageloadOngoing()) {\n startBrowserTracingNavigationSpan(client, {\n name: strippedUrl,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.angular',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n },\n });\n } else {\n // The first time we end up here, we set the pageload flag to false\n // Subsequent navigations are going to get their own navigation root span\n // even if the pageload root span is still ongoing.\n this._pageloadOngoing = false;\n }\n\n this._routingSpan =\n startInactiveSpan({\n name: `${navigationEvent.url}`,\n op: ANGULAR_ROUTING_OP,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url',\n url: strippedUrl,\n ...(navigationEvent.navigationTrigger && {\n navigationTrigger: navigationEvent.navigationTrigger,\n }),\n },\n }) || null;\n\n return;\n }\n }),\n );\n\n // The ResolveEnd event is fired when the Angular router has resolved the URL and\n // the parameter<->value mapping. It holds the new resolved router state with\n // the mapping and the new URL.\n // Only After this event, the route is activated, meaning that the transaction\n // can be updated with the parameterized route name before e.g. the route's root\n // component is initialized. This should be early enough before outgoing requests\n // are made from the new route, with the exceptions of requests being made during\n // a navigation.\n public resEnd$: Observable<Event> = this._router.events.pipe(\n filter((event): event is ResolveEnd => event instanceof ResolveEnd),\n tap(event => {\n const route = getParameterizedRouteFromSnapshot(\n (event.state as unknown as RouterState & { root: ActivatedRouteSnapshot }).root,\n );\n\n if (route) {\n getCurrentScope().setTransactionName(route);\n }\n\n const activeSpan = getActiveSpan();\n const rootSpan = activeSpan && getRootSpan(activeSpan);\n\n _updateSpanAttributesForParametrizedUrl(route, rootSpan);\n }),\n );\n\n public navEnd$: Observable<Event> = this._router.events.pipe(\n filter(\n event => event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError,\n ),\n tap(() => {\n if (this._routingSpan) {\n runOutsideAngular(() => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n this._routingSpan!.end();\n });\n this._routingSpan = null;\n }\n }),\n );\n\n private _routingSpan: Span | null;\n\n private _subscription: Subscription;\n\n /**\n * @see _isPageloadOngoing()\n */\n private _pageloadOngoing: boolean;\n\n public constructor(private readonly _router: Router) {\n this._routingSpan = null;\n this._pageloadOngoing = true;\n\n this._subscription = new Subscription();\n\n this._subscription.add(this.navStart$.subscribe());\n this._subscription.add(this.resEnd$.subscribe());\n this._subscription.add(this.navEnd$.subscribe());\n }\n\n /**\n * This is used to prevent memory leaks when the root view is created and destroyed multiple times,\n * since `subscribe` callbacks capture `this` and prevent many resources from being GC'd.\n */\n public ngOnDestroy(): void {\n this._subscription.unsubscribe();\n }\n\n /**\n * We only _avoid_ creating a navigation root span in one case:\n *\n * There is an ongoing pageload span AND the router didn't yet emit the first navigation start event\n *\n * The first navigation start event will create the child routing span\n * and update the pageload root span name on ResolveEnd.\n *\n * There's an edge case we need to avoid here: If the router fires the first navigation start event\n * _after_ the pageload root span finished. This is why we check for the pageload root span.\n * Possible real-world scenario: Angular application and/or router is bootstrapped after the pageload\n * idle root span finished\n *\n * The overall rationale is:\n * - if we already avoided creating a navigation root span once, we don't avoid it again\n * (i.e. set `_pageloadOngoing` to `false`)\n * - if `_pageloadOngoing` is already `false`, create a navigation root span\n * - if there's no active/pageload root span, create a navigation root span\n * - only if there's an ongoing pageload root span AND `_pageloadOngoing` is still `true,\n * don't create a navigation root span\n */\n private _isPageloadOngoing(): boolean {\n if (!this._pageloadOngoing) {\n // pageload is already finished, no need to update\n return false;\n }\n\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n this._pageloadOngoing = false;\n return false;\n }\n\n const rootSpan = getRootSpan(activeSpan);\n\n this._pageloadOngoing = spanToJSON(rootSpan).op === 'pageload';\n return this._pageloadOngoing;\n }\n}\n\nconst UNKNOWN_COMPONENT = 'unknown';\n\n/**\n * A directive that can be used to capture initialization lifecycle of the whole component.\n */\n@Directive({ selector: '[trace]' })\nexport class TraceDirective implements OnInit, AfterViewInit {\n @Input('trace') public componentName?: string;\n\n private _tracingSpan?: Span;\n\n /**\n * Implementation of OnInit lifecycle method\n * @inheritdoc\n */\n public ngOnInit(): void {\n if (!this.componentName) {\n this.componentName = UNKNOWN_COMPONENT;\n }\n\n if (getActiveSpan()) {\n this._tracingSpan = startInactiveSpan({\n name: `<${this.componentName}>`,\n op: ANGULAR_INIT_OP,\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_directive' },\n });\n }\n }\n\n /**\n * Implementation of AfterViewInit lifecycle method\n * @inheritdoc\n */\n public ngAfterViewInit(): void {\n if (this._tracingSpan) {\n this._tracingSpan.end();\n }\n }\n}\n\n/**\n * A module serves as a single compilation unit for the `TraceDirective` and can be re-used by any other module.\n */\n@NgModule({\n declarations: [TraceDirective],\n exports: [TraceDirective],\n})\nexport class TraceModule {}\n\ninterface TraceClassOptions {\n /**\n * Name of the class\n */\n name?: string;\n}\n\n/**\n * Decorator function that can be used to capture initialization lifecycle of the whole component.\n */\nexport function TraceClass(options?: TraceClassOptions): ClassDecorator {\n let tracingSpan: Span;\n\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n return target => {\n const originalOnInit = target.prototype.ngOnInit;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n target.prototype.ngOnInit = function (...args: any[]): ReturnType<typeof originalOnInit> {\n tracingSpan = startInactiveSpan({\n onlyIfParent: true,\n name: `<${options && options.name ? options.name : 'unnamed'}>`,\n op: ANGULAR_INIT_OP,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_class_decorator',\n },\n });\n\n if (originalOnInit) {\n return originalOnInit.apply(this, args);\n }\n };\n\n const originalAfterViewInit = target.prototype.ngAfterViewInit;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n target.prototype.ngAfterViewInit = function (...args: any[]): ReturnType<typeof originalAfterViewInit> {\n if (tracingSpan) {\n tracingSpan.end();\n }\n if (originalAfterViewInit) {\n return originalAfterViewInit.apply(this, args);\n }\n };\n };\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n}\n\ninterface TraceMethodOptions {\n /**\n * Name of the method (is added to the tracing span)\n */\n name?: string;\n}\n\n/**\n * Decorator function that can be used to capture a single lifecycle methods of the component.\n */\nexport function TraceMethod(options?: TraceMethodOptions): MethodDecorator {\n // eslint-disable-next-line @typescript-eslint/ban-types\n return (target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor) => {\n const originalMethod = descriptor.value;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n descriptor.value = function (...args: any[]): ReturnType<typeof originalMethod> {\n const now = timestampInSeconds();\n\n startInactiveSpan({\n onlyIfParent: true,\n name: `<${options && options.name ? options.name : 'unnamed'}>`,\n op: `${ANGULAR_OP}.${String(propertyKey)}`,\n startTime: now,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.angular.trace_method_decorator',\n },\n }).end(now);\n\n if (originalMethod) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalMethod.apply(this, args);\n }\n };\n return descriptor;\n };\n}\n\n/**\n * Takes the parameterized route from a given ActivatedRouteSnapshot and concatenates the snapshot's\n * child route with its parent to produce the complete parameterized URL of the activated route.\n * This happens recursively until the last child (i.e. the end of the URL) is reached.\n *\n * @param route the ActivatedRouteSnapshot of which its path and its child's path is concatenated\n *\n * @returns the concatenated parameterized route string\n */\nexport function getParameterizedRouteFromSnapshot(route?: ActivatedRouteSnapshot | null): string {\n const parts: string[] = [];\n\n let currentRoute = route && route.firstChild;\n while (currentRoute) {\n const path = currentRoute && currentRoute.routeConfig && currentRoute.routeConfig.path;\n if (path === null || path === undefined) {\n break;\n }\n\n parts.push(path);\n currentRoute = currentRoute.firstChild;\n }\n\n const fullPath = parts.filter(part => part).join('/');\n return fullPath ? `/${fullPath}/` : '/';\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["browserInit","originalBrowserTracingIntegration"],"mappings":";;;;;;;;;;;;;AAAA;;;;;;;AAOG;AAIH;AACO,MAAM,cAAc,GAAG,OAAO,gBAAgB,KAAK,WAAW,GAAG,IAAI,GAAG,gBAAgB;;ACJ/F;;AAEG;AACG,SAAU,IAAI,CAAC,OAAuB,EAAA;AAC1C,IAAA,MAAM,IAAI,GAAG;;;;;;;QAOX,mBAAmB,EAAE,sBAAsB,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,WAAW,IAAG;AACxE,YAAA,OAAO,WAAW,CAAC,IAAI,KAAK,kBAAkB,CAAC;AACjD,SAAC,CAAC;AACF,QAAA,GAAG,OAAO;KACX,CAAC;AAEF,IAAA,gBAAgB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAElC,IAAA,yBAAyB,EAAE,CAAC;IAC5BA,MAAW,CAAC,IAAI,CAAC,CAAC;AACpB,CAAC;AAED,SAAS,yBAAyB,GAAA;IAChC,MAAM,uBAAuB,GAAG,EAAE,CAAC;IAEnC,MAAM,cAAc,GAAG,OAAO,IAAI,OAAO,CAAC,KAAK,GAAG,QAAQ,CAAC,OAAO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