2026-09-22 07:41:18 +00:00
// Module ID: 8650
// Function ID: 8651
2026-09-10 05:38:07 +00:00
// Name: LinkAnalyticsUtils
2026-09-22 07:41:18 +00:00
// Dependencies: [1074, 8651, 1366, 4911, 1241, 2]
2026-07-20 16:05:17 +00:00
2026-09-22 07:41:18 +00:00
// Module 8650 (LinkAnalyticsUtils)
2026-09-10 05:38:07 +00:00
import Constants from "Constants" /* 1074 */ ;
2026-09-15 14:23:42 +00:00
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */ ;
import URLUtilsDefault from "URLUtils" /* 1366 */ ;
2026-09-22 07:41:18 +00:00
import LinkUtils from "LinkUtils" /* 4911 */ ;
2026-09-10 05:38:07 +00:00
import size from "module_2" /* 2 */ ;
2026-07-23 10:11:24 +00:00
2026-09-10 05:38:07 +00:00
const AnalyticEvents = Constants . AnalyticEvents ;
2026-09-17 08:17:09 +00:00
const constants = { MESSAGE : "Discord Message Link" , CHANNEL : "Discord Channel Link" , SERVER_INVITE : "Discord Server Invite" , GIFT : "Discord Gift Link" , UNKNOWN : "Unknown" , DISCOVERY : "Discord Discovery Link" , USER_PROFILE : "Discord User Profile Link" } ;
2026-07-20 16:05:17 +00:00
const items = [
2026-09-10 05:38:07 +00:00
( substr ) = > {
2026-07-20 16:05:17 +00:00
let SERVER_INVITE = null ;
2026-09-10 05:38:07 +00:00
if ( obj . isInvite ( substr ) ) {
2026-07-20 16:05:17 +00:00
SERVER_INVITE = constants . SERVER_INVITE ;
}
return SERVER_INVITE ;
} ,
2026-07-29 08:29:29 +00:00
( target ) = > {
2026-09-10 05:38:07 +00:00
const safeParseWithQueryResult = URLUtilsDefault . safeParseWithQuery ( target ) ;
2026-07-20 16:05:17 +00:00
if ( null == safeParseWithQueryResult ) {
return null ;
} else {
2026-09-10 05:38:07 +00:00
const tryParseChannelPathResult = LinkUtils . tryParseChannelPath ( safeParseWithQueryResult . path ) ;
2026-07-29 08:29:29 +00:00
if ( null == tryParseChannelPathResult ) {
return null ;
} else {
( { guildId , channelId } = tryParseChannelPathResult ) ;
if ( null != guildId ) {
if ( null != channelId ) {
const MESSAGE = constants . MESSAGE ;
}
}
if ( null != guildId ) {
if ( null != channelId ) {
let UNKNOWN = constants . CHANNEL ;
}
}
UNKNOWN = constants . UNKNOWN ;
2026-07-20 16:05:17 +00:00
}
}
} ,
( arg0 ) = > {
let DISCOVERY = null ;
if ( obj . isDiscoveryLink ( arg0 ) ) {
DISCOVERY = constants . DISCOVERY ;
}
return DISCOVERY ;
2026-09-17 08:17:09 +00:00
} ,
( target ) = > {
const safeParseWithQueryResult = URLUtilsDefault . safeParseWithQuery ( target ) ;
let USER_PROFILE = null ;
if ( null != safeParseWithQueryResult ) {
USER_PROFILE = null ;
if ( null != obj2 . tryParseUserProfilePath ( safeParseWithQueryResult . pathname ) ) {
USER_PROFILE = constants . USER_PROFILE ;
}
obj2 = LinkUtils ;
}
return USER_PROFILE ;
2026-07-20 16:05:17 +00:00
}
] ;
2026-09-10 05:38:07 +00:00
const result = size . fileFinishedImporting ( "modules/links/LinkAnalyticsUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default {
trackDiscordLinkClicked ( guildId ) {
2026-09-10 05:38:07 +00:00
AnalyticsUtilsDefault ;
2026-07-29 08:29:29 +00:00
if ( null != guildId . guildId ) {
if ( null != guildId . channelId ) {
if ( null != guildId . messageId ) {
let UNKNOWN = constants . MESSAGE ;
}
2026-09-10 05:38:07 +00:00
const obj = { is_discord_link : true , discord_link_type : UNKNOWN } ;
2026-07-29 08:29:29 +00:00
tmp2 ( tmp3 , obj ) ;
}
}
if ( null != guildId . guildId ) {
if ( null != guildId . channelId ) {
UNKNOWN = constants . CHANNEL ;
}
}
UNKNOWN = constants . UNKNOWN ;
2026-07-20 16:05:17 +00:00
} ,
2026-09-10 05:38:07 +00:00
trackLinkClicked ( ctaLink , arg1 ) {
if ( null != ctaLink ) {
let tmp3 = URLUtilsDefault . isDiscordUrl ( ctaLink , true ) || null != arg1 ;
AnalyticsUtilsDefault ;
const obj2 = { is_discord_link : tmp3 , discord_link_type : null } ;
2026-07-29 08:29:29 +00:00
if ( ! tmp3 ) {
2026-09-10 05:38:07 +00:00
obj2 . discord_link_type = null ;
tmp5 ( tmp7 , obj2 ) ;
2026-07-29 08:29:29 +00:00
} else {
if ( null != arg1 ) {
if ( null == arg1 ) {
2026-09-10 05:38:07 +00:00
let UNKNOWN = ( function getDiscordLinkTypeFromUrl ( ctaLink ) {
2026-07-29 08:29:29 +00:00
const iter = dependencyMap [ Symbol . iterator ] ( ) ;
while ( iter !== undefined ) {
2026-09-10 05:38:07 +00:00
let tmp2 = iter . next ( ) ( ctaLink ) ;
2026-07-29 08:29:29 +00:00
if ( null != tmp2 ) {
iter . return ( ) ;
return tmp2 ;
}
}
return constants . UNKNOWN ;
2026-09-10 05:38:07 +00:00
} ) ( ctaLink ) ;
2026-07-29 08:29:29 +00:00
} else {
if ( null != arg1 . guildId ) {
if ( null != arg1 . channelId ) {
if ( null != arg1 . messageId ) {
UNKNOWN = constants . MESSAGE ;
}
}
}
if ( null != arg1 . guildId ) {
if ( null != arg1 . channelId ) {
UNKNOWN = constants . CHANNEL ;
}
}
UNKNOWN = constants . UNKNOWN ;
}
}
UNKNOWN = constants . UNKNOWN ;
2026-07-20 16:05:17 +00:00
}
}
} ,
trackAnnouncementMessageLinkClicked ( arg0 ) {
( { messageId , channelId , guildId , sourceChannelId , sourceGuildId } = arg0 ) ;
2026-09-10 05:38:07 +00:00
AnalyticsUtilsDefault . track ( AnalyticEvents . ANNOUNCEMENT_MESSAGE_LINK_CLICKED , { message_id : messageId , channel_id : channelId , guild_id : guildId , source_channel_id : sourceChannelId , source_guild_id : sourceGuildId } ) ;
2026-07-20 16:05:17 +00:00
}
} ;