195 lines
8.9 KiB
TypeScript
195 lines
8.9 KiB
TypeScript
/* Metro module 12086; source: modules/nuf_channels/native/NUFChannelsManager.tsx; dependencies: [6, 7, 15, 17, 18, 1945, 1867, 3969, 1878, 661, 3772, 587, 3995, 4007, 1391, 4080, 12087, 1962, 4008, 4860, 2] */
|
|
function _fun92869(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12272:6, offset: 0x0209c37c, size: 349 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
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 guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const env0_12 = (require(661) /* metro dependency 661: Constants */).GuildFeatures;
|
|
const env0_13 = (require(3772) /* metro dependency 3772: GuildMemberConstants */).GuildMemberFlags;
|
|
let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
|
value = _fun92874(value);
|
|
value = new value();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/nuf_channels/native/NUFChannelsManager.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_92870() { // fn#92870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12272:240, offset: 0x0209c4d9, 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_92870_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function requiresChannelOnboard() { // fn#92873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12272:516, offset: 0x0209c53b, size: 99 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var moduleValue;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
const value2 = Storage.get('2020_02_nuf_channels');
|
|
if (value2) {
|
|
r0 = !value2;
|
|
} else {
|
|
moduleValue = require(3995) /* metro dependency 3995: UserUtils */;
|
|
r0 = moduleValue.isNewUser(UserStore.getCurrentUser());
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun92874(a0) { // fn#92874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12272:591, offset: 0x0209c59e, size: 97 bytes, params: 2, frame: 16
|
|
const closure = NUFChannelsManager;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: '_initialize', value: value_92881}, {key: '_terminate', value: value_92882}]);
|
|
}
|
|
|
|
function NUFChannelsManager(a0) { // fn#92875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12272:603, offset: 0x0209c5ff, size: 204 bytes, params: 2, frame: 20
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_3;
|
|
binding(this, NUFChannelsManager);
|
|
const items = [];
|
|
arraySpread(items, value, 0, items);
|
|
value = env1_6(NUFChannelsManager);
|
|
binding = env1_5;
|
|
if (_isNativeReflectConstruct_92870()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items, env1_6(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
value.actions = {LOGOUT: LOGOUT_92876};
|
|
value.handleNavigationStateChanged = handleNavigationStateChanged;
|
|
value.requiresVoiceChannelsOnboard = requiresVoiceChannelsOnboard;
|
|
value.handleVoiceChannelsOnboard = function() {
|
|
var Storage = require(dependencyMap[11]).Storage;
|
|
Storage.set('2020_02_nuf_voice_channels', true);
|
|
};
|
|
value.clear = function() {
|
|
var Storage = require(dependencyMap[11]).Storage;
|
|
Storage.remove('2020_02_nuf_channels');
|
|
Storage.remove('2020_02_nuf_voice_channels');
|
|
};
|
|
return value;
|
|
}
|
|
|
|
function value_92881() { // fn#92881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12272:1756, offset: 0x0209c9a5, size: 79 bytes, params: 1, frame: 14
|
|
let value = environment.__proto__;
|
|
if (requiresChannelOnboard()) {
|
|
value = require(4008) /* metro dependency 4008: RootNavigationRefNative */;
|
|
value = value.getRootNavigationRef();
|
|
if (value != null) {
|
|
value.addListener('state', this.handleNavigationStateChanged);
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_92882() { // fn#92882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12272:1927, offset: 0x0209c9f4, size: 68 bytes, params: 1, frame: 14
|
|
let value = environment.__proto__;
|
|
value = require(4008) /* metro dependency 4008: RootNavigationRefNative */;
|
|
value = value.getRootNavigationRef();
|
|
if (value != null) {
|
|
value.removeListener('state', this.handleNavigationStateChanged);
|
|
}
|
|
}
|
|
|
|
function NUFChannelsManagerHandleNavigationStateChanged() { // fn#92877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12272:907, owner: NUFChannelsManager.handleNavigationStateChanged, offset: 0x0209c6de, size: 478 bytes, params: 1, frame: 20
|
|
var r3;
|
|
var r2;
|
|
var r8;
|
|
var flags;
|
|
var guildId;
|
|
var guild;
|
|
var value6;
|
|
var moduleValue2;
|
|
var hasFlag;
|
|
var moduleValue3;
|
|
var defaultImport;
|
|
var openLazy;
|
|
let value = environment.__proto__.__proto__;
|
|
const value2 = undefined;
|
|
if (require(dependencyMap[13]).getCurrentNavigationRouteName() === 'guilds') {
|
|
guildId = SelectedGuildStore.getGuildId();
|
|
guild = GuildStore.getGuild(guildId);
|
|
value6 = null;
|
|
r2 = value6 != guildId && !(value6 != guild && guild.features.has(GuildFeatures.HUB));
|
|
r8 = value6 != guild ? GuildMemberStore.getSelfMember(guild.id) : value6;
|
|
r3 = value6 != guild && guild.features.has(GuildFeatures.GUILD_ONBOARDING);
|
|
if (r3) {
|
|
moduleValue2 = require(dependencyMap[14]);
|
|
hasFlag = moduleValue2.hasFlag;
|
|
flags = value6 == r8 ? value2 : r8.flags;
|
|
r3 = Reflect.apply(hasFlag, moduleValue2, [value6 != flags ? flags : 0,
|
|
GuildMemberFlags.STARTED_ONBOARDING]);
|
|
}
|
|
if (r3) {
|
|
moduleValue3 = require(dependencyMap[14]);
|
|
hasFlag = moduleValue3.hasFlag;
|
|
flags = value6 == r8 ? value2 : r8.flags;
|
|
r3 = !Reflect.apply(hasFlag, moduleValue3, [value6 != flags ? flags : 0,
|
|
GuildMemberFlags.COMPLETED_ONBOARDING]);
|
|
}
|
|
r2 = r2 && !r3;
|
|
if (r2) {
|
|
if (requiresChannelOnboard()) {
|
|
defaultImport = importDefault(dependencyMap[15]);
|
|
openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[17]);
|
|
value = value(dependencyMap[16], dependencyMap.paths);
|
|
Reflect.apply(openLazy, defaultImport, [value, 'NUFChannelsActionSheet']);
|
|
require(dependencyMap[11]).Storage.set('2020_02_nuf_channels', true);
|
|
}
|
|
env0_0.terminate();
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function requiresVoiceChannelsOnboard() { // fn#92878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12272:1477, owner: NUFChannelsManager.requiresVoiceChannelsOnboard, offset: 0x0209c8bc, size: 99 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var moduleValue;
|
|
const value = environment.__proto__.__proto__;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
|
|
const value2 = Storage.get('2020_02_nuf_voice_channels');
|
|
if (value2) {
|
|
r0 = !value2;
|
|
} else {
|
|
moduleValue = require(3995) /* metro dependency 3995: UserUtils */;
|
|
r0 = moduleValue.isNewUser(UserStore.getCurrentUser());
|
|
}
|
|
return r0;
|
|
}
|
|
|