224 lines
9.9 KiB
React
224 lines
9.9 KiB
React
/* Metro module 877; source: unknown; dependencies: [5, 857, 878, 832, 833, 839, 847, 836, 874, 830, 854] */
|
|
function _fun9437(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#9437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:6, offset: 0x00d67619, size: 337 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const closure = captureCheckIn;
|
|
const closure2 = endSession;
|
|
const env0_2 = require(5) /* metro dependency 5 */;
|
|
const Object = global.Object;
|
|
const defineProperty = Object.defineProperty;
|
|
const Symbol = global.Symbol;
|
|
Reflect.apply(defineProperty, Object, [exports, Symbol.toStringTag, {value: 'Module'}]);
|
|
exports.addEventProcessor = addEventProcessor;
|
|
exports.captureCheckIn = closure;
|
|
exports.captureEvent = captureEvent;
|
|
exports.captureException = captureException;
|
|
exports.captureMessage = captureMessage;
|
|
exports.captureSession = captureSession;
|
|
exports.close = function(a0) {
|
|
return _close.apply(this, arguments);
|
|
};
|
|
exports.endSession = closure2;
|
|
exports.flush = function(a0) {
|
|
return _flush.apply(this, arguments);
|
|
};
|
|
exports.isEnabled = isEnabled_9454;
|
|
exports.isInitialized = isInitialized;
|
|
exports.lastEventId = lastEventId;
|
|
exports.setContext = setContext_9457;
|
|
exports.setExtra = setExtra;
|
|
exports.setExtras = setExtras;
|
|
exports.setTag = setTag;
|
|
exports.setTags = setTags;
|
|
exports.setUser = setUser;
|
|
exports.startSession = startSession;
|
|
exports.withMonitor = withMonitor;
|
|
}
|
|
|
|
function captureCheckIn(a0, a1) { // fn#9438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:47, offset: 0x00d6776a, size: 266 bytes, params: 3, frame: 17
|
|
const DEBUG_BUILD = (require(832) /* metro dependency 832 */).DEBUG_BUILD;
|
|
const debug = (require(833) /* metro dependency 833 */).debug;
|
|
const currentScope = (require(857) /* metro dependency 857 */).getCurrentScope();
|
|
const client = (require(857) /* metro dependency 857 */).getClient();
|
|
if (client) {
|
|
if (client.captureCheckIn) {
|
|
return client.captureCheckIn(a0, a1, currentScope);
|
|
}
|
|
if (DEBUG_BUILD) {
|
|
debug.warn('Cannot capture check-in. Client does not support sending check-ins.');
|
|
}
|
|
} else if (DEBUG_BUILD) {
|
|
debug.warn('Cannot capture check-in. No client defined.');
|
|
}
|
|
return (require(839) /* metro dependency 839 */).uuid4();
|
|
}
|
|
|
|
function _flush() { // fn#9439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:420, offset: 0x00d67874, size: 47 bytes, params: 1, frame: 14
|
|
return env0_2(_fun9441).apply(this, arguments);
|
|
}
|
|
|
|
function _close() { // fn#9442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:648, offset: 0x00d6794d, size: 47 bytes, params: 1, frame: 14
|
|
return env0_2(_fun9444).apply(this, arguments);
|
|
}
|
|
|
|
function endSession() { // fn#9445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:892, offset: 0x00d67a26, size: 131 bytes, params: 1, frame: 15
|
|
const isolationScope = (require(857) /* metro dependency 857 */).getIsolationScope();
|
|
const r5 = (require(857) /* metro dependency 857 */).getCurrentScope().getSession() || isolationScope.getSession();
|
|
if (r5) {
|
|
(require(854) /* metro dependency 854 */).closeSession(r5);
|
|
}
|
|
_sendSessionUpdate();
|
|
isolationScope.setSession();
|
|
}
|
|
|
|
function _sendSessionUpdate() { // fn#9446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:1072, offset: 0x00d67aa9, size: 89 bytes, params: 1, frame: 14
|
|
let value = require(857) /* metro dependency 857 */;
|
|
value = value.getIsolationScope();
|
|
const client = (require(857) /* metro dependency 857 */).getClient();
|
|
value = value.getSession();
|
|
if (value && client) {
|
|
client.captureSession(value);
|
|
}
|
|
}
|
|
|
|
function isEnabled_9454() { // fn#9454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:2131, offset: 0x00d67c82, size: 93 bytes, params: 1, frame: 12
|
|
var r0;
|
|
let value = undefined;
|
|
const client = (require(857) /* metro dependency 857 */).getClient();
|
|
value = (client == null ? value : client.getOptions().enabled) !== false;
|
|
if (value) {
|
|
value = client == null;
|
|
value = !(value || !client.getTransport());
|
|
r0 = value;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function startSession(a0) { // fn#9463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:2898, offset: 0x00d67e77, size: 282 bytes, params: 2, frame: 22
|
|
const value2 = undefined;
|
|
const isolationScope = (require(857) /* metro dependency 857 */).getIsolationScope();
|
|
const currentScope = (require(857) /* metro dependency 857 */).getCurrentScope();
|
|
const GLOBAL_OBJ = (require(830) /* metro dependency 830 */).GLOBAL_OBJ;
|
|
const userAgent = (GLOBAL_OBJ.navigator || ({})).userAgent;
|
|
const moduleValue3 = require(854) /* metro dependency 854 */;
|
|
const makeSession = moduleValue3.makeSession;
|
|
const Object = global.Object;
|
|
const session = Reflect.apply(makeSession, moduleValue3,
|
|
[Object.assign({user: currentScope.getUser() || isolationScope.getUser()},
|
|
userAgent && ({userAgent: userAgent}), a0)]);
|
|
const session2 = isolationScope.getSession();
|
|
if ((session2 == null ? value2 : session2.status) === 'ok') {
|
|
moduleValue3.updateSession(session2, {status: 'exited'});
|
|
}
|
|
endSession();
|
|
isolationScope.setSession(session);
|
|
return session;
|
|
}
|
|
|
|
function withMonitor(a0, a1, a2) { // fn#9464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:3275, offset: 0x00d67f91, size: 75 bytes, params: 4, frame: 12
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const env0_2 = a2;
|
|
return (require(857) /* metro dependency 857 */).withIsolationScope(_fun9469);
|
|
}
|
|
|
|
function* _fun9441(a0) { // fn#9441, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:455, offset: 0x00d678ac, size: 161 bytes, params: 2, frame: 15
|
|
var r1;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const client = env2_0(env2_1[1]).getClient();
|
|
if (client) {
|
|
r1 = client.flush(a0);
|
|
} else {
|
|
if (env2_0(env2_1[3]).DEBUG_BUILD) {
|
|
env2_0(env2_1[4]).debug.warn('Cannot flush events. No client defined.');
|
|
}
|
|
r1 = global.Promise.resolve(false);
|
|
}
|
|
return r1;
|
|
}
|
|
|
|
function* _fun9444(a0) { // fn#9444, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:683, offset: 0x00d67985, size: 161 bytes, params: 2, frame: 15
|
|
var r1;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const client = env2_0(env2_1[1]).getClient();
|
|
if (client) {
|
|
r1 = client.close(a0);
|
|
} else {
|
|
if (env2_0(env2_1[3]).DEBUG_BUILD) {
|
|
env2_0(env2_1[4]).debug.warn('Cannot flush events and disable SDK. No client defined.');
|
|
}
|
|
r1 = global.Promise.resolve(false);
|
|
}
|
|
return r1;
|
|
}
|
|
|
|
function runCallback() { // fn#9465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:3303, owner: withMonitor.runCallback, offset: 0x00d67fdc, size: 201 bytes, params: 1, frame: 18
|
|
var environment;
|
|
var r0;
|
|
var moduleValue2;
|
|
var error;
|
|
const closure = runCallbackFinishCheckIn;
|
|
let value = environment.__proto__;
|
|
const env0_0Binding = captureCheckIn({monitorSlug: env0_0, status: 'in_progress'}, importDefault);
|
|
const env0_1 = (require(847) /* metro dependency 847 */).timestampInSeconds();
|
|
try {
|
|
moduleValue2 = require();
|
|
} catch (error) {
|
|
closure('error');
|
|
throw error;
|
|
}
|
|
value = require(836) /* metro dependency 836 */;
|
|
if (value.isThenable(moduleValue2)) {
|
|
r0 = moduleValue2.then(function(a0) {
|
|
runCallbackFinishCheckIn('ok');
|
|
return a0;
|
|
}, _fun9468);
|
|
} else {
|
|
closure('ok');
|
|
r0 = moduleValue2;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun9469() { // fn#9469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:3779, offset: 0x00d6812e, size: 82 bytes, params: 1, frame: 13
|
|
var r0;
|
|
var value2;
|
|
var moduleValue;
|
|
if (importDefault == null) {
|
|
r0 = runCallback();
|
|
} else if (importDefault.isolateTrace) {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(874) /* metro dependency 874 */;
|
|
r0 = moduleValue.startNewTrace(runCallback);
|
|
} else {
|
|
r0 = runCallback();
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function runCallbackFinishCheckIn(a0) { // fn#9466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:3421, owner: withMonitor.runCallback.finishCheckIn, offset: 0x00d680a5, size: 91 bytes, params: 2, frame: 14
|
|
let value = environment.__proto__.__proto__;
|
|
const captureCheckInBinding = captureCheckIn;
|
|
const object2 = {};
|
|
object2.monitorSlug = env1_0;
|
|
object2.status = a0;
|
|
object2.checkInId = env0_0;
|
|
value = require(847) /* metro dependency 847 */;
|
|
value = value.timestampInSeconds();
|
|
object2.duration = value - env0_1;
|
|
captureCheckInBinding(object2);
|
|
}
|
|
|
|
function _fun9468(a0) { // fn#9468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1004:3673, offset: 0x00d68117, size: 23 bytes, params: 2, frame: 11
|
|
runCallbackFinishCheckIn('error');
|
|
throw a0;
|
|
}
|
|
|