decord/source/stores/AuthenticationStore.tsx

1219 lines
41 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 1218
// Function ID: 1219
// Name: fetchFingerprint
2026-08-25 06:04:03 +00:00
// Dependencies: [1219, 1220, 676, 1221, 3, 707, 595, 1222, 698, 13647, 709, 13648, 8632, 4279, 513, 13649, 1208, 11979, 589, 10530, 13650, 1371, 1955, 2]
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 1218 (fetchFingerprint)
2026-08-24 06:08:38 +00:00
import timestampDefault from "timestamp" /* 3 */;
import extractId from "extractId" /* 513 */;
import initializeDefault from "initialize" /* 589 */;
import Storage6 from "Storage" /* 595 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 698 */;
import setSecondaryTokenAll from "setSecondaryToken" /* 707 */;
import _modDef1208 from "module_1208" /* 1208 */;
import transitionTo from "transitionTo" /* 1222 */;
import getToken from "getToken" /* 1371 */;
2026-08-25 06:04:03 +00:00
import PermissionOverwriteType from "PermissionOverwriteType" /* 1955 */;
import prototypeDefault from "prototype" /* 4279 */;
import getAuthenticationErrorsFromAPIError from "getAuthenticationErrorsFromAPIError" /* 8632 */;
import isStaffDefault from "isStaff" /* 11979 */;
import fetchExperiments from "fetchExperiments" /* 13647 */;
2026-08-24 06:08:38 +00:00
import closure_6 from "initialize" /* 1219 */;
import closure_7 from "clearAll" /* 1220 */;
import ME from "ME" /* 676 */;
import result from "result" /* 1221 */;
import importDefaultResult from "dispatcher" /* 709 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function fetchFingerprint(arg0) {
let flag = arg0;
if (arg0 === undefined) {
flag = true;
}
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
closure_21 = Storage.get(fingerprint);
const Storage2 = Storage6.Storage;
2026-07-29 08:29:29 +00:00
let value = Storage2.get(analytics_installation);
if (null == value) {
const Storage3 = tmp(595).Storage;
value = Storage3.get("analytics_installation");
let tmp4 = null;
if (null != value) {
tmp4 = null;
if (value.length > 0) {
const Storage4 = tmp(595).Storage;
const result = Storage4.set(analytics_installation, value);
tmp4 = value;
}
}
value = tmp4;
}
2026-08-24 06:08:38 +00:00
c23 = value;
2026-07-29 08:29:29 +00:00
if (null != nextPromise) {
return nextPromise;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (null != closure_21) {
let token = closure_21;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
2026-07-20 16:05:17 +00:00
token = obj.getToken();
}
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(1222);
if (tmpResult.isValidFingerprintRoute()) {
2026-07-20 16:05:17 +00:00
if (flag) {
if (!handoffAvailable.isHandoffAvailable()) {
2026-07-29 08:29:29 +00:00
obj = {};
2026-08-24 06:08:38 +00:00
const superPropertiesBase64 = expandEventPropertiesDefault.getSuperPropertiesBase64();
2026-07-29 08:29:29 +00:00
if (null != superPropertiesBase64) {
obj["X-Super-Properties"] = superPropertiesBase64;
}
if (null != closure_21) {
obj["X-Fingerprint"] = closure_21;
}
if (null != c23) {
obj["X-Installation-ID"] = c23;
}
2026-08-25 06:04:03 +00:00
tmpResult = tmp(13647);
2026-07-29 08:29:29 +00:00
obj = { withGuildExperiments: null, headers: null, context: null };
obj[0] = true;
obj[1] = obj;
2026-08-24 06:08:38 +00:00
obj1 = { location: null };
const obj4 = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
obj1[0] = tmp(1222).getFingerprintLocation();
obj[2] = obj1;
const experiments = tmpResult.fetchExperiments(obj);
nextPromise = experiments.then((body) => {
body = body.body;
({ fingerprint, installation } = body);
let tmp = null != installation;
({ assignments, guild_experiments } = body);
if (tmp) {
tmp = installation.length > 0;
}
if (tmp) {
let obj = callback2(709);
obj = { type: "INSTALLATION_ID", installation: null };
obj[1] = installation;
obj.dispatch(obj);
}
if (fingerprint) {
obj = { type: "FINGERPRINT", fingerprint: null };
obj[1] = fingerprint;
callback2(709).dispatch(obj);
const obj3 = callback2(709);
}
callback2(709).dispatch({ type: "EXPERIMENTS_FETCH_SUCCESS", fingerprint, experiments: assignments, guildExperiments: guild_experiments });
2026-08-24 06:08:38 +00:00
c33 = null;
2026-07-29 08:29:29 +00:00
const obj5 = callback2(709);
2026-08-25 06:04:03 +00:00
callback(13648).onExperimentsLoaded();
2026-07-29 08:29:29 +00:00
}, () => {
2026-08-24 06:08:38 +00:00
c33 = null;
2026-07-29 08:29:29 +00:00
callback2(709).dispatch({ type: "EXPERIMENTS_FETCH_FAILURE" });
});
const tmpResult1 = tmp(1222);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return nextPromise;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
nextPromise = Promise.resolve();
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
function handleLogout(isSwitchingAccount) {
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose("handleLogout called.", obj);
2026-07-29 08:29:29 +00:00
const tmp2 = null != obj.getToken();
2026-08-24 06:08:38 +00:00
const obj3 = setSecondaryTokenAll;
const Storage2 = Storage6.Storage;
obj = { tokenManagerHasToken: null != setSecondaryTokenAll.getToken(), storageHasToken: null != Storage2.get(closure_12) };
closure_13.verbose("removeAuthToken called.", obj);
const tmp5 = null != setSecondaryTokenAll.getToken();
setSecondaryTokenAll.removeAnalyticsToken();
const obj5 = setSecondaryTokenAll;
2026-07-29 08:29:29 +00:00
let flag;
2026-08-24 06:08:38 +00:00
const obj6 = setSecondaryTokenAll;
2026-07-29 08:29:29 +00:00
if (isSwitchingAccount != null) {
flag = isSwitchingAccount.isSwitchingAccount;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag == null) {
flag = false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!flag) {
if (removeTokenResult) {
2026-08-24 06:08:38 +00:00
closure_22 = c21;
2026-07-29 08:29:29 +00:00
c21 = null;
const Storage3 = tmp3(595).Storage;
Storage3.remove(fingerprint);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
fetchFingerprint();
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const PersistedStore = initializeDefault.PersistedStore;
obj1 = { omit: ["InstallationManagerStore", "AgeGateStore", "NativePermissionsStore", "MultiAccountStore", "DraftStore", "OverlayStoreV2", "StreamerModeStore", "LoginRequiredActionStore", "LayoutStore", "OverlaySettingsStore", "ApexExperimentStore", "AccessibilityStore"], type: null };
2026-07-20 16:05:17 +00:00
isSwitchingAccount = undefined;
2026-07-29 08:29:29 +00:00
if (isSwitchingAccount != null) {
2026-07-20 16:05:17 +00:00
isSwitchingAccount = isSwitchingAccount.isSwitchingAccount;
}
let str = "all";
2026-07-29 08:29:29 +00:00
if (isSwitchingAccount) {
str = "user-data-only";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj1[1] = str;
PersistedStore.clearAll(obj1);
const Store = tmp14(589).Store;
2026-07-20 16:05:17 +00:00
const result = Store.removeAllConditionalListeners();
2026-08-24 06:08:38 +00:00
closure_7.clearAll();
removeTokenResult = setSecondaryTokenAll.removeToken();
_modDef1208.clearUser();
2026-07-29 08:29:29 +00:00
const Storage4 = tmp3(595).Storage;
Storage4.remove(user_id_cache);
2026-08-24 06:08:38 +00:00
c17 = null;
c18 = null;
2026-07-29 08:29:29 +00:00
let isSwitchingAccount1;
if (isSwitchingAccount != null) {
isSwitchingAccount1 = isSwitchingAccount.isSwitchingAccount;
}
2026-08-24 06:08:38 +00:00
closure_25 = isSwitchingAccount1 ? tmp22.LOGGING_IN : tmp22.NONE;
c28 = "";
c30 = null;
c29 = false;
c35 = false;
c36 = false;
2026-07-29 08:29:29 +00:00
const items = [];
if (c31) {
items.push({ type: "totp" });
}
if (c32) {
items.push({ type: "backup" });
}
if (c29) {
items.push({ type: "sms" });
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
({ AnalyticEvents: closure_8, LoginStates } = ME);
2026-07-29 08:29:29 +00:00
({ Platforms: c10, Routes: unpackModuleId, TOKEN_KEY: closure_12 } = ME);
2026-07-23 10:11:24 +00:00
({ EXISTING_USER_AGE_GATE_MODAL_KEY, NEW_USER_AGE_GATE_MODAL_KEY } = result);
2026-08-24 06:08:38 +00:00
let closure_13 = new timestampDefault("AuthenticationStore");
2026-07-23 10:11:24 +00:00
let fingerprint = "fingerprint";
const analytics_installation = "analytics_installation";
const user_id_cache = "user_id_cache";
2026-07-29 08:29:29 +00:00
let c17 = null;
let c18 = null;
let c19 = null;
let c20 = null;
let c21 = null;
2026-07-23 10:11:24 +00:00
let c22 = null;
let c23 = null;
let c24 = null;
let NONE = LoginStates.NONE;
2026-07-29 08:29:29 +00:00
let c26 = false;
let closure_27 = [];
let c28 = "";
let c29 = false;
let c30 = null;
2026-07-23 10:11:24 +00:00
let c31 = false;
2026-07-29 08:29:29 +00:00
let c32 = false;
let c33 = null;
let c34 = null;
let c35 = false;
2026-07-23 10:11:24 +00:00
let c36 = false;
2026-07-29 08:29:29 +00:00
let closure_37 = [];
2026-08-24 06:08:38 +00:00
let Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class AuthenticationStore extends Store {
}
const prototype = AuthenticationStore.prototype;
prototype["initialize"] = function initialize() {
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
closure_17 = Storage.get(user_id_cache);
const Storage2 = Storage6.Storage;
2026-07-29 08:29:29 +00:00
let value = Storage2.get(analytics_installation);
if (null == value) {
const Storage3 = tmp(595).Storage;
value = Storage3.get("analytics_installation");
let tmp4 = null;
if (null != value) {
tmp4 = null;
if (value.length > 0) {
const Storage4 = tmp(595).Storage;
const result = Storage4.set(analytics_installation, value);
tmp4 = value;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
value = tmp4;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const _null = value;
if (null == obj.getToken()) {
let tmp7 = null == _null;
if (!tmp7) {
tmp7 = 0 === _null.length;
}
if (tmp7) {
2026-07-20 16:05:17 +00:00
function fireApex() {
2026-08-25 06:04:03 +00:00
const installationExperiments = callback(10530).fetchInstallationExperiments(null);
2026-07-29 08:29:29 +00:00
}
promise.then(fireApex, fireApex);
}
promise = fetchFingerprint();
}
2026-08-25 06:04:03 +00:00
this.addChangeListener(() => callback(13650).setClientState(closure_17));
2026-07-29 08:29:29 +00:00
};
prototype["getLoginStatus"] = function getLoginStatus() {
return NONE;
};
prototype["getId"] = function getId() {
return c17;
};
prototype["getSessionId"] = function getSessionId() {
return c18;
};
prototype["getAuthSessionIdHash"] = function getAuthSessionIdHash() {
return c19;
};
prototype["getStaticAuthSessionId"] = function getStaticAuthSessionId() {
return c20;
};
prototype["getToken"] = function getToken() {
2026-08-24 06:08:38 +00:00
return getToken.getToken();
2026-07-29 08:29:29 +00:00
};
prototype["isAuthenticated"] = function isAuthenticated() {
2026-08-24 06:08:38 +00:00
return getToken.isAuthenticated();
2026-07-29 08:29:29 +00:00
};
prototype["getFingerprint"] = function getFingerprint() {
return c21;
};
prototype["getInstallationForTracking"] = function getInstallationForTracking() {
let tmp = null;
if (obj.canUseInstallationId()) {
tmp = c23;
}
return tmp;
};
prototype["getAnalyticsToken"] = function getAnalyticsToken() {
let analyticsToken = c24;
if (c24 == null) {
2026-08-24 06:08:38 +00:00
analyticsToken = setSecondaryTokenAll.getAnalyticsToken();
const obj = setSecondaryTokenAll;
2026-07-29 08:29:29 +00:00
}
return analyticsToken;
};
prototype["getMFATicket"] = function getMFATicket() {
return c28;
};
prototype["getMFAMethods"] = function getMFAMethods() {
return closure_37;
};
prototype["getLoginInstanceId"] = function getLoginInstanceId() {
return closure_5;
};
prototype["hasTOTPEnabled"] = function hasTOTPEnabled() {
2026-08-24 06:08:38 +00:00
return closure_27.includes(PermissionOverwriteType.AuthenticatorType.TOTP);
2026-07-29 08:29:29 +00:00
};
prototype["getCredentials"] = function getCredentials() {
if (null == closure_4) {
const _Error = Error;
2026-08-24 06:08:38 +00:00
error = new Error("no credentials");
2026-07-29 08:29:29 +00:00
throw error;
} else {
return closure_4;
}
};
prototype["allowLogoutRedirect"] = function allowLogoutRedirect() {
return !c26;
};
prototype["getSuspendedUserToken"] = function getSuspendedUserToken() {
return c34;
};
prototype["getIsPasswordlessActive"] = function getIsPasswordlessActive() {
return c35;
};
prototype["attemptedPasswordLogin"] = function attemptedPasswordLogin() {
return c36;
};
AuthenticationStore.displayName = "AuthenticationStore";
2026-08-24 06:08:38 +00:00
let tmp4 = new timestampDefault("AuthenticationStore");
const authenticationStore = new AuthenticationStore(importDefaultResult, {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen(arg0) {
2026-07-29 08:29:29 +00:00
({ user, analyticsToken, auth, apexExperiments } = arg0);
({ sessionId, authSessionIdHash, staticAuthSessionId } = arg0);
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose("handleConnectionOpen called", obj);
2026-07-29 08:29:29 +00:00
const tmp = importAll;
const tmp3 = null != obj.getToken();
2026-07-20 16:05:17 +00:00
({ id, username, email } = user);
2026-08-24 06:08:38 +00:00
_modDef1208.setUser(id, username, email, isStaffDefault(user));
const obj3 = _modDef1208;
setSecondaryTokenAll.setAnalyticsToken(analyticsToken);
2026-07-23 10:11:24 +00:00
id = user.id;
2026-07-20 16:05:17 +00:00
if (undefined !== auth) {
const authenticator_types = auth.authenticator_types;
}
2026-07-29 08:29:29 +00:00
const Storage2 = tmp4(595).Storage;
const result = Storage2.set(user_id_cache, user.id);
2026-07-20 16:05:17 +00:00
let installation;
2026-07-29 08:29:29 +00:00
if (apexExperiments != null) {
2026-07-20 16:05:17 +00:00
installation = apexExperiments.installation;
}
if (null != installation) {
2026-07-29 08:29:29 +00:00
installation = apexExperiments.installation;
if (null == installation) {
2026-08-25 06:04:03 +00:00
let tmp6Result = tmp6(13649);
2026-07-29 08:29:29 +00:00
if (tmp6Result.canUseInstallationId()) {
const Storage3 = tmp4(595).Storage;
const result1 = Storage3.set(analytics_installation, installation);
}
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const Storage4 = tmp4(595).Storage;
if (Storage4.get(constants.APP_FIRST_LOGIN, true)) {
tmp6Result = tmp6(698);
obj = { platform: null };
obj[0] = constants2.IOS;
tmp6Result.track(tmp15.APP_FIRST_LOGIN, obj);
const Storage5 = tmp4(595).Storage;
const result2 = Storage5.set(tmp15.APP_FIRST_LOGIN, false);
2026-07-20 16:05:17 +00:00
}
},
OVERLAY_INITIALIZE: function handleOverlayInitialize(arg0) {
({ user, analyticsToken } = arg0);
({ sessionId, token } = arg0);
2026-08-24 06:08:38 +00:00
let obj = _modDef1208;
2026-07-20 16:05:17 +00:00
({ id, username, email } = user);
2026-08-24 06:08:38 +00:00
obj.setUser(id, username, email, isStaffDefault(user));
2026-07-29 08:29:29 +00:00
const id2 = user.id;
2026-08-24 06:08:38 +00:00
const obj2 = setSecondaryTokenAll;
2026-07-29 08:29:29 +00:00
const tmp = importDefault;
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
obj = { tokenManagerHasToken: null != setSecondaryTokenAll.getToken(), storageHasToken: null != Storage.get(closure_12) };
closure_13.verbose("setAuthToken called.", obj);
2026-07-29 08:29:29 +00:00
let tmp8 = null != id2;
if (tmp8) {
tmp8 = id2 === id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp8) {
let tmp4Result = tmp4(707);
tmp4Result.removeAnalyticsToken();
}
tmp4Result = tmp4(707);
tmp4Result.setToken(token, id2);
2026-07-20 16:05:17 +00:00
if (null != analyticsToken) {
2026-07-29 08:29:29 +00:00
tmp4(707).setAnalyticsToken(analyticsToken);
const tmp4Result1 = tmp4(707);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_22 = c21;
2026-07-29 08:29:29 +00:00
c21 = null;
const Storage2 = tmp6(595).Storage;
Storage2.remove(fingerprint);
2026-07-23 10:11:24 +00:00
id = user.id;
2026-07-29 08:29:29 +00:00
const Storage3 = tmp6(595).Storage;
const result = Storage3.set(user_id_cache, user.id);
2026-07-20 16:05:17 +00:00
},
CONNECTION_CLOSED: function handleConnectionClosed(code) {
code = code.code;
2026-07-29 08:29:29 +00:00
const combined = "handleConnectionClosed called with code " + code + ".";
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose(combined, obj);
2026-07-20 16:05:17 +00:00
if (4004 === code) {
2026-07-29 08:29:29 +00:00
if (c26) {
c26 = true;
handleLogout();
2026-08-24 06:08:38 +00:00
importDefaultResult.wait(() => {
2026-07-29 08:29:29 +00:00
callback(1222).transitionTo(constants.REGISTER);
});
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { user_id: null };
2026-08-24 06:08:38 +00:00
const Storage2 = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj[0] = Storage2.get(user_id_cache);
2026-08-24 06:08:38 +00:00
expandEventPropertiesDefault.track(constants.APP_USER_DEAUTHENTICATED, obj);
2026-07-20 16:05:17 +00:00
handleLogout();
const _setImmediate = setImmediate;
2026-07-29 08:29:29 +00:00
setImmediate(() => callback(1222).transitionTo(constants.DEFAULT_LOGGED_OUT));
2026-08-24 06:08:38 +00:00
const obj3 = expandEventPropertiesDefault;
2026-07-20 16:05:17 +00:00
}
}
},
AUTH_SESSION_CHANGE: function handleAuthSessionChange(authSessionIdHash) {
authSessionIdHash = authSessionIdHash.authSessionIdHash;
},
LOGIN: function handleLogin(arg0) {
2026-07-23 10:11:24 +00:00
const LOGGING_IN = LoginStates.LOGGING_IN;
2026-08-24 06:08:38 +00:00
let tmp2 = closure_36;
if (!closure_36) {
2026-07-20 16:05:17 +00:00
tmp2 = true === tmp;
}
2026-08-24 06:08:38 +00:00
closure_36 = tmp2;
2026-07-20 16:05:17 +00:00
},
LOGIN_SUCCESS: function handleLoginSuccess(token) {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.NONE;
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose("setAuthToken called.", obj);
2026-07-29 08:29:29 +00:00
const tmp = null != obj.getToken();
2026-08-24 06:08:38 +00:00
setSecondaryTokenAll.removeAnalyticsToken();
const obj3 = setSecondaryTokenAll;
setSecondaryTokenAll.setToken(token.token, undefined);
closure_22 = c21;
2026-07-29 08:29:29 +00:00
c21 = null;
2026-08-24 06:08:38 +00:00
const Storage2 = Storage6.Storage;
2026-07-29 08:29:29 +00:00
Storage2.remove(fingerprint);
2026-08-24 06:08:38 +00:00
c28 = "";
c29 = false;
c30 = null;
c5 = null;
2026-07-29 08:29:29 +00:00
const items = [];
if (c31) {
items.push({ type: "totp" });
}
if (c32) {
items.push({ type: "backup" });
}
if (c29) {
items.push({ type: "sms" });
}
2026-08-24 06:08:38 +00:00
c35 = false;
2026-07-20 16:05:17 +00:00
},
LOGIN_FAILURE: function handleLoginFailure(error) {
2026-08-24 06:08:38 +00:00
c28 = "";
c29 = false;
c30 = null;
c5 = null;
2026-07-29 08:29:29 +00:00
const items = [];
if (c31) {
items.push({ type: "totp" });
}
if (c32) {
items.push({ type: "backup" });
}
if (c29) {
items.push({ type: "sms" });
}
2026-07-20 16:05:17 +00:00
if (null != obj.getAuthenticationErrorsFromV6OrEarlierAPIError(error.error).date_of_birth) {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.LOGIN_AGE_GATE;
2026-07-20 16:05:17 +00:00
} else {
NONE = LoginStates.NONE;
}
},
LOGIN_MFA_STEP: function handleLoginMFAStep(arg0) {
({ ticket, webauthn } = arg0);
if (null != ticket) {
2026-08-24 06:08:38 +00:00
c29 = tmp;
2026-07-29 08:29:29 +00:00
if (webauthn == null) {
webauthn = null;
}
2026-08-24 06:08:38 +00:00
c32 = tmp2;
c31 = tmp3;
closure_5 = tmp4;
2026-07-29 08:29:29 +00:00
const items = [];
2026-07-20 16:05:17 +00:00
if (null != webauthn) {
2026-07-29 08:29:29 +00:00
const obj = { type: "webauthn", challenge: null };
obj[1] = webauthn;
items.push(obj);
}
if (c31) {
items.push({ type: "totp" });
}
if (c32) {
items.push({ type: "backup" });
}
if (c29) {
items.push({ type: "sms" });
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
const MFA_STEP = LoginStates.MFA_STEP;
2026-07-20 16:05:17 +00:00
},
LOGIN_MFA: function handleLoginMFA() {
2026-07-23 10:11:24 +00:00
const LOGGING_IN_MFA = LoginStates.LOGGING_IN_MFA;
2026-07-20 16:05:17 +00:00
},
LOGIN_ACCOUNT_SCHEDULED_FOR_DELETION: function handleLoginAccountPendingDeletion(credentials) {
2026-08-24 06:08:38 +00:00
closure_25 = LoginStates.ACCOUNT_SCHEDULED_FOR_DELETION;
2026-07-20 16:05:17 +00:00
credentials = credentials.credentials;
},
LOGIN_ACCOUNT_DISABLED: function handleLoginAccountDisabled(credentials) {
2026-07-23 10:11:24 +00:00
const ACCOUNT_DISABLED = LoginStates.ACCOUNT_DISABLED;
2026-07-20 16:05:17 +00:00
credentials = credentials.credentials;
},
LOGIN_PASSWORD_RECOVERY_PHONE_VERIFICATION: function handleLoginPasswordRecoveryPhoneVerification(credentials) {
2026-08-24 06:08:38 +00:00
closure_25 = LoginStates.PASSWORD_RECOVERY_PHONE_VERIFICATION;
2026-07-20 16:05:17 +00:00
credentials = credentials.credentials;
},
LOGIN_PHONE_IP_AUTHORIZATION_REQUIRED: function handleLoginPhoneIPAuthorizationRequired(credentials) {
2026-07-23 10:11:24 +00:00
const PHONE_IP_AUTHORIZATION = LoginStates.PHONE_IP_AUTHORIZATION;
2026-07-20 16:05:17 +00:00
credentials = credentials.credentials;
},
LOGIN_RESET: function handleLoginReset(isMultiAccount) {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.NONE;
c28 = "";
c29 = false;
c30 = null;
c5 = null;
c4 = null;
2026-07-20 16:05:17 +00:00
if (!isMultiAccount.isMultiAccount) {
2026-07-29 08:29:29 +00:00
const items = [];
if (c31) {
items.push({ type: "totp" });
}
if (c32) {
items.push({ type: "backup" });
}
if (c29) {
items.push({ type: "sms" });
}
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null, storageHasToken: null };
obj[0] = null != obj.getToken();
obj[1] = null != Storage.get(closure_12);
2026-08-24 06:08:38 +00:00
closure_13.verbose("removeAuthToken called.", obj);
2026-07-29 08:29:29 +00:00
const tmp9 = null != obj.getToken();
2026-08-24 06:08:38 +00:00
setSecondaryTokenAll.removeAnalyticsToken();
const obj3 = setSecondaryTokenAll;
setSecondaryTokenAll.removeToken();
2026-07-20 16:05:17 +00:00
fetchFingerprint(false);
2026-08-24 06:08:38 +00:00
const obj4 = setSecondaryTokenAll;
2026-07-20 16:05:17 +00:00
}
},
LOGIN_STATUS_RESET: function handleLoginStatusReset() {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.NONE;
2026-07-20 16:05:17 +00:00
},
LOGIN_SUSPENDED_USER: function handleSuspendedUserLogin(suspendedUserToken) {
2026-08-24 06:08:38 +00:00
c35 = false;
2026-07-20 16:05:17 +00:00
suspendedUserToken = suspendedUserToken.suspendedUserToken;
2026-07-29 08:29:29 +00:00
setImmediate(() => callback(table[7]).transitionTo(constants.ACCOUNT_STANDING));
2026-07-20 16:05:17 +00:00
},
LOGOUT: handleLogout,
FINGERPRINT: function handleFingerprint(fingerprint) {
fingerprint = fingerprint.fingerprint;
2026-07-23 10:11:24 +00:00
if (null == fingerprint) {
2026-07-20 16:05:17 +00:00
if (null != fingerprint) {
let extractIdResult = null;
2026-07-23 10:11:24 +00:00
if (null != fingerprint) {
2026-08-24 06:08:38 +00:00
extractIdResult = extractId.extractId(fingerprint);
const obj6 = extractId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { old_fingerprint: null, new_fingerprint: null };
obj[0] = extractIdResult;
2026-08-24 06:08:38 +00:00
const obj5 = expandEventPropertiesDefault;
obj[1] = extractId.extractId(fingerprint);
2026-07-20 16:05:17 +00:00
obj5.track(constants.USER_FINGERPRINT_CHANGED, obj);
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
2026-07-23 10:11:24 +00:00
const result = Storage.set(fingerprint, fingerprint);
2026-08-24 06:08:38 +00:00
const obj8 = extractId;
2026-07-20 16:05:17 +00:00
} else {
fetchFingerprint();
}
} else {
let tmp2 = null != fingerprint;
if (tmp2) {
2026-07-23 10:11:24 +00:00
tmp2 = fingerprint !== fingerprint;
2026-07-20 16:05:17 +00:00
}
if (tmp2) {
2026-08-24 06:08:38 +00:00
obj = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
obj = { fingerprint: null, dropped_fingerprint: null };
2026-08-24 06:08:38 +00:00
obj[0] = extractId.extractId(fingerprint);
const obj3 = extractId;
obj[1] = extractId.extractId(fingerprint);
2026-07-20 16:05:17 +00:00
obj.track(constants.EXTERNAL_FINGERPRINT_DROPPED, obj);
2026-08-24 06:08:38 +00:00
const obj4 = extractId;
2026-07-29 08:29:29 +00:00
}
}
},
INSTALLATION_ID: function handleInstallationId(installation) {
installation = installation.installation;
if (null != installation) {
if (installation.length > 0) {
return false;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (obj.canUseInstallationId()) {
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
const result = Storage.set(analytics_installation, installation);
}
2026-07-20 16:05:17 +00:00
},
REGISTER_SUCCESS: function handleRegisterSuccess(token) {
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose("setAuthToken called.", obj);
2026-07-29 08:29:29 +00:00
const tmp = null != obj.getToken();
2026-08-24 06:08:38 +00:00
setSecondaryTokenAll.removeAnalyticsToken();
const obj3 = setSecondaryTokenAll;
setSecondaryTokenAll.setToken(token.token, undefined);
closure_22 = c21;
2026-07-29 08:29:29 +00:00
c21 = null;
2026-08-24 06:08:38 +00:00
const Storage2 = Storage6.Storage;
2026-07-29 08:29:29 +00:00
Storage2.remove(fingerprint);
2026-07-20 16:05:17 +00:00
},
FORGOT_PASSWORD_REQUEST: function handleForgotPasswordRequest() {
2026-07-23 10:11:24 +00:00
const FORGOT_PASSWORD = LoginStates.FORGOT_PASSWORD;
2026-07-20 16:05:17 +00:00
},
FORGOT_PASSWORD_SENT: function handleForgotPasswordSent() {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.NONE;
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
UPDATE_TOKEN: function handleUpdateToken(userId) {
userId = userId.userId;
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose("handleUpdateToken called", obj);
2026-07-29 08:29:29 +00:00
const tmp3 = null != obj.getToken();
2026-08-24 06:08:38 +00:00
const tmp4 = require;
const obj3 = setSecondaryTokenAll;
const Storage2 = Storage6.Storage;
obj = { tokenManagerHasToken: null != setSecondaryTokenAll.getToken(), storageHasToken: null != Storage2.get(closure_12) };
closure_13.verbose("setAuthToken called.", obj);
2026-07-29 08:29:29 +00:00
let tmp8 = null != userId;
if (tmp8) {
tmp8 = userId === c17;
}
if (!tmp8) {
let tmpResult = tmp(707);
tmpResult.removeAnalyticsToken();
}
tmpResult = tmp(707);
tmpResult.setToken(userId.token, userId);
2026-08-24 06:08:38 +00:00
closure_22 = c21;
2026-07-29 08:29:29 +00:00
c21 = null;
2026-08-24 06:08:38 +00:00
const Storage3 = Storage6.Storage;
2026-07-29 08:29:29 +00:00
Storage3.remove(fingerprint);
2026-07-20 16:05:17 +00:00
},
EXPERIMENTS_FETCH(withGuildExperiments) {
2026-07-29 08:29:29 +00:00
let obj = {};
2026-08-24 06:08:38 +00:00
const superPropertiesBase64 = expandEventPropertiesDefault.getSuperPropertiesBase64();
2026-07-29 08:29:29 +00:00
if (null != superPropertiesBase64) {
obj["X-Super-Properties"] = superPropertiesBase64;
}
if (null != c21) {
obj["X-Fingerprint"] = c21;
}
if (null != c23) {
obj["X-Installation-ID"] = c23;
}
2026-08-24 06:08:38 +00:00
const obj2 = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
obj = { withGuildExperiments: withGuildExperiments.withGuildExperiments, headers: obj, context: null };
obj = { location: null };
2026-08-24 06:08:38 +00:00
let obj3 = fetchExperiments;
obj[0] = transitionTo.getFingerprintLocation();
2026-07-29 08:29:29 +00:00
obj[2] = obj;
const experiments = obj3.fetchExperiments(obj);
2026-08-24 06:08:38 +00:00
closure_33 = experiments.then((body) => {
2026-07-29 08:29:29 +00:00
body = body.body;
({ fingerprint, installation } = body);
let tmp = null != installation;
({ assignments, guild_experiments } = body);
if (tmp) {
tmp = installation.length > 0;
}
if (tmp) {
let obj = callback2(709);
obj = { type: "INSTALLATION_ID", installation: null };
obj[1] = installation;
obj.dispatch(obj);
}
if (fingerprint) {
obj = { type: "FINGERPRINT", fingerprint: null };
obj[1] = fingerprint;
callback2(709).dispatch(obj);
const obj3 = callback2(709);
}
callback2(709).dispatch({ type: "EXPERIMENTS_FETCH_SUCCESS", fingerprint, experiments: assignments, guildExperiments: guild_experiments });
2026-08-24 06:08:38 +00:00
c33 = null;
2026-07-29 08:29:29 +00:00
const obj5 = callback2(709);
2026-08-25 06:04:03 +00:00
callback(13648).onExperimentsLoaded();
2026-07-29 08:29:29 +00:00
}, () => {
2026-08-24 06:08:38 +00:00
c33 = null;
2026-07-29 08:29:29 +00:00
callback2(709).dispatch({ type: "EXPERIMENTS_FETCH_FAILURE" });
});
2026-07-20 16:05:17 +00:00
},
CURRENT_USER_UPDATE: function handleUserUpdate(user) {
user = user.user;
const id = user.id;
if (undefined !== user.authenticator_types) {
const authenticator_types = user.authenticator_types;
}
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
2026-07-23 10:11:24 +00:00
const result = Storage.set(user_id_cache, user.id);
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
AGE_GATE_LOGOUT_UNDERAGE_NEW_USER: function handleAgeGateUnderage() {
2026-08-24 06:08:38 +00:00
c26 = true;
2026-07-29 08:29:29 +00:00
handleLogout();
2026-08-24 06:08:38 +00:00
importDefaultResult.wait(() => {
2026-07-29 08:29:29 +00:00
callback(1222).transitionTo(constants.REGISTER);
});
},
2026-07-20 16:05:17 +00:00
CLOSE_SUSPENDED_USER: function handleSuspendedUserClosed() {
2026-08-24 06:08:38 +00:00
c34 = null;
NONE = LoginStates.NONE;
2026-07-20 16:05:17 +00:00
handleLogout();
2026-07-29 08:29:29 +00:00
setImmediate(() => callback(table[7]).transitionTo(constants.DEFAULT_LOGGED_OUT));
2026-07-20 16:05:17 +00:00
},
PASSWORDLESS_FAILURE: function handlePasswordlessFailure(error) {
error = error.error;
2026-08-24 06:08:38 +00:00
c28 = "";
c29 = false;
c30 = null;
c35 = false;
c5 = null;
if (error instanceof prototypeDefault) {
2026-07-20 16:05:17 +00:00
if (null != obj.getAuthenticationErrorsFromAPIError(error).date_of_birth) {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.LOGIN_AGE_GATE;
2026-07-20 16:05:17 +00:00
} else {
NONE = LoginStates.NONE;
}
2026-08-24 06:08:38 +00:00
obj = getAuthenticationErrorsFromAPIError;
2026-07-20 16:05:17 +00:00
} else {
NONE = LoginStates.NONE;
}
},
PASSWORDLESS_START: function handlePasswordlessStart() {
2026-08-24 06:08:38 +00:00
c35 = true;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
}, require("dispatcher").DispatchBand.Early);
let obj = {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen(arg0) {
2026-07-29 08:29:29 +00:00
({ user, analyticsToken, auth, apexExperiments } = arg0);
({ sessionId, authSessionIdHash, staticAuthSessionId } = arg0);
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose("handleConnectionOpen called", obj);
2026-07-29 08:29:29 +00:00
const tmp = importAll;
const tmp3 = null != obj.getToken();
2026-07-20 16:05:17 +00:00
({ id, username, email } = user);
2026-08-24 06:08:38 +00:00
_modDef1208.setUser(id, username, email, isStaffDefault(user));
const obj3 = _modDef1208;
setSecondaryTokenAll.setAnalyticsToken(analyticsToken);
2026-07-23 10:11:24 +00:00
id = user.id;
2026-07-20 16:05:17 +00:00
if (undefined !== auth) {
const authenticator_types = auth.authenticator_types;
}
2026-07-29 08:29:29 +00:00
const Storage2 = tmp4(595).Storage;
const result = Storage2.set(user_id_cache, user.id);
2026-07-20 16:05:17 +00:00
let installation;
2026-07-29 08:29:29 +00:00
if (apexExperiments != null) {
2026-07-20 16:05:17 +00:00
installation = apexExperiments.installation;
}
if (null != installation) {
2026-07-29 08:29:29 +00:00
installation = apexExperiments.installation;
if (null == installation) {
2026-08-25 06:04:03 +00:00
let tmp6Result = tmp6(13649);
2026-07-29 08:29:29 +00:00
if (tmp6Result.canUseInstallationId()) {
const Storage3 = tmp4(595).Storage;
const result1 = Storage3.set(analytics_installation, installation);
}
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const Storage4 = tmp4(595).Storage;
if (Storage4.get(constants.APP_FIRST_LOGIN, true)) {
tmp6Result = tmp6(698);
obj = { platform: null };
obj[0] = constants2.IOS;
tmp6Result.track(tmp15.APP_FIRST_LOGIN, obj);
const Storage5 = tmp4(595).Storage;
const result2 = Storage5.set(tmp15.APP_FIRST_LOGIN, false);
2026-07-20 16:05:17 +00:00
}
},
OVERLAY_INITIALIZE: function handleOverlayInitialize(arg0) {
({ user, analyticsToken } = arg0);
({ sessionId, token } = arg0);
2026-08-24 06:08:38 +00:00
let obj = _modDef1208;
2026-07-20 16:05:17 +00:00
({ id, username, email } = user);
2026-08-24 06:08:38 +00:00
obj.setUser(id, username, email, isStaffDefault(user));
2026-07-29 08:29:29 +00:00
const id2 = user.id;
2026-08-24 06:08:38 +00:00
const obj2 = setSecondaryTokenAll;
2026-07-29 08:29:29 +00:00
const tmp = importDefault;
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
obj = { tokenManagerHasToken: null != setSecondaryTokenAll.getToken(), storageHasToken: null != Storage.get(closure_12) };
closure_13.verbose("setAuthToken called.", obj);
2026-07-29 08:29:29 +00:00
let tmp8 = null != id2;
if (tmp8) {
tmp8 = id2 === id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp8) {
let tmp4Result = tmp4(707);
tmp4Result.removeAnalyticsToken();
}
tmp4Result = tmp4(707);
tmp4Result.setToken(token, id2);
2026-07-20 16:05:17 +00:00
if (null != analyticsToken) {
2026-07-29 08:29:29 +00:00
tmp4(707).setAnalyticsToken(analyticsToken);
const tmp4Result1 = tmp4(707);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_22 = c21;
2026-07-29 08:29:29 +00:00
c21 = null;
const Storage2 = tmp6(595).Storage;
Storage2.remove(fingerprint);
2026-07-23 10:11:24 +00:00
id = user.id;
2026-07-29 08:29:29 +00:00
const Storage3 = tmp6(595).Storage;
const result = Storage3.set(user_id_cache, user.id);
2026-07-20 16:05:17 +00:00
},
CONNECTION_CLOSED: function handleConnectionClosed(code) {
code = code.code;
2026-07-29 08:29:29 +00:00
const combined = "handleConnectionClosed called with code " + code + ".";
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose(combined, obj);
2026-07-20 16:05:17 +00:00
if (4004 === code) {
2026-07-29 08:29:29 +00:00
if (c26) {
c26 = true;
handleLogout();
2026-08-24 06:08:38 +00:00
importDefaultResult.wait(() => {
2026-07-29 08:29:29 +00:00
callback(1222).transitionTo(constants.REGISTER);
});
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { user_id: null };
2026-08-24 06:08:38 +00:00
const Storage2 = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj[0] = Storage2.get(user_id_cache);
2026-08-24 06:08:38 +00:00
expandEventPropertiesDefault.track(constants.APP_USER_DEAUTHENTICATED, obj);
2026-07-20 16:05:17 +00:00
handleLogout();
const _setImmediate = setImmediate;
2026-07-29 08:29:29 +00:00
setImmediate(() => callback(1222).transitionTo(constants.DEFAULT_LOGGED_OUT));
2026-08-24 06:08:38 +00:00
const obj3 = expandEventPropertiesDefault;
2026-07-20 16:05:17 +00:00
}
}
},
AUTH_SESSION_CHANGE: function handleAuthSessionChange(authSessionIdHash) {
authSessionIdHash = authSessionIdHash.authSessionIdHash;
},
LOGIN: function handleLogin(arg0) {
2026-07-23 10:11:24 +00:00
const LOGGING_IN = LoginStates.LOGGING_IN;
2026-08-24 06:08:38 +00:00
let tmp2 = closure_36;
if (!closure_36) {
2026-07-20 16:05:17 +00:00
tmp2 = true === tmp;
}
2026-08-24 06:08:38 +00:00
closure_36 = tmp2;
2026-07-20 16:05:17 +00:00
},
LOGIN_SUCCESS: function handleLoginSuccess(token) {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.NONE;
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose("setAuthToken called.", obj);
2026-07-29 08:29:29 +00:00
const tmp = null != obj.getToken();
2026-08-24 06:08:38 +00:00
setSecondaryTokenAll.removeAnalyticsToken();
const obj3 = setSecondaryTokenAll;
setSecondaryTokenAll.setToken(token.token, undefined);
closure_22 = c21;
2026-07-29 08:29:29 +00:00
c21 = null;
2026-08-24 06:08:38 +00:00
const Storage2 = Storage6.Storage;
2026-07-29 08:29:29 +00:00
Storage2.remove(fingerprint);
2026-08-24 06:08:38 +00:00
c28 = "";
c29 = false;
c30 = null;
c5 = null;
2026-07-29 08:29:29 +00:00
const items = [];
if (c31) {
items.push({ type: "totp" });
}
if (c32) {
items.push({ type: "backup" });
}
if (c29) {
items.push({ type: "sms" });
}
2026-08-24 06:08:38 +00:00
c35 = false;
2026-07-20 16:05:17 +00:00
},
LOGIN_FAILURE: function handleLoginFailure(error) {
2026-08-24 06:08:38 +00:00
c28 = "";
c29 = false;
c30 = null;
c5 = null;
2026-07-29 08:29:29 +00:00
const items = [];
if (c31) {
items.push({ type: "totp" });
}
if (c32) {
items.push({ type: "backup" });
}
if (c29) {
items.push({ type: "sms" });
}
2026-07-20 16:05:17 +00:00
if (null != obj.getAuthenticationErrorsFromV6OrEarlierAPIError(error.error).date_of_birth) {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.LOGIN_AGE_GATE;
2026-07-20 16:05:17 +00:00
} else {
NONE = LoginStates.NONE;
}
},
LOGIN_MFA_STEP: function handleLoginMFAStep(arg0) {
({ ticket, webauthn } = arg0);
if (null != ticket) {
2026-08-24 06:08:38 +00:00
c29 = tmp;
2026-07-29 08:29:29 +00:00
if (webauthn == null) {
webauthn = null;
}
2026-08-24 06:08:38 +00:00
c32 = tmp2;
c31 = tmp3;
closure_5 = tmp4;
2026-07-29 08:29:29 +00:00
const items = [];
2026-07-20 16:05:17 +00:00
if (null != webauthn) {
2026-07-29 08:29:29 +00:00
const obj = { type: "webauthn", challenge: null };
obj[1] = webauthn;
items.push(obj);
}
if (c31) {
items.push({ type: "totp" });
}
if (c32) {
items.push({ type: "backup" });
}
if (c29) {
items.push({ type: "sms" });
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
const MFA_STEP = LoginStates.MFA_STEP;
2026-07-20 16:05:17 +00:00
},
LOGIN_MFA: function handleLoginMFA() {
2026-07-23 10:11:24 +00:00
const LOGGING_IN_MFA = LoginStates.LOGGING_IN_MFA;
2026-07-20 16:05:17 +00:00
},
LOGIN_ACCOUNT_SCHEDULED_FOR_DELETION: function handleLoginAccountPendingDeletion(credentials) {
2026-08-24 06:08:38 +00:00
closure_25 = LoginStates.ACCOUNT_SCHEDULED_FOR_DELETION;
2026-07-20 16:05:17 +00:00
credentials = credentials.credentials;
},
LOGIN_ACCOUNT_DISABLED: function handleLoginAccountDisabled(credentials) {
2026-07-23 10:11:24 +00:00
const ACCOUNT_DISABLED = LoginStates.ACCOUNT_DISABLED;
2026-07-20 16:05:17 +00:00
credentials = credentials.credentials;
},
LOGIN_PASSWORD_RECOVERY_PHONE_VERIFICATION: function handleLoginPasswordRecoveryPhoneVerification(credentials) {
2026-08-24 06:08:38 +00:00
closure_25 = LoginStates.PASSWORD_RECOVERY_PHONE_VERIFICATION;
2026-07-20 16:05:17 +00:00
credentials = credentials.credentials;
},
LOGIN_PHONE_IP_AUTHORIZATION_REQUIRED: function handleLoginPhoneIPAuthorizationRequired(credentials) {
2026-07-23 10:11:24 +00:00
const PHONE_IP_AUTHORIZATION = LoginStates.PHONE_IP_AUTHORIZATION;
2026-07-20 16:05:17 +00:00
credentials = credentials.credentials;
},
LOGIN_RESET: function handleLoginReset(isMultiAccount) {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.NONE;
c28 = "";
c29 = false;
c30 = null;
c5 = null;
c4 = null;
2026-07-20 16:05:17 +00:00
if (!isMultiAccount.isMultiAccount) {
2026-07-29 08:29:29 +00:00
const items = [];
if (c31) {
items.push({ type: "totp" });
}
if (c32) {
items.push({ type: "backup" });
}
if (c29) {
items.push({ type: "sms" });
}
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null, storageHasToken: null };
obj[0] = null != obj.getToken();
obj[1] = null != Storage.get(closure_12);
2026-08-24 06:08:38 +00:00
closure_13.verbose("removeAuthToken called.", obj);
2026-07-29 08:29:29 +00:00
const tmp9 = null != obj.getToken();
2026-08-24 06:08:38 +00:00
setSecondaryTokenAll.removeAnalyticsToken();
const obj3 = setSecondaryTokenAll;
setSecondaryTokenAll.removeToken();
2026-07-20 16:05:17 +00:00
fetchFingerprint(false);
2026-08-24 06:08:38 +00:00
const obj4 = setSecondaryTokenAll;
2026-07-20 16:05:17 +00:00
}
},
LOGIN_STATUS_RESET: function handleLoginStatusReset() {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.NONE;
2026-07-20 16:05:17 +00:00
},
LOGIN_SUSPENDED_USER: function handleSuspendedUserLogin(suspendedUserToken) {
2026-08-24 06:08:38 +00:00
c35 = false;
2026-07-20 16:05:17 +00:00
suspendedUserToken = suspendedUserToken.suspendedUserToken;
2026-07-29 08:29:29 +00:00
setImmediate(() => callback(table[7]).transitionTo(constants.ACCOUNT_STANDING));
2026-07-20 16:05:17 +00:00
},
LOGOUT: handleLogout,
FINGERPRINT: function handleFingerprint(fingerprint) {
fingerprint = fingerprint.fingerprint;
2026-07-23 10:11:24 +00:00
if (null == fingerprint) {
2026-07-20 16:05:17 +00:00
if (null != fingerprint) {
let extractIdResult = null;
2026-07-23 10:11:24 +00:00
if (null != fingerprint) {
2026-08-24 06:08:38 +00:00
extractIdResult = extractId.extractId(fingerprint);
const obj6 = extractId;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { old_fingerprint: null, new_fingerprint: null };
obj[0] = extractIdResult;
2026-08-24 06:08:38 +00:00
const obj5 = expandEventPropertiesDefault;
obj[1] = extractId.extractId(fingerprint);
2026-07-20 16:05:17 +00:00
obj5.track(constants.USER_FINGERPRINT_CHANGED, obj);
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
2026-07-23 10:11:24 +00:00
const result = Storage.set(fingerprint, fingerprint);
2026-08-24 06:08:38 +00:00
const obj8 = extractId;
2026-07-20 16:05:17 +00:00
} else {
fetchFingerprint();
}
} else {
let tmp2 = null != fingerprint;
if (tmp2) {
2026-07-23 10:11:24 +00:00
tmp2 = fingerprint !== fingerprint;
2026-07-20 16:05:17 +00:00
}
if (tmp2) {
2026-08-24 06:08:38 +00:00
obj = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
obj = { fingerprint: null, dropped_fingerprint: null };
2026-08-24 06:08:38 +00:00
obj[0] = extractId.extractId(fingerprint);
const obj3 = extractId;
obj[1] = extractId.extractId(fingerprint);
2026-07-20 16:05:17 +00:00
obj.track(constants.EXTERNAL_FINGERPRINT_DROPPED, obj);
2026-08-24 06:08:38 +00:00
const obj4 = extractId;
2026-07-29 08:29:29 +00:00
}
}
},
INSTALLATION_ID: function handleInstallationId(installation) {
installation = installation.installation;
if (null != installation) {
if (installation.length > 0) {
return false;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (obj.canUseInstallationId()) {
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
const result = Storage.set(analytics_installation, installation);
}
2026-07-20 16:05:17 +00:00
},
REGISTER_SUCCESS: function handleRegisterSuccess(token) {
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose("setAuthToken called.", obj);
2026-07-29 08:29:29 +00:00
const tmp = null != obj.getToken();
2026-08-24 06:08:38 +00:00
setSecondaryTokenAll.removeAnalyticsToken();
const obj3 = setSecondaryTokenAll;
setSecondaryTokenAll.setToken(token.token, undefined);
closure_22 = c21;
2026-07-29 08:29:29 +00:00
c21 = null;
2026-08-24 06:08:38 +00:00
const Storage2 = Storage6.Storage;
2026-07-29 08:29:29 +00:00
Storage2.remove(fingerprint);
2026-07-20 16:05:17 +00:00
},
FORGOT_PASSWORD_REQUEST: function handleForgotPasswordRequest() {
2026-07-23 10:11:24 +00:00
const FORGOT_PASSWORD = LoginStates.FORGOT_PASSWORD;
2026-07-20 16:05:17 +00:00
},
FORGOT_PASSWORD_SENT: function handleForgotPasswordSent() {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.NONE;
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
UPDATE_TOKEN: function handleUpdateToken(userId) {
userId = userId.userId;
2026-08-24 06:08:38 +00:00
let obj = setSecondaryTokenAll;
const Storage = Storage6.Storage;
2026-07-29 08:29:29 +00:00
obj = { tokenManagerHasToken: null != obj.getToken(), storageHasToken: null != Storage.get(closure_12) };
2026-08-24 06:08:38 +00:00
closure_13.verbose("handleUpdateToken called", obj);
2026-07-29 08:29:29 +00:00
const tmp3 = null != obj.getToken();
2026-08-24 06:08:38 +00:00
const tmp4 = require;
const obj3 = setSecondaryTokenAll;
const Storage2 = Storage6.Storage;
obj = { tokenManagerHasToken: null != setSecondaryTokenAll.getToken(), storageHasToken: null != Storage2.get(closure_12) };
closure_13.verbose("setAuthToken called.", obj);
2026-07-29 08:29:29 +00:00
let tmp8 = null != userId;
if (tmp8) {
tmp8 = userId === c17;
}
if (!tmp8) {
let tmpResult = tmp(707);
tmpResult.removeAnalyticsToken();
}
tmpResult = tmp(707);
tmpResult.setToken(userId.token, userId);
2026-08-24 06:08:38 +00:00
closure_22 = c21;
2026-07-29 08:29:29 +00:00
c21 = null;
2026-08-24 06:08:38 +00:00
const Storage3 = Storage6.Storage;
2026-07-29 08:29:29 +00:00
Storage3.remove(fingerprint);
2026-07-20 16:05:17 +00:00
},
EXPERIMENTS_FETCH(withGuildExperiments) {
2026-07-29 08:29:29 +00:00
let obj = {};
2026-08-24 06:08:38 +00:00
const superPropertiesBase64 = expandEventPropertiesDefault.getSuperPropertiesBase64();
2026-07-29 08:29:29 +00:00
if (null != superPropertiesBase64) {
obj["X-Super-Properties"] = superPropertiesBase64;
}
if (null != c21) {
obj["X-Fingerprint"] = c21;
}
if (null != c23) {
obj["X-Installation-ID"] = c23;
}
2026-08-24 06:08:38 +00:00
const obj2 = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
obj = { withGuildExperiments: withGuildExperiments.withGuildExperiments, headers: obj, context: null };
obj = { location: null };
2026-08-24 06:08:38 +00:00
let obj3 = fetchExperiments;
obj[0] = transitionTo.getFingerprintLocation();
2026-07-29 08:29:29 +00:00
obj[2] = obj;
const experiments = obj3.fetchExperiments(obj);
2026-08-24 06:08:38 +00:00
closure_33 = experiments.then((body) => {
2026-07-29 08:29:29 +00:00
body = body.body;
({ fingerprint, installation } = body);
let tmp = null != installation;
({ assignments, guild_experiments } = body);
if (tmp) {
tmp = installation.length > 0;
}
if (tmp) {
let obj = callback2(709);
obj = { type: "INSTALLATION_ID", installation: null };
obj[1] = installation;
obj.dispatch(obj);
}
if (fingerprint) {
obj = { type: "FINGERPRINT", fingerprint: null };
obj[1] = fingerprint;
callback2(709).dispatch(obj);
const obj3 = callback2(709);
}
callback2(709).dispatch({ type: "EXPERIMENTS_FETCH_SUCCESS", fingerprint, experiments: assignments, guildExperiments: guild_experiments });
2026-08-24 06:08:38 +00:00
c33 = null;
2026-07-29 08:29:29 +00:00
const obj5 = callback2(709);
2026-08-25 06:04:03 +00:00
callback(13648).onExperimentsLoaded();
2026-07-29 08:29:29 +00:00
}, () => {
2026-08-24 06:08:38 +00:00
c33 = null;
2026-07-29 08:29:29 +00:00
callback2(709).dispatch({ type: "EXPERIMENTS_FETCH_FAILURE" });
});
2026-07-20 16:05:17 +00:00
},
CURRENT_USER_UPDATE: function handleUserUpdate(user) {
user = user.user;
const id = user.id;
if (undefined !== user.authenticator_types) {
const authenticator_types = user.authenticator_types;
}
2026-08-24 06:08:38 +00:00
const Storage = Storage6.Storage;
2026-07-23 10:11:24 +00:00
const result = Storage.set(user_id_cache, user.id);
2026-07-20 16:05:17 +00:00
},
2026-07-29 08:29:29 +00:00
AGE_GATE_LOGOUT_UNDERAGE_NEW_USER: function handleAgeGateUnderage() {
2026-08-24 06:08:38 +00:00
c26 = true;
2026-07-29 08:29:29 +00:00
handleLogout();
2026-08-24 06:08:38 +00:00
importDefaultResult.wait(() => {
2026-07-29 08:29:29 +00:00
callback(1222).transitionTo(constants.REGISTER);
});
},
2026-07-20 16:05:17 +00:00
CLOSE_SUSPENDED_USER: function handleSuspendedUserClosed() {
2026-08-24 06:08:38 +00:00
c34 = null;
NONE = LoginStates.NONE;
2026-07-20 16:05:17 +00:00
handleLogout();
2026-07-29 08:29:29 +00:00
setImmediate(() => callback(table[7]).transitionTo(constants.DEFAULT_LOGGED_OUT));
2026-07-20 16:05:17 +00:00
},
PASSWORDLESS_FAILURE: function handlePasswordlessFailure(error) {
error = error.error;
2026-08-24 06:08:38 +00:00
c28 = "";
c29 = false;
c30 = null;
c35 = false;
c5 = null;
if (error instanceof prototypeDefault) {
2026-07-20 16:05:17 +00:00
if (null != obj.getAuthenticationErrorsFromAPIError(error).date_of_birth) {
2026-08-24 06:08:38 +00:00
NONE = LoginStates.LOGIN_AGE_GATE;
2026-07-20 16:05:17 +00:00
} else {
NONE = LoginStates.NONE;
}
2026-08-24 06:08:38 +00:00
obj = getAuthenticationErrorsFromAPIError;
2026-07-20 16:05:17 +00:00
} else {
NONE = LoginStates.NONE;
}
},
PASSWORDLESS_START: function handlePasswordlessStart() {
2026-08-24 06:08:38 +00:00
c35 = true;
2026-07-20 16:05:17 +00:00
}
};
2026-08-24 06:08:38 +00:00
result = require("set").fileFinishedImporting("stores/AuthenticationStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default authenticationStore;