2026-07-25 08:10:48 +00:00
// Module ID: 7961
2026-07-27 11:26:19 +00:00
// Function ID: 63378
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-25 08:10:48 +00:00
// Dependencies: [57, 4992, 5040, 1348, 1908, 1918, 1911, 1838, 3759, 3768, 1850, 653, 1853, 5917, 4321, 21, 4975, 3772, 3776, 2]
2026-07-20 16:05:17 +00:00
// Exports: resolveApplicationCommandOption
2026-07-25 08:10:48 +00:00
// Module 7961 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray" ;
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_5 from "_isNativeReflectConstruct" ;
import closure_6 from "_isNativeReflectConstruct" ;
import closure_7 from "_isNativeReflectConstruct" ;
import { GUILD_SELECTABLE_CHANNELS_KEY as closure_8 } from "_isNativeReflectConstruct" ;
import closure_9 from "_isNativeReflectConstruct" ;
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose" ;
import closure_11 from "_createForOfIteratorHelperLoose" ;
import closure_12 from "_isNativeReflectConstruct" ;
import closure_13 from "_isNativeReflectConstruct" ;
import closure_14 from "_isNativeReflectConstruct" ;
import { Permissions } from "ME" ;
import { EmojiIntention } from "set" ;
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 resolvePlaintextInlineVoid ( arr , source , id , intention ) {
let obj = intention ;
if ( null == intention ) {
obj = { } ;
}
const allowUsers = obj . allowUsers ;
const allowRoles = obj . allowRoles ;
2026-07-23 10:11:24 +00:00
let first = arr [ 0 ] ;
2026-07-20 16:05:17 +00:00
if ( "@" === first ) {
2026-07-23 10:11:24 +00:00
return ( function resolveUserOrRole ( arr , source , id , arg3 , arg4 ) {
let tmp = outer1_3 ( arr . slice ( 1 ) . split ( "#" , 2 ) , 2 ) ;
2026-07-20 16:05:17 +00:00
const first = tmp [ 0 ] ;
2026-07-23 10:11:24 +00:00
let closure_1 = tmp3 ;
2026-07-20 16:05:17 +00:00
let guild = null ;
if ( null != source ) {
2026-07-23 10:11:24 +00:00
guild = outer1_11 . getGuild ( source ) ;
2026-07-20 16:05:17 +00:00
}
if ( arg4 ) {
if ( null == tmp3 ) {
if ( null != guild ) {
2026-07-23 10:11:24 +00:00
const tmp8 = outer1_17 ( outer1_10 . getSortedRoles ( guild . id ) ) ;
2026-07-20 16:05:17 +00:00
const iter = tmp8 ( ) ;
let iter2 = iter ;
if ( ! iter . done ) {
const value = iter2 . value ;
while ( first !== value . name ) {
let iter3 = tmp8 ( ) ;
iter2 = iter3 ;
}
let obj = { type : "roleMention" , roleId : value.id } ;
obj = { text : "" } ;
const items = [ obj ] ;
obj . children = items ;
return obj ;
}
}
}
}
if ( arg3 ) {
let channel = null ;
if ( null != id ) {
2026-07-23 10:11:24 +00:00
channel = outer1_6 . getChannel ( id ) ;
2026-07-20 16:05:17 +00:00
}
if ( null == channel ) {
return null ;
} else {
if ( channel . isPrivate ( ) ) {
let recipients = channel . recipients ;
} else {
2026-07-23 10:11:24 +00:00
const members = outer1_9 . getMembers ( source ) ;
2026-07-20 16:05:17 +00:00
recipients = members . map ( ( userId ) = > userId . userId ) ;
}
2026-07-23 10:11:24 +00:00
const mapped = recipients . map ( ( arg0 ) = > outer2_14 . getUser ( arg0 ) ) ;
2026-07-20 16:05:17 +00:00
const found = mapped . filter ( ( arg0 ) = > {
let tmp = undefined !== arg0 ;
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = outer2_20 ( first , closure_1 , arg0 ) ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
} ) ;
if ( 1 === found . length ) {
const first1 = found [ 0 ] ;
obj = { requireExact : true } ;
2026-07-23 10:11:24 +00:00
if ( outer1_20 ( first , tmp3 , first1 , obj ) ) {
2026-07-20 16:05:17 +00:00
const obj1 = { type : "userMention" , userId : first1.id } ;
const obj2 = { text : "" } ;
const items1 = [ obj2 ] ;
obj1 . children = items1 ;
return obj1 ;
}
}
}
}
return null ;
2026-07-23 10:11:24 +00:00
} ) ( arr , source , id , tmp , tmp2 ) ;
2026-07-20 16:05:17 +00:00
} else if ( ":" === first ) {
2026-07-25 08:10:48 +00:00
const EMOJI_NAME_RE = importDefault ( 3772 ) . EMOJI_NAME_RE ;
2026-07-20 16:05:17 +00:00
const match = EMOJI_NAME_RE . exec ( arr ) ;
let tmp47 = null ;
if ( null != match ) {
2026-07-23 10:11:24 +00:00
disambiguatedEmojiContext = disambiguatedEmojiContext . getDisambiguatedEmojiContext ( source ) ;
2026-07-20 16:05:17 +00:00
const customEmoji = disambiguatedEmojiContext . getCustomEmoji ( ) ;
let obj2 = customEmoji . get ( match [ 1 ] ) ;
let channel = null ;
if ( null != id ) {
channel = channel . getChannel ( id ) ;
}
tmp47 = null ;
if ( null != obj2 ) {
obj = { emoji : obj2 , channel , intention : EmojiIntention.CHAT } ;
tmp47 = null ;
if ( ! obj17 . isEmojiFiltered ( obj ) ) {
obj = { type : "customEmoji" } ;
let obj1 = { emojiId : obj2.id } ;
if ( ! ( "require_colons" in obj2 ) ) {
obj1 . name = obj2 . name ;
obj1 . animated = true === obj2 . animated ;
obj1 . jumboable = false ;
obj . emoji = obj1 ;
obj2 = { text : "" } ;
obj1 = [ obj2 ] ;
obj . children = obj1 ;
}
const _HermesInternal = HermesInternal ;
const combined = ":" + obj2 . name + ":" ;
}
2026-07-25 08:10:48 +00:00
obj17 = importDefault ( 3776 ) ;
2026-07-20 16:05:17 +00:00
}
}
return tmp47 ;
} else if ( "#" === first ) {
let tmp4 = null ;
if ( null != source ) {
if ( arr . length > 3 ) {
if ( "\"" === arr [ 1 ] ) {
if ( "\"" === arr [ arr . length - 1 ] ) {
2026-07-25 08:10:48 +00:00
obj1 = require ( 4321 ) /* computeDefaultGroupDmNameFromUserIds */ ;
2026-07-20 16:05:17 +00:00
let unescapeChannelNameResult = obj1 . unescapeChannelName ( arr . slice ( 2 , arr . length - 1 ) ) ;
}
const textChannelNameDisambiguations = store . getTextChannelNameDisambiguations ( source ) ;
2026-07-23 10:11:24 +00:00
let obj3 = importDefault ( 21 ) ;
2026-07-20 16:05:17 +00:00
const tmp13 = _createForOfIteratorHelperLoose ( obj3 . keys ( textChannelNameDisambiguations ) ) ;
2026-07-23 10:11:24 +00:00
let iter = tmp13 ( ) ;
2026-07-20 16:05:17 +00:00
let iter2 = iter ;
if ( iter . done ) {
2026-07-25 08:10:48 +00:00
const tmp17 = _createForOfIteratorHelperLoose ( require ( 4975 ) /* _createForOfIteratorHelperLoose */ . COMMAND_SUPPORTED_CHANNEL_TYPE_KEYS ) ;
2026-07-20 16:05:17 +00:00
const iter4 = tmp17 ( ) ;
let iter5 = iter4 ;
if ( ! iter4 . done ) {
while ( true ) {
let value = iter5 . value ;
let tmp19 = closure_8 ;
let tmp20 = tmp18 ;
if ( value !== closure_8 ) {
let tmp62 = _createForOfIteratorHelperLoose ;
let tmp63 = store ;
let tmp64 = _createForOfIteratorHelperLoose ( store . getChannels ( source ) [ value ] ) ;
let iter15 = tmp64 ( ) ;
let iter7 = iter15 ;
let tmp65 = iter15 ;
let tmp66 = tmp64 ;
tmp20 = tmp18 ;
if ( ! iter15 . done ) {
while ( true ) {
channel = iter7 . value . channel ;
2026-07-23 10:11:24 +00:00
let tmp21 = require ;
2026-07-20 16:05:17 +00:00
let tmp22 = dependencyMap ;
2026-07-25 08:10:48 +00:00
let obj6 = require ( 4321 ) /* computeDefaultGroupDmNameFromUserIds */ ;
2026-07-20 16:05:17 +00:00
let tmp23 = closure_14 ;
let tmp24 = closure_13 ;
if ( obj6 . computeChannelName ( channel , closure_14 , closure_13 ) !== unescapeChannelNameResult ) {
let iter6 = tmp64 ( ) ;
iter7 = iter6 ;
let tmp27 = iter6 ;
let tmp28 = tmp64 ;
tmp20 = channel ;
continue ;
} else if ( ! channel . isCategory ( ) ) {
break ;
} else {
let tmp25 = closure_12 ;
let tmp26 = Permissions ;
if ( closure_12 . can ( Permissions . VIEW_CHANNEL , channel ) ) {
break ;
}
}
}
obj3 = { } ;
let str4 = "channelMention" ;
obj3 . type = "channelMention" ;
obj3 . channelId = channel . id ;
let obj4 = { } ;
let str5 = "" ;
obj4 . text = "" ;
let items = [ obj4 ] ;
obj3 . children = items ;
tmp4 = obj3 ;
}
}
let iter8 = tmp17 ( ) ;
2026-07-23 10:11:24 +00:00
tmp18 = tmp20 ;
2026-07-20 16:05:17 +00:00
iter5 = iter8 ;
}
}
2026-07-23 10:11:24 +00:00
activeJoinedThreadsForGuild = activeJoinedThreadsForGuild . getActiveJoinedThreadsForGuild ( source ) ;
const tmp34 = _createForOfIteratorHelperLoose ( importDefault ( 21 ) . keys ( activeJoinedThreadsForGuild ) ) ;
2026-07-20 16:05:17 +00:00
const iter9 = tmp34 ( ) ;
let iter10 = iter9 ;
tmp4 = null ;
if ( ! iter9 . done ) {
while ( true ) {
let value1 = iter10 . value ;
let tmp35 = _createForOfIteratorHelperLoose ;
let tmp36 = importDefault ;
let tmp37 = dependencyMap ;
2026-07-23 10:11:24 +00:00
let obj10 = importDefault ( 21 ) ;
2026-07-20 16:05:17 +00:00
let tmp38 = _createForOfIteratorHelperLoose ( obj10 . keys ( activeJoinedThreadsForGuild [ value1 ] ) ) ;
let iter11 = tmp38 ( ) ;
let iter12 = iter11 ;
if ( iter11 . done ) {
let iter14 = tmp34 ( ) ;
iter10 = iter14 ;
tmp4 = null ;
} else {
let channel2 = activeJoinedThreadsForGuild [ value1 ] [ iter12 . value ] . channel ;
2026-07-23 10:11:24 +00:00
let tmp39 = require ;
2026-07-20 16:05:17 +00:00
let tmp40 = dependencyMap ;
2026-07-25 08:10:48 +00:00
let obj11 = require ( 4321 ) /* computeDefaultGroupDmNameFromUserIds */ ;
2026-07-20 16:05:17 +00:00
let tmp41 = closure_14 ;
let tmp42 = closure_13 ;
while ( obj11 . computeChannelName ( channel2 , closure_14 , closure_13 ) !== unescapeChannelNameResult ) {
let iter13 = tmp38 ( ) ;
iter12 = iter13 ;
let tmp43 = channel2 ;
continue ;
}
let obj5 = { } ;
let str6 = "channelMention" ;
obj5 . type = "channelMention" ;
obj5 . channelId = channel2 . id ;
obj6 = { } ;
let str7 = "" ;
obj6 . text = "" ;
let items1 = [ obj6 ] ;
obj5 . children = items1 ;
tmp4 = obj5 ;
}
}
}
2026-07-23 10:11:24 +00:00
const obj9 = importDefault ( 21 ) ;
2026-07-20 16:05:17 +00:00
} else {
obj2 = iter2 . value ;
while ( textChannelNameDisambiguations [ obj2 ] . name !== unescapeChannelNameResult ) {
let iter3 = tmp13 ( ) ;
iter2 = iter3 ;
}
const obj7 = { type : "channelMention" , channelId : obj2 } ;
const obj8 = { text : "" } ;
const items2 = [ obj8 ] ;
obj7 . children = items2 ;
tmp4 = obj7 ;
}
}
}
unescapeChannelNameResult = arr . slice ( 1 ) ;
}
return tmp4 ;
} else {
return null ;
}
}
function matchesUser ( arg0 , arg1 , username ) {
let obj = arg3 ;
if ( arg3 === undefined ) {
obj = { } ;
}
let flag = obj . requireExact ;
if ( flag === undefined ) {
flag = false ;
}
let tmp = null != username ;
if ( tmp ) {
username = username . username ;
if ( flag ) {
let startsWithResult = username === arg0 ;
} else {
startsWithResult = username . startsWith ( arg0 ) ;
}
if ( startsWithResult ) {
let str = "0" ;
if ( null != arg1 ) {
str = arg1 ;
}
startsWithResult = username . discriminator === str ;
}
tmp = startsWithResult ;
}
return tmp ;
}
2026-07-23 10:11:24 +00:00
const result = require ( "_isNativeReflectConstruct" ) . fileFinishedImporting ( "modules/channel_text_area/PlaintextResolvers.tsx" ) ;
2026-07-20 16:05:17 +00:00
export { resolvePlaintextInlineVoid } ;
export const resolveApplicationCommandOption = function resolveApplicationCommandOption ( text , source , id , intention ) {
const tmp = resolvePlaintextInlineVoid ( text , source , id , intention ) ;
let voidToOptionValueResult = null ;
if ( null != tmp ) {
2026-07-25 08:10:48 +00:00
voidToOptionValueResult = require ( 5917 ) /* toRichValue */ . voidToOptionValue ( tmp ) ;
const obj = require ( 5917 ) /* toRichValue */ ;
2026-07-20 16:05:17 +00:00
}
return voidToOptionValueResult ;
} ;