158 lines
7.1 KiB
React
158 lines
7.1 KiB
React
/* Metro module 1135; source: unknown; dependencies: [1010, 1009, 826, 1011] */
|
|
function _fun12633(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#12633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1262:6, offset: 0x00dd1084, size: 97 bytes, params: 8, frame: 17
|
|
const env0_0 = require;
|
|
const closure = getExpoUpdatesContext;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
exports.OTA_UPDATES_CONTEXT_KEY = 'ota_updates';
|
|
exports.expoContextIntegration = function() {
|
|
var env0_1 = _fun12636;
|
|
return {name: 'ExpoContext', setup: _fun12637, processEvent: _fun12639};
|
|
};
|
|
exports.getExpoUpdatesContext = closure;
|
|
}
|
|
|
|
function getExpoUpdatesContext() { // fn#12634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1262:112, offset: 0x00dd10e5, size: 441 bytes, params: 1, frame: 13
|
|
var r2;
|
|
var object2;
|
|
let value = require(1011) /* metro dependency 1011 */;
|
|
value = value.getExpoUpdates();
|
|
if (value) {
|
|
object2 = {};
|
|
object2.is_enabled = !!value.isEnabled;
|
|
object2.is_embedded_launch = !!value.isEmbeddedLaunch;
|
|
object2.is_emergency_launch = !!value.isEmergencyLaunch;
|
|
object2.is_using_embedded_assets = !!value.isUsingEmbeddedAssets;
|
|
r2 = typeof value.updateId === 'string' && value.updateId;
|
|
if (r2) {
|
|
object2.update_id = value.updateId.toLowerCase();
|
|
}
|
|
r2 = typeof value.channel === 'string' && value.channel;
|
|
if (r2) {
|
|
object2.channel = value.channel.toLowerCase();
|
|
}
|
|
r2 = typeof value.runtimeVersion === 'string' && value.runtimeVersion;
|
|
if (r2) {
|
|
object2.runtime_version = value.runtimeVersion.toLowerCase();
|
|
}
|
|
r2 = typeof value.checkAutomatically === 'string' && value.checkAutomatically;
|
|
if (r2) {
|
|
object2.check_automatically = value.checkAutomatically.toLowerCase();
|
|
}
|
|
r2 = typeof value.emergencyLaunchReason === 'string' && value.emergencyLaunchReason;
|
|
if (r2) {
|
|
object2.emergency_launch_reason = value.emergencyLaunchReason;
|
|
}
|
|
if (typeof value.launchDuration === 'number') {
|
|
object2.launch_duration = value.launchDuration;
|
|
}
|
|
if (value.createdAt instanceof global.Date) {
|
|
object2.created_at = value.createdAt.toISOString();
|
|
}
|
|
return object2;
|
|
}
|
|
return {is_enabled: false};
|
|
}
|
|
|
|
function expoContextIntegration() { // fn#12635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1262:1071, offset: 0x00dd129e, size: 45 bytes, params: 1, frame: 3
|
|
return {name: 'ExpoContext', setup: function(a0) {
|
|
var env0_0 = a0;
|
|
a0.on('afterInit', _fun12638);
|
|
}, processEvent: processEvent_12639};
|
|
}
|
|
|
|
function getExpoUpdatesContextCached() { // fn#12636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1262:1111, owner: expoContextIntegration.getExpoUpdatesContextCached, offset: 0x00dd12cb, size: 32 bytes, params: 1, frame: 11
|
|
return env0_0 || getExpoUpdatesContext();
|
|
}
|
|
|
|
function expoContextIntegrationSetup(a0) { // fn#12637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1262:1220, owner: expoContextIntegration.setup, offset: 0x00dd12eb, size: 36 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
a0.on('afterInit', _fun12638);
|
|
}
|
|
|
|
function expoContextIntegrationProcessEvent(a0) { // fn#12639, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1262:1545, owner: expoContextIntegration.processEvent, offset: 0x00dd13e1, size: 117 bytes, params: 2, frame: 15
|
|
var environment;
|
|
var contexts;
|
|
var Object;
|
|
let value = environment.__proto__;
|
|
value = require(1010) /* metro dependency 1010 */;
|
|
if (value.isExpo()) {
|
|
addExpoGoContext(a0);
|
|
contexts = a0.contexts;
|
|
a0.contexts = contexts || ({});
|
|
contexts = a0.contexts;
|
|
Object = global.Object;
|
|
contexts.ota_updates = Object.assign({}, getExpoUpdatesContextCached());
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function _fun12638() { // fn#12638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1262:1256, offset: 0x00dd130f, size: 210 bytes, params: 1, frame: 15
|
|
var moduleValue;
|
|
var moduleValue2;
|
|
var value2;
|
|
var property;
|
|
var moduleValue3;
|
|
var NATIVE;
|
|
var error;
|
|
var debug;
|
|
const binding = env0_0;
|
|
const getOptions = binding.getOptions;
|
|
if (Reflect.apply(getOptions, binding, []).enableNative) {
|
|
value = environment.__proto__.__proto__;
|
|
moduleValue = require(dependencyMap[0]);
|
|
if (moduleValue.isExpo()) {
|
|
moduleValue2 = require(dependencyMap[0]);
|
|
if (!moduleValue2.isExpoGo()) {
|
|
value2 = environment.__proto__;
|
|
try {
|
|
property = dependencyMap[1];
|
|
moduleValue3 = require(property);
|
|
NATIVE = moduleValue3.NATIVE;
|
|
NATIVE.setContext('ota_updates', getExpoUpdatesContextCached());
|
|
} catch (error) {
|
|
debug = require(dependencyMap[2]).debug;
|
|
debug.error('Error setting Expo updates context:', error);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function addExpoGoContext(a0) { // fn#12640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1262:1595, owner: expoContextIntegration.processEvent.addExpoGoContext, offset: 0x00dd1456, size: 397 bytes, params: 2, frame: 20
|
|
var r10;
|
|
var r8;
|
|
var expoDevice;
|
|
var contexts;
|
|
var Object;
|
|
let value = environment.__proto__.__proto__;
|
|
const value2 = undefined;
|
|
const moduleValue = require(1010) /* metro dependency 1010 */;
|
|
if (moduleValue.isExpoGo()) {
|
|
expoDevice = (require(1011) /* metro dependency 1011 */).getExpoDevice();
|
|
r10 = expoDevice ? {name: expoDevice.deviceName,
|
|
simulator: !(expoDevice == null ? value2 : expoDevice.isDevice),
|
|
model: expoDevice.modelName, manufacturer: expoDevice.manufacturer,
|
|
memory_size: expoDevice.totalMemory} : value2;
|
|
if (r10) {
|
|
contexts = a0.contexts;
|
|
a0.contexts = contexts || ({});
|
|
contexts = a0.contexts;
|
|
Object = global.Object;
|
|
contexts.device = Object.assign(global.Object.assign({}, r10), a0.contexts.device);
|
|
}
|
|
value = require(1011) /* metro dependency 1011 */;
|
|
value = value.getExpoDevice();
|
|
r8 = value ? {build: value.osBuildId, version: value.osVersion, name: value.osName} : value2;
|
|
if (r8) {
|
|
contexts = a0.contexts;
|
|
a0.contexts = contexts || ({});
|
|
contexts = a0.contexts;
|
|
Object = global.Object;
|
|
contexts.os = Object.assign(global.Object.assign({}, r8), a0.contexts.os);
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
|