Files
discord-decomp/sources/modules/autocompleter/Autocompleter.tsx
T
2026-07-28 01:06:53 +03:00

896 lines
44 KiB
TypeScript

/* Metro module 7235; source: modules/autocompleter/Autocompleter.tsx; dependencies: [6, 7, 7236, 7237, 1935, 3793, 1878, 6587, 6526, 22, 6591, 7238, 1362, 6592, 4096, 4101, 3855, 1471, 2] */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import RelationshipStore from '../../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import ThreadMemberListStore from '../threads/ThreadMemberListStore.tsx'; /* Metro dependency 7236 */
import LinkRecord from '../../records/LinkRecord.tsx'; /* Metro dependency 7237 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as GuildChannelStoreModule from '../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */
import * as AutocompleterConstantsModule from './AutocompleterConstants.tsx'; /* Metro dependency 6587 */
function _fun57999(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:6, offset: 0x016bc9c2, size: 294 bytes, params: 8, frame: 20
const env0_0 = require;
const _arrayLikeToArray_58002 = 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;
};
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
Object = global.Object;
const env0_11 = Object.freeze({});
let value = _fun58004();
(FileImportTrackerModule).fileFinishedImporting('modules/autocompleter/Autocompleter.tsx');
exports.default = value;
function _createForOfIteratorHelperLoose_58000(a0, a1) { // fn#58000, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:232, offset: 0x016bcae8, 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 _fun58001;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_58002(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_58002(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_58002(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun58001;
}
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 _fun58001() { // fn#58001, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:803, 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 getAutocompleterBoosterMap(a0, a1) { // fn#58003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:1166, offset: 0x016bcc5a, size: 57 bytes, params: 3, frame: 12
var r0;
var value;
if (a1.frecencyBoosters) {
value = require(6526) /* metro dependency 6526: AutocompleteUtils */;
value = value.getBoosterMap(a0);
r0 = value;
} else {
r0 = {};
}
return r0;
}
function _fun58004() { // fn#58004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:1268, offset: 0x016bcc93, size: 569 bytes, params: 1, frame: 15
return CreateClass(Autocompleter, [{key: 'createSearchContext', value: value_58009}, {key: 'setLimit',
value: value_58010}, {key: 'setRefetchForSingleCategoryLimit', value: function(a0) {
this._refetchForSingleCategoryLimit = a0;
}}, {key: 'setResultTypes', value: value_58012}, {key: '_include', value: function(a0) {
return this.resultTypes == null || this.resultTypes.has(a0);
}}, {key: '_isAsyncSearch', value: value_58014}, {key: 'setOptions', value: value_58015},
{key: '_willRefetchIfSingleCategoryResults', value: value_58018}, {key: 'refetchIfSingleCategoryResults',
value: value_58020}, {key: 'search', value: value_58021}, {key: 'clear', value: function() {
var userSearchContext = this.userSearchContext;
if (userSearchContext != null) {
userSearchContext.clearQuery();
}
this.results = [];
this._userResults = [];
this._groupDMResults = [];
this._textChannelResults = [];
this._voiceChannelResults = [];
this._guildResults = [];
this._applicationResults = [];
this._linkResults = [];
this._inAppNavigations = [];
}}, {key: 'clean', value: function() {
this.clear();
this.destroy();
this.query = '';
this.updateAllResults();
}}, {key: 'pause', value: function() {
var userSearchContext = this.userSearchContext;
if (!(userSearchContext == null || userSearchContext.unsubscribe == null)) {
userSearchContext.unsubscribe();
}
}}, {key: 'resume', value: function() {
var userSearchContext = this.userSearchContext;
if (!(userSearchContext == null || userSearchContext.subscribe == null)) {
userSearchContext.subscribe();
}
}}, {key: 'destroy', value: function() {
var userSearchContext = this.userSearchContext;
if (userSearchContext != null) {
userSearchContext.destroy();
this.userSearchContext = null;
}
}}, {key: 'queryTextChannels', value: value_58028}, {key: 'queryVoiceChannels', value: value_58030},
{key: 'queryGuilds', value: value_58031}, {key: 'queryUsers', value: value_58033}, {key: 'queryGroupDMs',
value: value_58034}, {key: 'queryApplications', value: value_58036}, {key: 'queryLink', value: value_58037},
{key: 'queryInAppNavigations', value: value_58038}]);
function Autocompleter(a0, a1) { // fn#58005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:1289, offset: 0x016bcecc, size: 273 bytes, params: 3, frame: 18
var environment;
let value = a2;
const value2 = a3;
const value3 = a4;
const r2 = value !== undefined ? value : 100;
const r6 = value2 !== undefined ? value2 : env1_11;
const r1 = value3 !== undefined ? value3 : 0;
value = environment.__proto__;
env1_3(this, Autocompleter);
this.query = '';
this.options = env1_11;
this.results = [];
this._userResults = [];
this._groupDMResults = [];
this._textChannelResults = [];
this._voiceChannelResults = [];
this._guildResults = [];
this._applicationResults = [];
this._linkResults = [];
this._inAppNavigations = [];
this._userBlacklist = null;
this._refetched = false;
this.parseUserResults = parseUserResults;
this.updateAllResults = updateAllResults;
this.onResultsChange = a0;
this.setOptions(r6, true);
this._limit = r2;
this._refetchForSingleCategoryLimit = r1;
this.createSearchContext();
this.setResultTypes(a1);
function parseUserResults({results}) { // fn#58006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:1663, owner: Autocompleter.parseUserResults, offset: 0x016bcfdd, size: 348 bytes, params: 2, frame: 22
var r2;
var r10;
var _createForOfIteratorHelperLoose_58000Binding;
var value3;
var value4;
var value5;
var done;
var value6;
var id;
var score;
var comparator;
var user;
var _userResults;
var push;
var object;
var moduleValue;
var value8;
var value9;
let binding = env0_0;
const _include = binding._include;
let USER = AutocompleterResultTypes.USER;
if (Reflect.apply(_include, binding, [USER])) {
binding = env0_0;
binding._userResults = [];
_createForOfIteratorHelperLoose_58000Binding = _createForOfIteratorHelperLoose_58000;
value3 = undefined;
value4 = _createForOfIteratorHelperLoose_58000Binding(results);
value5 = value4();
done = value5.done;
if (!done) {
r2 = value5;
while (true) {
value6 = r2.value;
id = value6.id;
score = value6.score;
comparator = value6.comparator;
user = UserStore.getUser(id);
if (user != null) {
_userResults = env0_0._userResults;
push = _userResults.push;
object = {};
USER = AutocompleterResultTypes.USER;
object.type = USER;
object.record = user;
moduleValue = require(6526) /* metro dependency 6526: AutocompleteUtils */;
object.score = moduleValue.calculateScore(score);
if (comparator != null) {
r10 = comparator;
continue;
}
r10 = value3;
continue;
object.comparator = r10;
Reflect.apply(push, _userResults, [object]);
}
value8 = value4();
done = value8.done;
if (done) {
break;
}
r2 = value8;
continue;
}
}
binding = env0_0;
value9 = binding._willRefetchIfSingleCategoryResults();
if (value9) {
r2 = !value9;
} else {
binding = env0_0;
r2 = binding._userResults.length > binding._limit;
}
if (r2) {
binding = env0_0;
binding._userResults.length = binding._limit;
}
if (value9) {
env0_0.refetchIfSingleCategoryResults();
}
binding = env0_0;
binding.updateAllResults();
}
}
function updateAllResults() { // fn#58007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:2186, owner: Autocompleter.updateAllResults, offset: 0x016bd139, size: 235 bytes, params: 1, frame: 18
var environment;
const clearTimeout = global.clearTimeout;
const binding = env0_0;
clearTimeout(binding._asyncTimeout);
let value = environment.__proto__.__proto__;
value = importDefault(22) /* metro dependency 22 */;
const _userResults = binding._userResults;
const items2 = [];
arraySpread(items2, binding._inAppNavigations, arraySpread(items2, binding._linkResults, arraySpread(items2,
binding._guildResults, arraySpread(items2, binding._voiceChannelResults, arraySpread(items2,
binding._textChannelResults, arraySpread(items2, binding._groupDMResults, arraySpread(items2, _userResults, 0,
undefined), undefined), undefined), undefined), undefined), undefined), undefined);
value = value(items2);
value = value.uniqBy(function(a0) {
return '' + a0.type + '-' + a0.record.id;
});
value = value.sort(importDefault(6591) /* metro dependency 6591: sortByMatchScore */);
binding.results = value.value();
binding.onResultsChange(binding.results, binding.query);
}
}
function value_58009() { // fn#58009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:2712, offset: 0x016bd255, size: 74 bytes, params: 1, frame: 14
var value;
const userSearchContext = this.userSearchContext;
if (userSearchContext == null) {
value = environment.__proto__;
value = importDefault(7238) /* metro dependency 7238: UserSearchManager */;
this.userSearchContext = value.getUserSearchContext(this.parseUserResults, this._limit);
}
}
function value_58012(a0) { // fn#58012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:3751, offset: 0x016bd40e, size: 395 bytes, params: 2, frame: 13
let value = null;
this.resultTypes = value != a0 ? new global.Set(a0) : value;
let _include = this._include;
value = environment.__proto__;
const USER = AutocompleterResultTypes.USER;
this._userResults = Reflect.apply(_include, this, [USER]) ? this._userResults : [];
_include = this._include;
const GROUP_DM = AutocompleterResultTypes.GROUP_DM;
this._groupDMResults = Reflect.apply(_include, this, [GROUP_DM]) ? this._groupDMResults : [];
_include = this._include;
const TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
this._textChannelResults = Reflect.apply(_include, this, [TEXT_CHANNEL]) ? this._textChannelResults : [];
_include = this._include;
const VOICE_CHANNEL = AutocompleterResultTypes.VOICE_CHANNEL;
this._voiceChannelResults = Reflect.apply(_include, this, [VOICE_CHANNEL]) ? this._voiceChannelResults : [];
_include = this._include;
const GUILD = AutocompleterResultTypes.GUILD;
this._guildResults = Reflect.apply(_include, this, [GUILD]) ? this._guildResults : [];
_include = this._include;
const APPLICATION = AutocompleterResultTypes.APPLICATION;
this._applicationResults = Reflect.apply(_include, this, [APPLICATION]) ? this._applicationResults : [];
_include = this._include;
const LINK = AutocompleterResultTypes.LINK;
this._linkResults = Reflect.apply(_include, this, [LINK]) ? this._linkResults : [];
_include = this._include;
const IN_APP_NAVIGATION = AutocompleterResultTypes.IN_APP_NAVIGATION;
this._inAppNavigations = Reflect.apply(_include, this, [IN_APP_NAVIGATION]) ? this._inAppNavigations : [];
}
function value_58014() { // fn#58014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:4517, offset: 0x016bd5c0, size: 73 bytes, params: 1, frame: 14
var r0;
var options;
const _include = this._include;
let value = environment.__proto__;
const USER = AutocompleterResultTypes.USER;
value = Reflect.apply(_include, this, [USER]);
if (value) {
options = this.options;
value = undefined;
value = (options == null || options.userFilters == null ? value : options.userFilters.thread) != null;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function value_58015(a0) { // fn#58015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:4662, offset: 0x016bd609, size: 150 bytes, params: 2, frame: 16
var r3;
var object;
var Array;
let value = a0;
let value2 = a1;
if (value2 !== undefined ? value2 : false) {
object = {};
copyDataProperties(object, value, copyDataProperties(object, this.options, undefined));
r3 = object;
} else {
r3 = value;
}
this.options = r3;
if (this.options.blacklist != null) {
Array = global.Array;
value = Array.from(this.options.blacklist);
value = value.map(function(a0) {
var value = a0.startsWith('user:');
var value2 = '';
return value ? a0.replace('user:', value2) : value2;
});
this._userBlacklist = value.filter(_fun58017);
} else {
this._userBlacklist = null;
}
}
function value_58018() { // fn#58018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:4956, offset: 0x016bd6ca, size: 190 bytes, params: 1, frame: 13
var r1;
var items2;
let r0 = this._refetched || this._refetchForSingleCategoryLimit <= 5;
if (r0) {
r0 = !r0;
} else {
r1 = this.options.voiceChannelGuildFilter == null && this.options.userFilters == null;
if (r1) {
items2 = [this._userResults];
items2[1] = this._groupDMResults;
items2[2] = this._textChannelResults;
items2[3] = this._voiceChannelResults;
items2[4] = this._guildResults;
items2[5] = this._applicationResults;
items2[6] = this._linkResults;
items2[7] = this._inAppNavigations;
r1 = items2.filter(function(a0) {
return a0.length > 0;
}).length === 1;
}
r0 = r1;
}
return r0;
}
function value_58021(a0, a1) { // fn#58021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:6374, offset: 0x016bd90f, size: 173 bytes, params: 3, frame: 14
var environment;
var r3;
const env0_1 = a0;
const env0_2 = a1;
this.query = a0;
this._refetched = false;
let value = a0.trim();
if (value === '') {
this.clear();
this.updateAllResults();
} else {
if (this.options.frecencyBoosters) {
value = environment.__proto__;
value = (require(1362) /* metro dependency 1362: UserSettingsProtoActionCreators */).FrecencyUserSettingsActionCreators.loadIfNecessary();
r3 = value;
} else {
r3 = global.Promise.resolve();
}
r3.finally(_fun58022);
}
function _fun58022() { // fn#58022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:6608, offset: 0x016bd9bc, size: 299 bytes, params: 1, frame: 16
var _include;
var value2;
var clearTimeout;
let binding = env0_0;
const queryUsers = binding.queryUsers;
const binding2 = env0_1;
Reflect.apply(queryUsers, binding, [binding2, require, binding._limit]);
binding._groupDMResults = binding.queryGroupDMs(binding2, binding._limit);
binding._textChannelResults = binding.queryTextChannels(binding2, binding._limit);
binding._voiceChannelResults = binding.queryVoiceChannels(binding2, binding._limit);
binding._guildResults = binding.queryGuilds(binding2, binding._limit);
binding._applicationResults = binding.queryApplications(binding2, binding._limit);
binding._inAppNavigations = binding.queryInAppNavigations(binding2, binding._limit);
if (binding._isAsyncSearch()) {
clearTimeout = global.clearTimeout;
binding = env0_0;
clearTimeout(binding._asyncTimeout);
binding._asyncTimeout = global.setTimeout(binding.updateAllResults, 300);
} else {
binding = env0_0;
_include = binding._include;
value2 = environment.__proto__.__proto__;
if (!Reflect.apply(_include, binding, [AutocompleterResultTypes.USER])) {
env0_0.updateAllResults();
}
}
}
}
function value_58028(a0, a1) { // fn#58028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:7932, offset: 0x016bdc0a, size: 177 bytes, params: 3, frame: 17
var environment;
var r4;
var getAutocompleterBoosterMapBinding;
var options;
var value2;
var autocompleterBoosterMapBinding;
var allowSnowflake;
const _include = this._include;
let value = environment.__proto__;
let TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
if (Reflect.apply(_include, this, [TEXT_CHANNEL])) {
getAutocompleterBoosterMapBinding = getAutocompleterBoosterMap;
TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
options = this.options;
value2 = undefined;
autocompleterBoosterMapBinding = getAutocompleterBoosterMapBinding(TEXT_CHANNEL, options);
options = this.options;
allowSnowflake = options.allowSnowflake;
r4 = options.blacklist != null ? function(a0) {
return !blacklist.has('channel:' + a0.id);
} : value2;
value = importDefault(6526) /* metro dependency 6526: AutocompleteUtils */;
return value.queryChannels({query: a0, guildId: null, limit: a1, fuzzy: true, allowSnowflake: allowSnowflake,
filter: r4, boosters: autocompleterBoosterMapBinding});
}
return [];
}
function value_58030(a0, a1) { // fn#58030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:8286, offset: 0x016bdcf1, size: 159 bytes, params: 3, frame: 17
var options;
var allowSnowflake;
var voiceChannelGuildFilter;
var getAutocompleterBoosterMapBinding;
const _include = this._include;
let VOICE_CHANNEL = AutocompleterResultTypes.VOICE_CHANNEL;
if (Reflect.apply(_include, this, [VOICE_CHANNEL])) {
options = this.options;
allowSnowflake = options.allowSnowflake;
voiceChannelGuildFilter = options.voiceChannelGuildFilter;
getAutocompleterBoosterMapBinding = getAutocompleterBoosterMap;
VOICE_CHANNEL = AutocompleterResultTypes.VOICE_CHANNEL;
options = this.options;
return (importDefault(6526) /* metro dependency 6526: AutocompleteUtils */).queryChannels({query: a0,
guildId: voiceChannelGuildFilter, limit: a1, fuzzy: true, type: GUILD_VOCAL_CHANNELS_KEY,
allowSnowflake: allowSnowflake, boosters: getAutocompleterBoosterMapBinding(VOICE_CHANNEL, options)});
}
return [];
}
function value_58031(a0, a1) { // fn#58031, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:8598, offset: 0x016bdd90, size: 173 bytes, params: 3, frame: 16
var environment;
var r5;
var getAutocompleterBoosterMapBinding;
var options;
var value2;
var autocompleterBoosterMapBinding;
var allowSnowflake;
const _include = this._include;
let value = environment.__proto__;
let GUILD = AutocompleterResultTypes.GUILD;
if (Reflect.apply(_include, this, [GUILD])) {
getAutocompleterBoosterMapBinding = getAutocompleterBoosterMap;
GUILD = AutocompleterResultTypes.GUILD;
options = this.options;
value2 = undefined;
autocompleterBoosterMapBinding = getAutocompleterBoosterMapBinding(GUILD, options);
options = this.options;
allowSnowflake = options.allowSnowflake;
r5 = options.blacklist != null ? function(a0) {
return !blacklist.has('guild:' + a0.id);
} : value2;
value = importDefault(6526) /* metro dependency 6526: AutocompleteUtils */;
return value.queryGuilds({query: a0, limit: a1, fuzzy: true, filter: r5,
boosters: autocompleterBoosterMapBinding,
allowSnowflake: allowSnowflake});
}
return [];
}
function value_58033(a0, a1, a2) { // fn#58033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:8913, offset: 0x016bde73, size: 586 bytes, params: 4, frame: 47
var r24;
var r15;
var r7;
var r30;
var r32;
var displayName;
var _include;
var value;
var USER;
var options;
var allowSnowflake;
var userFilters;
var getAutocompleterBoosterMapBinding;
var value2;
var autocompleterBoosterMapBinding;
var threadMemberListStoreBinding;
var value4;
var items2;
var propertyName;
var propertyName2;
var property;
var _createForOfIteratorHelperLoose_58000Binding;
var userIds;
var value5;
var value6;
var done;
var value7;
var value8;
var friends;
var relationshipStoreBinding;
var isFriend;
var value9;
var _userBlacklist;
var value10;
var value11;
var push;
var usersById;
var property2;
var value12;
const userSearchContext = this.userSearchContext;
if (userSearchContext != null) {
_include = this._include;
value = environment.__proto__;
USER = AutocompleterResultTypes.USER;
if (Reflect.apply(_include, this, [USER])) {
options = this.options;
allowSnowflake = options.allowSnowflake;
userFilters = options.userFilters;
getAutocompleterBoosterMapBinding = getAutocompleterBoosterMap;
USER = AutocompleterResultTypes.USER;
options = this.options;
value2 = undefined;
autocompleterBoosterMapBinding = getAutocompleterBoosterMapBinding(USER, options);
if ((userFilters == null ? value2 : userFilters.thread) == null) {
if (value2 !== a1) {
(importDefault(6592) /* metro dependency 6592: GuildUtils */).requestMembers(a1, a0, 100);
}
userSearchContext.setLimit(a2);
userSearchContext.setQuery({query: a0, filters: userFilters, blacklist: this._userBlacklist,
boosters: autocompleterBoosterMapBinding});
} else {
threadMemberListStoreBinding = ThreadMemberListStore;
value4 = threadMemberListStoreBinding.getMemberListSections(userFilters.thread);
items2 = [];
for (propertyName in value4) {
property = value4[propertyName];
_createForOfIteratorHelperLoose_58000Binding = _createForOfIteratorHelperLoose_58000;
userIds = property.userIds;
value5 = _createForOfIteratorHelperLoose_58000Binding(userIds);
value6 = value5();
done = value6.done;
if (done) {
r24 = propertyName2;
continue;
}
r15 = value6;
while (true) {
value7 = r15.value;
value8 = userFilters != null;
if (value8) {
friends = userFilters.friends;
r7 = friends;
} else {
r7 = value8;
}
if (!r7) {
continue;
}
relationshipStoreBinding = RelationshipStore;
isFriend = relationshipStoreBinding.isFriend;
value9 = !Reflect.apply(isFriend, relationshipStoreBinding, [value7]);
r7 = value9;
if (r7) {
continue;
}
_userBlacklist = this._userBlacklist;
if (_userBlacklist == null) {
r30 = value2;
continue;
}
value10 = _userBlacklist.includes(value7);
r30 = value10;
value11 = r30 != null;
if (value11) {
r32 = r30;
continue;
}
r32 = value11;
continue;
if (r32) {
continue;
}
push = items2.push;
usersById = property.usersById;
property2 = usersById[value7];
if (property2 == null) {
displayName = value2;
continue;
}
displayName = property2.displayName;
Reflect.apply(push, items2, [{userId: value7, nick: displayName}]);
value12 = value5();
done = value12.done;
if (done) {
r24 = propertyName2;
break;
}
r15 = value12;
continue;
}
}
value = importDefault(6526) /* metro dependency 6526: AutocompleteUtils */;
this._userResults = value.queryUsers({query: a0, users: items2, limit: a2,
boosters: autocompleterBoosterMapBinding,
allowSnowflake: allowSnowflake});
}
}
}
}
function value_58034(a0, a1) { // fn#58034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:9723, offset: 0x016be0bd, size: 162 bytes, params: 3, frame: 16
var environment;
var r4;
var options;
var blacklist;
var getAutocompleterBoosterMapBinding;
var value2;
var autocompleterBoosterMapBinding;
const _include = this._include;
let value = environment.__proto__;
let GROUP_DM = AutocompleterResultTypes.GROUP_DM;
if (Reflect.apply(_include, this, [GROUP_DM])) {
options = this.options;
blacklist = options.blacklist;
getAutocompleterBoosterMapBinding = getAutocompleterBoosterMap;
GROUP_DM = AutocompleterResultTypes.GROUP_DM;
options = this.options;
value2 = undefined;
autocompleterBoosterMapBinding = getAutocompleterBoosterMapBinding(GROUP_DM, options);
r4 = blacklist != null ? function(a0) {
return !blacklist.has('channel:' + a0.id);
} : value2;
value = importDefault(6526) /* metro dependency 6526: AutocompleteUtils */;
return value.queryGroupDMs({query: a0, limit: a1, fuzzy: true, filter: r4,
boosters: autocompleterBoosterMapBinding});
}
return [];
}
function value_58036(a0, a1) { // fn#58036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:10015, offset: 0x016be15f, size: 95 bytes, params: 3, frame: 13
var r0;
const _include = this._include;
let value = environment.__proto__;
const APPLICATION = AutocompleterResultTypes.APPLICATION;
if (Reflect.apply(_include, this, [APPLICATION])) {
value = importDefault(6526) /* metro dependency 6526: AutocompleteUtils */;
value = value.queryApplications({query: a0, limit: a1, fuzzy: true});
r0 = value;
} else {
r0 = [];
}
return r0;
}
function value_58037(a0) { // fn#58037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:10147, offset: 0x016be1be, size: 480 bytes, params: 2, frame: 24
var items2;
var codedLink;
var URL;
var prototype;
var value4;
var uRL;
var value5;
var pathname;
var hostname;
var object;
var linkRecordBinding;
var error;
let value = undefined;
const _include = this._include;
const LINK = AutocompleterResultTypes.LINK;
if (Reflect.apply(_include, this, [LINK])) {
codedLink = (require(4096) /* metro dependency 4096: findCodedLinks */).findCodedLink(a0);
if ((codedLink == null ? value : codedLink.type) === (require(4101) /* metro dependency 4101: CodedLink */).CodedLinkType.INVITE) {
linkRecordBinding = LinkRecord;
return [{type: AutocompleterResultTypes.LINK, record: linkRecordBinding.fromInviteCode(codedLink.code),
score: 1}];
}
try {
URL = global.URL;
prototype = URL.prototype;
value4 = Object.create(prototype, {constructor: {value: URL}});
uRL = new URL((importDefault(3855) /* metro dependency 3855 */).sanitizeUrl(a0));
value5 = uRL instanceof Object ? uRL : value4;
} catch (error) {
return [];
}
pathname = value5.pathname;
hostname = value5.hostname;
if (pathname === null) {
items2 = [];
} else if ((importDefault(1471) /* metro dependency 1471: URLUtils */).isDiscordHostname(value === hostname ? '' : hostname) || global.window.location.host === value5.host) {
value = importDefault(1471) /* metro dependency 1471: URLUtils */;
if (value.isAppRoute(pathname)) {
object = {};
object.type = AutocompleterResultTypes.LINK;
object.record = LinkRecord.fromPath(pathname);
object.score = 1;
items2 = [object];
} else {
items2 = [];
}
} else {
items2 = [];
}
return items2;
}
return [];
}
function value_58038(a0, a1) { // fn#58038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:10663, offset: 0x016be39e, size: 95 bytes, params: 3, frame: 13
var r0;
const _include = this._include;
let value = environment.__proto__;
const IN_APP_NAVIGATION = AutocompleterResultTypes.IN_APP_NAVIGATION;
if (Reflect.apply(_include, this, [IN_APP_NAVIGATION])) {
value = importDefault(6526) /* metro dependency 6526: AutocompleteUtils */;
value = value.queryInAppNavigations({query: a0, limit: a1, fuzzy: true});
r0 = value;
} else {
r0 = [];
}
return r0;
}
}
}
function value_58010(a0) { // fn#58010, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:2867, offset: 0x016bd29f, size: 351 bytes, params: 2, frame: 12
const userSearchContext = this.userSearchContext;
this._limit = a0;
if (userSearchContext != null) {
userSearchContext.setLimit(a0);
}
if (this._userResults.length > this._limit) {
this._userResults.length = this._limit;
}
if (this._groupDMResults.length > this._limit) {
this._groupDMResults.length = this._limit;
}
if (this._textChannelResults.length > this._limit) {
this._textChannelResults.length = this._limit;
}
if (this._voiceChannelResults.length > this._limit) {
this._voiceChannelResults.length = this._limit;
}
if (this._guildResults.length > this._limit) {
this._guildResults.length = this._limit;
}
if (this._applicationResults.length > this._limit) {
this._applicationResults.length = this._limit;
}
if (this._linkResults.length > this._limit) {
this._linkResults.length = this._limit;
}
if (this._inAppNavigations.length > this._limit) {
this._inAppNavigations.length = this._limit;
}
}
function _fun58017(a0) { // fn#58017, offset: 0x00c5f3a9, size: 13 bytes, params: 2, frame: 2
return a0 !== '';
}
function value_58020() { // fn#58020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7413:5369, offset: 0x016bd788, size: 391 bytes, params: 1, frame: 15
var query;
if (this._willRefetchIfSingleCategoryResults()) {
this._refetched = true;
query = this.query;
if (this._userResults.length > 0) {
this.queryUsers(query, null, this._refetchForSingleCategoryLimit);
} else if (this._groupDMResults.length > 0) {
this._groupDMResults = this.queryGroupDMs(query, this._refetchForSingleCategoryLimit);
} else if (this._textChannelResults.length > 0) {
this._textChannelResults = this.queryTextChannels(query, this._refetchForSingleCategoryLimit);
} else if (this._voiceChannelResults.length > 0) {
this._voiceChannelResults = this.queryVoiceChannels(query, this._refetchForSingleCategoryLimit);
} else if (this._guildResults.length > 0) {
this._guildResults = this.queryGuilds(query, this._refetchForSingleCategoryLimit);
} else if (this._applicationResults.length > 0) {
this._applicationResults = this.queryApplications(query, this._refetchForSingleCategoryLimit);
} else if (this._linkResults.length > 0) {
this._linkResults = this.queryLink(query, this._refetchForSingleCategoryLimit);
} else if (this._inAppNavigations.length > 0) {
this._inAppNavigations = this.queryInAppNavigations(query, this._refetchForSingleCategoryLimit);
}
}
}
global.__d(_fun57999, 7235, [6, 7, 7236, 7237, 1935, 3793, 1878, 6587, 6526, 22, 6591, 7238, 1362, 6592, 4096, 4101,
3855, 1471,
2]) /* metro module 7235, dependencies: [6, 7, 7236, 7237, 1935, 3793, 1878, 6587, 6526, 22, 6591, 7238, 1362, 6592, 4096, 4101, 3855, 1471, 2] */;