/* Metro module 9517; source: modules/ads/analytics/captureAdUserAction.tsx; dependencies: [5, 7093, 661, 7121, 7110, 7091, 7120, 683, 491, 7127, 9518, 2] */ import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */ import QuestStore from '../../quests/QuestStore.tsx'; /* Metro dependency 7093 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as CaptureAdUserActionTypesModule from './captureAdUserActionTypes.tsx'; /* Metro dependency 9518 */ function _fun74252(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74252, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9703:6, offset: 0x01d8705e, size: 167 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/ads/analytics/captureAdUserAction.tsx'); exports.captureAdUserAction = captureAdUserAction; function _handleClickInternalAction() { // fn#74253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9703:141, offset: 0x01d87105, size: 50 bytes, params: 1, frame: 14 return Module00005(_fun74255).apply(this, arguments); function* _fun74255(a0) { // fn#74255, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9703:216, offset: 0x01d87142, size: 891 bytes, params: 2, frame: 32 var r9; var r17; var uuid; var binding; var QUEST_CONTENT_CLICKED; var object; var value9; var value10; var value11; var getCommonClickEventProperties; var value12; var adCreativeId; var binding3; var value14; var trackQuestEvent; var object2; var adMetadataSealed; var adTrafficMetadataSealed; var currentQuestHomeSearchSession; var binding4; var value21; var trackAdContentEvent; var object3; var currentQuestHomeSearchSession2; if (true) { var adCreativeType = a0.adCreativeType; var questContentCTA = a0.questContentCTA; var surfaceId = a0.surfaceId; var sourceQuestContent = a0.sourceQuestContent; var impressionId = a0.impressionId; var clickId = a0.clickId; var questContentPosition = a0.questContentPosition; var questContentRowIndex = a0.questContentRowIndex; var trackGuildAndChannelMetadata = a0.trackGuildAndChannelMetadata; value = null; if (value != adCreativeType) { value9 = environment.__proto__.__proto__; binding = env2_0; value10 = undefined; value11 = binding(env2_2[4]); getCommonClickEventProperties = value11.getCommonClickEventProperties; object = {questContent: surfaceId, questContentPosition: questContentPosition, questContentRowIndex: questContentRowIndex, questContentCTA: questContentCTA, impressionId: impressionId, clickId: clickId}; yield Reflect.apply(getCommonClickEventProperties, value11, [object]); value12 = undefined; if (false) { return value12; } binding = env2_0; if (adCreativeType !== binding(env2_2[3]).AdCreativeType.QUEST) { binding = env2_0; binding4 = env2_2; value21 = binding(binding4[4]); trackAdContentEvent = value21.trackAdContentEvent; object = {}; object.adContentId = a0.adCreativeId; object.relatedQuestId = a0.relatedQuestId; object.adCreativeType = adCreativeType; object.event = env2_5.QUEST_CONTENT_CLICKED; object3 = {}; copyDataProperties(object3, value12, undefined); currentQuestHomeSearchSession2 = binding(binding4[9]).getCurrentQuestHomeSearchSession(); uuid = value == currentQuestHomeSearchSession2 ? value10 : currentQuestHomeSearchSession2.uuid; object3['search_session_id'] = value != uuid ? uuid : value; object.properties = object3; object.trackGuildAndChannelMetadata = trackGuildAndChannelMetadata; binding = env2_0; value = binding(env2_2[5]); object.shouldExtendSession = value.isBillableQuestContent(surfaceId); object.sourceQuestContent = sourceQuestContent; Reflect.apply(trackAdContentEvent, value21, [object]); } else { adCreativeId = a0.adCreativeId; binding = env2_0; binding3 = env2_2; value14 = binding(binding3[4]); trackQuestEvent = value14.trackQuestEvent; object = {questId: adCreativeId}; object.event = env2_5.QUEST_CONTENT_CLICKED; object2 = {}; copyDataProperties(object2, value12, undefined); adMetadataSealed = binding(binding3[5]).getAdMetadataSealed(sourceQuestContent, adCreativeId); r17 = value != adMetadataSealed ? adMetadataSealed : value; object2['metadata_sealed'] = r17; binding = env2_0; adTrafficMetadataSealed = binding(env2_2[5]).getAdTrafficMetadataSealed(sourceQuestContent, adCreativeId); r17 = value != adTrafficMetadataSealed ? adTrafficMetadataSealed : value; object2['traffic_metadata_sealed'] = r17; binding = env2_0; currentQuestHomeSearchSession = binding(env2_2[9]).getCurrentQuestHomeSearchSession(); uuid = value == currentQuestHomeSearchSession ? value10 : currentQuestHomeSearchSession.uuid; r17 = value != uuid ? uuid : value; object2['search_session_id'] = r17; object.properties = object2; object.trackGuildAndChannelMetadata = trackGuildAndChannelMetadata; binding = env2_0; value = binding(env2_2[5]); object.shouldExtendSession = value.isBillableQuestContent(surfaceId); object.sourceQuestContent = sourceQuestContent; Reflect.apply(trackQuestEvent, value14, [object]); } } else { binding = env2_0; var binding2 = env2_2; var contentProperties = binding(binding2[6]).getContentProperties(surfaceId, questContentPosition, questContentRowIndex); binding = env2_1; var value6 = binding(binding2[7]); var track = value6.track; QUEST_CONTENT_CLICKED = env2_5.QUEST_CONTENT_CLICKED; object = {cta_name: questContentCTA}; r9 = value != clickId ? clickId : env2_0(env2_2[8]).v4(); object.click_id = r9; var isTargeted = a0.isTargeted; value = value != isTargeted; r9 = value && isTargeted; object.is_targeted = r9; object.content_id = contentProperties.content_id; object.content_name = contentProperties.content_name; object.content_position = contentProperties.content_position; object.row_index = contentProperties.row_index; object.ad_content_id = a0.adContentId; Reflect.apply(track, value6, [QUEST_CONTENT_CLICKED, object]); } } } } function captureAdUserAction(a0) { // fn#74256, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9703:1906, offset: 0x01d874bd, size: 657 bytes, params: 2, frame: 23 var questEnrollmentBlockedUntil; var value2; var value3; var moduleValue; var trackAdContentEvent; var object; var adCreativeId; var sourceQuestContent; var object2; var surfaceId; var getQuestContentName; var moduleValue2; var trackQuestEvent; var object3; var moduleValue3; var getAdMetadataSealed; var value4; var moduleValue4; var getAdTrafficMetadataSealed; var value5; const type = a0.type; var value; const AdUserActionType = (CaptureAdUserActionTypesModule).AdUserActionType; const END_CONTENT_LOAD = AdUserActionType.END_CONTENT_LOAD; if (END_CONTENT_LOAD === type) { questEnrollmentBlockedUntil = QuestStore.questEnrollmentBlockedUntil; value2 = null; value3 = value2 != questEnrollmentBlockedUntil; if (a0.adCreativeType === (require(7121) /* metro dependency 7121: AdCreativeType */).AdCreativeType.QUEST) { adCreativeId = a0.adCreativeId; moduleValue2 = require(7110) /* metro dependency 7110: AnalyticsActions */; trackQuestEvent = moduleValue2.trackQuestEvent; object = {}; object.event = AnalyticEvents.QUEST_CONTENT_LOADED; object.questId = adCreativeId; object.trackGuildAndChannelMetadata = a0.trackGuildAndChannelMetadata; sourceQuestContent = a0.sourceQuestContent; object.sourceQuestContent = sourceQuestContent; object3 = {}; object3.triggered_by_status_change = a0.triggeredByStatusChange; moduleValue3 = require(7091) /* metro dependency 7091: QuestDataUtils */; getAdMetadataSealed = moduleValue3.getAdMetadataSealed; sourceQuestContent = a0.sourceQuestContent; value4 = Reflect.apply(getAdMetadataSealed, moduleValue3, [sourceQuestContent, adCreativeId]); object3.metadata_sealed = value2 != value4 ? value4 : value2; moduleValue4 = require(7091) /* metro dependency 7091: QuestDataUtils */; getAdTrafficMetadataSealed = moduleValue4.getAdTrafficMetadataSealed; sourceQuestContent = a0.sourceQuestContent; value5 = Reflect.apply(getAdTrafficMetadataSealed, moduleValue4, [sourceQuestContent, adCreativeId]); object3.traffic_metadata_sealed = value2 != value5 ? value5 : value2; object3.impression_id = a0.impressionId; object3.is_quest_enrollment_blocked = value3; surfaceId = a0.surfaceId; object3.content_id = surfaceId; value = require(7120) /* metro dependency 7120: AnalyticsTypes */; getQuestContentName = value.getQuestContentName; surfaceId = a0.surfaceId; object3.content_name = Reflect.apply(getQuestContentName, value, [surfaceId]); object3.content_position = a0.questContentPosition; object3.row_index = a0.questContentRowIndex; object.properties = object3; Reflect.apply(trackQuestEvent, moduleValue2, [object]); } else { moduleValue = require(7110) /* metro dependency 7110: AnalyticsActions */; trackAdContentEvent = moduleValue.trackAdContentEvent; object = {}; object.event = AnalyticEvents.QUEST_CONTENT_LOADED; object.adContentId = a0.adCreativeId; object.adCreativeType = a0.adCreativeType; object.trackGuildAndChannelMetadata = a0.trackGuildAndChannelMetadata; object.sourceQuestContent = a0.sourceQuestContent; object2 = {}; object2.triggered_by_status_change = a0.triggeredByStatusChange; object2.impression_id = a0.impressionId; object2.is_quest_enrollment_blocked = value3; surfaceId = a0.surfaceId; object2.content_id = surfaceId; value = require(7120) /* metro dependency 7120: AnalyticsTypes */; getQuestContentName = value.getQuestContentName; surfaceId = a0.surfaceId; object2.content_name = Reflect.apply(getQuestContentName, value, [surfaceId]); object2.content_position = a0.questContentPosition; object2.row_index = a0.questContentRowIndex; object.properties = object2; Reflect.apply(trackAdContentEvent, moduleValue, [object]); } } else if (AdUserActionType.CLICK_INTERNAL === type) { (function() { return _handleClickInternalAction.apply(this, arguments); })(a0); } } } global.__d(_fun74252, 9517, [5, 7093, 661, 7121, 7110, 7091, 7120, 683, 491, 7127, 9518, 2]) /* metro module 9517, dependencies: [5, 7093, 661, 7121, 7110, 7091, 7120, 683, 491, 7127, 9518, 2] */;