694 lines
41 KiB
TypeScript
694 lines
41 KiB
TypeScript
/* Metro module 9514; source: modules/quests/lib/analytics/ContentImpressionTracker.tsx; dependencies: [5, 6, 7, 31, 7093, 9515, 661, 33, 7091, 7122, 7120, 477, 7071, 9516, 7121, 9484, 7099, 7110, 7127, 9517, 9518, 4826, 4831, 491, 9519, 9513, 566, 4594, 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 MonitoringAgent from '../../../monitoring/MonitoringAgent.tsx'; /* Metro dependency 4826 */
|
|
import QuestStore from '../../QuestStore.tsx'; /* Metro dependency 7093 */
|
|
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 JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as Module00491Module from '../../../../by-id/module-00491.js'; /* Metro dependency 491 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as MetricEventsModule from '../../../../external/discord_common/js/shared/shared-constants/MetricEvents.tsx'; /* Metro dependency 4831 */
|
|
import * as QuestDataUtilsModule from '../../utils/QuestDataUtils.tsx'; /* Metro dependency 7091 */
|
|
import * as AnalyticsTypesModule from './AnalyticsTypes.tsx'; /* Metro dependency 7120 */
|
|
import * as AdCreativeTypeModule from '../../../../external/discord_common/js/shared/shared-constants/AdCreativeType.tsx'; /* Metro dependency 7121 */
|
|
import * as ContentImpressionTrackerHooksModule from './ContentImpressionTrackerHooks.tsx'; /* Metro dependency 9513 */
|
|
import * as ContentImpressionTrackerConstantsModule from './ContentImpressionTrackerConstants.tsx'; /* Metro dependency 9515 */
|
|
|
|
function _fun74221(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:6, offset: 0x01d8544e, size: 353 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const getQuestPlacementCombinationKey = function(a0, a1) {
|
|
return '' + a0 + '_' + a1;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const Set = global.Set;
|
|
const set = new Set();
|
|
const value5 = _fun74223();
|
|
value = value.createContext(undefined);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/quests/lib/analytics/ContentImpressionTracker.tsx');
|
|
exports.QuestContentImpression = value5;
|
|
exports.QuestImpressionContext = value;
|
|
exports.QuestContentImpressionTracker = QuestContentImpressionTracker;
|
|
function _fun74223() { // fn#74223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:373, offset: 0x01d855d3, size: 84 bytes, params: 1, frame: 15
|
|
return CreateClass(QuestContentImpression, [{key: 'getId', value: function() {
|
|
return this.id;
|
|
}}, {key: 'getQuestContentPosition', value: function() {
|
|
return this.questContentPosition;
|
|
}}]);
|
|
function QuestContentImpression({adContentIds, adCreativeType, questContent, triggeredByStatusChange, trackGuildAndChannelMetadata, questContentPosition, questContentRowIndex, minViewTimeSeconds, isQuestEnrollmentBlocked, onImpression, sourceQuestContent}) { // fn#74224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:394, offset: 0x01d85627, size: 434 bytes, params: 2, frame: 27
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
env1_4(this, QuestContentImpression);
|
|
this.isRunning = false;
|
|
this.trackViewedPlacement = trackViewedPlacement;
|
|
this.shouldExtendSession = shouldExtendSession;
|
|
this.onMinViewTimeReached = env1_3(_fun74228);
|
|
this.beat = beat;
|
|
this.commonProperties = commonProperties;
|
|
this.clone = clone_74233;
|
|
this.start = start_74234;
|
|
this.stop = stop_74237;
|
|
const r13 = minViewTimeSeconds !== undefined ? minViewTimeSeconds : MIN_QUEST_VIEW_TIME_SECONDS;
|
|
this.id = Module00491Module.v4();
|
|
this.questContent = questContent;
|
|
this.questContentPosition = questContentPosition;
|
|
this.minViewTimeSeconds = r13;
|
|
this.minViewportPercentage = MIN_QUEST_CONTENT_VISIBILITY_PERCENTAGE;
|
|
this.trackGuildAndChannelMetadata = trackGuildAndChannelMetadata;
|
|
this.triggeredByStatusChange = triggeredByStatusChange;
|
|
this.questContentRowIndex = questContentRowIndex;
|
|
this.isQuestEnrollmentBlocked = isQuestEnrollmentBlocked;
|
|
this.onImpressionCallback = onImpression;
|
|
this.sourceQuestContent = sourceQuestContent;
|
|
value = require(9519) /* metro dependency 9519: AdAnalyticsInterfaceExperiment */;
|
|
const shouldMigrateToAdAnalyticsInterface = value.shouldMigrateToAdAnalyticsInterface;
|
|
const AdAnalyticsInterfaceExperimentStep = (require(9519) /* metro dependency 9519: AdAnalyticsInterfaceExperiment */).AdAnalyticsInterfaceExperimentStep;
|
|
const STEP_1_LOADED = AdAnalyticsInterfaceExperimentStep.STEP_1_LOADED;
|
|
this.migrateQuestContentLoadedToCaptureAdUserAction = Reflect.apply(shouldMigrateToAdAnalyticsInterface, value,
|
|
[STEP_1_LOADED, 'quest_content_impression']);
|
|
const AdCreativeType = (AdCreativeTypeModule).AdCreativeType;
|
|
AdCreativeType.QUEST;
|
|
this.entity = {adContentIds: adContentIds, adCreativeType: adCreativeType};
|
|
function trackViewedPlacement(a0) { // fn#74225, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:515, owner: QuestContentImpression.trackViewedPlacement, offset: 0x01d857d9, size: 128 bytes, params: 2, frame: 17
|
|
var r2;
|
|
var moduleValue2;
|
|
var binding;
|
|
const questPlacementFromQuestContent = (require(7091) /* metro dependency 7091: QuestDataUtils */).getQuestPlacementFromQuestContent(env0_0.questContent);
|
|
const value4 = questPlacementFromQuestContent != null;
|
|
if (value4) {
|
|
moduleValue2 = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
r2 = moduleValue2.isBillableQuestContent(env0_0.questContent);
|
|
} else {
|
|
r2 = value4;
|
|
}
|
|
if (r2) {
|
|
binding = env2_13;
|
|
binding.add(getQuestPlacementCombinationKey(a0, questPlacementFromQuestContent));
|
|
}
|
|
}
|
|
|
|
function shouldExtendSession(a0) { // fn#74226, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:716, owner: QuestContentImpression.shouldExtendSession, offset: 0x01d85859, size: 131 bytes, params: 2, frame: 19
|
|
let value = environment.__proto__.__proto__;
|
|
const questPlacementFromQuestContent = (require(7091) /* metro dependency 7091: QuestDataUtils */).getQuestPlacementFromQuestContent(env0_0.questContent);
|
|
let r0 = questPlacementFromQuestContent != null && !env2_13.has(getQuestPlacementCombinationKey(a0,
|
|
questPlacementFromQuestContent));
|
|
if (r0) {
|
|
value = require(7091) /* metro dependency 7091: QuestDataUtils */;
|
|
value = value.isBillableQuestContent(env0_0.questContent);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function* _fun74228() { // fn#74228, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:929, offset: 0x01d858e7, size: 431 bytes, params: 1, frame: 21
|
|
var r11;
|
|
var environment;
|
|
var advertisingId;
|
|
var value9;
|
|
var binding4;
|
|
var value10;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__;
|
|
var binding = env3_0;
|
|
var binding2 = env3_2;
|
|
var value3 = binding(binding2[9]);
|
|
var getAdUser = value3.getAdUser;
|
|
var value4 = binding(binding2[10]);
|
|
var getQuestContentName = value4.getQuestContentName;
|
|
yield Reflect.apply(getAdUser, value3, [Reflect.apply(getQuestContentName, value4, [env1_1.questContent])]);
|
|
var value6 = undefined;
|
|
if (false) {
|
|
return value6;
|
|
}
|
|
var object = {};
|
|
binding = env1_1;
|
|
object.trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
|
|
object.sourceQuestContent = binding.sourceQuestContent;
|
|
object = {};
|
|
object.min_view_time_seconds = binding.minViewTimeSeconds;
|
|
object.min_viewport_percentage = binding.minViewportPercentage;
|
|
object.triggered_by_status_change = binding.triggeredByStatusChange;
|
|
var value8 = null;
|
|
if (value8 != value6) {
|
|
value9 = env3_0(env3_2[11]);
|
|
advertisingId = value9.isIOS() ? value6.advertisingId : value8;
|
|
} else {
|
|
advertisingId = value8;
|
|
}
|
|
object.apple_advertising_id = advertisingId;
|
|
if (value8 != value6) {
|
|
binding = env3_0;
|
|
binding4 = env3_2;
|
|
value10 = binding(binding4[11]);
|
|
if (value10.isAndroid()) {
|
|
advertisingId = value6.advertisingId;
|
|
r11 = binding4;
|
|
} else {
|
|
advertisingId = value8;
|
|
r11 = binding4;
|
|
}
|
|
} else {
|
|
advertisingId = value8;
|
|
}
|
|
object.android_advertising_id = advertisingId;
|
|
binding = env3_1;
|
|
var binding5 = env3_2;
|
|
copyDataProperties(object, binding(binding5[12])(), r11);
|
|
value = env3_0(binding5[13]);
|
|
var getBrandSafetyContext = value.getBrandSafetyContext;
|
|
binding = env1_1;
|
|
copyDataProperties(object, Reflect.apply(getBrandSafetyContext, value, [binding.questContent]), r11);
|
|
binding.entity.adContentIds.forEach(_fun74229);
|
|
if (value8 != binding.onImpressionCallback) {
|
|
env1_1.onImpressionCallback();
|
|
}
|
|
}
|
|
function _fun74229(a0, a1) { // fn#74229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:1506, offset: 0x01d85a96, size: 995 bytes, params: 3, frame: 33
|
|
var questName;
|
|
var r20;
|
|
var r11;
|
|
var uuid;
|
|
var id;
|
|
var property;
|
|
var binding4;
|
|
var binding5;
|
|
var questLogger;
|
|
var info;
|
|
var minViewTimeSeconds;
|
|
var value8;
|
|
var object;
|
|
var value11;
|
|
var trackAdContentEvent;
|
|
var object2;
|
|
var quest;
|
|
var value14;
|
|
var binding6;
|
|
var value17;
|
|
var questLogger2;
|
|
var binding7;
|
|
var binding8;
|
|
var value20;
|
|
var value22;
|
|
var value23;
|
|
var trackQuestEvent;
|
|
var object3;
|
|
var currentQuestHomeSearchSession;
|
|
var getAdTrafficMetadataSealed;
|
|
let value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
let binding = env4_0;
|
|
const binding2 = env4_2;
|
|
const value2 = undefined;
|
|
const value3 = binding(binding2[8]);
|
|
const getAdMetadataSealed = value3.getAdMetadataSealed;
|
|
const binding3 = env2_1;
|
|
let sourceQuestContent = binding3.sourceQuestContent;
|
|
const value5 = Reflect.apply(getAdMetadataSealed, value3, [sourceQuestContent, a0]);
|
|
const shouldExtendSession2 = binding3.shouldExtendSession(a0);
|
|
binding3.trackViewedPlacement(a0);
|
|
let entity = binding3.entity;
|
|
const adCreativeType = entity.adCreativeType;
|
|
const AdCreativeType = binding(binding2[14]).AdCreativeType;
|
|
const QUEST = AdCreativeType.QUEST;
|
|
if (adCreativeType === QUEST) {
|
|
property = env2_1.entity.adContentIds[a1];
|
|
binding = env4_7;
|
|
quest = binding.getQuest(property);
|
|
value14 = null;
|
|
if (!(value14 == quest || env4_0(env4_2[8]).isQuestExpired(quest))) {
|
|
binding = env4_0;
|
|
binding6 = env4_2;
|
|
value17 = binding(binding6[15]);
|
|
value17.markAdContentSeen(binding(binding6[14]).AdCreativeType.QUEST, [property]);
|
|
}
|
|
binding = env4_0;
|
|
questLogger2 = binding(env4_2[16]).getQuestLogger();
|
|
info = questLogger2.info;
|
|
questName = value14 == quest ? value2 : quest.config.messages.questName;
|
|
r20 = value14 == questName ? property : questName;
|
|
binding = env2_1;
|
|
minViewTimeSeconds = binding.minViewTimeSeconds;
|
|
binding7 = env4_0;
|
|
binding8 = env4_2;
|
|
value20 = binding7(binding8[10]);
|
|
value22 = '' + r20 + ' Quest viewed for at least ' + minViewTimeSeconds + 's at ' + value20.getQuestContentName(binding.questContent);
|
|
id = binding.id;
|
|
Reflect.apply(info, questLogger2, [value22, {impressionId: id}]);
|
|
value23 = binding7(binding8[17]);
|
|
trackQuestEvent = value23.trackQuestEvent;
|
|
object = {};
|
|
copyDataProperties(object, env0_0, minViewTimeSeconds);
|
|
object['shouldExtendSession'] = shouldExtendSession2;
|
|
object['questId'] = property;
|
|
object['event'] = env4_11.QUEST_CONTENT_VIEWED;
|
|
object3 = {};
|
|
copyDataProperties(object3, env0_1, minViewTimeSeconds);
|
|
copyDataProperties(object3, binding.commonProperties(), minViewTimeSeconds);
|
|
r11 = value14 != value5 ? value5 : value14;
|
|
object3['metadata_sealed'] = r11;
|
|
binding = env4_0;
|
|
currentQuestHomeSearchSession = binding(env4_2[18]).getCurrentQuestHomeSearchSession();
|
|
uuid = value14 == currentQuestHomeSearchSession ? value2 : currentQuestHomeSearchSession.uuid;
|
|
r11 = value14 != uuid ? uuid : value14;
|
|
object3['search_session_id'] = r11;
|
|
binding = env4_0;
|
|
value = binding(env4_2[8]);
|
|
getAdTrafficMetadataSealed = value.getAdTrafficMetadataSealed;
|
|
sourceQuestContent = env2_1.sourceQuestContent;
|
|
id = value14 == quest ? value2 : quest.id;
|
|
value = Reflect.apply(getAdTrafficMetadataSealed, value, [sourceQuestContent, id]);
|
|
object3['traffic_metadata_sealed'] = value14 != value ? value : value14;
|
|
object['properties'] = object3;
|
|
Reflect.apply(trackQuestEvent, value23, [object]);
|
|
} else {
|
|
binding = env2_1;
|
|
entity = binding.entity;
|
|
property = entity.adContentIds[a1];
|
|
binding4 = env4_0;
|
|
binding5 = env4_2;
|
|
questLogger = binding4(binding5[16]).getQuestLogger();
|
|
info = questLogger.info;
|
|
minViewTimeSeconds = binding.minViewTimeSeconds;
|
|
value8 = binding4(binding5[10]);
|
|
Reflect.apply(info, questLogger,
|
|
['' + property + ' ad content viewed for at least ' + minViewTimeSeconds + 's at ' + value8.getQuestContentName(binding.questContent),
|
|
|
|
{impressionId: binding.id}]);
|
|
value11 = binding4(binding5[17]);
|
|
trackAdContentEvent = value11.trackAdContentEvent;
|
|
object = {};
|
|
copyDataProperties(object, env0_0, minViewTimeSeconds);
|
|
object['shouldExtendSession'] = shouldExtendSession2;
|
|
object['adContentId'] = property;
|
|
entity = binding.entity;
|
|
object['adCreativeType'] = entity.adCreativeType;
|
|
object['event'] = env4_11.QUEST_CONTENT_VIEWED;
|
|
object2 = {};
|
|
copyDataProperties(object2, env0_1, minViewTimeSeconds);
|
|
copyDataProperties(object2, binding.commonProperties(), minViewTimeSeconds);
|
|
object['properties'] = object2;
|
|
Reflect.apply(trackAdContentEvent, value11, [object]);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
}
|
|
|
|
function beat() { // fn#74230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:2899, owner: QuestContentImpression.beat, offset: 0x01d85e79, size: 219 bytes, params: 1, frame: 17
|
|
var Math;
|
|
var round;
|
|
var value2;
|
|
var binding;
|
|
var value3;
|
|
var object;
|
|
const value = a0;
|
|
const r6 = value !== undefined ? value : false;
|
|
const env0_0 = r6;
|
|
if (env0_0.lastBeatTime != null) {
|
|
Math = global.Math;
|
|
round = Math.round;
|
|
value2 = global.Date.now();
|
|
binding = env0_0;
|
|
value3 = Reflect.apply(round, Math, [value2 - binding.lastBeatTime]);
|
|
object = {};
|
|
object.trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
|
|
object.sourceQuestContent = binding.sourceQuestContent;
|
|
object = {is_termination_beat: r6, viewed_time_ms: value3};
|
|
object.triggered_by_status_change = binding.triggeredByStatusChange;
|
|
binding.entity.adContentIds.forEach(_fun74231);
|
|
}
|
|
binding = env0_0;
|
|
const Date = global.Date;
|
|
binding.lastBeatTime = Date.now();
|
|
function _fun74231(a0, a1) { // fn#74231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:3226, offset: 0x01d85f54, size: 668 bytes, params: 3, frame: 28
|
|
var r13;
|
|
var r14;
|
|
var r12;
|
|
var property;
|
|
var questLogger;
|
|
var info;
|
|
var value6;
|
|
var binding;
|
|
var value8;
|
|
var object;
|
|
var trackAdContentEvent;
|
|
var object2;
|
|
var quest;
|
|
var questLogger2;
|
|
var value12;
|
|
var value14;
|
|
var trackQuestEvent;
|
|
var object3;
|
|
let value = environment.__proto__;
|
|
let entity = env1_0.entity;
|
|
const adCreativeType = entity.adCreativeType;
|
|
const value3 = undefined;
|
|
const AdCreativeType = (AdCreativeTypeModule).AdCreativeType;
|
|
const QUEST = AdCreativeType.QUEST;
|
|
if (adCreativeType === QUEST) {
|
|
property = env1_0.entity.adContentIds[a1];
|
|
quest = QuestStore.getQuest(property);
|
|
questLogger2 = (require(7099) /* metro dependency 7099: getQuestLogger */).getQuestLogger();
|
|
info = questLogger2.info;
|
|
r14 = (quest == null ? value3 : quest.config.messages.questName) ?? property;
|
|
value12 = '';
|
|
r12 = env0_0 ? 'terminal ' : value12;
|
|
binding = env0_1;
|
|
value14 = value12 + r14 + ' Quest impression ' + r12 + 'heartbeat: ' + binding + 'ms since last heartbeat';
|
|
binding = env1_0;
|
|
Reflect.apply(info, questLogger2, [value14, {impressionId: binding.id}]);
|
|
value = require(7110) /* metro dependency 7110: AnalyticsActions */;
|
|
trackQuestEvent = value.trackQuestEvent;
|
|
object = {};
|
|
copyDataProperties(object, env0_2, r12);
|
|
object['questId'] = property;
|
|
object['event'] = AnalyticEvents.QUEST_CONTENT_VIEW_TIME;
|
|
object3 = {};
|
|
copyDataProperties(object3, Module00005, r12);
|
|
copyDataProperties(object3, binding.commonProperties(), r12);
|
|
object['properties'] = object3;
|
|
Reflect.apply(trackQuestEvent, value, [object]);
|
|
} else {
|
|
entity = env1_0.entity;
|
|
property = entity.adContentIds[a1];
|
|
questLogger = (require(7099) /* metro dependency 7099: getQuestLogger */).getQuestLogger();
|
|
info = questLogger.info;
|
|
value6 = '';
|
|
r13 = env0_0 ? 'terminal ' : value6;
|
|
binding = env0_1;
|
|
value8 = value6 + property + ' ad content impression ' + r13 + 'heartbeat: ' + binding + 'ms since last heartbeat';
|
|
binding = env1_0;
|
|
Reflect.apply(info, questLogger, [value8, {impressionId: binding.id}]);
|
|
value = require(7110) /* metro dependency 7110: AnalyticsActions */;
|
|
trackAdContentEvent = value.trackAdContentEvent;
|
|
object = {};
|
|
copyDataProperties(object, env0_2, r13);
|
|
object['adContentId'] = property;
|
|
entity = binding.entity;
|
|
object['adCreativeType'] = entity.adCreativeType;
|
|
object['event'] = AnalyticEvents.QUEST_CONTENT_VIEW_TIME;
|
|
object2 = {};
|
|
copyDataProperties(object2, Module00005, r13);
|
|
copyDataProperties(object2, binding.commonProperties(), r13);
|
|
object['properties'] = object2;
|
|
Reflect.apply(trackAdContentEvent, value, [object]);
|
|
}
|
|
return value3;
|
|
}
|
|
|
|
}
|
|
|
|
function commonProperties() { // fn#74232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:4068, owner: QuestContentImpression.commonProperties, offset: 0x01d861f0, size: 95 bytes, params: 1, frame: 16
|
|
const object = {};
|
|
const binding = env0_0;
|
|
object.impression_id = binding.id;
|
|
object.is_quest_enrollment_blocked = binding.isQuestEnrollmentBlocked;
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(7120) /* metro dependency 7120: AnalyticsTypes */;
|
|
const getContentProperties = value.getContentProperties;
|
|
copyDataProperties(object, Reflect.apply(getContentProperties, value, [binding.questContent,
|
|
binding.questContentPosition, binding.questContentRowIndex]), undefined);
|
|
return object;
|
|
}
|
|
|
|
function QuestContentImpressionClone({triggeredByStatusChange}) { // fn#74233, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:4271, owner: QuestContentImpression.clone, offset: 0x01d8624f, size: 155 bytes, params: 2, frame: 14
|
|
const binding = env0_0;
|
|
binding.stop();
|
|
let value = environment.__proto__;
|
|
const object = {};
|
|
object.questContent = binding.questContent;
|
|
object.questContentRowIndex = binding.questContentRowIndex;
|
|
object.questContentPosition = binding.questContentPosition;
|
|
const trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
|
|
object.trackGuildAndChannelMetadata = trackGuildAndChannelMetadata;
|
|
object.triggeredByStatusChange = triggeredByStatusChange;
|
|
object.isQuestEnrollmentBlocked = binding.isQuestEnrollmentBlocked;
|
|
object.onImpression = binding.onImpressionCallback;
|
|
object.sourceQuestContent = binding.sourceQuestContent;
|
|
copyDataProperties(object, binding.entity, trackGuildAndChannelMetadata);
|
|
value = Object.create(QuestContentImpression.prototype, {constructor: {value: QuestContentImpression}});
|
|
const questContentImpression = new QuestContentImpression(object);
|
|
return questContentImpression instanceof Object ? questContentImpression : value;
|
|
}
|
|
|
|
function QuestContentImpressionStart() { // fn#74234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:4723, owner: QuestContentImpression.start, offset: 0x01d862ea, size: 347 bytes, params: 1, frame: 18
|
|
var environment;
|
|
const binding = env0_0;
|
|
binding.stop(false);
|
|
const Date = global.Date;
|
|
binding.lastBeatTime = Date.now();
|
|
let window = global.window;
|
|
const setInterval = window.setInterval;
|
|
let value = environment.__proto__.__proto__;
|
|
binding.heartbeatTimeoutId = Reflect.apply(setInterval, window, [_fun74235, 1000 * HEARTBEAT_SECONDS]);
|
|
window = global.window;
|
|
binding.minViewTimeReachedTimeoutId = window.setTimeout(binding.onMinViewTimeReached,
|
|
1000 * binding.minViewTimeSeconds);
|
|
let object = {};
|
|
object.trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
|
|
object.sourceQuestContent = binding.sourceQuestContent;
|
|
({}).triggered_by_status_change = binding.triggeredByStatusChange;
|
|
binding.entity.adContentIds.forEach(_fun74236);
|
|
const defaultImport = MonitoringAgent;
|
|
const increment = defaultImport.increment;
|
|
object = {};
|
|
const MetricEvents = (MetricEventsModule).MetricEvents;
|
|
const QUEST_CONTENT_IMPRESSION = MetricEvents.QUEST_CONTENT_IMPRESSION;
|
|
object.name = QUEST_CONTENT_IMPRESSION;
|
|
const getQuestContentName = (AnalyticsTypesModule).getQuestContentName;
|
|
value = Reflect.apply(getQuestContentName, value, [binding.questContent]);
|
|
value = 'quest_content:' + value;
|
|
object.tags = [value];
|
|
Reflect.apply(increment, defaultImport, [object]);
|
|
binding.isRunning = true;
|
|
function _fun74235() { // fn#74235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:4815, offset: 0x01d86445, size: 19 bytes, params: 1, frame: 9
|
|
return env1_0.beat();
|
|
}
|
|
|
|
function _fun74236(a0, a1) { // fn#74236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:5153, offset: 0x01d86458, size: 974 bytes, params: 3, frame: 32
|
|
var questName;
|
|
var r21;
|
|
var id;
|
|
var property;
|
|
var questLogger;
|
|
var info;
|
|
var moduleValue3;
|
|
var getQuestContentName;
|
|
var object;
|
|
var moduleValue4;
|
|
var trackAdContentEvent;
|
|
var object2;
|
|
var quest;
|
|
var questLogger2;
|
|
var value11;
|
|
var moduleValue6;
|
|
var value13;
|
|
var moduleValue7;
|
|
var trackQuestEvent;
|
|
var object3;
|
|
var getAdTrafficMetadataSealed;
|
|
var captureAdUserAction;
|
|
var object4;
|
|
let value = environment.__proto__.__proto__.__proto__;
|
|
const value2 = undefined;
|
|
const getAdMetadataSealed = QuestDataUtilsModule.getAdMetadataSealed;
|
|
let binding = env1_0;
|
|
let sourceQuestContent = binding.sourceQuestContent;
|
|
const value4 = Reflect.apply(getAdMetadataSealed, QuestDataUtilsModule, [sourceQuestContent, a0]);
|
|
const migrateQuestContentLoadedToCaptureAdUserAction = binding.migrateQuestContentLoadedToCaptureAdUserAction;
|
|
let entity = env1_0.entity;
|
|
const adCreativeType = entity.adCreativeType;
|
|
const AdCreativeType = (AdCreativeTypeModule).AdCreativeType;
|
|
const QUEST = AdCreativeType.QUEST;
|
|
if (migrateQuestContentLoadedToCaptureAdUserAction) {
|
|
object = {};
|
|
entity = binding.entity;
|
|
object.adCreativeType = entity.adCreativeType;
|
|
entity = binding.entity;
|
|
object.adCreativeId = entity.adContentIds[a1];
|
|
value = require(9517) /* metro dependency 9517: captureAdUserAction */;
|
|
captureAdUserAction = value.captureAdUserAction;
|
|
object4 = {};
|
|
object4.type = (require(9518) /* metro dependency 9518: captureAdUserActionTypes */).AdUserActionType.END_CONTENT_LOAD;
|
|
object4.surfaceId = binding.questContent;
|
|
object4.sourceQuestContent = binding.sourceQuestContent;
|
|
object4.impressionId = binding.id;
|
|
object4.triggeredByStatusChange = binding.triggeredByStatusChange;
|
|
object4.trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
|
|
object4.questContentPosition = binding.questContentPosition;
|
|
object4.questContentRowIndex = binding.questContentRowIndex;
|
|
copyDataProperties(object4, object, undefined);
|
|
Reflect.apply(captureAdUserAction, value, [object4]);
|
|
} else if (adCreativeType === QUEST) {
|
|
property = env1_0.entity.adContentIds[a1];
|
|
quest = QuestStore.getQuest(property);
|
|
questLogger2 = (require(7099) /* metro dependency 7099: getQuestLogger */).getQuestLogger();
|
|
info = questLogger2.info;
|
|
value11 = null;
|
|
questName = value11 == quest ? value2 : quest.config.messages.questName;
|
|
r21 = value11 == questName ? property : questName;
|
|
moduleValue6 = require(7120) /* metro dependency 7120: AnalyticsTypes */;
|
|
getQuestContentName = moduleValue6.getQuestContentName;
|
|
binding = env1_0;
|
|
value13 = '' + r21 + ' Quest became visible at ' + Reflect.apply(getQuestContentName, moduleValue6,
|
|
[binding.questContent]);
|
|
id = binding.id;
|
|
Reflect.apply(info, questLogger2, [value13, {impressionId: id}]);
|
|
moduleValue7 = require(7110) /* metro dependency 7110: AnalyticsActions */;
|
|
trackQuestEvent = moduleValue7.trackQuestEvent;
|
|
object = {};
|
|
copyDataProperties(object, env0_0, undefined);
|
|
object['questId'] = property;
|
|
object['event'] = AnalyticEvents.QUEST_CONTENT_LOADED;
|
|
object3 = {};
|
|
copyDataProperties(object3, env0_1, undefined);
|
|
object3['metadata_sealed'] = value11 != value4 ? value4 : value11;
|
|
binding = env1_0;
|
|
copyDataProperties(object3, binding.commonProperties(), undefined);
|
|
value = QuestDataUtilsModule;
|
|
getAdTrafficMetadataSealed = value.getAdTrafficMetadataSealed;
|
|
sourceQuestContent = binding.sourceQuestContent;
|
|
id = value11 == quest ? value2 : quest.id;
|
|
value = Reflect.apply(getAdTrafficMetadataSealed, value, [sourceQuestContent, id]);
|
|
object3['traffic_metadata_sealed'] = value11 != value ? value : value11;
|
|
object['properties'] = object3;
|
|
Reflect.apply(trackQuestEvent, moduleValue7, [object]);
|
|
} else {
|
|
binding = env1_0;
|
|
entity = binding.entity;
|
|
property = entity.adContentIds[a1];
|
|
questLogger = (require(7099) /* metro dependency 7099: getQuestLogger */).getQuestLogger();
|
|
info = questLogger.info;
|
|
moduleValue3 = require(7120) /* metro dependency 7120: AnalyticsTypes */;
|
|
Reflect.apply(info, questLogger,
|
|
['' + property + ' ad content became visible at ' + moduleValue3.getQuestContentName(binding.questContent),
|
|
{impressionId: binding.id}]);
|
|
moduleValue4 = require(7110) /* metro dependency 7110: AnalyticsActions */;
|
|
trackAdContentEvent = moduleValue4.trackAdContentEvent;
|
|
object = {};
|
|
copyDataProperties(object, env0_0, undefined);
|
|
object['adContentId'] = property;
|
|
entity = binding.entity;
|
|
object['adCreativeType'] = entity.adCreativeType;
|
|
object['event'] = AnalyticEvents.QUEST_CONTENT_LOADED;
|
|
object2 = {};
|
|
copyDataProperties(object2, env0_1, undefined);
|
|
copyDataProperties(object2, binding.commonProperties(), undefined);
|
|
object['properties'] = object2;
|
|
Reflect.apply(trackAdContentEvent, moduleValue4, [object]);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
}
|
|
|
|
function QuestContentImpressionStop() { // fn#74237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:6927, owner: QuestContentImpression.stop, offset: 0x01d86826, size: 93 bytes, params: 1, frame: 13
|
|
const value = a0;
|
|
if (!(value !== undefined) || value) {
|
|
env0_0.beat(true);
|
|
}
|
|
const binding = env0_0;
|
|
binding.lastBeatTime = undefined;
|
|
global.clearInterval(binding.heartbeatTimeoutId);
|
|
global.clearTimeout(binding.minViewTimeReachedTimeoutId);
|
|
binding.isRunning = false;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function QuestContentImpressionTracker(a0) { // fn#74240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:8267, offset: 0x01d8688e, size: 379 bytes, params: 2, frame: 29
|
|
const env0_0 = a0;
|
|
const visible = a0.visible;
|
|
const visibleChanged = a0.visibleChanged;
|
|
const focused = a0.focused;
|
|
const reference = a0.reference;
|
|
const focusedChanged = a0.focusedChanged;
|
|
const sourceQuestContent = a0.sourceQuestContent;
|
|
const value2 = (ContentImpressionTrackerHooksModule).useQuestStatusChanged(a0);
|
|
const binding = value2;
|
|
const value3 = binding.useRef(null);
|
|
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([QuestStore], function() {
|
|
return QuestStore.questEnrollmentBlockedUntil != null;
|
|
}, []);
|
|
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
|
|
return _fun74243;
|
|
});
|
|
binding.useEffect(_fun74244, [focused, visible, focusedChanged, visibleChanged, a0.adContentIds, a0.onImpression,
|
|
a0.questContent, a0.questContentPosition, a0.questContentRowIndex, a0.trackGuildAndChannelMetadata, value2,
|
|
a0.minViewTimeSeconds, value4, sourceQuestContent, a0.adCreativeType]);
|
|
const Provider = env0_15.Provider;
|
|
return (
|
|
<Provider value={value3}>
|
|
{a0.children(reference, value3)}
|
|
</Provider>
|
|
);
|
|
function _fun74242() { // fn#74242, offset: 0x01d86a1e, size: 11 bytes, params: 1, frame: 1
|
|
return _fun74243;
|
|
function _fun74243() { // fn#74243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:8566, offset: 0x01d86a29, size: 41 bytes, params: 1, frame: 10
|
|
if (env1_7.current != null) {
|
|
env1_7.current.stop();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun74244() { // fn#74244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9700:8621, offset: 0x01d86a52, size: 356 bytes, params: 1, frame: 16
|
|
var r3;
|
|
var r2;
|
|
var binding;
|
|
var object;
|
|
var value4;
|
|
var binding2;
|
|
var binding3;
|
|
var object2;
|
|
const r4 = focused && visible;
|
|
let r1 = visibleChanged || focusedChanged;
|
|
r1 = (!r1 ? env0_6 : r1) && r4;
|
|
if (r1) {
|
|
r2 = r1;
|
|
} else {
|
|
r3 = visibleChanged || focusedChanged;
|
|
r3 = r3 && !r4;
|
|
r2 = r3;
|
|
}
|
|
r2 = (!r2 ? env0_6 : r2) && env0_7.current != null;
|
|
if (r2) {
|
|
env0_7.current.stop();
|
|
}
|
|
if (r1) {
|
|
object = {isQuestEnrollmentBlocked: ContentImpressionTrackerConstantsModule.HEARTBEAT_SECONDS};
|
|
binding = env0_0;
|
|
object.minViewTimeSeconds = binding.minViewTimeSeconds;
|
|
object.onImpression = binding.onImpression;
|
|
object.questContent = binding.questContent;
|
|
object.questContentPosition = binding.questContentPosition;
|
|
object.questContentRowIndex = binding.questContentRowIndex;
|
|
object.sourceQuestContent = sourceQuestContent;
|
|
object.trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
|
|
object.triggeredByStatusChange = env0_6;
|
|
binding.adCreativeType;
|
|
value4 = environment.__proto__;
|
|
(require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST;
|
|
binding2 = env0_7;
|
|
binding3 = env1_14;
|
|
object2 = {};
|
|
copyDataProperties(object2, object, require);
|
|
object2['adContentIds'] = binding.adContentIds;
|
|
object2['adCreativeType'] = binding.adCreativeType;
|
|
binding2.current = new binding3();
|
|
binding2.current.start();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun74221, 9514, [5, 6, 7, 31, 7093, 9515, 661, 33, 7091, 7122, 7120, 477, 7071, 9516, 7121, 9484, 7099,
|
|
7110, 7127, 9517, 9518, 4826, 4831, 491, 9519, 9513, 566, 4594,
|
|
2]) /* metro module 9514, dependencies: [5, 6, 7, 31, 7093, 9515, 661, 33, 7091, 7122, 7120, 477, 7071, 9516, 7121, 9484, 7099, 7110, 7127, 9517, 9518, 4826, 4831, 491, 9519, 9513, 566, 4594, 2] */;
|