/* Metro module 11854; source: modules/autocompleter/native/AutocompleteWrapper.tsx; dependencies: [57, 31, 27, 7168, 6540, 4257, 6583, 661, 5066, 11018, 6625, 11086, 1881, 33, 11855, 4501, 477, 697, 1478, 5463, 5314, 566, 3860, 3829, 6748, 11085, 8530, 5065, 1909, 11017, 11857, 1583, 4863, 11859, 1357, 4559, 11860, 7882, 11752, 4017, 11861, 5068, 11868, 4573, 1244, 7331, 11869, 2] */ function _fun90825(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6, offset: 0x02047d5e, size: 657 bytes, params: 8, frame: 20 var object2; const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(57) /* metro dependency 57 */; let value = importAll(31) /* metro dependency 31 */; const value2 = require(27) /* metro dependency 27 */; const StyleSheet = value2.StyleSheet; const env0_5 = value2.View; const env0_6 = value2.FlatList; const applicationCommandStore = importDefault(7168) /* metro dependency 7168: ApplicationCommandStore */; const emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */; const gatewayConnectionStore = importDefault(4257) /* metro dependency 4257: GatewayConnectionStore */; const stickersStore = importDefault(6583) /* metro dependency 6583: StickersStore */; const constantsModule = require(661) /* metro dependency 661: Constants */; const env0_11 = constantsModule.AutoCompleteResultTypes; const env0_12 = constantsModule.WHITESPACE_RE; const env0_13 = constantsModule.AnalyticEvents; const env0_14 = constantsModule.UpsellTypes; const env0_15 = (require(5066) /* metro dependency 5066: ApplicationCommandConstants */).BOOLEAN_CHOICES; const applicationCommandsConstantsModule = require(11018) /* metro dependency 11018: ApplicationCommandsConstants */; const env0_16 = applicationCommandsConstantsModule.AUTOCOMPLETE_EMOJI_ROW_HEIGHT; const env0_17 = applicationCommandsConstantsModule.AUTOCOMPLETE_ROW_HEIGHT; const channelAutocompleteConstantsModule = require(6625) /* metro dependency 6625: ChannelAutocompleteConstants */; const env0_18 = channelAutocompleteConstantsModule.MENTION_SENTINEL; const env0_19 = channelAutocompleteConstantsModule.CHANNEL_SENTINEL; const env0_20 = channelAutocompleteConstantsModule.EMOJI_SENTINEL; const env0_21 = (require(11086) /* metro dependency 11086: ChannelAutocompleteConstants */).AutocompleteTypes; const env0_22 = (require(1881) /* metro dependency 1881: EmojiConstants */).EmojiInteractionPoint; const value6 = require(33) /* metro dependency 33 */; const env0_23 = value6.jsx; const env0_24 = value6.Fragment; const env0_25 = value6.jsxs; const hairlineWidth = StyleSheet.hairlineWidth; const AUTOCOMPLETE_STICKER_NODE_SIZE = (require(11855) /* metro dependency 11855: Autocomplete */).AUTOCOMPLETE_STICKER_NODE_SIZE; const env0_27 = 284 + AUTOCOMPLETE_STICKER_NODE_SIZE + 12 + hairlineWidth; const env0_28 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun90827); object2 = {'resultCount': 0, 'stickerResults': null, 'nonStickerResults': null, 'hasStickerResults': false, 'hasNonStickerResults': false}; object2.stickerResults = []; object2.nonStickerResults = []; const value8 = value.forwardRef(_fun90830); value8.displayName = 'AutocompleteWrapper'; value = value.memo(value8); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/autocompleter/native/AutocompleteWrapper.tsx'); exports.default = value; } function getAutocompletesHeight(a0, a1, a2, a3) { // fn#90826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:1691, offset: 0x02047fef, size: 79 bytes, params: 5, frame: 6 var r0; let value = a3; const value2 = 0; if (value2 === a0) { r0 = value2; } else { value = a0 * (a2 ? value : a1 === AutocompleteTypes.EMOJIS_AND_STICKERS ? AUTOCOMPLETE_EMOJI_ROW_HEIGHT : AUTOCOMPLETE_ROW_HEIGHT); value += (a0 - 1) * hairlineWidth; r0 = value; } return r0; } function _fun90827(a0, a1, a2, a3, a4) { // fn#90827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:663, offset: 0x0204803e, size: 405 bytes, params: 6, frame: 17 const object2 = {}; const value = 'relative'; object2.autocompletePositionRelative = {position: value}; const object5 = {}; object5.position = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? value : 'absolute'; object5.marginHorizontal = a3; object5.marginBottom = a4; object2.autocompleteWrapper = object5; object2.autocompleteWrapperAbsolute = {'left': 0, 'right': 0, 'bottom': 0}; const object6 = {}; let MOBILE_FLOATING_ACCESSORY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BACKGROUND; object6.backgroundColor = MOBILE_FLOATING_ACCESSORY_BACKGROUND; object6.borderRadius = a0; object6.borderWidth = a1; object6.borderTopWidth = a2; let MOBILE_FLOATING_ACCESSORY_BORDER = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BORDER; object6.borderColor = MOBILE_FLOATING_ACCESSORY_BORDER; object6.overflow = 'hidden'; object2.autocompleteContainer = object6; MOBILE_FLOATING_ACCESSORY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BACKGROUND; object2.autocomplete = {'flexGrow': 0, 'flexShrink': 1, backgroundColor: MOBILE_FLOATING_ACCESSORY_BACKGROUND}; MOBILE_FLOATING_ACCESSORY_BORDER = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BORDER; object2.sectionDivider = {backgroundColor: MOBILE_FLOATING_ACCESSORY_BORDER, marginLeft: -16}; MOBILE_FLOATING_ACCESSORY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BACKGROUND; object2.sectionTitle = {'height': 18, 'backgroundColor': null, 'paddingLeft': 12, 'marginVertical': 12, 'alignItems': 'center', backgroundColor: MOBILE_FLOATING_ACCESSORY_BACKGROUND}; const object7 = {}; const AUTOCOMPLETE_STICKER_NODE_MARGIN = (require(11855) /* metro dependency 11855: Autocomplete */).AUTOCOMPLETE_STICKER_NODE_MARGIN; object7.paddingLeft = 12 - AUTOCOMPLETE_STICKER_NODE_MARGIN; object7.marginBottom = 12; const AUTOCOMPLETE_STICKER_NODE_SIZE = (require(11855) /* metro dependency 11855: Autocomplete */).AUTOCOMPLETE_STICKER_NODE_SIZE; object7.height = AUTOCOMPLETE_STICKER_NODE_SIZE; object7.flexShrink = 0; object2.stickersAutocompleteList = object7; return object2; } function isSlashAutocompleteType(a0) { // fn#90828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:1649, offset: 0x020481d3, size: 39 bytes, params: 2, frame: 4 const SLASHES = AutocompleteTypes.SLASHES; return a0 === SLASHES || a0 === AutocompleteTypes.SLASHES_DISCOVERY; } function getStickersItemLayout(a0, a1) { // fn#90829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:1819, offset: 0x020481fa, size: 119 bytes, params: 3, frame: 16 const object2 = {}; const AUTOCOMPLETE_STICKER_NODE_SIZE = (require(11855) /* metro dependency 11855: Autocomplete */).AUTOCOMPLETE_STICKER_NODE_SIZE; object2.length = AUTOCOMPLETE_STICKER_NODE_SIZE; const AUTOCOMPLETE_STICKER_NODE_MARGIN = (require(11855) /* metro dependency 11855: Autocomplete */).AUTOCOMPLETE_STICKER_NODE_MARGIN; object2.offset = a1 * (AUTOCOMPLETE_STICKER_NODE_SIZE + AUTOCOMPLETE_STICKER_NODE_MARGIN) + (a1 - 1) * AUTOCOMPLETE_STICKER_NODE_MARGIN; object2.index = a1; return object2; } function _fun90830({analyticsLocations, channel, canMentionEveryone, keyboardType, onChangeAutoCompleteVisibility, commandsDisabled, chatInputRef, canOnlyUseTextCommands, screenIndex}, a1) { // fn#90830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:2148, offset: 0x02048271, size: 3292 bytes, params: 3, frame: 62 var r23; var r34; var r33; var jsxRuntimeEnv0_24Binding; var items3; var value49; var jsxRuntimeEnv0_24Binding2; var jsxRuntimeEnv0_24Binding3; const Text = (require(4573) /* metro dependency 4573: Text */).Text; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var items4; var object2; var items5; const env0_3 = keyboardType; const env0_4 = onChangeAutoCompleteVisibility; const {optionStates, activeOption, activeCommand, activeSection} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ApplicationCommandStore], function() { var object = {}; var channelBinding = channel; object.optionStates = ApplicationCommandStore.getOptionStates(channelBinding.id); object.activeOption = ApplicationCommandStore.getActiveOption(channelBinding.id); object.activeCommand = ApplicationCommandStore.getActiveCommand(channelBinding.id); object.activeSection = ApplicationCommandStore.getActiveCommandSection(channelBinding.id); return object; }); const useTokenModule = require(3860) /* metro dependency 3860: useToken */; let useToken = useTokenModule.useToken; const TABLE_ROW_HEIGHT = (importDefault(697) /* metro dependency 697: native */).modules.mobile.TABLE_ROW_HEIGHT; const value3 = Reflect.apply(useToken, useTokenModule, [TABLE_ROW_HEIGHT]); const IncludeStickersInAutocomplete = (require(3829) /* metro dependency 3829: UserSettings */).IncludeStickersInAutocomplete; const setting = IncludeStickersInAutocomplete.getSetting(); let binding = env0_4; let useState = binding.useState; const value5 = Reflect.apply(useState, binding, [env0_31]); const binding2 = env0_3; const value6 = binding2(value5, 2); var property = value6[0]; const resultCount = property.resultCount; const stickerResults = property.stickerResults; const nonStickerResults = property.nonStickerResults; const hasStickerResults = property.hasStickerResults; const hasNonStickerResults = property.hasNonStickerResults; const env0_17 = value6[1]; const loadState = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], function() { return EmojiStore.loadState; }); const loadState2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([StickersStore], function() { return StickersStore.loadState; }); const useContext = binding.useContext; const RedesignCompatContext = (require(6748) /* metro dependency 6748: RedesignCompatNative */).RedesignCompatContext; const value8 = Reflect.apply(useContext, binding, [RedesignCompatContext]); const value9 = binding.useMemo(_fun90834, [channel, setting]); useState = binding.useState; const value10 = ''; const value11 = binding2(Reflect.apply(useState, binding, [{'focused': false, 'text': '', 'selectionStart': 0, 'selectionEnd': 0}]), 2); property = value11[0]; const focused = property.focused; const text = property.text; const selectionStart = property.selectionStart; const selectionEnd = property.selectionEnd; const env0_24 = value11[1]; useState = binding.useState; const value12 = binding2(Reflect.apply(useState, binding, [0]), 2); property = value12[0]; const env0_25 = value12[1]; binding.useEffect(function() { var env0_0 = false; GatewayConnectionStore.addConditionalChangeListener(_fun90836); return _fun90837; }, []); binding.useImperativeHandle(a1, binding.useMemo(function() { var env0_0 = -1; return _fun90839; }, [])); const {autocompleteType, query, queryOptions, autocompleteSelectionStart, showOptionValuesPicker} = binding.useMemo(_fun90843, [selectionStart, selectionEnd, text, activeCommand, optionStates, activeOption, canMentionEveryone, commandsDisabled, value9, loadState, loadState2]); const value15 = binding.useCallback(_fun90846, [autocompleteType, query, queryOptions, value9]); binding.useEffect(_fun90848, [autocompleteType, value15, value9]); binding.useEffect(_fun90851, [value15]); const value16 = binding.useCallback(function() { var object = {}; object.numStickerResults = stickerResults.length; object.numEmojiResults = nonStickerResults.filter(_fun90853).length; return object; }, [stickerResults, nonStickerResults]); const value17 = binding.useMemo(_fun90854, [autocompleteType, focused, keyboardType, resultCount]); const env0_34 = binding.useRef(false); binding.useEffect(_fun90855, [autocompleteType, activeCommand]); binding.useEffect(_fun90856, [onChangeAutoCompleteVisibility, activeCommand, value17, autocompleteType, channel, value16]); const value18 = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)({ignoreKeyboard: true}); const insets = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)({includeKeyboardHeight: true}).insets; const value20 = value18.height - insets.top - insets.bottom; const NAV_BAR_HEIGHT = (require(5314) /* metro dependency 5314: NavigatorConstantsNative */).NAV_BAR_HEIGHT; const value22 = binding.useMemo(_fun90857, [autocompleteType, stickerResults.length, value20 - NAV_BAR_HEIGHT - property]); useState = binding.useState; const value23 = binding2(Reflect.apply(useState, binding, [null]), 2); property = value23[0]; const property2 = value23[1]; const value24 = binding.useMemo(_fun90858, [resultCount, autocompleteType, value17, hasStickerResults, hasNonStickerResults, nonStickerResults.length, value22, property, value8, value3]); const mobileVisualRefreshExperimentModule = require(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */; const useMobileVisualRefreshConfig = mobileVisualRefreshExperimentModule.useMobileVisualRefreshConfig; const chatInputFloating = Reflect.apply(useMobileVisualRefreshConfig, mobileVisualRefreshExperimentModule, [{location: 'AutocompleteWrapper'}]).chatInputFloating; const value25 = value24 > 0; const moduleValue6 = useTokenModule; useToken = moduleValue6.useToken; const CHAT_INPUT_FLOATING_BORDER_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_BORDER_RADIUS; const value26 = Reflect.apply(useToken, moduleValue6, [CHAT_INPUT_FLOATING_BORDER_RADIUS]); const moduleValue7 = useTokenModule; useToken = moduleValue7.useToken; const CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH; const value27 = Reflect.apply(useToken, moduleValue7, [CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH]); const moduleValue8 = useTokenModule; useToken = moduleValue8.useToken; const CHAT_INPUT_FLOATING_ACCESSORY_TOP_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_TOP_BORDER_WIDTH; const value28 = Reflect.apply(useToken, moduleValue8, [CHAT_INPUT_FLOATING_ACCESSORY_TOP_BORDER_WIDTH]); const moduleValue9 = useTokenModule; useToken = moduleValue9.useToken; const CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_HORIZONTAL = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_HORIZONTAL; const value29 = Reflect.apply(useToken, moduleValue9, [CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_HORIZONTAL]); const moduleValue10 = useTokenModule; useToken = moduleValue10.useToken; const CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_BOTTOM = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_BOTTOM; const value30 = Reflect.apply(useToken, moduleValue10, [CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_BOTTOM]); const r36 = value25 || activeCommand != null && !commandsDisabled; const r19 = value25 ? value27 : 0; let r12 = value25 ? value28 : 0; let r10 = r36 ? value29 : 0; const styles = useStyles(value26, r19, r12, r10, r36 ? value30 : 0); const value33 = (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).useIsScreenReaderEnabled(); r10 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() || (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && (value33 || chatInputFloating); binding = env0_4; const value34 = binding.useMemo(_fun90859, [value33, chatInputFloating, styles.autocompletePositionRelative]); const value35 = binding.useMemo(_fun90860, [value25, value30]); const value36 = (importDefault(11860) /* metro dependency 11860: useAutocompleteAnimatedHeightStyles */)(value24, screenIndex); const value37 = binding.useCallback(_fun90861, [analyticsLocations, channel, chatInputRef]); const value38 = binding.useCallback(_fun90862, [chatInputRef, optionStates, channel]); const value39 = binding.useCallback(_fun90863, [autocompleteSelectionStart, autocompleteType, value16, channel, value37, showOptionValuesPicker]); var [property, env0_47] = env0_3(binding.useState(null), 2); const value42 = binding.useCallback(_fun90864, [autocompleteType, value39, property, channel, activeCommand]); items7 = [styles.autocomplete]; items7[1] = {maxHeight: value22}; const items6 = [styles.autocompleteWrapper]; r10 = !r10 && styles.autocompleteWrapperAbsolute; items6[1] = r10; items6[2] = value34; const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View; const items2 = [styles.autocompleteContainer, value36]; const value44 = autocompleteType != null; if (value44) { jsxRuntimeEnv0_24Binding = jsxRuntimeEnv0_24; r23 = autocompleteType === AutocompleteTypes.SLASHES_DISCOVERY && ((Component) => )(importDefault(11861) /* metro dependency 11861: ApplicationCommandDiscovery */); items3 = [r23]; r23 = autocompleteType === AutocompleteTypes.SLASHES && ((Component) => )(importDefault(11868) /* metro dependency 11868: ApplicationCommandList */); items3[1] = r23; value49 = autocompleteType === AutocompleteTypes.EMOJIS_AND_STICKERS; if (value49) { jsxRuntimeEnv0_24Binding2 = jsxRuntimeEnv0_24; if (hasStickerResults) { jsxRuntimeEnv0_24Binding3 = jsxRuntimeEnv0_24; items4 = [{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.uferGG, {prefix: query})}]; object2 = {}; copyDataProperties(object2, items7, r12); copyDataProperties(object2, styles.stickersAutocompleteList, r12); items4[1] = ; r34 = <>{items4}; } else { r34 = hasStickerResults; } items5 = [r34]; r33 = hasStickerResults && hasNonStickerResults; r33 = r33 && ((Component) => )(importDefault(7331) /* metro dependency 7331: FormDivider */); items5[1] = r33; items5[2] = hasNonStickerResults && {intl.format((require(1244) /* metro dependency 1244: indexNative */).t.ksAVYt, {prefix: value10 + EMOJI_SENTINEL + query})}; r23 = <>{items5}; } else { r23 = value49; } items3[2] = r23; items3[3] = ; r12 = <>{items3}; } else { r12 = value44; } return ( {r12} {activeCommand != null && !commandsDisabled && {((Component) => )(importDefault(11869) /* metro dependency 11869: ApplicationCommandBar */)}} ); } function _fun90834() { // fn#90834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:3051, offset: 0x02048fd3, size: 53 bytes, params: 1, frame: 15 const value = environment.__proto__; return (require(11085) /* metro dependency 11085: AutocompleteOptions */).getAutocompleteOptions(channel, true, env0_11); } function _fun90835() { // fn#90835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:3324, offset: 0x02049008, size: 42 bytes, params: 1, frame: 12 GatewayConnectionStore.addConditionalChangeListener(_fun90836); return function() { env0_0 = true; }; } function _fun90838() { // fn#90838, offset: 0x02049087, size: 21 bytes, params: 1, frame: 2 return _fun90839; } function _fun90843() { // fn#90843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:3859, offset: 0x020491aa, size: 1338 bytes, params: 1, frame: 42 var r32; var environment; var r3; var r7; var r8; var r2; var r13; var r1; var channelTypes; var r5; var r9; var r11; var r23; var r25; var r12; var r22; var r27; var r14; var r30; var r15; var r18; var r10; var length; var value3; var activeOptionBinding; var object5; var canMentionEveryoneBinding; var value4; var moduleValue; var getApplicationCommandOptionQueryOptions; var value5; var value6; var optionStatesBinding; var name; var property; var location; var substring; var value7; var value8; var choices; var autocomplete; var type; var value9; const ApplicationCommandOptionType = (require(1909) /* metro dependency 1909: Server */).ApplicationCommandOptionType; var BOOLEAN; var CHANNEL; var ROLE; var USER; var MENTIONABLE; var value10; var MENTIONS; var value11; var CHANNELS; var value12; var value13; var CHOICES; var value14; var value15; var value16; var value17; var value18; var value19; var value20; var test; var value21; var slice; var value22; var moduleValue2; var getPrefix; var moduleValue3; var getQuery; var value23; var Object; var keys; var value24; var find; var value25; var value26; var SLASHES; var getTextBeforeFirstOption; var value27; var text2; var object6; var value28; var value29; var value30; var startsWith; var value31; var length2; var value32; var value33; var entries; var value34; var forEach; var object7; var object8; let value = environment; const selectionStartBinding = selectionStart; var env0_2; let textBinding = text; const value2 = null; if (value2 != textBinding) { textBinding = text; length = textBinding.trim().length; value3 = 0; reducibleJoin54: while (true) { if (value3 !== length) { if (value2 != activeOption) { value4 = environment.__proto__; moduleValue = require(5065) /* metro dependency 5065: ApplicationCommandUtils */; getApplicationCommandOptionQueryOptions = moduleValue.getApplicationCommandOptionQueryOptions; value5 = Reflect.apply(getApplicationCommandOptionQueryOptions, moduleValue, [activeOption]); r3 = value5; } else { canMentionEveryoneBinding = canMentionEveryone; r3 = {'canMentionEveryone': null, 'canMentionHere': null, 'canMentionChannels': true, 'canMentionUsers': true, 'canMentionRoles': true, 'canMentionAnyGuildUser': false, 'canMentionNonMentionableRoles': false, 'canMentionOtherGlobals': true, canMentionEveryone: canMentionEveryoneBinding, canMentionHere: canMentionEveryoneBinding}; } activeOptionBinding = activeOption; value6 = undefined; reducibleJoin7: while (true) { if (value2 != activeOptionBinding) { optionStatesBinding = optionStates; name = activeOption.name; property = optionStatesBinding[name]; r7 = property; break reducibleJoin7; } r7 = value6; break reducibleJoin7; } if (value2 != activeCommand) { reducibleJoin26: while (true) { if (value2 != activeOption) { if (value2 != r7) { location = r7.location; r8 = value2 != location ? location : value3; length = r7.length; r2 = value2 != length ? length : value3; reducibleJoin14: while (true) { if (selectionStart >= r8 + r2) { textBinding = text; substring = textBinding.substring; value7 = r8 + r2; value8 = Reflect.apply(substring, textBinding, [value7, selectionStart]); r13 = value8; break reducibleJoin14; } r13 = value6; break reducibleJoin14; } var env0_1 = r13; choices = activeOption.choices; reducibleJoin25: while (true) { reducibleJoin24: while (true) { if (value2 != choices) { break reducibleJoin24; } autocomplete = activeOption.autocomplete; if (autocomplete) { break reducibleJoin24; } type = activeOption.type; value9 = environment.__proto__; BOOLEAN = ApplicationCommandOptionType.BOOLEAN; if (BOOLEAN === type) { value13 = ''; env0_0 = value13; CHOICES = AutocompleteTypes.CHOICES; value14 = true; r1 = value14; channelTypes = value6; r5 = BOOLEAN_CHOICES; r9 = CHOICES; r11 = value13; break reducibleJoin25; } CHANNEL = ApplicationCommandOptionType.CHANNEL; if (CHANNEL === type) { env0_0 = CHANNEL_SENTINEL; CHANNELS = AutocompleteTypes.CHANNELS; channelTypes = activeOption.channelTypes; value12 = true; r1 = value12; r5 = value6; r9 = CHANNELS; r11 = CHANNEL_SENTINEL; break reducibleJoin25; } ROLE = ApplicationCommandOptionType.ROLE; if (ROLE !== type) { USER = ApplicationCommandOptionType.USER; if (USER !== type) { MENTIONABLE = ApplicationCommandOptionType.MENTIONABLE; value10 = false; if (MENTIONABLE !== type) { r1 = value10; channelTypes = value6; r5 = value6; r9 = value6; r11 = value6; break reducibleJoin25; } } } env0_0 = MENTION_SENTINEL; MENTIONS = AutocompleteTypes.MENTIONS; value11 = true; r1 = value11; channelTypes = value6; r5 = value6; r9 = MENTIONS; r11 = MENTION_SENTINEL; break reducibleJoin25; } value15 = ''; var env0_0 = value15; value16 = environment.__proto__; CHOICES = AutocompleteTypes.CHOICES; choices = activeOption.choices; value17 = true; r1 = value17; channelTypes = value6; r5 = choices; r9 = CHOICES; r11 = value15; break reducibleJoin25; } if (r1) { value28 = value2 != r11; reducibleJoin45: while (true) { if (value28) { value29 = r11 !== ''; r7 = value29; break reducibleJoin45; } r7 = value28; break reducibleJoin45; } reducibleJoin47: while (true) { if (r7) { value30 = value2 != r13; r7 = value30; break reducibleJoin47; } break reducibleJoin47; } reducibleJoin49: while (true) { if (r7) { startsWith = r13.startsWith; value31 = Reflect.apply(startsWith, r13, [r11]); r7 = value31; break reducibleJoin49; } break reducibleJoin49; } reducibleJoin53: while (true) { if (r7) { length = r13.length; length2 = r11.length; value32 = ''; reducibleJoin52: while (true) { if (length > length2) { substring = r13.substring; length = r11.length; value33 = Reflect.apply(substring, r13, [length]); r7 = value33; break reducibleJoin52; } r7 = value32; break reducibleJoin52; } env0_1 = r7; r10 = r7; break reducibleJoin53; } r10 = r13; break reducibleJoin53; } Object = global.Object; entries = Object.entries; value34 = Reflect.apply(entries, Object, [optionStates]); forEach = value34.forEach; Reflect.apply(forEach, value34, [_fun90844]); object7 = {query: r10, autocompleteType: r9, autocompleteSelectionStart: r8 + r2}; object8 = {}; object8.activeCommand = activeCommand; object8.optionValues = {}; object8.isActiveApplicationCommand = r1; object8.option = activeOption; object8.choices = r5; object8.channelTypes = channelTypes; copyDataProperties(object8, r3, r32); object7.queryOptions = object8; object7.showOptionValuesPicker = r1; return object7; } r23 = r13; r25 = r9; break reducibleJoin26; } r23 = value6; r25 = value6; break reducibleJoin26; } r23 = value6; r25 = value6; break reducibleJoin26; } } else { r23 = value6; r25 = value6; } reducibleJoin30: while (true) { if (value2 != r7) { location = r7.location; r12 = value2 != location ? location : value3; length = r7.length; r7 = value2 != length ? length : value3; value18 = r12 + r7; r22 = value18; break reducibleJoin30; } r22 = value2; break reducibleJoin30; } value19 = environment.__proto__; value20 = value2 != r22; r27 = selectionStartBinding; reducibleLoop31: while (true) { test = WHITESPACE_RE.test; value21 = Reflect.apply(test, WHITESPACE_RE, [text[r27 - 1]]); r14 = value20 ? r22 : value3; if (r27 !== r14) { reducibleJoin34: while (true) { if (value21) { break reducibleJoin34; } r30 = r25; value26 = typeof r27 === 'bigint' ? r27 - 1n : +r27 - 1; env0_2 = value26; r15 = value20 ? r22 : value3; if (value26 >= r15) { r25 = r30; r27 = value26; continue reducibleLoop31; } r12 = value26; r14 = r30; r18 = r23; break reducibleLoop31; } } textBinding = text; slice = textBinding.slice; value22 = Reflect.apply(slice, textBinding, [r27, selectionEnd]); moduleValue2 = require(11017) /* metro dependency 11017: AutocompleteUtils */; getPrefix = moduleValue2.getPrefix; env0_0 = Reflect.apply(getPrefix, moduleValue2, [value22]); moduleValue3 = require(11017) /* metro dependency 11017: AutocompleteUtils */; getQuery = moduleValue3.getQuery; value23 = Reflect.apply(getQuery, moduleValue3, [value22]); env0_1 = value23; if (value2 != value23) { test = WHITESPACE_RE.test; reducibleJoin36: while (true) { if (Reflect.apply(test, WHITESPACE_RE, [value23])) { r12 = r27; r14 = r25; r18 = value23; break reducibleLoop31; } break reducibleJoin36; } } Object = global.Object; keys = Object.keys; value24 = Reflect.apply(keys, Object, [env0_19]); find = value24.find; value25 = Reflect.apply(find, value24, [_fun90845]); if (value2 != value25) { r12 = r27; r14 = value25; r18 = value23; r32 = value24; break reducibleLoop31; } r23 = value23; r30 = value25; r32 = value24; value26 = typeof r27 === 'bigint' ? r27 - 1n : +r27 - 1; env0_2 = value26; r15 = value20 ? r22 : value3; if (value26 >= r15) { r25 = r30; r27 = value26; continue reducibleLoop31; } r12 = value26; r14 = r30; r18 = r23; break reducibleLoop31; } SLASHES = AutocompleteTypes.SLASHES; reducibleJoin42: while (true) { if (r14 !== SLASHES) { r15 = r18; break reducibleJoin42; } value = require(11857) /* metro dependency 11857: ChatInputCommandOptionParser */; getTextBeforeFirstOption = value.getTextBeforeFirstOption; value27 = ''; r7 = value2 != r18 ? r18 : value27; text2 = Reflect.apply(getTextBeforeFirstOption, value, [r7]).text; env0_1 = text2; r15 = text2; break reducibleJoin42; } object5 = {query: r15, autocompleteType: r14, autocompleteSelectionStart: r12}; object6 = {}; copyDataProperties(object6, r3, r32); object5.queryOptions = object6; return object5; } break reducibleJoin54; } } return {'query': null, 'autocompleteType': null, 'autocompleteSelectionStart': null}; } function _fun90846(a0) { // fn#90846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:5974, offset: 0x020497c8, size: 182 bytes, params: 2, frame: 17 var environment; var binding; var property; var value2; var items3; var items2; var object2; var length; if (autocompleteType == null) { binding = env0_17; value = environment.__proto__; binding(env1_31); } else if (query != null) { binding = env0_19; property = binding[autocompleteType]; value2 = property.queryResults(query, queryOptions, a0); items3 = []; items2 = []; value2.forEach(_fun90847); binding = env0_17; object2 = {}; length = value2.length; object2.resultCount = length; object2.stickerResults = items3; object2.nonStickerResults = items2; length = items3.length; object2.hasStickerResults = length > 0; length = items2.length; object2.hasNonStickerResults = length > 0; binding(object2); } else { binding = env0_17; value = environment.__proto__; binding(env1_31); } } function _fun90848() { // fn#90848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6269, offset: 0x020498bf, size: 153 bytes, params: 1, frame: 15 var environment; var value; const autocompleteTypeBinding = autocompleteType; const value2 = null; const r4 = value2 != autocompleteTypeBinding ? value2 == env0_19 ? undefined : env0_19[autocompleteType].stores : value2; if (value2 != r4) { value = environment.__proto__; new (require(566) /* metro dependency 566: flux */).BatchedStoreListener(r4, _fun90849).attach('AutocompleteWrapper'); return _fun90850; } } function _fun90851() { // fn#90851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6475, offset: 0x0204996a, size: 18 bytes, params: 1, frame: 11 env0_31(true); } function _fun90852() { // fn#90852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6517, offset: 0x0204997c, size: 54 bytes, params: 1, frame: 12 const nonStickerResultsBinding = nonStickerResults; return {numStickerResults: stickerResults.length, numEmojiResults: nonStickerResultsBinding.filter(function({type}) { return type === AutoCompleteResultTypes.EMOJI; }).length}; } function _fun90854() { // fn#90854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6629, offset: 0x020499cd, size: 103 bytes, params: 1, frame: 14 var r0; var keyboardTypeBinding; var value; const focusedBinding = focused; const r2 = focusedBinding ? resultCount === 0 && !isSlashAutocompleteType(autocompleteType) : !focusedBinding; if (r2) { r0 = !r2; } else { keyboardTypeBinding = keyboardType; value = environment.__proto__; value = keyboardTypeBinding === (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.SYSTEM; r0 = value; } return r0; } function _fun90855() { // fn#90855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6755, offset: 0x02049a34, size: 148 bytes, params: 1, frame: 18 var value; const current = env0_34.current; const binding = env0_34; const isSlashAutocompleteType2 = isSlashAutocompleteType(autocompleteType); if (current) { binding.current = isSlashAutocompleteType2 || activeCommand != null; } else { binding.current = isSlashAutocompleteType2 || activeCommand != null; if (env0_34.current) { value = require(4863) /* metro dependency 4863: AppAnalyticsUtils */; value.trackWithMetadata(AnalyticEvents.APPLICATION_COMMAND_TOP_OF_FUNNEL, {location: 'slash_ui'}); } } } function _fun90856() { // fn#90856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6990, offset: 0x02049ac8, size: 102 bytes, params: 1, frame: 16 var value3; var moduleValue; const r1 = env0_33 || activeCommand != null; if (onChangeAutoCompleteVisibility != null) { onChangeAutoCompleteVisibility(r1); } if (r1) { value3 = environment.__proto__; moduleValue = require(11859) /* metro dependency 11859: ChannelAutocompleteAnalytics */; moduleValue.iOSTrackAutocompleteOpen(autocompleteType, channel, env0_32()); } } function _fun90857() { // fn#90857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:7293, offset: 0x02049b2e, size: 79 bytes, params: 1, frame: 13 const r3 = stickerResults.length > 0 ? env1_27 : autocompleteType !== AutocompleteTypes.EMOJIS_AND_STICKERS ? 200 : 242; const Math = global.Math; return Math.min(env0_35, r3); } function _fun90858() { // fn#90858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:7459, offset: 0x02049b7d, size: 281 bytes, params: 1, frame: 20 var r4; var r5; var r3; var autocompletesHeight; const autocompleteTypeBinding = autocompleteType; const EMOJIS_AND_STICKERS = AutocompleteTypes.EMOJIS_AND_STICKERS; if (autocompleteTypeBinding === EMOJIS_AND_STICKERS) { autocompletesHeight = getAutocompletesHeight(nonStickerResults.length, autocompleteType, env0_18, env0_10); r5 = hasNonStickerResults ? autocompletesHeight + 42 : autocompletesHeight; r3 = hasStickerResults ? r5 + (42 + (require(11855) /* metro dependency 11855: Autocomplete */).AUTOCOMPLETE_STICKER_NODE_SIZE + 12) : r5; r5 = hasStickerResults && hasNonStickerResults; r4 = r5 ? r3 + hairlineWidth : r3; } else { r4 = isSlashAutocompleteType(autocompleteType) ? env0_37 ?? 0 : autocompleteType != null ? getAutocompletesHeight(resultCount, autocompleteType, env0_18, env0_10) : 0; } const Math = global.Math; return Math.min(env0_33 ? r4 : 0, env0_36); } function _fun90859() { // fn#90859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:8508, offset: 0x02049c96, size: 71 bytes, params: 1, frame: 12 let value = environment.__proto__; value = require(477) /* metro dependency 477: PlatformUtils */; value = value.isIOS(); return value && (env0_43 || chatInputFloating) ? styles.autocompletePositionRelative : null; } function _fun90860() { // fn#90860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:8632, offset: 0x02049cdd, size: 27 bytes, params: 1, frame: 3 return result ? {marginTop: env0_41} : undefined; } function _fun90861(a0, a1, a2) { // fn#90861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:8707, offset: 0x02049cf8, size: 284 bytes, params: 4, frame: 20 var value2; var moduleValue; var value4; var current; var applicationCommandManager; var STICKER; let type = a0.type; const EMOJI_PREMIUM_UPSELL = AutoCompleteResultTypes.EMOJI_PREMIUM_UPSELL; if (type !== EMOJI_PREMIUM_UPSELL) { value2 = undefined; moduleValue = require(11017) /* metro dependency 11017: AutocompleteUtils */; value4 = moduleValue.getAutocompleteResultText(a0, channel); current = chatInputRef.current; applicationCommandManager = current.getApplicationCommandManager(); if (!(applicationCommandManager == null ? value2 : applicationCommandManager.setAutoCompleteResult(channel.id, value4, a2, a0))) { type = a0.type; STICKER = AutoCompleteResultTypes.STICKER; current = chatInputRef.current; current.insertText(value4, a1, type !== STICKER); type = a0.type; STICKER = AutoCompleteResultTypes.STICKER; if (type === STICKER) { current = chatInputRef.current; current.handleSelectSticker(a0.sticker); } } } else { (importDefault(7882) /* metro dependency 7882: PremiumUpsellUtils */).handleShowUpsellAlert({initialUpsellKey: UpsellTypes.EMOJI_AUTOCOMPLETE, analyticsLocations: analyticsLocations}); } } function _fun90862(a0) { // fn#90862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:9148, offset: 0x02049e14, size: 215 bytes, params: 2, frame: 18 var property; var id; var lastValidationResult; var value; const applicationCommandManager = chatInputRef.current.getApplicationCommandManager(); const type = a0.type; const value4 = undefined; const ApplicationCommandOptionType = (require(1909) /* metro dependency 1909: Server */).ApplicationCommandOptionType; const ATTACHMENT = ApplicationCommandOptionType.ATTACHMENT; if (type === ATTACHMENT) { property = optionStates[a0.name]; id = channel.id; lastValidationResult = property.lastValidationResult; if (lastValidationResult == null) { if (applicationCommandManager != null) { applicationCommandManager.insertOrJumpCommandOption(a0); } } else if (lastValidationResult.success) { value = require(11752) /* metro dependency 11752: ApplicationCommandUtils */; value.openCommandAttachmentPreview(applicationCommandManager, id, a0.name); } else if (applicationCommandManager != null) { applicationCommandManager.insertOrJumpCommandOption(a0); } } else if (applicationCommandManager != null) { applicationCommandManager.insertOrJumpCommandOption(a0, applicationCommandManager == null ? value4 : applicationCommandManager.props.text.length); } return value4; } function _fun90863(a0) { // fn#90863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:9538, offset: 0x02049eeb, size: 152 bytes, params: 2, frame: 22 let value = environment.__proto__; const channelAutocompleteAnalyticsModule = require(11859) /* metro dependency 11859: ChannelAutocompleteAnalytics */; const iOSTrackAutocompleteSelect = channelAutocompleteAnalyticsModule.iOSTrackAutocompleteSelect; const autocompleteTypeBinding = autocompleteType; const channelBinding = channel; const object2 = {}; let type = a0.type; object2.selectionType = type; type = a0.type; const STICKER = AutoCompleteResultTypes.STICKER; object2.stickerId = type !== STICKER ? null : a0.sticker.id; copyDataProperties(object2, env0_32(), undefined); Reflect.apply(iOSTrackAutocompleteSelect, channelAutocompleteAnalyticsModule, [autocompleteTypeBinding, channelBinding, object2]); const binding = env0_44; const autocompleteSelectionStartBinding = autocompleteSelectionStart; value = 0; binding(a0, value != autocompleteSelectionStartBinding ? autocompleteSelectionStart : value, showOptionValuesPicker); } function _fun90864({item}) { // fn#90864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:9774, offset: 0x02049f83, size: 979 bytes, params: 2, frame: 22 var environment; var binding; var sticker; var id; var value3; var Sticker; const type = item.type; const value = environment.__proto__; const USER = AutoCompleteResultTypes.USER; if (USER === type) { const User = (importDefault(11855) /* metro dependency 11855: Autocomplete */).User; return ( ); } const GLOBAL = AutoCompleteResultTypes.GLOBAL; if (GLOBAL === type) { const Global = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Global; return ; } const ROLE = AutoCompleteResultTypes.ROLE; if (ROLE === type) { const Role = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Role; return ( ); } const CHANNEL = AutoCompleteResultTypes.CHANNEL; if (CHANNEL === type) { const Channel = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Channel; return ; } const EMOJI = AutoCompleteResultTypes.EMOJI; if (EMOJI === type) { const Emoji = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Emoji; return ; } const EMOJI_PREMIUM_UPSELL = AutoCompleteResultTypes.EMOJI_PREMIUM_UPSELL; if (EMOJI_PREMIUM_UPSELL === type) { const EmojiPremiumUpsell = (importDefault(11855) /* metro dependency 11855: Autocomplete */).EmojiPremiumUpsell; return ; } const CHOICE = AutoCompleteResultTypes.CHOICE; if (CHOICE === type) { const Choice = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Choice; return ; } const CHOICE_LOADING = AutoCompleteResultTypes.CHOICE_LOADING; if (CHOICE_LOADING === type) { const ChoiceLoading = (importDefault(11855) /* metro dependency 11855: Autocomplete */).ChoiceLoading; return ; } const STICKER = AutoCompleteResultTypes.STICKER; if (STICKER === type) { binding = env0_46; sticker = item.sticker; id = sticker.id; value3 = binding === id; Sticker = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Sticker; sticker = item.sticker; id = sticker.id; return ( ); } const LABEL = AutoCompleteResultTypes.LABEL; if (LABEL === type) { const Label = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Label; return