500 lines
20 KiB
TypeScript
500 lines
20 KiB
TypeScript
/* Metro module 10646; source: modules/activities/utils/confirmActivityLaunchChecks.tsx; dependencies: [5, 1379, 1378, 661, 9473, 10647, 694, 4131, 3774, 10648, 8091, 10649, 7504, 10651, 2] */
|
|
function _fun81895(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#81895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:6, offset: 0x01ee3185, size: 238 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const getOrFetchApplicationForLaunch = function() {
|
|
return _getOrFetchApplicationForLaunch.apply(this, arguments);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const embeddedActivitiesStore = importDefault(1378) /* metro dependency 1378: EmbeddedActivitiesStore */;
|
|
const env0_6 = (require(661) /* metro dependency 661: Constants */).ApplicationFlags;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/activities/utils/confirmActivityLaunchChecks.tsx');
|
|
exports.confirmActivityLaunchChecks = function() {
|
|
return _confirmActivityLaunchChecks.apply(this, arguments);
|
|
};
|
|
}
|
|
|
|
function _getOrFetchApplicationForLaunch() { // fn#81897, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:258, offset: 0x01ee3273, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun81899).apply(this, arguments);
|
|
}
|
|
|
|
function _confirmActivityChange() { // fn#81900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:754, offset: 0x01ee340b, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun81902).apply(this, arguments);
|
|
}
|
|
|
|
function _confirmActivityAgeGate() { // fn#81906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:1344, offset: 0x01ee35f7, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun81908).apply(this, arguments);
|
|
}
|
|
|
|
function _confirmExternalAppLaunch() { // fn#81912, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:2013, offset: 0x01ee37d9, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun81914).apply(this, arguments);
|
|
}
|
|
|
|
function _confirmActivityLaunchChecks() { // fn#81918, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:2622, offset: 0x01ee39bb, size: 50 bytes, params: 1, frame: 14
|
|
return env0_3(_fun81920).apply(this, arguments);
|
|
}
|
|
|
|
async function _fun81899({applicationId, channelId, guildId}) { // fn#81899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:343, offset: 0x01ee32b9, size: 338 bytes, params: 2, frame: 23
|
|
var r3;
|
|
var r11;
|
|
var r9;
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value4;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var error;
|
|
var value8;
|
|
var EmbeddedActivityLocationKind;
|
|
var PRIVATE_CHANNEL;
|
|
var GUILD_CHANNEL;
|
|
var value9;
|
|
var dispatch;
|
|
var object2;
|
|
var APIError;
|
|
var prototype;
|
|
var aPIError;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
try {
|
|
binding = env2_1;
|
|
} catch (error) {
|
|
value8 = null;
|
|
if (value8 != guildId) {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
GUILD_CHANNEL = EmbeddedActivityLocationKind.GUILD_CHANNEL;
|
|
r3 = GUILD_CHANNEL;
|
|
} else {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
PRIVATE_CHANNEL = EmbeddedActivityLocationKind.PRIVATE_CHANNEL;
|
|
r3 = PRIVATE_CHANNEL;
|
|
}
|
|
binding = env2_1;
|
|
value9 = binding(env2_2[6]);
|
|
dispatch = value9.dispatch;
|
|
object2 = {'type': 'EMBEDDED_ACTIVITY_LAUNCH_FAIL', 'nonce': ''};
|
|
object2.applicationId = applicationId;
|
|
r11 = value8 != channelId ? channelId : value8;
|
|
object2.channelId = r11;
|
|
r9 = value8 != guildId ? guildId : value8;
|
|
object2.guildId = r9;
|
|
binding = env2_0;
|
|
APIError = binding(env2_2[7]).APIError;
|
|
prototype = APIError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: APIError}});
|
|
aPIError = new APIError();
|
|
value = aPIError instanceof Object ? aPIError : value;
|
|
object2.error = value;
|
|
object2.locationKind = r3;
|
|
Reflect.apply(dispatch, value9, [object2]);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
value8 = null;
|
|
if (value8 != guildId) {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
GUILD_CHANNEL = EmbeddedActivityLocationKind.GUILD_CHANNEL;
|
|
r3 = GUILD_CHANNEL;
|
|
} else {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
PRIVATE_CHANNEL = EmbeddedActivityLocationKind.PRIVATE_CHANNEL;
|
|
r3 = PRIVATE_CHANNEL;
|
|
}
|
|
binding = env2_1;
|
|
value9 = binding(env2_2[6]);
|
|
dispatch = value9.dispatch;
|
|
object2 = {'type': 'EMBEDDED_ACTIVITY_LAUNCH_FAIL', 'nonce': ''};
|
|
object2.applicationId = applicationId;
|
|
r11 = value8 != channelId ? channelId : value8;
|
|
object2.channelId = r11;
|
|
r9 = value8 != guildId ? guildId : value8;
|
|
object2.guildId = r9;
|
|
binding = env2_0;
|
|
APIError = binding(env2_2[7]).APIError;
|
|
prototype = APIError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: APIError}});
|
|
aPIError = new APIError();
|
|
value = aPIError instanceof Object ? aPIError : value;
|
|
object2.error = value;
|
|
object2.locationKind = r3;
|
|
Reflect.apply(dispatch, value9, [object2]);
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = binding2[4];
|
|
} catch (error) {
|
|
value8 = null;
|
|
if (value8 != guildId) {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
GUILD_CHANNEL = EmbeddedActivityLocationKind.GUILD_CHANNEL;
|
|
r3 = GUILD_CHANNEL;
|
|
} else {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
PRIVATE_CHANNEL = EmbeddedActivityLocationKind.PRIVATE_CHANNEL;
|
|
r3 = PRIVATE_CHANNEL;
|
|
}
|
|
binding = env2_1;
|
|
value9 = binding(env2_2[6]);
|
|
dispatch = value9.dispatch;
|
|
object2 = {'type': 'EMBEDDED_ACTIVITY_LAUNCH_FAIL', 'nonce': ''};
|
|
object2.applicationId = applicationId;
|
|
r11 = value8 != channelId ? channelId : value8;
|
|
object2.channelId = r11;
|
|
r9 = value8 != guildId ? guildId : value8;
|
|
object2.guildId = r9;
|
|
binding = env2_0;
|
|
APIError = binding(env2_2[7]).APIError;
|
|
prototype = APIError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: APIError}});
|
|
aPIError = new APIError();
|
|
value = aPIError instanceof Object ? aPIError : value;
|
|
object2.error = value;
|
|
object2.locationKind = r3;
|
|
Reflect.apply(dispatch, value9, [object2]);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value4 = binding(property);
|
|
} catch (error) {
|
|
value8 = null;
|
|
if (value8 != guildId) {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
GUILD_CHANNEL = EmbeddedActivityLocationKind.GUILD_CHANNEL;
|
|
r3 = GUILD_CHANNEL;
|
|
} else {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
PRIVATE_CHANNEL = EmbeddedActivityLocationKind.PRIVATE_CHANNEL;
|
|
r3 = PRIVATE_CHANNEL;
|
|
}
|
|
binding = env2_1;
|
|
value9 = binding(env2_2[6]);
|
|
dispatch = value9.dispatch;
|
|
object2 = {'type': 'EMBEDDED_ACTIVITY_LAUNCH_FAIL', 'nonce': ''};
|
|
object2.applicationId = applicationId;
|
|
r11 = value8 != channelId ? channelId : value8;
|
|
object2.channelId = r11;
|
|
r9 = value8 != guildId ? guildId : value8;
|
|
object2.guildId = r9;
|
|
binding = env2_0;
|
|
APIError = binding(env2_2[7]).APIError;
|
|
prototype = APIError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: APIError}});
|
|
aPIError = new APIError();
|
|
value = aPIError instanceof Object ? aPIError : value;
|
|
object2.error = value;
|
|
object2.locationKind = r3;
|
|
Reflect.apply(dispatch, value9, [object2]);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value5 = value4(applicationId, channelId);
|
|
} catch (error) {
|
|
value8 = null;
|
|
if (value8 != guildId) {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
GUILD_CHANNEL = EmbeddedActivityLocationKind.GUILD_CHANNEL;
|
|
r3 = GUILD_CHANNEL;
|
|
} else {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
PRIVATE_CHANNEL = EmbeddedActivityLocationKind.PRIVATE_CHANNEL;
|
|
r3 = PRIVATE_CHANNEL;
|
|
}
|
|
binding = env2_1;
|
|
value9 = binding(env2_2[6]);
|
|
dispatch = value9.dispatch;
|
|
object2 = {'type': 'EMBEDDED_ACTIVITY_LAUNCH_FAIL', 'nonce': ''};
|
|
object2.applicationId = applicationId;
|
|
r11 = value8 != channelId ? channelId : value8;
|
|
object2.channelId = r11;
|
|
r9 = value8 != guildId ? guildId : value8;
|
|
object2.guildId = r9;
|
|
binding = env2_0;
|
|
APIError = binding(env2_2[7]).APIError;
|
|
prototype = APIError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: APIError}});
|
|
aPIError = new APIError();
|
|
value = aPIError instanceof Object ? aPIError : value;
|
|
object2.error = value;
|
|
object2.locationKind = r3;
|
|
Reflect.apply(dispatch, value9, [object2]);
|
|
return undefined;
|
|
}
|
|
await value5;
|
|
try {
|
|
value6 = undefined;
|
|
value7 = false;
|
|
} catch (error) {
|
|
value8 = null;
|
|
if (value8 != guildId) {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
GUILD_CHANNEL = EmbeddedActivityLocationKind.GUILD_CHANNEL;
|
|
r3 = GUILD_CHANNEL;
|
|
} else {
|
|
EmbeddedActivityLocationKind = env2_0(env2_2[5]).EmbeddedActivityLocationKind;
|
|
PRIVATE_CHANNEL = EmbeddedActivityLocationKind.PRIVATE_CHANNEL;
|
|
r3 = PRIVATE_CHANNEL;
|
|
}
|
|
binding = env2_1;
|
|
value9 = binding(env2_2[6]);
|
|
dispatch = value9.dispatch;
|
|
object2 = {'type': 'EMBEDDED_ACTIVITY_LAUNCH_FAIL', 'nonce': ''};
|
|
object2.applicationId = applicationId;
|
|
r11 = value8 != channelId ? channelId : value8;
|
|
object2.channelId = r11;
|
|
r9 = value8 != guildId ? guildId : value8;
|
|
object2.guildId = r9;
|
|
binding = env2_0;
|
|
APIError = binding(env2_2[7]).APIError;
|
|
prototype = APIError.prototype;
|
|
value = Object.create(prototype, {constructor: {value: APIError}});
|
|
aPIError = new APIError();
|
|
value = aPIError instanceof Object ? aPIError : value;
|
|
object2.error = value;
|
|
object2.locationKind = r3;
|
|
Reflect.apply(dispatch, value9, [object2]);
|
|
return undefined;
|
|
}
|
|
return value7 ? value6 : value6;
|
|
}
|
|
|
|
async function _fun81902({currentEmbeddedApplication, shouldClosePopoutOnLeaveCurrentEmbeddedApplication, onConfirmActivityLaunchChecksAlertOpen}) { // fn#81902, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:821, offset: 0x01ee3451, size: 127 bytes, params: 2, frame: 14
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
if (currentEmbeddedApplication == null) {
|
|
return true;
|
|
}
|
|
const Promise = global.Promise;
|
|
let promise = new Promise(_fun81903);
|
|
await promise;
|
|
promise = undefined;
|
|
if (false) {
|
|
return promise;
|
|
}
|
|
if (promise) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
async function _fun81908({application, applicationId, channel, user, onConfirmActivityLaunchChecksAlertOpen}) { // fn#81908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:1413, offset: 0x01ee363d, size: 282 bytes, params: 2, frame: 19
|
|
var r5;
|
|
var requires_age_gate;
|
|
var embeddedActivityConfig;
|
|
var promise;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
if (user.nsfwAllowed == null) {
|
|
if (application != null) {
|
|
r5 = application;
|
|
if (r5 == null) {
|
|
return false;
|
|
}
|
|
embeddedActivityConfig = r5.embeddedActivityConfig;
|
|
requires_age_gate = embeddedActivityConfig == null ? value : embeddedActivityConfig.requires_age_gate;
|
|
if (requires_age_gate == null) {
|
|
return true;
|
|
}
|
|
if (requires_age_gate) {
|
|
promise = new global.Promise(_fun81909);
|
|
await promise;
|
|
promise = undefined;
|
|
if (false) {
|
|
return promise;
|
|
}
|
|
if (promise) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
var binding = env2_7;
|
|
var object2 = {applicationId: applicationId};
|
|
object2.channelId = channel == null ? value : channel.id;
|
|
object2.guildId = (channel == null ? value : channel.getGuildId()) ?? value;
|
|
await binding(object2);
|
|
var value7 = undefined;
|
|
if (false) {
|
|
return value7;
|
|
}
|
|
r5 = value7;
|
|
if (r5 == null) {
|
|
return false;
|
|
}
|
|
embeddedActivityConfig = r5.embeddedActivityConfig;
|
|
requires_age_gate = embeddedActivityConfig == null ? value : embeddedActivityConfig.requires_age_gate;
|
|
if (requires_age_gate == null) {
|
|
return true;
|
|
}
|
|
if (requires_age_gate) {
|
|
promise = new global.Promise(_fun81909);
|
|
await promise;
|
|
promise = undefined;
|
|
if (false) {
|
|
return promise;
|
|
}
|
|
if (promise) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
async function _fun81914({application, applicationId, channel, onConfirmActivityLaunchChecksAlertOpen}) { // fn#81914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:2086, offset: 0x01ee381f, size: 308 bytes, params: 2, frame: 21
|
|
var environment;
|
|
var r3;
|
|
var r6;
|
|
var r2;
|
|
var binding;
|
|
var value9;
|
|
var value10;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
await undefined;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
if (application != null) {
|
|
r3 = application;
|
|
value9 = r3 != null;
|
|
} else {
|
|
binding = env2_7;
|
|
var object2 = {applicationId: applicationId};
|
|
object2.channelId = channel == null ? value : channel.id;
|
|
object2.guildId = (channel == null ? value : channel.getGuildId()) ?? value;
|
|
await binding(object2);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value9 = null != undefined;
|
|
}
|
|
if (value9) {
|
|
value10 = environment.__proto__.__proto__;
|
|
value = env2_0(env2_2[12]);
|
|
value = value.hasApplicationFlag(r3, env2_6.EMBEDDED_RELEASED);
|
|
r6 = !value && !r3.isVerified;
|
|
value = !r6;
|
|
if (r6) {
|
|
value = env2_5.hasActivityEverBeenLaunched(applicationId);
|
|
r3 = value ? !!value : new global.Promise(_fun81915);
|
|
} else {
|
|
r3 = value;
|
|
}
|
|
r2 = r3;
|
|
} else {
|
|
r2 = value9;
|
|
}
|
|
return r2;
|
|
}
|
|
|
|
function* _fun81920(a0) { // fn#81920, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:2701, offset: 0x01ee39f8, size: 155 bytes, params: 2, frame: 15
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
yield confirmActivityChange({currentEmbeddedApplication: a0.currentEmbeddedApplication,
|
|
shouldClosePopoutOnLeaveCurrentEmbeddedApplication: a0.shouldClosePopoutOnLeaveCurrentEmbeddedApplication,
|
|
onConfirmActivityLaunchChecksAlertOpen: a0.onConfirmActivityLaunchChecksAlertOpen});
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
if (value) {
|
|
yield confirmActivityAgeGate(a0);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
if (value) {
|
|
yield confirmExternalAppLaunch(a0);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
return !!value;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
function _fun81903(a0) { // fn#81903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:990, offset: 0x01ee34d0, size: 197 bytes, params: 2, frame: 22
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
let binding = env3_5;
|
|
const value4 = binding.getSelfEmbeddedActivities().get(currentEmbeddedApplication.id);
|
|
binding = env3_0;
|
|
const value5 = undefined;
|
|
const value6 = binding(env3_2[8]);
|
|
const getEmbeddedActivityLocationChannelId = value6.getEmbeddedActivityLocationChannelId;
|
|
const channel = env3_4.getChannel(Reflect.apply(getEmbeddedActivityLocationChannelId, value6,
|
|
[value4 == null ? value5 : value4.location]));
|
|
if (value4 == null) {
|
|
a0(true);
|
|
} else if (channel != null) {
|
|
if (onConfirmActivityLaunchChecksAlertOpen != null) {
|
|
onConfirmActivityLaunchChecksAlertOpen();
|
|
}
|
|
env3_1(env3_2[9])(currentEmbeddedApplication, channel, _fun81904, _fun81905);
|
|
} else {
|
|
a0(true);
|
|
}
|
|
return value5;
|
|
}
|
|
|
|
function _fun81909(a0) { // fn#81909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:1825, offset: 0x01ee3757, size: 130 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
if (onConfirmActivityLaunchChecksAlertOpen != null) {
|
|
onConfirmActivityLaunchChecksAlertOpen();
|
|
}
|
|
const binding = env3_0;
|
|
const value3 = undefined;
|
|
binding(env3_2[11]).confirmActivityAgeGateAlert({application: env0_2,
|
|
channelId: channel == null ? value3 : channel.id, onAgree: onAgree, onDisagree: onDisagree_81911});
|
|
return value3;
|
|
}
|
|
|
|
function _fun81915(a0) { // fn#81915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:2479, offset: 0x01ee3953, size: 104 bytes, params: 2, frame: 14
|
|
const env0_0 = a0;
|
|
if (onConfirmActivityLaunchChecksAlertOpen != null) {
|
|
onConfirmActivityLaunchChecksAlertOpen();
|
|
}
|
|
const value3 = env3_0(env3_2[13]);
|
|
value3.confirmExternalAppLaunchAlert({application: env0_1, onConfirm: onConfirm_81916, onCancel: onCancel_81917});
|
|
}
|
|
|
|
function confirmExternalAppLaunch() { // fn#81923, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:3200, offset: 0x01ee3ab1, size: 30 bytes, params: 1, frame: 13
|
|
return env3_11.apply(this, arguments);
|
|
}
|
|
|
|
function _fun81904() { // fn#81904, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10832:1176, offset: 0x01ee3595, size: 98 bytes, params: 1, frame: 15
|
|
const value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
env4_1(env4_2[10])().leaveActivity({location: env0_1.location, applicationId: currentEmbeddedApplication.id,
|
|
shouldClosePopout: shouldClosePopoutOnLeaveCurrentEmbeddedApplication});
|
|
env0_0(true);
|
|
}
|
|
|