132 lines
4.3 KiB
JavaScript
132 lines
4.3 KiB
JavaScript
// Metro module 1030 (f1031).
|
|
import * as _classCallCheck from "./_classCallCheck";
|
|
import * as __createClass from "./_createClass";
|
|
import * as _possibleConstructorReturn from "./_possibleConstructorReturn";
|
|
import * as _getPrototypeOf from "./_getPrototypeOf";
|
|
import * as _get from "./_get";
|
|
import * as __inherits from "./_inherits";
|
|
import { WINDOW } from "./ignoreNextOnError";
|
|
import { applySdkMetadata, getSDKSource, _INTERNAL_flushLogsBuffer, _INTERNAL_flushMetricsBuffer, addAutoIpAddressToSession, Client } from "./Module817";
|
|
import * as _exceptionFromError from "./exceptionFromError_1031";
|
|
let BrowserClient;
|
|
let env844 = {};
|
|
env844[6] = function _isNativeReflectConstruct() {
|
|
let c12665_0;
|
|
try {
|
|
c12665_0 = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
} catch ($e) {}
|
|
const _isNativeReflectConstruct2 = function _isNativeReflectConstruct() {
|
|
return !!c12665_0;
|
|
};
|
|
env844[6] = _isNativeReflectConstruct2;
|
|
return _isNativeReflectConstruct2();
|
|
};
|
|
Object.defineProperty(exports, Symbol.toStringTag, {
|
|
value: "Module"
|
|
});
|
|
BrowserClient = function BrowserClient(a0) {
|
|
"use strict";
|
|
_classCallCheck(this, BrowserClient);
|
|
const r6 = {
|
|
release: typeof globalThis.__SENTRY_RELEASE__ === "string" ? __SENTRY_RELEASE__ : WINDOW.SENTRY_RELEASE?.id,
|
|
sendClientReports: true,
|
|
parentSpanIsAlwaysRootSpan: true,
|
|
...a0
|
|
};
|
|
applySdkMetadata(r6, "browser", ["browser"], WINDOW.SENTRY_SDK_SOURCE || getSDKSource());
|
|
if (r6._metadata?.sdk) {
|
|
r6._metadata.sdk.settings = {
|
|
infer_ip: r6.sendDefaultPii ? "auto" : "never",
|
|
...r6._metadata.sdk.settings
|
|
};
|
|
}
|
|
const r54 = [r6];
|
|
const r56 = _getPrototypeOf(BrowserClient);
|
|
const r61 = (0, env844[6])() ? Reflect.construct(r56, r54, _getPrototypeOf(this).constructor) : r56.apply(this, r54);
|
|
const r67 = _possibleConstructorReturn(this, r61);
|
|
const _options = r67._options;
|
|
const sendDefaultPii = _options.sendDefaultPii;
|
|
let sendClientReports2 = _options.sendClientReports;
|
|
const sendClientReports = sendClientReports2;
|
|
const { enableLogs, _experiments } = _options;
|
|
let enableMetrics = _options.enableMetrics;
|
|
if (enableMetrics == null) {
|
|
enableMetrics = _experiments?.enableMetrics;
|
|
}
|
|
if (enableMetrics == null) {
|
|
enableMetrics = true;
|
|
}
|
|
let c24018_3 = enableMetrics;
|
|
let document2 = WINDOW.document;
|
|
if (document2) {
|
|
if (!sendClientReports) {
|
|
sendClientReports2 = enableLogs;
|
|
}
|
|
if (!sendClientReports2) {
|
|
sendClientReports2 = enableMetrics;
|
|
}
|
|
document2 = sendClientReports2;
|
|
}
|
|
if (document2) {
|
|
WINDOW.document.addEventListener("visibilitychange", () => {
|
|
if (WINDOW.document.visibilityState === "hidden") {
|
|
if (sendClientReports) {
|
|
this._flushOutcomes();
|
|
}
|
|
if (enableLogs) {
|
|
_INTERNAL_flushLogsBuffer(this);
|
|
}
|
|
if (c24018_3) {
|
|
_INTERNAL_flushMetricsBuffer(this);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
if (sendDefaultPii) {
|
|
r67.on("beforeSendSession", addAutoIpAddressToSession);
|
|
}
|
|
return r67;
|
|
};
|
|
__inherits(BrowserClient, Client);
|
|
exports.BrowserClient = __createClass(BrowserClient, [{
|
|
key: "eventFromException",
|
|
value: function eventFromException(a0, a1) {
|
|
"use strict";
|
|
return _exceptionFromError.eventFromException(this._options.stackParser, a0, a1, this._options.attachStacktrace);
|
|
}
|
|
}, {
|
|
key: "eventFromMessage",
|
|
value: function eventFromMessage(a0) {
|
|
"use strict";
|
|
let r7 = arguments[1];
|
|
if (r7 === void 0) {
|
|
r7 = "info";
|
|
}
|
|
return _exceptionFromError.eventFromMessage(this._options.stackParser, a0, r7, arguments[2], this._options.attachStacktrace);
|
|
}
|
|
}, {
|
|
key: "_prepareEvent",
|
|
value: function _prepareEvent(a0, a1, a2, a3) {
|
|
"use strict";
|
|
const platform2 = a0.platform || "javascript";
|
|
a0.platform = platform2;
|
|
const _this = this;
|
|
let r13 = _get(_getPrototypeOf(BrowserClient.prototype), "_prepareEvent", this);
|
|
let c24019_1 = r13;
|
|
if (typeof r13 === "function") {
|
|
r13 = function(a0) {
|
|
return c24019_1.apply(_this, a0);
|
|
};
|
|
}
|
|
return r13([a0, a1, a2, a3]);
|
|
}
|
|
}]);
|
|
export function applyDefaultOptions(a0) {
|
|
return {
|
|
release: typeof globalThis.__SENTRY_RELEASE__ === "string" ? __SENTRY_RELEASE__ : WINDOW.SENTRY_RELEASE?.id,
|
|
sendClientReports: true,
|
|
parentSpanIsAlwaysRootSpan: true,
|
|
...a0
|
|
};
|
|
}
|