252 lines
9.9 KiB
TypeScript
252 lines
9.9 KiB
TypeScript
/* Metro module 9858; source: modules/channel/VoiceChannelStartTimeStore.tsx; dependencies: [6, 7, 15, 17, 18, 4257, 672, 677, 566, 694, 2] */
|
|
function _fun77281(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:6, offset: 0x01df81c3, size: 422 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_77287 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const closure = CONNECTION_RESUMED_77289;
|
|
const closure2 = GUILD_CREATE_77290;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const gatewayConnectionStore = importDefault(4257) /* metro dependency 4257: GatewayConnectionStore */;
|
|
const Set = global.Set;
|
|
let set = new Set();
|
|
const env0_10 = {};
|
|
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
|
|
_fun77291(Store).displayName = 'VoiceChannelStartTimeStore';
|
|
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {GUILD_CREATE: closure2,
|
|
GUILD_DELETE: closure2, CONNECTION_RESUMED: closure, CONNECTION_OPEN: closure,
|
|
VOICE_CHANNEL_START_TIME_UPDATE: VOICE_CHANNEL_START_TIME_UPDATE, CHANNEL_INFO: CHANNEL_INFO_77297,
|
|
FETCH_CHANNEL_INFO: FETCH_CHANNEL_INFO_77298});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/channel/VoiceChannelStartTimeStore.tsx');
|
|
exports.default = set;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_77282() { // fn#77282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:160, offset: 0x01df8369, 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_77282_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_77285(a0, a1) { // fn#77285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:353, offset: 0x01df83cb, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun77286;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_77287(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_77287(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_77287(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun77286;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
}
|
|
|
|
function _toTimestampMs(a0) { // fn#77288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1282, offset: 0x01df853f, size: 84 bytes, params: 2, frame: 12
|
|
const Date = global.Date;
|
|
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
|
const SECOND = Millis.SECOND;
|
|
const value = a0 * SECOND;
|
|
const value2 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
const date = new Date();
|
|
return (date instanceof Object ? date : value2).getTime();
|
|
}
|
|
|
|
function CONNECTION_OPEN_77289() { // fn#77289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1360, offset: 0x01df8593, size: 21 bytes, params: 1, frame: 9
|
|
env0_9.clear();
|
|
}
|
|
|
|
function GUILD_CREATE_77290({guild}) { // fn#77290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1403, offset: 0x01df85a8, size: 34 bytes, params: 2, frame: 11
|
|
env0_9.delete(guild.id);
|
|
}
|
|
|
|
function _fun77291(a0) { // fn#77291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1459, offset: 0x01df85ca, size: 122 bytes, params: 2, frame: 16
|
|
const closure = VoiceChannelStartTimeStore;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'initialize', value: function() {
|
|
this.waitFor(GatewayConnectionStore);
|
|
}}, {key: 'getStartTime', value: value_77294}, {key: 'hasRequestedStartTimes', value: value_77295}]);
|
|
}
|
|
|
|
function VOICE_CHANNEL_START_TIME_UPDATE({guildId, id, voiceStartTime}) { // fn#77296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:2332, offset: 0x01df86a9, size: 80 bytes, params: 2, frame: 15
|
|
if (env0_10[guildId] == null) {
|
|
env0_10[guildId] = {};
|
|
}
|
|
env0_10[guildId][id] = voiceStartTime != null ? _toTimestampMs(voiceStartTime) : undefined;
|
|
}
|
|
|
|
function CHANNEL_INFO_77297({guildId, channels}) { // fn#77297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:2487, offset: 0x01df86f9, size: 115 bytes, params: 2, frame: 19
|
|
var r2;
|
|
var r1;
|
|
var value5;
|
|
var id;
|
|
var voiceStartTime;
|
|
var property;
|
|
var value6;
|
|
var value7;
|
|
env0_10[guildId] = {};
|
|
const value3 = _createForOfIteratorHelperLoose_77285(channels);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r2 = value4;
|
|
while (true) {
|
|
value5 = r2.value;
|
|
id = value5.id;
|
|
voiceStartTime = value5.voiceStartTime;
|
|
property = env0_10[guildId];
|
|
if (voiceStartTime != null) {
|
|
value6 = _toTimestampMs(voiceStartTime);
|
|
r1 = value6;
|
|
} else {
|
|
r1 = undefined;
|
|
}
|
|
property[id] = r1;
|
|
value7 = value3();
|
|
done = value7.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r2 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
|
|
function FETCH_CHANNEL_INFO_77298({guildId}) { // fn#77298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:2710, offset: 0x01df876c, size: 29 bytes, params: 2, frame: 11
|
|
env0_9.add(guildId);
|
|
}
|
|
|
|
function value_77294(a0) { // fn#77294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10044:1874, offset: 0x01df8644, size: 101 bytes, params: 2, frame: 15
|
|
var property;
|
|
if (a0 != null) {
|
|
if (a0.guild_id == null) {
|
|
return undefined;
|
|
}
|
|
var type = a0.type;
|
|
var value2 = undefined;
|
|
var ChannelTypes = (require(677) /* metro dependency 677: ChannelTypes */).ChannelTypes;
|
|
var GUILD_VOICE = ChannelTypes.GUILD_VOICE;
|
|
if (type === GUILD_VOICE) {
|
|
property = env1_10[a0.guild_id];
|
|
return property == null ? value2 : property[a0.id];
|
|
}
|
|
}
|
|
}
|
|
|