128 lines
6.9 KiB
TypeScript
128 lines
6.9 KiB
TypeScript
/* Metro module 16215; source: modules/local_message_caching/LocalMessageCacheStatsManager.tsx; dependencies: [7, 6, 15, 17, 18, 661, 4900, 683, 4860, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun125301(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#125301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16423:6, offset: 0x025d4147, size: 284 bytes, params: 8, frame: 19
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ConstantsModule;
|
|
const env0_7 = value.AnalyticEvents;
|
|
const env0_8 = value.AppStates;
|
|
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
|
value = _fun125307(value);
|
|
value = new value();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/local_message_caching/LocalMessageCacheStatsManager.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_125302() { // fn#125302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16423:191, offset: 0x025d4263, size: 98 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_125302_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function handleAppStateUpdate_125306({state}) { // fn#125306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16423:830, offset: 0x025d43ad, size: 242 bytes, params: 2, frame: 20
|
|
var Array;
|
|
var from;
|
|
var fetchLogs;
|
|
var value2;
|
|
var value3;
|
|
var defaultImport;
|
|
var track;
|
|
var CACHE_STATS_RECORDED;
|
|
var object;
|
|
var size;
|
|
var binding;
|
|
const BACKGROUND = AppStates.BACKGROUND;
|
|
if (state === BACKGROUND) {
|
|
Array = global.Array;
|
|
from = Array.from;
|
|
fetchLogs = (importDefault(4900) /* metro dependency 4900: MessageCacheStats */).fetchLogs;
|
|
value2 = Reflect.apply(from, Array, [fetchLogs.values()]);
|
|
value3 = value2.map(makeLogLine);
|
|
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport.track;
|
|
CACHE_STATS_RECORDED = AnalyticEvents.CACHE_STATS_RECORDED;
|
|
object = {};
|
|
size = (importDefault(4900) /* metro dependency 4900: MessageCacheStats */).channelsFetchStarted.size;
|
|
object.num_channels_fetch_started = size;
|
|
size = (importDefault(4900) /* metro dependency 4900: MessageCacheStats */).channelsFetchedWithLocalMessages.size;
|
|
object.num_channels_local_cached = size;
|
|
size = (importDefault(4900) /* metro dependency 4900: MessageCacheStats */).channelsFetchedNetwork.size;
|
|
object.num_channels_fetched_network = size;
|
|
binding = env0_9;
|
|
object.num_times_backgrounded = typeof binding === 'bigint' ? binding + 1n : +binding + 1;
|
|
object.fetch_entries = value3;
|
|
Reflect.apply(track, defaultImport, [CACHE_STATS_RECORDED, object]);
|
|
}
|
|
}
|
|
|
|
function _fun125307(a0) { // fn#125307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16423:1244, offset: 0x025d449f, size: 42 bytes, params: 2, frame: 14
|
|
const LocalMessageCacheStatsManager2 = LocalMessageCacheStatsManager;
|
|
Inherits(LocalMessageCacheStatsManager2, a0);
|
|
return CreateClass(LocalMessageCacheStatsManager2);
|
|
function LocalMessageCacheStatsManager(a0) { // fn#125308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16423:1256, offset: 0x025d44c9, size: 143 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_3;
|
|
binding(this, LocalMessageCacheStatsManager);
|
|
const items2 = [];
|
|
arraySpread(items2, value, 0, items2);
|
|
value = env1_5(LocalMessageCacheStatsManager);
|
|
binding = env1_4;
|
|
if (_isNativeReflectConstruct_125302()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items2, env1_5(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items2);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.actions = {APP_STATE_UPDATE: handleAppStateUpdate_125306};
|
|
return value;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function makeLogLine(a0) { // fn#125305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16423:392, offset: 0x025d42c5, size: 232 bytes, params: 2, frame: 15
|
|
const localMessageDetails = a0.localMessageDetails;
|
|
const value = '-1';
|
|
return [a0.channelId, localMessageDetails != null ? a0.localMessageDetails.loadTime - a0.startTime : value,
|
|
a0.networkMessageDetails != null ? a0.networkMessageDetails.loadTime - a0.startTime : value,
|
|
a0.localMessageDetails == null || a0.networkMessageDetails == null ? 'incomplete' : a0.localMessageDetails.count !== a0.networkMessageDetails.count || a0.localMessageDetails.lastMessageId !== a0.networkMessageDetails.lastMessageId ? 'mismatch' : 'match'].join(':');
|
|
}
|
|
|
|
global.__d(_fun125301, 16215, [7, 6, 15, 17, 18, 661, 4900, 683, 4860,
|
|
2]) /* metro module 16215, dependencies: [7, 6, 15, 17, 18, 661, 4900, 683, 4860, 2] */;
|