952 lines
38 KiB
TypeScript
952 lines
38 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] */
|
|
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 closure2 = generateResultFromId;
|
|
const closure3 = QUICKSWITCHER_SHOW;
|
|
const closure4 = QUICKSWITCHER_HIDE;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const activeJoinedThreadsStore = importDefault(5071) /* metro dependency 5071: ActiveJoinedThreadsStore */;
|
|
const themeStore = importDefault(1310) /* metro dependency 1310: ThemeStore */;
|
|
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const draftStore = importDefault(4645) /* metro dependency 4645: DraftStore */;
|
|
const env0_13 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
|
|
const guildChannelStore = importDefault(1935) /* metro dependency 1935: GuildChannelStore */;
|
|
const env0_15 = (require(1935) /* metro dependency 1935: GuildChannelStore */).GUILD_VOCAL_CHANNELS_KEY;
|
|
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
|
|
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
|
|
const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */;
|
|
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
|
|
let value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_23 = value.CHANNEL_NOTICE_SHOW_DELAY;
|
|
const env0_24 = value.Permissions;
|
|
const AutocompleterResultTypes = (require(7234) /* metro dependency 7234: autocompleter */).AutocompleterResultTypes;
|
|
const USER = AutocompleterResultTypes.USER;
|
|
items = [USER];
|
|
const GROUP_DM = AutocompleterResultTypes.GROUP_DM;
|
|
items[1] = GROUP_DM;
|
|
const TEXT_CHANNEL = AutocompleterResultTypes.TEXT_CHANNEL;
|
|
items[2] = TEXT_CHANNEL;
|
|
const GUILD = AutocompleterResultTypes.GUILD;
|
|
items[3] = GUILD;
|
|
const APPLICATION = AutocompleterResultTypes.APPLICATION;
|
|
items[4] = APPLICATION;
|
|
const LINK = AutocompleterResultTypes.LINK;
|
|
items[5] = LINK;
|
|
const IN_APP_NAVIGATION = AutocompleterResultTypes.IN_APP_NAVIGATION;
|
|
items[6] = IN_APP_NAVIGATION;
|
|
const env0_31 = [];
|
|
let env0_34 = [];
|
|
const env0_35 = [];
|
|
const PersistedStore = (importDefault(566) /* metro dependency 566: 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: closure3, SHOW_ACTION_SHEET_QUICK_SWITCHER: closure3,
|
|
QUICKSWITCHER_HIDE: closure4, OVERLAY_SET_INPUT_LOCKED: closure4, HIDE_ACTION_SHEET_QUICK_SWITCHER: closure4,
|
|
QUICKSWITCHER_SEARCH: QUICKSWITCHER_SEARCH, QUICKSWITCHER_SELECT: function(a0) {
|
|
env0_27 = a0.selectedIndex;
|
|
}, QUICKSWITCHER_SWITCH_TO: QUICKSWITCHER_SWITCH_TO, CHANNEL_SELECT: CHANNEL_SELECT_57996});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/quickswitcher/QuickSwitcherStore.tsx');
|
|
exports.default = value;
|
|
exports.generateResultFromId = closure2;
|
|
}
|
|
|
|
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 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 = (importDefault(7242) /* metro dependency 7242: 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 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 getSelectableChannelIds;
|
|
var value28;
|
|
var value29;
|
|
var map;
|
|
var value30;
|
|
var isNotNullish;
|
|
var value31;
|
|
var Object;
|
|
var values;
|
|
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;
|
|
}
|
|
can = PermissionStore.can;
|
|
VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
|
|
record = value9.record;
|
|
value12 = Reflect.apply(can, PermissionStore, [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;
|
|
}
|
|
getSelectableChannelIds = GuildChannelStore.getSelectableChannelIds;
|
|
value28 = Reflect.apply(getSelectableChannelIds, GuildChannelStore, [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;
|
|
getActiveJoinedUnreadThreadsForGuild = ActiveJoinedThreadsStore.getActiveJoinedUnreadThreadsForGuild;
|
|
value32 = Reflect.apply(values, Object, [Reflect.apply(getActiveJoinedUnreadThreadsForGuild,
|
|
ActiveJoinedThreadsStore, [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 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 = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var moduleValue2;
|
|
var moduleValue3;
|
|
var moduleValue4;
|
|
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) {
|
|
value2 = GuildStore.getGuild(SelectedGuildStore.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 closure = QuickSwitcherStoreClass;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{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 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 = (require(7234) /* metro dependency 7234: autocompleter */).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 = (require(587) /* metro dependency 587: Storage */).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;
|
|
}
|
|
}
|
|
|
|
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 getRecentlyEditedDrafts = DraftStore.getRecentlyEditedDrafts;
|
|
const ChannelMessage = DraftType.ChannelMessage;
|
|
Reflect.apply(getRecentlyEditedDrafts, DraftStore, [ChannelMessage]).forEach(_fun57968);
|
|
return [];
|
|
}
|
|
|
|
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 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
|
|
this.waitFor(ActiveJoinedThreadsStore, AuthenticationStore, ChannelStore, DraftStore, GuildChannelStore,
|
|
GuildMemberStore, GuildStore, PermissionStore, ReadStateStore, SelectedChannelStore, SelectedGuildStore,
|
|
ThemeStore, UserGuildSettingsStore);
|
|
this.syncWith([ThemeStore], function() {
|
|
return true;
|
|
});
|
|
const value2 = undefined;
|
|
const Storage = (require(587) /* metro dependency 587: Storage */).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 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_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 _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 _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;
|
|
}
|
|
|