2026-07-24 07:16:23 +00:00
// Module ID: 6923
// Function ID: 55206
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-24 07:16:23 +00:00
// Dependencies: [4991, 5039, 1348, 1907, 1917, 1910, 1838, 3758, 3767, 3970, 1849, 653, 4567, 1852, 4320, 3829, 4565, 6924, 3803, 3771, 4572, 3969, 4319, 22, 4577, 1212, 6925, 4974, 1327, 3775, 2]
2026-07-23 10:11:24 +00:00
2026-07-24 07:16:23 +00:00
// Module 6923 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_4 from "_isNativeReflectConstruct" ;
import closure_5 from "_isNativeReflectConstruct" ;
import closure_6 from "_isNativeReflectConstruct" ;
import { GUILD_SELECTABLE_CHANNELS_KEY as closure_7 } from "_isNativeReflectConstruct" ;
import closure_8 from "_isNativeReflectConstruct" ;
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose" ;
import closure_10 from "_createForOfIteratorHelperLoose" ;
import closure_11 from "_isNativeReflectConstruct" ;
import closure_12 from "_isNativeReflectConstruct" ;
import closure_13 from "_isNativeReflectConstruct" ;
import closure_14 from "_isNativeReflectConstruct" ;
import ME from "ME" ;
2026-07-24 07:16:23 +00:00
import regExp from "regExp" ;
2026-07-23 10:11:24 +00:00
import { EmojiIntention } from "set" ;
import merged from "textRegexp" ;
import importDefaultResult from "t" ;
import importDefaultResult1 from "t" ;
import importDefaultResult2 from "t" ;
import importDefaultResult3 from "t" ;
import importDefaultResult4 from "t" ;
import importDefaultResult5 from "t" ;
import merged2 from "textRegexp" ;
import importDefaultResult6 from "t" ;
import importDefaultResult7 from "t" ;
2026-07-21 22:01:30 +00:00
2026-07-20 16:05:17 +00:00
let MARKDOWN_SPOILER_REGEXP ;
let MARKDOWN_STATIC_ROUTE_NAME_REGEXP ;
2026-07-24 07:16:23 +00:00
let closure_16 ;
let closure_17 ;
2026-07-23 10:11:24 +00:00
const require = arg1 ;
function _createForOfIteratorHelperLoose ( iterable ) {
let closure_0 = iterable ;
iterable = "undefined" !== typeof Symbol ;
if ( iterable ) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol ;
2026-07-23 10:11:24 +00:00
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! iterable ) {
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( iterable ) {
const iter = iterable . call ( iterable ) ;
2026-07-20 16:05:17 +00:00
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
2026-07-23 10:11:24 +00:00
let tmp = iterable ;
if ( ! Array . isArray ( iterable ) ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-07-23 10:11:24 +00:00
if ( iterable ) {
if ( "string" === typeof iterable ) {
tmp2 = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
const toString = { } . toString ;
2026-07-23 10:11:24 +00:00
const substr = toString . call ( iterable ) . slice ( 8 , - 1 ) ;
2026-07-20 16:05:17 +00:00
let name = substr ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
name = iterable . constructor . name ;
2026-07-20 16:05:17 +00:00
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
2026-07-23 10:11:24 +00:00
arr = Array . from ( iterable ) ;
const callResult = toString . call ( iterable ) ;
tmp3 = "Object" === substr && iterable . constructor ;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2 ;
if ( ! tmp2 ) {
const _TypeError = TypeError ;
const typeError = new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
throw typeError ;
}
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
if ( closure_1 >= length . length ) {
2026-07-20 16:05:17 +00:00
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
2026-07-23 10:11:24 +00:00
obj . value = length [ + closure_1 ] ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ;
}
}
function _arrayLikeToArray ( arg0 , arg1 ) {
let length ;
if ( tmp ) {
length = arg0 . length ;
}
const ArrayResult = Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
ArrayResult [ num ] = arg0 [ num ] ;
}
return ArrayResult ;
}
function matchPrefix ( arg0 , str , sortBy ) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0 ;
let closure_1 = str ;
let closure_2 = arg3 ;
2026-07-20 16:05:17 +00:00
if ( str [ 0 ] === arg0 ) {
2026-07-23 10:11:24 +00:00
let _isNativeReflectConstruct = str . substring ( arg0 . length ) ;
2026-07-20 16:05:17 +00:00
const found = sortBy . sortBy ( ( text ) = > - text . text . length ) . filter ( ( text ) = > {
2026-07-23 10:11:24 +00:00
const formatted = str . toLowerCase ( ) ;
2026-07-20 16:05:17 +00:00
return 1 === formatted . indexOf ( text . text . toLowerCase ( ) ) ;
} ) ;
const sortByResult = sortBy . sortBy ( ( text ) = > - text . text . length ) ;
const mapped = found . sortBy ( ( text ) = > {
let num = 1 ;
2026-07-23 10:11:24 +00:00
if ( text . text === _isNativeReflectConstruct ) {
2026-07-20 16:05:17 +00:00
num = 0 ;
}
return num ;
} ) . map ( ( text ) = > {
2026-07-23 10:11:24 +00:00
const items = [ closure_0 + text . text , text . id , closure_2 ] ;
2026-07-20 16:05:17 +00:00
return items ;
} ) ;
return mapped . first ( ) ;
}
}
function matchAndReturnText ( codeBlock ) {
2026-07-23 10:11:24 +00:00
let closure_0 = codeBlock ;
2026-07-20 16:05:17 +00:00
return {
order : codeBlock.order ,
match : codeBlock.match ,
parse ( content ) {
2026-07-23 10:11:24 +00:00
return { type : type . type , content : content [ 0 ] } ;
2026-07-20 16:05:17 +00:00
}
} ;
}
function matchRegexAndReturnText ( MARKDOWN_SPOILER_REGEXP ) {
const obj = {
2026-07-23 10:11:24 +00:00
match : importDefault ( 3829 ) . anyScopeRegex ( MARKDOWN_SPOILER_REGEXP ) ,
2026-07-20 16:05:17 +00:00
parse ( content ) {
return { type : "text" , content : content [ 0 ] } ;
}
} ;
return obj ;
}
function rebuild ( arr ) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg1 ;
let closure_1 = arg2 ;
let closure_2 = arg3 ;
let c3 = "" ;
2026-07-20 16:05:17 +00:00
const items = [ ] ;
const item = arr . forEach ( ( type ) = > {
let done ;
2026-07-23 10:11:24 +00:00
if ( null != dependencyMap ) {
2026-07-20 16:05:17 +00:00
if ( "customEmoticon" === type . type ) {
tmp2 ( type . emoji , false ) ;
}
if ( "emoticon" === type . type ) {
2026-07-23 10:11:24 +00:00
let obj = callback ( 3771 ) ;
2026-07-20 16:05:17 +00:00
const result = obj . translateSurrogatesToInlineEmoji ( type . content ) ;
2026-07-24 07:16:23 +00:00
let match = outer1_23 . exec ( result ) ;
2026-07-20 16:05:17 +00:00
if ( null !== match ) {
while ( true ) {
if ( null != match [ 1 ] ) {
if ( "" !== match [ 1 ] ) {
let byId ;
if ( tmp . emojiContext ) {
let emojiContext = tmp . emojiContext ;
byId = emojiContext . getById ( match [ 1 ] ) ;
}
if ( byId ) {
let tmp12 = type . isShortcut || false ;
let tmp2Result = tmp2 ( byId , tmp12 ) ;
}
2026-07-24 07:16:23 +00:00
let tmp14 = outer1_23 ;
match = outer1_23 . exec ( result ) ;
2026-07-20 16:05:17 +00:00
if ( null === match ) {
break ;
}
}
}
2026-07-23 10:11:24 +00:00
let tmp9 = callback ;
let tmp10 = dependencyMap ;
let obj2 = callback ( 3771 ) ;
2026-07-20 16:05:17 +00:00
byId = obj2 . getByName ( match [ 2 ] ) ;
}
}
}
}
if ( "string" === typeof type . content ) {
type = type . type ;
if ( "emoji" === type ) {
2026-07-23 10:11:24 +00:00
obj = { position : _var.length , length : type.content.length , id : type.id } ;
2026-07-20 16:05:17 +00:00
items . push ( obj ) ;
2026-07-23 10:11:24 +00:00
_var = _var + type . content ;
2026-07-20 16:05:17 +00:00
} else {
if ( "codeBlock" !== type ) {
if ( "inlineCode" !== type ) {
if ( "mention" !== type ) {
if ( "roleMention" !== type ) {
2026-07-24 07:16:23 +00:00
if ( "gameMention" !== type ) {
if ( "channel" !== type ) {
_var = _var + callback ( type . content ) ;
}
2026-07-20 16:05:17 +00:00
}
}
}
}
}
2026-07-23 10:11:24 +00:00
if ( true === lib . isNotification ) {
2026-07-24 07:16:23 +00:00
_var = _var + lib ( 6925 ) . isolate ( type . content ) ;
const obj4 = lib ( 6925 ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
_var = _var + type . content ;
2026-07-20 16:05:17 +00:00
}
}
} else {
const _Array = Array ;
if ( type . content . constructor === Array ) {
2026-07-24 07:16:23 +00:00
const tmp35 = outer1_27 ( type . content , lib , callback , dependencyMap ) ;
const tmp37 = outer1_24 ( tmp35 . emoji ) ;
2026-07-20 16:05:17 +00:00
let iter2 = tmp37 ( ) ;
if ( ! iter2 . done ) {
do {
let value = iter2 . value ;
2026-07-23 10:11:24 +00:00
let tmp15 = items ;
2026-07-20 16:05:17 +00:00
obj = { } ;
2026-07-23 10:11:24 +00:00
let tmp16 = var ;
obj . position = var . length + value . position ;
2026-07-20 16:05:17 +00:00
obj . length = value . length ;
obj . id = value . id ;
2026-07-23 10:11:24 +00:00
let arr = items . push ( obj ) ;
2026-07-20 16:05:17 +00:00
let iter = tmp37 ( ) ;
iter2 = iter ;
done = iter . done ;
} while ( ! done ) ;
}
2026-07-23 10:11:24 +00:00
_var = _var + tmp35 . content ;
2026-07-20 16:05:17 +00:00
}
}
} ) ;
2026-07-23 10:11:24 +00:00
return { content : c3 , emoji : items } ;
2026-07-20 16:05:17 +00:00
}
function parseAndRebuild ( content , arg1 , arg2 ) {
2026-07-24 07:16:23 +00:00
return rebuild ( callback2 ( content , arg1 ) , arg1 , importDefault ( 3771 ) . translateInlineEmojiToSurrogates , arg2 ) . content ;
2026-07-20 16:05:17 +00:00
}
2026-07-24 07:16:23 +00:00
function createParserState ( getGuildId , arr ) {
2026-07-20 16:05:17 +00:00
let guildId ;
if ( null != getGuildId ) {
guildId = getGuildId . getGuildId ( ) ;
}
let guild = null ;
if ( null != guildId ) {
guild = store4 . getGuild ( guildId ) ;
}
2026-07-22 07:54:56 +00:00
const importDefault = closure_11 . can ( Permissions . MENTION_EVERYONE , getGuildId ) ;
2026-07-20 16:05:17 +00:00
if ( null != getGuildId ) {
if ( getGuildId . isPrivate ( ) ) {
const recipients = getGuildId . recipients ;
const mapped = recipients . map ( ( userId ) = > ( { userId , nick : null } ) ) ;
const currentUser = authStore . getCurrentUser ( ) ;
let mapped4 = mapped ;
if ( null != currentUser ) {
let obj = { userId : currentUser.id , nick : null } ;
2026-07-24 07:16:23 +00:00
arr = mapped . push ( obj ) ;
2026-07-20 16:05:17 +00:00
mapped4 = mapped ;
}
}
2026-07-23 10:11:24 +00:00
const tmp10 = importDefault ( 22 ) ;
const tmp10Result = importDefault ( 22 ) ( mapped4 . reduce ( ( arr , userId ) = > {
2026-07-20 16:05:17 +00:00
userId = userId . userId ;
2026-07-23 10:11:24 +00:00
const user = outer1_14 . getUser ( userId ) ;
2026-07-20 16:05:17 +00:00
if ( null != user ) {
const obj = { id : userId , text : user.tag } ;
arr . push ( obj ) ;
}
return arr ;
} , [ ] ) ) ;
if ( null != guild ) {
let sortedRoles = store3 . getSortedRoles ( guild . id ) ;
} else {
sortedRoles = [ ] ;
}
2026-07-23 10:11:24 +00:00
const tmp12 = importDefault ( 22 ) ;
const found = importDefault ( 22 ) ( sortedRoles ) . filter ( ( mentionable ) = > {
2026-07-20 16:05:17 +00:00
mentionable = closure_1 ;
if ( ! closure_1 ) {
mentionable = mentionable . mentionable ;
}
return mentionable ;
} ) ;
const mapped1 = found . map ( ( id ) = > ( { id : id.id , text : id.name } ) ) ;
2026-07-23 10:11:24 +00:00
const tmp12Result = importDefault ( 22 ) ( sortedRoles ) ;
const tmp17 = importDefault ( 22 ) ;
const mapped2 = importDefault ( 22 ) ( textChannelNameDisambiguations . getTextChannelNameDisambiguations ( guildId ) ) . map ( ( id ) = > ( { id : id.id , text : id.name } ) ) ;
2026-07-20 16:05:17 +00:00
if ( null != guildId ) {
2026-07-23 10:11:24 +00:00
const tmp21 = importDefault ( 22 ) ;
const found1 = importDefault ( 22 ) ( guildId ( 4974 ) . COMMAND_SUPPORTED_CHANNEL_TYPE_KEYS ) . filter ( ( arg0 ) = > arg0 !== outer1_7 ) ;
const tmp21Result = importDefault ( 22 ) ( guildId ( 4974 ) . COMMAND_SUPPORTED_CHANNEL_TYPE_KEYS ) ;
const flatMapResult = found1 . flatMap ( ( arg0 ) = > outer1_6 . getChannels ( guildId ) [ arg0 ] . map ( ( channel ) = > {
2026-07-20 16:05:17 +00:00
channel = channel . channel ;
if ( ! channel . isCategory ( ) ) {
2026-07-24 07:16:23 +00:00
const obj = { id : channel.channel.id , text : guildId ( outer2_2 [ 14 ] ) . computeChannelName ( channel . channel , outer2_14 , outer2_12 ) } ;
2026-07-20 16:05:17 +00:00
let tmp3 = obj ;
2026-07-24 07:16:23 +00:00
const obj2 = guildId ( outer2_2 [ 14 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
tmp3 = null ;
}
return tmp3 ;
} ) ) ;
2026-07-23 10:11:24 +00:00
let items = found1 . flatMap ( ( arg0 ) = > outer1_6 . getChannels ( guildId ) [ arg0 ] . map ( ( channel ) = > {
2026-07-20 16:05:17 +00:00
channel = channel . channel ;
if ( ! channel . isCategory ( ) ) {
2026-07-24 07:16:23 +00:00
const obj = { id : channel.channel.id , text : guildId ( outer2_2 [ 14 ] ) . computeChannelName ( channel . channel , outer2_14 , outer2_12 ) } ;
2026-07-20 16:05:17 +00:00
let tmp3 = obj ;
2026-07-24 07:16:23 +00:00
const obj2 = guildId ( outer2_2 [ 14 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
tmp3 = null ;
}
return tmp3 ;
2026-07-23 10:11:24 +00:00
} ) ) . filter ( guildId ( 1327 ) . isNotNullish ) . value ( ) ;
const iter = found1 . flatMap ( ( arg0 ) = > outer1_6 . getChannels ( guildId ) [ arg0 ] . map ( ( channel ) = > {
2026-07-20 16:05:17 +00:00
channel = channel . channel ;
if ( ! channel . isCategory ( ) ) {
2026-07-24 07:16:23 +00:00
const obj = { id : channel.channel.id , text : guildId ( outer2_2 [ 14 ] ) . computeChannelName ( channel . channel , outer2_14 , outer2_12 ) } ;
2026-07-20 16:05:17 +00:00
let tmp3 = obj ;
2026-07-24 07:16:23 +00:00
const obj2 = guildId ( outer2_2 [ 14 ] ) ;
2026-07-20 16:05:17 +00:00
} else {
tmp3 = null ;
}
return tmp3 ;
2026-07-23 10:11:24 +00:00
} ) ) . filter ( guildId ( 1327 ) . isNotNullish ) ;
2026-07-20 16:05:17 +00:00
} else {
items = [ ] ;
}
2026-07-22 07:54:56 +00:00
const allActiveJoinedThreads = closure_4 . computeAllActiveJoinedThreads ( guildId ) ;
2026-07-20 16:05:17 +00:00
const mapped3 = allActiveJoinedThreads . map ( ( id ) = > {
2026-07-24 07:16:23 +00:00
const obj = { id : id.id , text : guildId ( outer1_2 [ 14 ] ) . computeChannelName ( id , outer1_14 , outer1_12 ) } ;
2026-07-20 16:05:17 +00:00
return obj ;
} ) ;
const disambiguatedEmojiContext = store . getDisambiguatedEmojiContext ( guildId ) ;
const escapedCustomEmoticonNames = disambiguatedEmojiContext . getEscapedCustomEmoticonNames ( ) ;
const customEmoji = disambiguatedEmojiContext . getCustomEmoji ( ) ;
obj = { inline : true , mentionableRoles : mapped1 , guild , users : tmp10Result } ;
const customEmoticonRegex = disambiguatedEmojiContext . getCustomEmoticonRegex ( ) ;
2026-07-24 07:16:23 +00:00
const tmp17Result = importDefault ( 22 ) ( textChannelNameDisambiguations . getTextChannelNameDisambiguations ( guildId ) ) ;
if ( null != arr ) {
const _Array = Array ;
arr = Array . from ( arr . values ( ) ) ;
} else {
arr = [ ] ;
}
const tmp31 = importDefault ( 22 ) ;
obj . games = importDefault ( 22 ) ( arr ) . map ( ( id ) = > ( { id : id.id , text : id.name } ) ) ;
2026-07-20 16:05:17 +00:00
const combined = mapped2 . concat ( items ) ;
obj . channels = combined . concat ( mapped3 ) ;
obj . emojiContext = disambiguatedEmojiContext ;
obj . customEmoticonsRegex = customEmoticonRegex ;
obj . customEmoji = customEmoji ;
obj . textExclusions = escapedCustomEmoticonNames ;
obj . isNotification = false ;
return obj ;
}
if ( null != guildId ) {
2026-07-23 10:11:24 +00:00
members = members . getMembers ( guildId ) ;
2026-07-20 16:05:17 +00:00
mapped4 = members . map ( ( userId ) = > ( { userId : userId.userId , nick : userId.nick } ) ) ;
} else {
mapped4 = [ ] ;
}
}
function NOOP ( arg0 ) {
return arg0 ;
}
function unparseWithMeta ( content , id , isNotification ) {
const channel = store2 . getChannel ( id ) ;
let guildId = null ;
if ( null != channel ) {
guildId = channel . getGuildId ( ) ;
}
let guild = null ;
if ( null != guildId ) {
guild = store4 . getGuild ( guildId ) ;
}
if ( isNotification ) {
let omitResult = obj4 ;
} else {
2026-07-23 10:11:24 +00:00
omitResult = importDefault ( 22 ) . omit ( obj4 , [ "spoiler" , "timestamp" ] ) ;
const obj2 = importDefault ( 22 ) ;
2026-07-20 16:05:17 +00:00
}
if ( isNotification ) {
let translateSurrogatesToInlineEmoji = NOOP ;
} else {
2026-07-23 10:11:24 +00:00
translateSurrogatesToInlineEmoji = importDefault ( 3771 ) . translateSurrogatesToInlineEmoji ;
2026-07-20 16:05:17 +00:00
}
const obj = { inline : true , guild , channelId : id , isNotification } ;
2026-07-23 10:11:24 +00:00
obj4 = importDefault ( 3829 ) ;
2026-07-20 16:05:17 +00:00
return rebuild ( obj4 . parserFor ( omitResult ) ( content , obj ) , obj , translateSurrogatesToInlineEmoji ) ;
}
2026-07-23 10:11:24 +00:00
const Permissions = ME . Permissions ;
( { MARKDOWN_SPOILER_REGEXP , MARKDOWN_STATIC_ROUTE_NAME_REGEXP } = ME ) ;
2026-07-24 07:16:23 +00:00
( { extractGameMentionIds : closure_16 , GAME_MENTION_SENTINEL : closure_17 } = regExp ) ;
let tmp4 = /^<@!?(\d+)>/ ;
const tmp5 = /^<@&(\d+)>/ ;
const tmp6 = /^<#(\d+)>/ ;
let tmp7 = /^<a?:(\w+):(\d+)>/ ;
const re19 = /(@everyone|@here|@Clyde)\b/ ;
const re20 = /^[^\s]+@[^\s]+\.[^\s.]+/ ;
obj = { link : matchAndReturnText ( require ( "t" ) . defaultRules . link ) , autolink : matchAndReturnText ( require ( "t" ) . defaultRules . autolink ) , url : matchAndReturnText ( require ( "t" ) . defaultRules . url ) , inlineCode : matchAndReturnText ( require ( "parseLink" ) . RULES . inlineCode ) , codeBlock : matchAndReturnText ( require ( "parseLink" ) . RULES . codeBlock ) , rawUserMention : matchRegexAndReturnText ( tmp4 ) , rawRoleMention : matchRegexAndReturnText ( tmp5 ) , rawChannelMention : matchRegexAndReturnText ( tmp6 ) , rawEmoji : matchRegexAndReturnText ( tmp7 ) , mention : obj , channel : obj , emoticon : obj1 } ;
2026-07-20 16:05:17 +00:00
obj = {
2026-07-24 07:16:23 +00:00
match ( arg0 , games , str ) {
2026-07-20 16:05:17 +00:00
const parts = str . split ( " " ) ;
if ( regex2 . test ( parts . pop ( ) + arg0 ) ) {
return null ;
} else {
2026-07-24 07:16:23 +00:00
const tmp4 = matchPrefix ( closure_17 , arg0 , games . games , "gameMention" ) ;
if ( null != tmp4 ) {
return tmp4 ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-24 07:16:23 +00:00
const tmp12 = matchPrefix ( "@" , arg0 , games . users , "mention" ) ;
if ( null != tmp12 ) {
return tmp12 ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-24 07:16:23 +00:00
const tmp15 = matchPrefix ( "@" , arg0 , games . mentionableRoles , "roleMention" ) ;
if ( null != tmp15 ) {
return tmp15 ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-24 07:16:23 +00:00
const users = games . users ;
const tmp18 = matchPrefix ( "@" , arg0 , users . map ( ( text ) = > {
const obj = { } ;
const merged = Object . assign ( text ) ;
obj [ "text" ] = text . text . split ( "#" ) [ 0 ] ;
return obj ;
} ) , "mention" ) ;
if ( null == tmp18 ) {
return null ;
} else {
const match = regex . exec ( arg0 ) ;
if ( null != match ) {
if ( tmp18 [ 0 ] . length <= match [ 0 ] . length ) {
2026-07-20 16:05:17 +00:00
return null ;
}
}
2026-07-24 07:16:23 +00:00
if ( "" === str ) {
const SILENT_RE = require ( 6924 ) /* regExp */ . SILENT_RE ;
const match1 = SILENT_RE . exec ( arg0 ) ;
if ( null != match1 ) {
if ( tmp18 [ 0 ] . length <= match1 [ 0 ] . length ) {
return null ;
}
}
}
return tmp18 ;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
} ,
parse ( arg0 ) {
2026-07-24 07:16:23 +00:00
let tmp2 ;
let tmp4 ;
[ , tmp2 , tmp4 ] = arg0 ;
if ( "gameMention" === tmp4 ) {
let obj = { type : tmp3 } ;
const _HermesInternal2 = HermesInternal ;
obj . content = "<@$" + tmp2 + ">" ;
return obj ;
} else {
let str = "@" ;
if ( "roleMention" === tmp4 ) {
str = ` @& ` ;
}
obj = { type : tmp4 } ;
const _HermesInternal = HermesInternal ;
obj . content = "<" + str + tmp2 + ">" ;
return obj ;
2026-07-20 16:05:17 +00:00
}
}
} ;
obj = {
match ( arg0 , channels ) {
2026-07-23 10:11:24 +00:00
const tmp = ( function matchChannelPrefix ( arg0 , str , channels ) {
2026-07-20 16:05:17 +00:00
if ( str [ 0 ] === "#" ) {
if ( "\"" !== str [ 1 ] ) {
2026-07-24 07:16:23 +00:00
return outer1_26 ( "#" , str , channels , "channel" ) ;
2026-07-20 16:05:17 +00:00
} else {
let num3 = 2 ;
let num2 = 2 ;
if ( 2 < str . length ) {
while ( true ) {
if ( "\\" !== str [ num3 ] ) {
let sum = num3 ;
num2 = num3 ;
if ( "\"" === str [ num3 ] ) {
break ;
}
} else {
sum = num3 + 1 ;
}
num3 = sum + 1 ;
num2 = num3 ;
if ( num3 >= str . length ) {
break ;
}
}
}
2026-07-23 10:11:24 +00:00
let closure_0 = str . substring ( 0 , num2 + 1 ) ;
2026-07-24 07:16:23 +00:00
let closure_1 = outer1_0 ( outer1_2 [ 14 ] ) . unescapeChannelName ( str . substring ( 2 , num2 ) ) ;
const obj = outer1_0 ( outer1_2 [ 14 ] ) ;
2026-07-20 16:05:17 +00:00
const found = channels . sortBy ( ( text ) = > - text . text . length ) . filter ( ( text ) = > closure_1 === text . text ) ;
const mapped = found . map ( ( id ) = > {
const items = [ closure_0 , id . id , "channel" ] ;
return items ;
} ) ;
return mapped . first ( ) ;
}
}
2026-07-23 10:11:24 +00:00
} ) ( "#" , arg0 , channels . channels ) ;
2026-07-20 16:05:17 +00:00
let tmp2 = null ;
if ( null != tmp ) {
tmp2 = tmp ;
}
return tmp2 ;
} ,
parse ( arg0 ) {
return { type : "text" , content : "<#" + arg0 [ 1 ] + ">" } ;
} ,
emoji : {
2026-07-23 10:11:24 +00:00
order : require ( "parseLink" ) . RULES . emoji . order ,
2026-07-20 16:05:17 +00:00
match ( arg0 ) {
2026-07-23 10:11:24 +00:00
const EMOJI_NAME_RE = importDefault ( 3771 ) . EMOJI_NAME_RE ;
2026-07-20 16:05:17 +00:00
return EMOJI_NAME_RE . exec ( arg0 ) ;
} ,
parse ( arg0 , arg1 , customEmoji ) {
let tmp ;
let tmp2 ;
[ tmp , tmp2 ] = arg0 ;
customEmoji = customEmoji . customEmoji ;
const value = customEmoji . get ( tmp2 ) ;
let tmp4 = null ;
if ( null != value ) {
tmp4 = value ;
}
if ( null != tmp4 ) {
let obj = { type : "customEmoticon" } ;
let str3 = "" ;
if ( true === tmp4 . animated ) {
str3 = "a" ;
}
let name = tmp4 . originalName ;
if ( null == name ) {
name = tmp4 . name ;
}
const _HermesInternal = HermesInternal ;
obj . content = "<" + str3 + ":" + name + ":" + tmp4 . id + ">" ;
obj . emoji = tmp4 ;
} else {
obj = { type : "text" , content : tmp } ;
}
return obj ;
}
} ,
customEmoticons : {
match ( arg0 , customEmoticonsRegex ) {
customEmoticonsRegex = customEmoticonsRegex . customEmoticonsRegex ;
let match ;
if ( null != customEmoticonsRegex ) {
match = customEmoticonsRegex . exec ( arg0 ) ;
}
let tmp3 = null ;
if ( null != match ) {
tmp3 = match ;
}
return tmp3 ;
} ,
parse ( arg0 , arg1 , emojiContext ) {
let tmp ;
let tmp2 ;
[ tmp , tmp2 ] = arg0 ;
emojiContext = emojiContext . emojiContext ;
const emoticonByName = emojiContext . getEmoticonByName ( tmp2 ) ;
if ( null != emoticonByName ) {
let obj = { type : "customEmoticon" } ;
let str3 = "" ;
if ( true === emoticonByName . animated ) {
str3 = "a" ;
}
const _HermesInternal = HermesInternal ;
obj . content = "<" + str3 + ":" + emoticonByName . name + ":" + emoticonByName . id + ">" ;
obj . emoji = emoticonByName ;
} else {
obj = { type : "text" , content : tmp } ;
}
return obj ;
}
}
} ;
2026-07-23 10:11:24 +00:00
let obj3 = { } ;
2026-07-20 16:05:17 +00:00
obj3 [ "match" ] = function match ( arg0 , textExclusions ) {
if ( "string" === typeof textExclusions . textExclusions ) {
if ( "" !== textExclusions . textExclusions ) {
2026-07-23 10:11:24 +00:00
const result = require ( 4572 ) /* textRegexp */ . textMarkupPatternWithExclusions ( textExclusions . textExclusions ) ;
2026-07-20 16:05:17 +00:00
let match = result . exec ( arg0 ) ;
2026-07-23 10:11:24 +00:00
const obj = require ( 4572 ) /* textRegexp */ ;
2026-07-20 16:05:17 +00:00
}
return match ;
}
match = null ;
2026-07-23 10:11:24 +00:00
if ( null != importDefault ( 4572 ) . match ) {
match = importDefault ( 4572 ) . match ( arg0 , textExclusions , "" ) ;
const str2 = importDefault ( 4572 ) ;
2026-07-20 16:05:17 +00:00
}
} ;
obj . text = obj3 ;
2026-07-23 10:11:24 +00:00
let obj4 = { inlineCode : matchAndReturnText ( require ( "parseLink" ) . RULES . inlineCode ) , codeBlock : matchAndReturnText ( require ( "parseLink" ) . RULES . codeBlock ) } ;
2026-07-20 16:05:17 +00:00
const obj5 = { } ;
2026-07-23 10:11:24 +00:00
obj1 = {
2026-07-20 16:05:17 +00:00
match ( arg0 , arg1 , arg2 ) {
2026-07-23 10:11:24 +00:00
const ConvertEmoticons = require ( 3803 ) /* explicitContentFromProto */ . ConvertEmoticons ;
2026-07-20 16:05:17 +00:00
if ( ConvertEmoticons . getSetting ( ) ) {
if ( 0 !== arg2 . length ) {
if ( ! obj . test ( arg2 ) ) {
return null ;
}
2026-07-23 10:11:24 +00:00
obj = /\s$/ ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const EMOJI_SHORTCUT_RE = importDefault ( 3771 ) . EMOJI_SHORTCUT_RE ;
2026-07-20 16:05:17 +00:00
const match = EMOJI_SHORTCUT_RE . exec ( arg0 ) ;
let tmp7 = null ;
if ( null != match ) {
if ( match [ 0 ] . length !== arg0 . length ) {
if ( " " !== arg0 [ match [ 0 ] . length ] ) {
tmp7 = null ;
}
}
tmp7 = match ;
}
return tmp7 ;
} else {
return null ;
}
} ,
parse ( arg0 ) {
2026-07-23 10:11:24 +00:00
const obj = { type : "emoticon" , content : importDefault ( 3771 ) . convertShortcutToName ( arg0 [ 1 ] ) , isShortcut : true } ;
2026-07-20 16:05:17 +00:00
return obj ;
}
} ;
2026-07-23 10:11:24 +00:00
let obj2 = {
order : require ( "parseLink" ) . RULES . emoji . order ,
2026-07-20 16:05:17 +00:00
match ( arg0 ) {
2026-07-23 10:11:24 +00:00
const EMOJI_NAME_RE = importDefault ( 3771 ) . EMOJI_NAME_RE ;
2026-07-20 16:05:17 +00:00
return EMOJI_NAME_RE . exec ( arg0 ) ;
} ,
parse ( arg0 , arg1 , customEmoji ) {
let tmp ;
let tmp2 ;
[ tmp , tmp2 ] = arg0 ;
customEmoji = customEmoji . customEmoji ;
const value = customEmoji . get ( tmp2 ) ;
let tmp4 = null ;
if ( null != value ) {
tmp4 = value ;
}
if ( null != tmp4 ) {
let obj = { type : "customEmoticon" } ;
let str3 = "" ;
if ( true === tmp4 . animated ) {
str3 = "a" ;
}
let name = tmp4 . originalName ;
if ( null == name ) {
name = tmp4 . name ;
}
const _HermesInternal = HermesInternal ;
obj . content = "<" + str3 + ":" + name + ":" + tmp4 . id + ">" ;
obj . emoji = tmp4 ;
} else {
obj = { type : "text" , content : tmp } ;
}
return obj ;
}
} ;
2026-07-24 07:16:23 +00:00
obj5 . match = require ( "t" ) . anyScopeRegex ( tmp4 ) ;
2026-07-20 16:05:17 +00:00
obj5 . parse = function parse ( arg0 , arg1 , channelId ) {
let guild ;
let isNotification ;
( { isNotification , guild } = channelId ) ;
let closure_0 ;
const user = authStore . getUser ( arg0 [ 1 ] ) ;
if ( null == user ) {
let obj = { content : arg0 [ 0 ] } ;
return obj ;
} else {
obj = { } ;
let str = "always" ;
if ( isNotification ) {
str = "always" ;
if ( enabled . enabled ) {
str = "never" ;
}
}
obj . identifiable = str ;
2026-07-23 10:11:24 +00:00
const str2 = importDefault ( 3969 ) . getUserTag ( user , obj ) ;
2026-07-20 16:05:17 +00:00
if ( isNotification ) {
let id ;
if ( null != guild ) {
id = guild . id ;
}
2026-07-23 10:11:24 +00:00
let nickname = importDefault ( 4319 ) . getNickname ( id , channelId . channelId , user ) ;
2026-07-20 16:05:17 +00:00
if ( null == nickname ) {
2026-07-23 10:11:24 +00:00
nickname = importDefault ( 3969 ) . getGlobalName ( user ) ;
const obj6 = importDefault ( 3969 ) ;
2026-07-20 16:05:17 +00:00
}
const obj1 = { } ;
if ( null != nickname ) {
const _HermesInternal6 = HermesInternal ;
let combined = "@" + nickname ;
} else {
const _HermesInternal5 = HermesInternal ;
combined = "@" + str2 ;
}
obj1 . content = combined ;
return obj1 ;
} else if ( user . bot ) {
const obj2 = { } ;
const _HermesInternal4 = HermesInternal ;
obj2 . content = "@" + str2 ;
return obj2 ;
} else {
let id1 ;
if ( null != guild ) {
id1 = guild . id ;
}
let str4 = "" ;
if ( null != id1 ) {
closure_0 = str2 . toLowerCase ( ) ;
2026-07-23 10:11:24 +00:00
obj = importDefault ( 22 ) ;
2026-07-20 16:05:17 +00:00
let str5 = "" ;
if ( obj . some ( store3 . getUnsafeMutableRoles ( guild . id ) , ( name ) = > closure_0 . startsWith ( name . name . toLowerCase ( ) ) ) ) {
const _HermesInternal = HermesInternal ;
const combined1 = "" + user . discriminator ;
const _HermesInternal2 = HermesInternal ;
str5 = "#" + combined1 . padStart ( 4 , "0" ) ;
}
str4 = str5 ;
}
const obj3 = { } ;
const _HermesInternal3 = HermesInternal ;
obj3 . content = "@" + str2 + str4 ;
return obj3 ;
}
2026-07-23 10:11:24 +00:00
const obj9 = importDefault ( 3969 ) ;
2026-07-20 16:05:17 +00:00
}
} ;
obj4 . mention = obj5 ;
2026-07-23 10:11:24 +00:00
let obj6 = { } ;
2026-07-24 07:16:23 +00:00
obj6 . match = require ( "t" ) . anyScopeRegex ( tmp5 ) ;
2026-07-20 16:05:17 +00:00
obj6 . parse = function parse ( content , arg1 , guild ) {
guild = guild . guild ;
if ( null != guild ) {
const role = store3 . getRole ( guild . id , content [ 1 ] ) ;
if ( null != role ) {
let obj = { } ;
const _HermesInternal = HermesInternal ;
obj . content = "@" + role . name ;
return obj ;
}
}
obj = { content : content [ 0 ] } ;
return obj ;
} ;
obj4 . roleMention = obj6 ;
const obj7 = { } ;
2026-07-24 07:16:23 +00:00
obj7 . match = require ( "t" ) . anyScopeRegex ( tmp6 ) ;
2026-07-20 16:05:17 +00:00
obj7 . parse = function parse ( arg0 ) {
const channel = store2 . getChannel ( arg0 [ 1 ] ) ;
const obj = { } ;
if ( null == channel ) {
let first = arg0 [ 0 ] ;
} else {
2026-07-23 10:11:24 +00:00
const obj2 = require ( 4320 ) /* computeDefaultGroupDmNameFromUserIds */ ;
2026-07-22 07:54:56 +00:00
first = obj2 . computeChannelName ( channel , closure_14 , closure_12 , true , true ) ;
2026-07-20 16:05:17 +00:00
}
obj . content = first ;
return obj ;
} ;
obj4 . channel = obj7 ;
const obj8 = { } ;
2026-07-24 07:16:23 +00:00
obj8 . match = require ( "t" ) . anyScopeRegex ( tmp7 ) ;
2026-07-20 16:05:17 +00:00
obj8 . parse = function parse ( arg0 , arg1 , guild ) {
let name ;
let tmp ;
[ , name , tmp ] = arg0 ;
guild = guild . guild ;
let id = null ;
if ( guild ) {
id = guild . id ;
}
const disambiguatedEmojiContext = store . getDisambiguatedEmojiContext ( id ) ;
const byId = disambiguatedEmojiContext . getById ( tmp ) ;
const obj = { } ;
if ( null != byId ) {
name = byId . name ;
}
obj . content = ":" + name + ":" ;
obj . id = tmp ;
return obj ;
} ;
obj4 . emoji = obj8 ;
2026-07-23 10:11:24 +00:00
let obj9 = { } ;
obj9 . match = require ( "t" ) . anyScopeRegex ( require ( "getSoundmojiFromMessage" ) . soundmojiRawFormatRegex ) ;
2026-07-20 16:05:17 +00:00
obj9 . parse = function parse ( arg0 ) {
let tmp ;
let tmp2 ;
[ , tmp , tmp2 ] = arg0 ;
return { content : "<sound:" + tmp + ":" + tmp2 + ">" } ;
} ;
obj4 . soundboard = obj9 ;
const obj10 = { } ;
2026-07-23 10:11:24 +00:00
obj10 . match = require ( "t" ) . anyScopeRegex ( MARKDOWN_SPOILER_REGEXP ) ;
2026-07-20 16:05:17 +00:00
obj10 . parse = function parse() {
const obj = { } ;
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
obj . content = "<" + intl . string ( require ( 1212 ) /* getSystemLocale */ . t [ "F+x38C" ] ) . toLowerCase ( ) + ">" ;
2026-07-20 16:05:17 +00:00
return obj ;
} ;
obj4 . spoiler = obj10 ;
const obj11 = { } ;
2026-07-23 10:11:24 +00:00
obj11 . match = require ( "t" ) . anyScopeRegex ( MARKDOWN_STATIC_ROUTE_NAME_REGEXP ) ;
2026-07-20 16:05:17 +00:00
obj11 . parse = function parse ( arg0 ) {
return { content : "<id:" + arg0 [ 1 ] + ">" } ;
} ;
obj4 . staticRouteLink = obj11 ;
const obj12 = { } ;
2026-07-23 10:11:24 +00:00
const merged1 = Object . assign ( require ( "parseLink" ) . RULES . timestamp ) ;
2026-07-20 16:05:17 +00:00
obj12 [ "parse" ] = function parse ( arg0 ) {
const items = [ . . . arguments ] ;
2026-07-23 10:11:24 +00:00
const timestamp = importDefault ( 4565 ) . RULES . timestamp ;
2026-07-20 16:05:17 +00:00
const items1 = [ . . . items ] ;
const applyResult = timestamp . parse . apply ( items1 ) ;
if ( "text" === applyResult . type ) {
let obj = { content : applyResult.content } ;
} else {
obj = { content : applyResult.formatted } ;
}
return obj ;
} ;
obj4 . timestamp = obj12 ;
obj4 . text = { } ;
2026-07-23 10:11:24 +00:00
let items = [ obj , obj4 ] ;
let item = items . forEach ( ( arg0 ) = > {
let closure_0 = arg0 ;
2026-07-20 16:05:17 +00:00
const keys = Object . keys ( arg0 ) ;
const item = keys . forEach ( ( arg0 , order ) = > {
2026-07-23 10:11:24 +00:00
table [ arg0 ] . order = order ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
const obj13 = { } ;
2026-07-24 07:16:23 +00:00
let closure_22 = require ( "t" ) . parserFor ( obj ) ;
const re23 = /(?:<a?:\w+:(\d+)>)|:(?:([^\s:]+?)(?:::skin-tone-\d)?:)/g ;
2026-07-22 07:54:56 +00:00
const obj14 = {
2026-07-24 07:16:23 +00:00
parse ( getGuildId , content , arg2 , size ) {
let iter ;
2026-07-20 16:05:17 +00:00
let tmp = arg2 ;
2026-07-23 10:11:24 +00:00
let closure_0 = getGuildId ;
let obj ;
2026-07-20 16:05:17 +00:00
if ( null == tmp ) {
2026-07-24 07:16:23 +00:00
tmp = createParserState ( getGuildId , size ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj = { content , tts : false , invalidEmojis : [ ] , validNonShortcutEmojis : [ ] } ;
2026-07-20 16:05:17 +00:00
obj . content = parseAndRebuild ( obj . content , tmp , ( emoji ) = > {
2026-07-24 07:16:23 +00:00
obj = obj ( outer1_2 [ 29 ] ) ;
obj = { emoji , channel : closure_0 , intention : outer1_18.CHAT } ;
2026-07-20 16:05:17 +00:00
if ( obj . isEmojiPremiumLocked ( obj ) ) {
const invalidEmojis = obj . invalidEmojis ;
invalidEmojis . push ( emoji ) ;
} else if ( ! arg1 ) {
const prop = obj . validNonShortcutEmojis ;
prop . push ( emoji ) ;
}
} ) ;
2026-07-24 07:16:23 +00:00
if ( null != size ) {
if ( size . size > 0 ) {
const _Set = Set ;
const set = new Set ( callback ( obj . content ) ) ;
const items = [ ] ;
const tmp10 = _createForOfIteratorHelperLoose ( size . values ( ) ) ;
let iter2 = tmp10 ( ) ;
if ( ! iter2 . done ) {
do {
let value = iter2 . value ;
if ( set . has ( value . id ) ) {
obj = { } ;
( { id : obj2.id , name : obj2.name , icon : obj2.icon } = value ) ;
let arr = items . push ( obj ) ;
}
iter = tmp10 ( ) ;
iter2 = iter ;
} while ( ! iter . done ) ;
}
if ( items . length > 0 ) {
obj . mentionGames = items ;
}
}
}
2026-07-20 16:05:17 +00:00
return obj ;
} ,
parsePreprocessor ( getGuildId , arg1 ) {
2026-07-24 07:16:23 +00:00
return callback2 ( arg1 , createParserState ( getGuildId ) ) ;
2026-07-20 16:05:17 +00:00
} ,
unparse ( content , id , isNotification ) {
return unparseWithMeta ( content , id , isNotification ) . content ;
} ,
unparseWithMeta
} ;
2026-07-23 10:11:24 +00:00
let result = require ( "_isNativeReflectConstruct" ) . fileFinishedImporting ( "modules/messages/MessageParser.tsx" ) ;
2026-07-22 07:54:56 +00:00
export default obj14 ;
2026-07-20 16:05:17 +00:00
export { parseAndRebuild } ;
export { createParserState } ;