Files
2026-07-28 01:06:53 +03:00

1004 lines
45 KiB
TypeScript

/* Metro module 7233; source: modules/quickswitcher/QuickSwitcherStore.tsx; dependencies: [6, 7, 15, 17, 18, 5071, 1310, 1226, 1379, 4645, 1935, 1945, 1867, 3784, 4605, 1934, 3969, 4864, 661, 7234, 22, 7242, 6526, 1244, 7243, 1360, 587, 566, 694, 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 PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import AuthenticationStore from '../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import ThemeStore from '../user_settings/ThemeStore.tsx'; /* Metro dependency 1310 */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import SelectedChannelStore from '../../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */
import GuildChannelStore from '../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */
import GuildMemberStore from '../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
import PermissionStore from '../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import SelectedGuildStore from '../../stores/SelectedGuildStore.tsx'; /* Metro dependency 3969 */
import ReadStateStore from '../../stores/ReadStateStore.tsx'; /* Metro dependency 4605 */
import DraftStore from '../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import UserGuildSettingsStore from '../../stores/UserGuildSettingsStore.tsx'; /* Metro dependency 4864 */
import ActiveJoinedThreadsStore from '../threads/ActiveJoinedThreadsStore.tsx'; /* Metro dependency 5071 */
import CreateAutocompleterResultForChannelId from '../autocompleter/createAutocompleterResultForChannelId.tsx'; /* Metro dependency 7242 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as StorageModule from '../../external/discord_common/js/packages/storage/Storage.tsx'; /* Metro dependency 587 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as GuildChannelStoreModule from '../../stores/GuildChannelStore.tsx'; /* Metro dependency 1935 */
import * as DraftStoreModule from '../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import * as AutocompleterModule from '../autocompleter/index.tsx'; /* Metro dependency 7234 */
function _fun57955(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:6, offset: 0x016bad4a, size: 949 bytes, params: 8, frame: 24
const env0_0 = require;
const _arrayLikeToArray_57961 = 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 closure = function() {
env0_29 = GuildStore.getGuildCount() >= 3 || importDefault(dependencyMap[20]).size(ChannelStore.getMutablePrivateChannels()) >= 20;
env0_34 = [];
};
const generateResultFromId2 = generateResultFromId;
const QUICKSWITCHER_SHOW2 = QUICKSWITCHER_SHOW;
const QUICKSWITCHER_HIDE2 = QUICKSWITCHER_HIDE;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ConstantsModule;
const env0_23 = value.CHANNEL_NOTICE_SHOW_DELAY;
const env0_24 = value.Permissions;
const AutocompleterResultTypes = (AutocompleterModule).AutocompleterResultTypes;
const USER = AutocompleterResultTypes.USER;
items2 = [USER];
const GROUP_DM = AutocompleterResultTypes.GROUP_DM;
items2[1] = GROUP_DM;
const TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
items2[2] = TEXT_CHANNEL;
const GUILD = AutocompleterResultTypes.GUILD;
items2[3] = GUILD;
const APPLICATION = AutocompleterResultTypes.APPLICATION;
items2[4] = APPLICATION;
const LINK = AutocompleterResultTypes.LINK;
items2[5] = LINK;
const IN_APP_NAVIGATION = AutocompleterResultTypes.IN_APP_NAVIGATION;
items2[6] = IN_APP_NAVIGATION;
const env0_31 = [];
let env0_34 = [];
const env0_35 = [];
const PersistedStore = (Flux).PersistedStore;
value = _fun57978(PersistedStore);
value.displayName = 'QuickSwitcherStore';
value.persistKey = 'QuickSwitcherStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: closure,
CONNECTION_OPEN_SUPPLEMENTAL: closure, QUICKSWITCHER_SHOW: QUICKSWITCHER_SHOW2,
SHOW_ACTION_SHEET_QUICK_SWITCHER: QUICKSWITCHER_SHOW2, QUICKSWITCHER_HIDE: QUICKSWITCHER_HIDE2,
OVERLAY_SET_INPUT_LOCKED: QUICKSWITCHER_HIDE2, HIDE_ACTION_SHEET_QUICK_SWITCHER: QUICKSWITCHER_HIDE2,
QUICKSWITCHER_SEARCH: QUICKSWITCHER_SEARCH, QUICKSWITCHER_SELECT: function(a0) {
env0_27 = a0.selectedIndex;
}, QUICKSWITCHER_SWITCH_TO: QUICKSWITCHER_SWITCH_TO, CHANNEL_SELECT: CHANNEL_SELECT_57996});
(FileImportTrackerModule).fileFinishedImporting('modules/quickswitcher/QuickSwitcherStore.tsx');
exports.default = value;
exports.generateResultFromId = generateResultFromId2;
function _isNativeReflectConstruct_57956() { // fn#57956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:442, offset: 0x016bb0ff, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_57956_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_57959(a0, a1) { // fn#57959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:635, offset: 0x016bb15d, 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 _fun57960;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_57961(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_57961(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_57961(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun57960;
}
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 _fun57960() { // fn#57960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:1206, 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 generateResultFromId(a0) { // fn#57963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:2053, offset: 0x016bb32c, size: 72 bytes, params: 2, frame: 13
const value2 = (CreateAutocompleterResultForChannelId)(a0);
const value3 = null;
return value3 == value2 ? value3 : value3 == env0_30 ? value2 : env0_30 !== value2.type ? value3 : value2;
}
function generateInitialResults() { // fn#57964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:2149, offset: 0x016bb374, size: 1748 bytes, params: 1, frame: 33
var r22;
var environment;
var r8;
var r7;
var r13;
var r14;
var r2;
var object;
var value9;
var type;
var value10;
var value11;
var permissionStoreBinding;
var can;
var VIEW_CHANNEL;
var record;
var value12;
var push;
var size;
var add;
var value13;
var moduleValue;
var createHeaderResult;
const intl = require(dependencyMap[23]).intl;
var string;
const t = require(dependencyMap[23]).t;
var value15;
var value16;
var done;
var value17;
var channelId;
var value18;
var filter;
var property;
var value22;
var value23;
var moduleValue2;
var value24;
var value25;
var value26;
var result;
var id;
var value27;
var guildChannelStoreBinding;
var getSelectableChannelIds;
var value28;
var value29;
var map;
var value30;
var isNotNullish;
var value31;
var Object;
var values;
var activeJoinedThreadsStoreBinding;
var getActiveJoinedUnreadThreadsForGuild;
var value32;
var forEach;
var moduleValue3;
var ieCAhD;
var concat;
var value33;
var splice;
var items3;
var defaultImport;
var queryChannels;
var defaultImport2;
let value = environment;
const guildId = SelectedGuildStore.getGuildId();
const value3 = undefined;
const r16 = guildId ?? value3;
const r4 = SelectedChannelStore.getChannelId() ?? value3;
const binding = env0_30;
const AutocompleterResultTypes = require(dependencyMap[19]).AutocompleterResultTypes;
const USER = AutocompleterResultTypes.USER;
if (USER === binding) {
var env0_1 = AuthenticationStore.getId();
value = importDefault(dependencyMap[22]);
value = value.getRecentlyTalked(r4, 100);
return value.filter(_fun57965);
}
const APPLICATION = AutocompleterResultTypes.APPLICATION;
if (APPLICATION === binding) {
return importDefault(dependencyMap[22]).queryApplications({'query': '', 'limit': 100, 'fuzzy': true});
}
const GUILD = AutocompleterResultTypes.GUILD;
if (GUILD === binding) {
return importDefault(dependencyMap[22]).queryGuilds({'query': '', 'limit': 100, 'fuzzy': true});
}
let TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
if (TEXT_CHANNEL === binding) {
defaultImport2 = importDefault(dependencyMap[22]);
queryChannels = defaultImport2.queryChannels;
object = {'query': '', 'guildId': null, 'limit': 100, 'fuzzy': true, 'allowEmptyQueries': true};
object.guildId = SelectedGuildStore.getGuildId();
return Reflect.apply(queryChannels, defaultImport2, [object]);
}
let VOICE_CHANNEL = AutocompleterResultTypes.VOICE_CHANNEL;
if (VOICE_CHANNEL === binding) {
defaultImport = importDefault(dependencyMap[22]);
queryChannels = defaultImport.queryChannels;
object = {'query': '', 'guildId': null, 'limit': 100, 'fuzzy': true, 'filter': null, 'type': null,
'allowEmptyQueries': true};
object.guildId = SelectedGuildStore.getGuildId();
object.filter = function() {
return true;
};
object.type = GUILD_VOCAL_CHANNELS_KEY;
return Reflect.apply(queryChannels, defaultImport, [object]);
}
object = [];
const Set = global.Set;
const set = new Set();
const items4 = [];
let length = env0_35.length;
const value7 = 1;
const value8 = 3;
if (value7 < length) {
r8 = value7;
reducibleLoop8: while (true) {
value9 = generateResultFromId(env0_35[r8]);
reducibleJoin16: while (true) {
if (value9 == null) {
break reducibleJoin16;
}
type = value9.type;
TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
value10 = type !== TEXT_CHANNEL;
reducibleJoin11: while (true) {
if (value10) {
type = value9.type;
VOICE_CHANNEL = AutocompleterResultTypes.VOICE_CHANNEL;
value11 = type !== VOICE_CHANNEL;
r7 = value11;
break reducibleJoin11;
}
r7 = value10;
break reducibleJoin11;
}
reducibleJoin13: while (true) {
if (r7) {
break reducibleJoin13;
}
permissionStoreBinding = PermissionStore;
can = permissionStoreBinding.can;
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
record = value9.record;
value12 = Reflect.apply(can, permissionStoreBinding, [VIEW_CHANNEL, record]);
r7 = value12;
break reducibleJoin13;
}
if (r7) {
push = items4.push;
Reflect.apply(push, items4, [value9]);
size = set.size;
if (size < value8) {
add = set.add;
Reflect.apply(add, set, [env0_35[r8]]);
break reducibleJoin16;
}
break reducibleJoin16;
}
break reducibleJoin16;
}
value13 = r8 + value7;
length = env0_35.length;
if (value13 < length) {
r8 = value13;
continue reducibleLoop8;
}
break reducibleLoop8;
}
}
const drafts = getDrafts(_fun57969);
reducibleJoin20: while (true) {
if (!(drafts.length > 0)) {
break reducibleJoin20;
}
push = object.push;
moduleValue = require(dependencyMap[19]);
createHeaderResult = moduleValue.createHeaderResult;
string = intl.string;
Reflect.apply(push, object, [Reflect.apply(createHeaderResult, moduleValue, [Reflect.apply(string, intl,
[t['4B63jZ']])])]);
value15 = _createForOfIteratorHelperLoose_57959(drafts);
value16 = value15();
done = value16.done;
if (done) {
r22 = dependencyMap;
break reducibleJoin20;
}
r13 = value16;
reducibleLoop19: while (true) {
value17 = r13.value;
add = set.add;
channelId = value17.channelId;
Reflect.apply(add, set, [channelId]);
push = object.push;
record = value17.record;
Reflect.apply(push, object, [record]);
value18 = value15();
done = value18.done;
if (done) {
r22 = dependencyMap;
break reducibleJoin20;
}
r13 = value18;
continue reducibleLoop19;
}
}
const value20 = ReadStateStore.getMentionChannelIds().filter(_fun57970);
const items2 = [];
const value21 = value20.length - value7;
if (value21 >= 0) {
r14 = value21;
reducibleLoop21: while (true) {
property = value20[r14];
reducibleJoin24: while (true) {
if (property == null) {
break reducibleJoin24;
}
value22 = generateResultFromId(property);
if (value22 == null) {
break reducibleJoin24;
}
push = items2.push;
Reflect.apply(push, items2, [{channelId: property, result: value22}]);
break reducibleJoin24;
}
value23 = typeof r14 === 'bigint' ? r14 - 1n : +r14 - 1;
if (value23 >= 0) {
r14 = value23;
continue reducibleLoop21;
}
break reducibleLoop21;
}
}
reducibleJoin28: while (true) {
if (!(items2.length > 0)) {
break reducibleJoin28;
}
push = object.push;
moduleValue2 = require(dependencyMap[19]);
createHeaderResult = moduleValue2.createHeaderResult;
string = intl.string;
Reflect.apply(push, object, [Reflect.apply(createHeaderResult, moduleValue2, [Reflect.apply(string, intl,
[t['61Df13']])])]);
value24 = _createForOfIteratorHelperLoose_57959(items2);
value25 = value24();
done = value25.done;
if (done) {
r22 = dependencyMap;
break reducibleJoin28;
}
r13 = value25;
reducibleLoop27: while (true) {
value26 = r13.value;
channelId = value26.channelId;
result = value26.result;
add = set.add;
record = result.record;
id = record.id;
Reflect.apply(add, set, [id]);
add = set.add;
Reflect.apply(add, set, [channelId]);
push = object.push;
Reflect.apply(push, object, [result]);
value27 = value24();
done = value27.done;
if (done) {
r22 = dependencyMap;
break reducibleJoin28;
}
r13 = value27;
continue reducibleLoop27;
}
}
reducibleJoin31: while (true) {
if (r16 == null) {
r7 = object;
break reducibleJoin31;
}
guildChannelStoreBinding = GuildChannelStore;
getSelectableChannelIds = guildChannelStoreBinding.getSelectableChannelIds;
value28 = Reflect.apply(getSelectableChannelIds, guildChannelStoreBinding, [r16]);
filter = value28.filter;
value29 = Reflect.apply(filter, value28, [_fun57971]);
map = value29.map;
value30 = Reflect.apply(map, value29, [function(a0) {
return generateResultFromId(a0);
}]);
filter = value30.filter;
isNotNullish = require(dependencyMap[25]).isNotNullish;
value31 = Reflect.apply(filter, value30, [isNotNullish]);
var env0_3 = value31;
Object = global.Object;
values = Object.values;
activeJoinedThreadsStoreBinding = ActiveJoinedThreadsStore;
getActiveJoinedUnreadThreadsForGuild = activeJoinedThreadsStoreBinding.getActiveJoinedUnreadThreadsForGuild;
value32 = Reflect.apply(values, Object, [Reflect.apply(getActiveJoinedUnreadThreadsForGuild,
activeJoinedThreadsStoreBinding, [r16])]);
forEach = value32.forEach;
Reflect.apply(forEach, value32, [_fun57973]);
length = value31.length;
if (length > 0) {
push = object.push;
moduleValue3 = require(dependencyMap[19]);
createHeaderResult = moduleValue3.createHeaderResult;
string = intl.string;
ieCAhD = t.ieCAhD;
Reflect.apply(push, object, [Reflect.apply(createHeaderResult, moduleValue3, [Reflect.apply(string, intl,
[ieCAhD])])]);
concat = object.concat;
value33 = Reflect.apply(concat, object, [value31]);
r7 = value33;
break reducibleJoin31;
}
r7 = object;
break reducibleJoin31;
}
const r10 = r7.length > 0 ? value8 : 7;
reducibleJoin34: while (true) {
if (items4.length > r10) {
splice = items4.splice;
Reflect.apply(splice, items4, [r10]);
break reducibleJoin34;
}
break reducibleJoin34;
}
reducibleJoin36: while (true) {
if (items4.length > 0) {
value = require(dependencyMap[19]);
createHeaderResult = value.createHeaderResult;
string = intl.string;
value = Reflect.apply(createHeaderResult, value, [Reflect.apply(string, intl, [t['80lOZ1']])]);
object = [value];
arraySpread(object, items4, value7, r22);
items3 = [];
arraySpread(items3, r7, arraySpread(items3, object, 0, r22), r22);
r2 = items3;
break reducibleJoin36;
}
r2 = r7;
break reducibleJoin36;
}
return r2;
function _fun57965({record}) { // fn#57965, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:2387, offset: 0x016bba48, size: 27 bytes, params: 2, frame: 2
return record.id !== env0_1;
}
function getDrafts(a0) { // fn#57967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:3264, owner: generateInitialResults.getDrafts, offset: 0x016bba63, size: 64 bytes, params: 2, frame: 13
var environment;
const env0_0 = a0;
const value = environment.__proto__;
const draftStoreBinding = DraftStore;
const getRecentlyEditedDrafts = draftStoreBinding.getRecentlyEditedDrafts;
const ChannelMessage = DraftType.ChannelMessage;
Reflect.apply(getRecentlyEditedDrafts, draftStoreBinding, [ChannelMessage]).forEach(_fun57968);
return [];
function _fun57968({channelId}) { // fn#57968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:3355, offset: 0x016bbaa3, size: 70 bytes, params: 2, frame: 14
var value2;
var value3;
var binding;
if (!env0_0(channelId)) {
value2 = environment.__proto__.__proto__;
value3 = generateResultFromId(channelId);
if (value3 != null) {
binding = env0_1;
binding.push({record: value3, channelId: channelId});
}
}
}
}
function _fun57969(a0) { // fn#57969, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:3461, offset: 0x016bbae9, size: 33 bytes, params: 2, frame: 12
return a0 === env0_0 || env0_2.has(a0);
}
function _fun57970(a0) { // fn#57970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:3737, offset: 0x016bbb0a, size: 36 bytes, params: 2, frame: 12
return a0 !== env0_0 && !env0_2.has(a0);
}
function _fun57971(a0) { // fn#57971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:4175, offset: 0x016bbb2e, size: 171 bytes, params: 2, frame: 17
let value = environment.__proto__;
const channel = ChannelStore.getChannel(a0);
let r0 = channel == null || a0 === env0_0;
r0 = !r0 ? env0_2.has(a0) : r0;
r0 = !r0 ? UserGuildSettingsStore.isChannelMuted(channel.guild_id, a0) : r0;
r0 = !r0 ? channel.parent_id != null && UserGuildSettingsStore.isChannelMuted(channel.guild_id,
channel.parent_id) : r0;
if (r0) {
r0 = !r0;
} else {
value = require(7243) /* metro dependency 7243: ReadStateUtils */;
value = value.getHasImportantUnread(channel);
r0 = value;
}
return r0;
}
function _fun57973(a0) { // fn#57973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:4498, offset: 0x016bbbec, size: 95 bytes, params: 2, frame: 22
var r6;
var r9;
var propertyName;
var propertyName2;
var value3;
var value4;
var binding;
var has;
var record;
var id;
var value5;
for (propertyName in a0) {
value3 = generateResultFromId(propertyName);
value4 = value3 == null;
if (value4) {
r9 = value4;
continue;
}
binding = env0_2;
has = binding.has;
record = value3.record;
id = record.id;
value5 = Reflect.apply(has, binding, [id]);
r9 = value5;
if (r9) {
r6 = propertyName2;
continue;
}
binding = env0_3;
binding.push(value3);
r6 = propertyName2;
}
}
}
function updateResults(a0, a1) { // fn#57974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:4863, offset: 0x016bbc4b, size: 1056 bytes, params: 3, frame: 25
var unshift;
var moduleValue;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var moduleValue2;
var moduleValue3;
var moduleValue4;
var guildStoreBinding;
var getGuild;
var selectedGuildStoreBinding;
var value2;
var moduleValue5;
var property;
var moduleValue6;
const FindResultDirections = (require(7234) /* metro dependency 7234: autocompleter */).FindResultDirections;
var Math;
var moduleValue7;
const binding = env0_30;
const AutocompleterResultTypes = (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterResultTypes;
const USER = AutocompleterResultTypes.USER;
if (USER === binding) {
guildStoreBinding = GuildStore;
getGuild = guildStoreBinding.getGuild;
selectedGuildStoreBinding = SelectedGuildStore;
value2 = Reflect.apply(getGuild, guildStoreBinding, [selectedGuildStoreBinding.getGuildId()]);
unshift = a0.unshift;
moduleValue5 = require(7234) /* metro dependency 7234: autocompleter */;
Reflect.apply(unshift, a0, [moduleValue5.createHeaderResult(value2 != null ? intl.formatToPlainString(t.FREzQs,
{name: value2.name}) : intl.string(t.XFYW1o))]);
env0_31 = a0;
} else if (AutocompleterResultTypes.TEXT_CHANNEL === binding) {
unshift = a0.unshift;
moduleValue4 = require(7234) /* metro dependency 7234: autocompleter */;
Reflect.apply(unshift, a0, [moduleValue4.createHeaderResult(intl.string(t.W26k4V))]);
env0_31 = a0;
} else if (AutocompleterResultTypes.VOICE_CHANNEL === binding) {
unshift = a0.unshift;
moduleValue3 = require(7234) /* metro dependency 7234: autocompleter */;
Reflect.apply(unshift, a0, [moduleValue3.createHeaderResult(intl.string(t.zUoI5C))]);
env0_31 = a0;
} else if (AutocompleterResultTypes.GUILD === binding) {
unshift = a0.unshift;
moduleValue2 = require(7234) /* metro dependency 7234: autocompleter */;
Reflect.apply(unshift, a0, [moduleValue2.createHeaderResult(intl.string(t.olADPs))]);
env0_31 = a0;
} else if (AutocompleterResultTypes.APPLICATION === binding) {
unshift = a0.unshift;
moduleValue = require(7234) /* metro dependency 7234: autocompleter */;
Reflect.apply(unshift, a0, [moduleValue.createHeaderResult(intl.string(t.VwK1ld))]);
env0_31 = a0;
} else {
env0_31 = a0;
}
if (a1 !== env0_32) {
env0_32 = a1;
Math = global.Math;
env0_33 = Math.max(a1.length, env0_33);
moduleValue7 = require(7234) /* metro dependency 7234: autocompleter */;
env0_27 = moduleValue7.findNextSelectedResult(FindResultDirections.DOWN, -1, env0_31);
} else {
property = env0_31[env0_27];
if (property != null && property.type === AutocompleterResultTypes.HEADER) {
moduleValue6 = require(7234) /* metro dependency 7234: autocompleter */;
env0_27 = moduleValue6.findNextSelectedResult(FindResultDirections.DOWN, env0_27, env0_31);
}
}
env0_37.emitChange();
}
function QUICKSWITCHER_SHOW({query, queryMode}) { // fn#57975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:6021, offset: 0x016bc06b, size: 336 bytes, params: 2, frame: 24
var r5;
var value12;
const value = query.trim();
const r10 = SelectedGuildStore.getGuildId() ?? undefined;
const Set = global.Set;
const set = new Set(['user:' + AuthenticationStore.getId()]);
if (r10 != null) {
set.add('guild:' + r10);
}
const Date = global.Date;
env0_36 = Date.now();
if (env0_25 != null) {
r5 = env0_25;
} else {
value12 = new (importDefault(7234) /* metro dependency 7234: autocompleter */)(handleUserSearchUpdate, env0_26,
queryMode != null ? 100 : 5, {'frecencyBoosters': true, 'blacklist': null, 'allowSnowflake': true,
blacklist: set}, 100);
}
env0_25 = r5;
env0_33 = value.length;
env0_25.search(value);
}
function handleUserSearchUpdate(a0, a1) { // fn#57976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:6363, offset: 0x016bc1bb, size: 162 bytes, params: 3, frame: 19
var r6;
var r1;
var value5;
var value6;
var property;
var property2;
var record;
var id;
var id2;
var value7;
const value = a0;
const value2 = a1.trim();
const r3 = value2.trim() !== '' ? value : generateInitialResults();
const binding = env0_34;
let length = r3.length;
const length2 = binding.length;
const value4 = false;
if (length !== length2) {
r1 = value4;
} else {
length = r3.length;
value5 = 0;
value6 = true;
if (value5 < length) {
r6 = value5;
while (true) {
property = r3[r6];
property2 = binding[r6];
record = property.record;
id = record.id;
record = property2.record;
id2 = record.id;
if (id !== id2) {
r1 = value4;
break;
}
value7 = typeof r6 === 'bigint' ? r6 + 1n : +r6 + 1;
length = r3.length;
if (value7 < length) {
r6 = value7;
continue;
}
r1 = value6;
break;
}
} else {
r1 = value6;
}
}
if (!r1) {
updateResults(r3, value2);
}
}
function HIDE_ACTION_SHEET_QUICK_SWITCHER_57977() { // fn#57977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:6641, offset: 0x016bc25d, size: 53 bytes, params: 1, frame: 11
env0_34 = [];
if (env0_25 != null) {
env0_25.destroy();
}
}
function _fun57978(a0) { // fn#57978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:6728, offset: 0x016bc292, size: 283 bytes, params: 2, frame: 16
const QuickSwitcherStoreClass2 = QuickSwitcherStoreClass;
Inherits(QuickSwitcherStoreClass2, a0);
return CreateClass(QuickSwitcherStoreClass2, [{key: 'initialize', value: value_57980}, {key: 'getState',
value: value_57982}, {key: 'isOpen', value: value_57983}, {key: 'getResultTotals', value: value_57984},
{key: 'channelNoticePredicate', value: value_57987}, {key: 'getFrequentGuilds', value: value_57988},
{key: 'getFrequentGuildsLength', value: value_57989}, {key: 'getChannelHistory', value: value_57990},
{key: 'getLastShowTimestamp', value: value_57991}, {key: 'getProps', value: value_57992}]);
function QuickSwitcherStoreClass() { // fn#57979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:6740, offset: 0x016bc3ad, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_3(this, QuickSwitcherStoreClass);
const value3 = env1_6(QuickSwitcherStoreClass);
return env1_5(this, _isNativeReflectConstruct_57956() ? global.Reflect.construct(value3, arguments,
env1_6(this).constructor) : value3.apply(this, arguments));
}
function value_57980(a0) { // fn#57980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:7073, offset: 0x016bc41e, size: 188 bytes, params: 2, frame: 37
const waitFor = this.waitFor;
const activeJoinedThreadsStoreBinding = ActiveJoinedThreadsStore;
const authenticationStoreBinding = AuthenticationStore;
const channelStoreBinding = ChannelStore;
const draftStoreBinding = DraftStore;
const guildChannelStoreBinding = GuildChannelStore;
const guildMemberStoreBinding = GuildMemberStore;
const guildStoreBinding = GuildStore;
const permissionStoreBinding = PermissionStore;
const readStateStoreBinding = ReadStateStore;
const selectedChannelStoreBinding = SelectedChannelStore;
const selectedGuildStoreBinding = SelectedGuildStore;
const themeStoreBinding = ThemeStore;
Reflect.apply(waitFor, this, [activeJoinedThreadsStoreBinding, authenticationStoreBinding, channelStoreBinding,
draftStoreBinding, guildChannelStoreBinding, guildMemberStoreBinding, guildStoreBinding, permissionStoreBinding,
readStateStoreBinding, selectedChannelStoreBinding, selectedGuildStoreBinding, themeStoreBinding,
UserGuildSettingsStore]);
this.syncWith([themeStoreBinding], function() {
return true;
});
const value2 = undefined;
const Storage = (StorageModule).Storage;
let r1 = Storage.get('seenQSTutorial') || false;
r1 = (a0 == null ? value2 : a0.channelHistory) ?? [];
return value2;
}
function value_57982() { // fn#57982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:7263, offset: 0x016bc4da, size: 16 bytes, params: 1, frame: 2
return {channelHistory: env1_35};
}
function value_57983() { // fn#57983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:7321, offset: 0x016bc4ea, size: 15 bytes, params: 1, frame: 2
return env1_25 != null;
}
function value_57984(a0) { // fn#57984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:7378, offset: 0x016bc4f9, size: 94 bytes, params: 2, frame: 16
var environment;
const env0_0 = a0;
let value = environment.__proto__;
const value2 = 0;
return env1_25 == null ? value2 : a0 == null ? env1_25.results.reduce(function(a0, a1) {
var r0;
var value = a0;
if (a1.type === require(dependencyMap[19]).AutocompleterResultTypes.HEADER) {
r0 = value;
} else {
value += 1;
r0 = value;
}
return r0;
}, value2) : env1_25.results.reduce(_fun57986, value2);
function _fun57986(a0, {type}) { // fn#57986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:7519, offset: 0x016bc597, size: 34 bytes, params: 3, frame: 4
var r0;
let value = a0;
if (type !== env0_0) {
r0 = value;
} else {
value += 1;
r0 = value;
}
return r0;
}
}
function value_57987(a0, a1) { // fn#57987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:7585, offset: 0x016bc5b9, size: 47 bytes, params: 3, frame: 10
const Date = global.Date;
let value = Date.now();
value -= a1;
value = value >= CHANNEL_NOTICE_SHOW_DELAY;
return env1_29 && value;
}
function value_57988() { // fn#57988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:7666, offset: 0x016bc5e8, size: 41 bytes, params: 1, frame: 14
const value = environment.__proto__;
const value2 = null;
return value2 != env1_25 ? env1_25.queryGuilds('', 100) : value2;
}
function value_57989() { // fn#57989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:7758, offset: 0x016bc611, size: 48 bytes, params: 1, frame: 14
return env1_25 != null ? env1_25.queryGuilds('', 100).length : 0;
}
function value_57990() { // fn#57990, offset: 0x00e427c1, size: 9 bytes, params: 1, frame: 1
return env1_35;
}
function value_57991() { // fn#57991, offset: 0x00e427ca, size: 9 bytes, params: 1, frame: 1
return env1_36;
}
function value_57992() { // fn#57992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:7948, offset: 0x016bc641, size: 101 bytes, params: 1, frame: 4
return {theme: ThemeStore.theme, query: env1_25 != null ? env1_25.query : '', queryMode: env1_30, results: env1_31,
selectedIndex: env1_27, seenTutorial: env1_28, maxQueryLength: env1_33};
}
}
function QUICKSWITCHER_SEARCH({query, queryMode}) { // fn#57993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:8558, offset: 0x016bc6a6, size: 420 bytes, params: 2, frame: 19
var r0;
var binding;
var setResultTypes;
var setLimit;
var guildId;
var value7;
const AutocompleterResultTypes = (AutocompleterModule).AutocompleterResultTypes;
const value = query.trim();
if (env0_25 == null) {
return false;
}
if (env0_30 !== queryMode) {
binding = env0_25;
setResultTypes = binding.setResultTypes;
r0 = queryMode != null ? [queryMode] : env0_26;
Reflect.apply(setResultTypes, binding, [r0]);
binding = env0_25;
setLimit = binding.setLimit;
r0 = queryMode != null ? 100 : 5;
Reflect.apply(setLimit, binding, [r0]);
guildId = SelectedGuildStore.getGuildId();
value7 = undefined;
r0 = guildId ?? value7;
if (queryMode !== AutocompleterResultTypes.USER) {
if (queryMode === AutocompleterResultTypes.VOICE_CHANNEL) {
env0_25.setOptions({voiceChannelGuildFilter: null}, true);
} else {
binding = env0_25;
binding.setOptions({userFilters: null, voiceChannelGuildFilter: value7}, true);
}
} else if (r0 != null) {
env0_25.setOptions({userFilters: {guild: r0, friends: true}}, true);
} else if (queryMode === AutocompleterResultTypes.VOICE_CHANNEL) {
env0_25.setOptions({voiceChannelGuildFilter: null}, true);
} else {
binding = env0_25;
binding.setOptions({userFilters: null, voiceChannelGuildFilter: value7}, true);
}
}
const USER = AutocompleterResultTypes.USER;
if (queryMode === USER) {
env0_25.search(value, SelectedGuildStore.getGuildId() ?? null);
} else {
env0_25.search(value, undefined);
}
}
function QUICKSWITCHER_SWITCH_TO() { // fn#57995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:9271, offset: 0x016bc85e, size: 67 bytes, params: 1, frame: 14
if (env0_28) {
return false;
}
const Storage = (StorageModule).Storage;
Storage.set('seenQSTutorial', true);
}
function CHANNEL_SELECT_57996({channelId}) { // fn#57996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7411:9373, offset: 0x016bc8a1, size: 91 bytes, params: 2, frame: 13
if (channelId == null) {
return false;
}
const value2 = env0_35.filter(function(a0) {
return a0 !== channelId;
});
env0_35 = value2;
value2.unshift(channelId);
if (env0_35.length > 8) {
env0_35.length = 8;
}
}
}
global.__d(_fun57955, 7233, [6, 7, 15, 17, 18, 5071, 1310, 1226, 1379, 4645, 1935, 1945, 1867, 3784, 4605, 1934,
3969, 4864, 661, 7234, 22, 7242, 6526, 1244, 7243, 1360, 587, 566, 694,
2]) /* metro module 7233, dependencies: [6, 7, 15, 17, 18, 5071, 1310, 1226, 1379, 4645, 1935, 1945, 1867, 3784, 4605, 1934, 3969, 4864, 661, 7234, 22, 7242, 6526, 1244, 7243, 1360, 587, 566, 694, 2] */;