/* Metro module 8050; source: modules/application_commands/executeCommand.tsx; dependencies: [5, 6540, 1949, 1867, 4644, 1878, 7168, 661, 4503, 5068, 694, 7153, 5065, 1909, 8051, 8053, 44, 8054, 4863, 7166, 7879, 3797, 1360, 7142, 8055, 4862, 8056, 8060, 8061, 7141, 7067, 4655, 1244, 4651, 7226, 2] */ import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */ import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */ import LocaleStore from '../user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */ import UploadAttachmentStore from '../../stores/UploadAttachmentStore.tsx'; /* Metro dependency 4644 */ import MessageQueue from '../../lib/MessageQueue.tsx'; /* Metro dependency 4862 */ import EmojiStore from '../emojis/EmojiStore.tsx'; /* Metro dependency 6540 */ import ApplicationCommandStore from './ApplicationCommandStore.tsx'; /* Metro dependency 7168 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ import * as GlobalUtilsModule from '../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */ import * as MessageConstantsModule from '../messages/MessageConstants.tsx'; /* Metro dependency 4503 */ import * as MessageQueueModule from '../../lib/MessageQueue.tsx'; /* Metro dependency 4862 */ import * as ApplicationCommandTypesModule from './ApplicationCommandTypes.tsx'; /* Metro dependency 5068 */ function _fun63817(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:6, offset: 0x01b90c4d, size: 416 bytes, params: 8, frame: 19 let env0_0 = require; const _arrayLikeToArray_63820 = function(a0, a1) { var r0; var r1; var r2; var value3; var length; var value5; var value = undefined; var value2 = value == null; reducibleJoin2: while (true) { if (value2) { r0 = value2; break reducibleJoin2; } value3 = value > a0.length; r0 = value3; break reducibleJoin2; } reducibleJoin4: while (true) { if (r0) { length = a0.length; r1 = length; break reducibleJoin4; } r1 = value; break reducibleJoin4; } value = (0, global.Array)(r1); var value4 = 0; if (value4 < r1) { r2 = value4; reducibleLoop5: while (true) { value[r2] = a0[r2]; value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1; if (value5 < r1) { r2 = value5; continue reducibleLoop5; } break reducibleLoop5; } } return value; }; const queueCommand = function(a0, a1) { var env0_0 = a0; var env0_1 = a1; var defaultImport = importDefault(dependencyMap[25]); var object = {}; object.type = require(dependencyMap[25]).MessageDataType.COMMAND; object.message = a0; defaultImport.enqueue(object, _fun63826); }; const displayInteractionLifecycleInChat = function() { return _displayInteractionLifecycleInChat.apply(this, arguments); }; const getMaxAndTotalFileSize = function() { return _getMaxAndTotalFileSize.apply(this, arguments); }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const env0_11 = value.AbortCodes; const env0_12 = value.AnalyticEvents; const env0_13 = value.MessageTypes; const env0_14 = value.NON_USER_BOT_DISCRIMINATOR; value = _fun63849(); (FileImportTrackerModule).fileFinishedImporting('modules/application_commands/executeCommand.tsx'); exports.default = function() { return _executeCommand.apply(this, arguments); }; exports.retryCommandMessage = value; function _createForOfIteratorHelperLoose_63818(a0, a1) { // fn#63818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:333, offset: 0x01b90ded, size: 370 bytes, params: 3, frame: 20 var r6; var r9; var r5; var value3; var regexp; const env0_0 = a0; const Symbol = global.Symbol; let value = typeof Symbol !== 'undefined'; let r1 = value && a0[global.Symbol.iterator]; r1 = !r1 ? a0['@@iterator'] : r1; if (r1) { value = r1.call(a0); return value.next.bind(value); } const Array = global.Array; if (Array.isArray(a0)) { if (r1) { } return _fun63819; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_63820(a0, value); r5 = value; } else { value3 = ({}).toString.call(a0).slice(8, -1); r6 = value3 === 'Object' && a0.constructor; r9 = r6 ? a0.constructor.name : value3; if (r9 === 'Map') { r6 = global.Array.from(a0); } else if (r9 === 'Set') { r6 = global.Array.from(a0); } else if (r9 === 'Arguments') { value = _arrayLikeToArray_63820(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_63820(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun63819; } const TypeError = global.TypeError; throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); function _fun63819() { // fn#63819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:904, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5 return env0_1 >= env0_0.length ? {done: true} : {done: false, value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]}; } } function _executeCommand() { // fn#63821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:1243, offset: 0x01b90f5f, size: 48 bytes, params: 1, frame: 14 return Module00005(_fun63823).apply(this, arguments); async function _fun63823({command, optionValues, context, commandTargetId, maxSizeCallback, commandOrigin, sectionName, interactionLifecycleOptionsFactory, source}) { // fn#63823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:1296, offset: 0x01b90fa1, size: 6278 bytes, params: 2, frame: 129 var environment; var r13; var r3; var r10; var r42; var name; var r106; var r92; var r4; var r94; var r93; var r95; var r91; var r103; var r112; var r110; var id; var type; var r105; var r109; var r8; var r20; var r18; var value3; var binding; var CommandOrigin; var CHAT; var value4; var value7; var getSource; var getCommandOrigin; var autocomplete; var value10; var dispatch; var object; var value11; var unarchiveThreadIfNecessary; var items3; var commandAttachmentDraftType; var options; var value16; var value17; var done; var value18; var value19; var ApplicationCommandOptionType; var SUB_COMMAND; var SUB_COMMAND_GROUP; var name2; var value20; var STRING; var value21; var getOptionalString; var value22; var trim; var value23; var choices; var value24; var findAutocompleteChoiceStringValue; var autocompleteChoiceStringValue; var query; var value25; var findChoiceStringValue; var choiceStringValue; var value26; var value27; var value28; var HermesInternal; var concat; var push; var ATTACHMENT; var getUpload; var value29; var length; var binding2; var value30; var filterEmpty; var value31; var value32; var value33; var value34; var property; var CHANNEL; var ROLE; var USER; var MENTIONABLE; var BOOLEAN; var INTEGER; var NUMBER; var Error; var text; var value36; var value37; var findAutocompleteChoiceNumberValue; var autocompleteChoiceNumberValue; var value38; var findChoiceNumberValue; var choiceNumberValue; var Number; var value39; var normalizeNumericString; var locale; var value40; var value41; var value42; var autocompleteChoiceNumberValue2; var value43; var choiceNumberValue2; var value44; var value45; var value46; var toChoiceBooleanValue; var value47; var value48; var isSnowflake; var value49; var resolveApplicationCommandOption; var guild; var id2; var applicationCommandOption; var value50; var roleId; var userId; var value51; var value52; var value53; var id3; var applicationCommandOption2; var value54; var value55; var value56; var value57; var value58; var id4; var applicationCommandOption3; var value59; var value60; var value61; var value62; var value63; var id5; var applicationCommandOption4; var value64; var value65; var channelId; var value66; var value67; var value68; var value69; var value70; var value71; var value72; var subCommandPath; var value73; var items2; var value74; var execute; var inputType; var ApplicationCommandInputType; var BUILT_IN; var BUILT_IN_TEXT; var BUILT_IN_INTEGRATION; var version; var rootCommand; var guildId; var untranslatedName; var value75; var clearAll; var object3; var applicationId; var value76; var value77; var value78; var performAutocomplete; var value79; var trackWithMetadata; var APPLICATION_COMMAND_USED; if (false) { return undefined; } value = undefined; reducibleJoin3: while (true) { if (commandOrigin !== value) { r13 = commandOrigin; break reducibleJoin3; } value3 = environment.__proto__.__proto__; binding = env2_0; CommandOrigin = binding(env2_3[9]).CommandOrigin; CHAT = CommandOrigin.CHAT; r13 = CHAT; break reducibleJoin3; } reducibleJoin5: while (true) { if (interactionLifecycleOptionsFactory !== value) { r3 = interactionLifecycleOptionsFactory; break reducibleJoin5; } value4 = environment.__proto__.__proto__; binding = env2_22; r3 = binding; break reducibleJoin5; } await value; if (false) { return undefined; } let channel = context.channel; if (channel != null) { value7 = environment.__proto__.__proto__; binding = env2_10; getSource = binding.getSource; channel = context.channel; id = channel.id; r10 = Reflect.apply(getSource, binding, [id]) ?? source; binding = env2_10; getCommandOrigin = binding.getCommandOrigin; channel = context.channel; id = channel.id; r13 = Reflect.apply(getCommandOrigin, binding, [id]) ?? r13; autocomplete = context.autocomplete; reducibleJoin12: while (true) { if (autocomplete != null) { break reducibleJoin12; } binding = env2_1; value10 = binding(env2_3[10]); dispatch = value10.dispatch; Reflect.apply(dispatch, value10, [{type: 'APPLICATION_COMMAND_USED', context: context, command: command, commandOrigin: r13}]); break reducibleJoin12; } binding = env2_1; value11 = binding(env2_3[11]); unarchiveThreadIfNecessary = value11.unarchiveThreadIfNecessary; channel = context.channel; id = channel.id; await Reflect.apply(unarchiveThreadIfNecessary, value11, [id]); if (false) { return undefined; } object = []; items3 = []; binding = env2_0; commandAttachmentDraftType = binding(env2_3[12]).getCommandAttachmentDraftType(r13); options = command.options; reducibleJoin180: while (true) { reducibleJoin160: while (true) { if (options == null) { subCommandPath = command.subCommandPath; if (subCommandPath == null) { r4 = object; break reducibleJoin160; } subCommandPath = command.subCommandPath; length = subCommandPath.length; value73 = length - 1; if (!(value73 >= 0)) { r4 = object; break reducibleJoin160; } r8 = object; r20 = value73; reducibleLoop159: while (true) { subCommandPath = command.subCommandPath; property = subCommandPath[r20]; name = property.name; type = property.type; items2 = [{type: type, name: name, options: r8}]; value74 = r20 - 1; if (value74 >= 0) { r8 = items2; r20 = value74; continue reducibleLoop159; } r4 = items2; break reducibleJoin160; } } else { binding = env2_18; options = command.options; value16 = binding(options); value17 = value16(); done = value17.done; value18 = ''; if (!done) { r42 = value17; reducibleLoop16: while (true) { value19 = r42.value; type = value19.type; binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; SUB_COMMAND = ApplicationCommandOptionType.SUB_COMMAND; if (type !== SUB_COMMAND) { type = value19.type; binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; SUB_COMMAND_GROUP = ApplicationCommandOptionType.SUB_COMMAND_GROUP; reducibleJoin156: while (true) { if (type === SUB_COMMAND_GROUP) { break reducibleJoin156; } name = value19.name; if (name in optionValues) { autocomplete = context.autocomplete; reducibleJoin21: while (true) { if (autocomplete == null) { name = value; break reducibleJoin21; } name = autocomplete.name; break reducibleJoin21; } name2 = value19.name; value20 = name === name2; r106 = value20 || value; type = value19.type; binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; STRING = ApplicationCommandOptionType.STRING; if (type !== STRING) { type = value19.type; binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; ATTACHMENT = ApplicationCommandOptionType.ATTACHMENT; if (type !== ATTACHMENT) { binding = env2_2; binding2 = env2_3; value30 = binding(binding2[14]); filterEmpty = value30.filterEmpty; name = value19.name; value31 = Reflect.apply(filterEmpty, value30, [optionValues[name]]); binding = env2_1; value32 = binding(binding2[16]); autocomplete = context.autocomplete; value33 = autocomplete != null; reducibleJoin47: while (true) { if (value33) { r91 = value33; break reducibleJoin47; } length = value31.length; value34 = length === 1; r91 = value34; break reducibleJoin47; } name = value19.name; HermesInternal = global.HermesInternal; concat = HermesInternal.concat; value32(r91, 'Option "' + name + '" expects a single option type'); if (value31[0] == null) { reducibleJoin49: while (true) { if (r106) { break reducibleJoin49; } break reducibleJoin156; } } property = value31[0]; reducibleJoin51: while (true) { if (property != null) { r103 = property; break reducibleJoin51; } r103 = {'type': 'text', 'text': ''}; break reducibleJoin51; } type = value19.type; binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; CHANNEL = ApplicationCommandOptionType.CHANNEL; if (CHANNEL === type) { type = r103.type; if (type === 'channelMention') { channelId = r103.channelId; r105 = channelId; } else { type = r103.type; reducibleJoin148: while (true) { if (type !== 'text') { r105 = value; break reducibleJoin148; } binding = env2_0; value62 = binding(env2_3[12]); isSnowflake = value62.isSnowflake; text = r103.text; if (Reflect.apply(isSnowflake, value62, [text])) { text = r103.text; trim = text.trim; value66 = Reflect.apply(trim, text, []); r105 = value66; break reducibleJoin148; } binding = env2_0; value63 = binding(env2_3[17]); resolveApplicationCommandOption = value63.resolveApplicationCommandOption; text = r103.text; guild = context.guild; reducibleJoin143: while (true) { if (guild == null) { id = value; break reducibleJoin143; } id = guild.id; break reducibleJoin143; } channel = context.channel; id5 = channel.id; applicationCommandOption4 = Reflect.apply(resolveApplicationCommandOption, value63, [text, id, id5]); binding = env2_1; value64 = binding(env2_3[16]); reducibleJoin145: while (true) { if (applicationCommandOption4 == null) { type = value; break reducibleJoin145; } type = applicationCommandOption4.type; break reducibleJoin145; } text = r103.text; HermesInternal = global.HermesInternal; concat = HermesInternal.concat; value65 = 'Failed to resolve ' + text; value64(type === 'channelMention', value65); channelId = applicationCommandOption4.channelId; r105 = channelId; break reducibleJoin148; } } } else { binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; ROLE = ApplicationCommandOptionType.ROLE; if (ROLE === type) { type = r103.type; if (type === 'roleMention') { roleId = r103.roleId; r105 = roleId; } else { type = r103.type; if (type === 'text') { binding = env2_0; value57 = binding(env2_3[12]); isSnowflake = value57.isSnowflake; text = r103.text; if (Reflect.apply(isSnowflake, value57, [text])) { text = r103.text; trim = text.trim; value61 = Reflect.apply(trim, text, []); r105 = value61; } else { binding = env2_0; value58 = binding(env2_3[17]); resolveApplicationCommandOption = value58.resolveApplicationCommandOption; text = r103.text; guild = context.guild; reducibleJoin133: while (true) { if (guild == null) { id = value; break reducibleJoin133; } id = guild.id; break reducibleJoin133; } id4 = context.channel.id; applicationCommandOption3 = Reflect.apply(resolveApplicationCommandOption, value58, [text, id, id4, {allowUsers: false}]); binding = env2_1; value59 = binding(env2_3[16]); reducibleJoin135: while (true) { if (applicationCommandOption3 == null) { type = value; break reducibleJoin135; } type = applicationCommandOption3.type; break reducibleJoin135; } text = r103.text; concat = global.HermesInternal.concat; value60 = 'Failed to resolve ' + text; value59(type === 'roleMention', value60); roleId = applicationCommandOption3.roleId; r105 = roleId; } } else { reducibleJoin148: while (true) { if (r103.type !== 'textMention') { r105 = value; break reducibleJoin148; } text = r103.text; if (text !== '@everyone') { r105 = value; break reducibleJoin148; } guild = context.guild; reducibleJoin129: while (true) { if (guild == null) { id = value; break reducibleJoin129; } id = guild.id; break reducibleJoin129; } r105 = id; break reducibleJoin148; } } } } else { binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; USER = ApplicationCommandOptionType.USER; if (USER === type) { type = r103.type; if (type === 'userMention') { userId = r103.userId; r105 = userId; } else { type = r103.type; reducibleJoin148: while (true) { if (type !== 'text') { r105 = value; break reducibleJoin148; } binding = env2_0; value52 = binding(env2_3[12]); isSnowflake = value52.isSnowflake; text = r103.text; if (Reflect.apply(isSnowflake, value52, [text])) { text = r103.text; trim = text.trim; value56 = Reflect.apply(trim, text, []); r105 = value56; break reducibleJoin148; } binding = env2_0; value53 = binding(env2_3[17]); resolveApplicationCommandOption = value53.resolveApplicationCommandOption; text = r103.text; guild = context.guild; reducibleJoin118: while (true) { if (guild == null) { id = value; break reducibleJoin118; } id = guild.id; break reducibleJoin118; } channel = context.channel; id3 = channel.id; applicationCommandOption2 = Reflect.apply(resolveApplicationCommandOption, value53, [text, id, id3, {allowRoles: false}]); binding = env2_1; value54 = binding(env2_3[16]); reducibleJoin120: while (true) { if (applicationCommandOption2 == null) { type = value; break reducibleJoin120; } type = applicationCommandOption2.type; break reducibleJoin120; } text = r103.text; HermesInternal = global.HermesInternal; concat = HermesInternal.concat; value55 = 'Failed to resolve ' + text; value54(type === 'userMention', value55); userId = applicationCommandOption2.userId; r105 = userId; break reducibleJoin148; } } } else { binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; MENTIONABLE = ApplicationCommandOptionType.MENTIONABLE; if (MENTIONABLE === type) { type = r103.type; if (type === 'userMention') { userId = r103.userId; r105 = userId; } else { type = r103.type; if (type === 'roleMention') { roleId = r103.roleId; r105 = roleId; } else { type = r103.type; reducibleJoin148: while (true) { reducibleJoin87: while (true) { if (type !== 'textMention') { break reducibleJoin87; } text = r103.text; if (text === '@everyone') { guild = context.guild; reducibleJoin110: while (true) { if (guild == null) { id = value; break reducibleJoin110; } id = guild.id; break reducibleJoin110; } r105 = id; break reducibleJoin148; } break reducibleJoin87; } type = r103.type; if (type !== 'text') { r105 = value; break reducibleJoin148; } binding = env2_0; value48 = binding(env2_3[12]); isSnowflake = value48.isSnowflake; text = r103.text; if (Reflect.apply(isSnowflake, value48, [text])) { text = r103.text; trim = text.trim; value51 = Reflect.apply(trim, text, []); r105 = value51; break reducibleJoin148; } binding = env2_0; value49 = binding(env2_3[17]); resolveApplicationCommandOption = value49.resolveApplicationCommandOption; text = r103.text; guild = context.guild; reducibleJoin91: while (true) { if (guild == null) { id = value; break reducibleJoin91; } id = guild.id; break reducibleJoin91; } channel = context.channel; id2 = channel.id; applicationCommandOption = Reflect.apply(resolveApplicationCommandOption, value49, [text, id, id2]); reducibleJoin93: while (true) { if (applicationCommandOption == null) { type = value; break reducibleJoin93; } type = applicationCommandOption.type; break reducibleJoin93; } if (type === 'userMention') { userId = applicationCommandOption.userId; r105 = userId; break reducibleJoin148; } reducibleJoin96: while (true) { if (applicationCommandOption == null) { type = value; break reducibleJoin96; } type = applicationCommandOption.type; break reducibleJoin96; } if (type === 'roleMention') { roleId = applicationCommandOption.roleId; r105 = roleId; break reducibleJoin148; } reducibleJoin99: while (true) { if (applicationCommandOption == null) { type = value; break reducibleJoin99; } type = applicationCommandOption.type; break reducibleJoin99; } if (type === 'textMention') { if (applicationCommandOption.text === '@everyone') { guild = context.guild; reducibleJoin104: while (true) { if (guild == null) { id = value; break reducibleJoin104; } id = guild.id; break reducibleJoin104; } r105 = id; break reducibleJoin148; } } binding = env2_1; value50 = binding(env2_3[16]); text = r103.text; HermesInternal = global.HermesInternal; concat = HermesInternal.concat; value50(false, 'Failed to resolve ' + text); r105 = value; break reducibleJoin148; } } } } else { binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; BOOLEAN = ApplicationCommandOptionType.BOOLEAN; if (BOOLEAN === type) { reducibleJoin148: while (true) { if (r103.type !== 'text') { r105 = value; break reducibleJoin148; } binding = env2_0; value46 = binding(env2_3[15]); toChoiceBooleanValue = value46.toChoiceBooleanValue; text = r103.text; trim = text.trim; value47 = Reflect.apply(toChoiceBooleanValue, value46, [Reflect.apply(trim, text, [])]); r105 = value47; break reducibleJoin148; } } else { binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; INTEGER = ApplicationCommandOptionType.INTEGER; if (INTEGER === type) { reducibleJoin148: while (true) { if (r103.type !== 'text') { r105 = value; break reducibleJoin148; } text = r103.text; trim = text.trim; value41 = Reflect.apply(trim, text, []); choices = value19.choices; if (choices != null) { value43 = env2_0(env2_3[15]); findChoiceNumberValue = value43.findChoiceNumberValue; choices = value19.choices; choiceNumberValue2 = Reflect.apply(findChoiceNumberValue, value43, [choices, value41]); r110 = choiceNumberValue2; } else { autocomplete = value19.autocomplete; reducibleJoin79: while (true) { if (autocomplete) { autocomplete = context.autocomplete; reducibleJoin77: while (true) { reducibleJoin75: while (true) { if (autocomplete == null) { break reducibleJoin75; } if (r106) { autocomplete = context.autocomplete; query = autocomplete.query; r112 = query; break reducibleJoin77; } break reducibleJoin75; } binding = env2_0; value42 = binding(env2_3[15]); findAutocompleteChoiceNumberValue = value42.findAutocompleteChoiceNumberValue; channel = context.channel; id = channel.id; name = value19.name; autocompleteChoiceNumberValue2 = Reflect.apply(findAutocompleteChoiceNumberValue, value42, [id, name, value41]); r112 = autocompleteChoiceNumberValue2; break reducibleJoin77; } r110 = r112; break reducibleJoin79; } r110 = value; break reducibleJoin79; } } if (r110 != null) { r105 = r110; break reducibleJoin148; } Number = global.Number; binding = env2_2; value44 = binding(env2_3[14]); normalizeNumericString = value44.normalizeNumericString; locale = env2_6.locale; value45 = Number(Reflect.apply(normalizeNumericString, value44, [locale, value41])); r105 = value45; break reducibleJoin148; } } else { binding = env2_0; ApplicationCommandOptionType = binding(env2_3[13]).ApplicationCommandOptionType; NUMBER = ApplicationCommandOptionType.NUMBER; if (NUMBER !== type) { Error = global.Error; type = value19.type; concat = global.HermesInternal.concat; throw new Error('Unsupported option type: ' + type); } type = r103.type; reducibleJoin148: while (true) { if (type !== 'text') { r105 = value; break reducibleJoin148; } text = r103.text; trim = text.trim; value36 = Reflect.apply(trim, text, []); choices = value19.choices; if (choices != null) { value38 = env2_0(env2_3[15]); findChoiceNumberValue = value38.findChoiceNumberValue; choices = value19.choices; choiceNumberValue = Reflect.apply(findChoiceNumberValue, value38, [choices, value36]); r110 = choiceNumberValue; } else { autocomplete = value19.autocomplete; reducibleJoin68: while (true) { if (autocomplete) { autocomplete = context.autocomplete; reducibleJoin66: while (true) { reducibleJoin64: while (true) { if (autocomplete == null) { break reducibleJoin64; } if (r106) { autocomplete = context.autocomplete; query = autocomplete.query; r112 = query; break reducibleJoin66; } break reducibleJoin64; } binding = env2_0; value37 = binding(env2_3[15]); findAutocompleteChoiceNumberValue = value37.findAutocompleteChoiceNumberValue; channel = context.channel; id = channel.id; name = value19.name; autocompleteChoiceNumberValue = Reflect.apply(findAutocompleteChoiceNumberValue, value37, [id, name, value36]); r112 = autocompleteChoiceNumberValue; break reducibleJoin66; } r110 = r112; break reducibleJoin68; } r110 = value; break reducibleJoin68; } } if (r110 != null) { r105 = r110; break reducibleJoin148; } Number = global.Number; binding = env2_2; value39 = binding(env2_3[14]); normalizeNumericString = value39.normalizeNumericString; locale = env2_6.locale; value40 = Number(Reflect.apply(normalizeNumericString, value39, [locale, value36])); r105 = value40; break reducibleJoin148; } } } } } } } value67 = value18 !== r105; reducibleJoin150: while (true) { if (value67) { r109 = value67; break reducibleJoin150; } autocomplete = context.autocomplete; value68 = autocomplete == null; r109 = value68; break reducibleJoin150; } if (!r109) { r109 = r106; } if (r109) { value69 = env2_1(env2_3[16]); value70 = context.autocomplete != null; reducibleJoin154: while (true) { if (value70) { r110 = value70; break reducibleJoin154; } value71 = r105 != null; r110 = value71; break reducibleJoin154; } name = value19.name; concat = global.HermesInternal.concat; value69(r110, 'Unexpected value for option "' + name + '"'); if (r105 == null) { break reducibleJoin156; } push = object.push; type = value19.type; name = value19.name; Reflect.apply(push, object, [{type: type, name: name, value: r105, focused: r106}]); break reducibleJoin156; } break reducibleJoin156; } autocomplete = context.autocomplete; if (autocomplete != null) { break reducibleJoin156; } binding = env2_8; getUpload = binding.getUpload; channel = context.channel; id = channel.id; name = value19.name; value29 = Reflect.apply(getUpload, binding, [id, name, commandAttachmentDraftType]); if (value29 == null) { break reducibleJoin156; } length = items3.length; push = items3.push; Reflect.apply(push, items3, [value29]); push = object.push; type = value19.type; name = value19.name; Reflect.apply(push, object, [{type: type, name: name, value: length, focused: r106}]); break reducibleJoin156; } binding = env2_2; value21 = binding(env2_3[14]); getOptionalString = value21.getOptionalString; name = value19.name; value22 = Reflect.apply(getOptionalString, value21, [optionValues, name]); reducibleJoin25: while (true) { if (value22 == null) { r92 = value; break reducibleJoin25; } trim = value22.trim; value23 = Reflect.apply(trim, value22, []); r92 = value23; break reducibleJoin25; } r4 = r92 ?? value18; choices = value19.choices; if (choices != null) { value25 = env2_0(env2_3[15]); findChoiceStringValue = value25.findChoiceStringValue; choices = value19.choices; choiceStringValue = Reflect.apply(findChoiceStringValue, value25, [choices, r4]); r93 = choiceStringValue; } else { autocomplete = value19.autocomplete; reducibleJoin34: while (true) { if (autocomplete) { autocomplete = context.autocomplete; reducibleJoin32: while (true) { reducibleJoin30: while (true) { if (autocomplete == null) { break reducibleJoin30; } if (r106) { autocomplete = context.autocomplete; query = autocomplete.query; r94 = query; break reducibleJoin32; } break reducibleJoin30; } binding = env2_0; value24 = binding(env2_3[15]); findAutocompleteChoiceStringValue = value24.findAutocompleteChoiceStringValue; channel = context.channel; id = channel.id; name = value19.name; autocompleteChoiceStringValue = Reflect.apply(findAutocompleteChoiceStringValue, value24, [id, name, r4]); r94 = autocompleteChoiceStringValue; break reducibleJoin32; } r93 = r94; break reducibleJoin34; } r93 = value; break reducibleJoin34; } } if (r93 == null) { r93 = r4; } if (value18 === r93) { if (context.autocomplete != null) { if (!r106) { break reducibleJoin156; } } } binding = env2_1; value26 = binding(env2_3[16]); autocomplete = context.autocomplete; value27 = autocomplete != null; reducibleJoin40: while (true) { if (value27) { r95 = value27; break reducibleJoin40; } value28 = r93 != null; r95 = value28; break reducibleJoin40; } name = value19.name; HermesInternal = global.HermesInternal; concat = HermesInternal.concat; value26(r95, 'Option "' + name + '" expects a value'); push = object.push; type = value19.type; name = value19.name; Reflect.apply(push, object, [{type: type, name: name, value: r93, focused: r106}]); break reducibleJoin156; } break reducibleJoin156; } } value72 = value16(); done = value72.done; if (done) { break reducibleLoop16; } r42 = value72; continue reducibleLoop16; } } subCommandPath = command.subCommandPath; if (subCommandPath == null) { r4 = object; break reducibleJoin160; } subCommandPath = command.subCommandPath; length = subCommandPath.length; value73 = length - 1; if (!(value73 >= 0)) { r4 = object; break reducibleJoin160; } r8 = object; r20 = value73; reducibleLoop159: while (true) { subCommandPath = command.subCommandPath; property = subCommandPath[r20]; name = property.name; type = property.type; items2 = [{type: type, name: name, options: r8}]; value74 = r20 - 1; if (value74 >= 0) { r8 = items2; r20 = value74; continue reducibleLoop159; } r4 = items2; break reducibleJoin160; } } } execute = command.execute; if (execute != null) { value79 = env2_1(env2_3[18]); trackWithMetadata = value79.trackWithMetadata; APPLICATION_COMMAND_USED = env2_12.APPLICATION_COMMAND_USED; object = {}; object.command_id = command.id; object.application_id = command.applicationId; object.command_type = command.type; object.location = env2_24(r13); object.source = r10; Reflect.apply(trackWithMetadata, value79, [APPLICATION_COMMAND_USED, object]); return command.execute(r4, context); } inputType = command.inputType; binding = env2_0; ApplicationCommandInputType = binding(env2_3[9]).ApplicationCommandInputType; BUILT_IN = ApplicationCommandInputType.BUILT_IN; if (inputType === BUILT_IN) { break reducibleJoin180; } inputType = command.inputType; binding = env2_0; ApplicationCommandInputType = binding(env2_3[9]).ApplicationCommandInputType; BUILT_IN_TEXT = ApplicationCommandInputType.BUILT_IN_TEXT; if (inputType === BUILT_IN_TEXT) { break reducibleJoin180; } inputType = command.inputType; binding = env2_0; ApplicationCommandInputType = binding(env2_3[9]).ApplicationCommandInputType; BUILT_IN_INTEGRATION = ApplicationCommandInputType.BUILT_IN_INTEGRATION; if (inputType === BUILT_IN_INTEGRATION) { break reducibleJoin180; } object = {}; version = command.version; object.version = version; rootCommand = command.rootCommand; reducibleJoin166: while (true) { if (rootCommand == null) { id = value; break reducibleJoin166; } id = rootCommand.id; break reducibleJoin166; } reducibleJoin168: while (true) { if (id != null) { break reducibleJoin168; } id = command.id; break reducibleJoin168; } object.id = id; guildId = command.guildId; object.guild_id = guildId; rootCommand = command.rootCommand; reducibleJoin170: while (true) { if (rootCommand == null) { name = value; break reducibleJoin170; } name = rootCommand.name; break reducibleJoin170; } reducibleJoin172: while (true) { if (name != null) { r18 = name; break reducibleJoin172; } untranslatedName = command.untranslatedName; r18 = untranslatedName; break reducibleJoin172; } object.name = r18; type = command.type; object.type = type; object.options = r4; rootCommand = command.rootCommand; object.application_command = rootCommand; reducibleJoin174: while (true) { if (commandTargetId == null) { break reducibleJoin174; } object.target_id = commandTargetId; break reducibleJoin174; } autocomplete = context.autocomplete; if (autocomplete != null) { value78 = env2_0(env2_3[19]); performAutocomplete = value78.performAutocomplete; Reflect.apply(performAutocomplete, value78, [command, context, object]); break reducibleJoin180; } binding = env2_1; value75 = binding(env2_3[20]); clearAll = value75.clearAll; channel = context.channel; id = channel.id; Reflect.apply(clearAll, value75, [id, commandAttachmentDraftType]); binding = env2_17; object3 = {}; applicationId = command.applicationId; object3.applicationId = applicationId; object3.data = object; object3.context = context; object3.attachments = items3; object3.maxSizeCallback = maxSizeCallback; object3.onMessageSuccess = onMessageSuccess; object3.analytics_location = env2_24(r13); object3.sectionName = sectionName; object3.source = r10; await r3(command, context, object); value76 = undefined; value77 = false; if (value77) { return value76; } object3.interactionLifecycleOptions = value76; binding(object3); break reducibleJoin180; } } return value; function onMessageSuccess() { // fn#63824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:7247, offset: 0x01b92827, size: 23 bytes, params: 1, frame: 11 env3_16(optionValues); } } } function queueCommand(a0, a1) { // fn#63825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:9026, offset: 0x01b9283e, size: 95 bytes, params: 3, frame: 18 const env0_0 = a0; const env0_1 = a1; const defaultImport = MessageQueue; const enqueue = defaultImport.enqueue; const MessageDataType = (MessageQueueModule).MessageDataType; const COMMAND = MessageDataType.COMMAND; Reflect.apply(enqueue, defaultImport, [{type: COMMAND, message: a0}, _fun63826]); function _fun63826(a0) { // fn#63826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:9123, offset: 0x01b9289d, size: 128 bytes, params: 2, frame: 24 let value = environment.__proto__; value = require(8056) /* metro dependency 8056: InteractionUtils */; const handleInteractionResponse = value.handleInteractionResponse; const {nonce, applicationId, channelId, guildId} = env0_0; const value3 = null; Reflect.apply(handleInteractionResponse, value, [nonce, a0, applicationId, channelId, value3 != guildId ? guildId : value3]); if (a0.ok && value3 != require) { require(); } } } function _displayInteractionLifecycleInChat() { // fn#63828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:9366, offset: 0x01b9291d, size: 48 bytes, params: 1, frame: 14 return Module00005(_fun63830).apply(this, arguments); function* _fun63830(a0, a1, a2) { // fn#63830, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:9457, offset: 0x01b92956, size: 678 bytes, params: 4, frame: 29 var bot; var r14; var r13; var botId; var binding2; var property; var value6; var getUser; var value7; var value8; var value9; var error; var binding3; var value10; var object; var id; var ApplicationCommandType; var CHAT; var CHAT_INPUT_COMMAND; var name; var object2; var displayName; var binding4; var InteractionTypes; var APPLICATION_COMMAND; var value11; var userRecordToServer; var getCurrentUser; var value12; var receiveMessage; if (false) { return undefined; } const env0_0 = a0; const env0_1 = a1; value = undefined; var env0_2; let channel = a1.channel; if (channel == null) { return {}; } let binding = env2_2; const value4 = binding(env2_3[27]); const getCachedApplicationSection = value4.getCachedApplicationSection; let object4 = {}; object4.channel = a1.channel; object4.type = 'channel'; let type = a2.type; let applicationId = a0.applicationId; const value5 = Reflect.apply(getCachedApplicationSection, value4, [object4, type, applicationId]); if (value5 == null) { return {}; } let application = value5.application; reducibleJoin5: while (true) { if (application == null) { bot = value; break reducibleJoin5; } bot = application.bot; break reducibleJoin5; } reducibleJoin22: while (true) { reduciblePort21: while (true) { exceptionLanding20: while (true) { if (bot != null) { break reduciblePort21; } botId = value5.botId; if (botId == null) { break reduciblePort21; } try { binding = env2_2; } catch (error) { break exceptionLanding20; } try { binding2 = env2_3; } catch (error) { break exceptionLanding20; } try { property = binding2[28]; } catch (error) { break exceptionLanding20; } try { value6 = binding(property); } catch (error) { break exceptionLanding20; } try { getUser = value6.getUser; } catch (error) { break exceptionLanding20; } try { botId = value5.botId; } catch (error) { break exceptionLanding20; } try { value7 = Reflect.apply(getUser, value6, [botId]); } catch (error) { break exceptionLanding20; } yield value7; try { value8 = undefined; value9 = false; } catch (error) { break exceptionLanding20; } if (value9) { return value8; } break reduciblePort21; } break reduciblePort21; } object4 = {}; binding = env2_1; binding3 = env2_3; value10 = binding(binding3[29]); object = {}; channel = a1.channel; id = channel.id; object.channelId = id; object.content = ''; type = a2.type; binding = env2_0; ApplicationCommandType = binding(binding3[13]).ApplicationCommandType; CHAT = ApplicationCommandType.CHAT; if (type !== CHAT) { break reducibleJoin22; } CHAT_INPUT_COMMAND = env2_13.CHAT_INPUT_COMMAND; r14 = CHAT_INPUT_COMMAND; object.type = r14; reducibleJoin26: while (true) { if (bot != null) { r13 = bot; break reducibleJoin26; } id = value5.id; name = value5.name; r13 = {id: id, username: name, discriminator: env2_14, avatar: null, bot: true}; break reducibleJoin26; } object.author = r13; copyDataProperties(object4, value10(object), undefined); application = value5.application; object4['application'] = application; object2 = {}; id = a2.id; object2.id = id; name = a2.name; object2.name = name; displayName = a0.displayName; object2.name_localized = displayName; binding = env2_0; binding4 = env2_3; InteractionTypes = binding(binding4[13]).InteractionTypes; APPLICATION_COMMAND = InteractionTypes.APPLICATION_COMMAND; object2.type = APPLICATION_COMMAND; value11 = binding(binding4[29]); userRecordToServer = value11.userRecordToServer; binding = env2_9; getCurrentUser = binding.getCurrentUser; object2.user = Reflect.apply(userRecordToServer, value11, [Reflect.apply(getCurrentUser, binding, [])]); object4['interaction'] = object2; object4['interaction_data'] = a2; env0_2 = object4; binding = env2_1; value12 = binding(binding4[30]); receiveMessage = value12.receiveMessage; channel = a1.channel; id = channel.id; applicationId = a0.applicationId; Reflect.apply(receiveMessage, value12, [id, object4, true, {applicationId: applicationId, command: a0}]); object4 = {}; Object.defineProperty(object4, 'messageId', {get: _fun63831, set: value, enumerable: true, configurable: true}); Object.defineProperty(object4, 'nonce', {get: _fun63832, set: value, enumerable: true, configurable: true}); object4.onCreate = onCreate; object4.onSuccess = function() { }; object4.onFailure = onFailure_63835; return object4; } object.type = env2_13.CONTEXT_MENU_COMMAND; reducibleJoin26: while (true) { if (bot != null) { r13 = bot; break reducibleJoin26; } id = value5.id; name = value5.name; r13 = {id: id, username: name, discriminator: env2_14, avatar: null, bot: true}; break reducibleJoin26; } object.author = r13; copyDataProperties(object4, value10(object), undefined); object4['application'] = value5.application; object2 = {}; object2.id = a2.id; object2.name = a2.name; object2.name_localized = a0.displayName; binding = env2_0; binding4 = env2_3; InteractionTypes = binding(binding4[13]).InteractionTypes; APPLICATION_COMMAND = InteractionTypes.APPLICATION_COMMAND; object2.type = APPLICATION_COMMAND; value11 = binding(binding4[29]); userRecordToServer = value11.userRecordToServer; binding = env2_9; getCurrentUser = binding.getCurrentUser; object2.user = Reflect.apply(userRecordToServer, value11, [Reflect.apply(getCurrentUser, binding, [])]); object4['interaction'] = object2; object4['interaction_data'] = a2; value12 = env2_1(binding4[30]); value12.receiveMessage(a1.channel.id, object4, true, {applicationId: a0.applicationId, command: a0}); object4 = {}; Object.defineProperty(object4, 'messageId', {get: _fun63831, set: value, enumerable: true, configurable: true}); Object.defineProperty(object4, 'nonce', {get: _fun63832, set: value, enumerable: true, configurable: true}); object4.onCreate = onCreate; object4.onSuccess = function() { }; object4.onFailure = onFailure_63835; return object4; function _fun63831() { // fn#63831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:10287, offset: 0x01b92bfc, size: 14 bytes, params: 1, frame: 1 return env0_2.id; } function _fun63832() { // fn#63832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:10316, offset: 0x01b92bfc, size: 14 bytes, params: 1, frame: 1 return env0_2.id; } function onCreate(a0) { // fn#63833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:10350, offset: 0x01b92c0a, size: 42 bytes, params: 2, frame: 3 if (env0_2.interaction != null) { env0_2.interaction.id = a0; } } function onFailure_63835(a0, a1, a2, a3) { // fn#63835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:10424, offset: 0x01b92c34, size: 240 bytes, params: 5, frame: 17 var r0; var r3; var value5; var value6; var id; var dispatch; var object; let value = a1; if (require.channel != null) { r0 = value == null && a0 != null; if (r0) { value5 = environment.__proto__.__proto__.__proto__; value6 = env3_1(env3_3[30]); value6.sendClydeError(require.channel.id, a0); } r0 = value == null && a3 != null; if (r0) { value = environment.__proto__.__proto__.__proto__; value = env3_0(env3_3[26]); value = value.interactionCallbackErrorReason(a3, env0_0.applicationId); r3 = value; } else { r3 = value; } value = environment.__proto__.__proto__.__proto__; value = env3_1(env3_3[10]); dispatch = value.dispatch; object = {type: 'MESSAGE_SEND_FAILED'}; id = env0_2.id; object.messageId = id; id = require.channel.id; object.channelId = id; object.reason = r3; Reflect.apply(dispatch, value, [object]); } } } } function getAnalyticsLocationFromCommandOrigin(a0) { // fn#63836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:10730, offset: 0x01b92d24, size: 639 bytes, params: 2, frame: 14 const ApplicationCommandTriggerLocations = (ApplicationCommandTypesModule).ApplicationCommandTriggerLocations; const CommandOrigin = (ApplicationCommandTypesModule).CommandOrigin; const APPLICATION_LAUNCHER = CommandOrigin.APPLICATION_LAUNCHER; if (APPLICATION_LAUNCHER === a0) { return ApplicationCommandTriggerLocations.APP_LAUNCHER; } const APP_LAUNCHER_APPLICATION_VIEW = CommandOrigin.APP_LAUNCHER_APPLICATION_VIEW; if (APP_LAUNCHER_APPLICATION_VIEW === a0) { return ApplicationCommandTriggerLocations.APP_LAUNCHER_APPLICATION_VIEW; } const IMAGE_RECS_MENU = CommandOrigin.IMAGE_RECS_MENU; if (IMAGE_RECS_MENU === a0) { return ApplicationCommandTriggerLocations.IMAGE_RECS_MENU; } const IMAGE_RECS_SUBMENU = CommandOrigin.IMAGE_RECS_SUBMENU; if (IMAGE_RECS_SUBMENU === a0) { return ApplicationCommandTriggerLocations.IMAGE_RECS_SUBMENU; } const ACTIVITY_INSTANCE_EMBED = CommandOrigin.ACTIVITY_INSTANCE_EMBED; if (ACTIVITY_INSTANCE_EMBED === a0) { return ApplicationCommandTriggerLocations.ACTIVITY_INSTANCE_EMBED; } const ACTIVITY_BOOKMARK_EMBED = CommandOrigin.ACTIVITY_BOOKMARK_EMBED; if (ACTIVITY_BOOKMARK_EMBED === a0) { return ApplicationCommandTriggerLocations.ACTIVITY_BOOKMARK_EMBED; } const MINI_SHELF = CommandOrigin.MINI_SHELF; if (MINI_SHELF === a0) { return ApplicationCommandTriggerLocations.ACTIVITIES_MINI_SHELF; } const VOICE_TILE_ACTIVITY_SUGGESTIONS = CommandOrigin.VOICE_TILE_ACTIVITY_SUGGESTIONS; if (VOICE_TILE_ACTIVITY_SUGGESTIONS === a0) { return ApplicationCommandTriggerLocations.VC_TILE_ACTIVITY_SUGGESTION; } const APP_DMS_ENTRY_POINT_COMMAND_BUTTON = CommandOrigin.APP_DMS_ENTRY_POINT_COMMAND_BUTTON; if (APP_DMS_ENTRY_POINT_COMMAND_BUTTON === a0) { return ApplicationCommandTriggerLocations.APP_DMS_ENTRY_POINT_COMMAND_BUTTON; } return ApplicationCommandTriggerLocations.SLASH_UI; } function _getMaxAndTotalFileSize() { // fn#63838, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:12080, offset: 0x01b92fa3, size: 48 bytes, params: 1, frame: 14 return Module00005(_fun63840).apply(this, arguments); function* _fun63840(a0, a1) { // fn#63840, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:12149, offset: 0x01b92fdc, size: 168 bytes, params: 3, frame: 24 var r5; var r6; var r7; var r13; var r1; var r2; var r3; var value5; var getSize; var value6; var value7; var currentSize; var value8; var value9; if (false) { return undefined; } value = environment.__proto__.__proto__; value = env2_18(a0); const value3 = value(); let done = value3.done; const value4 = 0; if (done) { r2 = value4; r3 = value4; } else { r5 = value4; r6 = value4; r7 = value3; reducibleLoop2: while (true) { value5 = r7.value; if (a1) { currentSize = value5.currentSize; r13 = currentSize ?? value4; r1 = r13; } else { getSize = value5.getSize; yield Reflect.apply(getSize, value5, []); value6 = undefined; value7 = false; reducibleJoin8: while (true) { if (value7) { return value6; } r1 = value6; break reducibleJoin8; } } if (r1 > r5) { r5 = r1; } value8 = r6 + r1; value9 = value(); done = value9.done; if (done) { return {totalSize: value8, largestUploadedFileSize: r5}; } r6 = value8; r7 = value9; continue reducibleLoop2; } } return {totalSize: r3, largestUploadedFileSize: r2}; } } function _stageAttachments() { // fn#63841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:12389, offset: 0x01b93084, size: 48 bytes, params: 1, frame: 14 return Module00005(_fun63843).apply(this, arguments); function* _fun63843(a0, a1, a2, a3) { // fn#63843, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:12446, offset: 0x01b930bd, size: 479 bytes, params: 5, frame: 29 var environment; var r8; var r7; var MAX_TOTAL_ATTACHMENT_SIZE; var binding2; var property; var value8; var value9; var value10; var value11; var error; var binding3; var value12; var setFailed; var intl; var formatToPlainString; var t; var length; var value13; var value14; var some; var value15; if (false) { return undefined; } const env0_0 = a1; const env0_1 = a3; value = environment.__proto__.__proto__; let binding = env2_0; const value4 = binding(env2_3[31]).maxFileSize(a2); const handleUploadsTooLarge2 = handleUploadsTooLarge; const value5 = false; yield env2_25(a0, value5); const value6 = undefined; if (false) { return value6; } let totalSize = value6.totalSize; let largestUploadedFileSize = value6.largestUploadedFileSize; const Math = global.Math; if (!(largestUploadedFileSize > Math.max(value4, env2_15))) { binding = env2_0; MAX_TOTAL_ATTACHMENT_SIZE = binding(env2_3[33]).MAX_TOTAL_ATTACHMENT_SIZE; reducibleJoin25: while (true) { if (!(totalSize > MAX_TOTAL_ATTACHMENT_SIZE)) { reducibleJoin6: while (true) { reduciblePort17: while (true) { exceptionLanding16: while (true) { try { binding = env2_1; } catch (error) { break exceptionLanding16; } break reducibleJoin6; } binding = env2_2; binding3 = env2_3; value12 = binding(binding3[24]); setFailed = value12.setFailed; binding = env2_0; intl = binding(binding3[32]).intl; formatToPlainString = intl.formatToPlainString; t = binding(binding3[32]).t; property = t['9h1/1p']; length = a0.length; Reflect.apply(setFailed, value12, [a1, undefined, Reflect.apply(formatToPlainString, intl, [property, {count: length}])]); break reduciblePort17; } yield env2_25(a0, true); value13 = undefined; value14 = false; if (value14) { return value13; } totalSize = value13.totalSize; largestUploadedFileSize = value13.largestUploadedFileSize; some = a0.some; value15 = Reflect.apply(some, a0, [_fun63845]); reducibleJoin21: while (true) { if (value15) { r8 = value15; break reducibleJoin21; } binding = env2_0; MAX_TOTAL_ATTACHMENT_SIZE = binding(env2_3[33]).MAX_TOTAL_ATTACHMENT_SIZE; value = totalSize > MAX_TOTAL_ATTACHMENT_SIZE; r8 = value; break reducibleJoin21; } value = !r8; reducibleJoin23: while (true) { if (r8) { handleUploadsTooLarge2(largestUploadedFileSize); r7 = value5; break reducibleJoin23; } r7 = value; break reducibleJoin23; } return r7; } try { binding2 = env2_3; } catch (error) { break exceptionLanding16; } try { property = binding2[34]; } catch (error) { break exceptionLanding16; } try { value8 = binding(property); } catch (error) { break exceptionLanding16; } try { value9 = value8(a0); } catch (error) { break exceptionLanding16; } yield value9; try { value10 = undefined; value11 = false; } catch (error) { break exceptionLanding16; } if (value11) { return value10; } yield env2_25(a0, true); value13 = undefined; value14 = false; if (value14) { return value13; } totalSize = value13.totalSize; largestUploadedFileSize = value13.largestUploadedFileSize; some = a0.some; value15 = Reflect.apply(some, a0, [_fun63845]); reducibleJoin21: while (true) { if (value15) { r8 = value15; break reducibleJoin21; } binding = env2_0; MAX_TOTAL_ATTACHMENT_SIZE = binding(env2_3[33]).MAX_TOTAL_ATTACHMENT_SIZE; value = totalSize > MAX_TOTAL_ATTACHMENT_SIZE; r8 = value; break reducibleJoin21; } value = !r8; reducibleJoin23: while (true) { if (r8) { handleUploadsTooLarge2(largestUploadedFileSize); r7 = value5; break reducibleJoin23; } r7 = value; break reducibleJoin23; } return r7; } break reducibleJoin25; } } handleUploadsTooLarge2(largestUploadedFileSize); return value5; function handleUploadsTooLarge(a0) { // fn#63844, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:12518, offset: 0x01b9329c, size: 172 bytes, params: 2, frame: 23 if (importAll != null) { importAll(env0_2, a0); } let binding = env3_2; const binding2 = env3_3; const value3 = binding(binding2[24]); const setFailed = value3.setFailed; const ENTITY_TOO_LARGE = env3_11.ENTITY_TOO_LARGE; binding = env3_0; const intl = binding(binding2[32]).intl; const formatToPlainString = intl.formatToPlainString; const fxEKdS = binding(binding2[32]).t.fxEKdS; const object = {}; object.maxSize = binding(binding2[31]).sizeString(env0_2); Reflect.apply(setFailed, value3, [require, ENTITY_TOO_LARGE, Reflect.apply(formatToPlainString, intl, [fxEKdS, object])]); } function _fun63845({error}) { // fn#63845, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:13079, offset: 0x01b93348, size: 27 bytes, params: 2, frame: 2 const ENTITY_TOO_LARGE = env3_11.ENTITY_TOO_LARGE; return error === ENTITY_TOO_LARGE; } } } function trackEmojiUsage(a0) { // fn#63846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:7450, offset: 0x01b93363, size: 106 bytes, params: 2, frame: 13 var defaultImport; const Object = global.Object; let value = Object.values(a0); value = value.flatMap(function(a0) { return a0.map(_fun63848).filter(require(dependencyMap[22]).isNotNullish); }); if (value.length > 0) { defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */; defaultImport.dispatch({type: 'EMOJI_TRACK_USAGE', emojiUsed: value}); } function _fun63847(a0) { // fn#63847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:7486, offset: 0x01b933cd, size: 63 bytes, params: 2, frame: 13 const value = a0.map(_fun63848); return value.filter((GlobalUtilsModule).isNotNullish); function _fun63848(a0) { // fn#63848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:7496, offset: 0x01b9340c, size: 166 bytes, params: 2, frame: 16 var r0; var value; var emojiStoreBinding; var Emoji; var object; let type = a0.type; if (type === 'emoji') { value = environment.__proto__.__proto__; Emoji = (require(3797) /* metro dependency 3797: UnicodeEmojis */).Emoji; object = {'names': null, 'surrogates': '', 'unicodeVersion': 6}; value = a0.name.replaceAll(':', ''); object.names = [value]; r0 = new Emoji(); } else { type = a0.type; value = null; if (type !== 'customEmoji') { r0 = value; } else { value = environment.__proto__.__proto__; emojiStoreBinding = EmojiStore; value = emojiStoreBinding.getCustomEmojiById(a0.emojiId); r0 = value; } } return r0; } } } function _fun63849() { // fn#63849, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:7774, offset: 0x01b934b2, size: 32 bytes, params: 1, frame: 12 const env0_0 = Module00005(_fun63851); return _fun63852; function* _fun63851(a0, a1, a2) { // fn#63851, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:7794, offset: 0x01b934db, size: 204 bytes, params: 4, frame: 18 var r3; var interactionData; var command; var object; var binding; var object2; var binding2; let value = undefined; if (false) { return value; } if (a0.isCommandType()) { interactionData = a0.interactionData; value = null; if (value == interactionData) { return undefined; } command = a2.command; if (value == command) { return undefined; } object = {channel: a1}; if (value != a1.guild_id) { value = environment.__proto__.__proto__; binding = env2_7; value = binding.getGuild(a1.guild_id); r3 = value; } else { r3 = value; } object.guild = r3; value = environment.__proto__.__proto__; binding = env2_17; object2 = {}; command = a2.command; object2.applicationId = command.applicationId; interactionData = a0.interactionData; object2.data = interactionData; object2.context = object; binding2 = env2_22; command = a2.command; interactionData = a0.interactionData; yield binding2(command, object, interactionData); value = undefined; if (false) { return value; } object2.interactionLifecycleOptions = value; binding(object2); } } function _fun63852() { // fn#63852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:8154, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13 return env0_0.apply(this, arguments); } } function enqueueCommandInteraction({applicationId, data, context, attachments, maxSizeCallback, onMessageSuccess, analytics_location, sectionName, source, interactionLifecycleOptions}) { // fn#63853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:8226, offset: 0x01b935a7, size: 410 bytes, params: 2, frame: 30 var id; var guild; var id2; var object; var nonce; var moduleValue2; var addQueued; var object2; var object3; let channel = context.channel; if (channel != null) { channel = context.channel; guild = context.guild; id2 = channel.id; id = guild?.id; object = {applicationId: applicationId, channelId: id2, guildId: id, data: data}; nonce = interactionLifecycleOptions.nonce; object.nonce = nonce ?? (require(7142) /* metro dependency 7142: createNonce */).createNonce(); object.attachments = attachments; object.maxSizeCallback = maxSizeCallback; object.analytics_location = analytics_location; object.sectionName = sectionName; object.source = source; moduleValue2 = importAll(8055) /* metro dependency 8055: InteractionActionCreators */; addQueued = moduleValue2.addQueued; nonce = object.nonce; object2 = {}; object2.messageId = interactionLifecycleOptions.messageId; object2.onCreate = interactionLifecycleOptions.onCreate; object2.onSuccess = interactionLifecycleOptions.onSuccess; object2.onFailure = interactionLifecycleOptions.onFailure; object3 = {}; object3.interactionType = (require(1909) /* metro dependency 1909: Server */).InteractionTypes.APPLICATION_COMMAND; object3.applicationId = applicationId; object3.channelId = id2; object2.data = object3; Reflect.apply(addQueued, moduleValue2, [nonce, object2]); if (attachments == null) { queueCommand(object, onMessageSuccess); } else if (attachments.length > 0) { (function() { return _stageAttachments.apply(this, arguments); })(attachments, object.nonce, id, maxSizeCallback).then(_fun63855); } else { queueCommand(object, onMessageSuccess); } } function _fun63855(a0) { // fn#63855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8228:8978, offset: 0x01b93741, size: 36 bytes, params: 2, frame: 13 var value; if (a0) { value = environment.__proto__; queueCommand(env0_1, onMessageSuccess); } } } } global.__d(_fun63817, 8050, [5, 6540, 1949, 1867, 4644, 1878, 7168, 661, 4503, 5068, 694, 7153, 5065, 1909, 8051, 8053, 44, 8054, 4863, 7166, 7879, 3797, 1360, 7142, 8055, 4862, 8056, 8060, 8061, 7141, 7067, 4655, 1244, 4651, 7226, 2]) /* metro module 8050, dependencies: [5, 6540, 1949, 1867, 4644, 1878, 7168, 661, 4503, 5068, 694, 7153, 5065, 1909, 8051, 8053, 44, 8054, 4863, 7166, 7879, 3797, 1360, 7142, 8055, 4862, 8056, 8060, 8061, 7141, 7067, 4655, 1244, 4651, 7226, 2] */;