329 lines
15 KiB
JavaScript
329 lines
15 KiB
JavaScript
/* Metro module 1101; source: unknown; dependencies: [77, 1041, 1081, 1085, 1084, 1089, 1086, 1088, 1087, 1102, 826, 1080, 1036] */
|
|
import * as Module00077Module from './module-00077.js'; /* Metro dependency 77 */
|
|
import * as Module00826Module from './module-00826.js'; /* Metro dependency 826 */
|
|
import * as Module01041Module from './module-01041.js'; /* Metro dependency 1041 */
|
|
import * as Module01081Module from './module-01081.js'; /* Metro dependency 1081 */
|
|
import * as BrowserApiErrorsIntegrationModule from './module-01084-browserApiErrorsIntegration.js'; /* Metro dependency 1084 */
|
|
import * as BreadcrumbsIntegrationModule from './module-01085-breadcrumbsIntegration.js'; /* Metro dependency 1085 */
|
|
import * as Module01086Module from './module-01086.js'; /* Metro dependency 1086 */
|
|
import * as LinkedErrorsIntegrationModule from './module-01087-linkedErrorsIntegration.js'; /* Metro dependency 1087 */
|
|
import * as HttpContextIntegrationModule from './module-01088-httpContextIntegration.js'; /* Metro dependency 1088 */
|
|
import * as BrowserSessionIntegrationModule from './module-01089-browserSessionIntegration.js'; /* Metro dependency 1089 */
|
|
import * as Module01102Module from './module-01102.js'; /* Metro dependency 1102 */
|
|
|
|
function _fun12318(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#12318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1228:6, offset: 0x00dc74d4, size: 319 bytes, params: 8, frame: 24
|
|
const env0_0 = require;
|
|
const addPreviousTraceSpanLink2 = addPreviousTraceSpanLink;
|
|
const storePreviousTraceInSessionStorage2 = storePreviousTraceInSessionStorage;
|
|
const getPreviousTraceFromSessionStorage2 = getPreviousTraceFromSessionStorage;
|
|
const closure4 = function(a0) {
|
|
return a0.traceFlags === 1;
|
|
};
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
Module01041Module;
|
|
Module01081Module;
|
|
BreadcrumbsIntegrationModule;
|
|
BrowserApiErrorsIntegrationModule;
|
|
BrowserSessionIntegrationModule;
|
|
Module01086Module;
|
|
HttpContextIntegrationModule;
|
|
LinkedErrorsIntegrationModule;
|
|
Module01102Module;
|
|
exports.PREVIOUS_TRACE_KEY = 'sentry_previous_trace';
|
|
exports.PREVIOUS_TRACE_MAX_DURATION = 3600;
|
|
exports.PREVIOUS_TRACE_TMP_SPAN_ATTRIBUTE = 'sentry.previous_trace';
|
|
exports.addPreviousTraceSpanLink = addPreviousTraceSpanLink2;
|
|
exports.getPreviousTraceFromSessionStorage = getPreviousTraceFromSessionStorage2;
|
|
exports.linkTraces = linkTraces;
|
|
exports.spanContextSampled = closure4;
|
|
exports.storePreviousTraceInSessionStorage = storePreviousTraceInSessionStorage2;
|
|
function addPreviousTraceSpanLink(a0, a1, a2) { // fn#12319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1228:235, offset: 0x00dc7613, size: 628 bytes, params: 4, frame: 29
|
|
var sample_rate;
|
|
var r2;
|
|
var r0;
|
|
var Number;
|
|
var dsc;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var data;
|
|
var value8;
|
|
var property;
|
|
var moduleValue2;
|
|
var SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE;
|
|
var value9;
|
|
var error;
|
|
var value10;
|
|
var traceId;
|
|
var debug;
|
|
var log;
|
|
var JSON;
|
|
var stringify;
|
|
var Object;
|
|
var addLink;
|
|
var object;
|
|
var binding;
|
|
var setAttribute;
|
|
var spanId;
|
|
let value = a0;
|
|
const value3 = undefined;
|
|
const value4 = require(dependencyMap[10]).spanToJSON(a1);
|
|
const object3 = {};
|
|
object3.spanContext = a1.spanContext();
|
|
object3.startTimestamp = value4.start_timestamp;
|
|
try {
|
|
Number = global.Number;
|
|
dsc = a2.dsc;
|
|
value5 = dsc == null;
|
|
sample_rate = value5 ? value3 : dsc.sample_rate;
|
|
value6 = Number(sample_rate);
|
|
value7 = value6 != null;
|
|
if (value7) {
|
|
r2 = value6;
|
|
} else {
|
|
Number = global.Number;
|
|
data = value4.data;
|
|
value8 = data == null;
|
|
if (value8) {
|
|
r2 = value3;
|
|
} else {
|
|
property = dependencyMap[10];
|
|
moduleValue2 = require(property);
|
|
SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = moduleValue2.SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE;
|
|
property = data[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];
|
|
r2 = property;
|
|
}
|
|
value9 = Number(r2);
|
|
r2 = value9;
|
|
}
|
|
} catch (error) {
|
|
value10 = 0;
|
|
r2 = value10;
|
|
}
|
|
object3.sampleRate = r2;
|
|
object3.sampleRand = a2.sampleRand;
|
|
if (value) {
|
|
spanContext = value.spanContext;
|
|
traceId = spanContext.traceId;
|
|
if (traceId === value4.trace_id) {
|
|
r0 = value;
|
|
} else if (global.Date.now() / 1000 - value.startTimestamp <= 3600) {
|
|
if (require(dependencyMap[11]).DEBUG_BUILD) {
|
|
debug = require(dependencyMap[10]).debug;
|
|
log = debug.log;
|
|
JSON = global.JSON;
|
|
value = JSON.stringify(spanContext);
|
|
JSON = global.JSON;
|
|
stringify = JSON.stringify;
|
|
Object = global.Object;
|
|
Reflect.apply(log, debug,
|
|
['Adding previous_trace `' + value + '` link to span `' + Reflect.apply(stringify,
|
|
JSON,
|
|
[Object.assign({op: value4.op}, a1.spanContext())]) + '`']);
|
|
}
|
|
addLink = a1.addLink;
|
|
object = {context: spanContext};
|
|
binding = Module00077Module;
|
|
object.attributes = binding({}, require(dependencyMap[10]).SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE,
|
|
'previous_trace');
|
|
Reflect.apply(addLink, a1, [object]);
|
|
setAttribute = a1.setAttribute;
|
|
binding = env0_4;
|
|
traceId = spanContext.traceId;
|
|
spanId = spanContext.spanId;
|
|
value = spanContextSampled(spanContext);
|
|
Reflect.apply(setAttribute, a1, [binding, '' + traceId + '-' + spanId + '-' + (value ? 1 : 0)]);
|
|
r0 = object3;
|
|
} else {
|
|
r0 = object3;
|
|
}
|
|
return r0;
|
|
}
|
|
return object3;
|
|
}
|
|
|
|
function storePreviousTraceInSessionStorage(a0) { // fn#12320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1228:1070, offset: 0x00dc7887, size: 163 bytes, params: 2, frame: 16
|
|
var value;
|
|
var property;
|
|
var moduleValue;
|
|
var WINDOW;
|
|
var sessionStorage;
|
|
var setItem;
|
|
var binding;
|
|
var JSON;
|
|
var value2;
|
|
var error;
|
|
var DEBUG_BUILD;
|
|
var debug;
|
|
try {
|
|
value = environment;
|
|
property = dependencyMap[12];
|
|
moduleValue = require(property);
|
|
WINDOW = moduleValue.WINDOW;
|
|
sessionStorage = WINDOW.sessionStorage;
|
|
setItem = sessionStorage.setItem;
|
|
binding = env0_3;
|
|
JSON = global.JSON;
|
|
value2 = JSON.stringify(a0);
|
|
Reflect.apply(setItem, sessionStorage, [binding, value2]);
|
|
} catch (error) {
|
|
DEBUG_BUILD = require(dependencyMap[11]).DEBUG_BUILD;
|
|
if (DEBUG_BUILD) {
|
|
debug = require(dependencyMap[10]).debug;
|
|
debug.warn('Could not store previous trace in sessionStorage', error);
|
|
}
|
|
}
|
|
}
|
|
|
|
function getPreviousTraceFromSessionStorage() { // fn#12321, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1228:1287, offset: 0x00dc792a, size: 96 bytes, params: 1, frame: 14
|
|
var r3;
|
|
var value2;
|
|
var property;
|
|
var moduleValue;
|
|
var WINDOW;
|
|
var sessionStorage;
|
|
var value3;
|
|
var getItem;
|
|
var binding;
|
|
var value4;
|
|
var JSON;
|
|
var value5;
|
|
var error;
|
|
const value = undefined;
|
|
try {
|
|
value2 = environment;
|
|
property = dependencyMap[12];
|
|
moduleValue = require(property);
|
|
WINDOW = moduleValue.WINDOW;
|
|
sessionStorage = WINDOW.sessionStorage;
|
|
value3 = sessionStorage == null;
|
|
if (value3) {
|
|
r3 = value;
|
|
} else {
|
|
getItem = sessionStorage.getItem;
|
|
binding = env0_3;
|
|
value4 = Reflect.apply(getItem, sessionStorage, [binding]);
|
|
r3 = value4;
|
|
}
|
|
JSON = global.JSON;
|
|
value5 = JSON.parse(r3);
|
|
} catch (error) {
|
|
return value;
|
|
}
|
|
return value5;
|
|
}
|
|
|
|
function linkTraces(a0, {linkPreviousTrace, consistentTraceSampling}) { // fn#12323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1228:1738, offset: 0x00dc799c, size: 113 bytes, params: 3, frame: 16
|
|
let value = linkPreviousTrace === 'session-storage';
|
|
if (value) {
|
|
value = getPreviousTraceFromSessionStorage();
|
|
}
|
|
a0.on('spanStart', _fun12324);
|
|
if (consistentTraceSampling) {
|
|
a0.on('beforeSampling', _fun12325);
|
|
}
|
|
function _fun12324(a0) { // fn#12324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1228:1907, offset: 0x00dc7a0d, size: 124 bytes, params: 2, frame: 17
|
|
const getRootSpan = Module00826Module.getRootSpan;
|
|
if (Reflect.apply(getRootSpan, Module00826Module, [a0]) === a0) {
|
|
env0_1 = addPreviousTraceSpanLink(env0_1, a0, Module00826Module.getCurrentScope().getPropagationContext());
|
|
if (result) {
|
|
storePreviousTraceInSessionStorage(env0_1);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun12325(a0) { // fn#12325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1228:2122, offset: 0x00dc7a89, size: 351 bytes, params: 2, frame: 29
|
|
var value2;
|
|
var currentScope;
|
|
var propagationContext;
|
|
var setPropagationContext;
|
|
var Object;
|
|
var assign;
|
|
var Object2;
|
|
var assign2;
|
|
var dsc;
|
|
var object2;
|
|
var String;
|
|
var sampleRate;
|
|
var spanContextSampledBinding;
|
|
var spanContext;
|
|
var spanAttributes;
|
|
var binding;
|
|
const SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE = (require(826) /* metro dependency 826 */).SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE;
|
|
if (env0_1) {
|
|
value2 = environment.__proto__;
|
|
currentScope = (require(826) /* metro dependency 826 */).getCurrentScope();
|
|
propagationContext = currentScope.getPropagationContext();
|
|
if (Module00077Module) {
|
|
if (!propagationContext.parentSpanId) {
|
|
setPropagationContext = currentScope.setPropagationContext;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
Object2 = global.Object;
|
|
assign2 = Object2.assign;
|
|
dsc = propagationContext.dsc;
|
|
object2 = {};
|
|
String = global.String;
|
|
sampleRate = env0_1.sampleRate;
|
|
object2.sample_rate = String(sampleRate);
|
|
String = global.String;
|
|
spanContextSampledBinding = spanContextSampled;
|
|
spanContext = env0_1.spanContext;
|
|
object2.sampled = String(spanContextSampledBinding(spanContext));
|
|
Reflect.apply(setPropagationContext, currentScope, [Reflect.apply(assign, Object, [{},
|
|
propagationContext,
|
|
{dsc: Reflect.apply(assign2, Object2, [{}, dsc, object2]), sampleRand: env0_1.sampleRand}])]);
|
|
spanContext = env0_1.spanContext;
|
|
a0.parentSampled = spanContextSampledBinding(spanContext);
|
|
sampleRate = env0_1.sampleRate;
|
|
a0.parentSampleRate = sampleRate;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
spanAttributes = a0.spanAttributes;
|
|
binding = env1_2;
|
|
sampleRate = env0_1.sampleRate;
|
|
a0.spanAttributes = Reflect.apply(assign, Object, [{}, spanAttributes, binding({},
|
|
SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE, sampleRate)]);
|
|
}
|
|
} else {
|
|
setPropagationContext = currentScope.setPropagationContext;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
Object2 = global.Object;
|
|
assign2 = Object2.assign;
|
|
dsc = propagationContext.dsc;
|
|
object2 = {};
|
|
String = global.String;
|
|
sampleRate = env0_1.sampleRate;
|
|
object2.sample_rate = String(sampleRate);
|
|
String = global.String;
|
|
spanContextSampledBinding = spanContextSampled;
|
|
spanContext = env0_1.spanContext;
|
|
object2.sampled = String(spanContextSampledBinding(spanContext));
|
|
Reflect.apply(setPropagationContext, currentScope, [Reflect.apply(assign, Object, [{}, propagationContext,
|
|
{dsc: Reflect.apply(assign2, Object2, [{}, dsc, object2]), sampleRand: env0_1.sampleRand}])]);
|
|
spanContext = env0_1.spanContext;
|
|
a0.parentSampled = spanContextSampledBinding(spanContext);
|
|
sampleRate = env0_1.sampleRate;
|
|
a0.parentSampleRate = sampleRate;
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
spanAttributes = a0.spanAttributes;
|
|
binding = env1_2;
|
|
sampleRate = env0_1.sampleRate;
|
|
a0.spanAttributes = Reflect.apply(assign, Object, [{}, spanAttributes, binding({},
|
|
SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE, sampleRate)]);
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun12318, 1101, [77, 1041, 1081, 1085, 1084, 1089, 1086, 1088, 1087, 1102, 826, 1080,
|
|
1036]) /* metro module 1101, dependencies: [77, 1041, 1081, 1085, 1084, 1089, 1086, 1088, 1087, 1102, 826, 1080, 1036] */;
|