2026-07-25 08:10:48 +00:00
// Module ID: 7953
2026-07-27 11:26:19 +00:00
// Function ID: 63258
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-25 08:10:48 +00:00
// Dependencies: [29, 5, 5669, 4154, 7954, 653, 4567, 4124, 1212, 5664, 7956, 477, 1882, 5676, 7957, 5914, 5685, 4471, 1392, 7955, 7967, 5674, 7968, 2]
2026-07-20 16:05:17 +00:00
// Exports: appLauncherShowsRecommendations, ensureRecommendationSectionsOnlyContainActivities, executeAppLauncherCommand, formatPrimaryEntryPointCommandName, getApplicationDetails, getInstallAppProps, getInstallAppPropsFromProfileApplication, getSectionDescription, getSectionName, getShelfBadgeNameIfActive, isAppAvailableInAppLauncher, isApplicationAdSupported, isApplicationMonetizedWithIAP, isPartnerApplication, isPromotedApplication
2026-07-25 08:10:48 +00:00
// Module 7953 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _objectWithoutProperties from "_objectWithoutProperties" ;
import ME from "ME" ;
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import _callSuper from "_callSuper" ;
import closure_8 from "_isNativeReflectConstruct" ;
import { ApplicationFlags } from "ME" ;
import { BuiltInSectionId } from "TRUE_OPTION_NAME" ;
import { MessageSendLocation } from "MESSAGE_GROUP_SPACING" ;
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 isRealApplication ( application ) {
return application . id !== BuiltInSectionId . BUILT_IN ;
}
function isEmbeddedApp ( application ) {
let hasApplicationFlagResult = isRealApplication ( application ) ;
if ( hasApplicationFlagResult ) {
2026-07-25 08:10:48 +00:00
hasApplicationFlagResult = require ( 5664 ) /* getApplicationFlags */ . hasApplicationFlag ( application , ApplicationFlags . EMBEDDED ) ;
const obj = require ( 5664 ) /* getApplicationFlags */ ;
2026-07-20 16:05:17 +00:00
}
return hasApplicationFlagResult ;
}
function getShelfBadgeTypeIfActive ( application ) {
const tmp = getEmbeddedActivityConfig ( application ) ;
let tmp2 ;
if ( null != tmp ) {
2026-07-23 10:11:24 +00:00
const obj = require ( 477 ) /* set */ ;
2026-07-25 08:10:48 +00:00
tmp2 = tmp . client_platform_config [ importDefault ( 7956 ) ( undefined , obj . getOS ( obj ) ) ] ;
const tmp5 = importDefault ( 7956 ) ;
2026-07-20 16:05:17 +00:00
}
const timestamp = Date . now ( ) ;
let label_until ;
if ( null != tmp2 ) {
label_until = tmp2 . label_until ;
}
if ( null != label_until ) {
const _Date = Date ;
if ( timestamp < Date . parse ( tmp2 . label_until ) ) {
let label_from ;
if ( null != tmp2 ) {
label_from = tmp2 . label_from ;
}
if ( null != label_from ) {
const _Date2 = Date ;
if ( timestamp > Date . parse ( tmp2 . label_from ) ) {
let label_type ;
if ( null != tmp2 ) {
label_type = tmp2 . label_type ;
}
}
return label_type ;
}
}
}
2026-07-25 08:10:48 +00:00
label_type = require ( 1882 ) /* PermissionOverwriteType */ . EmbeddedActivityLabelTypes . NONE ;
2026-07-20 16:05:17 +00:00
}
function getEmbeddedActivityConfig ( embeddedActivityConfig ) {
let tmp = null ;
if ( isRealApplication ( embeddedActivityConfig ) ) {
tmp = null ;
}
return tmp ;
}
2026-07-23 10:11:24 +00:00
let closure_3 = [ "fakeAppIconURL" ] ;
let result = require ( "_isNativeReflectConstruct" ) . fileFinishedImporting ( "modules/app_launcher/utils/AppLauncherUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export const FAKE_BUILT_IN_APP = { id : BuiltInSectionId.BUILT_IN } ;
export { isRealApplication } ;
export const getSectionName = function getSectionName ( FAKE_BUILT_IN_APP ) {
if ( isRealApplication ( FAKE_BUILT_IN_APP ) ) {
let name = FAKE_BUILT_IN_APP . name ;
} else {
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
name = intl . string ( require ( 1212 ) /* getSystemLocale */ . t . UB2gG2 ) ;
2026-07-20 16:05:17 +00:00
}
return name ;
} ;
export const getSectionDescription = function getSectionDescription ( FAKE_BUILT_IN_APP ) {
if ( isRealApplication ( FAKE_BUILT_IN_APP ) ) {
let description = FAKE_BUILT_IN_APP . description ;
} else {
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
description = intl . string ( require ( 1212 ) /* getSystemLocale */ . t . X9fusn ) ;
2026-07-20 16:05:17 +00:00
}
return description ;
} ;
export { isEmbeddedApp } ;
export const isPartnerApplication = function isPartnerApplication ( application ) {
let hasApplicationFlagResult = isRealApplication ( application ) ;
if ( hasApplicationFlagResult ) {
2026-07-25 08:10:48 +00:00
hasApplicationFlagResult = require ( 5664 ) /* getApplicationFlags */ . hasApplicationFlag ( application , ApplicationFlags . PARTNER ) ;
const obj = require ( 5664 ) /* getApplicationFlags */ ;
2026-07-20 16:05:17 +00:00
}
return hasApplicationFlagResult ;
} ;
export const isPromotedApplication = function isPromotedApplication ( FAKE_BUILT_IN_APP2 ) {
let hasApplicationFlagResult = isRealApplication ( FAKE_BUILT_IN_APP2 ) ;
if ( hasApplicationFlagResult ) {
2026-07-25 08:10:48 +00:00
hasApplicationFlagResult = require ( 5664 ) /* getApplicationFlags */ . hasApplicationFlag ( FAKE_BUILT_IN_APP2 , ApplicationFlags . PROMOTED ) ;
const obj = require ( 5664 ) /* getApplicationFlags */ ;
2026-07-20 16:05:17 +00:00
}
return hasApplicationFlagResult ;
} ;
export { getShelfBadgeTypeIfActive } ;
export const getShelfBadgeNameIfActive = function getShelfBadgeNameIfActive ( application ) {
const tmp = getShelfBadgeTypeIfActive ( application ) ;
2026-07-25 08:10:48 +00:00
if ( require ( 1882 ) /* PermissionOverwriteType */ . EmbeddedActivityLabelTypes . NEW === tmp ) {
2026-07-20 16:05:17 +00:00
return "New" ;
2026-07-25 08:10:48 +00:00
} else if ( require ( 1882 ) /* PermissionOverwriteType */ . EmbeddedActivityLabelTypes . UPDATED === tmp ) {
2026-07-20 16:05:17 +00:00
return "Updated" ;
} else {
return "" ;
}
} ;
export { getEmbeddedActivityConfig } ;
export const executeAppLauncherCommand = function executeAppLauncherCommand ( arg0 ) {
2026-07-23 10:11:24 +00:00
let closure_3 ;
let _objectWithoutProperties ;
let ME ;
2026-07-20 16:05:17 +00:00
let commandOrigin ;
let context ;
2026-07-23 10:11:24 +00:00
let importDefault ;
let require ;
( { command : require , optionValues : importDefault , context } = arg0 ) ;
( { commandTargetId : closure_3 , maxSizeCallback : _objectWithoutProperties , sectionName : ME , commandOrigin } = arg0 ) ;
2026-07-20 16:05:17 +00:00
if ( commandOrigin === undefined ) {
2026-07-23 10:11:24 +00:00
commandOrigin = require ( context [ 13 ] ) . CommandOrigin . APPLICATION_LAUNCHER ;
2026-07-20 16:05:17 +00:00
}
let channel ;
2026-07-23 10:11:24 +00:00
let c8 ;
2026-07-20 16:05:17 +00:00
channel = context . channel ;
2026-07-23 10:11:24 +00:00
const tmp3 = ( ( ) = > {
let closure_0 = outer1_5 ( async ( ) = > {
let obj = { command : inputType , optionValues : outer2_1 , context : outer2_2 , commandTargetId : outer2_3 , maxSizeCallback : outer2_4 , commandOrigin : outer2_6 , sectionName : outer2_5 , source : c8.entrypoint ( ) } ;
const tmp2 = yield outer3_1 ( context [ 14 ] ) ( obj ) ;
if ( inputType . inputType === outer3_0 ( context [ 13 ] ) . ApplicationCommandInputType . BUILT_IN_TEXT ) {
2026-07-20 16:05:17 +00:00
if ( null != tmp3 ) {
2026-07-23 10:11:24 +00:00
if ( null != outer2_2 . channel ) {
const parsed = outer3_1 ( context [ 15 ] ) . parse ( outer2_7 , tmp3 . content ) ;
2026-07-20 16:05:17 +00:00
const tts = tmp3 . tts ;
let tmp4 = tmp23 ;
if ( null != tts ) {
tmp4 = tts ;
}
parsed . tts = tmp4 ;
2026-07-23 10:11:24 +00:00
const obj2 = outer3_1 ( context [ 16 ] ) ;
obj = { location : outer3_11.APP_COMMAND } ;
obj2 . sendMessage ( outer2_2 . channel . id , parsed , true , obj ) ;
const obj4 = outer3_1 ( context [ 15 ] ) ;
2026-07-20 16:05:17 +00:00
const tmp21 = parsed ;
}
}
}
} ) ;
return function ( ) {
return callback ( . . . arguments ) ;
} ;
2026-07-23 10:11:24 +00:00
} ) ( ) ;
c8 = tmp3 ;
2026-07-20 16:05:17 +00:00
return tmp3 ( ) ;
} ;
export const getApplicationDetails = function getApplicationDetails ( id , guildMember ) {
let obj = guildMember ;
if ( guildMember === undefined ) {
obj = { } ;
}
const fakeAppIconURL = obj . fakeAppIconURL ;
const tmp = callback ( obj , closure_3 ) ;
obj = { } ;
if ( isRealApplication ( id ) ) {
obj = { } ;
const merged = Object . assign ( tmp ) ;
obj [ "id" ] = id . id ;
obj [ "icon" ] = id . icon ;
2026-07-23 10:11:24 +00:00
obj . iconURL = importDefault ( 1392 ) . getApplicationIconURL ( obj ) ;
2026-07-20 16:05:17 +00:00
( { name : obj2.name , description : obj2.description } = id ) ;
let tmp5 = obj ;
2026-07-23 10:11:24 +00:00
const obj3 = importDefault ( 1392 ) ;
2026-07-20 16:05:17 +00:00
} else {
let tmp2 = null ;
if ( null != fakeAppIconURL ) {
tmp2 = fakeAppIconURL ;
}
obj . iconURL = tmp2 ;
2026-07-23 10:11:24 +00:00
const intl = require ( 1212 ) /* getSystemLocale */ . intl ;
obj . name = intl . string ( require ( 1212 ) /* getSystemLocale */ . t . UB2gG2 ) ;
const intl2 = require ( 1212 ) /* getSystemLocale */ . intl ;
obj . description = intl2 . string ( require ( 1212 ) /* getSystemLocale */ . t . X9fusn ) ;
2026-07-20 16:05:17 +00:00
tmp5 = obj ;
}
return tmp5 ;
} ;
export const isApplicationMonetizedWithIAP = function isApplicationMonetizedWithIAP ( application ) {
const tmp = isRealApplication ( application ) ;
if ( ! tmp ) {
return tmp ;
}
} ;
export const isApplicationAdSupported = function isApplicationAdSupported ( application ) {
const tmp = getEmbeddedActivityConfig ( application ) ;
return null != tmp && tmp . displays_advertisements ;
} ;
export const appLauncherShowsRecommendations = function appLauncherShowsRecommendations ( entrypoint ) {
2026-07-25 08:10:48 +00:00
return entrypoint === require ( 7955 ) /* AppLauncherEntrypoint */ . AppLauncherEntrypoint . TEXT ;
2026-07-20 16:05:17 +00:00
} ;
export const formatPrimaryEntryPointCommandName = function formatPrimaryEntryPointCommandName ( displayName ) {
let str = "" ;
if ( null != displayName ) {
const charAtResult = displayName . charAt ( 0 ) ;
const sum = displayName . charAt ( 0 ) . toLocaleUpperCase ( ) + displayName . slice ( 1 ) ;
str = sum . replaceAll ( "_" , " " ) ;
const toLocaleUpperCaseResult = displayName . charAt ( 0 ) . toLocaleUpperCase ( ) ;
}
return str ;
} ;
export const ensureRecommendationSectionsOnlyContainActivities = function ensureRecommendationSectionsOnlyContainActivities ( stateFromStores ) {
let iter2 ;
const items = [ ] ;
2026-07-23 10:11:24 +00:00
let tmp = _createForOfIteratorHelperLoose ( stateFromStores ) ;
2026-07-20 16:05:17 +00:00
let iter = tmp ( ) ;
if ( ! iter . done ) {
do {
let value = iter . value ;
let prop = value . application_directory_collection_items ;
let found = prop . filter ( ( type ) = > {
2026-07-23 10:11:24 +00:00
let tmp = type . type === outer1_0 ( outer1_2 [ 20 ] ) . ApplicationDirectoryCollectionItemType . APPLICATION ;
2026-07-20 16:05:17 +00:00
if ( tmp ) {
2026-07-23 10:11:24 +00:00
tmp = outer1_15 ( type . application ) ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
} ) ;
if ( 0 !== found . length ) {
let obj = { } ;
let tmp2 = obj ;
let tmp3 = value ;
let merged = Object . assign ( value ) ;
obj [ "application_directory_collection_items" ] = found ;
let arr = items . push ( obj ) ;
}
iter2 = tmp ( ) ;
iter = iter2 ;
} while ( ! iter2 . done ) ;
}
return items ;
} ;
export const getInstallAppPropsFromProfileApplication = function getInstallAppPropsFromProfileApplication ( application ) {
return { applicationId : application.id , customInstallUrl : application.customInstallUrl , installParams : application.installParams , integrationTypesConfig : application.integrationTypesConfig } ;
} ;
export const getInstallAppProps = function getInstallAppProps ( application ) {
const obj = { applicationId : application.id } ;
2026-07-23 10:11:24 +00:00
if ( application instanceof _callSuper ) {
2026-07-20 16:05:17 +00:00
( { customInstallUrl : obj.customInstallUrl , installParams : obj.installParams , integrationTypesConfig : obj.integrationTypesConfig } = application ) ;
let tmp = obj ;
} else {
( { custom_install_url : obj.customInstallUrl , install_params : obj.installParams , integration_types_config : obj.integrationTypesConfig } = application ) ;
tmp = obj ;
}
return tmp ;
} ;
export const isAppAvailableInAppLauncher = function isAppAvailableInAppLauncher ( id ) {
let guildState = null ;
if ( null != arg1 ) {
guildState = guildState . getGuildState ( arg1 ) ;
}
let result = null != guildState ;
if ( result ) {
2026-07-25 08:10:48 +00:00
result = require ( 5674 ) /* _createForOfIteratorHelperLoose */ . hasCommandIndexForApp ( id . id , guildState ) ;
const obj = require ( 5674 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
}
2026-07-25 08:10:48 +00:00
const obj2 = require ( 7968 ) /* canInstallApplication */ ;
return require ( 7968 ) /* canInstallApplication */ . isAppUserInstallable ( id ) || result ;
2026-07-20 16:05:17 +00:00
} ;