2026-07-25 08:10:48 +00:00
// Module ID: 7958
2026-07-27 11:26:19 +00:00
// Function ID: 63349
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-25 08:10:48 +00:00
// Dependencies: [4567, 44, 7959, 4119, 1882, 2]
2026-07-20 16:05:17 +00:00
// Exports: getInitialValuesFromInteractionOptions, getOptionalBoolean, getOptionalChannelId, getOptionalRoleId, getOptionalString, getOptionalUserId, normalizeNumericString
2026-07-25 08:10:48 +00:00
// Module 7958 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import { TRUE_OPTION_NAME } from "TRUE_OPTION_NAME" ;
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 filterEmpty ( arr ) {
2026-07-23 10:11:24 +00:00
let closure_0 = arr ;
2026-07-20 16:05:17 +00:00
if ( null == arr ) {
let items = [ ] ;
} else {
items = arr . filter ( ( type ) = > {
let str = type ;
if ( "text" !== type . type ) {
return tmp ;
} else {
if ( arg1 <= 0 ) {
let tmp3 = "" !== str . text . trim ( ) ;
const str2 = str . text ;
}
str = "" ;
tmp3 = "" !== str . text ;
}
} ) ;
}
return items ;
}
function getBoolean ( arg0 , arg1 ) {
const arr = filterEmpty ( arg0 [ arg1 ] ) ;
2026-07-23 10:11:24 +00:00
importDefault ( 44 ) ( 1 === arr . length , "Contains multiple values" ) ;
2026-07-20 16:05:17 +00:00
const first = arr [ 0 ] ;
let type ;
if ( null != first ) {
type = first . type ;
}
2026-07-23 10:11:24 +00:00
importDefault ( 44 ) ( "text" === type , "First value is not text" ) ;
2026-07-20 16:05:17 +00:00
return arr [ 0 ] . text === TRUE_OPTION_NAME ;
}
function getChannelId ( guildId , arg1 ) {
const arr = filterEmpty ( guildId [ arg1 ] ) ;
2026-07-23 10:11:24 +00:00
importDefault ( 44 ) ( 1 === arr . length , "Contains multiple values" ) ;
2026-07-20 16:05:17 +00:00
const first = arr [ 0 ] ;
let type ;
if ( null != first ) {
type = first . type ;
}
2026-07-23 10:11:24 +00:00
importDefault ( 44 ) ( "channelMention" === type , "First value is not a channel mention" ) ;
2026-07-20 16:05:17 +00:00
return arr [ 0 ] . channelId ;
}
function getUserId ( arg0 , arg1 ) {
const arr = filterEmpty ( arg0 [ arg1 ] ) ;
2026-07-23 10:11:24 +00:00
importDefault ( 44 ) ( 1 === arr . length , "Contains multiple values" ) ;
2026-07-20 16:05:17 +00:00
const first = arr [ 0 ] ;
let type ;
if ( null != first ) {
type = first . type ;
}
2026-07-23 10:11:24 +00:00
importDefault ( 44 ) ( "userMention" === type , "First value is not a user mention" ) ;
2026-07-20 16:05:17 +00:00
return arr [ 0 ] . userId ;
}
function getRoleId ( arg0 , arg1 ) {
const arr = filterEmpty ( arg0 [ arg1 ] ) ;
2026-07-23 10:11:24 +00:00
importDefault ( 44 ) ( 1 === arr . length , "Contains multiple values" ) ;
2026-07-20 16:05:17 +00:00
const first = arr [ 0 ] ;
let type ;
if ( null != first ) {
type = first . type ;
}
2026-07-23 10:11:24 +00:00
importDefault ( 44 ) ( "roleMention" === type , "First value is not a role mention" ) ;
2026-07-20 16:05:17 +00:00
return arr [ 0 ] . roleId ;
}
function getString ( arg0 , arg1 ) {
const tmp = _createForOfIteratorHelperLoose ( arg0 [ arg1 ] ) ;
const iter = tmp ( ) ;
let iter2 = iter ;
let str = "" ;
let str2 = "" ;
if ( ! iter . done ) {
while ( true ) {
let value = iter2 . value ;
let type = value . type ;
if ( "text" !== type ) {
if ( "textMention" !== type ) {
if ( "userMention" === type ) {
let _HermesInternal4 = HermesInternal ;
let text = ` ${ "<@" + value . userId + ">" } ` ;
} else if ( "channelMention" === type ) {
let _HermesInternal3 = HermesInternal ;
text = ` ${ "<#" + value . channelId + ">" } ` ;
} else if ( "roleMention" === type ) {
let _HermesInternal2 = HermesInternal ;
text = ` ${ "<@&" + value . roleId + ">" } ` ;
} else if ( "emoji" === type ) {
text = ` ${ value . surrogate } ` ;
} else {
text = str ;
if ( "customEmoji" === type ) {
let str3 = "" ;
if ( value . animated ) {
str3 = "a" ;
}
let str4 = value . name ;
let str5 = str4 . replace ( /:/g , "" ) ;
let _HermesInternal = HermesInternal ;
let str6 = "<" ;
let tmp3 = str3 ;
let str7 = ":" ;
let str8 = ":" ;
let str9 = ">" ;
text = str + "<" + str3 + ":" + str5 . split ( "~" ) [ 0 ] + ":" + value . emojiId + ">" ;
}
}
}
let iter3 = tmp ( ) ;
str = text ;
iter2 = iter3 ;
str2 = text ;
if ( iter3 . done ) {
break ;
}
}
text = str + value . text ;
}
}
return str2 ;
}
2026-07-23 10:11:24 +00:00
const result = require ( "numberParts" ) . fileFinishedImporting ( "modules/application_commands/ApplicationCommandOptionUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export { filterEmpty } ;
export { getBoolean } ;
export const getOptionalBoolean = function getOptionalBoolean ( arg0 , arg1 ) {
let tmp = null ;
if ( null != arg0 [ arg1 ] ) {
tmp = getBoolean ( arg0 , arg1 ) ;
}
return tmp ;
} ;
export { getChannelId } ;
export const getOptionalChannelId = function getOptionalChannelId ( guildId ) {
let tmp = null ;
if ( null != guildId [ arg1 ] ) {
tmp = getChannelId ( guildId , arg1 ) ;
}
return tmp ;
} ;
export { getUserId } ;
export const getOptionalUserId = function getOptionalUserId ( arg0 , arg1 ) {
let tmp = null ;
if ( null != arg0 [ arg1 ] ) {
tmp = getUserId ( arg0 , arg1 ) ;
}
return tmp ;
} ;
export { getRoleId } ;
export const getOptionalRoleId = function getOptionalRoleId ( arg0 , arg1 ) {
let tmp = null ;
if ( null != arg0 [ arg1 ] ) {
tmp = getRoleId ( arg0 , arg1 ) ;
}
return tmp ;
} ;
export { getString } ;
export const getOptionalString = function getOptionalString ( optionValues , name ) {
let tmp = null ;
if ( null != optionValues [ name ] ) {
tmp = getString ( optionValues , name ) ;
}
return tmp ;
} ;
export const normalizeNumericString = function normalizeNumericString ( locale , source ) {
let decimal ;
let group ;
2026-07-23 10:11:24 +00:00
if ( locale !== closure_5 ) {
closure_5 = locale ;
2026-07-25 08:10:48 +00:00
en_US = require ( 7959 ) /* numberParts */ . numberParts [ locale ] ;
2026-07-20 16:05:17 +00:00
if ( null == en_US ) {
2026-07-25 08:10:48 +00:00
en_US = require ( 7959 ) /* numberParts */ . numberParts [ "en-US" ] ;
2026-07-20 16:05:17 +00:00
}
const _RegExp = RegExp ;
( { group , decimal } = en_US ) ;
2026-07-25 08:10:48 +00:00
const regExp = new RegExp ( importDefault ( 4119 ) . escape ( group ) , "g" ) ;
2026-07-20 16:05:17 +00:00
const _RegExp2 = RegExp ;
2026-07-25 08:10:48 +00:00
const obj = importDefault ( 4119 ) ;
const regExp1 = new RegExp ( importDefault ( 4119 ) . escape ( decimal ) , "g" ) ;
const obj2 = importDefault ( 4119 ) ;
2026-07-20 16:05:17 +00:00
}
return source . replace ( regExp , "" ) . replace ( regExp1 , "." ) ;
} ;
export const getInitialValuesFromInteractionOptions = function getInitialValuesFromInteractionOptions ( command , interactionOptions ) {
let done ;
2026-07-23 10:11:24 +00:00
let closure_0 = command ;
2026-07-20 16:05:17 +00:00
const obj = { } ;
function _loop ( value ) {
2026-07-23 10:11:24 +00:00
const command = value ;
const options = command . options ;
2026-07-20 16:05:17 +00:00
if ( null != options ) {
2026-07-23 10:11:24 +00:00
const found = options . find ( ( name ) = > name . name === value . name ) ;
2026-07-20 16:05:17 +00:00
}
let num = 0 ;
2026-07-23 10:11:24 +00:00
if ( value . type !== command ( outer1_2 [ 4 ] ) . ApplicationCommandOptionType . ATTACHMENT ) {
2026-07-20 16:05:17 +00:00
if ( null == found ) {
obj [ value . name ] = value ;
} else {
num = 0 ;
}
}
return num ;
}
const tmp = _createForOfIteratorHelperLoose ( interactionOptions ) ;
let iter = tmp ( ) ;
if ( ! iter . done ) {
do {
let _loopResult = _loop ( iter . value ) ;
let iter2 = tmp ( ) ;
iter = iter2 ;
done = iter2 . done ;
} while ( ! done ) ;
}
return obj ;
} ;