138 lines
7.5 KiB
JavaScript
138 lines
7.5 KiB
JavaScript
/* Metro module 865; source: unknown; dependencies: [831, 866, 846, 857, 828, 848, 844, 863, 829] */
|
|
import * as Module00831Module from './module-00831.js'; /* Metro dependency 831 */
|
|
import * as Module00844Module from './module-00844.js'; /* Metro dependency 844 */
|
|
import * as Module00857Module from './module-00857.js'; /* Metro dependency 857 */
|
|
|
|
function _fun9311(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:992:6, offset: 0x00d62c55, size: 140 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const getDynamicSamplingContextFromClient2 = getDynamicSamplingContextFromClient;
|
|
const getDynamicSamplingContextFromSpan2 = getDynamicSamplingContextFromSpan;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports.freezeDscOnSpan = freezeDscOnSpan;
|
|
exports.getDynamicSamplingContextFromClient = getDynamicSamplingContextFromClient2;
|
|
exports.getDynamicSamplingContextFromScope = getDynamicSamplingContextFromScope;
|
|
exports.getDynamicSamplingContextFromSpan = getDynamicSamplingContextFromSpan2;
|
|
exports.spanToBaggageHeader = spanToBaggageHeader;
|
|
function getDynamicSamplingContextFromClient(a0, a1) { // fn#9312, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:992:110, offset: 0x00d62ce1, size: 166 bytes, params: 3, frame: 17
|
|
const options = a1.getOptions();
|
|
const publicKey = (a1.getDsn() || ({})).publicKey;
|
|
const object = {};
|
|
object.environment = options.environment || (require(866) /* metro dependency 866 */).DEFAULT_ENVIRONMENT;
|
|
object.release = options.release;
|
|
object.public_key = publicKey;
|
|
object.trace_id = a0;
|
|
object.org_id = (require(846) /* metro dependency 846 */).extractOrgIdFromClient(a1);
|
|
a1.emit('createDsc', object);
|
|
return object;
|
|
}
|
|
|
|
function getDynamicSamplingContextFromSpan(a0) { // fn#9313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:992:383, offset: 0x00d62d87, size: 621 bytes, params: 2, frame: 27
|
|
var r0;
|
|
var r15;
|
|
var r3;
|
|
var r5;
|
|
var rootSpan;
|
|
var value5;
|
|
var data;
|
|
var spanContext;
|
|
var traceState;
|
|
var property;
|
|
var getDynamicSamplingContextFromClientBinding;
|
|
var dynamicSamplingContextFromClientBinding;
|
|
var description;
|
|
var moduleValue5;
|
|
var String;
|
|
var moduleValue6;
|
|
var scope;
|
|
const applyLocalSampleRateToDsc2 = applyLocalSampleRateToDsc;
|
|
var value;
|
|
const value2 = undefined;
|
|
const client = (Module00857Module).getClient();
|
|
if (client) {
|
|
rootSpan = (require(828) /* metro dependency 828 */).getRootSpan(a0);
|
|
value5 = (require(828) /* metro dependency 828 */).spanToJSON(rootSpan);
|
|
data = value5.data;
|
|
spanContext = rootSpan.spanContext;
|
|
traceState = Reflect.apply(spanContext, rootSpan, []).traceState;
|
|
r0 = traceState == null ? value2 : traceState.get('sentry.sample_rate');
|
|
r0 = r0 ?? data[(require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];
|
|
if (r0 == null) {
|
|
property = data[(require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE];
|
|
}
|
|
property = rootSpan[env0_2];
|
|
if (property) {
|
|
applyLocalSampleRateToDsc2(property);
|
|
return property;
|
|
}
|
|
r15 = traceState == null ? value2 : traceState.get('sentry.dsc');
|
|
r3 = r15 && (require(844) /* metro dependency 844 */).baggageHeaderToDynamicSamplingContext(r15);
|
|
if (r3) {
|
|
applyLocalSampleRateToDsc2(r3);
|
|
return r3;
|
|
}
|
|
getDynamicSamplingContextFromClientBinding = getDynamicSamplingContextFromClient;
|
|
spanContext = a0.spanContext;
|
|
dynamicSamplingContextFromClientBinding = getDynamicSamplingContextFromClientBinding(Reflect.apply(spanContext,
|
|
a0,
|
|
[]).traceId, client);
|
|
property = data[(require(848) /* metro dependency 848 */).SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];
|
|
description = value5.description;
|
|
if (property !== 'url' && description) {
|
|
dynamicSamplingContextFromClientBinding.transaction = description;
|
|
}
|
|
moduleValue5 = require(863) /* metro dependency 863 */;
|
|
if (moduleValue5.hasSpansEnabled()) {
|
|
String = global.String;
|
|
moduleValue6 = require(828) /* metro dependency 828 */;
|
|
dynamicSamplingContextFromClientBinding.sampled = String(moduleValue6.spanIsSampled(rootSpan));
|
|
r5 = traceState == null ? value2 : traceState.get('sentry.sample_rand');
|
|
if (r5 == null) {
|
|
value = require(829) /* metro dependency 829 */;
|
|
scope = value.getCapturedScopesOnSpan(rootSpan).scope;
|
|
r5 = scope == null ? value2 : scope.getPropagationContext().sampleRand.toString();
|
|
}
|
|
dynamicSamplingContextFromClientBinding.sample_rand = r5;
|
|
}
|
|
applyLocalSampleRateToDsc2(dynamicSamplingContextFromClientBinding);
|
|
client.emit('createDsc', dynamicSamplingContextFromClientBinding, rootSpan);
|
|
return dynamicSamplingContextFromClientBinding;
|
|
}
|
|
return {};
|
|
function applyLocalSampleRateToDsc(a0) { // fn#9314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:992:747, owner: getDynamicSamplingContextFromSpan.applyLocalSampleRateToDsc, offset: 0x00d62ff4, size: 76 bytes, params: 2, frame: 13
|
|
if (!(typeof env0_0 !== 'number' && typeof env0_0 !== 'string')) {
|
|
a0.sample_rate = '' + env0_0;
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
}
|
|
|
|
function freezeDscOnSpan(a0, a1) { // fn#9315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:992:1540, offset: 0x00d63040, size: 49 bytes, params: 3, frame: 16
|
|
(Module00831Module).addNonEnumerableProperty(a0, env0_2, a1);
|
|
}
|
|
|
|
function getDynamicSamplingContextFromScope(a0, a1) { // fn#9316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:992:1730, offset: 0x00d63071, size: 48 bytes, params: 3, frame: 14
|
|
var r0;
|
|
let value = a1.getPropagationContext();
|
|
const dsc = value.dsc;
|
|
if (dsc) {
|
|
r0 = dsc;
|
|
} else {
|
|
value = getDynamicSamplingContextFromClient(value.traceId, a0);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function spanToBaggageHeader(a0) { // fn#9317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:992:1967, offset: 0x00d630a1, size: 50 bytes, params: 2, frame: 13
|
|
return (Module00844Module).dynamicSamplingContextToSentryBaggageHeader(getDynamicSamplingContextFromSpan(a0));
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun9311, 865, [831, 866, 846, 857, 828, 848, 844, 863,
|
|
829]) /* metro module 865, dependencies: [831, 866, 846, 857, 828, 848, 844, 863, 829] */;
|