Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,16 @@
/* Metro module 11877; source: modules/multi_account/Constants.tsx; dependencies: [2] */
function _fun91132(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#91132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12063:6, offset: 0x0205356b, size: 224 bytes, params: 8, frame: 16
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/Constants.tsx');
exports.MAX_ACCOUNTS = 5;
exports.SWITCH_ACCOUNTS_MODAL_KEY = 'switch-accounts-modal';
exports.MULTI_ACCOUNT_LOGIN_MODAL_KEY = 'multiaccount-login-modal';
exports.MULTIACCOUNT_TOOLTIP_SEEN_KEY = 'multiaccount_cta_tooltip_seen';
exports.MANAGE_EDIT_TRANSITION_DURATION = 200;
exports.MultiAccountSwitchLocation = {YOU_ACCOUNT_ACTION_SHEET: 'you_account_action_sheet',
CHOOSE_ACCOUNT: 'choose_account', MANAGE_ACCOUNTS_MODAL: 'manage_accounts_modal',
MULTI_ACCOUNTS_LIST: 'multi_accounts_list', MULTI_ACCOUNT_MENU: 'multi_account_menu',
PUSH_NOTIFICATION: 'push_notification', SHARE_EXTENSION: 'share_extension'};
}
@@ -0,0 +1,396 @@
/* Metro module 11880; source: modules/multi_account/MultiAccountActionCreators.tsx; dependencies: [5, 1226, 11876, 661, 3, 692, 694, 507, 683, 5076, 2] */
function _fun91139(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#91139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12066:6, offset: 0x020539fa, size: 296 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(5) /* metro dependency 5 */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const multiAccountStore = importDefault(11876) /* metro dependency 11876: MultiAccountStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_7 = value.AnalyticEvents;
const env0_8 = value.Endpoints;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('MultiAccountActionCreators');
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/MultiAccountActionCreators.tsx');
exports.validateMultiAccountTokens = validateMultiAccountTokens;
exports.switchAccount = switchAccount;
exports.moveAccount = moveAccount;
exports.removeAccount = removeAccount_91147;
exports.updatePushSyncToken = updatePushSyncToken;
exports.invalidatePushSyncTokens = invalidatePushSyncTokens;
}
function validateMultiAccountTokens() { // fn#91140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12066:333, offset: 0x02053b22, size: 62 bytes, params: 1, frame: 12
const env0_0 = AuthenticationStore.getId();
MultiAccountStore.getUsers().forEach(_fun91141());
}
function switchAccount(a0, a1, a2) { // fn#91145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12066:1479, offset: 0x02053e62, size: 281 bytes, params: 4, frame: 21
var r0;
let value = a2;
env0_9.log('Switching account to ' + a0, {switchSynchronously: a1});
const token = (importAll(692) /* metro dependency 692: TokenManager */).getToken(a0);
const value5 = null;
if (value5 == token) {
env0_9.log('Switching accounts failed because there was no token');
value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.dispatch({type: 'MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE', userId: a0});
value = global.Promise.resolve();
r0 = value;
} else {
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'MULTI_ACCOUNT_SWITCH_START',
targetUserId: a0, location: value5 != value ? value : value5});
value = importDefault(5076) /* metro dependency 5076: AuthenticationActionCreators */;
value = value.switchAccountToken(token, a1);
r0 = value;
}
return r0;
}
function moveAccount(a0, a1) { // fn#91146, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12066:1907, offset: 0x02053f7b, size: 63 bytes, params: 3, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'MULTI_ACCOUNT_MOVE_ACCOUNT', from: a0,
to: a1});
}
function removeAccount_91147(a0) { // fn#91147, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12066:2017, offset: 0x02053fba, size: 54 bytes, params: 2, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'MULTI_ACCOUNT_REMOVE_ACCOUNT',
userId: a0});
}
function updatePushSyncToken(a0, a1) { // fn#91148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12066:2132, offset: 0x02053ff0, size: 64 bytes, params: 3, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'MULTI_ACCOUNT_UPDATE_PUSH_SYNC_TOKEN',
userId: a0, pushSyncToken: a1});
}
function invalidatePushSyncTokens(a0) { // fn#91149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12066:2284, offset: 0x02054030, size: 57 bytes, params: 2, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'MULTI_ACCOUNT_INVALIDATE_PUSH_SYNC_TOKENS',
invalidPushSyncTokens: a0});
}
function _fun91141() { // fn#91141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12066:408, offset: 0x02053b60, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_4(_fun91143);
return _fun91144;
}
async function _fun91143(a0) { // fn#91143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12066:428, offset: 0x02053b98, size: 714 bytes, params: 2, frame: 26
var id;
var r10;
var status;
var r3;
var r6;
var value;
var value2;
var id2;
var value3;
var value4;
var value5;
var binding;
var value6;
var getToken;
var value7;
var value8;
var value9;
var dispatch;
var object3;
var value10;
var binding2;
var property;
var value11;
var HTTP;
var get;
var ME;
var object4;
var value12;
var value13;
var value14;
var body;
var value15;
var value16;
var value17;
var binding3;
var value18;
var value19;
var error;
var value20;
var value21;
var value22;
var value23;
exceptionSkip41: while (true) {
exceptionLanding41: while (true) {
value = undefined;
value2 = false;
if (value2) {
return value;
}
id2 = a0.id;
value = undefined;
await value;
value3 = undefined;
value4 = false;
if (value4) {
return value3;
}
value5 = environment.__proto__.__proto__.__proto__;
binding = env3_2;
value6 = binding(env3_3[5]);
getToken = value6.getToken;
value7 = Reflect.apply(getToken, value6, [id2]);
value8 = null;
if (value8 == value7) {
value9 = env3_1(env3_3[6]);
value9.dispatch({type: 'MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE', userId: id2});
return value;
}
if (value7 !== '') {
binding = env3_1;
value10 = binding(env3_3[6]);
dispatch = value10.dispatch;
Reflect.apply(dispatch, value10, [{type: 'MULTI_ACCOUNT_VALIDATE_TOKEN_REQUEST', userId: id2}]);
try {
binding = env3_0;
} catch (error) {
break exceptionLanding41;
}
try {
binding2 = env3_3;
} catch (error) {
break exceptionLanding41;
}
try {
property = binding2[7];
} catch (error) {
break exceptionLanding41;
}
try {
value11 = binding(property);
} catch (error) {
break exceptionLanding41;
}
try {
HTTP = value11.HTTP;
} catch (error) {
break exceptionLanding41;
}
try {
get = HTTP.get;
} catch (error) {
break exceptionLanding41;
}
try {
object3 = {};
} catch (error) {
break exceptionLanding41;
}
try {
binding = env3_8;
} catch (error) {
break exceptionLanding41;
}
try {
ME = binding.ME;
} catch (error) {
break exceptionLanding41;
}
try {
object3.url = ME;
} catch (error) {
break exceptionLanding41;
}
try {
object4 = {};
} catch (error) {
break exceptionLanding41;
}
try {
object4.authorization = value7;
} catch (error) {
break exceptionLanding41;
}
try {
object3.headers = object4;
} catch (error) {
break exceptionLanding41;
}
try {
object3.retries = 3;
} catch (error) {
break exceptionLanding41;
}
try {
object3.rejectWithError = false;
} catch (error) {
break exceptionLanding41;
}
try {
value12 = Reflect.apply(get, HTTP, [object3]);
} catch (error) {
break exceptionLanding41;
}
await value12;
try {
value13 = undefined;
value14 = false;
} catch (error) {
break exceptionLanding41;
}
if (value14) {
return value13;
}
body = value13.body;
id = value8 == body ? value : body.id;
r10 = value8 != id ? id : value8;
if (value8 == r10) {
value15 = environment.__proto__.__proto__;
if (require !== id2) {
value16 = env3_1(env3_3[6]);
value16.dispatch({type: 'USER_UPDATE', user: value13.body});
}
value17 = env3_1(env3_3[6]);
value17.dispatch({type: 'MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS', userId: id2});
return value;
}
if (r10 !== id2) {
object3 = {expected_user_id: id2, actual_user_id: r10};
binding = env3_9;
binding.log('Found per-user token authentication mismatch', object3);
binding = env3_1;
binding3 = env3_3;
value18 = binding(binding3[8]);
value18.track(env3_7.MULTI_ACCOUNT_VALIDATE_TOKEN_USER_MISMATCH, object3);
value19 = binding(binding3[6]);
value19.dispatch({type: 'MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE', userId: id2});
return value;
}
value15 = environment.__proto__.__proto__;
if (require !== id2) {
value16 = env3_1(env3_3[6]);
dispatch = value16.dispatch;
body = value13.body;
Reflect.apply(dispatch, value16, [{type: 'USER_UPDATE', user: body}]);
}
binding = env3_1;
value17 = binding(env3_3[6]);
dispatch = value17.dispatch;
Reflect.apply(dispatch, value17, [{type: 'MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS', userId: id2}]);
return value;
}
binding = env3_1;
value9 = binding(env3_3[6]);
dispatch = value9.dispatch;
Reflect.apply(dispatch, value9, [{type: 'MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE', userId: id2}]);
return value;
break exceptionSkip41;
}
if (value8 == error) {
status = value;
value20 = status === 401;
if (value20) {
r3 = value20;
value22 = env3_1(env3_3[6]);
dispatch = value22.dispatch;
object3 = {};
value23 = 'MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS';
if (r3) {
object3.type = 'MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE';
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
object3.type = value23;
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
if (value8 == error) {
r3 = value === 403;
value22 = env3_1(env3_3[6]);
dispatch = value22.dispatch;
object3 = {};
value23 = 'MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS';
if (r3) {
object3.type = 'MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE';
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
object3.type = value23;
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
status = error.status;
r3 = status === 403;
value22 = env3_1(env3_3[6]);
dispatch = value22.dispatch;
object3 = {};
value23 = 'MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS';
if (r3) {
object3.type = 'MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE';
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
object3.type = value23;
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
status = error.status;
value20 = status === 401;
if (value20) {
r3 = value20;
value22 = env3_1(env3_3[6]);
dispatch = value22.dispatch;
object3 = {};
value23 = 'MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS';
if (r3) {
object3.type = 'MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE';
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
object3.type = value23;
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
if (value8 == error) {
r3 = value === 403;
value22 = env3_1(env3_3[6]);
dispatch = value22.dispatch;
object3 = {};
value23 = 'MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS';
if (r3) {
object3.type = 'MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE';
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
object3.type = value23;
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
status = error.status;
value21 = status === 403;
r3 = value21;
binding = env3_1;
value22 = binding(env3_3[6]);
dispatch = value22.dispatch;
object3 = {};
value23 = 'MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS';
if (r3) {
object3.type = 'MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE';
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
}
r6 = value23;
object3.type = r6;
object3.userId = id2;
Reflect.apply(dispatch, value22, [object3]);
return value;
break exceptionSkip41;
}
}
@@ -0,0 +1,364 @@
/* Metro module 15772; source: modules/multi_account/MultiAccountManager.tsx; dependencies: [6, 7, 15, 17, 18, 1878, 11876, 661, 3, 25, 692, 683, 12491, 694, 4860, 2] */
function _fun121187(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:6, offset: 0x025407df, size: 380 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = getFastConnectUserId;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(6) /* metro dependency 6 */;
const env0_5 = importDefault(7) /* metro dependency 7 */;
const env0_6 = importDefault(15) /* metro dependency 15 */;
const env0_7 = importDefault(17) /* metro dependency 17 */;
const env0_8 = importDefault(18) /* metro dependency 18 */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const multiAccountStore = importDefault(11876) /* metro dependency 11876: MultiAccountStore */;
const env0_11 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('MultiAccountManager');
value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
value = _fun121193(value);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/MultiAccountManager.tsx');
exports.default = value;
exports.getMultiAccountManagerState = getMultiAccountManagerState;
exports.getFastConnectUserId = closure;
}
function _isNativeReflectConstruct_121188() { // fn#121188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:193, offset: 0x0254095b, 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_121188_isNativeReflectConstruct = function() {
return !!result;
})();
}
function isDiagnosticsEnabled() { // fn#121191, offset: 0x025409bd, size: 14 bytes, params: 1, frame: 2
return env0_18 && true;
}
function getFastConnectUserId() { // fn#121192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:506, offset: 0x025409cb, size: 37 bytes, params: 1, frame: 11
return (require(25) /* metro dependency 25: fast_connect */).getLastFastConnectIdentifyUserId();
}
function _fun121193(a0) { // fn#121193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:594, offset: 0x025409f0, size: 97 bytes, params: 2, frame: 16
const closure = MultiAccountManager;
env0_8(closure, a0);
return env0_5(closure, [{key: '_initialize', value: value_121211}, {key: '_terminate', value: value_121213}]);
}
function getMultiAccountManagerState() { // fn#121215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:4722, offset: 0x02541469, size: 52 bytes, params: 1, frame: 3
return {previousUserId: env0_13, expectedUserId: env0_16, switchLocation: env0_17, isSwitchingAccount: env0_18,
hasEverConnected: env0_19};
}
function MultiAccountManager({onSwitchStart, onSwitchSuccess, onSwitchError, onTokenSet, onLogout}) { // fn#121194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:606, offset: 0x02540a51, size: 250 bytes, params: 2, frame: 25
var environment;
let value = environment.__proto__;
env1_4(this, MultiAccountManager);
const value3 = env1_7(MultiAccountManager);
value = env1_6(this, _isNativeReflectConstruct_121188() ? global.Reflect.construct(value3, [],
env1_7(this).constructor) : value3.apply(this, undefined));
value.actions = {LOGOUT: LOGOUT_121195, MULTI_ACCOUNT_SWITCH_START: MULTI_ACCOUNT_SWITCH_START};
value.handleMultiAccountSwitchStart = handleMultiAccountSwitchStart;
value.handleConnectionOpen = handleConnectionOpen_121198;
value.handleLogout = handleLogout_121210;
value.onSwitchStart = onSwitchStart;
value.onSwitchSuccess = onSwitchSuccess;
value.onSwitchError = onSwitchError;
value.onTokenSet = onTokenSet;
value.onLogout = onLogout;
return value;
}
function value_121211() { // fn#121211, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:4361, offset: 0x025413e9, size: 69 bytes, params: 1, frame: 15
var environment;
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).subscribe('CONNECTION_OPEN', _fun121212);
this.handleConnectionOpen();
}
function value_121213() { // fn#121213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:4498, offset: 0x0254142e, size: 59 bytes, params: 1, frame: 14
var environment;
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).unsubscribe('CONNECTION_OPEN', _fun121214);
}
function MULTI_ACCOUNT_SWITCH_START(a0) { // fn#121196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:979, owner: MultiAccountManager.MULTI_ACCOUNT_SWITCH_START, offset: 0x02540b4b, size: 23 bytes, params: 2, frame: 11
return env0_0.handleMultiAccountSwitchStart(a0);
}
function handleMultiAccountSwitchStart(a0) { // fn#121197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:1050, owner: MultiAccountManager.handleMultiAccountSwitchStart, offset: 0x02540b62, size: 66 bytes, params: 2, frame: 12
const targetUserId = a0.targetUserId;
let value = environment.__proto__.__proto__;
env2_17 = a0.location;
value = require(12491) /* metro dependency 12491: GatewaySocket */;
value.setAccountSwitchUserId(a0.targetUserId);
}
function MultiAccountManagerHandleConnectionOpen() { // fn#121198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:1156, owner: MultiAccountManager.handleConnectionOpen, offset: 0x02540ba4, size: 379 bytes, params: 1, frame: 18
var environment;
var id;
var token;
var moduleValue2;
var setToken;
const value = environment.__proto__.__proto__;
const currentUser = UserStore.getCurrentUser();
if (currentUser != null) {
id = currentUser.id;
checkConnectionOpenMismatch(id);
if (env2_13 != null) {
if (env2_13 !== currentUser.id) {
trackAndLogSuccess(currentUser);
if (env0_0.onSwitchSuccess != null) {
env0_0.onSwitchSuccess(currentUser, env2_15);
}
} else {
trackAndLogFailure(currentUser);
if (env0_0.onSwitchError != null) {
env0_0.onSwitchError(currentUser);
}
}
}
id = currentUser.id;
token = (importAll(692) /* metro dependency 692: TokenManager */).getToken();
if (token != null && token !== '') {
id = currentUser.id;
checkTokenCollisionIntroducedAtWrite(id, token);
moduleValue2 = importAll(692) /* metro dependency 692: TokenManager */;
setToken = moduleValue2.setToken;
id = currentUser.id;
Reflect.apply(setToken, moduleValue2, [token, id]);
}
id = currentUser.id;
checkGeneralTokenCollision(id);
if (env0_0.onTokenSet != null) {
env0_0.onTokenSet(currentUser);
}
(require(12491) /* metro dependency 12491: GatewaySocket */).setAccountSwitchUserId(null);
}
}
function MultiAccountManagerHandleLogout(a0) { // fn#121210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:3885, owner: MultiAccountManager.handleLogout, offset: 0x02541302, size: 231 bytes, params: 2, frame: 18
var binding;
var log;
var object2;
if (env0_0.onLogout != null) {
env0_0.onLogout(a0);
}
if (a0.isSwitchingAccount) {
binding = env2_14;
log = binding.log;
object2 = {current_user_id: env2_12, expected_user_id: env2_16};
object2.fast_connect_user_id = getFastConnectUserId();
object2.switch_origin = env2_17;
Reflect.apply(log, binding, ['logout from account switch', object2]);
if (env0_0.onSwitchStart != null) {
env0_0.onSwitchStart();
}
env2_15 = !!a0.goHomeAfterSwitching;
} else {
(importAll(692) /* metro dependency 692: TokenManager */).removeToken(env2_12);
}
}
function checkConnectionOpenMismatch(a0) { // fn#121199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:1199, owner: MultiAccountManager.handleConnectionOpen.checkConnectionOpenMismatch, offset: 0x02540d1f, size: 315 bytes, params: 2, frame: 20
var r2;
var r3;
var token;
var token2;
var object2;
var defaultImport;
if (isDiagnosticsEnabled()) {
token = (importAll(692) /* metro dependency 692: TokenManager */).getToken(a0);
token2 = (importAll(692) /* metro dependency 692: TokenManager */).getToken();
r2 = env3_16 != null && a0 !== env3_16;
r3 = token != null && token2 != null;
r3 = r3 && token !== token2;
if (r3) {
object2 = {from_user_id: env3_13, to_user_id: env3_16, actual_user_id: a0};
object2.fast_connect_user_id = getFastConnectUserId();
object2.linked_user_ids = MultiAccountStore.getUsers().map(function(a0) {
return a0.id;
});
object2.has_ever_connected = env3_19;
object2.user_token_exists = token != null;
object2.main_token_exists = token2 != null;
object2.is_token_mismatch = r3;
object2.is_user_mismatch = r2;
object2.switch_origin = env3_17;
env3_14.log('Token mismatch on account switch connection open', object2);
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.MULTI_ACCOUNT_SWITCH_READY_MISMATCH, object2);
} else if (r2) {
object2 = {from_user_id: env3_13, to_user_id: env3_16, actual_user_id: a0};
object2.fast_connect_user_id = getFastConnectUserId();
object2.linked_user_ids = MultiAccountStore.getUsers().map(_fun121200);
object2.has_ever_connected = env3_19;
object2.user_token_exists = token != null;
object2.main_token_exists = token2 != null;
object2.is_token_mismatch = r3;
object2.is_user_mismatch = r2;
object2.switch_origin = env3_17;
env3_14.log('Token mismatch on account switch connection open', object2);
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.MULTI_ACCOUNT_SWITCH_READY_MISMATCH, object2);
}
}
}
function trackAndLogSuccess({id}) { // fn#121201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:1786, owner: MultiAccountManager.handleConnectionOpen.trackAndLogSuccess, offset: 0x02540e5a, size: 183 bytes, params: 2, frame: 15
const object2 = {};
object2.from_user_id = env3_13;
object2.to_user_id = env3_16;
object2.actual_user_id = id;
object2.fast_connect_user_id = getFastConnectUserId();
object2.linked_user_ids = MultiAccountStore.getUsers().map(function(a0) {
return a0.id;
});
object2.has_ever_connected = env3_19;
object2.switch_origin = env3_17;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MULTI_ACCOUNT_SWITCH_SUCCESS = AnalyticEvents.MULTI_ACCOUNT_SWITCH_SUCCESS;
Reflect.apply(track, defaultImport, [MULTI_ACCOUNT_SWITCH_SUCCESS, object2]);
if (isDiagnosticsEnabled()) {
env3_14.log('Account switch success', object2);
}
}
function trackAndLogFailure({id}) { // fn#121203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:2164, owner: MultiAccountManager.handleConnectionOpen.trackAndLogFailure, offset: 0x02540f11, size: 183 bytes, params: 2, frame: 15
const object2 = {};
object2.from_user_id = env3_13;
object2.to_user_id = env3_16;
object2.actual_user_id = id;
object2.fast_connect_user_id = getFastConnectUserId();
object2.linked_user_ids = MultiAccountStore.getUsers().map(function(a0) {
return a0.id;
});
object2.has_ever_connected = env3_19;
object2.switch_origin = env3_17;
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MULTI_ACCOUNT_SWITCH_FAILURE = AnalyticEvents.MULTI_ACCOUNT_SWITCH_FAILURE;
Reflect.apply(track, defaultImport, [MULTI_ACCOUNT_SWITCH_FAILURE, object2]);
if (isDiagnosticsEnabled()) {
env3_14.log('Account switch failure', object2);
}
}
function checkTokenCollisionIntroducedAtWrite(a0, a1) { // fn#121205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:2594, owner: MultiAccountManager.handleConnectionOpen.checkTokenCollisionIntroducedAtWrite, offset: 0x02540fc8, size: 276 bytes, params: 3, frame: 18
var set;
var items3;
var items2;
var users;
var object2;
var defaultImport;
const env0_0 = a0;
const env0_1 = a1;
if (isDiagnosticsEnabled()) {
set = new global.Set();
items3 = [];
items2 = [];
users = MultiAccountStore.getUsers();
var env0_5 = false;
users.forEach(_fun121206);
if (items3.length !== 0) {
object2 = {from_user_id: env3_13, to_user_id: env3_16, actual_user_id: a0};
object2.fast_connect_user_id = getFastConnectUserId();
object2.linked_user_ids = items2;
object2.colliding_user_ids = items3;
object2.has_ever_connected = env3_19;
object2.is_already_corrupted = env0_5;
object2.switch_origin = env3_17;
env3_14.log('setToken about to introduce per-user token collision', object2);
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.MULTI_ACCOUNT_SWITCH_TOKEN_COLLISION_WRITE, object2);
}
}
}
function checkGeneralTokenCollision(a0) { // fn#121207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:3214, owner: MultiAccountManager.handleConnectionOpen.checkGeneralTokenCollision, offset: 0x0254116c, size: 115 bytes, params: 2, frame: 14
var environment;
var map;
const env0_0 = a0;
const value = environment.__proto__.__proto__.__proto__;
if (isDiagnosticsEnabled()) {
var env0_1 = [];
map = new global.Map();
MultiAccountStore.getUsers().forEach(_fun121208);
map.forEach(_fun121209);
}
}
function _fun121206({id}) { // fn#121206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:2730, offset: 0x025410dc, size: 144 bytes, params: 2, frame: 14
let binding = env0_4;
binding.push(id);
const token = (importAll(692) /* metro dependency 692: TokenManager */).getToken(id);
if (id !== env0_0 && token === require) {
env0_3.push(id);
}
if (token != null) {
binding = env0_2;
if (!binding.has(token)) {
env0_2.add(token);
}
}
}
function _fun121208({id}) { // fn#121208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:3321, offset: 0x025411df, size: 124 bytes, params: 2, frame: 16
var r3;
let binding = env0_1;
binding.push(id);
const token = (importAll(692) /* metro dependency 692: TokenManager */).getToken(id);
if (token != null) {
if (token !== '') {
binding = env0_2;
r3 = binding.get(token) ?? [];
r3.push(id);
binding = env0_2;
binding.set(token, r3);
}
}
}
function _fun121209(a0) { // fn#121209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15980:3461, offset: 0x0254125b, size: 167 bytes, params: 2, frame: 15
var object2;
var value;
var defaultImport;
if (!(a0.length < 2)) {
object2 = {};
value = environment.__proto__.__proto__.__proto__.__proto__;
object2.from_user_id = env4_13;
object2.to_user_id = env4_16;
object2.actual_user_id = env0_0;
object2.fast_connect_user_id = getFastConnectUserId();
object2.linked_user_ids = env0_1;
object2.colliding_user_ids = a0;
object2.has_ever_connected = env4_19;
object2.switch_origin = env4_17;
env4_14.log('Per-user token collision detected', object2);
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.MULTI_ACCOUNT_SWITCH_TOKEN_COLLISION, object2);
}
}
@@ -0,0 +1,260 @@
/* Metro module 11876; source: modules/multi_account/MultiAccountStore.tsx; dependencies: [6, 7, 15, 17, 18, 11877, 11878, 692, 11879, 566, 694, 2] */
function _fun91094(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#91094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:6, offset: 0x02052bf7, size: 543 bytes, params: 8, frame: 21
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(6) /* metro dependency 6 */;
const env0_5 = importDefault(7) /* metro dependency 7 */;
const env0_6 = importDefault(15) /* metro dependency 15 */;
const env0_7 = importDefault(17) /* metro dependency 17 */;
const env0_8 = importDefault(18) /* metro dependency 18 */;
const env0_9 = (require(11877) /* metro dependency 11877: Constants */).MAX_ACCOUNTS;
object2 = {INVALID: 0};
object2[0] = 'INVALID';
object2.VALIDATING = 1;
object2[1] = 'VALIDATING';
object2.VALID = 2;
object2[2] = 'VALID';
const env0_13 = [];
const PersistedStore = (importDefault(566) /* metro dependency 566: flux */).PersistedStore;
let value = _fun91102(PersistedStore);
value.displayName = 'MultiAccountStore';
value.persistKey = 'MultiAccountStore';
value.migrations = [function(a0) {
return a0 != null ? {users: a0.users ?? [], canUseMultiAccountMobile: false} : {users: [],
canUseMultiAccountMobile: false};
}];
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
{CONNECTION_OPEN: CONNECTION_OPEN_91116, LOGOUT: LOGOUT_91119,
MULTI_ACCOUNT_VALIDATE_TOKEN_REQUEST: MULTI_ACCOUNT_VALIDATE_TOKEN_REQUEST,
MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS: MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS,
MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE: MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE,
MULTI_ACCOUNT_REMOVE_ACCOUNT: function(a0) {
removeAccountById(a0.userId);
}, MULTI_ACCOUNT_MOVE_ACCOUNT: MULTI_ACCOUNT_MOVE_ACCOUNT, CURRENT_USER_UPDATE: CURRENT_USER_UPDATE_91126,
MULTI_ACCOUNT_UPDATE_PUSH_SYNC_TOKEN: MULTI_ACCOUNT_UPDATE_PUSH_SYNC_TOKEN,
MULTI_ACCOUNT_INVALIDATE_PUSH_SYNC_TOKENS: MULTI_ACCOUNT_INVALIDATE_PUSH_SYNC_TOKENS});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/MultiAccountStore.tsx');
exports.default = value;
exports.MultiAccountTokenStatus = object2;
}
function _isNativeReflectConstruct_91095() { // fn#91095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:171, offset: 0x02052e16, 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_91095_isNativeReflectConstruct = function() {
return !!result;
})();
}
function removeAccountById(a0) { // fn#91098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:487, offset: 0x02052e78, size: 72 bytes, params: 2, frame: 13
const env0_0 = a0;
env0_13 = env0_13.filter(_fun91099);
(importAll(692) /* metro dependency 692: TokenManager */).removeToken(a0);
}
function setTokenStatus(a0, a1) { // fn#91100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:570, offset: 0x02052ec0, size: 66 bytes, params: 3, frame: 12
const env0_0 = a0;
const value3 = env0_13.slice().find(_fun91101);
if (value3 != null) {
value3.tokenStatus = a1;
}
}
function _fun91102(a0) { // fn#91102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:680, offset: 0x02052f02, size: 274 bytes, params: 2, frame: 16
const closure = MultiAccountStore;
env0_8(closure, a0);
return env0_5(closure, [{key: 'initialize', value: value_91104}, {key: 'getCanUseMultiAccountMobile',
value: value_91105}, {key: 'getState', value: value_91106}, {key: 'getUsers', value: value_91107},
{key: 'getValidUsers', value: value_91108}, {key: 'getHasLoggedInAccounts', value: value_91110},
{key: 'getIsValidatingUsers', value: value_91111}, {key: 'canUseMultiAccountNotifications', get: function() {
return this.getCanUseMultiAccountMobile();
}}, {key: 'isSwitchingAccount', get: get_91114}]);
}
function CONNECTION_OPEN_91116({user}) { // fn#91116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:1945, offset: 0x0205319c, size: 346 bytes, params: 2, frame: 16
var property;
const id = user.id;
if (!env0_11 && (importDefault(11878) /* metro dependency 11878: isStaffFromRawUser */)(user)) {
}
const value4 = env0_13.slice();
const index = value4.findIndex(function({id}) {
return id === user.id;
});
if (index > -1) {
property = env0_13[index];
property.avatar = user.avatar;
property = env0_13[index];
property.username = user.username;
property = env0_13[index];
property.discriminator = user.discriminator;
property = env0_13[index];
property.tokenStatus = env0_12.VALID;
env0_13 = value4;
} else {
value4.push({id: user.id, avatar: user.avatar, username: user.username, discriminator: user.discriminator,
tokenStatus: env0_12.VALID, pushSyncToken: null});
env0_13 = value4;
}
if (env0_13.length > MAX_ACCOUNTS) {
env0_13.splice(MAX_ACCOUNTS).forEach(function({id}) {
removeAccountById(id);
});
}
}
function LOGOUT_91119(a0) { // fn#91119, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:2394, offset: 0x0205330e, size: 68 bytes, params: 2, frame: 12
result = !!a0.isSwitchingAccount;
if (!a0.isSwitchingAccount) {
env0_13 = env0_13.filter(_fun91120);
}
}
function MULTI_ACCOUNT_VALIDATE_TOKEN_REQUEST({userId}) { // fn#91121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:2543, offset: 0x02053367, size: 35 bytes, params: 2, frame: 13
const setTokenStatusBinding = setTokenStatus;
const VALIDATING = env0_12.VALIDATING;
setTokenStatusBinding(userId, VALIDATING);
}
function MULTI_ACCOUNT_VALIDATE_TOKEN_SUCCESS({userId}) { // fn#91122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:2621, offset: 0x0205338a, size: 35 bytes, params: 2, frame: 13
const setTokenStatusBinding = setTokenStatus;
const VALID = env0_12.VALID;
setTokenStatusBinding(userId, VALID);
}
function MULTI_ACCOUNT_VALIDATE_TOKEN_FAILURE({userId}) { // fn#91123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:2694, offset: 0x020533ad, size: 35 bytes, params: 2, frame: 13
const setTokenStatusBinding = setTokenStatus;
const INVALID = env0_12.INVALID;
setTokenStatusBinding(userId, INVALID);
}
function MULTI_ACCOUNT_MOVE_ACCOUNT({from, to}) { // fn#91125, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:2819, offset: 0x020533e8, size: 61 bytes, params: 2, frame: 17
env0_13 = (require(11879) /* metro dependency 11879: DragAndDropUtils */).moveItemFromTo(env0_13, from, to);
}
function CURRENT_USER_UPDATE_91126({user}) { // fn#91126, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:2914, offset: 0x02053425, size: 98 bytes, params: 2, frame: 13
const value3 = env0_13.slice().find(function({id}) {
return id === user.id;
});
if (value3 != null) {
value3.avatar = user.avatar;
value3.username = user.username;
value3.discriminator = user.discriminator;
}
}
function MULTI_ACCOUNT_UPDATE_PUSH_SYNC_TOKEN({userId, pushSyncToken}) { // fn#91128, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:3129, offset: 0x02053487, size: 56 bytes, params: 2, frame: 12
env0_13 = env0_13.map(function(a0) {
var r0;
var object;
var value = a0;
var id = value.id;
if (id !== userId) {
r0 = value;
} else {
object = {};
copyDataProperties(object, value, id);
object['pushSyncToken'] = pushSyncToken;
r0 = object;
}
return r0;
});
}
function MULTI_ACCOUNT_INVALIDATE_PUSH_SYNC_TOKENS({invalidPushSyncTokens}) { // fn#91130, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:3283, offset: 0x020534f3, size: 47 bytes, params: 2, frame: 12
env0_13 = env0_13.map(_fun91131);
}
function MultiAccountStore() { // fn#91103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:692, offset: 0x02053014, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_4(this, MultiAccountStore);
const value3 = env1_7(MultiAccountStore);
return env1_6(this, _isNativeReflectConstruct_91095() ? global.Reflect.construct(value3, arguments,
env1_7(this).constructor) : value3.apply(this, arguments));
}
function value_91104(a0) { // fn#91104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:995, offset: 0x02053085, size: 44 bytes, params: 2, frame: 3
var r2;
var value;
var canUseMultiAccountMobile;
if (a0 != null) {
r2 = a0.users ?? [];
value = environment.__proto__;
canUseMultiAccountMobile = a0.canUseMultiAccountMobile;
}
}
function value_91106() { // fn#91106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:1165, offset: 0x020530b1, size: 25 bytes, params: 1, frame: 3
return {users: env1_13, canUseMultiAccountMobile: env1_11};
}
function value_91108() { // fn#91108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:1292, offset: 0x020530ca, size: 28 bytes, params: 1, frame: 11
return env1_13.filter(_fun91109);
}
function value_91110() { // fn#91110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:1393, offset: 0x02053102, size: 20 bytes, params: 1, frame: 2
return env1_13.length > 0;
}
function value_91111() { // fn#91111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:1458, offset: 0x02053116, size: 29 bytes, params: 1, frame: 11
return env1_13.some(_fun91112);
}
function _fun91120({id}) { // fn#91120, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:2479, offset: 0x02053352, size: 21 bytes, params: 2, frame: 2
return id !== env1_10;
}
function _fun91131(a0) { // fn#91131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:3359, offset: 0x02053522, size: 73 bytes, params: 2, frame: 15
var r0;
var invalidPushSyncTokensBinding;
var object2;
const value = a0;
if (value.pushSyncToken == null) {
r0 = value;
} else {
invalidPushSyncTokensBinding = invalidPushSyncTokens;
if (invalidPushSyncTokensBinding.includes(value.pushSyncToken)) {
object2 = {};
copyDataProperties(object2, value, invalidPushSyncTokensBinding);
object2['pushSyncToken'] = null;
r0 = object2;
} else {
r0 = value;
}
}
return r0;
}
function _fun91109({tokenStatus}) { // fn#91109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:1320, offset: 0x020530e6, size: 28 bytes, params: 2, frame: 2
const INVALID = env2_12.INVALID;
return tokenStatus !== INVALID;
}
function _fun91112({tokenStatus}) { // fn#91112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12062:1484, offset: 0x02053133, size: 28 bytes, params: 2, frame: 2
const VALIDATING = env2_12.VALIDATING;
return tokenStatus === VALIDATING;
}
@@ -0,0 +1,60 @@
/* Metro module 10918; source: modules/multi_account/StatusUtils.tsx; dependencies: [1244, 2] */
function _fun83666(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11104:6, offset: 0x01f23180, size: 107 bytes, params: 8, frame: 18
const env0_0 = require;
const isSameDate = function(a0, a1) {
var r0;
var value = a0.getFullYear();
value = value === a1.getFullYear();
if (value) {
value = a0.getMonth();
value = value === a1.getMonth();
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = a0.getDate();
value = value === a1.getDate();
r0 = value;
}
return r0;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/StatusUtils.tsx');
exports.getStatusExpiryParts = getStatusExpiryParts;
}
function getStatusExpiryParts(a0) { // fn#83668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11104:308, offset: 0x01f23241, size: 430 bytes, params: 2, frame: 22
var object2;
let Date = global.Date;
const Number = global.Number;
let date = new Date(Number(a0));
const isSameDateBinding = isSameDate;
Date = global.Date;
const value4 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
const isSameDate2 = isSameDateBinding(date, date instanceof Object ? date : value4);
Date = global.Date;
date = new Date();
date.setDate(date.getDate() + 1);
const isSameDate3 = isSameDateBinding(date, date);
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const value9 = intl.data.formatTime(date, {format: 'short'});
object2 = {};
if (isSameDate2) {
object2.kind = 'today';
object2.dateString = intl.data.formatRelativeTime(0, 'day', {numeric: 'auto'});
object2.timeString = value9;
} else if (isSameDate3) {
object2.kind = 'tomorrow';
object2.dateString = intl.data.formatRelativeTime(1, 'day', {numeric: 'auto'});
object2.timeString = value9;
} else {
object2.kind = 'date';
object2.dateString = intl.data.formatDate(date, {dateStyle: 'short'});
object2.timeString = value9;
}
return object2;
}
@@ -0,0 +1,98 @@
/* Metro module 14310; source: modules/multi_account/native/AccountSwitcherListItem.tsx; dependencies: [31, 27, 1885, 3996, 1878, 11876, 33, 4501, 566, 4073, 697, 4068, 4573, 1244, 5278, 3874, 1305, 3995, 2] */
function _fun108307(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14507:6, offset: 0x0231bb9e, size: 381 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = AccountStatusIcon;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_3 = value.Pressable;
const env0_4 = value.View;
const userRecord = importDefault(1885) /* metro dependency 1885: UserRecord */;
const streamerModeStore = importDefault(3996) /* metro dependency 3996: StreamerModeStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_8 = (require(11876) /* metro dependency 11876: MultiAccountStore */).MultiAccountTokenStatus;
value = require(33) /* metro dependency 33 */;
const env0_9 = value.jsx;
const env0_10 = value.jsxs;
const env0_11 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({accountListTag: {'marginLeft': 12,
'flex': 1}, tagContainer: {'display': 'flex', 'flexDirection': 'row'},
accountSwitcherListItem: {'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'flex-start',
'alignItems': 'center', 'paddingVertical': 8, 'paddingHorizontal': 16}, username: {flexShrink: 1},
accountInfo: {'flex': 1, 'minWidth': '30%', 'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center'}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/native/AccountSwitcherListItem.tsx');
exports.default = AccountSwitcherListItem;
exports.AccountStatusIcon = closure;
}
function AccountStatusIcon({user}) { // fn#108308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14507:605, offset: 0x0231bd1b, size: 254 bytes, params: 2, frame: 18
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
if (user.id === currentUser?.id) {
const CircleCheckIcon = (require(4073) /* metro dependency 4073: CircleCheckIcon */).CircleCheckIcon;
return <CircleCheckIcon color={(importDefault(697) /* metro dependency 697: native */).colors.TEXT_BRAND} />;
} else if (user.tokenStatus !== MultiAccountTokenStatus.INVALID) {
return null;
} else {
const CircleInformationIcon = (require(4068) /* metro dependency 4068: CircleInformationIcon */).CircleInformationIcon;
return (
<CircleInformationIcon
color={(importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_CRITICAL}
/>
);
}
}
function AccountSwitcherListItem({user, onPressUser, showActiveAccountLabel, sortHandlers, delayLongPress, leading, trailing}) { // fn#108310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14507:921, offset: 0x0231be19, size: 1074 bytes, params: 2, frame: 36
var r26;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
showActiveAccountLabel = !(showActiveAccountLabel === undefined) && showActiveAccountLabel;
const styles = useStyles();
const hidePersonalInformation = (require(566) /* metro dependency 566: flux */).useStateFromStores([StreamerModeStore],
function() {
return StreamerModeStore.hidePersonalInformation;
});
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const isActive = user.id === currentUser?.id;
const userRecord = new UserRecord(user);
const accountLabel = isActive && showActiveAccountLabel ? <Text variant="text-sm/semibold" color="text-brand">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.seV8yt)}</Text> : user.tokenStatus !== MultiAccountTokenStatus.INVALID ? null : <Text variant="text-sm/semibold" color="text-feedback-critical">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.tYX2ps)}</Text>;
const PressableComponent = onPressUser == null ? Pressable : (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const {accessibilityRole,
accessibilityState} = (require(3874) /* metro dependency 3874: useA11yRolesNative */).useRadioA11yNative({selected: isActive});
const pressableProps = {accessibilityRole: accessibilityRole, accessibilityState: accessibilityState,
accessibilityHint: isActive ? undefined : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.wY4y0R),
style: styles.accountSwitcherListItem, delayLongPress: delayLongPress, onPress: onPressUser, ...sortHandlers};
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
const avatar = <Avatar user={userRecord} guildId={undefined} />;
const defaultImport = importDefault(3995) /* metro dependency 3995: UserUtils */;
const getUserTag = defaultImport.getUserTag;
return (
<PressableComponent {...pressableProps} key={user.id}>
{leading}
<View style={styles.accountInfo}>
{avatar}
<View style={styles.accountListTag}>
<View style={styles.tagContainer}>
<Text
variant="text-md/semibold"
color="text-default"
style={styles.username}
lineClamp={1}
>
{Reflect.apply(getUserTag, defaultImport, [userRecord, {mode: 'username',
identifiable: hidePersonalInformation ? 'never' : 'always'}])}
</Text>
{!hidePersonalInformation && !userRecord.hasUniqueUsername() && <Text variant="text-md/normal" color="text-muted">{'#' + userRecord.discriminator}</Text>}
</View>
{accountLabel}
</View>
</View>
{trailing !== undefined ? trailing : <AccountStatusIcon user={user} />}
</PressableComponent>
);
}
@@ -0,0 +1,35 @@
/* Metro module 15771; source: modules/multi_account/native/AccountSwitchingSpinnerModal.tsx; dependencies: [31, 27, 33, 4501, 1244, 5461, 676, 2] */
function _fun121185(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15979:6, offset: 0x0254065e, size: 243 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = AccountSwitchingSpinnerModal;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_2 = (require(27) /* metro dependency 27 */).View;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
const env0_4 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({switchingSpinnerContainer: {'flex': 1,
'alignItems': 'center', 'justifyContent': 'center'}});
const ModalAnimation = (require(676) /* metro dependency 676: ConstantsIOS */).ModalAnimation;
const FADE = ModalAnimation.FADE;
closure.modalConfig = {animation: FADE, closable: false};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/native/AccountSwitchingSpinnerModal.tsx');
exports.default = closure;
}
function AccountSwitchingSpinnerModal() { // fn#121186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15979:238, offset: 0x02540751, size: 142 bytes, params: 1, frame: 19
const styles = useStyles();
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const n8qMH0 = (require(1244) /* metro dependency 1244: indexNative */).t.n8qMH0;
const ActivityIndicator = (require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator;
return (
<View
style={styles.switchingSpinnerContainer}
accessible
accessibilityLabel={Reflect.apply(string, intl, [n8qMH0])}
>
<ActivityIndicator />
</View>
);
}
@@ -0,0 +1,210 @@
/* Metro module 14308; source: modules/multi_account/native/ChooseAccount.tsx; dependencies: [5, 31, 27, 11876, 11877, 661, 33, 4501, 697, 1484, 14309, 683, 11880, 4496, 1244, 1305, 4080, 6802, 9001, 4573, 12638, 14310, 5278, 9139, 7972, 14311, 2] */
function _fun108287(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:6, offset: 0x0231af67, size: 508 bytes, params: 8, frame: 22
var object4;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(5) /* metro dependency 5 */;
importAll(31) /* metro dependency 31 */;
const env0_5 = (require(27) /* metro dependency 27 */).View;
const env0_6 = (require(11876) /* metro dependency 11876: MultiAccountStore */).MultiAccountTokenStatus;
let value = require(11877) /* metro dependency 11877: Constants */;
const env0_7 = value.MAX_ACCOUNTS;
const env0_8 = value.MultiAccountSwitchLocation;
value = require(661) /* metro dependency 661: Constants */;
const env0_9 = value.AnalyticEvents;
const env0_10 = value.AuthStates;
value = require(33) /* metro dependency 33 */;
const env0_11 = value.jsx;
const env0_12 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object4 = {};
const object5 = {};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object5.backgroundColor = BACKGROUND_BASE_LOW;
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object5.paddingTop = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object5.margin = PX_16;
object4.container = object5;
const object6 = {'marginVertical': null, 'borderRadius': null, 'flexDirection': 'column', 'alignItems': 'stretch',
'alignSelf': 'stretch', 'display': 'flex'};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object6.marginVertical = PX_16;
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object4.mainCard = object6;
const TEXT_LINK = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_LINK;
object4.addAccountLabel = {color: TEXT_LINK};
const env0_13 = Reflect.apply(createStyles, value, [object4]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/native/ChooseAccount.tsx');
exports.default = ChooseAccount;
}
function ChooseAccount() { // fn#108288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:766, offset: 0x0231b163, size: 586 bytes, params: 1, frame: 28
const styles = useStyles();
const env0_0 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
const useMultiAccountModule = require(14309) /* metro dependency 14309: useMultiAccount */;
const useMultiAccountUsers = useMultiAccountModule.useMultiAccountUsers;
const multiAccountUsers = Reflect.apply(useMultiAccountUsers, useMultiAccountModule, []).multiAccountUsers;
const env0_3 = _fun108290();
const AuthFormView = importDefault(9001) /* metro dependency 9001: AuthFormView */;
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.headerText = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bVbB63);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
object2.subHeader = <Text variant="text-sm/medium" color="text-default">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['0M5fN7'])}</Text>;
object2.backgroundImageSource = importDefault(12638) /* metro dependency 12638 */;
object2.backgroundImageCover = true;
object2.contentStyle = styles.container;
const value = multiAccountUsers.map(_fun108294);
const FormRow = (require(7972) /* metro dependency 7972: native */).FormRow;
const FormRow2 = (require(7972) /* metro dependency 7972: native */).FormRow;
const Icon = FormRow2.Icon;
const TEXT_LINK = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_LINK;
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
const Sizes = Icon2.Sizes;
const SMALL_20 = Sizes.SMALL_20;
return (
<AuthFormView {...object2}>
<View style={styles.mainCard}>
{value}
<FormRow
leading={<Icon themedColor={TEXT_LINK} size={SMALL_20} source={importDefault(14311) /* metro dependency 14311 */} />}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bPP34Q)}
labelStyle={styles.addAccountLabel}
onPress={onPress_108300}
/>
</View>
</AuthFormView>
);
}
function handlePressUser(a0) { // fn#108289, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:895, owner: ChooseAccount.handlePressUser, offset: 0x0231b3ad, size: 164 bytes, params: 2, frame: 16
var binding;
var defaultImport;
const tokenStatus = a0.tokenStatus;
const INVALID = MultiAccountTokenStatus.INVALID;
if (tokenStatus === INVALID) {
binding = env0_0;
binding.push(AuthStates.LOGIN);
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.LOGIN_VIEWED, {source: 'choose_account_user_invalid'});
} else {
var moduleValue = importAll(11880) /* metro dependency 11880: MultiAccountActionCreators */;
var switchAccount = moduleValue.switchAccount;
var id = a0.id;
var CHOOSE_ACCOUNT = MultiAccountSwitchLocation.CHOOSE_ACCOUNT;
Reflect.apply(switchAccount, moduleValue, [id, undefined, CHOOSE_ACCOUNT]);
}
}
function _fun108290() { // fn#108290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:1082, offset: 0x0231b451, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_4(_fun108292);
return _fun108293;
}
function _fun108294(a0) { // fn#108294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:1933, offset: 0x0231b65a, size: 206 bytes, params: 2, frame: 23
const env0_0 = a0;
const AccountSwitcherListItem = importDefault(14310) /* metro dependency 14310: AccountSwitcherListItem */;
const object3 = {user: a0, onPressUser: onPressUser};
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const object4 = {accessibilityRole: 'button', onPress: onPress_108296};
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
const Sizes = Icon2.Sizes;
const SMALL_20 = Sizes.SMALL_20;
object3.trailing = <PressableOpacity {...object4}><Icon size={SMALL_20} source={importDefault(9139) /* metro dependency 9139 */} disableColor /></PressableOpacity>;
return <AccountSwitcherListItem {...object3} key={a0.id} />;
}
function ChooseAccountOnPress() { // fn#108300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:2674, owner: ChooseAccount.onPress, offset: 0x0231b85e, size: 268 bytes, params: 1, frame: 20
var binding;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var value;
if (multiAccountUsers.length >= MAX_ACCOUNTS) {
value = importDefault(4496) /* metro dependency 4496: AlertActionCreators */;
value.show({title: intl.string(t.w7wfXi), body: intl.formatToPlainString(t.WOyelG,
{maxNumAccounts: MAX_ACCOUNTS}),
isDismissable: true});
} else {
binding = env0_0;
binding.push(AuthStates.LOGIN);
value = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
value.track(AnalyticEvents.LOGIN_VIEWED, {source: 'choose_account_add_account'});
}
}
function* _fun108292(a0) { // fn#108292, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:1102, offset: 0x0231b480, size: 474 bytes, params: 2, frame: 27
var binding4;
if (true) {
value = environment.__proto__.__proto__.__proto__;
var binding = env3_1;
var binding2 = env3_3;
var value3 = binding(binding2[13]);
var confirm = value3.confirm;
var object2 = {};
binding = env3_0;
var intl = binding(binding2[14]).intl;
var string = intl.string;
object2.title = Reflect.apply(string, intl, [binding(binding2[14]).t.n0Fbg6]);
intl = binding(binding2[14]).intl;
object2.body = intl.formatToPlainString(binding(binding2[14]).t.phEQmS,
{username: a0.discriminator === '0' ? '' + a0.username : '' + a0.username + '#' + a0.discriminator});
binding = env3_0;
var binding3 = env3_3;
intl = binding(binding3[14]).intl;
string = intl.string;
var N86XcP = binding(binding3[14]).t.N86XcP;
object2.confirmText = Reflect.apply(string, intl, [N86XcP]);
var ButtonColors = binding(binding3[15]).ButtonColors;
var RED = ButtonColors.RED;
object2.confirmColor = RED;
intl = binding(binding3[14]).intl;
object2.cancelText = intl.string(binding(binding3[14]).t['ETE/oC']);
object2.isDismissable = true;
yield Reflect.apply(confirm, value3, [object2]);
var value6 = undefined;
if (false) {
return value6;
}
if (value6) {
binding = env3_1;
binding4 = env3_3;
binding(binding4[16]).hideActionSheet();
binding = env3_2;
value = binding(binding4[12]);
value.removeAccount(a0.id);
}
}
}
function onPress_108296() { // fn#108296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:2063, offset: 0x0231b728, size: 25 bytes, params: 1, frame: 11
_fun108297(env0_0);
}
function _fun108297(a0) { // fn#108297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:2068, offset: 0x0231b741, size: 239 bytes, params: 2, frame: 20
var environment;
const env0_0 = a0;
let value = environment.__proto__.__proto__.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
value = require(6802) /* metro dependency 6802: showSimpleActionSheet */;
const showSimpleActionSheet = value.showSimpleActionSheet;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
Reflect.apply(showSimpleActionSheet, value, [{'key': 'RemoveAccount', 'options': null, 'hasIcons': false,
options: [{label: Reflect.apply(string, intl, [t['DSN+hw']]), onPress: onPress_108298},
{label: intl.string(t.lSLMaU), onPress: onPress_108299, isDestructive: true}]}]);
}
function onPress_108298() { // fn#108298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:2218, offset: 0x0231b830, size: 23 bytes, params: 1, frame: 11
return handlePressUser(env0_0);
}
function onPress_108299() { // fn#108299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14505:2297, offset: 0x0231b847, size: 23 bytes, params: 1, frame: 11
return env3_3(env0_0);
}
@@ -0,0 +1,86 @@
/* Metro module 14755; source: modules/multi_account/native/FadeInOut.tsx; dependencies: [31, 33, 4017, 4504, 2] */
function _fun111403(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#111403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14952:6, offset: 0x023a0be8, size: 185 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
object = {code: 'function FadeInOutTsx1(){const{opacity}=this.__closure;return{opacity:opacity.get()};}'};
object = {code: 'function FadeInOutTsx2(finished){const{runOnJS,handleTransitionFinished}=this.__closure;if(finished){runOnJS(handleTransitionFinished)();}}'};
value = value.forwardRef(_fun111404);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/native/FadeInOut.tsx');
exports.default = value;
}
function _fun111404({children, duration, style}, a1) { // fn#111404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14952:385, offset: 0x023a0ca1, size: 255 bytes, params: 3, frame: 21
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = h_111405;
closure.__closure = {opacity: value2};
closure.__workletHash = 8749472415282;
closure.__initData = env0_5;
const value3 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const binding = env0_3;
var env0_3 = binding.useCallback(_fun111406, [binding.useRef(null)]);
binding.useImperativeHandle(a1, function() {
return {componentDidAppear: _fun111408, componentDidEnter: _fun111409, componentWillLeave: _fun111410};
});
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<View style={[style, value3]}>
{children}
</View>
);
}
function _fun111406() { // fn#111406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14952:624, offset: 0x023a0da0, size: 35 bytes, params: 1, frame: 10
if (env0_2.current != null) {
env0_2.current();
}
}
function _fun111407() { // fn#111407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14952:697, offset: 0x023a0dc3, size: 42 bytes, params: 1, frame: 3
return {componentDidAppear: componentDidAppear_111408, componentDidEnter: componentDidEnter_111409,
componentWillLeave: componentWillLeave_111410};
}
function componentDidAppear_111408() { // fn#111408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14952:703, offset: 0x023a0ded, size: 68 bytes, params: 1, frame: 16
const binding = env1_1;
const set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
Reflect.apply(set, binding, [timingModule.withTiming(1, {duration: duration})]);
}
function componentWillLeave_111410(a0) { // fn#111410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14952:830, offset: 0x023a0e31, size: 166 bytes, params: 2, frame: 24
env1_2.current = a0;
const binding = env1_1;
const set = binding.set;
const timingModule = require(4504) /* metro dependency 4504: timing */;
const withTiming = timingModule.withTiming;
const object3 = {};
object3.duration = duration;
const closure = componentWillLeave_111410T;
const object4 = {};
object4.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object4.handleTransitionFinished = env1_3;
closure.__closure = object4;
closure.__workletHash = 7644958904451;
closure.__initData = env2_6;
Reflect.apply(set, binding, [Reflect.apply(withTiming, timingModule, [0, object3, 'respect-motion-settings',
closure])]);
}
function componentWillLeave_111410T(a0) { // fn#111411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14952:940, owner: componentWillLeave_111410.t, offset: 0x023a0ed7, size: 56 bytes, params: 2, frame: 12
var value;
var runOnJS;
var value2;
if (a0) {
value = environment.__proto__.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
runOnJS = value.runOnJS;
value2 = environment.__proto__.__proto__;
Reflect.apply(runOnJS, value, [env2_3])();
}
}
@@ -0,0 +1,20 @@
/* Metro module 14753; source: modules/multi_account/native/ManageAccountsConstants.tsx; dependencies: [661, 2] */
function _fun111361(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#111361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14950:6, offset: 0x0239f4c6, size: 168 bytes, params: 8, frame: 18
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const AuthStates = (require(661) /* metro dependency 661: Constants */).AuthStates;
object2 = {MANAGE_ACCOUNTS: 'MANAGE_ACCOUNTS'};
const LOGIN = AuthStates.LOGIN;
object2.LOGIN = LOGIN;
object2[LOGIN] = 'LOGIN';
const ACCOUNT_DISABLED_OR_DELETION_SCHEDULED = AuthStates.ACCOUNT_DISABLED_OR_DELETION_SCHEDULED;
object2.ACCOUNT_DISABLED_OR_DELETION_SCHEDULED = ACCOUNT_DISABLED_OR_DELETION_SCHEDULED;
object2[ACCOUNT_DISABLED_OR_DELETION_SCHEDULED] = 'ACCOUNT_DISABLED_OR_DELETION_SCHEDULED';
const MFA = AuthStates.MFA;
object2.MFA = MFA;
object2[MFA] = 'MFA';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/native/ManageAccountsConstants.tsx');
exports.ManageAccountsScreens = object2;
}
@@ -0,0 +1,371 @@
/* Metro module 14752; source: modules/multi_account/native/ManageAccountsModal.tsx; dependencies: [57, 5, 31, 27, 1226, 3996, 1878, 11876, 11877, 14753, 661, 33, 9884, 4501, 697, 566, 1305, 4496, 1244, 11880, 5278, 13770, 14309, 4017, 4504, 6266, 683, 6618, 14754, 14310, 11206, 14755, 6247, 7972, 10504, 5280, 9603, 9893, 14335, 5076, 8971, 14334, 2] */
function _fun111330(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#111330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:6, offset: 0x0239e2b2, size: 623 bytes, params: 8, frame: 24
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(57) /* metro dependency 57 */;
const env0_5 = importDefault(5) /* metro dependency 5 */;
let value = importAll(31) /* metro dependency 31 */;
const env0_7 = (require(27) /* metro dependency 27 */).View;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const streamerModeStore = importDefault(3996) /* metro dependency 3996: StreamerModeStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_11 = (require(11876) /* metro dependency 11876: MultiAccountStore */).MultiAccountTokenStatus;
const constantsModule = require(11877) /* metro dependency 11877: Constants */;
const env0_12 = constantsModule.MANAGE_EDIT_TRANSITION_DURATION;
const env0_13 = constantsModule.MAX_ACCOUNTS;
const env0_14 = constantsModule.MultiAccountSwitchLocation;
const env0_15 = (require(14753) /* metro dependency 14753: ManageAccountsConstants */).ManageAccountsScreens;
const constantsModule2 = require(661) /* metro dependency 661: Constants */;
const env0_16 = constantsModule2.AnalyticEvents;
const env0_17 = constantsModule2.AuthStates;
const value4 = require(33) /* metro dependency 33 */;
const env0_18 = value4.jsx;
const env0_19 = value4.jsxs;
const env0_20 = (require(9884) /* metro dependency 9884 */).createNativeStackNavigator();
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.container = {'backgroundColor': null, 'flex': 1, 'paddingTop': 16, backgroundColor: BACKGROUND_BASE_LOW};
BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.sortableListView = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW};
const TEXT_LINK = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_LINK;
object2.addAccountLabel = {color: TEXT_LINK};
object2.trailingIconContainer = {'width': 24, 'height': 24};
object2.trailingIcon = {position: 'absolute'};
const env0_21 = Reflect.apply(createStyles, createStylesModule, [object2]);
object2 = {code: 'function ManageAccountsModalTsx1(){const{withTiming,leadingWidth,MANAGE_EDIT_TRANSITION_DURATION}=this.__closure;return{width:withTiming(leadingWidth.get(),{duration:MANAGE_EDIT_TRANSITION_DURATION})};}'};
value = value.memo(ManageAccountsModal);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/native/ManageAccountsModal.tsx');
exports.default = value;
}
function RemoveMultiAccountUserButton({user}) { // fn#111331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:762, offset: 0x0239e521, size: 434 bytes, params: 2, frame: 20
var env0_1;
const hidePersonalInformation = (require(566) /* metro dependency 566: flux */).useStateFromStores([StreamerModeStore],
function() {
return StreamerModeStore.hidePersonalInformation;
});
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
if (currentUser?.id === user.id) {
const Spacer = (require(1305) /* metro dependency 1305: native */).Spacer;
return <Spacer size={21} />;
}
const username = user.username;
if (!hidePersonalInformation && user.discriminator !== '0') {
env0_1 = username + ('#' + user.discriminator);
}
const value4 = _fun111334();
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const lSLMaU = (require(1244) /* metro dependency 1244: indexNative */).t.lSLMaU;
const CircleMinusIcon = (require(13770) /* metro dependency 13770: CircleMinusIcon */).CircleMinusIcon;
const ICON_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_CRITICAL;
return (
<PressableOpacity
accessibilityRole="button"
accessibilityLabel={Reflect.apply(string, intl, [lSLMaU])}
onPress={value4}
>
<CircleMinusIcon color={ICON_FEEDBACK_CRITICAL} />
</PressableOpacity>
);
}
function ManageAccounts({isEditing, navigation}) { // fn#111338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:1946, offset: 0x0239e87b, size: 775 bytes, params: 2, frame: 37
var r10;
var FadeInOut;
var FormRow;
var Label;
var intl;
const styles = useStyles();
const useMultiAccountModule = require(14309) /* metro dependency 14309: useMultiAccount */;
const useMultiAccountUsers = useMultiAccountModule.useMultiAccountUsers;
const multiAccountUsers = Reflect.apply(useMultiAccountUsers, useMultiAccountModule, []).multiAccountUsers;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStoresObject = fluxModule.useStateFromStoresObject;
const env0_4 = Reflect.apply(useStateFromStoresObject, fluxModule, [[AuthenticationStore], function() {
var object = {};
object.currentUserId = AuthenticationStore.getId();
return object;
}]).currentUserId;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = ManageAccountsL;
closure.__closure = {withTiming: (require(4504) /* metro dependency 4504: timing */).withTiming,
leadingWidth: value2, MANAGE_EDIT_TRANSITION_DURATION: MANAGE_EDIT_TRANSITION_DURATION};
closure.__workletHash = 3389178545077;
closure.__initData = env0_22;
const env0_6 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const env0_7 = (importDefault(6266) /* metro dependency 6266: usePrevious */)(isEditing);
env0_6.useEffect(_fun111341);
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
const SortableListView = importDefault(14754) /* metro dependency 14754: SortableListView */;
let object = {data: multiAccountUsers, onRowMoved: onRowMoved};
const value3 = !isEditing;
object.disableSorting = value3;
object.wrapperStyles = styles.sortableListView;
object.renderRow = renderRow;
object.keyboardShouldPersistTaps = 'handled';
object.scrollEventThrottle = 16;
object.scrollEnabled = true;
const TransitionGroup = (require(11206) /* metro dependency 11206: TransitionGroup */).TransitionGroup;
if (isEditing) {
r10 = value3;
} else {
FadeInOut = importDefault(14755) /* metro dependency 14755: FadeInOut */;
var defaultImport2Props = {duration: MANAGE_EDIT_TRANSITION_DURATION};
FormRow = (require(7972) /* metro dependency 7972: native */).FormRow;
var formRowProps = {leading: ((CirclePlusIcon) => <CirclePlusIcon color={(importDefault(697) /* metro dependency 697: native */).colors.TEXT_LINK} />)((require(10504) /* metro dependency 10504: CirclePlusIcon */).CirclePlusIcon)};
Label = (require(7972) /* metro dependency 7972: native */).FormRow.Label;
var labelProps = {style: styles.addAccountLabel};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
labelProps.text = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.bPP34Q);
formRowProps.label = <Label {...labelProps} />;
formRowProps.onPress = onPress_111345;
r10 = <FadeInOut {...defaultImport2Props}><FormRow {...formRowProps} /></FadeInOut>;
}
object.footer = <TransitionGroup component={View} transitionEnter transitionLeave transitionAppear>{r10}</TransitionGroup>;
return (
<SafeAreaPaddingView style={styles.container} bottom>
<SortableListView {...object} />
</SafeAreaPaddingView>
);
}
function ManageAccountsModal({initialRouteName = ManageAccountsScreens.MANAGE_ACCOUNTS}) { // fn#111346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:4255, offset: 0x0239f01b, size: 398 bytes, params: 2, frame: 22
const env0_0 = (require(5280) /* metro dependency 5280: NavigatorNative */).useAccessibilityNativeStackOptions();
let binding = env0_6;
const [env0_1, env0_2] = env0_4(binding.useState(false), 2);
binding = env0_20;
const Navigator = binding.Navigator;
const object2 = {initialRouteName: initialRouteName, screenOptions: screenOptions_111347};
let Screen = binding.Screen;
const MANAGE_ACCOUNTS = ManageAccountsScreens.MANAGE_ACCOUNTS;
const items2 = [<Screen name={MANAGE_ACCOUNTS} options={options_111349}>{children_111352}</Screen>];
Screen = binding.Screen;
const ACCOUNT_DISABLED_OR_DELETION_SCHEDULED = ManageAccountsScreens.ACCOUNT_DISABLED_OR_DELETION_SCHEDULED;
items2[1] = <Screen name={ACCOUNT_DISABLED_OR_DELETION_SCHEDULED} options={function() {
var object = {};
object.title = require(dependencyMap[18]).intl.string(require(dependencyMap[18]).t.WbFpq4);
return object;
}}>{children_111354}</Screen>;
Screen = binding.Screen;
const LOGIN = ManageAccountsScreens.LOGIN;
items2[2] = <Screen name={LOGIN} options={function() {
return {headerShown: false};
}}>{children_111358}</Screen>;
Screen = binding.Screen;
const MFA = ManageAccountsScreens.MFA;
items2[3] = <Screen name={MFA} options={function() {
return {headerShown: false};
}}>{children_111360}</Screen>;
return (
<Navigator {...object2}>
{items2}
</Navigator>
);
}
function _fun111334() { // fn#111334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:1085, offset: 0x0239e6e2, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_5(_fun111336);
return _fun111337;
}
function ManageAccountsL() { // fn#111340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:2212, owner: ManageAccounts.l, offset: 0x0239eb9c, size: 70 bytes, params: 1, frame: 15
const timingModule = require(4504) /* metro dependency 4504: timing */;
return {width: timingModule.withTiming(env0_5.get(), {duration: MANAGE_EDIT_TRANSITION_DURATION})};
}
function _fun111341() { // fn#111341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:2437, offset: 0x0239ebe2, size: 61 bytes, params: 1, frame: 12
var binding;
if (env0_7 != null && env0_7 !== isEditing) {
binding = env0_5;
binding.set(isEditing ? 37 : 0);
}
}
function onRowMoved({from, to}) { // fn#111342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:2581, owner: ManageAccounts.onRowMoved, offset: 0x0239ec1f, size: 52 bytes, params: 2, frame: 14
const value = environment.__proto__;
(importAll(11880) /* metro dependency 11880: MultiAccountActionCreators */).moveAccount(from, to);
}
function ManageAccountsRenderRow(a0, a1) { // fn#111343, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:2687, owner: ManageAccounts.renderRow, offset: 0x0239ec53, size: 499 bytes, params: 3, frame: 30
var environment;
const env0_0 = a0;
const value = environment.__proto__;
const value2 = undefined;
const AccountSwitcherListItem = importDefault(14310) /* metro dependency 14310: AccountSwitcherListItem */;
const defaultImportProps = {user: a0, onPressUser: isEditing ? null : _fun111344, showActiveAccountLabel: true};
const TransitionGroup = (require(11206) /* metro dependency 11206: TransitionGroup */).TransitionGroup;
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
defaultImportProps.leading = <TransitionGroup component={View2} transitionEnter transitionLeave style={env0_6}>{isEditing && ((Component) => <Component duration={MANAGE_EDIT_TRANSITION_DURATION}><RemoveMultiAccountUserButton user={a0} /></Component>)(importDefault(14755) /* metro dependency 14755: FadeInOut */)}</TransitionGroup>;
isEditingBinding = isEditing;
const FadeInOut = importDefault(14755) /* metro dependency 14755: FadeInOut */;
defaultImportProps.trailing = <TransitionGroup component={View} transitionEnter transitionLeave transitionAppear style={styles.trailingIconContainer}>{isEditingBinding ? <FadeInOut duration={MANAGE_EDIT_TRANSITION_DURATION} style={styles.trailingIcon} key="drag">{((DragIcon) => <DragIcon />)((require(6247) /* metro dependency 6247: DragIcon */).DragIcon)}</FadeInOut> : <FadeInOut duration={MANAGE_EDIT_TRANSITION_DURATION} style={styles.trailingIcon} key="status">{((AccountStatusIcon) => <AccountStatusIcon user={a0} />)((require(14310) /* metro dependency 14310: AccountSwitcherListItem */).AccountStatusIcon)}</FadeInOut>}</TransitionGroup>;
defaultImportProps.delayLongPress = isEditing ? 100 : value2;
return <AccountSwitcherListItem {...defaultImportProps} key={a1} />;
}
function ManageAccountsOnPress() { // fn#111345, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:3970, owner: ManageAccounts.onPress, offset: 0x0239ef0f, size: 268 bytes, params: 1, frame: 20
var navigationBinding;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var value;
if (multiAccountUsers.length >= MAX_ACCOUNTS) {
value = importDefault(4496) /* metro dependency 4496: AlertActionCreators */;
value.show({title: intl.string(t.w7wfXi), body: intl.formatToPlainString(t.WOyelG,
{maxNumAccounts: MAX_ACCOUNTS}),
isDismissable: true});
} else {
navigationBinding = navigation;
navigationBinding.push(AuthStates.LOGIN);
value = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
value.track(AnalyticEvents.LOGIN_VIEWED, {source: 'multi_account_add_account'});
}
}
function ManageAccountsModalScreenOptions({navigation}) { // fn#111347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:4471, owner: ManageAccountsModal.screenOptions, offset: 0x0239f1a9, size: 134 bytes, params: 2, frame: 17
var r7;
var environment;
var r3;
var value3;
const object2 = {headerTitle: headerTitle_111348};
if (env0_1) {
r3 = undefined;
} else {
value3 = environment.__proto__;
r3 = require(dependencyMap[36]).getRenderModalCloseImage(navigation);
r7 = dependencyMap;
}
object2.headerLeft = r3;
object2.headerTitleAlign = 'center';
copyDataProperties(object2, env0_0, r7);
copyDataProperties(object2, importDefault(dependencyMap[37])(), r7);
return object2;
}
function ManageAccountsModalOptions() { // fn#111349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:4727, owner: ManageAccountsModal.options, offset: 0x0239f286, size: 194 bytes, params: 1, frame: 20
var environment;
const object2 = {};
let value = environment.__proto__;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const WbFpq4 = t.WbFpq4;
object2.title = Reflect.apply(string, intl, [WbFpq4]);
const binding = env0_1;
value = require(9603) /* metro dependency 9603: HeaderShared */;
const getRenderHeaderTextButton = value.getRenderHeaderTextButton;
string = intl.string;
object2.headerRight = binding ? Reflect.apply(getRenderHeaderTextButton, value, [Reflect.apply(string, intl,
[t.i4jeWR]), _fun111350]) : Reflect.apply(getRenderHeaderTextButton, value, [Reflect.apply(string, intl,
[t.bt75uw]), _fun111351]);
return object2;
}
function ManageAccountsModalChildren({navigation}) { // fn#111352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:4980, owner: ManageAccountsModal.children, offset: 0x0239f348, size: 49 bytes, params: 2, frame: 14
return <ManageAccounts isEditing={env0_1} navigation={navigation} />;
}
function ManageAccountsModalChildren_111354() { // fn#111354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:5174, owner: ManageAccountsModal.children, offset: 0x0239f3bd, size: 65 bytes, params: 1, frame: 15
var environment;
const value = environment.__proto__;
return ((Component) => <Component handleLogin={handleLogin_111355} onReset={onReset} />)(importDefault(14335) /* metro dependency 14335: AccountDisabledOrDeletionScheduled */);
}
function ManageAccountsModalChildren_111358() { // fn#111358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:5368, owner: ManageAccountsModal.children, offset: 0x0239f471, size: 46 bytes, params: 1, frame: 14
const value = environment.__proto__;
return ((Component) => <Component isMultiAccount />)(importDefault(8971) /* metro dependency 8971: Login */);
}
function ManageAccountsModalChildren_111360() { // fn#111360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:5469, owner: ManageAccountsModal.children, offset: 0x0239f49f, size: 39 bytes, params: 1, frame: 13
const value = environment.__proto__;
return ((Component) => <Component />)(importDefault(14334) /* metro dependency 14334: MFA */);
}
function* _fun111336() { // fn#111336, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:1105, offset: 0x0239e711, size: 362 bytes, params: 1, frame: 24
if (true) {
value = environment.__proto__.__proto__.__proto__;
var binding = env3_1;
var binding2 = env3_3;
var value3 = binding(binding2[17]);
var confirm = value3.confirm;
var object2 = {};
binding = env3_0;
var intl = binding(binding2[18]).intl;
var string = intl.string;
object2.title = Reflect.apply(string, intl, [binding(binding2[18]).t.n0Fbg6]);
intl = binding(binding2[18]).intl;
object2.body = intl.formatToPlainString(binding(binding2[18]).t.phEQmS, {username: importDefault});
intl = binding(binding2[18]).intl;
string = intl.string;
var N86XcP = binding(binding2[18]).t.N86XcP;
object2.confirmText = Reflect.apply(string, intl, [N86XcP]);
var ButtonColors = binding(binding2[16]).ButtonColors;
var RED = ButtonColors.RED;
object2.confirmColor = RED;
intl = binding(binding2[18]).intl;
object2.cancelText = intl.string(binding(binding2[18]).t['ETE/oC']);
object2.isDismissable = true;
yield Reflect.apply(confirm, value3, [object2]);
var value5 = undefined;
if (false) {
return value5;
}
if (value5) {
value = env3_2(env3_3[19]);
value.removeAccount(require.id);
}
}
}
function _fun111344() { // fn#111344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:2732, offset: 0x0239ee46, size: 201 bytes, params: 1, frame: 18
var tokenStatus;
var value2;
var navigationBinding;
const binding = env0_0;
let value = environment.__proto__;
if (!isEditing) {
if (binding.id !== currentUserId) {
tokenStatus = binding.tokenStatus;
value2 = environment.__proto__.__proto__;
if (tokenStatus === MultiAccountTokenStatus.INVALID) {
navigationBinding = navigation;
navigationBinding.push(AuthStates.LOGIN);
value = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
value.track(AnalyticEvents.LOGIN_VIEWED, {source: 'multi_account_invalid_user'});
} else {
value = importAll(11880) /* metro dependency 11880: MultiAccountActionCreators */;
value.switchAccount(binding.id, undefined, MultiAccountSwitchLocation.MANAGE_ACCOUNTS_MODAL);
}
}
}
}
function screenOptionsHeaderTitle_111348(a0) { // fn#111348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:4503, owner: ManageAccountsModal.screenOptions.headerTitle, offset: 0x0239f22f, size: 87 bytes, params: 2, frame: 16
const children = a0.children;
const value = Object.create(null);
value.children = 0;
const value2 = copyDataProperties({}, a0, value, children);
const GenericHeaderTitle = (require(9603) /* metro dependency 9603: HeaderShared */).GenericHeaderTitle;
return <GenericHeaderTitle title={children} {...value2} />;
}
function childrenHandleLogin(a0, a1, a2) { // fn#111355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:5202, owner: ManageAccountsModal.children.handleLogin, offset: 0x0239f3fe, size: 64 bytes, params: 4, frame: 13
const value = environment.__proto__.__proto__;
(importDefault(5076) /* metro dependency 5076: AuthenticationActionCreators */).login({login: a0, password: a1,
undelete: a2});
}
function onReset() { // fn#111356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14949:5269, owner: ManageAccountsModal.children.onReset, offset: 0x0239f43e, size: 40 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
(importDefault(5076) /* metro dependency 5076: AuthenticationActionCreators */).loginReset(true);
}
@@ -0,0 +1,148 @@
/* Metro module 15770; source: modules/multi_account/native/MultiAccountManagerNative.tsx; dependencies: [7, 6, 11876, 11877, 661, 3, 672, 5080, 15771, 1962, 4008, 1239, 15772, 683, 1230, 4013, 4007, 3857, 1244, 15773, 25, 2] */
function _fun121171(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:6, offset: 0x0253ffad, size: 423 bytes, params: 8, frame: 20
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importDefault(7) /* metro dependency 7 */;
const env0_3 = importDefault(6) /* metro dependency 6 */;
const multiAccountStore = importDefault(11876) /* metro dependency 11876: MultiAccountStore */;
const env0_5 = (require(11877) /* metro dependency 11877: Constants */).SWITCH_ACCOUNTS_MODAL_KEY;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_6 = constantsModule.AnalyticEvents;
const env0_7 = constantsModule.ComponentActions;
const env0_8 = constantsModule.Routes;
const value5 = new (importDefault(3) /* metro dependency 3: Logger */)('MultiAccountManagerNative');
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
const SECOND = Millis.SECOND;
const env0_10 = 15 * SECOND;
value = value(MultiAccountModalManagerImpl);
value = new value();
value = importDefault(15772) /* metro dependency 15772: MultiAccountManager */;
value = new value({onSwitchStart: onSwitchStart, onSwitchSuccess: function(a0, a1) {
var env0_0 = a0;
var env0_1 = a1;
global.setTimeout(_fun121181, 100);
}, onSwitchError: function() {
var defaultImport = importDefault(dependencyMap[17]);
var object = {key: 'SWITCH_ACCOUNTS_TOAST_LOGIN_ERROR'};
object.content = require(dependencyMap[18]).intl.string(require(dependencyMap[18]).t.pqvKWA);
object.icon = importDefault(dependencyMap[19]);
defaultImport.open(object);
}, onTokenSet: onTokenSet, onLogout: onLogout});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/native/MultiAccountManagerNative.tsx');
exports.default = value;
}
function MultiAccountModalManagerImpl() { // fn#121172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:344, offset: 0x02540154, size: 77 bytes, params: 1, frame: 14
env0_3(this, MultiAccountModalManagerImpl);
this.cancelled = false;
this.push = push_121173;
this.enqueue = enqueue;
this.pop = pop_121176;
}
function onSwitchStart() { // fn#121177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:818, offset: 0x0254030a, size: 114 bytes, params: 1, frame: 14
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).popWithKey(SWITCH_ACCOUNTS_MODAL_KEY);
env0_12.enqueue();
if (env0_11 !== null) {
global.clearTimeout(env0_11);
}
env0_11 = global.setTimeout(_fun121178, env0_10);
}
function onSwitchSuccess(a0, a1) { // fn#121180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:1212, offset: 0x02540428, size: 44 bytes, params: 3, frame: 13
const env0_0 = a0;
const env0_1 = a1;
global.setTimeout(_fun121181, 100);
}
function onTokenSet() { // fn#121183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:1701, offset: 0x025405ea, size: 44 bytes, params: 1, frame: 12
env0_12.pop();
global.clearTimeout(env0_11);
}
function onLogout(a0) { // fn#121184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:1746, offset: 0x02540616, size: 72 bytes, params: 2, frame: 12
if (a0.isSwitchingAccount) {
env0_9.info('Closing fast-connect socket because of account switch logout');
(require(25) /* metro dependency 25: fast_connect */).closeFastConnectSocket();
}
}
function MultiAccountModalManagerImplPush() { // fn#121173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:449, owner: MultiAccountModalManagerImpl.push, offset: 0x025401a1, size: 126 bytes, params: 1, frame: 18
const value = environment.__proto__;
const defaultImport = importDefault(dependencyMap[7]);
defaultImport.pushLazy(require(dependencyMap[9])(dependencyMap[8], dependencyMap.paths), {},
'switch-accounts-spinner-modal');
if (env0_0.cancelled) {
importDefault(dependencyMap[7]).popWithKey('switch-accounts-spinner-modal');
}
}
function enqueue() { // fn#121174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:551, owner: MultiAccountModalManagerImpl.enqueue, offset: 0x0254021f, size: 143 bytes, params: 1, frame: 15
const ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
env0_0.cancelled = false;
const rootNavigationRef = (require(4008) /* metro dependency 4008: RootNavigationRefNative */).getRootNavigationRef();
if (rootNavigationRef == null) {
ComponentDispatch.subscribeOnce(ComponentActions.NAVIGATOR_READY, _fun121175);
} else if (rootNavigationRef.isReady()) {
env0_0.push();
} else {
ComponentDispatch.subscribeOnce(ComponentActions.NAVIGATOR_READY, _fun121175);
}
}
function MultiAccountModalManagerImplPop() { // fn#121176, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:751, owner: MultiAccountModalManagerImpl.pop, offset: 0x025402cf, size: 59 bytes, params: 1, frame: 12
env0_0.cancelled = true;
const value = environment.__proto__;
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).popWithKey('switch-accounts-spinner-modal');
}
function _fun121178() { // fn#121178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:908, offset: 0x0254037c, size: 172 bytes, params: 1, frame: 19
var environment;
const value = environment.__proto__;
env1_12.pop();
const {previousUserId, expectedUserId, switchLocation,
hasEverConnected} = (require(15772) /* metro dependency 15772: MultiAccountManager */).getMultiAccountManagerState();
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const MULTI_ACCOUNT_SWITCH_TIMEOUT = AnalyticEvents.MULTI_ACCOUNT_SWITCH_TIMEOUT;
const object2 = {from_user_id: previousUserId, to_user_id: expectedUserId};
object2.linked_user_ids = MultiAccountStore.getUsers().map(function(a0) {
return a0.id;
});
object2.has_ever_connected = hasEverConnected;
object2.switch_origin = switchLocation;
Reflect.apply(track, defaultImport, [MULTI_ACCOUNT_SWITCH_TIMEOUT, object2]);
}
function _fun121181() { // fn#121181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:1245, offset: 0x02540454, size: 283 bytes, params: 1, frame: 20
var value2;
var moduleValue;
var MobileHomeDrawerExperiment;
if (require) {
value2 = environment.__proto__;
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
moduleValue.transitionTo(Routes.ME);
MobileHomeDrawerExperiment = (require(4013) /* metro dependency 4013: HomeDrawerExperiment */).MobileHomeDrawerExperiment;
if (MobileHomeDrawerExperiment.getConfig({location: 'multi-account'}).enableHome) {
(require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */).setHomeDrawerState(false);
}
}
const defaultImport = importDefault(3857) /* metro dependency 3857: ToastActionCreators */;
const open = defaultImport.open;
const object2 = {key: 'SWITCH_ACCOUNTS_TOAST_LOGIN_SUCCESS'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const formatToPlainString = intl.formatToPlainString;
const wx7O3L = (require(1244) /* metro dependency 1244: indexNative */).t.wx7O3L;
const username = env0_0.username;
object2.content = Reflect.apply(formatToPlainString, intl, [wx7O3L, {username: username}]);
object2.icon = importDefault(15773) /* metro dependency 15773 */;
Reflect.apply(open, defaultImport, [object2]);
}
function _fun121175() { // fn#121175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15978:705, offset: 0x025402ae, size: 33 bytes, params: 1, frame: 9
if (!env1_0.cancelled) {
env1_0.push();
}
}
@@ -0,0 +1,14 @@
/* Metro module 14751; source: modules/multi_account/native/openManageAccountsModal.tsx; dependencies: [11877, 4080, 5080, 14752, 1962, 2] */
function _fun111328(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#111328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14948:6, offset: 0x0239e1c8, size: 124 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(11877) /* metro dependency 11877: Constants */).SWITCH_ACCOUNTS_MODAL_KEY;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/native/openManageAccountsModal.tsx');
exports.default = function(a0) {
importDefault(dependencyMap[1]).hideActionSheet();
importDefault(dependencyMap[2]).pushLazy(require(dependencyMap[4])(dependencyMap[3], dependencyMap.paths),
{initialRouteName: a0}, SWITCH_ACCOUNTS_MODAL_KEY);
};
}
@@ -0,0 +1,137 @@
/* Metro module 10917; source: modules/multi_account/setUserStatus.tsx; dependencies: [5, 6611, 6876, 661, 3995, 1244, 10918, 1362, 1345, 3967, 683, 2] */
function _fun83660(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11103:6, offset: 0x01f22cb9, size: 183 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const lastMentionTimestampStore = importDefault(6611) /* metro dependency 6611: LastMentionTimestampStore */;
const selfPresenceStore = importDefault(6876) /* metro dependency 6876: SelfPresenceStore */;
const env0_6 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/setUserStatus.tsx');
exports.default = function() {
return _setUserStatus.apply(this, arguments);
};
}
function _setUserStatus() { // fn#83661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11103:151, offset: 0x01f22d70, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun83663).apply(this, arguments);
}
async function _fun83663({nextStatus, prevStatus, analyticsContext, durationMillis, disableTracking}) { // fn#83663, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11103:202, offset: 0x01f22db6, size: 785 bytes, params: 2, frame: 29
var r7;
var r8;
var binding;
var statusExpiryParts;
var kind;
var dateString;
var timeString;
var binding3;
var intl;
var object3;
var binding4;
var binding5;
var object4;
if (true) {
disableTracking = !(disableTracking === undefined) && disableTracking;
await undefined;
if (false) {
return undefined;
}
value = null;
r7 = value != prevStatus ? prevStatus : env2_5.getStatus();
var value6 = '0';
var r13 = value != durationMillis ? '' + (global.Date.now() + durationMillis) : value6;
binding = env2_0;
var binding2 = env2_2;
var PreloadedUserSettingsActionCreators = binding(binding2[7]).PreloadedUserSettingsActionCreators;
var updateAsync = PreloadedUserSettingsActionCreators.updateAsync;
var UserSettingsDelay = binding(binding2[7]).UserSettingsDelay;
var INFREQUENT_USER_ACTION = UserSettingsDelay.INFREQUENT_USER_ACTION;
await Reflect.apply(updateAsync, PreloadedUserSettingsActionCreators, ['status', _fun83664,
INFREQUENT_USER_ACTION]);
if (false) {
return undefined;
}
var value13 = env2_0(env2_2[4]).humanizeStatus(nextStatus);
if (value6 === r13) {
binding = env2_0;
binding5 = env2_2;
intl = binding(binding5[5]).intl;
r13 = intl.formatToPlainString(binding(binding5[5]).t.dO2aLi, {statusLabel: value13});
} else {
binding = env2_0;
statusExpiryParts = binding(env2_2[6]).getStatusExpiryParts(r13);
kind = statusExpiryParts.kind;
dateString = statusExpiryParts.dateString;
timeString = statusExpiryParts.timeString;
if (kind === 'today') {
binding = env2_0;
binding4 = env2_2;
intl = binding(binding4[5]).intl;
r13 = intl.formatToPlainString(binding(binding4[5]).t['r50t/S'], {statusLabel: value13,
timeString: timeString});
} else {
binding = env2_0;
binding3 = env2_2;
intl = binding(binding3[5]).intl;
r13 = intl.formatToPlainString(binding(binding3[5]).t['J+GJHv'], {statusLabel: value13,
dateString: dateString,
timeString: timeString});
}
}
var AccessibilityAnnouncer = env2_0(env2_2[9]).AccessibilityAnnouncer;
AccessibilityAnnouncer.announce(r13);
if (!disableTracking) {
object3 = {next_status: nextStatus, prev_status: r7};
binding = env2_4;
copyDataProperties(object3, binding.getGlobalStats(), undefined);
if (value == durationMillis) {
r8 = object3;
} else {
object4 = {};
copyDataProperties(object4, object3, undefined);
object4['expire_duration_minutes'] = value != durationMillis ? durationMillis / 60000 : value;
r8 = object4;
}
if (value == analyticsContext) {
r7 = r8;
} else {
object3 = {};
copyDataProperties(object3, r8, undefined);
copyDataProperties(object3, analyticsContext, undefined);
r7 = object3;
}
binding = env2_1;
value = binding(env2_2[10]);
value.track(env2_6.USER_STATUS_UPDATED, r7);
}
}
}
function _fun83664(a0) { // fn#83664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11103:433, offset: 0x01f230c7, size: 185 bytes, params: 2, frame: 18
var r1;
var UInt64Value;
let value = environment.__proto__.__proto__.__proto__;
const StringValue = env3_0(env3_2[8]).StringValue;
let create = StringValue.create;
const nextStatusBinding = nextStatus;
a0.status = Reflect.apply(create, StringValue, [{value: nextStatusBinding}]);
a0.statusExpiresAtMs = env0_2;
if (prevStatus !== nextStatusBinding) {
UInt64Value = env3_0(env3_2[8]).UInt64Value;
create = UInt64Value.create;
value = global.Date.now();
value = Reflect.apply(create, UInt64Value, [{value: '' + value}]);
r1 = value;
} else if (a0.statusCreatedAtMs != null) {
r1 = a0.statusCreatedAtMs;
} else {
UInt64Value = env3_0(env3_2[8]).UInt64Value;
create = UInt64Value.create;
value = global.Date.now();
value = Reflect.apply(create, UInt64Value, [{value: '' + value}]);
r1 = value;
}
a0.statusCreatedAtMs = r1;
}
@@ -0,0 +1,61 @@
/* Metro module 14309; source: modules/multi_account/useMultiAccount.tsx; dependencies: [31, 1878, 11876, 566, 694, 11880, 2] */
function _fun108301(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14506:6, offset: 0x0231b96a, size: 176 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importAll(31) /* metro dependency 31 */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const multiAccountStore = importDefault(11876) /* metro dependency 11876: MultiAccountStore */;
const env0_7 = (require(11876) /* metro dependency 11876: MultiAccountStore */).MultiAccountTokenStatus;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/multi_account/useMultiAccount.tsx');
exports.useMultiAccountUsers = useMultiAccountUsers;
}
function useMultiAccountUsers() { // fn#108302, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14506:258, offset: 0x0231ba1a, size: 94 bytes, params: 1, frame: 15
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([MultiAccountStore,
UserStore], _fun108303);
env0_4.useEffect(_fun108305, []);
return value2;
}
function _fun108303() { // fn#108303, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14506:336, offset: 0x0231ba78, size: 210 bytes, params: 1, frame: 17
var r0;
var object2;
var username;
var items2;
const users = MultiAccountStore.getUsers();
const currentUser = UserStore.getCurrentUser();
if (currentUser == null) {
object2 = {};
object2.isLoading = MultiAccountStore.getIsValidatingUsers();
object2.multiAccountUsers = users;
r0 = object2;
} else if (users.some(_fun108304)) {
object2 = {};
object2.isLoading = MultiAccountStore.getIsValidatingUsers();
object2.multiAccountUsers = users;
r0 = object2;
} else {
object2 = {};
object2.isLoading = MultiAccountStore.getIsValidatingUsers();
username = currentUser.username;
items2 = [{id: currentUser.id, avatar: currentUser.avatar, username: username,
discriminator: currentUser.discriminator, tokenStatus: MultiAccountTokenStatus.VALID, pushSyncToken: null}];
arraySpread(items2, users, 1, username);
object2.multiAccountUsers = items2;
r0 = object2;
}
return r0;
}
function _fun108305() { // fn#108305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14506:683, offset: 0x0231bb4a, size: 47 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
(importDefault(694) /* metro dependency 694: Dispatcher */).wait(_fun108306);
}
function _fun108306() { // fn#108306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14506:702, offset: 0x0231bb79, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__;
(importAll(11880) /* metro dependency 11880: MultiAccountActionCreators */).validateMultiAccountTokens();
}