423 lines
18 KiB
JavaScript
423 lines
18 KiB
JavaScript
/* Metro module 1126; source: unknown; dependencies: [65, 826, 1010, 1127] */
|
|
import Module00065 from './module-00065.js'; /* Metro dependency 65 */
|
|
import * as Module00826Module from './module-00826.js'; /* Metro dependency 826 */
|
|
|
|
function _fun12583(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#12583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1253:6, offset: 0x00dcf4bc, size: 151 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const closure = function(a0) {
|
|
return !(a0.samples.length <= 1);
|
|
};
|
|
const enrichAndroidProfileWithEventContext2 = enrichAndroidProfileWithEventContext;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
exports.isValidProfile = closure;
|
|
exports.findProfiledTransactionsFromEnvelope = findProfiledTransactionsFromEnvelope_12586;
|
|
exports.enrichCombinedProfileWithEventContext = enrichCombinedProfileWithEventContext;
|
|
exports.enrichAndroidProfileWithEventContext = enrichAndroidProfileWithEventContext2;
|
|
exports.createHermesProfilingEvent = function(a0) {
|
|
return {'platform': 'javascript', 'version': '1', profile: a0,
|
|
transaction: {active_thread_id: a0.active_thread_id}};
|
|
};
|
|
exports.addProfilesToEnvelope = function(a0, a1) {
|
|
var property;
|
|
var push;
|
|
var object;
|
|
var items;
|
|
var error;
|
|
if (a1.length) {
|
|
var iterator = a1[Symbol.iterator]();
|
|
var iterator2 = iterator.next;
|
|
var r2 = iterator;
|
|
var item2 = Reflect.apply(iterator2, r2, []);
|
|
var item = item2.value;
|
|
item2 = item2.done ? undefined : r2;
|
|
reducibleJoin4: while (true) {
|
|
if (item2 === undefined) {
|
|
return a0;
|
|
}
|
|
break reducibleJoin4;
|
|
}
|
|
reducibleLoop4: while (true) {
|
|
try {
|
|
property = a0[1];
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
push = property.push;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
object.type = 'profile';
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
items = [];
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
items[0] = object;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
items[1] = item;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
Reflect.apply(push, property, [items]);
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
r2 = item2;
|
|
item2 = Reflect.apply(iterator2, r2, []);
|
|
item = item2.value;
|
|
item2 = item2.done ? undefined : r2;
|
|
if (item2 === undefined) {
|
|
break reducibleLoop4;
|
|
}
|
|
continue reducibleLoop4;
|
|
}
|
|
}
|
|
return a0;
|
|
};
|
|
function enrichAndroidProfileWithEventContext(a0, a1, a2) { // fn#12585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1253:162, offset: 0x00dcf56d, size: 877 bytes, params: 4, frame: 22
|
|
var value15;
|
|
var date;
|
|
var value18;
|
|
var value19;
|
|
const Object = global.Object;
|
|
const assign = Object.assign;
|
|
const Object2 = global.Object;
|
|
const value = Object2.assign({}, a1);
|
|
const object = {};
|
|
const object2 = {};
|
|
const value3 = undefined;
|
|
object2.images = (require(1127) /* metro dependency 1127 */).getDebugMetadata();
|
|
object.debug_meta = object2;
|
|
let build_id = a1.build_id;
|
|
build_id = !build_id ? '' : build_id;
|
|
object.build_id = build_id;
|
|
object.device_cpu_frequencies = [];
|
|
let contexts = a2.contexts;
|
|
let device = contexts === null || value3 === contexts ? value3 : contexts.device;
|
|
let simulator = device === null || value3 === device ? value3 : device.simulator;
|
|
simulator = !!simulator && simulator;
|
|
object.device_is_emulator = simulator;
|
|
contexts = a2.contexts;
|
|
let r5 = (contexts === null || value3 === contexts ? value3 : contexts.device) && a2.contexts.device.locale;
|
|
r5 = !r5 ? '' : r5;
|
|
object.device_locale = r5;
|
|
contexts = a2.contexts;
|
|
device = contexts === null || value3 === contexts ? value3 : contexts.device;
|
|
let manufacturer = device === null || value3 === device ? value3 : device.manufacturer;
|
|
manufacturer = !manufacturer ? '' : manufacturer;
|
|
object.device_manufacturer = manufacturer;
|
|
contexts = a2.contexts;
|
|
device = contexts === null || value3 === contexts ? value3 : contexts.device;
|
|
let model = device === null || value3 === device ? value3 : device.model;
|
|
model = !model ? '' : model;
|
|
object.device_model = model;
|
|
contexts = a2.contexts;
|
|
let os = contexts === null || value3 === contexts ? value3 : contexts.os;
|
|
let name = os === null || value3 === os ? value3 : os.name;
|
|
name = !name ? '' : name;
|
|
object.device_os_name = name;
|
|
contexts = a2.contexts;
|
|
os = contexts === null || value3 === contexts ? value3 : contexts.os;
|
|
let version = os === null || value3 === os ? value3 : os.version;
|
|
version = !version ? '' : version;
|
|
object.device_os_version = version;
|
|
contexts = a2.contexts;
|
|
device = contexts === null || value3 === contexts ? value3 : contexts.device;
|
|
r5 = (device === null || value3 === device ? value3 : device.memory_size) && global.Number(a2.contexts.device.memory_size).toString(10);
|
|
r5 = !r5 ? '' : r5;
|
|
object.device_physical_memory_bytes = r5;
|
|
object.environment = a2.environment || (require(1010) /* metro dependency 1010 */).getDefaultEnvironment();
|
|
object.profile_id = a0;
|
|
const start_timestamp = a2.start_timestamp;
|
|
const Date = global.Date;
|
|
if (start_timestamp) {
|
|
value18 = 1000 * a2.start_timestamp;
|
|
value19 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
r5 = (date instanceof Object ? date : value19).toISOString();
|
|
} else {
|
|
value15 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
r5 = (date instanceof Object ? date : value15).toISOString();
|
|
}
|
|
object.timestamp = r5;
|
|
let release = a2.release;
|
|
release = !release ? '' : release;
|
|
object.release = release;
|
|
let dist = a2.dist;
|
|
dist = !dist ? '' : dist;
|
|
object.dist = dist;
|
|
let event_id = a2.event_id;
|
|
event_id = !event_id ? '' : event_id;
|
|
object.transaction_id = event_id;
|
|
let transaction = a2.transaction;
|
|
transaction = !transaction ? '' : transaction;
|
|
object.transaction_name = transaction;
|
|
contexts = a2.contexts;
|
|
const trace = contexts === null || value3 === contexts ? value3 : contexts.trace;
|
|
let trace_id = trace === null || value3 === trace ? value3 : trace.trace_id;
|
|
trace_id = !trace_id ? '' : trace_id;
|
|
object.trace_id = trace_id;
|
|
release = a2.release;
|
|
release = !release ? '' : release;
|
|
object.version_name = release;
|
|
dist = a2.dist;
|
|
dist = !dist ? '' : dist;
|
|
object.version_code = dist;
|
|
return Reflect.apply(assign, Object, [value, object]);
|
|
}
|
|
|
|
function findProfiledTransactionsFromEnvelope_12586(a0) { // fn#12586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1253:1727, offset: 0x00dcf8da, size: 57 bytes, params: 2, frame: 14
|
|
(Module00826Module).forEachEnvelopeItem(a0, _fun12587);
|
|
return [];
|
|
function _fun12587(a0, a1) { // fn#12587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1253:1823, offset: 0x00dcf913, size: 136 bytes, params: 3, frame: 16
|
|
var r4;
|
|
var trace;
|
|
var data;
|
|
var profile_id;
|
|
var length;
|
|
var value;
|
|
var value3;
|
|
var contexts;
|
|
var binding;
|
|
if (a1 === 'transaction') {
|
|
length = a0.length;
|
|
value = 1;
|
|
value3 = undefined;
|
|
if (value < length) {
|
|
r4 = value;
|
|
while (true) {
|
|
contexts = a0[r4].contexts;
|
|
if (contexts !== null) {
|
|
if (value3 === contexts) {
|
|
trace = value3;
|
|
break;
|
|
}
|
|
trace = contexts.trace;
|
|
break;
|
|
}
|
|
trace = value3;
|
|
if (trace === null) {
|
|
data = value3;
|
|
continue;
|
|
}
|
|
if (value3 === trace) {
|
|
data = value3;
|
|
continue;
|
|
}
|
|
data = trace.data;
|
|
if (data === null) {
|
|
profile_id = value3;
|
|
continue;
|
|
}
|
|
if (value3 === data) {
|
|
profile_id = value3;
|
|
continue;
|
|
}
|
|
profile_id = data.profile_id;
|
|
if (!profile_id) {
|
|
continue;
|
|
}
|
|
binding = env0_0;
|
|
binding.push(a0[r4]);
|
|
value = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
|
|
length = a0.length;
|
|
if (value < length) {
|
|
r4 = value;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function enrichCombinedProfileWithEventContext(a0, a1, a2) { // fn#12588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1253:2091, offset: 0x00dcf99b, size: 987 bytes, params: 4, frame: 26
|
|
var trace;
|
|
var trace_id;
|
|
var r7;
|
|
var os;
|
|
var r11;
|
|
var device;
|
|
var simulator;
|
|
var value;
|
|
var isValidProfileBinding;
|
|
var value2;
|
|
var contexts;
|
|
var Object;
|
|
var assign;
|
|
var value4;
|
|
var object;
|
|
var value5;
|
|
var start_timestamp;
|
|
var Date;
|
|
var value6;
|
|
var date;
|
|
var value9;
|
|
var value10;
|
|
var object2;
|
|
var object3;
|
|
var object4;
|
|
var transaction;
|
|
var object5;
|
|
var items2;
|
|
var concat;
|
|
var binding;
|
|
var debug_meta;
|
|
if ('js_profile' in a1) {
|
|
return enrichAndroidProfileWithEventContext(a0, a1, a2);
|
|
}
|
|
let profile = a1.profile;
|
|
if (profile) {
|
|
isValidProfileBinding = isValidProfile;
|
|
profile = a1.profile;
|
|
value2 = undefined;
|
|
if (isValidProfileBinding(profile)) {
|
|
contexts = a2.contexts;
|
|
trace = contexts === null || value2 === contexts ? value2 : contexts.trace;
|
|
trace_id = trace === null || value2 === trace ? value2 : trace.trace_id;
|
|
trace_id = !trace_id ? '' : trace_id;
|
|
if (trace_id != null) {
|
|
trace_id.length;
|
|
}
|
|
Object = global.Object;
|
|
assign = Object.assign;
|
|
value4 = global.Object.assign({}, a1);
|
|
object = {event_id: a0};
|
|
value5 = '';
|
|
object.runtime = {'name': 'hermes', 'version': ''};
|
|
start_timestamp = a2.start_timestamp;
|
|
Date = global.Date;
|
|
if (start_timestamp) {
|
|
value9 = 1000 * a2.start_timestamp;
|
|
value10 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
r7 = (date instanceof Object ? date : value10).toISOString();
|
|
} else {
|
|
value6 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
r7 = (date instanceof Object ? date : value6).toISOString();
|
|
}
|
|
object.timestamp = r7;
|
|
r7 = a2.release || value5;
|
|
object.release = r7;
|
|
r7 = a2.environment || (require(1010) /* metro dependency 1010 */).getDefaultEnvironment();
|
|
object.environment = r7;
|
|
object2 = {};
|
|
contexts = a2.contexts;
|
|
os = contexts === null || value2 === contexts ? value2 : contexts.os;
|
|
r11 = (os === null || value2 === os ? value2 : os.name) || value5;
|
|
object2.name = r11;
|
|
contexts = a2.contexts;
|
|
os = contexts === null || value2 === contexts ? value2 : contexts.os;
|
|
r11 = (os === null || value2 === os ? value2 : os.version) || value5;
|
|
object2.version = r11;
|
|
contexts = a2.contexts;
|
|
os = contexts === null || value2 === contexts ? value2 : contexts.os;
|
|
r11 = (os === null || value2 === os ? value2 : os.build) || value5;
|
|
object2.build_number = r11;
|
|
object.os = object2;
|
|
object3 = {};
|
|
contexts = a2.contexts;
|
|
device = contexts === null || value2 === contexts ? value2 : contexts.device;
|
|
r11 = device && a2.contexts.device.locale;
|
|
r11 = !r11 ? value5 : r11;
|
|
object3.locale = r11;
|
|
contexts = a2.contexts;
|
|
device = contexts === null || value2 === contexts ? value2 : contexts.device;
|
|
r11 = (device === null || value2 === device ? value2 : device.model) || value5;
|
|
object3.model = r11;
|
|
contexts = a2.contexts;
|
|
device = contexts === null || value2 === contexts ? value2 : contexts.device;
|
|
r11 = (device === null || value2 === device ? value2 : device.manufacturer) || value5;
|
|
object3.manufacturer = r11;
|
|
contexts = a2.contexts;
|
|
device = contexts === null || value2 === contexts ? value2 : contexts.device;
|
|
r11 = (device === null || value2 === device ? value2 : device.arch) || value5;
|
|
object3.architecture = r11;
|
|
contexts = a2.contexts;
|
|
device = contexts === null || value2 === contexts ? value2 : contexts.device;
|
|
simulator = device === null || value2 === device ? value2 : device.simulator;
|
|
simulator = !!simulator && simulator;
|
|
object3.is_emulator = simulator;
|
|
object.device = object3;
|
|
object4 = {};
|
|
transaction = a2.transaction;
|
|
r11 = transaction || value5;
|
|
object4.name = r11;
|
|
r11 = a2.event_id || value5;
|
|
object4.id = r11;
|
|
object4.trace_id = trace_id;
|
|
transaction = a1.transaction;
|
|
object4.active_thread_id = (transaction === null || value2 === transaction ? value2 : transaction.active_thread_id) || value5;
|
|
object.transaction = object4;
|
|
object5 = {};
|
|
items2 = [];
|
|
concat = items2.concat;
|
|
binding = Module00065;
|
|
value = require(1127) /* metro dependency 1127 */;
|
|
value = binding(value.getDebugMetadata());
|
|
debug_meta = a1.debug_meta;
|
|
object5.images = Reflect.apply(concat, items2, [value,
|
|
binding((debug_meta === null || value2 === debug_meta ? value2 : debug_meta.images) || [])]);
|
|
object.debug_meta = object5;
|
|
return Reflect.apply(assign, Object, [value4, object]);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun12583, 1126, [65, 826, 1010, 1127]) /* metro module 1126, dependencies: [65, 826, 1010, 1127] */;
|