Files
discord-decomp/sources/modules/quests/utils/QuestPlatformUtils.tsx
T
2026-07-28 01:06:53 +03:00

588 lines
33 KiB
TypeScript

/* Metro module 9520; source: modules/quests/utils/QuestPlatformUtils.tsx; dependencies: [6528, 661, 7116, 6535, 9519, 9517, 9518, 7121, 7110, 9354, 1244, 477, 9505, 4078, 9521, 1239, 491, 9511, 3847, 7007, 694, 2] */
import AuthorizeConnectionNative from '../../connections/authorizeConnection.native.tsx'; /* Metro dependency 9354 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as ComponentDispatchUtilsModule from '../../../utils/ComponentDispatchUtils.tsx'; /* Metro dependency 1239 */
import * as BrowserManagerModule from '../../links/native/BrowserManager.tsx'; /* Metro dependency 4078 */
import * as QuestConstantsModule from '../QuestConstants.tsx'; /* Metro dependency 6528 */
import * as FirstPartyQuestTaskTypesModule from '../../../external/discord_common/js/shared/shared-constants/FirstPartyQuestTaskTypes.tsx'; /* Metro dependency 6535 */
import * as OpenUserSettingsModule from '../../user_settings/core/native/openUserSettings.tsx'; /* Metro dependency 7007 */
import * as AnalyticsActionsModule from '../lib/analytics/AnalyticsActions.tsx'; /* Metro dependency 7110 */
import * as ExperimentsModule from '../experiments/index.tsx'; /* Metro dependency 9511 */
import * as AdAnalyticsInterfaceExperimentModule from '../experiments/AdAnalyticsInterfaceExperiment.tsx'; /* Metro dependency 9519 */
import * as AppStoreOverlayTelemetryManagerModule from '../native/AppStoreOverlayTelemetryManager.tsx'; /* Metro dependency 9521 */
function _fun74261(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:6, offset: 0x01d8797a, size: 395 bytes, params: 8, frame: 20
const env0_0 = require;
const supportedConsoles2 = supportedConsoles;
const closure2 = function(a0) {
return a0.connected_account_type === 'xbox' ? PlatformTypes.XBOX : PlatformTypes.PLAYSTATION;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/quests/utils/QuestPlatformUtils.tsx');
exports.supportedTaskPlatforms = supportedTaskPlatforms;
exports.supportedConsoles = supportedConsoles2;
exports.isQuestSupportedOnWeb = isQuestSupportedOnWeb;
exports.PlayQuestPlatform = {DESKTOP: 'desktop', XBOX: 'xbox', PLAYSTATION: 'playstation'};
exports.getPlatformTypeForHintMessage = closure2;
exports.openAuthorizationConnectionModal = openAuthorizationConnectionModal;
exports.getExpiredCredentialsHintMessage = function(a0) {
return getPlatformTypeForHintMessage(a0) === PlatformTypes.XBOX ? require(dependencyMap[10]).t['mytEv+'] : require(dependencyMap[10]).t.iDiwby;
};
exports.openGameLinkDirectly = openGameLinkDirectly;
exports.openAdGameLinkDirectly = openAdGameLinkDirectly;
exports.openConsoleConnectionSettings = openConsoleConnectionSettings;
exports.openAddConsoleConnectionModal = openAddConsoleConnectionModal;
exports.openSingleConsoleConnectionModal = openSingleConsoleConnectionModal;
function supportedConsoles({config}) { // fn#74262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:217, offset: 0x01d87b05, size: 194 bytes, params: 2, frame: 17
var r5;
var property;
const FirstPartyQuestTaskTypes = (FirstPartyQuestTaskTypesModule).FirstPartyQuestTaskTypes;
var PLAY_ON_XBOX;
var PLAY_ON_PLAYSTATION;
var push;
var PLAYSTATION;
var XBOX;
var value4;
const items2 = [];
const Object = global.Object;
const value = Object.keys(config.taskConfigV2.tasks);
let length = value.length;
if (0 < length) {
r5 = 0;
while (true) {
property = value[r5];
PLAY_ON_XBOX = FirstPartyQuestTaskTypes.PLAY_ON_XBOX;
if (PLAY_ON_XBOX !== property) {
PLAY_ON_PLAYSTATION = FirstPartyQuestTaskTypes.PLAY_ON_PLAYSTATION;
if (PLAY_ON_PLAYSTATION !== property) {
break;
}
push = items2.push;
PLAYSTATION = PlatformTypes.PLAYSTATION;
Reflect.apply(push, items2, [PLAYSTATION]);
break;
}
push = items2.push;
XBOX = PlatformTypes.XBOX;
Reflect.apply(push, items2, [XBOX]);
value4 = typeof r5 === 'bigint' ? r5 + 1n : +r5 + 1;
length = value.length;
if (value4 < length) {
r5 = value4;
continue;
}
break;
}
}
return items2;
}
function getDirectAppStoreLinkFromCta(a0) { // fn#74264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:695, offset: 0x01d87bf6, size: 340 bytes, params: 2, frame: 16
var iosAppId;
var r1;
var r0;
var ios;
var moduleValue3;
var android;
var value;
const value2 = undefined;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isIOS()) {
ios = a0.ios;
iosAppId = ios == null ? value2 : ios.iosAppId;
if (iosAppId == null) {
moduleValue3 = platformUtilsModule;
if (moduleValue3.isAndroid()) {
android = a0.android;
value = null;
r1 = value == (value == android ? value2 : android.androidAppId) ? value : 'https://play.google.com/store/apps/details?id=' + a0.android.androidAppId;
} else {
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.getOS();
r1 = value !== 'android' || (a0.android == null ? value2 : a0.android.androidAppId) == null ? null : 'https://play.google.com/store/apps/details?id=' + a0.android.androidAppId;
}
r0 = r1;
} else {
ios = a0.ios;
iosAppId = ios.iosAppId;
value = iosAppId.startsWith('id');
ios = a0.ios;
iosAppId = ios.iosAppId;
value = 'https://apps.apple.com/app/' + (value ? iosAppId : 'id' + iosAppId);
r0 = value;
}
} else if ((require(477) /* metro dependency 477: PlatformUtils */).getOS() !== 'ios') {
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue3.isAndroid()) {
android = a0.android;
value = null;
r1 = value == (value == android ? value2 : android.androidAppId) ? value : 'https://play.google.com/store/apps/details?id=' + a0.android.androidAppId;
} else {
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.getOS();
r1 = value !== 'android' || (a0.android == null ? value2 : a0.android.androidAppId) == null ? null : 'https://play.google.com/store/apps/details?id=' + a0.android.androidAppId;
}
r0 = r1;
} else {
ios = a0.ios;
iosAppId = ios == null ? value2 : ios.iosAppId;
if (iosAppId == null) {
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
if (moduleValue3.isAndroid()) {
android = a0.android;
value = null;
r1 = value == (value == android ? value2 : android.androidAppId) ? value : 'https://play.google.com/store/apps/details?id=' + a0.android.androidAppId;
} else {
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.getOS();
r1 = value !== 'android' || (a0.android == null ? value2 : a0.android.androidAppId) == null ? null : 'https://play.google.com/store/apps/details?id=' + a0.android.androidAppId;
}
r0 = r1;
} else {
ios = a0.ios;
iosAppId = ios.iosAppId;
value = iosAppId.startsWith('id');
ios = a0.ios;
iosAppId = ios.iosAppId;
value = 'https://apps.apple.com/app/' + (value ? iosAppId : 'id' + iosAppId);
r0 = value;
}
}
return r0;
}
function getInlineStoreParamsFromCta(a0) { // fn#74265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:1120, offset: 0x01d87d4a, size: 266 bytes, params: 2, frame: 18
var iosAppId;
var r0;
var android;
var value3;
var ios;
var object;
var parseInt;
var value;
const value2 = undefined;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
android = a0.android;
if ((android == null ? value2 : android.androidAppId) != null) {
r0 = {url: 'https://play.google.com/d?id=' + a0.android.androidAppId, appId: null};
} else {
value = platformUtilsModule;
value = value.isIOS();
value3 = null;
if (value) {
ios = a0.ios;
iosAppId = value3 == ios ? value2 : ios.iosAppId;
if (value3 != iosAppId) {
object = {};
ios = a0.ios;
iosAppId = ios.iosAppId;
object.url = 'https://apps.apple.com/app/id' + iosAppId;
parseInt = global.parseInt;
ios = a0.ios;
iosAppId = ios.iosAppId;
object.appId = parseInt(iosAppId, 10);
r0 = object;
} else {
r0 = value3;
}
} else {
r0 = value3;
}
}
} else {
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isIOS();
value3 = null;
if (value) {
ios = a0.ios;
iosAppId = value3 == ios ? value2 : ios.iosAppId;
if (value3 != iosAppId) {
object = {};
ios = a0.ios;
iosAppId = ios.iosAppId;
object.url = 'https://apps.apple.com/app/id' + iosAppId;
parseInt = global.parseInt;
ios = a0.ios;
iosAppId = ios.iosAppId;
object.appId = parseInt(iosAppId, 10);
r0 = object;
} else {
r0 = value3;
}
} else {
r0 = value3;
}
}
return r0;
}
function openAppStoreOverlay({url, appId}, a1) { // fn#74266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:1475, offset: 0x01d87e54, size: 161 bytes, params: 3, frame: 17
var value2;
const env0_0 = a1;
const openPlayStoreInlineInstall = (BrowserManagerModule).openPlayStoreInlineInstall;
if (appId != null) {
value2 = appId.toString();
}
openPlayStoreInlineInstall(url, appId, _fun74267).then(_fun74268).catch(_fun74270);
function _fun74267(a0) { // fn#74267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:1673, offset: 0x01d87ef5, size: 92 bytes, params: 2, frame: 16
clearAppStoreOverlayOpen();
const QUEST_APP_STORE_OVERLAY_CLOSED = AnalyticEvents.QUEST_APP_STORE_OVERLAY_CLOSED;
require(QUEST_APP_STORE_OVERLAY_CLOSED, QuestConstantsModule.QuestTaskPlatform, a0);
const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
const dispatch = ComponentDispatch.dispatch;
const QUEST_APP_STORE_OVERLAY_FINISHED = ComponentActions.QUEST_APP_STORE_OVERLAY_FINISHED;
Reflect.apply(dispatch, ComponentDispatch, [QUEST_APP_STORE_OVERLAY_FINISHED]);
}
function _fun74268(a0) { // fn#74268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:1802, offset: 0x01d87f51, size: 152 bytes, params: 2, frame: 15
var environment;
var value2;
var ComponentDispatch;
var value3;
if (a0) {
setAppStoreOverlayOpen({trackOverlayEvent: trackOverlayEvent});
value3 = environment.__proto__;
require(AnalyticEvents.QUEST_APP_STORE_OVERLAY_OPEN_SUCCEEDED, QuestConstantsModule.QuestTaskPlatform);
} else {
clearAppStoreOverlayOpen();
value2 = environment.__proto__;
require(AnalyticEvents.QUEST_APP_STORE_OVERLAY_OPEN_FAILED, QuestConstantsModule.QuestTaskPlatform);
ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch;
ComponentDispatch.dispatch(ComponentActions.QUEST_APP_STORE_OVERLAY_FINISHED);
}
function trackOverlayEvent(a0, a1) { // fn#74269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:1830, offset: 0x01d87fe9, size: 28 bytes, params: 3, frame: 15
return require(a0, env1_3, a1);
}
}
function _fun74270() { // fn#74270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:2026, offset: 0x01d88005, size: 88 bytes, params: 1, frame: 14
clearAppStoreOverlayOpen();
const QUEST_APP_STORE_OVERLAY_OPEN_FAILED = AnalyticEvents.QUEST_APP_STORE_OVERLAY_OPEN_FAILED;
require(QUEST_APP_STORE_OVERLAY_OPEN_FAILED, QuestConstantsModule.QuestTaskPlatform);
const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
const dispatch = ComponentDispatch.dispatch;
const QUEST_APP_STORE_OVERLAY_FINISHED = ComponentActions.QUEST_APP_STORE_OVERLAY_FINISHED;
Reflect.apply(dispatch, ComponentDispatch, [QUEST_APP_STORE_OVERLAY_FINISHED]);
}
}
function supportedTaskPlatforms(a0) { // fn#74271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:2256, offset: 0x01d8805d, size: 195 bytes, params: 2, frame: 17
let r3 = (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasPlayOnDesktopTask({quest: a0}) || (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasStreamOnDesktopTask({quest: a0});
r3 = !r3 ? (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasAchievementInGameTask(a0) : r3;
const hasSomeConsoleTasks2 = (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasSomeConsoleTasks(a0);
items2 = [];
if (r3) {
items2.push(QuestTaskPlatform.DESKTOP);
}
if (hasSomeConsoleTasks2) {
items2.push(QuestTaskPlatform.CONSOLE);
}
return items2;
}
function isQuestSupportedOnWeb(a0) { // fn#74272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:2569, offset: 0x01d88120, size: 67 bytes, params: 2, frame: 15
let value = require(7116) /* metro dependency 7116: QuestTaskUtils */;
value = value.hasWatchVideoTasks(a0);
return value || (require(7116) /* metro dependency 7116: QuestTaskUtils */).hasPlayActivityTask(a0);
}
function openAuthorizationConnectionModal({platformType, quest}, a1) { // fn#74273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:2804, offset: 0x01d88163, size: 355 bytes, params: 3, frame: 20
var object;
var moduleValue3;
var captureAdUserAction;
const shouldMigrateToAdAnalyticsInterface = AdAnalyticsInterfaceExperimentModule.shouldMigrateToAdAnalyticsInterface;
const AdAnalyticsInterfaceExperimentStep = AdAnalyticsInterfaceExperimentModule.AdAnalyticsInterfaceExperimentStep;
const STEP_2_CLICKED_INTERNAL = AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL;
if (Reflect.apply(shouldMigrateToAdAnalyticsInterface, AdAnalyticsInterfaceExperimentModule,
[STEP_2_CLICKED_INTERNAL, 'open_authorization_connection_modal'])) {
moduleValue3 = require(9517) /* metro dependency 9517: captureAdUserAction */;
captureAdUserAction = moduleValue3.captureAdUserAction;
object = {};
object.type = (require(9518) /* metro dependency 9518: captureAdUserActionTypes */).AdUserActionType.CLICK_INTERNAL;
object.adCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST;
object.adCreativeId = quest.id;
object.questContentCTA = a1.ctaContent;
object.surfaceId = a1.content;
object.sourceQuestContent = a1.sourceQuestContent;
object.impressionId = a1.impressionId;
Reflect.apply(captureAdUserAction, moduleValue3, [object]);
} else {
(require(7110) /* metro dependency 7110: AnalyticsActions */).trackQuestContentClicked({questId: quest.id,
questContent: a1.content, sourceQuestContent: a1.sourceQuestContent, questContentCTA: a1.ctaContent,
impressionId: a1.impressionId});
}
(AuthorizeConnectionNative)({platformType: platformType,
location: a1.ctaContent});
}
function openGameLinkDirectly(a0, a1) { // fn#74275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:3689, offset: 0x01d8832b, size: 684 bytes, params: 3, frame: 26
var r5;
var r6;
var r2;
var r13;
var getDirectAppStoreLinkFromCtaBinding;
var moduleValue2;
var URL;
var prototype;
var value6;
var uRL;
var value7;
var searchParams;
var value8;
var error;
var value9;
var value10;
var value11;
var value12;
var value13;
var getInlineStoreParamsFromCtaBinding;
var moduleValue5;
const env0_0 = a0;
const env0_1 = a1;
const value2 = undefined;
const ctaLink = (require(9505) /* metro dependency 9505: QuestCopyUtils */).getCtaLink(a0.config);
let ctaConfig = a0.config.ctaConfig;
const value4 = null;
if (value4 == ctaConfig) {
r5 = value4;
} else {
getDirectAppStoreLinkFromCtaBinding = getDirectAppStoreLinkFromCta;
moduleValue2 = require(9505) /* metro dependency 9505: QuestCopyUtils */;
r5 = getDirectAppStoreLinkFromCtaBinding({url: moduleValue2.getCtaLink(a0.config), android: ctaConfig.android,
ios: ctaConfig.ios});
}
const r10 = value4 == r5 ? ctaLink : r5;
try {
URL = global.URL;
prototype = URL.prototype;
value6 = Object.create(prototype, {constructor: {value: URL}});
uRL = new URL(r10);
value7 = uRL instanceof Object ? uRL : value6;
searchParams = value7.searchParams;
value8 = searchParams.has('dclid');
r6 = value8;
} catch (error) {
value9 = false;
r6 = value9;
}
if (r6) {
value10 = (require(491) /* metro dependency 491 */).v4();
try {
URL = global.URL;
prototype = URL.prototype;
value11 = Object.create(prototype, {constructor: {value: URL}});
uRL = new URL(r10);
value12 = uRL instanceof Object ? uRL : value11;
searchParams = value12.searchParams;
searchParams.set('dclid', value10);
value13 = value12.toString();
r6 = value13;
} catch (error) {
r6 = r10;
}
r2 = r6;
r13 = value10;
} else {
r2 = r10;
r13 = value2;
}
(AnalyticsActionsModule).trackQuestContentClicked({questId: a0.id,
questContent: a1.content, questContentCTA: a1.ctaContent, questContentPosition: a1.position,
impressionId: a1.impressionId, sourceQuestContent: a1.sourceQuestContent, clickId: r13});
const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
const dispatch = ComponentDispatch.dispatch;
const QUEST_GAME_LINK_OPENED = ComponentActions.QUEST_GAME_LINK_OPENED;
Reflect.apply(dispatch, ComponentDispatch, [QUEST_GAME_LINK_OPENED]);
const AppStoreBottomSheetOverlayFeatureGate = (ExperimentsModule).AppStoreBottomSheetOverlayFeatureGate;
const getConfig = AppStoreBottomSheetOverlayFeatureGate.getConfig;
if (Reflect.apply(getConfig, AppStoreBottomSheetOverlayFeatureGate, [{location: 'quest_open_game_link'}]).enabled) {
(importDefault(3847) /* metro dependency 3847: openURL */)(r2);
} else {
if (value4 == r5) {
(importDefault(3847) /* metro dependency 3847: openURL */)(r2);
return value2;
}
ctaConfig = a0.config.ctaConfig;
if (value4 == ctaConfig) {
r5 = value4;
} else {
getInlineStoreParamsFromCtaBinding = getInlineStoreParamsFromCta;
moduleValue5 = require(9505) /* metro dependency 9505: QuestCopyUtils */;
r5 = getInlineStoreParamsFromCtaBinding({url: moduleValue5.getCtaLink(a0.config),
android: ctaConfig.android,
ios: ctaConfig.ios});
}
if (value4 == r5) {
(importDefault(3847) /* metro dependency 3847: openURL */)(r2);
return value2;
}
openAppStoreOverlay(r5, _fun74276);
}
return value2;
function _fun74276(a0, a1, a2) { // fn#74276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:4826, offset: 0x01d885d7, size: 60 bytes, params: 4, frame: 19
let value = environment.__proto__;
value = require(7110) /* metro dependency 7110: AnalyticsActions */;
return value.trackAppStoreOverlayEvent(env0_0, require, a1, a0, a2);
}
}
function openAdGameLinkDirectly({adContentId, adCreativeType, cta}, a1) { // fn#74277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:4920, offset: 0x01d88613, size: 312 bytes, params: 3, frame: 24
const env0_2 = a1;
const url = cta.url;
const directAppStoreLinkFromCta = getDirectAppStoreLinkFromCta(cta);
const r2 = directAppStoreLinkFromCta ?? url;
(AnalyticsActionsModule).trackAdContentClicked({adContentId: adContentId,
adCreativeType: adCreativeType, questContent: a1.content, questContentCTA: a1.ctaContent,
questContentPosition: a1.position, impressionId: a1.impressionId, sourceQuestContent: a1.sourceQuestContent});
const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch;
const dispatch = ComponentDispatch.dispatch;
const QUEST_GAME_LINK_OPENED = ComponentActions.QUEST_GAME_LINK_OPENED;
Reflect.apply(dispatch, ComponentDispatch, [QUEST_GAME_LINK_OPENED]);
const AppStoreBottomSheetOverlayFeatureGate = (ExperimentsModule).AppStoreBottomSheetOverlayFeatureGate;
const getConfig = AppStoreBottomSheetOverlayFeatureGate.getConfig;
if (Reflect.apply(getConfig, AppStoreBottomSheetOverlayFeatureGate, [{location: 'quest_open_game_link'}]).enabled) {
(importDefault(3847) /* metro dependency 3847: openURL */)(r2);
} else {
if (directAppStoreLinkFromCta == null) {
(importDefault(3847) /* metro dependency 3847: openURL */)(r2);
return undefined;
}
var inlineStoreParamsFromCta = getInlineStoreParamsFromCta(cta);
if (inlineStoreParamsFromCta == null) {
(importDefault(3847) /* metro dependency 3847: openURL */)(r2);
return undefined;
}
openAppStoreOverlay(inlineStoreParamsFromCta, _fun74278);
}
function _fun74278(a0, a1, a2) { // fn#74278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:5530, offset: 0x01d8874b, size: 79 bytes, params: 4, frame: 19
const value = environment.__proto__;
return (AnalyticsActionsModule).trackAdContentAppStoreOverlayEvent({adContentId: adContentId,
adCreativeType: adCreativeType}, require, a1, a0, a2);
}
}
function openConsoleConnectionSettings({quest}, a1) { // fn#74279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:5671, offset: 0x01d8879a, size: 375 bytes, params: 3, frame: 19
var object;
var moduleValue3;
var captureAdUserAction;
const shouldMigrateToAdAnalyticsInterface = AdAnalyticsInterfaceExperimentModule.shouldMigrateToAdAnalyticsInterface;
const AdAnalyticsInterfaceExperimentStep = AdAnalyticsInterfaceExperimentModule.AdAnalyticsInterfaceExperimentStep;
const STEP_2_CLICKED_INTERNAL = AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL;
if (Reflect.apply(shouldMigrateToAdAnalyticsInterface, AdAnalyticsInterfaceExperimentModule,
[STEP_2_CLICKED_INTERNAL, 'open_console_connection_settings'])) {
moduleValue3 = require(9517) /* metro dependency 9517: captureAdUserAction */;
captureAdUserAction = moduleValue3.captureAdUserAction;
object = {};
object.type = (require(9518) /* metro dependency 9518: captureAdUserActionTypes */).AdUserActionType.CLICK_INTERNAL;
object.adCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST;
object.adCreativeId = quest.id;
object.questContentCTA = a1.ctaContent;
object.surfaceId = a1.content;
object.sourceQuestContent = a1.sourceQuestContent;
object.impressionId = a1.impressionId;
object.questContentPosition = a1.position;
Reflect.apply(captureAdUserAction, moduleValue3, [object]);
} else {
(require(7110) /* metro dependency 7110: AnalyticsActions */).trackQuestContentClicked({questId: quest.id,
questContent: a1.content, questContentPosition: a1.position, questContentCTA: a1.ctaContent,
impressionId: a1.impressionId, sourceQuestContent: a1.sourceQuestContent});
}
const openUserSettings = (OpenUserSettingsModule).openUserSettings;
const CONNECTIONS = UserSettingsSections.CONNECTIONS;
openUserSettings({screen: CONNECTIONS});
}
function openAddConsoleConnectionModal({quest}, a1) { // fn#74280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:6487, offset: 0x01d88911, size: 520 bytes, params: 3, frame: 19
var object;
var moduleValue3;
var captureAdUserAction;
var value;
const shouldMigrateToAdAnalyticsInterface = AdAnalyticsInterfaceExperimentModule.shouldMigrateToAdAnalyticsInterface;
const AdAnalyticsInterfaceExperimentStep = AdAnalyticsInterfaceExperimentModule.AdAnalyticsInterfaceExperimentStep;
const STEP_2_CLICKED_INTERNAL = AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL;
if (Reflect.apply(shouldMigrateToAdAnalyticsInterface, AdAnalyticsInterfaceExperimentModule,
[STEP_2_CLICKED_INTERNAL, 'open_add_console_connection_modal'])) {
moduleValue3 = require(9517) /* metro dependency 9517: captureAdUserAction */;
captureAdUserAction = moduleValue3.captureAdUserAction;
object = {};
object.type = (require(9518) /* metro dependency 9518: captureAdUserActionTypes */).AdUserActionType.CLICK_INTERNAL;
object.adCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST;
object.adCreativeId = quest.id;
object.questContentCTA = a1.ctaContent;
object.surfaceId = a1.content;
object.sourceQuestContent = a1.sourceQuestContent;
object.impressionId = a1.impressionId;
object.questContentPosition = a1.position;
object.questContentRowIndex = a1.rowIndex;
Reflect.apply(captureAdUserAction, moduleValue3, [object]);
} else {
(require(7110) /* metro dependency 7110: AnalyticsActions */).trackQuestContentClicked({questId: quest.id,
questContent: a1.content, questContentPosition: a1.position, questContentRowIndex: a1.rowIndex,
questContentCTA: a1.ctaContent, impressionId: a1.impressionId, sourceQuestContent: a1.sourceQuestContent});
}
const value2 = supportedConsoles(quest);
if (value2.length === 1) {
value = importDefault(9354) /* metro dependency 9354: authorizeConnectionNative */;
object = {};
object.platformType = value2.at(0);
return value(object);
}
value = importDefault(694) /* metro dependency 694: Dispatcher */;
const dispatch = value.dispatch;
object = {type: 'CONNECTIONS_GRID_MODAL_SHOW', onComplete: onComplete_74281};
const Set = global.Set;
const value3 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set(value2);
object.includedPlatformTypes = set instanceof Object ? set : value3;
object.includeApplicationConnections = false;
Reflect.apply(dispatch, value, [object]);
function openAddConsoleConnectionModalOnComplete(a0) { // fn#74281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:7386, owner: openAddConsoleConnectionModal.onComplete, offset: 0x01d88b19, size: 42 bytes, params: 2, frame: 12
const value = environment.__proto__;
return (AuthorizeConnectionNative)({platformType: a0});
}
}
function openSingleConsoleConnectionModal({quest}, a1, a2) { // fn#74282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9706:7519, offset: 0x01d88b43, size: 384 bytes, params: 4, frame: 19
var object;
var moduleValue3;
var captureAdUserAction;
const shouldMigrateToAdAnalyticsInterface = AdAnalyticsInterfaceExperimentModule.shouldMigrateToAdAnalyticsInterface;
const AdAnalyticsInterfaceExperimentStep = AdAnalyticsInterfaceExperimentModule.AdAnalyticsInterfaceExperimentStep;
const STEP_2_CLICKED_INTERNAL = AdAnalyticsInterfaceExperimentStep.STEP_2_CLICKED_INTERNAL;
if (Reflect.apply(shouldMigrateToAdAnalyticsInterface, AdAnalyticsInterfaceExperimentModule,
[STEP_2_CLICKED_INTERNAL, 'open_single_console_connection_modal'])) {
moduleValue3 = require(9517) /* metro dependency 9517: captureAdUserAction */;
captureAdUserAction = moduleValue3.captureAdUserAction;
object = {};
object.type = (require(9518) /* metro dependency 9518: captureAdUserActionTypes */).AdUserActionType.CLICK_INTERNAL;
object.adCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST;
object.adCreativeId = quest.id;
object.questContentCTA = a1.ctaContent;
object.surfaceId = a1.content;
object.sourceQuestContent = a1.sourceQuestContent;
object.impressionId = a1.impressionId;
object.questContentPosition = a1.position;
object.questContentRowIndex = a1.rowIndex;
Reflect.apply(captureAdUserAction, moduleValue3, [object]);
} else {
(require(7110) /* metro dependency 7110: AnalyticsActions */).trackQuestContentClicked({questId: quest.id,
questContent: a1.content, questContentPosition: a1.position, questContentRowIndex: a1.rowIndex,
questContentCTA: a1.ctaContent, impressionId: a1.impressionId, sourceQuestContent: a1.sourceQuestContent});
}
return (AuthorizeConnectionNative)({platformType: a2});
}
}
global.__d(_fun74261, 9520, [6528, 661, 7116, 6535, 9519, 9517, 9518, 7121, 7110, 9354, 1244, 477, 9505, 4078, 9521,
1239, 491, 9511, 3847, 7007, 694,
2]) /* metro module 9520, dependencies: [6528, 661, 7116, 6535, 9519, 9517, 9518, 7121, 7110, 9354, 1244, 477, 9505, 4078, 9521, 1239, 491, 9511, 3847, 7007, 694, 2] */;