This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

+18 -15
View File
@@ -1,25 +1,28 @@
/* Metro module 4245; source: modules/remote_auth/QRLoginUtils.tsx; dependencies: [1471, 2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun35274(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#35274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4417:6, offset: 0x0106d514, size: 115 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = RegExp('^\\/ra\\/([\\w-]+)$', '');
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/remote_auth/QRLoginUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/remote_auth/QRLoginUtils.tsx');
exports.findRemoteAuthFingerprint = findRemoteAuthFingerprint;
}
function findRemoteAuthFingerprint(a0, a1) { // fn#35275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4417:215, offset: 0x0106d587, size: 89 bytes, params: 3, frame: 15
var value3;
const value = null;
if (value != a0) {
if (value == a1) {
return value;
}
var defaultImport = importDefault(1471) /* metro dependency 1471: URLUtils */;
if (defaultImport.isDiscordHostname(a0)) {
value3 = a1.match(env0_2);
return value != value3 ? value3[1] : value;
function findRemoteAuthFingerprint(a0, a1) { // fn#35275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4417:215, offset: 0x0106d587, size: 89 bytes, params: 3, frame: 15
var value3;
const value = null;
if (value != a0) {
if (value == a1) {
return value;
}
var defaultImport = importDefault(1471) /* metro dependency 1471: URLUtils */;
if (defaultImport.isDiscordHostname(a0)) {
value3 = a1.match(env0_2);
return value != value3 ? value3[1] : value;
}
}
return value;
}
return value;
}
global.__d(_fun35274, 4245, [1471, 2]) /* metro module 4245, dependencies: [1471, 2] */;
@@ -1,93 +1,112 @@
/* Metro module 14348; source: modules/remote_auth/RemoteAuthCrypto.android.tsx; dependencies: [5, 6, 7, 14349, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import NativeRemoteAuthCryptoModule from '../../external/discord_common/js/packages/rtn-codegen/js/NativeRemoteAuthCryptoModule.tsx'; /* Metro dependency 14349 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun108596(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:6, offset: 0x02326f8d, size: 176 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(5) /* metro dependency 5 */;
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = {};
let value = _fun108597();
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/remote_auth/RemoteAuthCrypto.android.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/remote_auth/RemoteAuthCrypto.android.tsx');
exports.default = value;
}
function _fun108597() { // fn#108597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:133, offset: 0x0232703d, size: 242 bytes, params: 1, frame: 17
const AndroidRemoteAuthCrypto2 = AndroidRemoteAuthCrypto;
const binding2 = env0_2;
var env0_2 = binding2(_fun108600);
const items2 = [{key: 'generateRsaKeyPair', value: value_108601}];
items2[1] = {key: 'serializePublicKey', value: value_108602};
items2[2] = {key: 'publicKeyFingerprint', value: value_108603};
const env0_1 = binding2(_fun108605);
items2[3] = {key: 'decryptEncodedCiphertext', value: value_108607};
const env0_0 = binding2(_fun108609);
items2[4] = {key: 'decryptNonce', value: value_108611};
items2[5] = {key: 'release', value: value_108612};
return CreateClass(AndroidRemoteAuthCrypto2, items2);
function AndroidRemoteAuthCrypto() { // fn#108598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:154, offset: 0x011695d4, size: 27 bytes, params: 1, frame: 13
env1_3(this, AndroidRemoteAuthCrypto);
}
function _fun108597() { // fn#108597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:133, offset: 0x0232703d, size: 242 bytes, params: 1, frame: 17
const binding = env0_4;
const closure = AndroidRemoteAuthCrypto;
const binding2 = env0_2;
var env0_2 = binding2(_fun108600);
const items2 = [{key: 'generateRsaKeyPair', value: value_108601}];
items2[1] = {key: 'serializePublicKey', value: value_108602};
items2[2] = {key: 'publicKeyFingerprint', value: value_108603};
const env0_1 = binding2(_fun108605);
items2[3] = {key: 'decryptEncodedCiphertext', value: value_108607};
const env0_0 = binding2(_fun108609);
items2[4] = {key: 'decryptNonce', value: value_108611};
items2[5] = {key: 'release', value: value_108612};
return binding(closure, items2);
}
function* _fun108600() { // fn#108600, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:262, offset: 0x0232713a, size: 67 bytes, params: 1, frame: 13
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const value3 = env2_0(env2_1[3]);
yield value3.generateKeyPair();
if (false) {
return undefined;
}
return env2_5;
}
function value_108601() { // fn#108601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:318, offset: 0x00d6b059, size: 30 bytes, params: 1, frame: 13
return env0_2.apply(this, arguments);
}
function value_108602() { // fn#108602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:414, offset: 0x0232717d, size: 39 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (NativeRemoteAuthCryptoModule).getEncodedPublicKey();
}
function value_108603() { // fn#108603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:498, offset: 0x023271a4, size: 39 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (NativeRemoteAuthCryptoModule).getPublicKeyFingerprint();
}
function* _fun108605(a0, a1) { // fn#108605, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:596, offset: 0x023271d6, size: 144 bytes, params: 3, frame: 16
var environment;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
value = env2_0(env2_1[3]);
yield value.decrypt(a1);
if (false) {
return undefined;
}
const Uint8Array = global.Uint8Array;
const from = Uint8Array.from;
value = global.atob(value);
value = Reflect.apply(from, Uint8Array, [value, function(a0) {
return a0.charCodeAt(0);
}]);
const TextDecoder = global.TextDecoder;
const value4 = Object.create(TextDecoder.prototype, {constructor: {value: TextDecoder}});
const textDecoder = new TextDecoder();
return (textDecoder instanceof Object ? textDecoder : value4).decode(value);
}
function value_108607() { // fn#108607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:727, offset: 0x00c3b2ba, size: 30 bytes, params: 1, frame: 13
return env0_1.apply(this, arguments);
}
function* _fun108609(a0, a1) { // fn#108609, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:829, offset: 0x02327271, size: 84 bytes, params: 3, frame: 12
var environment;
if (true) {
value = environment.__proto__.__proto__;
value = env2_0(env2_1[3]);
value = value.decrypt(a1);
yield value.then(function(a0) {
return a0.replace(RegExp('\\/', 'g'), '_').replace(RegExp('\\+', 'g'), '-');
});
}
}
function value_108611() { // fn#108611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:930, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
function value_108612() { // fn#108612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:1009, offset: 0x02327304, size: 39 bytes, params: 1, frame: 11
const value = environment.__proto__;
(NativeRemoteAuthCryptoModule).releaseKeyPair();
}
function* _fun108600() { // fn#108600, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:262, offset: 0x0232713a, size: 67 bytes, params: 1, frame: 13
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const value3 = env2_0(env2_1[3]);
yield value3.generateKeyPair();
if (false) {
return undefined;
}
return env2_5;
}
function value_108602() { // fn#108602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:414, offset: 0x0232717d, size: 39 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (importDefault(14349) /* metro dependency 14349: NativeRemoteAuthCryptoModule */).getEncodedPublicKey();
}
function value_108603() { // fn#108603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:498, offset: 0x023271a4, size: 39 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (importDefault(14349) /* metro dependency 14349: NativeRemoteAuthCryptoModule */).getPublicKeyFingerprint();
}
function* _fun108605(a0, a1) { // fn#108605, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:596, offset: 0x023271d6, size: 144 bytes, params: 3, frame: 16
var environment;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
value = env2_0(env2_1[3]);
yield value.decrypt(a1);
if (false) {
return undefined;
}
const Uint8Array = global.Uint8Array;
const from = Uint8Array.from;
value = global.atob(value);
value = Reflect.apply(from, Uint8Array, [value, function(a0) {
return a0.charCodeAt(0);
}]);
const TextDecoder = global.TextDecoder;
const value4 = Object.create(TextDecoder.prototype, {constructor: {value: TextDecoder}});
const textDecoder = new TextDecoder();
return (textDecoder instanceof Object ? textDecoder : value4).decode(value);
}
function* _fun108609(a0, a1) { // fn#108609, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:829, offset: 0x02327271, size: 84 bytes, params: 3, frame: 12
var environment;
if (true) {
value = environment.__proto__.__proto__;
value = env2_0(env2_1[3]);
value = value.decrypt(a1);
yield value.then(function(a0) {
return a0.replace(RegExp('\\/', 'g'), '_').replace(RegExp('\\+', 'g'), '-');
});
}
}
function value_108612() { // fn#108612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14545:1009, offset: 0x02327304, size: 39 bytes, params: 1, frame: 11
const value = environment.__proto__;
(importDefault(14349) /* metro dependency 14349: NativeRemoteAuthCryptoModule */).releaseKeyPair();
}
global.__d(_fun108596, 14348, [5, 6, 7, 14349, 2]) /* metro module 14348, dependencies: [5, 6, 7, 14349, 2] */;
+51 -43
View File
@@ -1,11 +1,13 @@
/* Metro module 14350; source: modules/remote_auth/RemoteAuthUtils.tsx; dependencies: [57, 5, 1885, 14348, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import UserRecord from '../../records/UserRecord.tsx'; /* Metro dependency 1885 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun108614(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14547:6, offset: 0x0232739c, size: 187 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const env0_3 = importDefault(5) /* metro dependency 5 */;
const userRecord = importDefault(1885) /* metro dependency 1885: UserRecord */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/remote_auth/RemoteAuthUtils.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/remote_auth/RemoteAuthUtils.tsx');
exports.decodeEncodedUserRecord = function() {
return _decodeEncodedUserRecord.apply(this, arguments);
};
@@ -14,10 +16,48 @@ function _fun108614(global, require, importDefault, importAll, module, exports,
var Uint8Array = global.Uint8Array;
return Uint8Array.from((0, global.atob)(a0), _fun108621);
};
}
function _decodeEncodedUserRecord() { // fn#108615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14547:126, offset: 0x02327457, size: 50 bytes, params: 1, frame: 14
return Module00005(_fun108617).apply(this, arguments);
function* _fun108617(a0, a1) { // fn#108617, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14547:197, offset: 0x02327494, size: 243 bytes, params: 3, frame: 18
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const value3 = binding(env2_1[3]);
yield value3.decryptEncodedCiphertext(a0, a1);
const value4 = undefined;
if (false) {
return value4;
}
const value6 = value4.match(RegExp('^(\\d+):(\\d{1,4}):([a-zA-Z0-9_]+):(.*)$', ''));
const value7 = null;
if (value7 == value6) {
throw new global.Error('Invalid encoded user record.');
}
const value8 = env2_2(value6, 5);
const property = value8[1];
const property2 = value8[2];
const property3 = value8[3];
const property4 = value8[4];
binding = env2_4;
const object = {id: property, discriminator: property2};
object.avatar = property3 === '0' ? value7 : property3;
object.username = property4;
value = Object.create(binding.prototype, {constructor: {value: binding}});
const binding2 = new binding(object);
return binding2 instanceof Object ? binding2 : value;
}
}
function base64Decode_108620(a0) { // fn#108620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14547:870, offset: 0x02327632, size: 46 bytes, params: 2, frame: 14
const Uint8Array = global.Uint8Array;
return Uint8Array.from(global.atob(a0), function(a0) {
return a0.charCodeAt(0);
});
}
function _decodeEncodedUserRecord() { // fn#108615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14547:126, offset: 0x02327457, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun108617).apply(this, arguments);
}
function base64Encode_108619(a0) { // fn#108619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14547:714, offset: 0x02327587, size: 171 bytes, params: 2, frame: 16
@@ -35,41 +75,9 @@ function base64Encode_108619(a0) { // fn#108619, source: /ci/build/discord/disco
return uint8Array.replace(RegExp('={1,2}$', ''), '');
}
function base64Decode_108620(a0) { // fn#108620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14547:870, offset: 0x02327632, size: 46 bytes, params: 2, frame: 14
const Uint8Array = global.Uint8Array;
return Uint8Array.from(global.atob(a0), function(a0) {
return a0.charCodeAt(0);
});
}
function* _fun108617(a0, a1) { // fn#108617, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14547:197, offset: 0x02327494, size: 243 bytes, params: 3, frame: 18
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
let binding = env2_0;
const value3 = binding(env2_1[3]);
yield value3.decryptEncodedCiphertext(a0, a1);
const value4 = undefined;
if (false) {
return value4;
}
const value6 = value4.match(RegExp('^(\\d+):(\\d{1,4}):([a-zA-Z0-9_]+):(.*)$', ''));
const value7 = null;
if (value7 == value6) {
throw new global.Error('Invalid encoded user record.');
}
const value8 = env2_2(value6, 5);
const property = value8[1];
const property2 = value8[2];
const property3 = value8[3];
const property4 = value8[4];
binding = env2_4;
const object2 = {id: property, discriminator: property2};
object2.avatar = property3 === '0' ? value7 : property3;
object2.username = property4;
value = Object.create(binding.prototype, {constructor: {value: binding}});
const binding2 = new binding(object2);
return binding2 instanceof Object ? binding2 : value;
function _fun108621(a0) { // fn#108621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14547:927, offset: 0x00de9a52, size: 18 bytes, params: 2, frame: 11
return a0.charCodeAt(0);
}
global.__d(_fun108614, 14350, [57, 5, 1885, 14348,
2]) /* metro module 14350, dependencies: [57, 5, 1885, 14348, 2] */;
@@ -1,154 +1,227 @@
/* Metro module 14345; source: modules/remote_auth/components/native/CompanionRemoteAuth.tsx; dependencies: [31, 27, 661, 33, 4501, 14346, 5461, 4573, 1244, 4578, 1305, 3995, 1484, 4638, 683, 14347, 14351, 9001, 2] */
import GuildIDContext from '../../../guild/GuildIDContext.tsx'; /* Metro dependency 4638 */
import AuthFormView from '../../../auth/native/components/AuthFormView.tsx'; /* Metro dependency 9001 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as UseNavigationNativeModule from '../../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as TypingModule from '../../typing.tsx'; /* Metro dependency 14346 */
import * as UseAuthWebsocketModule from '../../useAuthWebsocket.tsx'; /* Metro dependency 14347 */
function _fun108558(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14542:6, offset: 0x023257aa, size: 324 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
let value = require(661) /* metro dependency 661: Constants */;
let value = ConstantsModule;
const env0_5 = value.AnalyticEvents;
const env0_6 = value.LoginSuccessfulSources;
value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.Fragment;
const env0_9 = value.jsxs;
const env0_10 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({statusContainer: {'alignItems': 'center',
const env0_10 = (CreateStylesModule).createStyles({statusContainer: {'alignItems': 'center',
'marginTop': 32}, avatar: {marginBottom: 16}, statusText: {'textAlign': 'center', 'marginTop': 16,
'marginBottom': 24, 'paddingHorizontal': 32}, buttonContainer: {'width': '100%', 'paddingHorizontal': 16,
'marginTop': 16}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/remote_auth/components/native/CompanionRemoteAuth.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/remote_auth/components/native/CompanionRemoteAuth.tsx');
exports.CompanionRemoteAuth = CompanionRemoteAuth;
}
function renderSteps(a0, a1, a2, a3) { // fn#108559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14542:466, offset: 0x023258ee, size: 1022 bytes, params: 5, frame: 30
var user;
var jsxRuntimeEnv0_8Binding;
var items3;
const Text = (TextModule).Text;
const intl = (IndexNativeModule).intl;
var string;
const t = (IndexNativeModule).t;
var format;
var Cbl5JK;
var object2;
const Button = (ButtonNativeModule).Button;
var items2;
const step = a0.step;
const RemoteAuthStep = (TypingModule).RemoteAuthStep;
const INITIALIZING = RemoteAuthStep.INITIALIZING;
if (INITIALIZING === step) {
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
const ActivityIndicator = (require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator;
items2 = [
<ActivityIndicator />,
];
string = intl.string;
items2[1] = (
<Text
style={a1.statusText}
variant="text-md/medium"
color="text-muted"
>
{Reflect.apply(string, intl, [t['7LkwqE']])}
</Text>
);
string = intl.string;
items2[2] = (
<View style={a1.buttonContainer}>
<Button
size="lg"
variant="tertiary"
text={Reflect.apply(string, intl, [t['ETE/oC']])}
onPress={a2}
/>
</View>
);
return (
<>
{items2}
</>
);
}
const PENDING_REMOTE_INIT = RemoteAuthStep.PENDING_REMOTE_INIT;
if (PENDING_REMOTE_INIT === step) {
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
const ActivityIndicator2 = (require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator;
items2 = [
<ActivityIndicator2 />,
];
string = intl.string;
items2[1] = (
<Text
style={a1.statusText}
variant="text-md/medium"
color="text-muted"
>
{Reflect.apply(string, intl, [t['7LkwqE']])}
</Text>
);
string = intl.string;
items2[2] = (
<View style={a1.buttonContainer}>
<Button
size="lg"
variant="tertiary"
text={Reflect.apply(string, intl, [t['ETE/oC']])}
onPress={a2}
/>
</View>
);
return (
<>
{items2}
</>
);
}
const PENDING_TICKET = RemoteAuthStep.PENDING_TICKET;
if (PENDING_TICKET === step) {
user = a0.user;
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
items3 = [
<Avatar
style={a1.avatar}
user={user}
size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.LARGE}
guildId={a3}
/>,
];
string = intl.string;
items3[1] = (
<Text variant="heading-lg/bold">
{Reflect.apply(string, intl, [t.apGCUT])}
</Text>
);
var textProps = {'style': null, 'variant': 'text-md/medium', 'color': 'text-muted', style: a1.statusText};
format = intl.format;
Cbl5JK = t.Cbl5JK;
object2 = {};
object2.username = (importDefault(3995) /* metro dependency 3995: UserUtils */).getUserTag(user);
items3[2] = (
<Text {...textProps}>
{Reflect.apply(format, intl, [Cbl5JK, object2])}
</Text>
);
string = intl.string;
items3[3] = (
<View style={a1.buttonContainer}>
<Button
size="lg"
variant="tertiary"
text={Reflect.apply(string, intl, [t['ETE/oC']])}
onPress={a2}
/>
</View>
);
return (
<>
{items3}
</>
);
}
const PENDING_LOGIN = RemoteAuthStep.PENDING_LOGIN;
if (PENDING_LOGIN === step) {
const ActivityIndicator3 = (require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator;
return <ActivityIndicator3 />;
}
const FINISH = RemoteAuthStep.FINISH;
if (FINISH === step) {
const ActivityIndicator4 = (require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator;
return <ActivityIndicator4 />;
}
}
function renderSteps(a0, a1, a2, a3) { // fn#108559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14542:466, offset: 0x023258ee, size: 1022 bytes, params: 5, frame: 30
var user;
var jsxRuntimeEnv0_8Binding;
var items3;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var format;
var Cbl5JK;
var object;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
var items2;
const step = a0.step;
const RemoteAuthStep = (require(14346) /* metro dependency 14346: typing */).RemoteAuthStep;
const INITIALIZING = RemoteAuthStep.INITIALIZING;
if (INITIALIZING === step) {
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
items2 = [((ActivityIndicator) => <ActivityIndicator />)((require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator)];
string = intl.string;
items2[1] = <Text style={a1.statusText} variant="text-md/medium" color="text-muted">{Reflect.apply(string, intl,
[t['7LkwqE']])}</Text>;
string = intl.string;
items2[2] = <View style={a1.buttonContainer}><Button size="lg" variant="tertiary" text={Reflect.apply(string,
intl,
[t['ETE/oC']])} onPress={a2} /></View>;
function CompanionRemoteAuth() { // fn#108560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14542:1732, offset: 0x02325cec, size: 381 bytes, params: 1, frame: 25
const styles = useStyles();
const value2 = (UseNavigationNativeModule).useNavigation();
let value3 = ReactModule.useContext(GuildIDContext);
const value4 = ReactModule.useCallback(function(a0) {
var value = a0;
var defaultImport = importDefault(dependencyMap[14]);
var track = defaultImport.track;
var LOGIN_SUCCESSFUL = AnalyticEvents.LOGIN_SUCCESSFUL;
var value3 = null;
Reflect.apply(track, defaultImport, [LOGIN_SUCCESSFUL, {'source': null, 'login_source': 'companion_remote_auth',
'is_new_user': false, 'login_method': 'quest_remote_auth', source: LoginSuccessfulSources.QR_CODE,
login_instance_id: value3 != value ? value : value3}]);
}, []);
const useAuthWebsocket = UseAuthWebsocketModule.useAuthWebsocket;
const state = Reflect.apply(useAuthWebsocket, UseAuthWebsocketModule, [value4, true]).state;
const value5 = ReactModule.useCallback(_fun108562, [value2]);
const step = state.step;
const RemoteAuthStep = (TypingModule).RemoteAuthStep;
const PENDING_REMOTE_INIT = RemoteAuthStep.PENDING_REMOTE_INIT;
ReactModule.useEffect(_fun108563, [step !== PENDING_REMOTE_INIT ? null : state.fingerprint]);
const intl = (IndexNativeModule).intl;
return (
<>
{items2}
</>
<AuthFormView headerText={intl.string((IndexNativeModule).t['7fNJgA'])}>
<View style={styles.statusContainer}>
{renderSteps(state, styles, value5, value3)}
</View>
</AuthFormView>
);
function _fun108562() { // fn#108562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14542:2081, offset: 0x022e84be, size: 21 bytes, params: 1, frame: 9
env0_0.goBack();
}
function _fun108563() { // fn#108563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14542:2197, offset: 0x02325ecb, size: 103 bytes, params: 1, frame: 13
var environment;
var value2;
var defaultImport;
if (fingerprint != null) {
value2 = environment.__proto__;
defaultImport = importDefault(14351) /* metro dependency 14351: NativeAuthenticationModule */;
defaultImport.sendAuthUrl('https://discord.com/ra/' + fingerprint).catch(function() {
var Error = global.Error;
throw new Error('Failed to initialize authentication');
});
}
}
}
const PENDING_REMOTE_INIT = RemoteAuthStep.PENDING_REMOTE_INIT;
if (PENDING_REMOTE_INIT === step) {
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
items2 = [((ActivityIndicator) => <ActivityIndicator />)((require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator)];
string = intl.string;
items2[1] = <Text style={a1.statusText} variant="text-md/medium" color="text-muted">{Reflect.apply(string, intl,
[t['7LkwqE']])}</Text>;
string = intl.string;
items2[2] = <View style={a1.buttonContainer}><Button size="lg" variant="tertiary" text={Reflect.apply(string,
intl,
[t['ETE/oC']])} onPress={a2} /></View>;
return (
<>
{items2}
</>
);
}
const PENDING_TICKET = RemoteAuthStep.PENDING_TICKET;
if (PENDING_TICKET === step) {
user = a0.user;
jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
items3 = [((Avatar) => <Avatar style={a1.avatar} user={user} size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.LARGE} guildId={a3} />)((require(1305) /* metro dependency 1305: native */).Avatar)];
string = intl.string;
items3[1] = <Text variant="heading-lg/bold">{Reflect.apply(string, intl, [t.apGCUT])}</Text>;
var textProps = {'style': null, 'variant': 'text-md/medium', 'color': 'text-muted', style: a1.statusText};
format = intl.format;
Cbl5JK = t.Cbl5JK;
object = {};
object.username = (importDefault(3995) /* metro dependency 3995: UserUtils */).getUserTag(user);
items3[2] = <Text {...textProps}>{Reflect.apply(format, intl, [Cbl5JK, object])}</Text>;
string = intl.string;
items3[3] = <View style={a1.buttonContainer}><Button size="lg" variant="tertiary" text={Reflect.apply(string,
intl,
[t['ETE/oC']])} onPress={a2} /></View>;
return (
<>
{items3}
</>
);
}
const PENDING_LOGIN = RemoteAuthStep.PENDING_LOGIN;
if (PENDING_LOGIN === step) {
const ActivityIndicator = (require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator;
return <ActivityIndicator />;
}
const FINISH = RemoteAuthStep.FINISH;
if (FINISH === step) {
const ActivityIndicator2 = (require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator;
return <ActivityIndicator2 />;
}
}
function CompanionRemoteAuth() { // fn#108560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14542:1732, offset: 0x02325cec, size: 381 bytes, params: 1, frame: 25
const styles = useStyles();
const value2 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
const binding = env0_3;
let value3 = binding.useContext(importDefault(4638) /* metro dependency 4638: GuildIDContext */);
const value4 = binding.useCallback(function(a0) {
var value = a0;
var defaultImport = importDefault(dependencyMap[14]);
var track = defaultImport.track;
var LOGIN_SUCCESSFUL = AnalyticEvents.LOGIN_SUCCESSFUL;
var value3 = null;
Reflect.apply(track, defaultImport, [LOGIN_SUCCESSFUL, {'source': null, 'login_source': 'companion_remote_auth',
'is_new_user': false, 'login_method': 'quest_remote_auth', source: LoginSuccessfulSources.QR_CODE,
login_instance_id: value3 != value ? value : value3}]);
}, []);
const useAuthWebsocketModule = require(14347) /* metro dependency 14347: useAuthWebsocket */;
const useAuthWebsocket = useAuthWebsocketModule.useAuthWebsocket;
const state = Reflect.apply(useAuthWebsocket, useAuthWebsocketModule, [value4, true]).state;
const value5 = binding.useCallback(_fun108562, [value2]);
const step = state.step;
const RemoteAuthStep = (require(14346) /* metro dependency 14346: typing */).RemoteAuthStep;
const PENDING_REMOTE_INIT = RemoteAuthStep.PENDING_REMOTE_INIT;
env0_3.useEffect(_fun108563, [step !== PENDING_REMOTE_INIT ? null : state.fingerprint]);
const AuthFormView = importDefault(9001) /* metro dependency 9001: AuthFormView */;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return (
<AuthFormView headerText={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7fNJgA'])}>
<View style={styles.statusContainer}>
{renderSteps(state, styles, value5, value3)}
</View>
</AuthFormView>
);
}
function _fun108563() { // fn#108563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14542:2197, offset: 0x02325ecb, size: 103 bytes, params: 1, frame: 13
var environment;
var value2;
var defaultImport;
if (fingerprint != null) {
value2 = environment.__proto__;
defaultImport = importDefault(14351) /* metro dependency 14351: NativeAuthenticationModule */;
defaultImport.sendAuthUrl('https://discord.com/ra/' + fingerprint).catch(function() {
var Error = global.Error;
throw new Error('Failed to initialize authentication');
});
}
}
global.__d(_fun108558, 14345, [31, 27, 661, 33, 4501, 14346, 5461, 4573, 1244, 4578, 1305, 3995, 1484, 4638, 683,
14347, 14351, 9001,
2]) /* metro module 14345, dependencies: [31, 27, 661, 33, 4501, 14346, 5461, 4573, 1244, 4578, 1305, 3995, 1484, 4638, 683, 14347, 14351, 9001, 2] */;
@@ -1,258 +1,356 @@
/* Metro module 12637; source: modules/remote_auth/components/native/RemoteAuthModal.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 1585, 12638, 12636, 5465, 507, 22, 12639, 4573, 1244, 1305, 6261, 4578, 5080, 12640, 12641, 5461, 2] */
import Module00022 from '../../../../by-id/module-00022.js'; /* Metro dependency 22 */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UseSafeAreaInsetsNative from '../../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import ModalActionCreators from '../../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import Module12636 from '../../../../by-id/module-12636.js'; /* Metro dependency 12636 */
import Module12638 from '../../../../by-id/module-12638.js'; /* Metro dependency 12638 */
import Module12639 from '../../../../by-id/module-12639.js'; /* Metro dependency 12639 */
import Module12640 from '../../../../by-id/module-12640.js'; /* Metro dependency 12640 */
import Module12641 from '../../../../by-id/module-12641.js'; /* Metro dependency 12641 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as HTTPUtilsModule from '../../../../external/discord_common/js/packages/http-utils/HTTPUtils.tsx'; /* Metro dependency 507 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as NativeModule from '../../../../design/void/native.tsx'; /* Metro dependency 1305 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as ActivityIndicatorNativeModule from '../../../../design/components/ActivityIndicator/native/ActivityIndicator.native.tsx'; /* Metro dependency 5461 */
import * as DeprecatedLayoutAnimationModule from '../../../animations/native/DeprecatedLayoutAnimation.tsx'; /* Metro dependency 5465 */
import * as ButtonGroupNativeModule from '../../../../design/components/ButtonGroup/native/ButtonGroup.native.tsx'; /* Metro dependency 6261 */
function _fun96931(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96931, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:6, offset: 0x0216c8c3, size: 689 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
let value = ReactNativeModule;
const env0_5 = value.ImageBackground;
const env0_6 = value.Image;
const env0_7 = value.View;
const env0_8 = (require(661) /* metro dependency 661: Constants */).Endpoints;
value = require(33) /* metro dependency 33 */;
const env0_9 = value.jsx;
const env0_10 = value.jsxs;
const env0_11 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {background: {'width': '100%', 'height': '100%'}, container: {'flex': 1, 'alignItems': 'stretch',
object = {background: {'width': '100%', 'height': '100%'}, container: {'flex': 1, 'alignItems': 'stretch',
'alignContent': 'center'}};
object2.imageStyle = {resizeMode: 'cover'};
object2.logo = {'position': 'absolute', 'top': 16, 'alignSelf': 'center', 'width': 32, 'height': 32};
object2.mainImage = {'marginTop': 16, 'marginBottom': 32};
object.imageStyle = {resizeMode: 'cover'};
object.logo = {'position': 'absolute', 'top': 16, 'alignSelf': 'center', 'width': 32, 'height': 32};
object.mainImage = {'marginTop': 16, 'marginBottom': 32};
const RED_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.RED_400;
object2.warningCaption = {'fontSize': 16, 'lineHeight': 20, 'color': null, 'textAlign': 'center', 'marginTop': 8,
object.warningCaption = {'fontSize': 16, 'lineHeight': 20, 'color': null, 'textAlign': 'center', 'marginTop': 8,
'marginBottom': 32, color: RED_400};
object2.caption = {'lineHeight': 20, 'textAlign': 'center', 'marginTop': 8, 'marginBottom': 32};
const object3 = {'display': 'flex', 'flexDirection': 'column', 'alignItems': 'center', 'backgroundColor': null,
object.caption = {'lineHeight': 20, 'textAlign': 'center', 'marginTop': 8, 'marginBottom': 32};
const object4 = {'display': 'flex', 'flexDirection': 'column', 'alignItems': 'center', 'backgroundColor': null,
'marginTop': 'auto', 'marginBottom': 'auto', 'marginLeft': 16, 'marginRight': 16, 'borderRadius': null,
'padding': 16, 'shadowColor': null, 'shadowOpacity': 0.16, 'shadowRadius': 2};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object3.backgroundColor = BACKGROUND_BASE_LOW;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object4.backgroundColor = BACKGROUND_BASE_LOW;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
const BLACK = (importDefault(697) /* metro dependency 697: native */).colors.BLACK;
object3.shadowColor = BLACK;
object3.shadowOffset = {'height': 2, 'width': 0};
object2.mainCard = object3;
object2.buttonGroup = {paddingVertical: 0};
object2.loadingContainer = {'height': 300, 'justifyContent': 'center'};
const env0_12 = Reflect.apply(createStyles, value, [object2]);
object2 = {LOADING: 0};
object2[0] = 'LOADING';
object2.NOT_FOUND = 1;
object2[1] = 'NOT_FOUND';
object2.LOADED = 2;
object2[2] = 'LOADED';
object2.SUCCEEDED = 3;
object2[3] = 'SUCCEEDED';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/remote_auth/components/native/RemoteAuthModal.tsx');
object4.shadowColor = BLACK;
object4.shadowOffset = {'height': 2, 'width': 0};
object.mainCard = object4;
object.buttonGroup = {paddingVertical: 0};
object.loadingContainer = {'height': 300, 'justifyContent': 'center'};
const env0_12 = Reflect.apply(createStyles, value, [object]);
object = {LOADING: 0};
object[0] = 'LOADING';
object.NOT_FOUND = 1;
object[1] = 'NOT_FOUND';
object.LOADED = 2;
object[2] = 'LOADED';
object.SUCCEEDED = 3;
object[3] = 'SUCCEEDED';
(FileImportTrackerModule).fileFinishedImporting('modules/remote_auth/components/native/RemoteAuthModal.tsx');
exports.default = RemoteAuth;
}
function RemoteAuthBody({remoteAuthFingerprint}) { // fn#96932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1246, offset: 0x0216cb74, size: 312 bytes, params: 2, frame: 20
const useState = ReactModule.useState;
let LOADING = env0_13.LOADING;
const value3 = Module00057(Reflect.apply(useState, ReactModule, [LOADING]), 2);
const property = value3[0];
const env0_1 = value3[1];
const [property2, env0_2] = Module00057(ReactModule.useState(null), 2);
const setAuthStep2 = setAuthStep;
ReactModule.useEffect(_fun96934, [remoteAuthFingerprint]);
LOADING = env0_13.LOADING;
if (LOADING === property) {
return <RemoteAuthLoading />;
}
const LOADED = env0_13.LOADED;
if (LOADED === property) {
return (
property2 == null
? (
<RemoteAuthNotFound />
)
: (
<RemoteAuthLogin handshakeToken={property2} setAuthStep={setAuthStep2} />
)
);
}
const SUCCEEDED = env0_13.SUCCEEDED;
if (SUCCEEDED === property) {
return <RemoteAuthLoginSucceeded />;
}
env0_13.NOT_FOUND;
return <RemoteAuthNotFound />;
function setAuthStep(a0) { // fn#96933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1407, owner: RemoteAuthBody.setAuthStep, offset: 0x0216ccac, size: 52 bytes, params: 2, frame: 12
env0_1(a0);
const value = environment.__proto__;
(DeprecatedLayoutAnimationModule).DeprecatedLayoutAnimation();
}
function _fun96934() { // fn#96934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1474, offset: 0x0216cce0, size: 125 bytes, params: 1, frame: 15
var environment;
let value = environment.__proto__;
const HTTP = (HTTPUtilsModule).HTTP;
const post = HTTP.post;
const REMOTE_AUTH_INITIALIZE = Endpoints.REMOTE_AUTH_INITIALIZE;
value = Reflect.apply(post, HTTP, [{url: REMOTE_AUTH_INITIALIZE, body: {fingerprint: remoteAuthFingerprint},
oldFormErrors: true, rejectWithError: true}]);
value = value.then(_fun96935);
value.catch(_fun96936);
function _fun96935({body}) { // fn#96935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1593, offset: 0x0216cd5d, size: 52 bytes, params: 2, frame: 12
env1_2(body.handshake_token);
const setAuthStepBinding = setAuthStep;
const LOADED = env2_13.LOADED;
setAuthStepBinding(LOADED);
}
function _fun96936() { // fn#96936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1658, offset: 0x0216cd91, size: 29 bytes, params: 1, frame: 11
const setAuthStepBinding = setAuthStep;
const NOT_FOUND = env2_13.NOT_FOUND;
setAuthStepBinding(NOT_FOUND);
}
}
function RemoteAuthBody({remoteAuthFingerprint}) { // fn#96932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1246, offset: 0x0216cb74, size: 312 bytes, params: 2, frame: 20
const binding = env0_4;
const useState = binding.useState;
let LOADING = env0_13.LOADING;
const value3 = env0_3(Reflect.apply(useState, binding, [LOADING]), 2);
const property = value3[0];
const env0_1 = value3[1];
const [property2, env0_2] = env0_3(env0_4.useState(null), 2);
const closure = setAuthStep;
env0_4.useEffect(_fun96934, [remoteAuthFingerprint]);
LOADING = env0_13.LOADING;
if (LOADING === property) {
return <RemoteAuthLoading />;
}
const LOADED = env0_13.LOADED;
if (LOADED === property) {
return property2 == null ? <RemoteAuthNotFound /> : <RemoteAuthLogin handshakeToken={property2} setAuthStep={closure} />;
function RemoteAuthLogin({handshakeToken, setAuthStep}) { // fn#96937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1982, offset: 0x0216cdae, size: 753 bytes, params: 2, frame: 32
const styles = useStyles();
const [property, env0_2] = env0_3Binding(ReactModule.useState(false), 2);
var [property2, env0_3] = env0_3Binding(ReactModule.useState(false), 2);
ReactModule.useEffect(function() {
var env0_0 = global.setTimeout(_fun96939, 1000);
return _fun96940;
}, []);
const value6 = (Module00022).throttle(_fun96941, 1000, {'leading': true,
'trailing': false});
const r19 = !property && !property2;
const jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
const items2 = [
<Image source={Module12639} style={styles.mainImage} />,
];
const Heading = (TextModule).Heading;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
items2[1] = (
<Heading variant="heading-md/extrabold">
{Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.jD2pqF])}
</Heading>
);
const LegacyText = (NativeModule).LegacyText;
items2[2] = (
<LegacyText style={styles.warningCaption}>
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['hcd/kh'])}
</LegacyText>
);
const ButtonGroup = (ButtonGroupNativeModule).ButtonGroup;
const Button = (ButtonNativeModule).Button;
string = intl.string;
const N3qV8e = (require(1244) /* metro dependency 1244: indexNative */).t.N3qV8e;
items2[3] = (
<ButtonGroup style={styles.buttonGroup}>
<Button
text={Reflect.apply(string, intl, [N3qV8e])}
onPress={value6}
disabled={r19}
key={'' + r19}
/>
<Button
variant="secondary"
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])}
onPress={onPress_96944}
/>
</ButtonGroup>
);
return (
<>
{items2}
</>
);
function _fun96938() { // fn#96938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2144, offset: 0x0216d09f, size: 44 bytes, params: 1, frame: 14
const env0_0 = global.setTimeout(_fun96939, 1000);
return _fun96940;
function _fun96939() { // fn#96939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2167, offset: 0x0216d0cb, size: 18 bytes, params: 1, frame: 11
env1_2(true);
}
function _fun96940() { // fn#96940, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2191, offset: 0x016d7e7e, size: 24 bytes, params: 1, frame: 11
return global.clearTimeout(env0_0);
}
}
function _fun96941() { // fn#96941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2242, offset: 0x0216d0dd, size: 134 bytes, params: 1, frame: 16
env0_3(true);
const HTTP = (HTTPUtilsModule).HTTP;
const post = HTTP.post;
const REMOTE_AUTH_FINISH = Endpoints.REMOTE_AUTH_FINISH;
let value = Reflect.apply(post, HTTP, [{url: REMOTE_AUTH_FINISH, body: {handshake_token: handshakeToken},
oldFormErrors: true, rejectWithError: true}]);
value = value.then(_fun96942);
value.catch(_fun96943);
function _fun96942() { // fn#96942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2367, offset: 0x0216d163, size: 29 bytes, params: 1, frame: 11
const setAuthStepBinding = setAuthStep;
const SUCCEEDED = env2_13.SUCCEEDED;
setAuthStepBinding(SUCCEEDED);
}
function _fun96943() { // fn#96943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2397, offset: 0x0216d180, size: 29 bytes, params: 1, frame: 11
const setAuthStepBinding = setAuthStep;
const NOT_FOUND = env2_13.NOT_FOUND;
setAuthStepBinding(NOT_FOUND);
}
}
function RemoteAuthLoginOnPress() { // fn#96944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2969, owner: RemoteAuthLogin.onPress, offset: 0x0216d19d, size: 114 bytes, params: 1, frame: 16
const value = environment.__proto__;
const HTTP = (HTTPUtilsModule).HTTP;
const post = HTTP.post;
const REMOTE_AUTH_CANCEL = Endpoints.REMOTE_AUTH_CANCEL;
Reflect.apply(post, HTTP, [{url: REMOTE_AUTH_CANCEL, body: {handshake_token: handshakeToken}, oldFormErrors: true,
rejectWithError: true}]);
(ModalActionCreators).pop();
}
}
const SUCCEEDED = env0_13.SUCCEEDED;
if (SUCCEEDED === property) {
return <RemoteAuthLoginSucceeded />;
function RemoteAuthLoginSucceeded() { // fn#96945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:3106, offset: 0x0216d20f, size: 447 bytes, params: 1, frame: 27
const styles = useStyles();
const jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
const items2 = [
<Image source={Module12640} style={styles.mainImage} />,
];
const Heading = (TextModule).Heading;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const HbwTOZ = (require(1244) /* metro dependency 1244: indexNative */).t.HbwTOZ;
items2[1] = (
<Heading variant="heading-xl/extrabold">
{Reflect.apply(string, intl, [HbwTOZ])}
</Heading>
);
const Text = (TextModule).Text;
items2[2] = (
<Text
style={styles.caption}
variant="text-md/medium"
color="text-muted"
>
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.wKknJ0)}
</Text>
);
const ButtonGroup = (ButtonGroupNativeModule).ButtonGroup;
const Button = (ButtonNativeModule).Button;
items2[3] = (
<ButtonGroup style={styles.buttonGroup}>
<Button
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.pYWLA0)}
onPress={(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop}
/>
</ButtonGroup>
);
return (
<>
{items2}
</>
);
}
env0_13.NOT_FOUND;
return <RemoteAuthNotFound />;
}
function RemoteAuthLogin({handshakeToken, setAuthStep}) { // fn#96937, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1982, offset: 0x0216cdae, size: 753 bytes, params: 2, frame: 32
const styles = useStyles();
const [property, env0_2] = env0_3Binding(env0_4.useState(false), 2);
var [property2, env0_3] = env0_3Binding(env0_4.useState(false), 2);
env0_4.useEffect(function() {
var env0_0 = global.setTimeout(_fun96939, 1000);
return _fun96940;
}, []);
const value6 = (importDefault(22) /* metro dependency 22 */).throttle(_fun96941, 1000, {'leading': true,
'trailing': false});
const r19 = !property && !property2;
const jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
const items2 = [<Image source={importDefault(12639) /* metro dependency 12639 */} style={styles.mainImage} />];
const Heading = (require(4573) /* metro dependency 4573: Text */).Heading;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
items2[1] = <Heading variant="heading-md/extrabold">{Reflect.apply(string, intl,
[(require(1244) /* metro dependency 1244: indexNative */).t.jD2pqF])}</Heading>;
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
items2[2] = <LegacyText style={styles.warningCaption}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['hcd/kh'])}</LegacyText>;
const ButtonGroup = (require(6261) /* metro dependency 6261: ButtonGroupNative */).ButtonGroup;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
string = intl.string;
const N3qV8e = (require(1244) /* metro dependency 1244: indexNative */).t.N3qV8e;
items2[3] = <ButtonGroup style={styles.buttonGroup}><Button text={Reflect.apply(string, intl,
[N3qV8e])} onPress={value6} disabled={r19} key={'' + r19} /><Button variant="secondary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])} onPress={onPress_96944} /></ButtonGroup>;
return (
<>
{items2}
</>
);
}
function RemoteAuthNotFound() { // fn#96946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:3590, offset: 0x0216d3ce, size: 445 bytes, params: 1, frame: 27
const styles = useStyles();
const jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
const items2 = [
<Image source={Module12641} style={styles.mainImage} />,
];
const Heading = (TextModule).Heading;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const NShI3Q = (require(1244) /* metro dependency 1244: indexNative */).t.NShI3Q;
items2[1] = (
<Heading variant="heading-xl/extrabold">
{Reflect.apply(string, intl, [NShI3Q])}
</Heading>
);
const Text = (TextModule).Text;
string = intl.string;
const Ygezov = (require(1244) /* metro dependency 1244: indexNative */).t.Ygezov;
items2[2] = (
<Text
style={styles.caption}
variant="text-md/medium"
color="text-muted"
>
{Reflect.apply(string, intl, [Ygezov])}
</Text>
);
const ButtonGroup = (ButtonGroupNativeModule).ButtonGroup;
const Button = (ButtonNativeModule).Button;
items2[3] = (
<ButtonGroup style={styles.buttonGroup}>
<Button
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])}
onPress={(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop}
/>
</ButtonGroup>
);
return (
<>
{items2}
</>
);
}
function RemoteAuthLoginSucceeded() { // fn#96945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:3106, offset: 0x0216d20f, size: 447 bytes, params: 1, frame: 27
const styles = useStyles();
const jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
const items2 = [<Image source={importDefault(12640) /* metro dependency 12640 */} style={styles.mainImage} />];
const Heading = (require(4573) /* metro dependency 4573: Text */).Heading;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const HbwTOZ = (require(1244) /* metro dependency 1244: indexNative */).t.HbwTOZ;
items2[1] = <Heading variant="heading-xl/extrabold">{Reflect.apply(string, intl, [HbwTOZ])}</Heading>;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2[2] = <Text style={styles.caption} variant="text-md/medium" color="text-muted">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.wKknJ0)}</Text>;
const ButtonGroup = (require(6261) /* metro dependency 6261: ButtonGroupNative */).ButtonGroup;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
items2[3] = <ButtonGroup style={styles.buttonGroup}><Button text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.pYWLA0)} onPress={(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop} /></ButtonGroup>;
return (
<>
{items2}
</>
);
}
function RemoteAuthNotFound() { // fn#96946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:3590, offset: 0x0216d3ce, size: 445 bytes, params: 1, frame: 27
const styles = useStyles();
const jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
const items2 = [<Image source={importDefault(12641) /* metro dependency 12641 */} style={styles.mainImage} />];
const Heading = (require(4573) /* metro dependency 4573: Text */).Heading;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const NShI3Q = (require(1244) /* metro dependency 1244: indexNative */).t.NShI3Q;
items2[1] = <Heading variant="heading-xl/extrabold">{Reflect.apply(string, intl, [NShI3Q])}</Heading>;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
string = intl.string;
const Ygezov = (require(1244) /* metro dependency 1244: indexNative */).t.Ygezov;
items2[2] = <Text style={styles.caption} variant="text-md/medium" color="text-muted">{Reflect.apply(string, intl,
[Ygezov])}</Text>;
const ButtonGroup = (require(6261) /* metro dependency 6261: ButtonGroupNative */).ButtonGroup;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
items2[3] = <ButtonGroup style={styles.buttonGroup}><Button text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])} onPress={(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop} /></ButtonGroup>;
return (
<>
{items2}
</>
);
}
function RemoteAuthLoading() { // fn#96947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:4071, offset: 0x0216d58b, size: 83 bytes, params: 1, frame: 17
const styles = useStyles();
const ActivityIndicator = (require(5461) /* metro dependency 5461: ActivityIndicatorNative */).ActivityIndicator;
return (
<View style={styles.loadingContainer}>
<ActivityIndicator />
</View>
);
}
function RemoteAuth(a0) { // fn#96948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:4293, offset: 0x0216d5de, size: 258 bytes, params: 2, frame: 24
const styles = useStyles();
return (
<ImageBackground
source={importDefault(12638) /* metro dependency 12638 */}
imageStyle={styles.imageStyle}
style={styles.background}
>
<Image
style={[styles.logo,
{marginTop: (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().top}]}
source={importDefault(12636) /* metro dependency 12636 */}
/>
<View style={styles.container}>
<View style={styles.mainCard}>
<RemoteAuthBody {...a0} />
</View>
function RemoteAuthLoading() { // fn#96947, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:4071, offset: 0x0216d58b, size: 83 bytes, params: 1, frame: 17
const styles = useStyles();
const ActivityIndicator = (ActivityIndicatorNativeModule).ActivityIndicator;
return (
<View style={styles.loadingContainer}>
<ActivityIndicator />
</View>
</ImageBackground>
);
}
);
}
function RemoteAuth(a0) { // fn#96948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:4293, offset: 0x0216d5de, size: 258 bytes, params: 2, frame: 24
const styles = useStyles();
return (
<ImageBackground
source={Module12638}
imageStyle={styles.imageStyle}
style={styles.background}
>
<Image
style={[styles.logo,
{marginTop: (UseSafeAreaInsetsNative)().top}]}
source={Module12636}
/>
<View style={styles.container}>
<View style={styles.mainCard}>
<RemoteAuthBody {...a0} />
</View>
</View>
</ImageBackground>
);
}
function setAuthStep(a0) { // fn#96933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1407, owner: RemoteAuthBody.setAuthStep, offset: 0x0216ccac, size: 52 bytes, params: 2, frame: 12
env0_1(a0);
const value = environment.__proto__;
(require(5465) /* metro dependency 5465: DeprecatedLayoutAnimation */).DeprecatedLayoutAnimation();
}
function _fun96934() { // fn#96934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1474, offset: 0x0216cce0, size: 125 bytes, params: 1, frame: 15
var environment;
let value = environment.__proto__;
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const post = HTTP.post;
const REMOTE_AUTH_INITIALIZE = Endpoints.REMOTE_AUTH_INITIALIZE;
value = Reflect.apply(post, HTTP, [{url: REMOTE_AUTH_INITIALIZE, body: {fingerprint: remoteAuthFingerprint},
oldFormErrors: true, rejectWithError: true}]);
value = value.then(_fun96935);
value.catch(_fun96936);
}
function _fun96938() { // fn#96938, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2144, offset: 0x0216d09f, size: 44 bytes, params: 1, frame: 14
const env0_0 = global.setTimeout(_fun96939, 1000);
return _fun96940;
}
function _fun96941() { // fn#96941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2242, offset: 0x0216d0dd, size: 134 bytes, params: 1, frame: 16
env0_3(true);
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const post = HTTP.post;
const REMOTE_AUTH_FINISH = Endpoints.REMOTE_AUTH_FINISH;
let value = Reflect.apply(post, HTTP, [{url: REMOTE_AUTH_FINISH, body: {handshake_token: handshakeToken},
oldFormErrors: true, rejectWithError: true}]);
value = value.then(_fun96942);
value.catch(_fun96943);
}
function RemoteAuthLoginOnPress() { // fn#96944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2969, owner: RemoteAuthLogin.onPress, offset: 0x0216d19d, size: 114 bytes, params: 1, frame: 16
const value = environment.__proto__;
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const post = HTTP.post;
const REMOTE_AUTH_CANCEL = Endpoints.REMOTE_AUTH_CANCEL;
Reflect.apply(post, HTTP, [{url: REMOTE_AUTH_CANCEL, body: {handshake_token: handshakeToken}, oldFormErrors: true,
rejectWithError: true}]);
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
}
function _fun96935({body}) { // fn#96935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1593, offset: 0x0216cd5d, size: 52 bytes, params: 2, frame: 12
env1_2(body.handshake_token);
const setAuthStepBinding = setAuthStep;
const LOADED = env2_13.LOADED;
setAuthStepBinding(LOADED);
}
function _fun96936() { // fn#96936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:1658, offset: 0x0216cd91, size: 29 bytes, params: 1, frame: 11
const setAuthStepBinding = setAuthStep;
const NOT_FOUND = env2_13.NOT_FOUND;
setAuthStepBinding(NOT_FOUND);
}
function _fun96942() { // fn#96942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2367, offset: 0x0216d163, size: 29 bytes, params: 1, frame: 11
const setAuthStepBinding = setAuthStep;
const SUCCEEDED = env2_13.SUCCEEDED;
setAuthStepBinding(SUCCEEDED);
}
function _fun96943() { // fn#96943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12827:2397, offset: 0x0216d180, size: 29 bytes, params: 1, frame: 11
const setAuthStepBinding = setAuthStep;
const NOT_FOUND = env2_13.NOT_FOUND;
setAuthStepBinding(NOT_FOUND);
}
global.__d(_fun96931, 12637, [57, 31, 27, 661, 33, 4501, 697, 1585, 12638, 12636, 5465, 507, 22, 12639, 4573, 1244,
1305, 6261, 4578, 5080, 12640, 12641, 5461,
2]) /* metro module 12637, dependencies: [57, 31, 27, 661, 33, 4501, 697, 1585, 12638, 12636, 5465, 507, 22, 12639, 4573, 1244, 1305, 6261, 4578, 5080, 12640, 12641, 5461, 2] */;
+15 -13
View File
@@ -1,19 +1,21 @@
/* Metro module 14346; source: modules/remote_auth/typing.tsx; dependencies: [2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun108565(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14543:6, offset: 0x02325f56, size: 162 bytes, params: 8, frame: 16
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {INITIALIZING: 0};
object2[0] = 'INITIALIZING';
object2.PENDING_REMOTE_INIT = 1;
object2[1] = 'PENDING_REMOTE_INIT';
object2.PENDING_TICKET = 2;
object2[2] = 'PENDING_TICKET';
object2.PENDING_LOGIN = 3;
object2[3] = 'PENDING_LOGIN';
object2.FINISH = 4;
object2[4] = 'FINISH';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/remote_auth/typing.tsx');
exports.RemoteAuthStep = object2;
object = {INITIALIZING: 0};
object[0] = 'INITIALIZING';
object.PENDING_REMOTE_INIT = 1;
object[1] = 'PENDING_REMOTE_INIT';
object.PENDING_TICKET = 2;
object[2] = 'PENDING_TICKET';
object.PENDING_LOGIN = 3;
object[3] = 'PENDING_LOGIN';
object.FINISH = 4;
object[4] = 'FINISH';
(FileImportTrackerModule).fileFinishedImporting('modules/remote_auth/typing.tsx');
exports.RemoteAuthStep = object;
}
global.__d(_fun108565, 14346, [2]) /* metro module 14346, dependencies: [2] */;
+467 -447
View File
@@ -1,472 +1,492 @@
/* Metro module 14347; source: modules/remote_auth/useAuthWebsocket.tsx; dependencies: [5, 57, 31, 661, 3, 14346, 561, 8994, 12494, 14348, 1239, 507, 5076, 14350, 2] */
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
import CreateWebSocketAndroid from '../gateway/createWebSocket.android.tsx'; /* Metro dependency 12494 */
import RemoteAuthCryptoAndroid from './RemoteAuthCrypto.android.tsx'; /* Metro dependency 14348 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as TypingModule from './typing.tsx'; /* Metro dependency 14346 */
function _fun108566(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:6, offset: 0x02325ff8, size: 225 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 env0_4 = importDefault(57) /* metro dependency 57 */;
const env0_5 = importAll(31) /* metro dependency 31 */;
let value = require(661) /* metro dependency 661: Constants */;
let value = ConstantsModule;
const env0_6 = value.ComponentActions;
const env0_7 = value.Endpoints;
value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('useAuthWebsocket');
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/remote_auth/useAuthWebsocket.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/remote_auth/useAuthWebsocket.tsx');
exports.useAuthWebsocket = useAuthWebsocket;
}
function useAuthWebsocket(a0, a1) { // fn#108567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:308, offset: 0x023260d9, size: 424 bytes, params: 3, frame: 28
let value = a2;
const env0_0 = a0;
const env0_1 = a1;
const r6 = value !== undefined ? value : false;
const env0_4 = undefined;
const env0_5 = undefined;
const binding = env0_5;
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [0]);
const binding2 = env0_4;
const value3 = binding2(value2, 2);
const property = value3[0];
const env0_3 = value3[1];
useState = binding.useState;
const value4 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property2 = value4[0];
const property3 = value4[1];
useState = binding.useState;
const RemoteAuthStep = (require(14346) /* metro dependency 14346: typing */).RemoteAuthStep;
const INITIALIZING = RemoteAuthStep.INITIALIZING;
const value5 = binding2(Reflect.apply(useState, binding, [{step: INITIALIZING}]), 2);
const property4 = value5[0];
const env0_7 = value5[1];
const env0_8 = binding.useRef(null);
const value6 = binding.useMemo(_fun108568, []);
value = importDefault(8994) /* metro dependency 8994: useStableCallback */;
value = value(_fun108569);
const value7 = binding.useCallback(_fun108571, [value, value6]);
binding.useEffect(_fun108572, [property4, a1, property2, property3]);
binding.useEffect(_fun108574, [value, a0, property, value6, value7, r6]);
return {state: property4, cancel: value};
}
function _fun108568() { // fn#108568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:537, offset: 0x02326281, size: 59 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = importDefault(561) /* metro dependency 561: Backoff */;
const value2 = Object.create(value.prototype, {constructor: {value: value}});
value = new value(1500, 30000);
return value instanceof Object ? value : value2;
}
function _fun108569() { // fn#108569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:582, offset: 0x023262bc, size: 117 bytes, params: 1, frame: 15
const binding = env0_7;
const RemoteAuthStep = (require(14346) /* metro dependency 14346: typing */).RemoteAuthStep;
const INITIALIZING = RemoteAuthStep.INITIALIZING;
binding({step: INITIALIZING});
if (require) {
env0_3(function(a0) {
return a0 + 1;
});
} else {
env1_8.info('document is not visible, will defer reconnection when document becomes visible.');
env0_5(true);
}
}
function _fun108571() { // fn#108571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:765, offset: 0x02326331, size: 110 bytes, params: 1, frame: 14
let binding = env1_8;
binding.error('Could not complete Remote Auth login, trying to restart with a new Remote Auth session.');
binding = env0_7;
const RemoteAuthStep = (require(14346) /* metro dependency 14346: typing */).RemoteAuthStep;
const INITIALIZING = RemoteAuthStep.INITIALIZING;
binding({step: INITIALIZING});
if (!env0_9.pending) {
env0_9.fail(env0_10);
}
}
function _fun108572() { // fn#108572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:965, offset: 0x0232639f, size: 130 bytes, params: 1, frame: 14
var environment;
var binding;
var value4;
if (require && env0_4 && env0_6.step === (require(14346) /* metro dependency 14346: typing */).RemoteAuthStep.INITIALIZING) {
value4 = environment.__proto__;
binding = env1_8;
binding.info('reconnecting, now that document is visible');
env0_5(false);
binding = env0_3;
binding(function(a0) {
return a0 + 1;
});
}
}
function _fun108574() { // fn#108574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1121, offset: 0x02326421, size: 377 bytes, params: 1, frame: 17
var environment;
const Date = global.Date;
const env0_0 = Date.now();
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const REMOTE_AUTH_ENDPOINT = GLOBAL_ENV.REMOTE_AUTH_ENDPOINT;
let value = '' + REMOTE_AUTH_ENDPOINT + '/?v=2';
const r7 = value.startsWith('//') ? 'wss:' + value : value;
value = environment.__proto__;
const value2 = (importDefault(12494) /* metro dependency 12494: createWebSocketAndroid */)(r7);
env1_8.info('[0ms] connecting to ' + r7);
value = _fun108579();
const value3 = _fun108589();
const closure = onclose;
const closure2 = onerror_108594;
value2.addEventListener('open', value3);
value2.addEventListener('message', value);
value2.addEventListener('close', closure);
value2.addEventListener('error', closure2);
return _fun108595;
}
function getKeyPair() { // fn#108575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1381, offset: 0x0232659a, size: 55 bytes, params: 1, frame: 12
if (env0_4 != null) {
return env0_4;
}
const Error = global.Error;
throw new Error('No key pair set');
}
function _fmt(a0) { // fn#108576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1148, offset: 0x023265d1, size: 69 bytes, params: 2, frame: 15
const Date = global.Date;
let value = Date.now();
value -= env0_0;
return '[' + (value + 'ms') + '] ' + a0;
}
function info_108577(a0) { // fn#108577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1186, offset: 0x02326616, size: 37 bytes, params: 2, frame: 13
const binding = env2_8;
return binding.info(_fmt(a0));
}
function doHeartbeat() { // fn#108578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1474, offset: 0x0232663b, size: 108 bytes, params: 1, frame: 14
var binding;
var send;
var JSON;
if (env0_8) {
binding = env0_3;
send = binding.send;
JSON = global.JSON;
Reflect.apply(send, binding, [JSON.stringify({op: 'heartbeat'})]);
} else {
info_108577('heartbeat timeout, reconnecting.');
env0_3.close();
value = environment.__proto__;
env1_11();
}
}
function _fun108579() { // fn#108579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1589, offset: 0x023266a7, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_3(_fun108581);
return _fun108588;
}
function _fun108589() { // fn#108589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3489, offset: 0x02326cc7, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_3(_fun108591);
return _fun108592;
}
function onclose({code, reason}) { // fn#108593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3830, offset: 0x02326e0c, size: 73 bytes, params: 2, frame: 16
info_108577('disconnected, code: ' + code + ' ' + reason);
value = environment.__proto__;
env1_11();
}
function onerror_108594(a0) { // fn#108594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3897, offset: 0x02326e55, size: 71 bytes, params: 2, frame: 13
const info_108577Binding = info_108577;
const JSON = global.JSON;
let value = JSON.stringify(a0);
value = 'disconnected, error: ' + value;
info_108577Binding(value);
value = environment.__proto__;
env1_11();
}
function _fun108595() { // fn#108595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:4096, offset: 0x02326e9c, size: 241 bytes, params: 1, frame: 15
info_108577('cleaning up');
let binding = env0_3;
binding.removeEventListener('open', env0_11);
env0_3.removeEventListener('message', env0_10);
binding = env0_3;
binding.removeEventListener('close', onclose);
binding = env0_3;
binding.removeEventListener('error', onerror_108594);
env0_3.close(1000);
env1_9.cancel();
(importDefault(14348) /* metro dependency 14348: RemoteAuthCryptoAndroid */).release();
if (env0_7 != null) {
global.clearTimeout(env0_7);
}
if (env0_6 != null) {
global.clearInterval(env0_6);
}
}
async function _fun108581({data}) { // fn#108581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1609, offset: 0x023266df, size: 1134 bytes, params: 2, frame: 24
var environment;
var binding;
var value4;
var heartbeat_interval;
var setTimeout;
var Math;
var floor;
var Math2;
var value5;
var binding2;
var ComponentDispatch;
var value6;
var encrypted_user_payload;
var value8;
var object2;
var ticket;
var binding3;
var value9;
var value10;
var binding4;
var value11;
var publicKeyFingerprint;
var value12;
var value13;
var Error;
var encrypted_nonce;
var decryptNonce;
var value16;
var send;
if (true) {
await undefined;
if (false) {
return undefined;
function useAuthWebsocket(a0, a1) { // fn#108567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:308, offset: 0x023260d9, size: 424 bytes, params: 3, frame: 28
let value = a2;
const env0_0 = a0;
const env0_1 = a1;
const r6 = value !== undefined ? value : false;
const env0_4 = undefined;
const env0_5 = undefined;
const binding = env0_5;
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [0]);
const binding2 = env0_4;
const value3 = binding2(value2, 2);
const property = value3[0];
const env0_3 = value3[1];
useState = binding.useState;
const value4 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property2 = value4[0];
const property3 = value4[1];
useState = binding.useState;
const RemoteAuthStep = (TypingModule).RemoteAuthStep;
const INITIALIZING = RemoteAuthStep.INITIALIZING;
const value5 = binding2(Reflect.apply(useState, binding, [{step: INITIALIZING}]), 2);
const property4 = value5[0];
const env0_7 = value5[1];
const env0_8 = binding.useRef(null);
const value6 = binding.useMemo(_fun108568, []);
value = importDefault(8994) /* metro dependency 8994: useStableCallback */;
value = value(_fun108569);
const value7 = binding.useCallback(_fun108571, [value, value6]);
binding.useEffect(_fun108572, [property4, a1, property2, property3]);
binding.useEffect(_fun108574, [value, a0, property, value6, value7, r6]);
return {state: property4, cancel: value};
function _fun108568() { // fn#108568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:537, offset: 0x02326281, size: 59 bytes, params: 1, frame: 13
let value = environment.__proto__;
value = importDefault(561) /* metro dependency 561: Backoff */;
const value2 = Object.create(value.prototype, {constructor: {value: value}});
value = new value(1500, 30000);
return value instanceof Object ? value : value2;
}
var JSON = global.JSON;
var op = JSON.parse(data).op;
if (op === 'nonce_proof') {
encrypted_nonce = value.encrypted_nonce;
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_1;
value = binding(env4_2[9]);
decryptNonce = value.decryptNonce;
value16 = environment.__proto__.__proto__;
await Reflect.apply(decryptNonce, value, [env2_14(), encrypted_nonce]);
value = undefined;
if (false) {
return value;
function _fun108569() { // fn#108569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:582, offset: 0x023262bc, size: 117 bytes, params: 1, frame: 15
const binding = env0_7;
const RemoteAuthStep = (TypingModule).RemoteAuthStep;
const INITIALIZING = RemoteAuthStep.INITIALIZING;
binding({step: INITIALIZING});
if (require) {
env0_3(function(a0) {
return a0 + 1;
});
} else {
env1_8.info('document is not visible, will defer reconnection when document becomes visible.');
env0_5(true);
}
env2_2('computed nonce proof');
binding = env2_3;
send = binding.send;
JSON = global.JSON;
Reflect.apply(send, binding, [JSON.stringify({op: 'nonce_proof', nonce: value})]);
} else {
if (op === 'pending_remote_init') {
value9 = environment.__proto__.__proto__.__proto__;
binding = env3_9;
binding.succeed();
value10 = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding4 = env4_2;
ComponentDispatch = binding(binding4[10]).ComponentDispatch;
ComponentDispatch.dispatch(env4_6.WAVE_EMPHASIZE);
binding = env4_1;
value11 = binding(binding4[9]);
publicKeyFingerprint = value11.publicKeyFingerprint;
value12 = environment.__proto__.__proto__;
await Reflect.apply(publicKeyFingerprint, value11, [env2_14()]);
value13 = undefined;
if (false) {
return value13;
}
if (value13 !== value.fingerprint) {
Error = global.Error;
value = 'bad fingerprint ' + value13 + ' !== ' + value.fingerprint;
throw new Error(value);
}
env2_2('handshake complete awaiting remote auth.');
object2 = {};
binding = env4_0;
object2.step = binding(env4_2[5]).RemoteAuthStep.PENDING_REMOTE_INIT;
object2.fingerprint = value13;
Endpoints(object2);
return undefined;
}
function _fun108571() { // fn#108571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:765, offset: 0x02326331, size: 110 bytes, params: 1, frame: 14
let binding = env1_8;
binding.error('Could not complete Remote Auth login, trying to restart with a new Remote Auth session.');
binding = env0_7;
const RemoteAuthStep = (TypingModule).RemoteAuthStep;
const INITIALIZING = RemoteAuthStep.INITIALIZING;
binding({step: INITIALIZING});
if (!env0_9.pending) {
env0_9.fail(env0_10);
}
if (op === 'pending_login') {
ticket = value.ticket;
if (ticket == null) {
value = environment.__proto__.__proto__.__proto__;
env3_11();
}
function _fun108572() { // fn#108572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:965, offset: 0x0232639f, size: 130 bytes, params: 1, frame: 14
var environment;
var binding;
var value4;
if (require && env0_4 && env0_6.step === (require(14346) /* metro dependency 14346: typing */).RemoteAuthStep.INITIALIZING) {
value4 = environment.__proto__;
binding = env1_8;
binding.info('reconnecting, now that document is visible');
env0_5(false);
binding = env0_3;
binding(function(a0) {
return a0 + 1;
});
}
}
function _fun108574() { // fn#108574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1121, offset: 0x02326421, size: 377 bytes, params: 1, frame: 17
var environment;
const Date = global.Date;
const env0_0 = Date.now();
const GLOBAL_ENV = global.window.GLOBAL_ENV;
const REMOTE_AUTH_ENDPOINT = GLOBAL_ENV.REMOTE_AUTH_ENDPOINT;
let value = '' + REMOTE_AUTH_ENDPOINT + '/?v=2';
const r7 = value.startsWith('//') ? 'wss:' + value : value;
value = environment.__proto__;
const value2 = (CreateWebSocketAndroid)(r7);
env1_8.info('[0ms] connecting to ' + r7);
value = _fun108579();
const value3 = _fun108589();
const onclose_1085932 = onclose_108593;
const onerror_1085942 = onerror_108594;
value2.addEventListener('open', value3);
value2.addEventListener('message', value);
value2.addEventListener('close', onclose_1085932);
value2.addEventListener('error', onerror_1085942);
return _fun108595;
function getKeyPair() { // fn#108575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1381, offset: 0x0232659a, size: 55 bytes, params: 1, frame: 12
if (env0_4 != null) {
return env0_4;
}
const Error = global.Error;
throw new Error('No key pair set');
}
function _fmt(a0) { // fn#108576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1148, offset: 0x023265d1, size: 69 bytes, params: 2, frame: 15
const Date = global.Date;
let value = Date.now();
value -= env0_0;
return '[' + (value + 'ms') + '] ' + a0;
}
function info_108577(a0) { // fn#108577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1186, offset: 0x02326616, size: 37 bytes, params: 2, frame: 13
const binding = env2_8;
return binding.info(_fmt(a0));
}
function doHeartbeat() { // fn#108578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1474, offset: 0x0232663b, size: 108 bytes, params: 1, frame: 14
var binding;
var send;
var JSON;
if (env0_8) {
binding = env0_3;
send = binding.send;
JSON = global.JSON;
Reflect.apply(send, binding, [JSON.stringify({op: 'heartbeat'})]);
} else {
value = environment.__proto__.__proto__.__proto__;
object2 = {};
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding3 = env4_2;
object2.step = binding(binding3[5]).RemoteAuthStep.PENDING_LOGIN;
object2.ticket = ticket;
Endpoints(object2);
value = binding(binding3[11]).HTTP.post({url: env4_7.REMOTE_AUTH_LOGIN, body: {ticket: ticket},
oldFormErrors: true,
rejectWithError: true});
value = value.then(_fun108582());
value.catch(_fun108586);
info_108577('heartbeat timeout, reconnecting.');
env0_3.close();
value = environment.__proto__;
env1_11();
}
return undefined;
}
if (op === 'pending_ticket') {
value5 = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding2 = env4_2;
ComponentDispatch = binding(binding2[10]).ComponentDispatch;
ComponentDispatch.dispatch(env4_6.WAVE_EMPHASIZE);
value6 = environment.__proto__.__proto__;
env2_2('remote auth handshake started, awaiting ticket/cancel.');
encrypted_user_payload = value.encrypted_user_payload;
value = binding(binding2[13]);
await value.decodeEncodedUserRecord(env2_14(), encrypted_user_payload);
value = undefined;
if (false) {
return value;
function _fun108579() { // fn#108579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1589, offset: 0x023266a7, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_3(_fun108581);
return _fun108588;
async function _fun108581({data}) { // fn#108581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:1609, offset: 0x023266df, size: 1134 bytes, params: 2, frame: 24
var environment;
var binding;
var value4;
var heartbeat_interval;
var setTimeout;
var Math;
var floor;
var Math2;
var value5;
var binding2;
var ComponentDispatch;
var value6;
var encrypted_user_payload;
var value8;
var object;
var ticket;
var binding3;
var value9;
var value10;
var binding4;
var value11;
var publicKeyFingerprint;
var value12;
var value13;
var Error;
var encrypted_nonce;
var decryptNonce;
var value16;
var send;
if (true) {
await undefined;
if (false) {
return undefined;
}
var JSON = global.JSON;
var op = JSON.parse(data).op;
if (op === 'nonce_proof') {
encrypted_nonce = value.encrypted_nonce;
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_1;
value = binding(env4_2[9]);
decryptNonce = value.decryptNonce;
value16 = environment.__proto__.__proto__;
await Reflect.apply(decryptNonce, value, [env2_14(), encrypted_nonce]);
value = undefined;
if (false) {
return value;
}
env2_2('computed nonce proof');
binding = env2_3;
send = binding.send;
JSON = global.JSON;
Reflect.apply(send, binding, [JSON.stringify({op: 'nonce_proof', nonce: value})]);
} else {
if (op === 'pending_remote_init') {
value9 = environment.__proto__.__proto__.__proto__;
binding = env3_9;
binding.succeed();
value10 = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding4 = env4_2;
ComponentDispatch = binding(binding4[10]).ComponentDispatch;
ComponentDispatch.dispatch(env4_6.WAVE_EMPHASIZE);
binding = env4_1;
value11 = binding(binding4[9]);
publicKeyFingerprint = value11.publicKeyFingerprint;
value12 = environment.__proto__.__proto__;
await Reflect.apply(publicKeyFingerprint, value11, [env2_14()]);
value13 = undefined;
if (false) {
return value13;
}
if (value13 !== value.fingerprint) {
Error = global.Error;
value = 'bad fingerprint ' + value13 + ' !== ' + value.fingerprint;
throw new Error(value);
}
env2_2('handshake complete awaiting remote auth.');
object = {};
binding = env4_0;
object.step = binding(env4_2[5]).RemoteAuthStep.PENDING_REMOTE_INIT;
object.fingerprint = value13;
Endpoints(object);
return undefined;
}
if (op === 'pending_login') {
ticket = value.ticket;
if (ticket == null) {
value = environment.__proto__.__proto__.__proto__;
env3_11();
} else {
value = environment.__proto__.__proto__.__proto__;
object = {};
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding3 = env4_2;
object.step = binding(binding3[5]).RemoteAuthStep.PENDING_LOGIN;
object.ticket = ticket;
Endpoints(object);
value = binding(binding3[11]).HTTP.post({url: env4_7.REMOTE_AUTH_LOGIN, body: {ticket: ticket},
oldFormErrors: true,
rejectWithError: true});
value = value.then(_fun108582());
value.catch(_fun108586);
}
return undefined;
}
if (op === 'pending_ticket') {
value5 = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_0;
binding2 = env4_2;
ComponentDispatch = binding(binding2[10]).ComponentDispatch;
ComponentDispatch.dispatch(env4_6.WAVE_EMPHASIZE);
value6 = environment.__proto__.__proto__;
env2_2('remote auth handshake started, awaiting ticket/cancel.');
encrypted_user_payload = value.encrypted_user_payload;
value = binding(binding2[13]);
await value.decodeEncodedUserRecord(env2_14(), encrypted_user_payload);
value = undefined;
if (false) {
return value;
}
value8 = environment.__proto__.__proto__.__proto__;
object = {};
binding = env4_0;
object.step = binding(env4_2[5]).RemoteAuthStep.PENDING_TICKET;
object.user = value;
Endpoints(object);
return undefined;
}
if (op === 'cancel') {
value = environment.__proto__.__proto__;
env2_2('remote auth handshake cancelled.');
value = environment.__proto__.__proto__.__proto__;
env3_10();
return undefined;
}
if (op === 'hello') {
value4 = environment.__proto__.__proto__;
env2_2('got hello, auth timeout=' + value.timeout_ms + 'ms');
heartbeat_interval = value.heartbeat_interval;
setTimeout = global.setTimeout;
Math = global.Math;
floor = Math.floor;
Math2 = global.Math;
value = Reflect.apply(floor, Math, [heartbeat_interval * Math2.random()]);
env2_7 = setTimeout(_fun108587, value);
return undefined;
}
if (op === 'heartbeat_ack') {
value = environment.__proto__.__proto__;
return undefined;
}
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_8;
var warn = binding.warn;
value = environment.__proto__.__proto__;
Reflect.apply(warn, binding, [require('received unsupported message')]);
}
}
function _fun108582() { // fn#108582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:2426, offset: 0x02326b4d, size: 36 bytes, params: 1, frame: 12
const env0_0 = env5_3(_fun108584);
return _fun108585;
function* _fun108584(a0) { // fn#108584, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:2446, offset: 0x02326b7c, size: 266 bytes, params: 2, frame: 18
var value3;
var binding;
var value4;
var decryptEncodedCiphertext;
var value5;
var value7;
var publicKeyFingerprint;
var value8;
var value10;
if (true) {
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__.__proto__;
var current = env6_8.current;
if (current != null) {
value3 = environment.__proto__.__proto__.__proto__.__proto__.__proto__.__proto__.__proto__;
binding = env7_1;
value4 = binding(env7_2[9]);
decryptEncodedCiphertext = value4.decryptEncodedCiphertext;
current = env6_8.current;
yield Reflect.apply(decryptEncodedCiphertext, value4, [current, a0.body.encrypted_token]);
value5 = undefined;
if (false) {
return value5;
}
binding = env7_1;
value7 = binding(env7_2[9]);
publicKeyFingerprint = value7.publicKeyFingerprint;
current = env6_8.current;
yield Reflect.apply(publicKeyFingerprint, value7, [current]);
value8 = undefined;
if (false) {
return value8;
}
binding = env6_2;
value10 = env7_1(env7_2[12]);
if (binding) {
yield value10.switchAccountToken(value5);
if (false) {
return undefined;
}
env6_0(value8);
return undefined;
}
yield value10.loginToken(value5, false);
if (false) {
return undefined;
}
env6_0(value8);
} else {
env6_11();
}
}
}
function _fun108585() { // fn#108585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:2705, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
function _fun108586() { // fn#108586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:2759, offset: 0x02326c86, size: 15 bytes, params: 1, frame: 9
return env4_11();
}
function _fun108587() { // fn#108587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3248, offset: 0x02326c95, size: 50 bytes, params: 1, frame: 14
env3_9();
env3_6 = global.setInterval(env3_9, heartbeat_interval);
}
}
value8 = environment.__proto__.__proto__.__proto__;
object2 = {};
binding = env4_0;
object2.step = binding(env4_2[5]).RemoteAuthStep.PENDING_TICKET;
object2.user = value;
Endpoints(object2);
return undefined;
}
if (op === 'cancel') {
value = environment.__proto__.__proto__;
env2_2('remote auth handshake cancelled.');
value = environment.__proto__.__proto__.__proto__;
env3_10();
return undefined;
}
if (op === 'hello') {
value4 = environment.__proto__.__proto__;
env2_2('got hello, auth timeout=' + value.timeout_ms + 'ms');
heartbeat_interval = value.heartbeat_interval;
setTimeout = global.setTimeout;
Math = global.Math;
floor = Math.floor;
Math2 = global.Math;
value = Reflect.apply(floor, Math, [heartbeat_interval * Math2.random()]);
env2_7 = setTimeout(_fun108587, value);
return undefined;
}
if (op === 'heartbeat_ack') {
value = environment.__proto__.__proto__;
return undefined;
}
value = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_8;
var warn = binding.warn;
value = environment.__proto__.__proto__;
Reflect.apply(warn, binding, [require('received unsupported message')]);
}
}
}
function* _fun108591() { // fn#108591, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3509, offset: 0x02326cf6, size: 278 bytes, params: 1, frame: 20
if (true) {
value = environment.__proto__.__proto__.__proto__.__proto__;
var binding = env4_1;
var value3 = binding(env4_2[9]);
yield value3.generateRsaKeyPair();
var value4 = undefined;
if (false) {
return value4;
}
env2_4 = value4;
var value7 = env4_1(env4_2[9]);
yield value7.serializePublicKey(env2_4);
var value8 = undefined;
if (false) {
return value8;
}
env2_5 = value8;
value = env4_1(env4_2[9]);
yield value.publicKeyFingerprint(env2_4);
value = undefined;
if (false) {
return value;
}
env2_2('connected, handshaking with fingerprint: ' + value);
binding = env2_3;
var send = binding.send;
var JSON = global.JSON;
Reflect.apply(send, binding, [JSON.stringify({op: 'init', encoded_public_key: env2_5})]);
value = environment.__proto__.__proto__.__proto__;
env3_8.current = env2_4;
}
}
function _fun108582() { // fn#108582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:2426, offset: 0x02326b4d, size: 36 bytes, params: 1, frame: 12
const env0_0 = env5_3(_fun108584);
return _fun108585;
}
function _fun108586() { // fn#108586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:2759, offset: 0x02326c86, size: 15 bytes, params: 1, frame: 9
return env4_11();
}
function _fun108587() { // fn#108587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3248, offset: 0x02326c95, size: 50 bytes, params: 1, frame: 14
env3_9();
env3_6 = global.setInterval(env3_9, heartbeat_interval);
}
function* _fun108584(a0) { // fn#108584, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:2446, offset: 0x02326b7c, size: 266 bytes, params: 2, frame: 18
var value3;
var binding;
var value4;
var decryptEncodedCiphertext;
var value5;
var value7;
var publicKeyFingerprint;
var value8;
var value10;
if (true) {
value = environment.__proto__.__proto__.__proto__.__proto__.__proto__.__proto__;
var current = env6_8.current;
if (current != null) {
value3 = environment.__proto__.__proto__.__proto__.__proto__.__proto__.__proto__.__proto__;
binding = env7_1;
value4 = binding(env7_2[9]);
decryptEncodedCiphertext = value4.decryptEncodedCiphertext;
current = env6_8.current;
yield Reflect.apply(decryptEncodedCiphertext, value4, [current, a0.body.encrypted_token]);
value5 = undefined;
if (false) {
return value5;
}
binding = env7_1;
value7 = binding(env7_2[9]);
publicKeyFingerprint = value7.publicKeyFingerprint;
current = env6_8.current;
yield Reflect.apply(publicKeyFingerprint, value7, [current]);
value8 = undefined;
if (false) {
return value8;
}
binding = env6_2;
value10 = env7_1(env7_2[12]);
if (binding) {
yield value10.switchAccountToken(value5);
if (false) {
return undefined;
function _fun108588() { // fn#108588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3441, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
env6_0(value8);
return undefined;
}
yield value10.loginToken(value5, false);
if (false) {
return undefined;
function _fun108589() { // fn#108589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3489, offset: 0x02326cc7, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_3(_fun108591);
return _fun108592;
function* _fun108591() { // fn#108591, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3509, offset: 0x02326cf6, size: 278 bytes, params: 1, frame: 20
if (true) {
value = environment.__proto__.__proto__.__proto__.__proto__;
var binding = env4_1;
var value3 = binding(env4_2[9]);
yield value3.generateRsaKeyPair();
var value4 = undefined;
if (false) {
return value4;
}
env2_4 = value4;
var value7 = env4_1(env4_2[9]);
yield value7.serializePublicKey(env2_4);
var value8 = undefined;
if (false) {
return value8;
}
env2_5 = value8;
value = env4_1(env4_2[9]);
yield value.publicKeyFingerprint(env2_4);
value = undefined;
if (false) {
return value;
}
env2_2('connected, handshaking with fingerprint: ' + value);
binding = env2_3;
var send = binding.send;
var JSON = global.JSON;
Reflect.apply(send, binding, [JSON.stringify({op: 'init', encoded_public_key: env2_5})]);
value = environment.__proto__.__proto__.__proto__;
env3_8.current = env2_4;
}
}
function _fun108592() { // fn#108592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3776, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
env6_0(value8);
} else {
env6_11();
function onclose_108593({code, reason}) { // fn#108593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3830, offset: 0x02326e0c, size: 73 bytes, params: 2, frame: 16
info_108577('disconnected, code: ' + code + ' ' + reason);
value = environment.__proto__;
env1_11();
}
function onerror_108594(a0) { // fn#108594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:3897, offset: 0x02326e55, size: 71 bytes, params: 2, frame: 13
const info_108577Binding = info_108577;
const JSON = global.JSON;
let value = JSON.stringify(a0);
value = 'disconnected, error: ' + value;
info_108577Binding(value);
value = environment.__proto__;
env1_11();
}
function _fun108595() { // fn#108595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14544:4096, offset: 0x02326e9c, size: 241 bytes, params: 1, frame: 15
info_108577('cleaning up');
let binding = env0_3;
binding.removeEventListener('open', env0_11);
env0_3.removeEventListener('message', env0_10);
binding = env0_3;
binding.removeEventListener('close', onclose_108593);
binding = env0_3;
binding.removeEventListener('error', onerror_108594);
env0_3.close(1000);
env1_9.cancel();
(RemoteAuthCryptoAndroid).release();
if (env0_7 != null) {
global.clearTimeout(env0_7);
}
if (env0_6 != null) {
global.clearInterval(env0_6);
}
}
}
}
}
global.__d(_fun108566, 14347, [5, 57, 31, 661, 3, 14346, 561, 8994, 12494, 14348, 1239, 507, 5076, 14350,
2]) /* metro module 14347, dependencies: [5, 57, 31, 661, 3, 14346, 561, 8994, 12494, 14348, 1239, 507, 5076, 14350, 2] */;