Files
discord-decomp/sources/modules/quests/lib/analytics/ContentImpressionTracker.tsx
T
2026-07-27 16:20:00 +03:00

686 lines
33 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] */
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});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importDefault(6) /* metro dependency 6 */;
const env0_5 = importDefault(7) /* metro dependency 7 */;
let value = importAll(31) /* metro dependency 31 */;
const questStore = importDefault(7093) /* metro dependency 7093: QuestStore */;
const contentImpressionTrackerConstantsModule = require(9515) /* metro dependency 9515: ContentImpressionTrackerConstants */;
const env0_8 = contentImpressionTrackerConstantsModule.HEARTBEAT_SECONDS;
const env0_9 = contentImpressionTrackerConstantsModule.MIN_QUEST_VIEW_TIME_SECONDS;
const env0_10 = contentImpressionTrackerConstantsModule.MIN_QUEST_CONTENT_VISIBILITY_PERCENTAGE;
const env0_11 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
const env0_12 = (require(33) /* metro dependency 33 */).jsx;
const Set = global.Set;
const set = new Set();
const value5 = _fun74223();
value = value.createContext(undefined);
(require(2) /* metro dependency 2 */).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 env0_5(QuestContentImpression, [{key: 'getId', value: function() {
return this.id;
}}, {key: 'getQuestContentPosition', value: function() {
return this.questContentPosition;
}}]);
}
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 = (require(9513) /* metro dependency 9513: ContentImpressionTrackerHooks */).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 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;
const moduleValue = require(491) /* metro dependency 491 */;
this.id = moduleValue.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 = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType;
AdCreativeType.QUEST;
this.entity = {adContentIds: adContentIds, adCreativeType: adCreativeType};
}
function _fun74242() { // fn#74242, offset: 0x01d86a1e, size: 11 bytes, params: 1, frame: 1
return _fun74243;
}
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 object3;
var value4;
var binding2;
var binding3;
var object4;
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) {
object3 = {isQuestEnrollmentBlocked: env0_8};
binding = env0_0;
object3.minViewTimeSeconds = binding.minViewTimeSeconds;
object3.onImpression = binding.onImpression;
object3.questContent = binding.questContent;
object3.questContentPosition = binding.questContentPosition;
object3.questContentRowIndex = binding.questContentRowIndex;
object3.sourceQuestContent = sourceQuestContent;
object3.trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
object3.triggeredByStatusChange = env0_6;
binding.adCreativeType;
value4 = environment.__proto__;
(require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST;
binding2 = env0_7;
binding3 = env1_14;
object4 = {};
copyDataProperties(object4, object3, require);
object4['adContentIds'] = binding.adContentIds;
object4['adCreativeType'] = binding.adCreativeType;
binding2.current = new binding3();
binding2.current.start();
}
}
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 object2 = {};
binding = env1_1;
object2.trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
object2.sourceQuestContent = binding.sourceQuestContent;
object2 = {};
object2.min_view_time_seconds = binding.minViewTimeSeconds;
object2.min_viewport_percentage = binding.minViewportPercentage;
object2.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;
}
object2.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;
}
object2.android_advertising_id = advertisingId;
binding = env3_1;
var binding5 = env3_2;
copyDataProperties(object2, binding(binding5[12])(), r11);
value = env3_0(binding5[13]);
var getBrandSafetyContext = value.getBrandSafetyContext;
binding = env1_1;
copyDataProperties(object2, Reflect.apply(getBrandSafetyContext, value, [binding.questContent]), r11);
binding.entity.adContentIds.forEach(_fun74229);
if (value8 != binding.onImpressionCallback) {
env1_1.onImpressionCallback();
}
}
}
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 object2;
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]);
object2 = {};
object2.trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
object2.sourceQuestContent = binding.sourceQuestContent;
object2 = {is_termination_beat: r6, viewed_time_ms: value3};
object2.triggered_by_status_change = binding.triggeredByStatusChange;
binding.entity.adContentIds.forEach(_fun74231);
}
binding = env0_0;
const Date = global.Date;
binding.lastBeatTime = Date.now();
}
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 object2 = {};
const binding = env0_0;
object2.impression_id = binding.id;
object2.is_quest_enrollment_blocked = binding.isQuestEnrollmentBlocked;
let value = environment.__proto__.__proto__;
value = require(7120) /* metro dependency 7120: AnalyticsTypes */;
const getContentProperties = value.getContentProperties;
copyDataProperties(object2, Reflect.apply(getContentProperties, value, [binding.questContent,
binding.questContentPosition, binding.questContentRowIndex]), undefined);
return object2;
}
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 object2 = {};
object2.questContent = binding.questContent;
object2.questContentRowIndex = binding.questContentRowIndex;
object2.questContentPosition = binding.questContentPosition;
const trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
object2.trackGuildAndChannelMetadata = trackGuildAndChannelMetadata;
object2.triggeredByStatusChange = triggeredByStatusChange;
object2.isQuestEnrollmentBlocked = binding.isQuestEnrollmentBlocked;
object2.onImpression = binding.onImpressionCallback;
object2.sourceQuestContent = binding.sourceQuestContent;
copyDataProperties(object2, binding.entity, trackGuildAndChannelMetadata);
value = Object.create(QuestContentImpression.prototype, {constructor: {value: QuestContentImpression}});
const questContentImpression = new QuestContentImpression(object2);
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 object2 = {};
object2.trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
object2.sourceQuestContent = binding.sourceQuestContent;
({}).triggered_by_status_change = binding.triggeredByStatusChange;
binding.entity.adContentIds.forEach(_fun74236);
const defaultImport = importDefault(4826) /* metro dependency 4826: MonitoringAgent */;
const increment = defaultImport.increment;
object2 = {};
const MetricEvents = (require(4831) /* metro dependency 4831: MetricEvents */).MetricEvents;
const QUEST_CONTENT_IMPRESSION = MetricEvents.QUEST_CONTENT_IMPRESSION;
object2.name = QUEST_CONTENT_IMPRESSION;
const getQuestContentName = (require(7120) /* metro dependency 7120: AnalyticsTypes */).getQuestContentName;
value = Reflect.apply(getQuestContentName, value, [binding.questContent]);
value = 'quest_content:' + value;
object2.tags = [value];
Reflect.apply(increment, defaultImport, [object2]);
binding.isRunning = true;
}
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 _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 _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 object4;
var value11;
var trackAdContentEvent;
var object5;
var quest;
var value14;
var binding6;
var value17;
var questLogger2;
var binding7;
var binding8;
var value20;
var value22;
var value23;
var trackQuestEvent;
var object6;
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;
object4 = {};
copyDataProperties(object4, env0_0, minViewTimeSeconds);
object4['shouldExtendSession'] = shouldExtendSession2;
object4['questId'] = property;
object4['event'] = env4_11.QUEST_CONTENT_VIEWED;
object6 = {};
copyDataProperties(object6, env0_1, minViewTimeSeconds);
copyDataProperties(object6, binding.commonProperties(), minViewTimeSeconds);
r11 = value14 != value5 ? value5 : value14;
object6['metadata_sealed'] = r11;
binding = env4_0;
currentQuestHomeSearchSession = binding(env4_2[18]).getCurrentQuestHomeSearchSession();
uuid = value14 == currentQuestHomeSearchSession ? value2 : currentQuestHomeSearchSession.uuid;
r11 = value14 != uuid ? uuid : value14;
object6['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]);
object6['traffic_metadata_sealed'] = value14 != value ? value : value14;
object4['properties'] = object6;
Reflect.apply(trackQuestEvent, value23, [object4]);
} 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;
object4 = {};
copyDataProperties(object4, env0_0, minViewTimeSeconds);
object4['shouldExtendSession'] = shouldExtendSession2;
object4['adContentId'] = property;
entity = binding.entity;
object4['adCreativeType'] = entity.adCreativeType;
object4['event'] = env4_11.QUEST_CONTENT_VIEWED;
object5 = {};
copyDataProperties(object5, env0_1, minViewTimeSeconds);
copyDataProperties(object5, binding.commonProperties(), minViewTimeSeconds);
object4['properties'] = object5;
Reflect.apply(trackAdContentEvent, value11, [object4]);
}
return value2;
}
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 object4;
var trackAdContentEvent;
var object5;
var quest;
var questLogger2;
var value12;
var value14;
var trackQuestEvent;
var object6;
let value = environment.__proto__;
let entity = env1_0.entity;
const adCreativeType = entity.adCreativeType;
const value3 = undefined;
const AdCreativeType = (require(7121) /* metro dependency 7121: AdCreativeType */).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;
object4 = {};
copyDataProperties(object4, env0_2, r12);
object4['questId'] = property;
object4['event'] = AnalyticEvents.QUEST_CONTENT_VIEW_TIME;
object6 = {};
copyDataProperties(object6, env0_3, r12);
copyDataProperties(object6, binding.commonProperties(), r12);
object4['properties'] = object6;
Reflect.apply(trackQuestEvent, value, [object4]);
} 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;
object4 = {};
copyDataProperties(object4, env0_2, r13);
object4['adContentId'] = property;
entity = binding.entity;
object4['adCreativeType'] = entity.adCreativeType;
object4['event'] = AnalyticEvents.QUEST_CONTENT_VIEW_TIME;
object5 = {};
copyDataProperties(object5, env0_3, r13);
copyDataProperties(object5, binding.commonProperties(), r13);
object4['properties'] = object5;
Reflect.apply(trackAdContentEvent, value, [object4]);
}
return value3;
}
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 object5;
var moduleValue4;
var trackAdContentEvent;
var object6;
var quest;
var questLogger2;
var value11;
var moduleValue6;
var value13;
var moduleValue7;
var trackQuestEvent;
var object7;
var getAdTrafficMetadataSealed;
var captureAdUserAction;
var object8;
let value = environment.__proto__.__proto__.__proto__;
const value2 = undefined;
const questDataUtilsModule = require(7091) /* metro dependency 7091: QuestDataUtils */;
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 = (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType;
const QUEST = AdCreativeType.QUEST;
if (migrateQuestContentLoadedToCaptureAdUserAction) {
object5 = {};
entity = binding.entity;
object5.adCreativeType = entity.adCreativeType;
entity = binding.entity;
object5.adCreativeId = entity.adContentIds[a1];
value = require(9517) /* metro dependency 9517: captureAdUserAction */;
captureAdUserAction = value.captureAdUserAction;
object8 = {};
object8.type = (require(9518) /* metro dependency 9518: captureAdUserActionTypes */).AdUserActionType.END_CONTENT_LOAD;
object8.surfaceId = binding.questContent;
object8.sourceQuestContent = binding.sourceQuestContent;
object8.impressionId = binding.id;
object8.triggeredByStatusChange = binding.triggeredByStatusChange;
object8.trackGuildAndChannelMetadata = binding.trackGuildAndChannelMetadata;
object8.questContentPosition = binding.questContentPosition;
object8.questContentRowIndex = binding.questContentRowIndex;
copyDataProperties(object8, object5, undefined);
Reflect.apply(captureAdUserAction, value, [object8]);
} 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;
object5 = {};
copyDataProperties(object5, env0_0, undefined);
object5['questId'] = property;
object5['event'] = AnalyticEvents.QUEST_CONTENT_LOADED;
object7 = {};
copyDataProperties(object7, env0_1, undefined);
object7['metadata_sealed'] = value11 != value4 ? value4 : value11;
binding = env1_0;
copyDataProperties(object7, binding.commonProperties(), undefined);
value = questDataUtilsModule;
getAdTrafficMetadataSealed = value.getAdTrafficMetadataSealed;
sourceQuestContent = binding.sourceQuestContent;
id = value11 == quest ? value2 : quest.id;
value = Reflect.apply(getAdTrafficMetadataSealed, value, [sourceQuestContent, id]);
object7['traffic_metadata_sealed'] = value11 != value ? value : value11;
object5['properties'] = object7;
Reflect.apply(trackQuestEvent, moduleValue7, [object5]);
} 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;
object5 = {};
copyDataProperties(object5, env0_0, undefined);
object5['adContentId'] = property;
entity = binding.entity;
object5['adCreativeType'] = entity.adCreativeType;
object5['event'] = AnalyticEvents.QUEST_CONTENT_LOADED;
object6 = {};
copyDataProperties(object6, env0_1, undefined);
copyDataProperties(object6, binding.commonProperties(), undefined);
object5['properties'] = object6;
Reflect.apply(trackAdContentEvent, moduleValue4, [object5]);
}
return value2;
}