/* Metro module 9547; source: modules/media_viewer/MediaViewerAnalyticsManager.tsx; dependencies: [1379, 661, 629, 683, 2] */ import AnalyticsUtils from '../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */ import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as Module00629Module from '../../by-id/module-00629.js'; /* Metro dependency 629 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ function _fun74530(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:6, offset: 0x01d9143b, size: 588 bytes, params: 8, frame: 22 let Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const env0_3 = value.AnalyticEvents; const env0_4 = value.AnalyticsSections; object = {VIEWER_SWIPE: 'number_viewer_swipes', THUMBNAIL_SWIPE: 'number_thumbnail_swipes', SELECTED_ITEM_CHANGE: 'number_selected_item_changes', ZOOM_IN_BUTTON_PRESSED: 'number_zoom_in_button_pressed', ZOOM_IN_IMAGE_PRESSED: 'number_zoom_in_image_pressed', ZOOM_OUT_BUTTON_PRESSED: 'number_zoom_out_button_pressed', ZOOM_OUT_IMAGE_PRESSED: 'number_zoom_out_image_pressed', FORWARD_PRESSED: 'number_forward_button_pressed', SAVE_MEDIA_PRESSED: 'number_save_media_button_pressed', OPEN_LINK_PRESSED: 'number_open_link_button_pressed', MORE_BUTTON_PRESSED: 'number_more_button_pressed', COPY_IMAGE_PRESSED: 'number_copy_image_more_menu_pressed', COPY_LINK_PRESSED: 'number_copy_link_more_menu_pressed', CONTEXT_MENU_OPENED: 'number_context_menu_opened'}; const object2 = {guildId: undefined, channelId: undefined, channelType: undefined, numMediaItems: 0, hasMediaOptions: undefined, source: undefined}; Object = global.Object; const fromEntries = Object.fromEntries; const Object2 = global.Object; value = Object2.values(object); object2.incrementableActions = Reflect.apply(fromEntries, Object, [value.map(function(a0) { return [a0, 0]; })]); const env0_6 = (Module00629Module).create(_fun74532); const object3 = {markSessionStarted: markSessionStarted, markSessionCompleted: markSessionCompleted, markActionPerformed: markActionPerformed, trackMediaViewerImageSaved: trackMediaViewerImageSaved, trackMediaViewerImageCopied: trackMediaViewerImageCopied, trackMediaViewerLinkCopied: trackMediaViewerLinkCopied, trackMediaViewerLinkOpened: trackMediaViewerLinkOpened, trackMediaViewerDownloadButtonTapped: trackMediaViewerDownloadButtonTapped, trackMediaViewerShareButtonTapped: trackMediaViewerShareButtonTapped, trackMessageEmbedsActionCompleted: function({platform, action, error}) { var defaultImport = importDefault(dependencyMap[3]); var MESSAGE_EMBEDS_ACTION_COMPLETED = AnalyticEvents.MESSAGE_EMBEDS_ACTION_COMPLETED; defaultImport.track(MESSAGE_EMBEDS_ACTION_COMPLETED, {platform: platform, error: error, action: action}); }}; (FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/MediaViewerAnalyticsManager.tsx'); exports.IncrementableMediaViewerActions = object; exports.MediaViewerAnalytics = object3; function _fun74532() { // fn#74532, offset: 0x00d9d76b, size: 9 bytes, params: 1, frame: 1 return env0_5; } function markSessionStarted(a0) { // fn#74533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1157, offset: 0x01d91687, size: 241 bytes, params: 2, frame: 20 const channel = ChannelStore.getChannel(a0.channelId); const value3 = undefined; const defaultImport = AnalyticsUtils; const track = defaultImport.track; const OPEN_MODAL = AnalyticEvents.OPEN_MODAL; const MEDIA_VIEWER = AnalyticsSections.MEDIA_VIEWER; const value4 = channel == null; Reflect.apply(track, defaultImport, [OPEN_MODAL, {type: MEDIA_VIEWER, source: a0.source, channel_id: a0.channelId, channel_type: channel == null ? value3 : channel.type, guild_id: value4 ? value3 : channel.guild_id}]); const binding = env0_6; const setState = binding.setState; object = {}; copyDataProperties(object, env0_5, value4); copyDataProperties(object, a0, value4); object['channelId'] = a0.channelId; object['channelType'] = channel == null ? value3 : channel.type; object['guildId'] = channel == null ? value3 : channel.guild_id; Reflect.apply(setState, binding, [object]); return value3; } function markSessionCompleted() { // fn#74534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1488, offset: 0x01d91778, size: 165 bytes, params: 1, frame: 18 const binding = env0_6; const state = binding.getState(); const defaultImport = AnalyticsUtils; const track = defaultImport.track; const MEDIA_VIEWER_SESSION_COMPLETED = AnalyticEvents.MEDIA_VIEWER_SESSION_COMPLETED; let object = {}; object.source = state.source; object.guild_id = state.guildId; object.channel_id = state.channelId; object.channel_type = state.channelType; object.number_media_items = state.numMediaItems; const hasMediaOptions = state.hasMediaOptions; object.has_media_options = hasMediaOptions; copyDataProperties(object, state.incrementableActions, hasMediaOptions); Reflect.apply(track, defaultImport, [MEDIA_VIEWER_SESSION_COMPLETED, object]); const setState = binding.setState; object = {}; copyDataProperties(object, env0_5, hasMediaOptions); Reflect.apply(setState, binding, [object]); } function markActionPerformed(a0) { // fn#74535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1784, offset: 0x01d9181d, size: 38 bytes, params: 2, frame: 11 const env0_0 = a0; env0_6.setState(_fun74536); function _fun74536(a0) { // fn#74536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1800, offset: 0x01d91843, size: 56 bytes, params: 2, frame: 14 const object2 = {}; copyDataProperties(object2, a0.incrementableActions, undefined); const binding = env0_0; object2[binding] = a0.incrementableActions[binding] + 1; return {incrementableActions: object2}; } } function trackMediaViewerImageSaved({url, success}) { // fn#74537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:1918, offset: 0x01d9187b, size: 96 bytes, params: 2, frame: 17 const state = env0_6.getState(); const defaultImport = AnalyticsUtils; const track = defaultImport.track; const MEDIA_VIEWER_IMAGE_SAVED = AnalyticEvents.MEDIA_VIEWER_IMAGE_SAVED; Reflect.apply(track, defaultImport, [MEDIA_VIEWER_IMAGE_SAVED, {url: url, success: success, channel_id: state.channelId}]); } function trackMediaViewerImageCopied({url, success}) { // fn#74538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2071, offset: 0x01d918db, size: 96 bytes, params: 2, frame: 17 const state = env0_6.getState(); const defaultImport = AnalyticsUtils; const track = defaultImport.track; const MEDIA_VIEWER_IMAGE_COPIED = AnalyticEvents.MEDIA_VIEWER_IMAGE_COPIED; Reflect.apply(track, defaultImport, [MEDIA_VIEWER_IMAGE_COPIED, {url: url, success: success, channel_id: state.channelId}]); } function trackMediaViewerLinkCopied({href, success}) { // fn#74539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2224, offset: 0x01d9193b, size: 98 bytes, params: 2, frame: 17 const state = env0_6.getState(); const defaultImport = AnalyticsUtils; const track = defaultImport.track; const MEDIA_VIEWER_LINK_COPIED = AnalyticEvents.MEDIA_VIEWER_LINK_COPIED; Reflect.apply(track, defaultImport, [MEDIA_VIEWER_LINK_COPIED, {href: href, success: success, channel_id: state.channelId}]); } function trackMediaViewerLinkOpened({href}) { // fn#74540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2378, offset: 0x01d9199d, size: 87 bytes, params: 2, frame: 16 const state = env0_6.getState(); const defaultImport = AnalyticsUtils; const track = defaultImport.track; const MEDIA_VIEWER_LINK_OPENED = AnalyticEvents.MEDIA_VIEWER_LINK_OPENED; Reflect.apply(track, defaultImport, [MEDIA_VIEWER_LINK_OPENED, {href: href, channel_id: state.channelId}]); } function trackMediaViewerDownloadButtonTapped() { // fn#74541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2522, offset: 0x01d919f4, size: 93 bytes, params: 1, frame: 16 const state = env0_6.getState(); const defaultImport = AnalyticsUtils; const track = defaultImport.track; const MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED = AnalyticEvents.MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED; Reflect.apply(track, defaultImport, [MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED, {guild_id: state.guildId, channel_id: state.channelId, channel_type: state.channelType}]); } function trackMediaViewerShareButtonTapped() { // fn#74542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9733:2705, offset: 0x01d91a51, size: 93 bytes, params: 1, frame: 16 const state = env0_6.getState(); const defaultImport = AnalyticsUtils; const track = defaultImport.track; const MEDIA_VIEWER_SHARE_BUTTON_TAPPED = AnalyticEvents.MEDIA_VIEWER_SHARE_BUTTON_TAPPED; Reflect.apply(track, defaultImport, [MEDIA_VIEWER_SHARE_BUTTON_TAPPED, {guild_id: state.guildId, channel_id: state.channelId, channel_type: state.channelType}]); } } global.__d(_fun74530, 9547, [1379, 661, 629, 683, 2]) /* metro module 9547, dependencies: [1379, 661, 629, 683, 2] */;