2026-07-25 08:10:48 +00:00
// Module ID: 7836
2026-07-27 11:26:19 +00:00
// Function ID: 62544
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-25 08:10:48 +00:00
// Dependencies: [5, 1194, 7662, 653, 21, 6024, 7837, 1882, 507, 5685, 7838, 686, 4358, 2, 4356]
2026-07-20 16:05:17 +00:00
// Exports: canRetryInteractionData, executeMessageComponentInteraction, getInteractionStatusViewState
2026-07-25 08:10:48 +00:00
// Module 7836 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import patchThread from "patchThread" ;
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_5 from "_isNativeReflectConstruct" ;
import ME from "ME" ;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
let closure_6 ;
let closure_7 ;
let closure_8 ;
let closure_9 ;
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 getInteractionTimeoutTimestamp ( id ) {
if ( null != id ) {
if ( "" !== id ) {
const _Number = Number ;
if ( ! Number . isNaN ( id ) ) {
2026-07-23 10:11:24 +00:00
let sum = importDefault ( 21 ) . extractTimestamp ( id ) + 900000 ;
const obj = importDefault ( 21 ) ;
2026-07-20 16:05:17 +00:00
}
return sum ;
}
}
sum = Date . now ( ) ;
}
function getInteractionInitialResponseDeadlineTimestamp ( id ) {
if ( null != id ) {
if ( "" !== id ) {
const _Number = Number ;
if ( ! Number . isNaN ( id ) ) {
2026-07-23 10:11:24 +00:00
let sum = importDefault ( 21 ) . extractTimestamp ( id ) + 3000 ;
const obj = importDefault ( 21 ) ;
2026-07-20 16:05:17 +00:00
}
return sum ;
}
}
sum = Date . now ( ) ;
}
async function _executeMessageComponentInteraction ( arg0 , arg1 ) {
2026-07-23 10:11:24 +00:00
let iter = ( function * ( channelId ) {
2026-07-20 16:05:17 +00:00
let applicationId ;
let componentId ;
let componentType ;
let customId ;
let messageFlags ;
let messageId ;
( { messageId , customId , componentId , applicationId } = channelId ) ;
channelId = channelId . channelId ;
const guildId = channelId . guildId ;
const localState = channelId . localState ;
2026-07-23 10:11:24 +00:00
let c3 ;
2026-07-20 16:05:17 +00:00
( { componentType , messageFlags } = channelId ) ;
yield undefined ;
2026-07-23 10:11:24 +00:00
let obj = outer2_1 ( outer2_2 [ 4 ] ) ;
const fromTimestampResult = obj . fromTimestamp ( Date . now ( ) ) ;
c3 = fromTimestampResult ;
if ( outer2_5 . canQueueInteraction ( messageId , fromTimestampResult ) ) {
let obj1 = outer2_1 ( outer2_2 [ 5 ] ) ;
2026-07-20 16:05:17 +00:00
yield obj1 . unarchiveThreadIfNecessary ( channelId ) ;
2026-07-23 10:11:24 +00:00
let obj2 = outer2_0 ( outer2_2 [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
obj = { messageId } ;
2026-07-23 10:11:24 +00:00
obj = { interactionType : outer2_0 ( outer2_2 [ 7 ] ) . InteractionTypes . MESSAGE_COMPONENT , applicationId , customId , componentId } ;
2026-07-20 16:05:17 +00:00
obj . data = obj ;
obj . onFailure = function onFailure ( code ) {
let tmp2 = null == arg1 ;
if ( tmp2 ) {
tmp2 = null != code ;
}
if ( tmp2 ) {
2026-07-23 10:11:24 +00:00
outer3_1 ( outer3_2 [ 9 ] ) . sendClydeError ( channelId , code ) ;
const obj = outer3_1 ( outer3_2 [ 9 ] ) ;
2026-07-20 16:05:17 +00:00
}
} ;
2026-07-23 10:11:24 +00:00
obj2 . addQueued ( tmp3 , obj ) ;
2026-07-20 16:05:17 +00:00
if ( null != localState ) {
2026-07-23 10:11:24 +00:00
const obj6 = outer2_0 ( outer2_2 [ 6 ] ) ;
const result = obj6 . queueInteractionComponentState ( messageId , tmp3 , localState , componentId ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj1 = { type : outer2_0 ( outer2_2 [ 7 ] ) . InteractionTypes . MESSAGE_COMPONENT , nonce : fromTimestampResult , guild_id : guildId , channel_id : channelId , message_flags : messageFlags , message_id : messageId , application_id : applicationId , session_id : outer2_4.getSessionId ( ) } ;
2026-07-20 16:05:17 +00:00
obj2 = { component_type : componentType , custom_id : customId } ;
2026-07-23 10:11:24 +00:00
const merged = Object . assign ( outer2_16 ( localState ) ) ;
2026-07-20 16:05:17 +00:00
obj1 . data = obj2 ;
2026-07-23 10:11:24 +00:00
const HTTP = outer2_0 ( outer2_2 [ 8 ] ) . HTTP ;
const obj3 = { url : outer2_6.INTERACTIONS , body : obj1 , timeout : 3000 , rejectWithError : outer2_0 ( outer2_2 [ 8 ] ) . rejectWithMigratedError ( ) } ;
2026-07-20 16:05:17 +00:00
yield HTTP . post ( obj3 , ( arg0 ) = > {
2026-07-23 10:11:24 +00:00
outer3_17 ( c3 , arg0 , applicationId , channelId , guildId ) ;
2026-07-20 16:05:17 +00:00
} ) ;
2026-07-23 10:11:24 +00:00
const obj10 = outer2_0 ( outer2_2 [ 8 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
} ) ( ) ;
iter . next ( ) ;
return iter ;
2026-07-20 16:05:17 +00:00
}
function mapMessageComponentLocalStateForAPI ( type ) {
if ( null == type ) {
return null ;
} else {
type = type . type ;
2026-07-25 08:10:48 +00:00
if ( require ( 1882 ) /* PermissionOverwriteType */ . ComponentType . TEXT_INPUT !== type ) {
if ( require ( 1882 ) /* PermissionOverwriteType */ . ComponentType . FILE_UPLOAD !== type ) {
if ( require ( 1882 ) /* PermissionOverwriteType */ . ComponentType . RADIO_GROUP !== type ) {
if ( require ( 1882 ) /* PermissionOverwriteType */ . ComponentType . CHECKBOX_GROUP !== type ) {
if ( require ( 1882 ) /* PermissionOverwriteType */ . ComponentType . CHECKBOX !== type ) {
if ( require ( 1882 ) /* PermissionOverwriteType */ . ComponentType . STRING_SELECT === type ) {
2026-07-20 16:05:17 +00:00
return type ;
} else {
2026-07-25 08:10:48 +00:00
if ( require ( 1882 ) /* PermissionOverwriteType */ . ComponentType . USER_SELECT !== type ) {
if ( require ( 1882 ) /* PermissionOverwriteType */ . ComponentType . ROLE_SELECT !== type ) {
if ( require ( 1882 ) /* PermissionOverwriteType */ . ComponentType . MENTIONABLE_SELECT !== type ) {
if ( require ( 1882 ) /* PermissionOverwriteType */ . ComponentType . CHANNEL_SELECT !== type ) {
2026-07-20 16:05:17 +00:00
return null ;
}
}
}
}
const selectedOptions = type . selectedOptions ;
const obj = { type : type . type , values : selectedOptions.map ( ( value ) = > value . value ) } ;
return obj ;
}
}
}
}
}
}
return null ;
}
}
function handleInteractionResponse ( nonce , ok , applicationId , channelId , arg4 ) {
if ( ! ok . ok ) {
if ( ok . hasErr ) {
2026-07-25 08:10:48 +00:00
require ( 7837 ) /* _fetchMessageInteractionData */ . setFailed ( nonce ) ;
const obj10 = require ( 7837 ) /* _fetchMessageInteractionData */ ;
2026-07-20 16:05:17 +00:00
} else {
if ( ok . status >= 400 ) {
if ( ok . status < 500 ) {
if ( ok . body ) {
if ( ok . body . code === constants . INVALID_FORM_BODY ) {
if ( ok . body . errors ) {
2026-07-25 08:10:48 +00:00
const firstSkemaError = require ( 7838 ) /* getFirstSkemaFieldError */ . getFirstSkemaError ( ok . body . errors ) ;
2026-07-20 16:05:17 +00:00
let tmp25 = null == firstSkemaError ;
if ( ! tmp25 ) {
let tmp26 = "INTERACTION_APPLICATION_COMMAND_INVALID_VERSION" !== firstSkemaError . code ;
if ( tmp26 ) {
tmp26 = "INTERACTION_APPLICATION_COMMAND_INVALID" !== firstSkemaError . code ;
}
tmp25 = tmp26 ;
}
if ( ! tmp25 ) {
let obj = { type : "APPLICATION_COMMAND_EXECUTE_BAD_VERSION" , applicationId , channelId } ;
let tmp29 = null ;
if ( null != arg4 ) {
tmp29 = arg4 ;
}
obj . guildId = tmp29 ;
2026-07-23 10:11:24 +00:00
importDefault ( 686 ) . dispatch ( obj ) ;
const obj7 = importDefault ( 686 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-25 08:10:48 +00:00
const obj6 = require ( 7838 ) /* getFirstSkemaFieldError */ ;
2026-07-20 16:05:17 +00:00
let message ;
if ( null != firstSkemaError ) {
message = firstSkemaError . message ;
}
2026-07-25 08:10:48 +00:00
require ( 7837 ) /* _fetchMessageInteractionData */ . setFailed ( nonce , undefined , message ) ;
2026-07-20 16:05:17 +00:00
}
}
if ( ok . body . code === constants . UNKNOWN_INTEGRATION ) {
obj = { type : "APPLICATION_COMMAND_EXECUTE_BAD_VERSION" , applicationId , channelId } ;
let tmp16 = null ;
if ( null != arg4 ) {
tmp16 = arg4 ;
}
obj . guildId = tmp16 ;
2026-07-23 10:11:24 +00:00
importDefault ( 686 ) . dispatch ( obj ) ;
const obj3 = importDefault ( 686 ) ;
2026-07-25 08:10:48 +00:00
require ( 7837 ) /* _fetchMessageInteractionData */ . setFailed ( nonce , undefined , ok . body . message ) ;
const obj5 = require ( 7837 ) /* _fetchMessageInteractionData */ ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-25 08:10:48 +00:00
const obj2 = require ( 7837 ) /* _fetchMessageInteractionData */ ;
2026-07-20 16:05:17 +00:00
obj2 . setFailed ( nonce , ok . body . code , ok . body . message , ok . status ) ;
}
return tmp13 ;
}
}
}
let code ;
2026-07-25 08:10:48 +00:00
obj = require ( 7837 ) /* _fetchMessageInteractionData */ ;
2026-07-20 16:05:17 +00:00
const body = ok . body ;
if ( null != body ) {
code = body . code ;
}
obj . setFailed ( nonce , code ) ;
}
}
}
2026-07-23 10:11:24 +00:00
( { Endpoints : closure_6 , AbortCodes : closure_7 , MessageStates : closure_8 , MessageFlags : closure_9 } = ME ) ;
let obj = { SENDING : 0 , [ 0 ] : "SENDING" , CREATED : 1 , [ 1 ] : "CREATED" , FAILED : 2 , [ 2 ] : "FAILED" , TIMED_OUT : 3 , [ 3 ] : "TIMED_OUT" , EPHEMERAL_SUCCESS : 4 , [ 4 ] : "EPHEMERAL_SUCCESS" } ;
let result = require ( "_isNativeReflectConstruct" ) . fileFinishedImporting ( "modules/interactions/InteractionUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export { getInteractionTimeoutTimestamp } ;
export { getInteractionInitialResponseDeadlineTimestamp } ;
export const executeMessageComponentInteraction = function executeMessageComponentInteraction ( arg0 ) {
return _executeMessageComponentInteraction ( . . . arguments ) ;
} ;
export { handleInteractionResponse } ;
export const InteractionStatusViewState = obj ;
export const getInteractionStatusViewState = function getInteractionStatusViewState ( state , state2 ) {
if ( null != state2 ) {
state = state2 . state ;
}
let tmp = state . state === constants2 . SENT ;
if ( tmp ) {
const _Date = Date ;
tmp = getInteractionTimeoutTimestamp ( state . id ) < Date . now ( ) ;
const tmp3 = getInteractionTimeoutTimestamp ( state . id ) ;
}
let tmp5 = state . state === constants2 . SEND_FAILED ;
if ( tmp5 ) {
const _Date2 = Date ;
tmp5 = getInteractionInitialResponseDeadlineTimestamp ( state . id ) < Date . now ( ) ;
const tmp7 = getInteractionInitialResponseDeadlineTimestamp ( state . id ) ;
}
let interactionType ;
if ( null != state2 ) {
interactionType = state2 . data . interactionType ;
}
2026-07-25 08:10:48 +00:00
const tmp10 = interactionType === require ( 1882 ) /* PermissionOverwriteType */ . InteractionTypes . APPLICATION_COMMAND ;
2026-07-20 16:05:17 +00:00
const isCommandTypeResult = state . isCommandType ( ) ;
if ( ! tmp10 ) {
if ( isCommandTypeResult ) {
if ( state . state === constants2 . SENDING ) {
return SENDING ;
}
}
if ( ! tmp10 ) {
if ( null != state . interaction ) {
2026-07-23 10:11:24 +00:00
SENDING = obj . TIMED_OUT ;
2026-07-20 16:05:17 +00:00
}
if ( isCommandTypeResult ) {
if ( state . state === constants2 . SEND_FAILED ) {
SENDING = obj . FAILED ;
}
}
if ( null != state . interaction ) {
if ( state . hasFlag ( constants3 . EPHEMERAL ) ) {
SENDING = obj . EPHEMERAL_SUCCESS ;
}
}
}
SENDING = obj . CREATED ;
}
SENDING = obj . SENDING ;
} ;
export const canRetryInteractionData = function canRetryInteractionData ( interactionData ) {
const options = interactionData . options ;
let length ;
if ( null != options ) {
length = options . length ;
}
let items = options ;
if ( 1 === length ) {
let tmp4 = options ;
2026-07-25 08:10:48 +00:00
if ( options [ 0 ] . type === require ( 1882 ) /* PermissionOverwriteType */ . ApplicationCommandOptionType . SUB_COMMAND_GROUP ) {
2026-07-20 16:05:17 +00:00
while ( true ) {
let options1 = tmp4 [ 0 ] . options ;
let length1 ;
if ( null != options1 ) {
length1 = options1 . length ;
}
items = options1 ;
if ( 1 !== length1 ) {
break ;
} else {
2026-07-23 10:11:24 +00:00
let tmp6 = require ;
2026-07-20 16:05:17 +00:00
let tmp7 = dependencyMap ;
tmp4 = options1 ;
2026-07-25 08:10:48 +00:00
if ( options1 [ 0 ] . type === require ( 1882 ) /* PermissionOverwriteType */ . ApplicationCommandOptionType . SUB_COMMAND_GROUP ) {
2026-07-20 16:05:17 +00:00
continue ;
} else {
2026-07-23 10:11:24 +00:00
let tmp8 = require ;
2026-07-20 16:05:17 +00:00
let tmp9 = dependencyMap ;
tmp4 = options1 ;
items = options1 ;
2026-07-25 08:10:48 +00:00
if ( options1 [ 0 ] . type !== require ( 1882 ) /* PermissionOverwriteType */ . ApplicationCommandOptionType . SUB_COMMAND ) {
2026-07-20 16:05:17 +00:00
break ;
}
}
continue ;
}
}
} else {
tmp4 = options ;
items = options ;
}
}
if ( null == items ) {
items = [ ] ;
}
const tmp10Result = _createForOfIteratorHelperLoose ( items ) ;
let iter = tmp10Result ( ) ;
if ( ! iter . done ) {
2026-07-25 08:10:48 +00:00
while ( tmp12 !== require ( 1882 ) /* PermissionOverwriteType */ . ApplicationCommandOptionType . ATTACHMENT ) {
2026-07-20 16:05:17 +00:00
let iter2 = tmp10Result ( ) ;
iter = iter2 ;
}
return false ;
}
return true ;
} ;
2026-07-23 10:11:24 +00:00
export const interactionCallbackErrorReason = require ( "interactionCallbackErrorReason" ) . interactionCallbackErrorReason ;