Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -0,0 +1,308 @@
/* Metro module 4790; source: modules/threads/ActiveThreadsStore.tsx; dependencies: [6, 7, 15, 17, 18, 1383, 1379, 22, 21, 566, 694, 2] */
function _fun41366(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#41366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:6, offset: 0x0111d46f, size: 477 bytes, params: 8, frame: 21
const threadStateFromChannel = function(a0) {
return {id: a0.id, parentId: a0.parent_id};
};
const closure = THREAD_CREATE_41376;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const channelRecordModule = require(1383) /* metro dependency 1383: ChannelRecord */;
const env0_7 = channelRecordModule.ALL_CHANNEL_TYPES;
const env0_8 = channelRecordModule.THREAD_CHANNEL_TYPES;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const env0_10 = {};
const Set = global.Set;
let set = new Set();
const env0_12 = {};
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun41378(Store).displayName = 'ActiveThreadsStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: CONNECTION_OPEN_41388,
OVERLAY_INITIALIZE: OVERLAY_INITIALIZE_41390, GUILD_CREATE: function({guild}) {
deleteGuildThreads_41371(guild.id);
storeThreads_41372(guild);
}, GUILD_DELETE: function({guild}) {
deleteGuildThreads_41371(guild.id);
}, THREAD_CREATE: closure, THREAD_UPDATE: closure, THREAD_LIST_SYNC: THREAD_LIST_SYNC_41396,
THREAD_DELETE: function({channel}) {
return deleteThread(channel);
}, CHANNEL_DELETE: CHANNEL_DELETE_41399});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ActiveThreadsStore.tsx');
exports.default = set;
}
function _isNativeReflectConstruct_41367() { // fn#41367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:215, offset: 0x0111d64c, 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_41367_isNativeReflectConstruct = function() {
return !!result;
})();
}
function deleteGuildThreads_41371(a0) { // fn#41371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:499, offset: 0x0111d6c5, size: 29 bytes, params: 2, frame: 3
if (a0 in env0_10) {
delete env0_10[a0];
}
}
function storeThreads_41372(a0) { // fn#41372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:550, offset: 0x0111d6e2, size: 133 bytes, params: 2, frame: 13
var binding;
const env0_0 = a0;
if (a0.threads != null && a0.threads.length > 0) {
env0_10[a0.id] = {};
a0.threads.filter(function(a0) {
return ALL_CHANNEL_TYPES.has(a0.type);
}).forEach(_fun41374);
}
if (a0.hasThreadsSubscription) {
binding = env0_11;
binding.add(a0.id);
}
}
function storeThread_41375(a0, a1) { // fn#41375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:734, offset: 0x0111d7a2, size: 70 bytes, params: 3, frame: 14
const property = env0_10[a0];
const parent_id = a1.parent_id;
if (!(parent_id in property)) {
property[parent_id] = {};
}
env0_10[a0][parent_id][a1.id] = threadStateFromChannel(a1);
}
function THREAD_CREATE_41376({channel}) { // fn#41376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:843, offset: 0x0111d7e8, size: 174 bytes, params: 2, frame: 19
var r9;
var threadMetadata;
var value2;
var binding;
var guild_id;
var object3;
var parent_id;
var object4;
if (ALL_CHANNEL_TYPES.has(channel.type)) {
threadMetadata = channel.threadMetadata;
value2 = undefined;
if ((threadMetadata == null ? value2 : threadMetadata.archived) === true) {
return deleteThread(channel);
}
binding = env0_10;
guild_id = channel.guild_id;
r9 = binding[guild_id] ?? ({});
binding = env0_10;
guild_id = channel.guild_id;
object3 = {};
copyDataProperties(object3, r9, r9);
parent_id = channel.parent_id;
object4 = {};
copyDataProperties(object4, r9[channel.parent_id], r9);
object4[channel.id] = threadStateFromChannel(channel);
object3[parent_id] = object4;
binding[guild_id] = object3;
return value2;
}
return false;
}
function deleteThread({guild_id, parent_id, id}) { // fn#41377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:1128, offset: 0x0111d896, size: 231 bytes, params: 2, frame: 21
var r3;
var r2;
var r1;
var value2;
var value3;
var value4;
var binding;
var object3;
var object4;
var property;
var value5;
var defaultImport;
let r0 = guild_id != null && parent_id != null;
if (r0) {
value2 = guild_id in env0_10;
if (value2) {
value3 = parent_id in env0_10[guild_id];
if (value3) {
value4 = id in env0_10[guild_id][parent_id];
if (value4) {
binding = env0_10;
object3 = {};
copyDataProperties(object3, binding[guild_id], undefined);
object4 = {};
property = env0_10[guild_id];
copyDataProperties(object4, property[parent_id], property);
object3[parent_id] = object4;
binding[guild_id] = object3;
delete env0_10[guild_id][parent_id][id];
value5 = undefined;
defaultImport = importDefault(22) /* metro dependency 22 */;
if (defaultImport.isEmpty(env0_10[guild_id][parent_id])) {
delete env0_10[guild_id][parent_id];
r3 = value5;
} else {
r3 = value5;
}
} else {
r3 = value4;
}
r2 = r3;
} else {
r2 = value3;
}
r1 = r2;
} else {
r1 = value2;
}
r0 = r1;
}
return r0;
}
function _fun41378(a0) { // fn#41378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:1365, offset: 0x0111d97d, size: 208 bytes, params: 2, frame: 16
const closure = ActiveThreadsStore;
env0_6(closure, a0);
return env0_3(closure, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore);
}}, {key: 'isActive', value: function(a0, a1, a2) {
var r0;
var value = a0 != null;
if (value) {
value = this.getThreadsForParent(a0, a1);
value = value[a2] != null;
r0 = value;
} else {
r0 = value;
}
return r0;
}}, {key: 'getThreadsForGuild', value: value_41382}, {key: 'getThreadsForParent', value: value_41383},
{key: 'hasThreadsForChannel', value: value_41384}, {key: 'forEachGuild', value: value_41385}, {key: 'hasLoaded',
value: value_41387}]);
}
function CONNECTION_OPEN_41388({guilds}) { // fn#41388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:2323, offset: 0x0111db57, size: 53 bytes, params: 2, frame: 11
env0_10 = {};
env0_11.clear();
guilds.forEach(function(a0) {
storeThreads_41372(a0);
});
}
function OVERLAY_INITIALIZE_41390({channels}) { // fn#41390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:2432, offset: 0x0111db9f, size: 94 bytes, params: 2, frame: 13
env0_10 = {};
let value = (importDefault(22) /* metro dependency 22 */)(channels);
value = value.filter(function(a0) {
return THREAD_CHANNEL_TYPES.has(a0.type);
});
value = value.groupBy('guild_id');
value.forEach(_fun41392);
}
function THREAD_LIST_SYNC_41396({guildId, threads, channelIds}) { // fn#41396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:2873, offset: 0x0111dca2, size: 155 bytes, params: 2, frame: 22
var propertyName;
var property2;
var property3;
if (channelIds == null) {
env0_11.add(guildId);
}
const binding = env0_10;
let object2 = {};
copyDataProperties(object2, binding[guildId], undefined);
binding[guildId] = object2;
for (propertyName in env0_10[guildId]) {
property2 = env0_10[guildId];
object2 = {};
property3 = env0_10[guildId];
copyDataProperties(object2, property3[propertyName], property3);
property2[propertyName] = object2;
}
threads.forEach(function(a0) {
storeThread_41375(guildId, a0);
});
}
function CHANNEL_DELETE_41399({channel}) { // fn#41399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:3139, offset: 0x0111dd70, size: 103 bytes, params: 2, frame: 16
var binding;
var object2;
var binding2;
let guild_id = channel.guild_id;
if (guild_id != null) {
guild_id = channel.guild_id;
if (guild_id in env0_10) {
binding = env0_10;
guild_id = channel.guild_id;
object2 = {};
binding2 = env0_10;
copyDataProperties(object2, binding2[channel.guild_id], binding2);
binding[guild_id] = object2;
binding = env0_10;
guild_id = channel.guild_id;
delete binding[guild_id][channel.id];
return undefined;
}
}
return false;
}
function _fun41374(a0) { // fn#41374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:670, offset: 0x0111d782, size: 32 bytes, params: 2, frame: 13
storeThread_41375(env0_0.id, a0);
}
function value_41382(a0) { // fn#41382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:1841, offset: 0x0111da78, size: 26 bytes, params: 2, frame: 3
return env1_10[a0] ?? env1_12;
}
function value_41383(a0, a1) { // fn#41383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:1920, offset: 0x0111da92, size: 39 bytes, params: 3, frame: 11
return this.getThreadsForGuild(a0)[a1] ?? env1_12;
}
function value_41384(a0, a1) { // fn#41384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:2027, offset: 0x0111dab9, size: 62 bytes, params: 3, frame: 15
let value = environment.__proto__;
value = importDefault(22) /* metro dependency 22 */;
const isEmpty = value.isEmpty;
const getThreadsForParent = this.getThreadsForParent;
return !Reflect.apply(isEmpty, value, [Reflect.apply(getThreadsForParent, this, [a0, a1])]);
}
function value_41385(a0) { // fn#41385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:2123, offset: 0x0111daf7, size: 65 bytes, params: 2, frame: 13
var environment;
const env0_0 = a0;
const value = environment.__proto__;
(importDefault(21) /* metro dependency 21: SnowflakeUtils */).keys(env1_10).forEach(_fun41386);
}
function _fun41392(a0, a1) { // fn#41392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:2551, offset: 0x0111dc18, size: 44 bytes, params: 3, frame: 13
const env0_0 = a1;
env1_10[a1] = {};
a0.forEach(function(a0) {
storeThread_41375(require, a0);
});
}
function _fun41386(a0) { // fn#41386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4968:2160, offset: 0x0111db38, size: 31 bytes, params: 2, frame: 13
env0_0(a0, env2_10[a0]);
}
@@ -0,0 +1,561 @@
/* Metro module 7154; source: modules/threads/ArchivedThreadsStore.tsx; dependencies: [6, 7, 15, 17, 18, 1383, 1379, 4605, 3786, 1388, 1390, 3, 1421, 7155, 22, 21, 6899, 566, 694, 2] */
function _fun57319(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:6, offset: 0x013e2f37, size: 621 bytes, params: 8, frame: 21
const env0_0 = require;
const _arrayLikeToArray_57325 = 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 = CONNECTION_OPEN_57326;
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 env0_8 = (require(1383) /* metro dependency 1383: ChannelRecord */).ALL_CHANNEL_TYPES;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
const env0_18 = ThreadSortOrder.LATEST_ACTIVITY;
const env0_19 = [];
const ThreadSearchTagSetting = (require(1390) /* metro dependency 1390: ThreadSearchTagSetting */).ThreadSearchTagSetting;
const env0_21 = ThreadSearchTagSetting.MATCH_SOME;
let value = importDefault(3) /* metro dependency 3: Logger */;
value = new value('ArchivedThreadsStore');
const env0_23 = [];
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun57337(Store).displayName = 'ArchivedThreadsStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: closure,
THREAD_DELETE: function({channel}) {
return removeThreadId(channel.id);
}, THREAD_UPDATE: THREAD_UPDATE_57346, CHANNEL_DELETE: CHANNEL_DELETE_57347,
LOAD_ARCHIVED_THREADS: LOAD_ARCHIVED_THREADS,
LOAD_ARCHIVED_THREADS_SUCCESS: LOAD_ARCHIVED_THREADS_SUCCESS_57349,
LOAD_ARCHIVED_THREADS_FAIL: LOAD_ARCHIVED_THREADS_FAIL, RESORT_THREADS: RESORT_THREADS_57353});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ArchivedThreadsStore.tsx');
exports.default = value;
exports.PAGE_SIZE = 25;
}
function _isNativeReflectConstruct_57320() { // fn#57320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:209, offset: 0x013e31a4, 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_57320_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_57323(a0, a1) { // fn#57323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:402, offset: 0x013e3202, 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 _fun57324;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_57325(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_57325(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_57325(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun57324;
}
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 CONNECTION_OPEN_57326() { // fn#57326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:1483, offset: 0x013e3374, size: 143 bytes, params: 1, frame: 14
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
env0_18 = ThreadSortOrder.LATEST_ACTIVITY;
const Set = global.Set;
const set = new Set();
env0_19 = [];
const ThreadSearchTagSetting = (require(1390) /* metro dependency 1390: ThreadSearchTagSetting */).ThreadSearchTagSetting;
env0_21 = ThreadSearchTagSetting.MATCH_SOME;
}
function getSortValue(a0, a1) { // fn#57327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:1635, offset: 0x013e3403, size: 76 bytes, params: 3, frame: 13
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
const LATEST_ACTIVITY = ThreadSortOrder.LATEST_ACTIVITY;
return a1 === LATEST_ACTIVITY ? ReadStateStore.lastMessageId(a0.id) : a0.id;
}
function resort() { // fn#57328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:1741, offset: 0x013e344f, size: 228 bytes, params: 1, frame: 17
var value4;
const value2 = null;
if (value2 == env0_17) {
return false;
}
const result = !env0_15;
const getChannel = ChannelStore.getChannel;
const binding = env0_19;
const value3 = Reflect.apply(getChannel, ChannelStore, [binding[binding.length - 1]]);
if (value2 != value3) {
value4 = getSortValue(value3, LATEST_ACTIVITY);
}
let defaultImport = importDefault(22) /* metro dependency 22 */;
const getAllThreadsForParent = ChannelStore.getAllThreadsForParent;
env0_19 = defaultImport(Reflect.apply(getAllThreadsForParent, ChannelStore, [env0_17])).filter(function(a0) {
return a0.isArchivedThread();
}).filter(_fun57330).sort(function(a0, a1) {
var defaultImport = importDefault(dependencyMap[15]);
var getSortValueBinding = getSortValue;
return defaultImport.compare(getSortValueBinding(a0, LATEST_ACTIVITY), getSortValueBinding(a1,
LATEST_ACTIVITY));
}).map(function(a0) {
return a0.id;
}).reverse().value();
}
function removeThreadId(a0) { // fn#57334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:2501, offset: 0x013e36f4, size: 64 bytes, params: 2, frame: 13
const env0_0 = a0;
if (env0_19.indexOf(a0) >= 0) {
env0_19 = env0_19.filter(_fun57335);
return undefined;
}
return false;
}
function matchesCurrentList(a0, a1, a2, a3) { // fn#57336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:2582, offset: 0x013e3734, size: 88 bytes, params: 5, frame: 15
return env0_17 === a0 && LATEST_ACTIVITY === a1 && (require(1421) /* metro dependency 1421: SetUtils */).areSetsEqual(env0_12,
a2) && MATCH_SOME === a3;
}
function _fun57337(a0) { // fn#57337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:2686, offset: 0x013e378c, size: 191 bytes, params: 2, frame: 16
const closure = ArchivedThreadsStore;
env0_7(closure, a0);
return env0_4(closure, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore, JoinedThreadsStore, ReadStateStore);
}}, {key: 'getCanLoadMore', value: value_57340}, {key: 'getNextOffset', value: value_57341},
{key: 'getIsInitialLoad', value: value_57342}, {key: 'isLoading', value: value_57343}, {key: 'getThreads',
value: value_57344}]);
}
function THREAD_UPDATE_57346({channel}) { // fn#57346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:3682, offset: 0x013e395d, size: 96 bytes, params: 2, frame: 15
var r1;
var r0;
var value3;
var moduleValue;
var isForumPostPinned2;
const value2 = env0_17 === channel.parent_id;
if (value2) {
value3 = undefined;
moduleValue = require(6899) /* metro dependency 6899: ForumUtils */;
isForumPostPinned2 = moduleValue.isForumPostPinned(channel.id);
if (isForumPostPinned2) {
removeThreadId(channel.id);
r1 = value3;
} else {
r1 = !!isForumPostPinned2;
}
r0 = r1;
} else {
r0 = value2;
}
return r0;
}
function CHANNEL_DELETE_57347({channel}) { // fn#57347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:3828, offset: 0x013e39bd, size: 40 bytes, params: 2, frame: 10
if (channel.id !== env0_17) {
return false;
}
CONNECTION_OPEN_57326();
}
function LOAD_ARCHIVED_THREADS(a0) { // fn#57348, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:3920, offset: 0x013e39e5, size: 223 bytes, params: 2, frame: 16
var moduleValue;
var set;
let channelId = a0.channelId;
let r2 = channelId === env0_17 && a0.sortOrder === LATEST_ACTIVITY;
if (r2) {
moduleValue = require(1421) /* metro dependency 1421: SetUtils */;
r2 = moduleValue.areSetsEqual(a0.tagFilter, env0_12);
}
r2 = r2 && a0.tagSetting === MATCH_SOME;
if (!r2) {
CONNECTION_OPEN_57326();
}
channelId = a0.channelId;
env0_18 = a0.sortOrder;
let tagFilter = a0.tagFilter;
let Set = global.Set;
if (tagFilter instanceof Set) {
tagFilter = a0.tagFilter;
} else {
Set = global.Set;
tagFilter = a0.tagFilter;
set = new Set();
}
env0_21 = a0.tagSetting;
}
function LOAD_ARCHIVED_THREADS_SUCCESS_57349(a0) { // fn#57349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:4203, offset: 0x013e3ac4, size: 469 bytes, params: 2, frame: 18
var value3;
var binding;
var channel;
var moduleValue2;
var trackForumMorePostsLoaded;
var hasMore;
var Array;
var info;
var offset;
if (a0.channelId !== env0_17) {
env0_22.info('ignored stale archived threads response', {channelId: a0.channelId});
} else {
if (a0.sortOrder !== LATEST_ACTIVITY) {
env0_22.info('ignored stale archived threads response', {channelId: a0.channelId});
return false;
}
var moduleValue = require(1421) /* metro dependency 1421: SetUtils */;
if (moduleValue.areSetsEqual(a0.tagFilter, env0_12)) {
if (a0.tagSetting !== MATCH_SOME) {
env0_22.info('ignored stale archived threads response', {channelId: a0.channelId});
return false;
}
value3 = a0.threads.filter(function(a0) {
return ALL_CHANNEL_TYPES.has(a0.type);
}).map(_fun57351);
binding = env0_19;
env0_19 = binding.concat(value3);
channel = ChannelStore.getChannel(env0_17);
if (channel != null && channel.isForumLikeChannel()) {
moduleValue2 = require(7155) /* metro dependency 7155: Tracking */;
trackForumMorePostsLoaded = moduleValue2.trackForumMorePostsLoaded;
Array = global.Array;
Reflect.apply(trackForumMorePostsLoaded, moduleValue2, [{guildId: channel.guild_id,
channelId: channel.id,
numArchivedThreads: env0_19.length, hasMoreThreads: a0.hasMore,
filterTagIds: Array.from(a0.tagFilter),
sortOrder: a0.sortOrder}]);
}
resort();
binding = env0_22;
info = binding.info;
offset = a0.offset;
hasMore = a0.hasMore;
Reflect.apply(info, binding, ['archived threads loaded', {channelId: env0_17, offset: offset,
count: env0_19.length,
hasMore: hasMore}]);
hasMore = a0.hasMore;
offset = a0.offset;
env0_20 = offset + 25;
return undefined;
}
binding = env0_22;
binding.info('ignored stale archived threads response', {channelId: a0.channelId});
}
return false;
}
function LOAD_ARCHIVED_THREADS_FAIL(a0) { // fn#57352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:4908, offset: 0x013e3c99, size: 116 bytes, params: 2, frame: 16
if (a0.channelId === env0_17) {
if (a0.sortOrder !== LATEST_ACTIVITY) {
return false;
}
var moduleValue = require(1421) /* metro dependency 1421: SetUtils */;
if (moduleValue.areSetsEqual(a0.tagFilter, env0_12)) {
if (a0.tagSetting !== MATCH_SOME) {
return false;
}
return undefined;
}
}
return false;
}
function RESORT_THREADS_57353(a0) { // fn#57353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:5084, offset: 0x013e3d0d, size: 59 bytes, params: 2, frame: 12
let r0 = env0_17 == null || a0.channelId == null;
r0 = (!r0 ? env0_17 === a0.channelId : r0) && resort();
return r0;
}
function _fun57330(a0) { // fn#57330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:1933, offset: 0x013e3542, size: 343 bytes, params: 2, frame: 21
var environment;
var r0;
var r5;
var value5;
var appliedTags;
var value6;
var value7;
var value9;
var value10;
var sortValue;
var value12;
var compare;
let value = environment.__proto__;
if (env1_12.size === 0) {
if (result) {
return true;
}
value10 = null;
if (value10 == env0_1) {
return true;
}
r5 = value10 == a0 ? value10 : getSortValue(a0, LATEST_ACTIVITY);
value12 = value10 != r5;
if (value12) {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare(r5, env0_1) >= 0;
r0 = value;
} else {
r0 = value12;
}
return r0;
}
const value2 = undefined;
const ThreadSearchTagSetting = (require(1390) /* metro dependency 1390: ThreadSearchTagSetting */).ThreadSearchTagSetting;
const MATCH_SOME2 = ThreadSearchTagSetting.MATCH_SOME;
if (MATCH_SOME2 === MATCH_SOME) {
appliedTags = a0.appliedTags;
if ((appliedTags == null ? value2 : appliedTags.some(_fun57331)) !== true) {
return false;
}
if (result) {
return true;
}
value10 = null;
if (value10 == env0_1) {
return true;
}
r5 = value10 == a0 ? value10 : getSortValue(a0, LATEST_ACTIVITY);
value12 = value10 != r5;
if (value12) {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare(r5, env0_1) >= 0;
r0 = value;
} else {
r0 = value12;
}
return r0;
}
const MATCH_ALL = ThreadSearchTagSetting.MATCH_ALL;
if (MATCH_ALL !== MATCH_SOME) {
if (result) {
return true;
}
value10 = null;
if (value10 == env0_1) {
return true;
}
r5 = value10 == a0 ? value10 : getSortValue(a0, LATEST_ACTIVITY);
value12 = value10 != r5;
if (value12) {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare(r5, env0_1) >= 0;
r0 = value;
} else {
r0 = value12;
}
return r0;
}
const _createForOfIteratorHelperLoose_57323Binding = _createForOfIteratorHelperLoose_57323;
const binding = env1_12;
const value3 = _createForOfIteratorHelperLoose_57323Binding(binding.values());
const value4 = value3();
let done = value4.done;
if (done) {
if (result) {
return true;
}
value10 = null;
if (value10 == env0_1) {
return true;
}
r5 = value10 == a0 ? value10 : getSortValue(a0, LATEST_ACTIVITY);
value12 = value10 != r5;
if (value12) {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare(r5, env0_1) >= 0;
r0 = value;
} else {
r0 = value12;
}
return r0;
}
let r4 = value4;
while (true) {
value5 = r4.value;
appliedTags = a0.appliedTags;
if (appliedTags == null) {
r0 = value2;
} else {
value6 = appliedTags.includes(value5);
r0 = value6;
}
if (r0 !== true) {
break;
}
value7 = value3();
done = value7.done;
if (done) {
value9 = environment;
if (result) {
return true;
}
value10 = null;
if (value10 == env0_1) {
return true;
}
if (value10 == a0) {
r5 = value10;
continue;
}
sortValue = getSortValue(a0, LATEST_ACTIVITY);
r5 = sortValue;
value12 = value10 != r5;
if (!value12) {
r0 = value12;
continue;
}
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
compare = value.compare;
value = Reflect.apply(compare, value, [r5, env0_1]) >= 0;
r0 = value;
return r0;
}
r4 = value7;
continue;
}
return false;
}
function value_57340(a0, a1, a2, a3) { // fn#57340, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:3077, offset: 0x013e386e, size: 63 bytes, params: 5, frame: 18
var r1;
var r0;
const value = environment.__proto__;
const value2 = matchesCurrentList(a0, a1, a2, a3);
if (value2) {
r1 = env1_15 && !env1_13;
r1 = r1 && !env1_16;
r0 = r1;
} else {
r0 = !!value2;
}
return r0;
}
function value_57341(a0, a1, a2, a3) { // fn#57341, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:3173, offset: 0x013e38ad, size: 36 bytes, params: 5, frame: 18
return matchesCurrentList(a0, a1, a2, a3) ? env1_20 : 0;
}
function value_57342(a0, a1, a2, a3) { // fn#57342, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:3262, offset: 0x013e38d1, size: 37 bytes, params: 5, frame: 18
const value2 = matchesCurrentList(a0, a1, a2, a3);
return value2 ? env1_14 : !value2;
}
function value_57343(a0, a1, a2, a3) { // fn#57343, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:3343, offset: 0x013e38f6, size: 34 bytes, params: 5, frame: 18
return matchesCurrentList(a0, a1, a2, a3) && env1_13;
}
function value_57344(a0, a1, a2, a3) { // fn#57344, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:3425, offset: 0x013e3918, size: 40 bytes, params: 5, frame: 18
return matchesCurrentList(a0, a1, a2, a3) ? env1_19 : env1_23;
}
function _fun57331(a0) { // fn#57331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7332:2064, offset: 0x013e3699, size: 22 bytes, params: 2, frame: 11
return env2_12.has(a0);
}
+43
View File
@@ -0,0 +1,43 @@
/* Metro module 15013; source: modules/threads/FormError.tsx; dependencies: [1244, 7246, 2] */
function _fun113486(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#113486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15210:6, offset: 0x023fc48c, size: 229 bytes, params: 8, frame: 18
var object2;
const env0_0 = require;
const formSubmitError_113487 = function(a0, a1) {
var value = a1;
var value2 = null;
return {type: a0, message: value2 != value ? value : value2};
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {EmptyContent: 0};
object2[0] = 'EmptyContent';
object2.AutomodViolation = 1;
object2[1] = 'AutomodViolation';
object2.ApiValidation = 2;
object2[2] = 'ApiValidation';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/FormError.tsx');
exports.FormSubmitErrorType = object2;
exports.makeEmptyTitleError = function() {
return makeEmptyContentError_113488(require(dependencyMap[0]).intl.string(require(dependencyMap[0]).t.uXA573));
};
exports.makeEmptyMessageError = function() {
return makeEmptyContentError_113488(require(dependencyMap[0]).intl.string(require(dependencyMap[0]).t.kesTVT));
};
exports.makeApiNameRequiredError = makeApiNameRequiredError;
exports.makeAutomodViolationError = makeAutomodViolationError_113492;
exports.renderError = renderError_113493;
}
function makeApiNameRequiredError() { // fn#113491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15210:744, offset: 0x023fc5ff, size: 81 bytes, params: 1, frame: 17
const formSubmitError_113487Binding = formSubmitError_113487;
const ApiValidation = env0_2.ApiValidation;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return formSubmitError_113487Binding(ApiValidation,
intl.string((require(1244) /* metro dependency 1244: indexNative */).t.uXA573));
}
function renderError_113493(a0, a1) { // fn#113493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15210:1056, offset: 0x023fc650, size: 101 bytes, params: 3, frame: 13
const value = null;
return value == a0 ? value : a0.type !== env0_2.EmptyContent || value == a1.content ? value != a0.message ? a0.message : value : a1.content.trim().length > 0 ? value : value != a0.message ? a0.message : value;
}
@@ -0,0 +1,411 @@
/* Metro module 3786; source: modules/threads/JoinedThreadsStore.tsx; dependencies: [6, 7, 15, 17, 18, 1383, 1226, 3787, 22, 566, 694, 2] */
function _fun28754(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#28754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:6, offset: 0x00f81c54, size: 534 bytes, params: 8, frame: 22
const closure = function(a0) {
var guildId = a0.guildId;
var env0_0 = guildId;
var members = a0.members;
if (guildId != null && members != null) {
members.forEach(_fun28765);
}
};
const closure2 = function(a0) {
var guildId = a0.guildId;
var env0_0 = guildId;
if (guildId != null) {
a0.data.forEach(_fun28767);
}
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const env0_7 = (require(1383) /* metro dependency 1383: ChannelRecord */).ALL_CHANNEL_TYPES;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
let env0_9 = {};
let value = importDefault(3787) /* metro dependency 3787: MuteTimers */;
value = new value();
const Set = global.Set;
let set = new Set();
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun28769(Store).displayName = 'JoinedThreadsStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: CONNECTION_OPEN_28779,
OVERLAY_INITIALIZE: function({joinedThreads}) {
env0_9 = importDefault(dependencyMap[8])(joinedThreads).map(_fun28782).keyBy('threadId').value();
}, GUILD_CREATE: function({guild}) {
deleteGuildThreads(guild.id);
storeThreads(guild);
}, GUILD_DELETE: function({guild}) {
deleteGuildThreads(guild.id);
}, THREAD_CREATE: function({channel}) {
storeThread(channel);
}, THREAD_LIST_SYNC: closure, SEARCH_MESSAGES_SUCCESS: closure2, MOD_VIEW_SEARCH_MESSAGES_SUCCESS: closure2,
LOAD_THREADS_SUCCESS: closure, LOAD_ARCHIVED_THREADS_SUCCESS: closure, THREAD_DELETE: THREAD_DELETE,
THREAD_MEMBER_UPDATE: THREAD_MEMBER_UPDATE_28787, THREAD_MEMBER_LOCAL_UPDATE: THREAD_MEMBER_LOCAL_UPDATE,
THREAD_MEMBERS_UPDATE: THREAD_MEMBERS_UPDATE_28789});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/JoinedThreadsStore.tsx');
exports.default = set;
}
function _isNativeReflectConstruct_28755() { // fn#28755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:186, offset: 0x00f81e6a, 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_28755_isNativeReflectConstruct = function() {
return !!result;
})();
}
function deleteGuildThreads(a0) { // fn#28758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:413, offset: 0x00f81ec8, size: 89 bytes, params: 2, frame: 13
const env0_0 = a0;
env0_9 = (importDefault(22) /* metro dependency 22 */)(env0_9).reject(_fun28759).keyBy('threadId').value();
}
function storeThreads({threads}) { // fn#28760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:510, offset: 0x00f81f36, size: 36 bytes, params: 2, frame: 11
if (threads != null) {
threads.forEach(storeThread);
}
}
function storeThread(a0) { // fn#28761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:585, offset: 0x00f81f5a, size: 194 bytes, params: 2, frame: 16
var member;
var binding;
var id;
var object2;
var Date;
var joinTimestamp;
var value4;
var date;
var handleMutedChangeBinding;
if (ALL_CHANNEL_TYPES.has(a0.type) && a0.member != null) {
binding = env0_9;
id = a0.id;
object2 = {};
object2.threadId = a0.id;
object2.guildId = a0.guild_id;
member = a0.member;
object2.flags = member.flags;
member = a0.member;
object2.muted = member.muted;
member = a0.member;
object2.muteConfig = member.muteConfig;
Date = global.Date;
member = a0.member;
joinTimestamp = member.joinTimestamp;
value4 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
object2.joinTimestamp = date instanceof Object ? date : value4;
binding[id] = object2;
handleMutedChangeBinding = handleMutedChange;
id = a0.id;
handleMutedChangeBinding(id);
}
}
function handleMutedChange(a0) { // fn#28762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:829, offset: 0x00f8201c, size: 239 bytes, params: 2, frame: 18
var Set;
var value2;
var set;
var value6;
const env0_0 = a0;
const property = env0_9[a0];
let binding = env0_10;
binding.clearTimer(a0);
if (property.muted === true) {
Set = global.Set;
binding = env0_11;
set = new Set(binding);
env0_11 = set;
set.add(a0);
binding = env0_10;
if (binding.setTimer(a0, property.muteConfig, _fun28763)) {
env0_9[a0].muted = false;
Set = global.Set;
binding = env0_11;
value6 = Object.create(Set.prototype, {constructor: {value: Set}});
set = new Set(binding);
(set instanceof Object ? set : value6).delete(a0);
}
} else {
Set = global.Set;
binding = env0_11;
value2 = Object.create(Set.prototype, {constructor: {value: Set}});
set = new Set(binding);
(set instanceof Object ? set : value2).delete(a0);
}
}
function LOAD_ARCHIVED_THREADS_SUCCESS_28764({guildId, members}) { // fn#28764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:1081, offset: 0x00f82165, size: 55 bytes, params: 2, frame: 13
if (guildId != null && members != null) {
members.forEach(_fun28765);
}
}
function MOD_VIEW_SEARCH_MESSAGES_SUCCESS_28766({guildId, data}) { // fn#28766, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:1334, offset: 0x00f8221e, size: 44 bytes, params: 2, frame: 12
if (guildId != null) {
data.forEach(function({members}) {
members.forEach(_fun28768);
});
}
}
function _fun28769(a0) { // fn#28769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:1604, offset: 0x00f822ea, size: 233 bytes, params: 2, frame: 16
const closure = JoinedThreadsStoreClass;
env0_6(closure, a0);
return env0_3(closure, [{key: 'initialize', value: function() {
this.waitFor(AuthenticationStore);
}}, {key: 'hasJoined', value: value_28772}, {key: 'joinTimestamp', value: value_28773}, {key: 'flags',
value: value_28774}, {key: 'getInitialOverlayState', value: value_28775}, {key: 'getMuteConfig',
value: value_28776}, {key: 'getMutedThreads', value: value_28777}, {key: 'isMuted', value: value_28778}]);
}
function CONNECTION_OPEN_28779({guilds}) { // fn#28779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:2552, offset: 0x00f82476, size: 85 bytes, params: 2, frame: 11
env0_10.reset();
const Set = global.Set;
const set = new Set();
env0_9 = {};
guilds.forEach(function(a0) {
storeThreads(a0);
});
}
function OVERLAY_INITIALIZE_28781({joinedThreads}) { // fn#28781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:2671, offset: 0x00f824de, size: 88 bytes, params: 2, frame: 13
env0_9 = (importDefault(22) /* metro dependency 22 */)(joinedThreads).map(function(a0) {
var r3;
var object = {};
copyDataProperties(object, a0, r3);
var Date = global.Date;
object['joinTimestamp'] = new Date(a0.joinTimestamp);
return object;
}).keyBy('threadId').value();
}
function THREAD_DELETE({channel}) { // fn#28786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:3363, offset: 0x00f825cd, size: 61 bytes, params: 2, frame: 13
var object2;
let id = channel.id;
if (id in env0_9) {
object2 = {};
copyDataProperties(object2, env0_9, id);
id = channel.id;
delete object2[id];
return undefined;
}
return false;
}
function THREAD_MEMBER_UPDATE_28787(a0) { // fn#28787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:3474, offset: 0x00f8260a, size: 158 bytes, params: 2, frame: 16
const id2 = AuthenticationStore.getId();
const userId = a0.userId;
if (id2 !== userId) {
return false;
}
const binding = env0_9;
const id = a0.id;
const object2 = {};
object2.threadId = a0.id;
object2.guildId = a0.guildId;
object2.flags = a0.flags;
object2.muted = a0.muted;
object2.muteConfig = a0.muteConfig;
const Date = global.Date;
const joinTimestamp = a0.joinTimestamp;
const value3 = Object.create(Date.prototype, {constructor: {value: Date}});
const date = new Date(joinTimestamp);
object2.joinTimestamp = date instanceof Object ? date : value3;
binding[id] = object2;
handleMutedChange(a0.id);
}
function THREAD_MEMBER_LOCAL_UPDATE({id, userId, guildId, isJoining}) { // fn#28788, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:3730, offset: 0x00f826a8, size: 155 bytes, params: 2, frame: 15
var r1;
var r0;
var value3;
var binding;
var object2;
const getId = AuthenticationStore.getId;
const value2 = Reflect.apply(getId, AuthenticationStore, []) === userId;
if (value2) {
value3 = guildId !== null;
if (value3) {
binding = env0_9;
if (isJoining) {
object2 = {threadId: id, guildId: guildId, flags: 0, muted: true};
object2.muteConfig = {end_time: undefined};
object2.joinTimestamp = new global.Date();
binding[id] = object2;
} else {
delete binding[id];
}
r1 = undefined;
} else {
r1 = value3;
}
r0 = r1;
} else {
r0 = value2;
}
return r0;
}
function THREAD_MEMBERS_UPDATE_28789(a0) { // fn#28789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:3982, offset: 0x00f82743, size: 145 bytes, params: 2, frame: 17
var r7;
var r3;
var object2;
const env0_0 = a0;
let env0_1 = false;
const removedMemberIds = a0.removedMemberIds;
const value = removedMemberIds != null;
if (value) {
r3 = removedMemberIds.includes(AuthenticationStore.getId());
r7 = AuthenticationStore;
} else {
r3 = value;
}
r3 = r3 && a0.id in env0_9;
if (r3) {
object2 = {};
copyDataProperties(object2, env0_9, r7);
delete object2[a0.id];
env0_1 = true;
}
const addedMembers = a0.addedMembers;
if (addedMembers != null) {
addedMembers.forEach(_fun28790);
}
return env0_1;
}
function _fun28763() { // fn#28763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:951, offset: 0x00f8210b, size: 90 bytes, params: 1, frame: 13
let binding = env1_9;
const binding2 = env0_0;
binding[binding2].muted = false;
const Set = global.Set;
binding = env1_11;
const value3 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set(binding);
(set instanceof Object ? set : value3).delete(binding2);
env1_12.emitChange();
}
function _fun28765(a0) { // fn#28765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:1177, offset: 0x00f8219c, size: 130 bytes, params: 2, frame: 16
const binding = env1_9;
const id = a0.id;
const object2 = {};
object2.threadId = a0.id;
object2.guildId = guildId;
object2.flags = a0.flags;
object2.muted = a0.muted;
object2.muteConfig = a0.muteConfig;
const Date = global.Date;
const joinTimestamp = a0.joinTimestamp;
const value3 = Object.create(Date.prototype, {constructor: {value: Date}});
const date = new Date(joinTimestamp);
object2.joinTimestamp = date instanceof Object ? date : value3;
binding[id] = object2;
handleMutedChange(a0.id);
}
function _fun28767({members}) { // fn#28767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:1411, offset: 0x00f8224a, size: 30 bytes, params: 2, frame: 11
members.forEach(_fun28768);
}
function value_28772(a0) { // fn#28772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:2001, offset: 0x00f823d3, size: 16 bytes, params: 2, frame: 2
return a0 in env1_9;
}
function value_28773(a0) { // fn#28773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:2056, offset: 0x00f823e3, size: 33 bytes, params: 2, frame: 3
const value = environment.__proto__;
return env1_9[a0]?.joinTimestamp;
}
function value_28774(a0) { // fn#28774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:2140, offset: 0x00f82404, size: 32 bytes, params: 2, frame: 3
const value = environment.__proto__;
return env1_9[a0]?.flags;
}
function value_28775() { // fn#28775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:2233, offset: 0x00f82424, size: 27 bytes, params: 1, frame: 11
const Object = global.Object;
return Object.values(env1_9);
}
function value_28776(a0) { // fn#28776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:2297, offset: 0x00f8243f, size: 33 bytes, params: 2, frame: 3
const value = environment.__proto__;
return env1_9[a0]?.muteConfig;
}
function _fun28790(a0) { // fn#28790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:4171, offset: 0x00f827d4, size: 182 bytes, params: 2, frame: 18
var object3;
var binding;
var id;
var object4;
var Date;
var joinTimestamp;
var value3;
var date;
var handleMutedChangeBinding;
const userId = a0.userId;
const getId = AuthenticationStore.getId;
if (userId === Reflect.apply(getId, AuthenticationStore, [])) {
object3 = {};
copyDataProperties(object3, env1_9, undefined);
binding = env0_0;
id = binding.id;
object4 = {};
object4.threadId = binding.id;
object4.guildId = binding.guildId;
object4.flags = a0.flags;
object4.muted = a0.muted;
object4.muteConfig = a0.muteConfig;
Date = global.Date;
joinTimestamp = a0.joinTimestamp;
value3 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
object4.joinTimestamp = date instanceof Object ? date : value3;
object3[id] = object4;
handleMutedChangeBinding = handleMutedChange;
id = binding.id;
handleMutedChangeBinding(id);
}
}
function _fun28768(a0) { // fn#28768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3913:1438, offset: 0x00f82268, size: 130 bytes, params: 2, frame: 16
const binding = env2_9;
const id = a0.id;
const object2 = {};
object2.threadId = a0.id;
object2.guildId = guildId;
object2.flags = a0.flags;
object2.muted = a0.muted;
object2.muteConfig = a0.muteConfig;
const Date = global.Date;
const joinTimestamp = a0.joinTimestamp;
const value3 = Object.create(Date.prototype, {constructor: {value: Date}});
const date = new Date(joinTimestamp);
object2.joinTimestamp = date instanceof Object ? date : value3;
binding[id] = object2;
handleMutedChange(a0.id);
}
@@ -0,0 +1,417 @@
/* Metro module 6904; source: modules/threads/LazyLoadedThreadManager.tsx; dependencies: [4257, 1383, 1379, 1934, 661, 1386, 694, 5225, 3974, 3987, 507, 2] */
function _fun54935(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:6, offset: 0x013714cf, size: 313 bytes, params: 8, frame: 20
var object2;
const env0_0 = require;
const _arrayLikeToArray_54938 = 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 = loadThread;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const gatewayConnectionStore = importDefault(4257) /* metro dependency 4257: GatewayConnectionStore */;
let value = require(1383) /* metro dependency 1383: ChannelRecord */;
const env0_4 = value.createChannelRecordFromServer;
const env0_5 = value.THREAD_CHANNEL_TYPES;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
value = require(661) /* metro dependency 661: Constants */;
const env0_8 = value.Endpoints;
const env0_9 = value.Routes;
const env0_10 = (require(1386) /* metro dependency 1386: ChannelConstants */).isStaticChannelRoute;
const env0_11 = {};
object2 = {getLoadState: getLoadState, loadThread: closure, loadThreadsBulk: loadThreadsBulk};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/LazyLoadedThreadManager.tsx');
exports.default = object2;
}
function _createForOfIteratorHelperLoose_54936(a0, a1) { // fn#54936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:268, offset: 0x01371608, 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 _fun54937;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_54938(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_54938(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_54938(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun54937;
}
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 initialize_54939() { // fn#54939, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:1192, offset: 0x0137177a, size: 65 bytes, params: 1, frame: 13
if (!env0_12) {
(importDefault(694) /* metro dependency 694: Dispatcher */).subscribe('CONNECTION_OPEN', function() {
env1_11 = {};
var value2 = SelectedChannelStore.getChannelId();
if (value2 != null && ChannelStore.getChannel(value2) == null) {
loadThread(value2);
}
});
}
}
function dispatchLoadedThread(a0, a1) { // fn#54941, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:1347, offset: 0x013717ff, size: 70 bytes, params: 3, frame: 14
const channelRecordFromServer = createChannelRecordFromServer(a0);
const value = importDefault(694) /* metro dependency 694: Dispatcher */;
value.dispatch({type: 'THREAD_CREATE', channel: channelRecordFromServer, messageId: a1});
}
function loadThread(a0) { // fn#54942, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:1456, offset: 0x01371845, size: 515 bytes, params: 2, frame: 26
var property;
var moduleValue;
var matchPath;
var pathname;
var object2;
const RouteParam = (require(3987) /* metro dependency 3987: RouteUtils */).RouteParam;
var HTTP;
var get;
var value6;
const env0_0 = a0;
if (a0 == null) {
return global.Promise.resolve();
}
const FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID = (require(5225) /* metro dependency 5225: FakePlaceholderPrivateChannel */).FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID;
if (a0 === FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID) {
return global.Promise.resolve();
}
if (isStaticChannelRoute(a0)) {
return global.Promise.resolve();
}
const getChannel = ChannelStore.getChannel;
if (Reflect.apply(getChannel, ChannelStore, [a0]) != null) {
return global.Promise.resolve();
}
initialize_54939();
if (GatewayConnectionStore.isConnected()) {
property = env0_11[a0];
if (property != null) {
return property.type === 'LOADING' ? property.promise : global.Promise.resolve();
}
moduleValue = require(3974) /* metro dependency 3974: matchPathCompat */;
matchPath = moduleValue.matchPath;
pathname = global.location.pathname;
object2 = {};
object2.path = Routes.CHANNEL(RouteParam.guildId(), RouteParam.channelId(), ':messageId');
object2.exact = true;
var env0_1 = Reflect.apply(matchPath, moduleValue, [pathname, object2]);
HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
get = HTTP.get;
object2 = {};
object2.url = Endpoints.CHANNEL(a0);
object2.rejectWithError = false;
value6 = Reflect.apply(get, HTTP, [object2]).then(_fun54943).catch(_fun54944);
env0_11[a0] = {type: 'LOADING', promise: value6};
return value6;
}
const Promise = global.Promise;
return Promise.resolve();
}
function getLoadState(a0) { // fn#54945, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:2385, offset: 0x01371b3b, size: 32 bytes, params: 2, frame: 3
return env0_11[a0]?.type;
}
function loadThreadsBulk(a0) { // fn#54946, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:2491, offset: 0x01371b5b, size: 529 bytes, params: 2, frame: 26
var r15;
var environment;
var r7;
var r2;
var r1;
var Promise;
var items4;
var items2;
var value2;
var value3;
var done;
var value4;
var FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID;
var getChannel;
var property;
var type;
var push;
var promise;
var value5;
var length;
var value6;
var HTTP;
var then;
var value9;
var binding;
var value10;
var all;
var items3;
let value = environment;
initialize_54939();
if (GatewayConnectionStore.isConnected()) {
items4 = [];
items2 = [];
value2 = _createForOfIteratorHelperLoose_54936(a0);
value3 = value2();
done = value3.done;
if (!done) {
r7 = value3;
reducibleLoop3: while (true) {
value4 = r7.value;
FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID = (require(5225) /* metro dependency 5225: FakePlaceholderPrivateChannel */).FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID;
reducibleJoin10: while (true) {
if (value4 === FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID) {
break reducibleJoin10;
}
if (isStaticChannelRoute(value4)) {
break reducibleJoin10;
}
getChannel = ChannelStore.getChannel;
if (Reflect.apply(getChannel, ChannelStore, [value4]) != null) {
break reducibleJoin10;
}
property = env0_11[value4];
if (property == null) {
items2.push(value4);
break reducibleJoin10;
}
type = property.type;
if (type !== 'LOADING') {
break reducibleJoin10;
}
push = items4.push;
promise = property.promise;
Reflect.apply(push, items4, [promise]);
r15 = push;
break reducibleJoin10;
}
value5 = value2();
done = value5.done;
if (done) {
break reducibleLoop3;
}
r7 = value5;
continue reducibleLoop3;
}
}
length = items2.length;
value6 = 0;
if (value6 === length) {
return global.Promise.all(items4).then(function() {
});
}
HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
value9 = HTTP.post({url: Endpoints.THREADS_BULK, body: {thread_ids: items2},
rejectWithError: false}).then(_fun54948).catch(_fun54949);
length = items2.length;
if (value6 < length) {
r2 = value6;
reducibleLoop13: while (true) {
property = items2[r2];
binding = env0_11;
binding[property] = {type: 'LOADING', promise: value9};
value10 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = items2.length;
if (value10 < length) {
r2 = value10;
continue reducibleLoop13;
}
break reducibleLoop13;
}
}
length = items4.length;
reducibleJoin16: while (true) {
if (value6 === length) {
r1 = value9;
break reducibleJoin16;
}
Promise = global.Promise;
all = Promise.all;
items3 = [];
value = arraySpread(items3, items4, value6, r15);
items3[value] = value9;
value + 1;
value = Reflect.apply(all, Promise, [items3]);
then = value.then;
value = Reflect.apply(then, value, [_fun54950]);
r1 = value;
break reducibleJoin16;
}
return r1;
}
Promise = global.Promise;
return Promise.resolve();
}
function _fun54943({body}) { // fn#54943, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:2020, offset: 0x01371a48, size: 113 bytes, params: 2, frame: 16
const value = environment.__proto__;
env1_11[env0_0] = {type: 'LOADED'};
if (THREAD_CHANNEL_TYPES.has(body.type)) {
dispatchLoadedThread(body, env0_1 == null || env0_1.params == null ? undefined : env0_1.params.messageId);
}
}
function _fun54944() { // fn#54944, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:2158, offset: 0x01371ab9, size: 130 bytes, params: 1, frame: 17
let value = environment.__proto__;
const binding = env1_11;
const binding2 = env0_0;
binding[binding2] = {type: 'NOT_FOUND'};
value = undefined;
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'CHANNEL_DELETE',
channel: {id: binding2, guild_id: env0_1 == null || env0_1.params == null ? value : env0_1.params.guildId,
parent_id: value}});
return value;
}
function _fun54948({body}) { // fn#54948, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:2967, offset: 0x01371d6c, size: 200 bytes, params: 2, frame: 19
var r2;
var r3;
var value5;
var id;
var binding;
var value6;
var property;
var has;
var binding2;
var value9;
const Set = global.Set;
const set = new Set();
const value3 = _createForOfIteratorHelperLoose_54936(body.items);
const value4 = value3();
let done = value4.done;
if (!done) {
for (r2 = value4; true; r2 = value6) {
value5 = r2.value;
id = value5.id;
set.add(id);
binding = env1_11;
binding[id] = {type: 'LOADED'};
dispatchLoadedThread(value5);
value6 = value3();
done = value6.done;
if (done) {
break;
}
}
}
binding = env0_0;
let length = binding.length;
if (0 < length) {
r3 = 0;
while (true) {
property = binding[r3];
has = set.has;
if (!Reflect.apply(has, set, [property])) {
binding2 = env1_11;
binding2[property] = {type: 'NOT_FOUND'};
}
value9 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
length = binding.length;
if (value9 < length) {
r3 = value9;
continue;
}
break;
}
}
}
function _fun54949() { // fn#54949, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7082:3224, offset: 0x01371e34, size: 52 bytes, params: 1, frame: 5
var r2;
var property;
const binding = env0_0;
let length = binding.length;
let value = 0;
if (value < length) {
for (r2 = value; true; r2 = value) {
property = binding[r2];
delete env1_11[property];
value = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = binding.length;
if (!(value < length)) {
break;
}
}
}
}
@@ -0,0 +1,44 @@
/* Metro module 8190; source: modules/threads/MessageCountUtils.tsx; dependencies: [1243, 21, 1244, 2] */
function _fun65689(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#65689, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8375:6, offset: 0x01bda2a5, size: 194 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const threadConstantsModule = require(1243) /* metro dependency 1243: ThreadConstants */;
const env0_3 = threadConstantsModule.MAX_THREAD_MESSAGE_COUNT;
const env0_4 = threadConstantsModule.MAX_THREAD_MESSAGE_COUNT_OLD;
const closure = shouldUseOldMaxMessageCount;
const closure2 = getMessageCountText;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/MessageCountUtils.tsx');
exports.shouldUseOldMaxMessageCount = closure;
exports.getMessageCountText = closure2;
exports.formatMobileMessageCountLabel = function(a0, a1) {
return _formatMessageCountLabel(a0, require(dependencyMap[2]).t.iTS3Xe, a1);
};
exports.formatMessageCountLabel = function(a0, a1) {
return _formatMessageCountLabel(a0, require(dependencyMap[2]).t.rfAXDV, a1);
};
}
function shouldUseOldMaxMessageCount(a0) { // fn#65690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8375:196, offset: 0x01bda367, size: 58 bytes, params: 2, frame: 13
let value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare('992549565104128000', a0);
return value > -1;
}
function getMessageCountText(a0, a1) { // fn#65691, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8375:262, offset: 0x01bda3a1, size: 108 bytes, params: 3, frame: 14
if (a0 == null) {
return '0';
}
if (a0 < 0) {
return '0';
}
return (a1 == null || shouldUseOldMaxMessageCount(a1)) && a0 >= MAX_THREAD_MESSAGE_COUNT_OLD ? '50+' : a0 >= MAX_THREAD_MESSAGE_COUNT ? '100k+' : '' + a0;
}
function _formatMessageCountLabel(a0, a1, a2) { // fn#65692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8375:410, offset: 0x01bda40d, size: 137 bytes, params: 4, frame: 16
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const messageCountText = getMessageCountText(a0, a2);
return messageCountText === '0' ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.eXHkhl) : intl.formatToPlainString(a1,
{count: messageCountText});
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,40 @@
/* Metro module 3791; source: modules/threads/ThreadActionUtils.tsx; dependencies: [1226, 2] */
function _fun28832(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#28832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3918:6, offset: 0x00f84664, size: 104 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadActionUtils.tsx');
exports.doesThreadMembersActionAffectMe = doesThreadMembersActionAffectMe;
}
function doesThreadMembersActionAffectMe(a0) { // fn#28833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3918:211, offset: 0x00f846cc, size: 107 bytes, params: 2, frame: 16
var r5;
var r1;
var r0;
var removedMemberIds;
var addedMembers;
var value;
const value2 = AuthenticationStore.getId() != null;
if (value2) {
removedMemberIds = a0.removedMemberIds;
r5 = removedMemberIds == null || !removedMemberIds.includes(value);
value = !r5;
if (r5) {
addedMembers = a0.addedMembers;
value = addedMembers == null;
value = !(value || !addedMembers.some(_fun28834));
r1 = value;
} else {
r1 = value;
}
r0 = r1;
} else {
r0 = value2;
}
return r0;
}
function _fun28834({userId}) { // fn#28834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3918:378, offset: 0x00f84737, size: 21 bytes, params: 2, frame: 2
return userId === env0_0;
}
@@ -0,0 +1,92 @@
/* Metro module 7878; source: modules/threads/ThreadAutoArchive.tsx; dependencies: [1243, 672, 1244, 4318, 3738, 2] */
function _fun63163(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63163, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8056:6, offset: 0x01b730a1, size: 311 bytes, params: 8, frame: 21
const env0_0 = require;
const closure = getAutoArchiveOptions;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(1243) /* metro dependency 1243: ThreadConstants */).DEFAULT_AUTO_ARCHIVE_DURATION;
let Minutes = (importDefault(672) /* metro dependency 672: Durations */).Minutes;
const HOUR = Minutes.HOUR;
items = [1 * HOUR];
Minutes = (importDefault(672) /* metro dependency 672: Durations */).Minutes;
let DAY = Minutes.DAY;
items[1] = 1 * DAY;
Minutes = (importDefault(672) /* metro dependency 672: Durations */).Minutes;
DAY = Minutes.DAY;
items[2] = 3 * DAY;
Minutes = (importDefault(672) /* metro dependency 672: Durations */).Minutes;
const WEEK = Minutes.WEEK;
items[3] = 1 * WEEK;
value = importDefault(4318) /* metro dependency 4318 */;
value = value(_fun63165);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadAutoArchive.tsx');
exports.AUTO_ARCHIVE_OPTION_VALUES = items;
exports.getAutoArchiveOptions = closure;
exports.getAutoArchiveDurations = value;
exports.getAutoArchiveDurationText = getAutoArchiveDurationText;
exports.getAutoArchiveDuration = function(a0, a1) {
var r0;
r0 = a1 ?? a0?.defaultAutoArchiveDuration;
r0 = r0 ?? DEFAULT_AUTO_ARCHIVE_DURATION;
return r0;
};
}
function getAutoArchiveOptions() { // fn#63164, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8056:236, offset: 0x01b731d8, size: 400 bytes, params: 1, frame: 19
let object2 = {id: '1hour'};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.label = Reflect.apply(string, intl, [t.cs8A1c]);
let Minutes = (importDefault(672) /* metro dependency 672: Durations */).Minutes;
const HOUR = Minutes.HOUR;
object2.value = HOUR;
const items2 = [object2];
object2 = {id: '24hours'};
object2.label = intl.string(t.zFKbrF);
Minutes = (importDefault(672) /* metro dependency 672: Durations */).Minutes;
let DAY = Minutes.DAY;
object2.value = DAY;
items2[1] = object2;
object2 = {id: '3days'};
string = intl.string;
const TmPIZX = t.TmPIZX;
object2.label = Reflect.apply(string, intl, [TmPIZX]);
Minutes = (importDefault(672) /* metro dependency 672: Durations */).Minutes;
DAY = Minutes.DAY;
object2.value = 3 * DAY;
items2[2] = object2;
object2 = {id: '1week'};
object2.label = intl.string(t['/7i2el']);
Minutes = (importDefault(672) /* metro dependency 672: Durations */).Minutes;
const WEEK = Minutes.WEEK;
object2.value = WEEK;
items2[3] = object2;
return items2;
}
function _fun63165() { // fn#63165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8056:646, offset: 0x01b73368, size: 32 bytes, params: 1, frame: 11
return getAutoArchiveOptions().map(function(a0) {
return a0.value;
});
}
function getAutoArchiveDurationText(a0) { // fn#63167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8056:900, offset: 0x01b73388, size: 105 bytes, params: 2, frame: 16
var r0;
const env0_0 = a0;
var value;
const getAutoArchiveOptionsBinding = getAutoArchiveOptions;
const value2 = undefined;
const value4 = getAutoArchiveOptionsBinding().find(_fun63168);
const label = value4 == null ? value2 : value4.label;
if (label != null) {
r0 = label;
} else {
value = importDefault(3738) /* metro dependency 3738 */;
value = value.duration(a0, 'minutes');
value = value.humanize();
r0 = value;
}
return r0;
}
@@ -0,0 +1,234 @@
/* Metro module 12057; source: modules/threads/ThreadBrowserHooks.tsx; dependencies: [57, 31, 12058, 1379, 3784, 4605, 4790, 7154, 3786, 482, 7169, 566, 22, 1360, 21, 7153, 9621, 2] */
function _fun92636(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:6, offset: 0x02093496, size: 339 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = useActiveThreadIds;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(12058) /* metro dependency 12058: ReportToModChannelStore */).useShouldShowResolvedFlagsForChannel;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
const activeThreadsStore = importDefault(4790) /* metro dependency 4790: ActiveThreadsStore */;
const archivedThreadsStore = importDefault(7154) /* metro dependency 7154: ArchivedThreadsStore */;
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
const env0_12 = (require(482) /* metro dependency 482: Constants */).Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadBrowserHooks.tsx');
exports.useTrackThreadBrowserTab = useTrackThreadBrowserTab;
exports.useActiveThreadIds = closure;
exports.useActiveThreads = useActiveThreads;
exports.useActiveGuildThreads = useActiveGuildThreads;
exports.useArchivedThreads = useArchivedThreads;
}
function useActiveThreadIds(a0) { // fn#92637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:247, offset: 0x020935e9, size: 140 bytes, params: 2, frame: 18
const env0_0 = a0;
return env0_4.useMemo(_fun92642,
[(require(566) /* metro dependency 566: flux */).useStateFromStoresArray([PermissionStore, ActiveThreadsStore,
ChannelStore], _fun92638, [a0.guild_id, a0.id])]);
}
function useTrackThreadBrowserTab() { // fn#92644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:760, offset: 0x020937f3, size: 35 bytes, params: 1, frame: 13
env0_4.useEffect(_fun92645, []);
}
function useActiveThreads(a0) { // fn#92646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:913, offset: 0x0209383b, size: 143 bytes, params: 2, frame: 22
const value2 = useActiveThreadIds(a0);
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
const value = env0_3(Reflect.apply(useStateFromStores, fluxModule, [[JoinedThreadsStore], _fun92647, [value2],
fluxModule.statesWillNeverBeEqual]), 2);
return {joinedThreadIds: value[0], unjoinedThreadIds: value[1]};
}
function useActiveGuildThreads(a0) { // fn#92649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:1175, offset: 0x02093918, size: 126 bytes, params: 2, frame: 17
const env0_0 = a0;
return env0_4.useMemo(_fun92655,
[(require(566) /* metro dependency 566: flux */).useStateFromStoresArray([PermissionStore, ActiveThreadsStore,
ChannelStore], _fun92650, [a0])]);
}
function useArchivedThreads(a0, a1, a2, a3) { // fn#92657, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:1623, offset: 0x02093ac4, size: 460 bytes, params: 5, frame: 30
var object2;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
let value = a0.isModeratorReportChannel();
const env0_4 = value;
const showResolvedFlags = useShouldShowResolvedFlagsForChannel(a0.id).showResolvedFlags;
const {canLoadMore, loading, nextOffset,
isInitialLoad} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ArchivedThreadsStore],
_fun92658);
value = env0_4.useCallback(_fun92659, [a0, a1, a2, a3, nextOffset, showResolvedFlags, value]);
const env0_9 = env0_4.useRef(value);
env0_4.useEffect(_fun92660);
env0_4.useEffect(_fun92661, [a0.id, a1, a2, isInitialLoad, showResolvedFlags]);
env0_4.useEffect(_fun92662, [a0.id, showResolvedFlags]);
object2 = {};
object2.threadIds = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([ArchivedThreadsStore,
ChannelStore, PermissionStore], _fun92663);
object2.canLoadMore = canLoadMore;
object2.loading = (loading || isInitialLoad) && showResolvedFlags && PermissionStore.can(Permissions.READ_MESSAGE_HISTORY,
a0);
object2.loadMore = value;
return object2;
}
function _fun92638() { // fn#92638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:326, offset: 0x02093675, size: 168 bytes, params: 1, frame: 18
var environment;
let value = environment.__proto__;
const defaultImport = importDefault(22) /* metro dependency 22 */;
const getThreadsForParent = ActiveThreadsStore.getThreadsForParent;
const binding = env0_0;
const value5 = defaultImport(Reflect.apply(getThreadsForParent, ActiveThreadsStore, [binding.guild_id,
binding.id])).values().map(function({id}) {
return ChannelStore.getChannel(id);
});
value = value5.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
value = value.filter(function(a0) {
return PermissionStore.can(Permissions.VIEW_CHANNEL, a0);
});
value = value.map(function(a0) {
return a0.id;
});
return value.value();
}
function _fun92642() { // fn#92642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:549, offset: 0x0209375a, size: 78 bytes, params: 1, frame: 11
var environment;
let value = environment.__proto__;
value = importDefault(22) /* metro dependency 22 */;
value = value(env0_1);
value = value.sort(function(a0, a1) {
return importDefault(dependencyMap[14]).compare(ReadStateStore.lastMessageId(a0),
ReadStateStore.lastMessageId(a1));
});
value = value.reverse();
return value.value();
}
function _fun92645() { // fn#92645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:809, offset: 0x02093816, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
(require(7169) /* metro dependency 7169: ThreadUtils */).trackThreadBrowserTab();
}
function _fun92647() { // fn#92647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:1005, offset: 0x020938ca, size: 55 bytes, params: 1, frame: 13
var environment;
let value = environment.__proto__;
value = importDefault(22) /* metro dependency 22 */;
return value.partition(env0_0, function(a0) {
return JoinedThreadsStore.hasJoined(a0);
});
}
function _fun92650() { // fn#92650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:1257, offset: 0x02093996, size: 184 bytes, params: 1, frame: 16
var environment;
let value = environment.__proto__;
const defaultImport = importDefault(22) /* metro dependency 22 */;
const getThreadsForGuild = ActiveThreadsStore.getThreadsForGuild;
const value7 = defaultImport(Reflect.apply(getThreadsForGuild, ActiveThreadsStore,
[env0_0])).values().map(_fun92651).flatten().map(function({id}) {
return ChannelStore.getChannel(id);
});
value = value7.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
value = value.filter(function(a0) {
return PermissionStore.can(Permissions.VIEW_CHANNEL, a0);
});
value = value.map(function(a0) {
return a0.id;
});
return value.value();
}
function _fun92655() { // fn#92655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:1490, offset: 0x02093a76, size: 78 bytes, params: 1, frame: 11
var environment;
let value = environment.__proto__;
value = importDefault(22) /* metro dependency 22 */;
value = value(env0_1);
value = value.sort(function(a0, a1) {
return importDefault(dependencyMap[14]).compare(ReadStateStore.lastMessageId(a0),
ReadStateStore.lastMessageId(a1));
});
value = value.reverse();
return value.value();
}
function _fun92658() { // fn#92658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:1764, offset: 0x02093c90, size: 164 bytes, params: 1, frame: 19
const isLoading = ArchivedThreadsStore.isLoading;
const binding = env0_0;
const getIsInitialLoad = ArchivedThreadsStore.getIsInitialLoad;
const getCanLoadMore = ArchivedThreadsStore.getCanLoadMore;
const getNextOffset = ArchivedThreadsStore.getNextOffset;
return {loading: Reflect.apply(isLoading, ArchivedThreadsStore, [binding.id, require, importDefault, importAll]),
isInitialLoad: Reflect.apply(getIsInitialLoad, ArchivedThreadsStore, [binding.id, require, importDefault,
importAll]), canLoadMore: Reflect.apply(getCanLoadMore, ArchivedThreadsStore, [binding.id, require,
importDefault, importAll]), nextOffset: Reflect.apply(getNextOffset, ArchivedThreadsStore, [binding.id, require,
importDefault, importAll])};
}
function _fun92659() { // fn#92659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:2009, offset: 0x02093d34, size: 159 bytes, params: 1, frame: 15
var binding;
var loadArchivedThreads;
let value = environment.__proto__;
const can = PermissionStore.can;
const READ_MESSAGE_HISTORY = Permissions.READ_MESSAGE_HISTORY;
const value3 = Reflect.apply(can, PermissionStore, [READ_MESSAGE_HISTORY, env0_0]);
if (!(value3 ? env0_4 && !showResolvedFlags : !value3)) {
value = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
loadArchivedThreads = value.loadArchivedThreads;
binding = env0_0;
Reflect.apply(loadArchivedThreads, value, [{guildId: binding.guild_id, channelId: binding.id,
sortOrder: require,
tagFilter: importDefault, tagSetting: importAll, offset: nextOffset}]);
}
}
function _fun92661() { // fn#92661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:2253, offset: 0x02093dd3, size: 27 bytes, params: 1, frame: 9
if (isInitialLoad) {
env0_9.current();
}
}
function _fun92662() { // fn#92662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:2304, offset: 0x02093dee, size: 50 bytes, params: 1, frame: 12
let value = environment.__proto__;
value = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
value.resort(env0_0.id);
}
function _fun92663() { // fn#92663, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:2396, offset: 0x02093e20, size: 103 bytes, params: 1, frame: 19
var environment;
let value = environment.__proto__;
const defaultImport = importDefault(22) /* metro dependency 22 */;
const getThreads = ArchivedThreadsStore.getThreads;
value = defaultImport(Reflect.apply(getThreads, ArchivedThreadsStore, [env0_0.id, require, importDefault,
importAll]));
value = value.filter(_fun92664);
return value.value();
}
function _fun92651(a0) { // fn#92651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:1309, offset: 0x02093a4e, size: 40 bytes, params: 2, frame: 11
const value = environment.__proto__.__proto__;
return (importDefault(22) /* metro dependency 22 */).values(a0);
}
function _fun92664(a0) { // fn#92664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12243:2443, offset: 0x02093e87, size: 94 bytes, params: 2, frame: 14
var r0;
var channel;
let value = environment.__proto__;
if (env1_4) {
if (showResolvedFlags) {
value = environment.__proto__.__proto__;
channel = ChannelStore.getChannel(a0);
r0 = channel != null && PermissionStore.can(Permissions.VIEW_CHANNEL, channel);
r0 = r0 && !channel.isMediaThread();
return r0;
}
return false;
}
value = environment.__proto__.__proto__;
channel = ChannelStore.getChannel(a0);
return channel != null && PermissionStore.can(Permissions.VIEW_CHANNEL, channel) && !channel.isMediaThread();
}
@@ -0,0 +1,55 @@
/* Metro module 1243; source: modules/threads/ThreadConstants.tsx; dependencies: [661, 1244, 2] */
function _fun13934(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1370:6, offset: 0x00df8598, size: 457 bytes, params: 8, frame: 24
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const AbortCodes = (require(661) /* metro dependency 661: Constants */).AbortCodes;
let Set = global.Set;
const TOO_MANY_ATTACHMENTS = AbortCodes.TOO_MANY_ATTACHMENTS;
const items2 = [TOO_MANY_ATTACHMENTS];
let EXPLICIT_CONTENT = AbortCodes.EXPLICIT_CONTENT;
items2[1] = EXPLICIT_CONTENT;
const ENTITY_TOO_LARGE = AbortCodes.ENTITY_TOO_LARGE;
items2[2] = ENTITY_TOO_LARGE;
EXPLICIT_CONTENT = AbortCodes.EXPLICIT_CONTENT;
items2[3] = EXPLICIT_CONTENT;
let set = new Set(items2);
Set = global.Set;
const AUTOMOD_MESSAGE_BLOCKED = AbortCodes.AUTOMOD_MESSAGE_BLOCKED;
const AUTOMOD_TITLE_BLOCKED = AbortCodes.AUTOMOD_TITLE_BLOCKED;
set = new Set([AUTOMOD_MESSAGE_BLOCKED, AUTOMOD_TITLE_BLOCKED]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadConstants.tsx');
exports.DEFAULT_AUTO_ARCHIVE_DURATION = 4320;
exports.MAX_THREAD_MESSAGE_COUNT_OLD = 50;
exports.MAX_THREAD_MESSAGE_COUNT = 100000;
exports.MAX_THREAD_MEMBERS_PREVIEW = 50;
exports.MAX_THREAD_UNREAD_MESSAGE_COUNT = 25;
exports.ThreadMemberFlags = {'HAS_INTERACTED': 1, 'ALL_MESSAGES': 2, 'ONLY_MENTIONS': 4, 'NO_MESSAGES': 8};
exports.OpenThreadAnalyticsLocations = {EMBED: 'Embed', BROWSER: 'Thread Browser', POPOUT: 'Active Threads Popout',
CHANNEL_LIST: 'Channel List', GUILD_ACTIVE_THREADS_MODAL: 'Guild Active Threads Modal', INBOX: 'Inbox',
FORUM: 'Forum', VOICE_AUTO_OPEN: 'Voice Auto Open'};
exports.getThreadNotificationOptions = getThreadNotificationOptions;
exports.ThreadSortOrderReadableForAnalytics = {LATEST_ACTIVITY: 'Last Message', CREATION_DATE: 'Creation'};
exports.FORUM_POST_CREATION_UPLOAD_ERRORS = set;
exports.FORUM_POST_CREATION_AUTOMOD_ERRORS = set;
}
function getThreadNotificationOptions() { // fn#13935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1370:1017, offset: 0x00df8761, size: 224 bytes, params: 1, frame: 20
const object2 = {};
const binding = env0_2;
const ALL_MESSAGES = binding.ALL_MESSAGES;
object2.setting = ALL_MESSAGES;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.label = Reflect.apply(string, intl, [t['n/bTaY']]);
const ONLY_MENTIONS = binding.ONLY_MENTIONS;
const format = intl.format;
const L2hmYy = t.L2hmYy;
const NO_MESSAGES = binding.NO_MESSAGES;
string = intl.string;
const CtVGyQ = t.CtVGyQ;
return [object2, {setting: ONLY_MENTIONS, label: Reflect.apply(format, intl, [L2hmYy, {}])}, {setting: NO_MESSAGES,
label: Reflect.apply(string, intl, [CtVGyQ])}];
}
File diff suppressed because it is too large. Load diff
+402
View File
@@ -0,0 +1,402 @@
/* Metro module 6860; source: modules/threads/ThreadHooks.tsx; dependencies: [57, 4249, 1383, 1226, 1379, 3784, 5071, 661, 566, 483, 5216, 21, 22, 6861, 6862, 5072, 2] */
function _fun54107(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:6, offset: 0x0135ce52, size: 592 bytes, params: 8, frame: 25
let env0_0 = require;
const closure = useCanStartPublicThread;
const closure2 = useCanStartPrivateThread;
const _canUnarchiveThread = function(a0, a1, a2) {
var r0;
var value = a1;
var value2 = a2;
r0 = a0 == null || !a0.isThread();
r0 = !r0 ? a0.isMediaThread() : r0;
r0 = !r0 && (a0.threadMetadata == null ? value : a0.threadMetadata.locked ? value2 : value);
return r0;
};
const closure3 = useIsActiveChannelOrUnarchivableThread;
const closure4 = function(a0) {
var env0_0 = a0;
return require(dependencyMap[8]).useStateFromStores([PermissionStore], _fun54118);
};
const closure5 = isThreadModerator;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(57) /* metro dependency 57 */;
let value = importDefault(4249) /* metro dependency 4249: createExperiment */;
const env0_5 = (require(1383) /* metro dependency 1383: ChannelRecord */).THREADED_CHANNEL_TYPES;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const activeJoinedThreadsStore = importDefault(5071) /* metro dependency 5071: ActiveJoinedThreadsStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_10 = constantsModule.Permissions;
const env0_11 = constantsModule.MessageFlags;
const env0_12 = constantsModule.ChannelTypes;
value = value({'id': '2022-07_voice_in_threads', 'label': 'Voice in Threads', 'kind': 'guild',
defaultConfig: {enabled: false}, treatments: [{'id': 1, 'label': 'On', config: {enabled: true}}]});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadHooks.tsx');
exports.VoiceInThreadsExperiment = value;
exports.useCanStartPublicThread = closure;
exports.computeCanStartPublicThread = function(a0, a1) {
var r2;
var value = a0.isForumLikeChannel();
if (value) {
r2 = Permissions.SEND_MESSAGES;
} else {
value = importAll(dependencyMap[9]);
value = value.combine(Permissions.CREATE_PUBLIC_THREADS, Permissions.READ_MESSAGE_HISTORY);
r2 = value;
}
return canStartThread(PermissionStore.can(r2, a0), a0, a1);
};
exports.useCanStartPrivateThread = closure2;
exports.computeCanStartPrivateThread = computeCanStartPrivateThread;
exports.useCanStartThread = useCanStartThread;
exports.useCanViewThreadForMessage = useCanViewThreadForMessage;
exports.useHasActiveThreads = function(a0) {
var env0_0 = a0;
return require(dependencyMap[8]).useStateFromStoresObject([ActiveJoinedThreadsStore, PermissionStore],
_fun54127);
};
exports.useCanManageThread = useCanManageThread;
exports.useCanUnarchiveThread = function(a0) {
var env0_0 = a0;
return _canUnarchiveThread(a0, require(dependencyMap[8]).useStateFromStores([PermissionStore], _fun54136),
useIsThreadModerator(a0));
};
exports.canUnarchiveThread = function(a0) {
return _canUnarchiveThread(a0, hasSendPermission(a0, PermissionStore), isThreadModerator(a0));
};
exports.useIsActiveChannelOrUnarchivableThread = closure3;
exports.getIsActiveChannelOrUnarchivableThread = getIsActiveChannelOrUnarchivableThread;
exports.computeIsReadOnlyThread = computeIsReadOnlyThread;
exports.useIsThreadModerator = closure4;
exports.isThreadModerator = closure5;
exports.useCanRemoveThreadMember = function(a0) {
var env0_0 = a0;
return require(dependencyMap[8]).useStateFromStores([ChannelStore, PermissionStore, AuthenticationStore],
_fun54141);
};
exports.useCanJoinThreadVoice = useCanJoinThreadVoice;
exports.useIsNonModInLockedThread = useIsNonModInLockedThread;
exports.isNonModInLockedThread = isNonModInLockedThread;
}
function useCanStartPublicThread(a0, a1) { // fn#54108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:402, offset: 0x0135d0a2, size: 87 bytes, params: 3, frame: 19
const env0_0 = a0;
const canStartThreadBinding = canStartThread;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
return canStartThreadBinding(Reflect.apply(useStateFromStores, fluxModule, [[PermissionStore], _fun54109, [a0]]),
a0, a1);
}
function useCanStartPrivateThread(a0) { // fn#54110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:638, offset: 0x0135d168, size: 105 bytes, params: 2, frame: 19
const env0_0 = a0;
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun54111,
[a0]);
const type = a0.type;
const GUILD_TEXT = ChannelTypes.GUILD_TEXT;
return type === GUILD_TEXT && canStartThread(value2, a0);
}
function canStartThread(a0, a1, a2) { // fn#54112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:824, offset: 0x0135d218, size: 117 bytes, params: 4, frame: 13
if (a0) {
if (THREADED_CHANNEL_TYPES.has(a1.type)) {
if (a2 == null) {
return true;
}
if (a2.hasFlag(MessageFlags.HAS_THREAD)) {
return false;
}
if ((importDefault(5216) /* metro dependency 5216: isSystemMessage */)(a2)) {
return false;
}
return true;
}
}
return false;
}
function hasSendPermission(a0, a1) { // fn#54113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:978, offset: 0x0135d28d, size: 42 bytes, params: 3, frame: 14
return a0 != null && a1.can(Permissions.SEND_MESSAGES_IN_THREADS, a0);
}
function useIsActiveChannelOrUnarchivableThread(a0) { // fn#54115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:1199, offset: 0x0135d30a, size: 154 bytes, params: 2, frame: 17
var r1;
var r2;
var r0;
var isThread2;
const env0_0 = a0;
const value2 = undefined;
const value = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun54116);
const value3 = a0 != null;
if (value3) {
isThread2 = a0.isThread();
r1 = isThread2 ? a0.isActiveThread() : !isThread2;
if (!r1) {
r2 = a0.isArchivedThread() && (a0.threadMetadata == null ? value2 : a0.threadMetadata.locked) !== true;
r2 = r2 && value;
r1 = r2;
}
r0 = r1;
} else {
r0 = value3;
}
return r0;
}
function useIsThreadModerator(a0) { // fn#54117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:1469, offset: 0x0135d3d7, size: 64 bytes, params: 2, frame: 14
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun54118);
}
function isThreadModerator(a0) { // fn#54119, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:1572, offset: 0x0135d43b, size: 85 bytes, params: 2, frame: 15
const value = a1;
const property = env0_4(value !== undefined ? value : [PermissionStore], 1)[0];
return a0 != null && property.can(Permissions.MANAGE_THREADS, a0);
}
function computeCanStartPrivateThread(a0, a1) { // fn#54121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:2160, offset: 0x0135d507, size: 50 bytes, params: 3, frame: 15
const canStartThreadBinding = canStartThread;
const can = PermissionStore.can;
const CREATE_PRIVATE_THREADS = Permissions.CREATE_PRIVATE_THREADS;
return canStartThreadBinding(Reflect.apply(can, PermissionStore, [CREATE_PRIVATE_THREADS, a0]), a0, a1);
}
function useCanStartThread(a0) { // fn#54122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:2285, offset: 0x0135d539, size: 34 bytes, params: 2, frame: 12
return useCanStartPublicThread(a0) || useCanStartPrivateThread(a0);
}
function useCanViewThreadForMessage(a0) { // fn#54123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:2420, offset: 0x0135d55b, size: 171 bytes, params: 2, frame: 22
const env0_0 = a0;
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun54124, [a0]);
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun54125,
[value2]);
const hasFlag = a0.hasFlag;
const HAS_THREAD = MessageFlags.HAS_THREAD;
const value = Reflect.apply(hasFlag, a0, [HAS_THREAD]);
return value ? value2 != null && !!value3 : !!value;
}
function useHasActiveThreads(a0) { // fn#54126, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:2741, offset: 0x0135d66c, size: 73 bytes, params: 2, frame: 15
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ActiveJoinedThreadsStore,
PermissionStore], _fun54127);
}
function useCanManageThread(a0) { // fn#54131, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:3267, offset: 0x0135d821, size: 230 bytes, params: 2, frame: 23
const env0_0 = a0;
var isThread;
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun54132);
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun54133,
[channel]);
const id = (require(566) /* metro dependency 566: flux */).useStateFromStores([AuthenticationStore], function() {
return AuthenticationStore.getId();
});
let r0 = a0 != null && channel != null;
if (r0) {
isThread = a0.isThread();
r0 = isThread ? value2 ? !!value2 : !a0.isLockedThread() && a0.ownerId === id : !!isThread;
}
return r0;
}
function useCanUnarchiveThread(a0) { // fn#54135, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:3622, offset: 0x0135d97c, size: 84 bytes, params: 2, frame: 18
const env0_0 = a0;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
return _canUnarchiveThread(a0, Reflect.apply(useStateFromStores, fluxModule, [[PermissionStore], _fun54136]),
useIsThreadModerator(a0));
}
function getIsActiveChannelOrUnarchivableThread(a0) { // fn#54138, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:4032, offset: 0x0135da18, size: 121 bytes, params: 2, frame: 16
var r1;
var r2;
var r0;
var threadMetadata;
let value = a0 != null;
if (value) {
value = a0.isThread();
r1 = value ? a0.isActiveThread() : !value;
if (!r1) {
value = a0.isArchivedThread();
if (value) {
threadMetadata = a0.threadMetadata;
value = undefined;
value = (threadMetadata == null ? value : threadMetadata.locked) !== true;
r2 = value;
} else {
r2 = value;
}
r2 = r2 && PermissionStore.can(Permissions.SEND_MESSAGES_IN_THREADS, a0);
r1 = r2;
}
r0 = r1;
} else {
r0 = value;
}
return r0;
}
function computeIsReadOnlyThread(a0) { // fn#54139, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:4278, offset: 0x0135da91, size: 67 bytes, params: 2, frame: 13
if (a0.isMediaThread()) {
return true;
}
const can = PermissionStore.can;
const MANAGE_THREADS = Permissions.MANAGE_THREADS;
return a0.isArchivedLockedThread() && !Reflect.apply(can, PermissionStore, [MANAGE_THREADS, a0]);
}
function useCanRemoveThreadMember(a0) { // fn#54140, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:4524, offset: 0x0135dad4, size: 80 bytes, params: 2, frame: 15
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore, PermissionStore,
AuthenticationStore], _fun54141);
}
function useCanJoinThreadVoice(a0) { // fn#54142, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:4769, offset: 0x0135db91, size: 271 bytes, params: 2, frame: 22
var r1;
const env0_0 = a0;
var value;
const value2 = (importDefault(6861) /* metro dependency 6861: useIsRemote */)();
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun54143);
const value4 = useIsActiveChannelOrUnarchivableThread(a0);
const binding = env0_13;
const useExperiment = binding.useExperiment;
const enabled = Reflect.apply(useExperiment, binding, [{guildId: a0.guild_id, location: 'e791ea_1'},
{autoTrackExposure: false}]).enabled;
const value5 = (require(6862) /* metro dependency 6862: GameInvitesChannelUtils */).useIsGameInvitesPost(a0);
const value6 = (require(5072) /* metro dependency 5072: AgeGateUtils */).useShouldAgeVerifyForAgeGate();
if (value6) {
value = require(5072) /* metro dependency 5072: AgeGateUtils */;
value = value.shouldShowAgeGateForChannelId(a0.id);
r1 = value;
} else {
r1 = value6;
}
let r0 = !value2 && a0.isVocalThread() && (enabled || value5);
r0 = r0 && value3 && value4 && !r1;
return r0;
}
function useIsNonModInLockedThread(a0) { // fn#54144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:5212, offset: 0x0135dcc6, size: 35 bytes, params: 2, frame: 11
return a0.isLockedThread() && !useIsThreadModerator(a0);
}
function isNonModInLockedThread(a0) { // fn#54145, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:5336, offset: 0x0135dce9, size: 35 bytes, params: 2, frame: 11
return a0.isLockedThread() && !isThreadModerator(a0);
}
function _fun54109() { // fn#54109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:494, offset: 0x0135d0f9, size: 111 bytes, params: 1, frame: 15
var r3;
var moduleValue;
if (env0_0.isForumLikeChannel()) {
r3 = Permissions.SEND_MESSAGES;
} else {
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
r3 = moduleValue.combine(Permissions.CREATE_PUBLIC_THREADS, Permissions.READ_MESSAGE_HISTORY);
}
return PermissionStore.can(r3, env0_0);
}
function _fun54111() { // fn#54111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:713, offset: 0x0135d1d1, size: 71 bytes, params: 1, frame: 15
const value = environment.__proto__;
const can = PermissionStore.can;
const bigFlagUtilsModule = importAll(483) /* metro dependency 483: BigFlagUtils */;
const combine = bigFlagUtilsModule.combine;
const CREATE_PRIVATE_THREADS = Permissions.CREATE_PRIVATE_THREADS;
return Reflect.apply(can, PermissionStore, [Reflect.apply(combine, bigFlagUtilsModule, [CREATE_PRIVATE_THREADS]),
env0_0]);
}
function _fun54116() { // fn#54116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:1290, offset: 0x0135d3a4, size: 51 bytes, params: 1, frame: 14
return env0_0 != null && PermissionStore.can(Permissions.SEND_MESSAGES_IN_THREADS, env0_0);
}
function _fun54118() { // fn#54118, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:1541, offset: 0x0135d417, size: 36 bytes, params: 1, frame: 13
return isThreadModerator(env0_0, [PermissionStore]);
}
function _fun54124() { // fn#54124, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:2497, offset: 0x0135d606, size: 64 bytes, params: 1, frame: 13
let value = environment.__proto__;
const getChannel = ChannelStore.getChannel;
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
return Reflect.apply(getChannel, ChannelStore, [value.castMessageIdAsChannelId(env0_0.id)]);
}
function _fun54125() { // fn#54125, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:2679, offset: 0x0135d646, size: 38 bytes, params: 1, frame: 13
const can = PermissionStore.can;
const VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
return Reflect.apply(can, PermissionStore, [VIEW_CHANNEL, env0_1]);
}
function _fun54127() { // fn#54127, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:2820, offset: 0x0135d6b5, size: 225 bytes, params: 1, frame: 19
var environment;
let value = environment.__proto__;
const getActiveJoinedThreadsForParent = ActiveJoinedThreadsStore.getActiveJoinedThreadsForParent;
const binding = env0_0;
const value3 = Reflect.apply(getActiveJoinedThreadsForParent, ActiveJoinedThreadsStore, [binding.guild_id,
binding.id]);
const activeJoinedRelevantThreadsForParent = ActiveJoinedThreadsStore.getActiveJoinedRelevantThreadsForParent(binding.guild_id,
binding.id);
const activeUnjoinedThreadsForParent = ActiveJoinedThreadsStore.getActiveUnjoinedThreadsForParent(binding.guild_id,
binding.id);
value = (importDefault(22) /* metro dependency 22 */)(activeJoinedRelevantThreadsForParent);
value = value.some(function(a0) {
var VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
return PermissionStore.can(VIEW_CHANNEL, a0.channel);
});
const value7 = (importDefault(22) /* metro dependency 22 */)(value3).some(_fun54129);
const value9 = (importDefault(22) /* metro dependency 22 */)(activeUnjoinedThreadsForParent).some(function(a0) {
return PermissionStore.can(Permissions.VIEW_CHANNEL, a0);
});
let r3 = value || value7;
r3 = !r3 ? value9 : r3;
return {hasActiveThreads: r3, hasMoreActiveThreads: value9 || value7};
}
function _fun54132() { // fn#54132, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:3336, offset: 0x0135d907, size: 47 bytes, params: 1, frame: 13
return ChannelStore.getChannel(env0_0?.parent_id);
}
function _fun54133() { // fn#54133, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:3417, offset: 0x0135d936, size: 51 bytes, params: 1, frame: 14
return channel != null && PermissionStore.can(Permissions.MANAGE_THREADS, channel);
}
function _fun54136() { // fn#54136, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:3694, offset: 0x0135d9d0, size: 28 bytes, params: 1, frame: 13
return hasSendPermission(env0_0, PermissionStore);
}
function _fun54141() { // fn#54141, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:4604, offset: 0x0135db24, size: 109 bytes, params: 1, frame: 14
const value = environment.__proto__;
const channel = ChannelStore.getChannel(env0_0);
if (channel == null) {
return false;
}
const id = AuthenticationStore.getId();
const type = channel.type;
const PRIVATE_THREAD = ChannelTypes.PRIVATE_THREAD;
let r0 = type === PRIVATE_THREAD && channel.ownerId === id;
r0 = !r0 ? isThreadModerator(channel, [PermissionStore]) : r0;
return r0;
}
function _fun54143() { // fn#54143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:4854, offset: 0x0135dca0, size: 38 bytes, params: 1, frame: 13
const can = PermissionStore.can;
const CONNECT = Permissions.CONNECT;
return Reflect.apply(can, PermissionStore, [CONNECT, env0_0]);
}
function _fun54129(a0) { // fn#54129, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7038:3075, offset: 0x0135d7bd, size: 66 bytes, params: 2, frame: 14
var r0;
const id = a0.channel.id;
var value;
if (value) {
r0 = !(id in env0_0);
} else {
value = environment.__proto__.__proto__;
value = PermissionStore.can(Permissions.VIEW_CHANNEL, a0.channel);
r0 = value;
}
return r0;
}
+254
View File
@@ -0,0 +1,254 @@
/* Metro module 15835; source: modules/threads/ThreadManager.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 1379, 566, 694, 9621, 4860, 2] */
function _fun121750(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#121750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:6, offset: 0x02550503, size: 280 bytes, params: 8, frame: 18
const _arrayLikeToArray_121753 = 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 Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
value = _fun121757(value);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadManager.tsx');
exports.default = value;
}
function _createForOfIteratorHelperLoose_121751(a0, a1) { // fn#121751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:170, offset: 0x0255061b, size: 372 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 _fun121752;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_121753(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_121753(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_121753(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun121752;
}
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 _isNativeReflectConstruct_121754() { // fn#121754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:1080, offset: 0x0255078f, size: 98 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_121754_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun121757(a0) { // fn#121757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:1283, offset: 0x025507f1, size: 122 bytes, params: 2, frame: 16
const closure = ThreadManager;
env0_6(closure, a0);
return env0_3(closure, [{key: 'handleChannelDelete', value: value_121759}, {key: 'handleMessageCreate',
value: value_121761}, {key: 'handleGuildDelete', value: value_121762}]);
}
function ThreadManager(a0) { // fn#121758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:1295, offset: 0x0255086b, size: 167 bytes, params: 2, frame: 19
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_2;
binding(this, ThreadManager);
const items = [];
arraySpread(items, value, 0, items);
value = env1_5(ThreadManager);
binding = env1_4;
if (_isNativeReflectConstruct_121754()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items, env1_5(this).constructor);
r0 = value;
} else {
value = value.apply(this, items);
r0 = value;
}
value = binding(this, r0);
value.actions = {CHANNEL_DELETE: value.handleChannelDelete, MESSAGE_CREATE: value.handleMessageCreate,
GUILD_DELETE: value.handleGuildDelete};
return value;
}
function value_121759({channel}) { // fn#121759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:1717, offset: 0x02550912, size: 111 bytes, params: 2, frame: 14
var environment;
var value;
if (channel.guild_id != null) {
value = environment.__proto__;
if (ChannelStore.getAllThreadsForParent(channel.id).length > 0) {
(importDefault(566) /* metro dependency 566: flux */).Emitter.batched(_fun121760);
}
}
}
function value_121761({channelId, message}) { // fn#121761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:2007, offset: 0x025509e4, size: 240 bytes, params: 2, frame: 17
var r4;
var Date;
var value5;
var date;
var time;
let value = environment.__proto__;
const channel = ChannelStore.getChannel(channelId);
const id = message.author?.id;
const getId = AuthenticationStore.getId;
if (id === Reflect.apply(getId, AuthenticationStore, [])) {
if (channel != null) {
if (channel.isActiveThread()) {
Date = global.Date;
r4 = channel.threadMetadata?.archiveTimestamp ?? 0;
value5 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date();
time = (date instanceof Object ? date : value5).getTime();
Date = global.Date;
if (Date.now() - time < 5000) {
value = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
value.resort(channel.parent_id);
}
}
}
}
}
function value_121762({guild}) { // fn#121762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:2320, offset: 0x02550ad4, size: 109 bytes, params: 2, frame: 14
var environment;
var value;
if (!guild.unavailable) {
value = environment.__proto__;
if (ChannelStore.getAllThreadsForGuild(guild.id).length !== 0) {
(importDefault(566) /* metro dependency 566: flux */).Emitter.batched(_fun121763);
}
}
}
function _fun121760() { // fn#121760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16043:1834, offset: 0x02550981, size: 99 bytes, params: 1, frame: 19
var r2;
var value5;
var defaultImport;
var value6;
const value3 = _createForOfIteratorHelperLoose_121751(env0_0);
const value4 = value3();
let done = value4.done;
if (!done) {
for (r2 = value4; true; r2 = value6) {
value5 = r2.value;
defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
defaultImport.dispatch({type: 'THREAD_DELETE', channel: value5});
value6 = value3();
done = value6.done;
if (done) {
break;
}
}
}
}
@@ -0,0 +1,89 @@
/* Metro module 15081; source: modules/threads/ThreadMemberListHooks.tsx; dependencies: [31, 1938, 7236, 482, 4594, 6903, 6890, 566, 1244, 2] */
function _fun114097(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#114097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15278:6, offset: 0x02413eb0, size: 183 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const guildRoleStore = importDefault(1938) /* metro dependency 1938: GuildRoleStore */;
const threadMemberListStore = importDefault(7236) /* metro dependency 7236: ThreadMemberListStore */;
const env0_6 = (require(482) /* metro dependency 482: Constants */).StatusTypes;
const env0_7 = [];
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadMemberListHooks.tsx');
exports.useThreadMemberListSections = useThreadMemberListSections;
}
function useThreadMemberListSections(a0, a1) { // fn#114098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15278:258, offset: 0x02413f67, size: 221 bytes, params: 3, frame: 20
const env0_0 = a0;
const env0_1 = a1;
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(_fun114099);
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildRoleStore], _fun114100);
const {version,
members} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ThreadMemberListStore],
_fun114101);
const env0_3 = members;
const value4 = a1 == null;
const binding = env0_3;
const useMemo = binding.useMemo;
return members != null ? Reflect.apply(useMemo, binding, [_fun114102, [value2, members, version, value4]]) : env0_7;
}
function _fun114099() { // fn#114099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15278:309, offset: 0x02414044, size: 102 bytes, params: 1, frame: 18
var value3;
var moduleValue;
const value2 = undefined;
if ((require == null ? value2 : require.id) != null) {
value3 = environment.__proto__;
moduleValue = require(6903) /* metro dependency 6903: GuildSubscriptionsActionCreators */;
moduleValue.subscribeChannel(require.id, env0_0,
(require(6890) /* metro dependency 6890: GuildChannelSubscriptions */).DEFAULT_RANGES);
}
return value2;
}
function _fun114100() { // fn#114100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15278:440, offset: 0x024140aa, size: 48 bytes, params: 1, frame: 12
return require != null ? GuildRoleStore.getSortedRoles(require.id) : [];
}
function _fun114101() { // fn#114101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15278:520, offset: 0x024140da, size: 52 bytes, params: 1, frame: 12
const object2 = {};
const getMemberListVersion = ThreadMemberListStore.getMemberListVersion;
const binding = env0_0;
object2.version = Reflect.apply(getMemberListVersion, ThreadMemberListStore, [binding]);
object2.members = ThreadMemberListStore.getMemberListSections(binding);
return object2;
}
function _fun114102() { // fn#114102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15278:646, offset: 0x0241410e, size: 232 bytes, params: 1, frame: 21
var environment;
var value;
if (result) {
value = environment.__proto__;
return env1_7;
}
value = env0_2.filter(function(a0) {
return a0.hoist;
});
value = value.map(function(a0) {
return {id: a0.id, label: a0.name};
});
const push = value.push;
const object2 = {};
const ONLINE = StatusTypes.ONLINE;
object2.id = ONLINE;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const WbGtnH = t.WbGtnH;
object2.label = Reflect.apply(string, intl, [WbGtnH]);
const OFFLINE = StatusTypes.OFFLINE;
string = intl.string;
const Vv0abJ = t.Vv0abJ;
Reflect.apply(push, value, [object2, {id: OFFLINE, label: Reflect.apply(string, intl, [Vv0abJ])}]);
return value.map(function({id, label}) {
var r2;
r2 = members == null || members[id] == null ? undefined : members[id].userIds;
r2 = r2 ?? [];
return {label: label, userIds: r2, id: id, roleId: id};
});
}
@@ -0,0 +1,960 @@
/* Metro module 7236; source: modules/threads/ThreadMemberListStore.tsx; dependencies: [15, 17, 18, 57, 6, 7, 1379, 1945, 6866, 4396, 6876, 1878, 661, 22, 21, 3789, 3995, 1360, 566, 694, 2] */
function _fun58039(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#58039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:6, offset: 0x016be3fd, size: 598 bytes, params: 8, frame: 21
const env0_0 = require;
const _arrayLikeToArray_58045 = 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(a0) {
return updateUserId(a0.user.id);
};
const closure2 = GUILD_ROLE_UPDATE_58048;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const env0_7 = importDefault(57) /* metro dependency 57 */;
const env0_8 = importDefault(6) /* metro dependency 6 */;
const env0_9 = importDefault(7) /* metro dependency 7 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
const guildSubscriptionsStore = importDefault(6866) /* metro dependency 6866: GuildSubscriptionsStore */;
const presenceStore = importDefault(4396) /* metro dependency 4396: PresenceStore */;
const selfPresenceStore = importDefault(6876) /* metro dependency 6876: SelfPresenceStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_16 = value.StatusTypes;
const env0_17 = value.Permissions;
let env0_18 = {};
const env0_19 = _fun58049();
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun58068(Store).displayName = 'ThreadMemberListStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
env0_18 = {};
}, THREAD_MEMBERS_UPDATE: THREAD_MEMBERS_UPDATE_58077, THREAD_UPDATE: THREAD_UPDATE_58080,
THREAD_DELETE: THREAD_DELETE_58081, CHANNEL_UPDATES: CHANNEL_UPDATES_58082,
THREAD_MEMBER_LIST_UPDATE: THREAD_MEMBER_LIST_UPDATE_58084, USER_UPDATE: closure,
PRESENCE_UPDATES: function({updates}) {
return updates.map(_fun58087).some(_fun58088);
}, GUILD_MEMBER_ADD: closure, GUILD_MEMBER_UPDATE: closure, GUILD_MEMBER_REMOVE: closure,
PRESENCES_REPLACE: PRESENCES_REPLACE_58089, GUILD_MEMBERS_CHUNK_BATCH: GUILD_MEMBERS_CHUNK_BATCH_58091,
GUILD_ROLE_UPDATE: closure2, GUILD_ROLE_DELETE: closure2, PASSIVE_UPDATE_V2: function({members}) {
return members.reduce(_fun58094, false);
}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadMemberListStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_58040() { // fn#58040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:279, offset: 0x016be653, 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_58040_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_58043(a0, a1) { // fn#58043, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:472, offset: 0x016be6b1, 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 _fun58044;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_58045(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_58045(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_58045(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun58044;
}
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 updateUserId(a0) { // fn#58047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:4464, offset: 0x016be840, size: 75 bytes, params: 2, frame: 20
var r1;
var r6;
var r0;
var propertyName;
var propertyName2;
var property;
var updateUserId;
var value3;
if (a0 == null) {
return false;
}
const binding = env0_18;
const value2 = false;
const properties = Object.keys(binding);
const properties2 = 0;
const properties3 = properties.length;
if (properties === undefined) {
r0 = value2;
} else {
r1 = value2;
r6 = properties2;
while (true) {
propertyName = properties[r6];
propertyName2 = r6 + 1;
if (propertyName === undefined) {
r0 = r1;
break;
}
property = env0_18[propertyName];
updateUserId = property.updateUserId;
if (!Reflect.apply(updateUserId, property, [a0])) {
r6 = propertyName2;
continue;
}
value3 = true;
r1 = value3;
r6 = propertyName2;
}
}
return r0;
}
function GUILD_ROLE_DELETE_58048({guildId}) { // fn#58048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:4571, offset: 0x016be88b, size: 83 bytes, params: 2, frame: 19
var r1;
var r6;
var r0;
var propertyName;
var propertyName2;
var guildId2;
var property;
var value3;
const properties = Object.keys(env0_18);
const properties3 = properties.length;
if (properties === undefined) {
r0 = false;
} else {
r1 = false;
r6 = 0;
while (true) {
propertyName = properties[r6];
propertyName2 = r6 + 1;
if (propertyName === undefined) {
r0 = r1;
break;
}
guildId2 = env0_18[propertyName].guildId;
if (guildId2 !== guildId) {
r6 = propertyName2;
continue;
}
property = env0_18[propertyName];
property.rebuild();
value3 = true;
r1 = value3;
r6 = propertyName2;
}
}
return r0;
}
function _fun58049() { // fn#58049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:1393, offset: 0x016be8de, size: 268 bytes, params: 1, frame: 15
return env0_9(MemberList_58050, [{key: 'rebuild', value: value_58051}, {key: 'updateMultipleUserIds',
value: function(a0, a1) {
var r0;
var r1;
var value2;
var env0_0 = this;
var value = a1 == null;
r0 = value || this.guildId === a1;
if (r0) {
value = a0.filter(_fun58057);
value2 = value.length !== 0;
if (value2) {
if (value.length > 50) {
this.rebuild();
r1 = true;
} else {
value.forEach(_fun58058);
value = true;
r1 = value;
}
} else {
r1 = value2;
}
r0 = r1;
}
return r0;
}}, {key: 'updateUserId', value: value_58059}, {key: 'addUserId', value: value_58060}, {key: 'removeUserId',
value: function(a0, a1) {
var r3;
var propertyName;
var propertyName2;
this.allUserIds.delete(a0);
if (a1 != null) {
reducibleJoin2: while (true) {
if (this.removeUserIdFromSection(a0, a1)) {
return true;
}
break reducibleJoin2;
}
}
var properties = Object.keys(this.sections);
var properties2 = 0;
var properties3 = properties.length;
if (properties !== undefined) {
r3 = properties2;
reducibleLoop3: while (true) {
propertyName = properties[r3];
propertyName2 = r3 + 1;
if (propertyName === undefined) {
return false;
}
if (this.removeUserIdFromSection(a0, propertyName)) {
return true;
}
r3 = propertyName2;
continue reducibleLoop3;
}
}
return false;
}}, {key: 'addUser', value: value_58062}, {key: 'findUserIdSortedPosition', value: function({userIds, usersById},
a1, a2) {
var r4;
var property;
var displayName;
var value = 0;
if (value < userIds.length) {
r4 = value;
reducibleLoop1: while (true) {
property = userIds[r4];
displayName = usersById[property].displayName;
if (displayName === a2) {
reducibleJoin9: while (true) {
if (a1 < property) {
return r4;
}
break reducibleJoin9;
}
} else if (displayName == null) {
reducibleJoin9: while (true) {
if (a2 != null) {
return r4;
}
break reducibleJoin9;
}
} else {
reducibleJoin9: while (true) {
if (a2 == null) {
break reducibleJoin9;
}
if (a2 < displayName) {
return r4;
}
break reducibleJoin9;
}
}
value = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1;
if (!(value < userIds.length)) {
return userIds.length;
}
r4 = value;
continue reducibleLoop1;
}
}
return userIds.length;
}}, {key: 'removeUserIdFromSection', value: function(a0, a1) {
var r1;
var r0;
var env0_0 = a0;
var property = this.sections[a1];
var value = a1 != null;
if (value) {
value = a0 in property.usersById;
if (value) {
delete property.usersById[a0];
property.userIds = property.userIds.filter(_fun58065);
property = this.version;
this.version = typeof property === 'bigint' ? property + 1n : +property + 1;
r1 = true;
} else {
r1 = value;
}
r0 = r1;
} else {
r0 = value;
}
return r0;
}}, {key: 'findOldState', value: function(a0) {
var propertyName;
var propertyName2;
var property2;
var property = this.sections;
var properties = Object.keys(property);
var properties2 = 0;
var properties3 = properties.length;
if (properties === undefined) {
return [undefined, undefined, false];
}
var r6 = properties2;
loopExit1: while (true) {
propertyName = properties[r6];
propertyName2 = r6 + 1;
if (propertyName === undefined) {
return [undefined, undefined, false];
}
property2 = this.sections[propertyName];
if (a0 in property2.usersById) {
break loopExit1;
}
r6 = propertyName2;
continue;
}
property = property2.usersById[a0];
return [propertyName, property.displayName, property.canViewChannel];
}}, {key: 'calculateNewState', value: value_58067}]);
}
function _fun58068(a0) { // fn#58068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:4702, offset: 0x016bf1a7, size: 141 bytes, params: 2, frame: 16
const closure = ThreadMemberListStore;
env0_6(closure, a0);
return env0_9(closure, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore, GuildMemberStore, GuildSubscriptionsStore, PresenceStore, SelfPresenceStore,
UserStore);
this.syncWith([GuildSubscriptionsStore], _fun58071);
this.syncWith([SelfPresenceStore], _fun58072);
}}, {key: 'getMemberListVersion', value: value_58073}, {key: 'getMemberListSections', value: value_58074},
{key: 'canUserViewChannel', value: value_58075}]);
}
function THREAD_MEMBERS_UPDATE_58077(a0) { // fn#58077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:5823, offset: 0x016bf42b, size: 88 bytes, params: 2, frame: 14
var addedMembers;
var removedMemberIds;
const env0_0 = a0;
if (a0.id in env0_18) {
addedMembers = a0.addedMembers;
if (addedMembers != null) {
addedMembers.forEach(_fun58078);
}
removedMemberIds = a0.removedMemberIds;
if (removedMemberIds != null) {
removedMemberIds.forEach(_fun58079);
}
return undefined;
}
return false;
}
function THREAD_UPDATE_58080({channel}) { // fn#58080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:6053, offset: 0x016bf4d8, size: 77 bytes, params: 2, frame: 6
var threadMetadata;
var value2;
if (channel.id in env0_18) {
threadMetadata = channel.threadMetadata;
value2 = undefined;
if ((threadMetadata == null ? value2 : threadMetadata.archived) !== true) {
return false;
}
delete env0_18[channel.id];
return value2;
}
return false;
}
function THREAD_DELETE_58081({channel}) { // fn#58081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:6208, offset: 0x016bf525, size: 48 bytes, params: 2, frame: 4
if (channel.id in env0_18) {
delete env0_18[channel.id];
return undefined;
}
return false;
}
function CHANNEL_UPDATES_58082({channels}) { // fn#58082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:6306, offset: 0x016bf555, size: 139 bytes, params: 2, frame: 21
var r1;
var r6;
var r0;
var propertyName;
var propertyName2;
var has;
var parentId;
var property;
var value5;
const Set = global.Set;
const set = new Set(channels.map(function(a0) {
return a0.id;
}));
const properties = Object.keys(env0_18);
const properties3 = properties.length;
if (properties === undefined) {
r0 = false;
} else {
r1 = false;
r6 = 0;
while (true) {
propertyName = properties[r6];
propertyName2 = r6 + 1;
if (propertyName === undefined) {
r0 = r1;
break;
}
has = set.has;
parentId = env0_18[propertyName].parentId;
if (!Reflect.apply(has, set, [parentId])) {
r6 = propertyName2;
continue;
}
property = env0_18[propertyName];
property.rebuild();
value5 = true;
r1 = value5;
r6 = propertyName2;
}
}
return r0;
}
function THREAD_MEMBER_LIST_UPDATE_58084({threadId, guildId, members}) { // fn#58084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:6482, offset: 0x016bf5e0, size: 139 bytes, params: 2, frame: 19
var binding;
var binding2;
var value4;
var binding22;
var property;
const parent_id = ChannelStore.getChannel(threadId)?.parent_id;
if (parent_id != null) {
binding = env0_18;
binding2 = env0_19;
value4 = Object.create(binding2.prototype, {constructor: {value: binding2}});
binding22 = new binding2(guildId, parent_id, threadId);
binding[threadId] = binding22 instanceof Object ? binding22 : value4;
property = env0_18[threadId];
property.rebuild(members.map(function(a0) {
return a0.user_id;
}));
}
}
function PRESENCE_UPDATES_58086({updates}) { // fn#58086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:6717, offset: 0x016bf676, size: 44 bytes, params: 2, frame: 12
return updates.map(function({user}) {
return updateUserId(user.id);
}).some(function(a0) {
return a0;
});
}
function PRESENCES_REPLACE_58089({presences}) { // fn#58089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:6944, offset: 0x016bf6bf, size: 166 bytes, params: 2, frame: 20
var r1;
var r5;
var r0;
var propertyName;
var propertyName2;
var property;
var updateMultipleUserIds;
var value9;
const value3 = (importDefault(22) /* metro dependency 22 */)(presences).map(function({user}) {
return user?.id;
});
const value7 = value3.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish).uniq().value();
const properties = Object.keys(env0_18);
const properties3 = properties.length;
if (properties === undefined) {
r0 = false;
} else {
r1 = false;
r5 = 0;
while (true) {
propertyName = properties[r5];
propertyName2 = r5 + 1;
if (propertyName === undefined) {
r0 = r1;
break;
}
property = env0_18[propertyName];
updateMultipleUserIds = property.updateMultipleUserIds;
if (!Reflect.apply(updateMultipleUserIds, property, [value7])) {
r5 = propertyName2;
continue;
}
value9 = true;
r1 = value9;
r5 = propertyName2;
}
}
return r0;
}
function GUILD_MEMBERS_CHUNK_BATCH_58091({chunks}) { // fn#58091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:7203, offset: 0x016bf77f, size: 158 bytes, params: 2, frame: 28
var r2;
var r3;
var r1;
var r12;
var r9;
var r0;
var value5;
var guildId;
var members;
var value6;
var binding;
var properties;
var properties2;
var properties3;
var propertyName;
var propertyName2;
var property;
var updateMultipleUserIds;
var value7;
var value8;
const value2 = _createForOfIteratorHelperLoose_58043(chunks);
const value3 = value2();
let done = value3.done;
if (done) {
r0 = false;
} else {
r2 = false;
r3 = value3;
while (true) {
value5 = r3.value;
guildId = value5.guildId;
members = value5.members;
value6 = members.map(function(a0) {
return a0.user.id;
});
binding = env0_18;
properties = Object.keys(binding);
properties2 = 0;
properties3 = properties.length;
if (properties === undefined) {
r9 = r2;
} else {
r1 = r2;
r12 = properties2;
while (true) {
propertyName = properties[r12];
propertyName2 = r12 + 1;
if (propertyName === undefined) {
r9 = r1;
break;
}
property = env0_18[propertyName];
updateMultipleUserIds = property.updateMultipleUserIds;
if (!Reflect.apply(updateMultipleUserIds, property, [value6, guildId])) {
r12 = propertyName2;
continue;
}
value7 = true;
r1 = value7;
r12 = propertyName2;
}
}
value8 = value2();
done = value8.done;
if (done) {
r0 = r9;
break;
}
r2 = r9;
r3 = value8;
continue;
}
}
return r0;
}
function PASSIVE_UPDATE_V2_58093({members}) { // fn#58093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:7558, offset: 0x016bf82c, size: 32 bytes, params: 2, frame: 13
return members.reduce(function(a0, a1) {
return updateUserId(a1.user.id) || a0;
}, false);
}
function MemberList_58050(a0, a1, a2) { // fn#58050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:1414, offset: 0x016be9ea, size: 104 bytes, params: 4, frame: 13
const value = environment.__proto__;
env1_8(this, MemberList_58050);
this.guildId = a0;
this.parentId = a1;
this.threadId = a2;
this.version = 0;
this.sections = {};
const Set = global.Set;
this.allUserIds = new Set();
}
function value_58051(a0) { // fn#58051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:1587, offset: 0x016bea52, size: 220 bytes, params: 2, frame: 14
var environment;
const version = this.version;
this.version = typeof version === 'bigint' ? version + 1n : +version + 1;
this.sections = {};
if (a0 != null) {
this.allUserIds = new global.Set(a0);
}
let value = environment.__proto__;
const env0_1 = ChannelStore.getChannel(this.parentId);
value = importDefault(22) /* metro dependency 22 */;
const Array = global.Array;
value = value(Array.from(this.allUserIds));
value = value.map(_fun58052);
value = value.sort(_fun58053);
value = value.sortBy(function(a0) {
return a0.displayName;
});
value.forEach(_fun58055);
}
function value_58056(a0, a1) { // fn#58056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:2067, offset: 0x016bebee, size: 113 bytes, params: 3, frame: 15
var r1;
var value2;
let value = a1 == null;
let r0 = value || this.guildId === a1;
if (r0) {
value = a0.filter(_fun58057);
value2 = value.length !== 0;
if (value2) {
if (value.length > 50) {
this.rebuild();
r1 = true;
} else {
value.forEach(_fun58058);
value = true;
r1 = value;
}
} else {
r1 = value2;
}
r0 = r1;
}
return r0;
}
function value_58059(a0) { // fn#58059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:2269, offset: 0x016bec92, size: 192 bytes, params: 2, frame: 26
var r0;
var value;
var value2;
var binding;
var property;
var property2;
var property3;
var property4;
var property5;
var property6;
const allUserIds = this.allUserIds;
if (allUserIds.has(a0)) {
value = this.findOldState(a0);
value2 = environment.__proto__;
binding = env1_7;
value = binding(value, 3);
property = value[0];
property2 = value[1];
property3 = value[2];
value = binding(this.calculateNewState(a0, ChannelStore.getChannel(this.parentId)), 3);
property4 = value[0];
property5 = value[1];
property6 = value[2];
value = property !== property4;
r0 = value || property2 !== property5;
r0 = !r0 ? property3 !== property6 : r0;
if (r0) {
this.removeUserId(a0, property);
this.addUser(a0, property4, property5, property6);
r0 = true;
}
return r0;
}
return false;
}
function value_58060(a0) { // fn#58060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:2564, offset: 0x016bed52, size: 94 bytes, params: 2, frame: 18
const calculateNewState = this.calculateNewState;
let value = environment.__proto__;
const getChannel = ChannelStore.getChannel;
value = env1_7(Reflect.apply(calculateNewState, this, [a0, Reflect.apply(getChannel, ChannelStore,
[this.parentId])]), 3);
this.addUser(a0, value[0], value[1], value[2]);
}
function value_58062(a0, a1, a2, a3, a4) { // fn#58062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:2916, offset: 0x016bee13, size: 235 bytes, params: 6, frame: 17
var sections;
var property;
var version;
this.allUserIds.add(a0);
let value = environment.__proto__;
value = UserStore.getUser(a0);
if (value != null) {
if (value.username !== '') {
sections = this.sections;
if (!(a1 in sections)) {
this.sections[a1] = {sectionId: a1, usersById: {}, userIds: []};
}
sections = this.sections;
property = sections[a1];
property.usersById[a0] = {userId: a0, displayName: a2, canViewChannel: a3};
if (a4) {
property.userIds.push(a0);
} else {
property.userIds.splice(this.findUserIdSortedPosition(property, a0, a2), 0, a0);
}
version = this.version;
this.version = typeof version === 'bigint' ? version + 1n : +version + 1;
}
}
}
function value_58064(a0, a1) { // fn#58064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:3559, offset: 0x016bef64, size: 106 bytes, params: 3, frame: 15
var r1;
var r0;
var version;
const env0_0 = a0;
const property = this.sections[a1];
let value = a1 != null;
if (value) {
value = a0 in property.usersById;
if (value) {
delete property.usersById[a0];
property.userIds = property.userIds.filter(_fun58065);
version = this.version;
this.version = typeof version === 'bigint' ? version + 1n : +version + 1;
r1 = true;
} else {
r1 = value;
}
r0 = r1;
} else {
r0 = value;
}
return r0;
}
function value_58067(a0, a1) { // fn#58067, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:3946, offset: 0x016bf042, size: 357 bytes, params: 3, frame: 21
var r4;
let value = environment.__proto__;
const member = GuildMemberStore.getMember(this.guildId, a0);
const user = UserStore.getUser(a0);
const currentUser = UserStore.getCurrentUser();
const value5 = undefined;
const r8 = (user == null ? value5 : user.id) === (currentUser == null ? value5 : currentUser.id) ? SelfPresenceStore.getStatus() : PresenceStore.getStatus(a0,
this.guildId);
const r1 = user != null && a1 != null && (importAll(3789) /* metro dependency 3789: PermissionUtils */).can({permission: Permissions.VIEW_CHANNEL,
user: user, context: a1});
const OFFLINE = StatusTypes.OFFLINE;
const r5 = r8 === OFFLINE || r8 === StatusTypes.INVISIBLE ? 'offline' : (member == null ? value5 : member.hoistRoleId) ?? 'online';
const nick = member == null ? value5 : member.nick;
if (nick != null) {
r4 = nick;
} else {
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
value = value.getName(user);
r4 = value;
}
const items = [r5];
items[1] = r4 == null ? value5 : r4.toLowerCase();
items[2] = r1;
return items;
}
function ThreadMemberListStore() { // fn#58069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:4714, offset: 0x016bf234, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_8(this, ThreadMemberListStore);
const value3 = env1_5(ThreadMemberListStore);
return env1_4(this, _isNativeReflectConstruct_58040() ? global.Reflect.construct(value3, arguments,
env1_5(this).constructor) : value3.apply(this, arguments));
}
function value_58070() { // fn#58070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:5037, offset: 0x016bf2a5, size: 105 bytes, params: 1, frame: 22
this.waitFor(ChannelStore, GuildMemberStore, GuildSubscriptionsStore, PresenceStore, SelfPresenceStore, UserStore);
this.syncWith([GuildSubscriptionsStore], _fun58071);
this.syncWith([SelfPresenceStore], _fun58072);
}
function value_58073(a0) { // fn#58073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:5323, offset: 0x016bf386, size: 33 bytes, params: 2, frame: 3
const value = environment.__proto__;
return env1_18[a0]?.version;
}
function value_58074(a0) { // fn#58074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:5417, offset: 0x016bf3a7, size: 33 bytes, params: 2, frame: 3
const value = environment.__proto__;
return env1_18[a0]?.sections;
}
function value_58075(a0, a1, a2) { // fn#58075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:5509, offset: 0x016bf3c8, size: 86 bytes, params: 4, frame: 5
let value = environment.__proto__;
let property = env1_18[a0];
if (property == null) {
return false;
}
property = property.sections[a1];
value = undefined;
const r2 = property == null ? value : property.usersById[a2];
const canViewChannel = r2 == null ? value : r2.canViewChannel;
return canViewChannel != null && canViewChannel;
}
function _fun58078({userId}) { // fn#58078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:5931, offset: 0x016bf483, size: 46 bytes, params: 2, frame: 11
return env1_18[env0_0.id].addUserId(userId);
}
function _fun58079(a0) { // fn#58079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:6009, offset: 0x016bf4b1, size: 39 bytes, params: 2, frame: 11
return env1_18[env0_0.id].removeUserId(a0);
}
function _fun58052(a0) { // fn#58052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:1747, offset: 0x016beb2e, size: 86 bytes, params: 2, frame: 14
let value = env0_0.calculateNewState(a0, env0_1);
value = env2_7(value, 3);
return {userId: a0, sectionId: value[0], displayName: value[1], canViewChannel: value[2]};
}
function _fun58053({userId}, {userId}) { // fn#58053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:1872, offset: 0x016beb84, size: 55 bytes, params: 3, frame: 13
const value = environment.__proto__.__proto__;
return (importDefault(21) /* metro dependency 21: SnowflakeUtils */).compare(userId, userId);
}
function _fun58055({userId, sectionId, displayName, canViewChannel}) { // fn#58055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:1954, offset: 0x016bebbb, size: 51 bytes, params: 2, frame: 19
env0_0.addUser(userId, sectionId, displayName, canViewChannel, true);
}
function _fun58057(a0) { // fn#58057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:2134, offset: 0x016bec5f, size: 28 bytes, params: 2, frame: 11
return env0_0.allUserIds.has(a0);
}
function _fun58058(a0) { // fn#58058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:2210, offset: 0x016bec7b, size: 23 bytes, params: 2, frame: 11
return env0_0.updateUserId(a0);
}
function _fun58071() { // fn#58071, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:5093, offset: 0x016bf30e, size: 75 bytes, params: 1, frame: 20
var r1;
var r5;
var r0;
var propertyName;
var propertyName2;
var has;
var value4;
const subscribedThreadIds = GuildSubscriptionsStore.getSubscribedThreadIds();
const binding = env2_18;
const value3 = false;
const properties = Object.keys(binding);
const properties2 = 0;
const properties3 = properties.length;
if (properties === undefined) {
r0 = value3;
} else {
r1 = value3;
r5 = properties2;
while (true) {
propertyName = properties[r5];
propertyName2 = r5 + 1;
if (propertyName === undefined) {
r0 = r1;
break;
}
has = subscribedThreadIds.has;
if (Reflect.apply(has, subscribedThreadIds, [propertyName])) {
r5 = propertyName2;
continue;
}
delete env2_18[propertyName];
value4 = true;
r1 = value4;
r5 = propertyName2;
}
}
return r0;
}
function _fun58072() { // fn#58072, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7414:5211, offset: 0x016bf359, size: 45 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__;
return updateUserId(UserStore.getCurrentUser()?.id);
}
@@ -0,0 +1,353 @@
/* Metro module 7158; source: modules/threads/ThreadMembersStore.tsx; dependencies: [6, 7, 15, 17, 18, 1383, 1379, 22, 566, 694, 2] */
function _fun57425(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:6, offset: 0x013e5d3c, size: 481 bytes, params: 8, frame: 22
const _arrayLikeToArray_57431 = 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({channel}) {
return updateFromThread_57433(channel);
};
const closure2 = function({threads}) {
threads.forEach(updateFromServerThread_57441);
};
const closure3 = SEARCH_MESSAGES_SUCCESS_57436;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const env0_7 = (require(1383) /* metro dependency 1383: ChannelRecord */).ALL_CHANNEL_TYPES;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
let env0_9 = {};
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
let value = _fun57442(Store);
value.displayName = 'ThreadMembersStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function(a0) {
env0_9 = {};
a0.guilds.forEach(updateFromGuild_57432);
}, OVERLAY_INITIALIZE: function({threadMembers}) {
var object = {};
copyDataProperties(object, threadMembers, object);
env0_9 = object;
}, GUILD_CREATE: function({guild}) {
updateFromGuild_57432(guild);
}, GUILD_DELETE: function(a0) {
_fun57452(a0.guild.id);
}, CHANNEL_DELETE: function(a0) {
_fun57455(a0.channel.id);
}, THREAD_CREATE: closure, THREAD_UPDATE: closure, THREAD_LIST_SYNC: function({threads}) {
threads.forEach(updateFromThread_57433);
}, THREAD_MEMBERS_UPDATE: THREAD_MEMBERS_UPDATE_57458, SEARCH_MESSAGES_SUCCESS: closure3,
MOD_VIEW_SEARCH_MESSAGES_SUCCESS: closure3, LOAD_THREADS_SUCCESS: closure2,
LOAD_ARCHIVED_THREADS_SUCCESS: closure2, THREAD_DELETE: THREAD_DELETE_57459,
LOAD_MESSAGES_SUCCESS: function(a0) {
var r2;
var r3;
var r7;
var r0;
var value5;
var value6;
var value2 = _createForOfIteratorHelperLoose_57429(a0.messages);
var value3 = value2();
var value4 = false;
if (value3.done) {
r0 = value4;
} else {
r2 = value4;
r3 = value3;
while (true) {
value5 = updateFromServerThread_57441(r3.value.thread);
r7 = value5 || r2;
value6 = value2();
if (value6.done) {
r0 = r7;
break;
}
r2 = r7;
r3 = value6;
continue;
}
}
return r0;
}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadMembersStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_57426() { // fn#57426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:189, offset: 0x013e5f1d, 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_57426_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_57429(a0, a1) { // fn#57429, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:382, offset: 0x013e5f7b, 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 _fun57430;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_57431(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_57431(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_57431(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun57430;
}
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 updateFromGuild_57432({threads}) { // fn#57432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:1301, offset: 0x013e60ed, size: 36 bytes, params: 2, frame: 11
if (threads != null) {
threads.forEach(updateFromThread_57433);
}
}
function updateFromThread_57433(a0) { // fn#57433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:1384, offset: 0x013e6111, size: 190 bytes, params: 2, frame: 17
var r5;
var id;
var binding;
var object2;
var property;
if (ALL_CHANNEL_TYPES.has(a0.type)) {
id = a0.id;
if (!(id in env0_9)) {
binding = env0_9;
id = a0.id;
object2 = {};
object2.guildId = a0.guild_id;
object2.parentId = a0.parent_id;
r5 = a0.memberCount ?? 0;
object2.memberCount = r5;
r5 = a0.memberIdsPreview ?? [];
object2.memberIdsPreview = r5;
binding[id] = object2;
}
binding = env0_9;
id = a0.id;
property = binding[id];
if (a0.memberCount != null) {
property.memberCount = a0.memberCount;
}
if (a0.memberIdsPreview != null) {
property.memberIdsPreview = a0.memberIdsPreview;
}
return undefined;
}
return false;
}
function MOD_VIEW_SEARCH_MESSAGES_SUCCESS_57436({data}) { // fn#57436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:1930, offset: 0x013e6205, size: 37 bytes, params: 2, frame: 12
data.forEach(function({threads, messages}) {
messages.forEach(_fun57438);
threads.forEach(_fun57440);
});
return false;
}
function updateFromServerThread_57441(a0) { // fn#57441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2175, offset: 0x013e62c3, size: 70 bytes, params: 2, frame: 13
if (a0 == null) {
return false;
}
if (a0.id in env0_9) {
return false;
}
const channel = ChannelStore.getChannel(a0.id);
if (channel == null) {
return false;
}
updateFromThread_57433(channel);
return true;
}
function _fun57442(a0) { // fn#57442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2317, offset: 0x013e6309, size: 141 bytes, params: 2, frame: 16
const closure = ThreadMembersStore;
env0_6(closure, a0);
return env0_3(closure, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore);
}}, {key: 'getMemberCount', value: value_57445}, {key: 'getMemberIdsPreview', value: value_57446},
{key: 'getInitialOverlayState', value: value_57447}]);
}
function GUILD_DELETE_57451({guild}) { // fn#57451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3282, offset: 0x013e644b, size: 29 bytes, params: 2, frame: 11
GUILD_DELETE_57451DeleteForGuild(guild.id);
}
function CHANNEL_DELETE_57454({channel}) { // fn#57454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3410, offset: 0x013e64a5, size: 29 bytes, params: 2, frame: 11
CHANNEL_DELETE_57454DeleteForChannel(channel.id);
}
function THREAD_MEMBERS_UPDATE_57458(a0) { // fn#57458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3723, offset: 0x013e651d, size: 67 bytes, params: 2, frame: 4
const property = env0_9[a0.id];
if (property == null) {
return false;
}
if (a0.memberIdsPreview != null) {
property.memberIdsPreview = a0.memberIdsPreview;
}
property.memberCount = a0.memberCount;
}
function THREAD_DELETE_57459({channel}) { // fn#57459, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:4134, offset: 0x013e6560, size: 28 bytes, params: 2, frame: 2
delete env0_9[channel.id];
}
function _fun57437({threads, messages}) { // fn#57437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2004, offset: 0x013e622a, size: 51 bytes, params: 2, frame: 13
messages.forEach(function(a0) {
a0.forEach(_fun57439);
});
threads.forEach(_fun57440);
}
function value_57445(a0) { // fn#57445, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2694, offset: 0x013e6396, size: 45 bytes, params: 2, frame: 4
let value = environment.__proto__;
const property = env1_9[a0];
value = null;
const memberCount = value == property ? undefined : property.memberCount;
return value != memberCount ? memberCount : value;
}
function value_57446(a0) { // fn#57446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2809, offset: 0x013e63c3, size: 45 bytes, params: 2, frame: 4
let value = environment.__proto__;
const property = env1_9[a0];
value = null;
const memberIdsPreview = value == property ? undefined : property.memberIdsPreview;
return value != memberIdsPreview ? memberIdsPreview : value;
}
function GUILD_DELETE_57451DeleteForGuild(a0) { // fn#57452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3321, owner: GUILD_DELETE_57451.deleteForGuild, offset: 0x013e6468, size: 61 bytes, params: 2, frame: 15
const env0_0 = a0;
const defaultImport = importDefault(22) /* metro dependency 22 */;
env1_9 = defaultImport.omitBy(env1_9, _fun57453);
}
function CHANNEL_DELETE_57454DeleteForChannel(a0) { // fn#57455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3453, owner: CHANNEL_DELETE_57454.deleteForChannel, offset: 0x013e64c2, size: 61 bytes, params: 2, frame: 15
const env0_0 = a0;
const defaultImport = importDefault(22) /* metro dependency 22 */;
env1_9 = defaultImport.omitBy(env1_9, _fun57456);
}
function _fun57438(a0) { // fn#57438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2042, offset: 0x013e625d, size: 24 bytes, params: 2, frame: 11
a0.forEach(_fun57439);
}
function _fun57440(a0) { // fn#57440, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2124, offset: 0x013e629f, size: 36 bytes, params: 2, frame: 11
let value = environment.__proto__.__proto__;
const r2 = updateFromServerThread_57441(a0) || env1_0;
value = environment.__proto__;
}
function _fun57439({thread}) { // fn#57439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2057, offset: 0x013e6275, size: 42 bytes, params: 2, frame: 11
let value = environment.__proto__.__proto__.__proto__;
const r2 = updateFromServerThread_57441(thread) || env2_0;
value = environment.__proto__.__proto__;
}
@@ -0,0 +1,706 @@
/* Metro module 6898; source: modules/threads/ThreadMessageStore.tsx; dependencies: [6, 7, 15, 17, 18, 1383, 3794, 1885, 1379, 4814, 1243, 661, 22, 21, 4625, 566, 694, 2] */
function _fun54822(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:6, offset: 0x0136ee18, size: 700 bytes, params: 8, frame: 24
let env0_0 = require;
const _arrayLikeToArray_54828 = 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 updateFromThreadMessages = function(a0) {
var value2;
var env0_0 = a0;
if (a0.type !== MessageTypes.THREAD_STARTER_MESSAGE) {
value2 = ChannelStore.getChannel(a0.channel_id);
if (value2 != null) {
updateState(value2, _fun54833);
}
}
};
const updateFromThread = function(a0) {
var env0_0 = a0;
updateState(a0, _fun54835);
};
const closure = function({channel}) {
updateFromThread(channel);
};
const closure2 = function({threads}) {
threads.forEach(updateFromServerThread);
};
const closure3 = function({data}) {
data.forEach(_fun54840);
};
const closure4 = RELATIONSHIP_ADD_54843;
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 channelRecordModule = require(1383) /* metro dependency 1383: ChannelRecord */;
const env0_8 = channelRecordModule.ALL_CHANNEL_TYPES;
const env0_9 = channelRecordModule.THREAD_CHANNEL_TYPES;
const messageRecord = importDefault(3794) /* metro dependency 3794: MessageRecord */;
const userRecord = importDefault(1885) /* metro dependency 1885: UserRecord */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const env0_14 = (require(1243) /* metro dependency 1243: ThreadConstants */).MAX_THREAD_MESSAGE_COUNT;
const env0_15 = (require(661) /* metro dependency 661: Constants */).MessageTypes;
const Set = global.Set;
let set = new Set();
const env0_17 = {};
const env0_18 = {};
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun54844(Store).displayName = 'ThreadMessageStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: CONNECTION_OPEN_54851,
OVERLAY_INITIALIZE: OVERLAY_INITIALIZE_54852, GUILD_CREATE: function({guild}) {
updateFromGuild(guild);
}, GUILD_DELETE: function(a0) {
_fun54855(a0.guild.id);
}, THREAD_CREATE: closure, THREAD_UPDATE: closure, THREAD_LIST_SYNC: function({threads, mostRecentMessages}) {
threads.forEach(updateFromThread);
if (mostRecentMessages != null) {
mostRecentMessages.forEach(_fun54858);
}
}, LOAD_THREADS_SUCCESS: closure2, LOAD_ARCHIVED_THREADS_SUCCESS: closure2, RELATIONSHIP_ADD: closure4,
RELATIONSHIP_UPDATE: closure4, RELATIONSHIP_REMOVE: closure4, SEARCH_MESSAGES_SUCCESS: closure3,
MOD_VIEW_SEARCH_MESSAGES_SUCCESS: closure3, THREAD_DELETE: THREAD_DELETE_54860, CHANNEL_DELETE: function(a0) {
_fun54862(a0.channel.id);
}, MESSAGE_CREATE: MESSAGE_CREATE_54864, MESSAGE_UPDATE: MESSAGE_UPDATE_54866, MESSAGE_DELETE: MESSAGE_DELETE_54868,
MESSAGE_DELETE_BULK: MESSAGE_DELETE_BULK_54870, LOAD_MESSAGES_SUCCESS: LOAD_MESSAGES_SUCCESS_54874});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadMessageStore.tsx');
exports.default = set;
}
function _isNativeReflectConstruct_54823() { // fn#54823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:310, offset: 0x0136f0d4, 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_54823_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_54826(a0, a1) { // fn#54826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:503, offset: 0x0136f132, 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 _fun54827;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_54828(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_54828(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_54828(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun54827;
}
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 updateState(a0, a1) { // fn#54829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:1437, offset: 0x0136f2a4, size: 145 bytes, params: 3, frame: 19
var updateWithStateBinding;
var id;
var binding;
if (ALL_CHANNEL_TYPES.has(a0.type)) {
updateWithStateBinding = updateWithState;
id = a0.id;
if (!(id in env0_17)) {
env0_17[a0.id] = {guildId: a0.guild_id, parentId: a0.parent_id, count: a0.messageCount ?? 0,
mostRecentRawMessage: null, mostRecentMessage: null};
}
binding = env0_17;
id = a0.id;
updateWithStateBinding(binding[id], a1);
}
}
function updateWithState(a0, a1) { // fn#54830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:1690, offset: 0x0136f335, size: 67 bytes, params: 3, frame: 13
env0_18[a0.parentId] = (env0_18[a0.parentId] ?? 0) + 1;
a1(a0);
}
function updateFromGuild({threads, threadMessages}) { // fn#54831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:1781, offset: 0x0136f378, size: 63 bytes, params: 2, frame: 13
if (threads != null) {
threads.forEach(updateFromThread);
}
if (threadMessages != null) {
threadMessages.forEach(updateFromThreadMessages);
}
}
function updateFromThreadMessages(a0) { // fn#54832, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:1930, offset: 0x0136f3b7, size: 77 bytes, params: 2, frame: 14
var value2;
const env0_0 = a0;
const type = a0.type;
const THREAD_STARTER_MESSAGE = MessageTypes.THREAD_STARTER_MESSAGE;
if (type !== THREAD_STARTER_MESSAGE) {
value2 = ChannelStore.getChannel(a0.channel_id);
if (value2 != null) {
updateState(value2, _fun54833);
}
}
}
function updateFromThread(a0) { // fn#54834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:2120, offset: 0x0136f420, size: 31 bytes, params: 2, frame: 13
const env0_0 = a0;
updateState(a0, _fun54835);
}
function updateFromServerThread(a0) { // fn#54836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:2404, offset: 0x0136f4b5, size: 70 bytes, params: 2, frame: 13
if (a0 == null) {
return false;
}
if (a0.id in env0_17) {
return false;
}
const channel = ChannelStore.getChannel(a0.id);
if (channel == null) {
return false;
}
updateFromThread(channel);
return true;
}
function MOD_VIEW_SEARCH_MESSAGES_SUCCESS_54839({data}) { // fn#54839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:2698, offset: 0x0136f531, size: 29 bytes, params: 2, frame: 11
data.forEach(function({messages, threads}) {
messages.forEach(_fun54841);
threads.forEach(updateFromServerThread);
});
}
function RELATIONSHIP_ADD_54843() { // fn#54843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:2889, offset: 0x0136f5b4, size: 102 bytes, params: 1, frame: 23
var r6;
var propertyName;
var propertyName2;
var property;
var mostRecentMessage;
var getMessage;
var id;
var value2;
for (propertyName in env0_17) {
property = env0_17[propertyName];
if (property == null) {
r6 = propertyName2;
continue;
}
mostRecentMessage = property.mostRecentMessage;
if (mostRecentMessage == null) {
r6 = propertyName2;
continue;
}
getMessage = MessageStore.getMessage;
mostRecentMessage = property.mostRecentMessage;
id = mostRecentMessage.id;
value2 = Reflect.apply(getMessage, MessageStore, [propertyName, id]);
if (value2 == null) {
r6 = propertyName2;
continue;
}
property.mostRecentMessage = value2;
r6 = propertyName2;
}
}
function _fun54844(a0) { // fn#54844, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:3086, offset: 0x0136f61a, size: 164 bytes, params: 2, frame: 16
const closure = ThreadMessageStore;
env0_7(closure, a0);
return env0_4(closure, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore, MessageStore);
}}, {key: 'getCount', value: value_54847}, {key: 'getMostRecentMessage', value: value_54848},
{key: 'getChannelThreadsVersion', value: value_54849}, {key: 'getInitialOverlayState', value: value_54850}]);
}
function CONNECTION_OPEN_54851({guilds}) { // fn#54851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:4094, offset: 0x0136f7a1, size: 50 bytes, params: 2, frame: 11
env0_18 = {};
env0_16.clear();
guilds.forEach(updateFromGuild);
}
function OVERLAY_INITIALIZE_54852({threadMessages}) { // fn#54852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:4196, offset: 0x0136f7d3, size: 161 bytes, params: 2, frame: 24
var r14;
var r5;
var propertyName;
var propertyName2;
var mostRecentMessage;
var property;
var object3;
var author;
var prototype;
var value2;
var userRecord;
var value3;
var value4;
var messageRecord;
var value5;
const object4 = {};
copyDataProperties(object4, threadMessages, r14);
for (propertyName in object4) {
mostRecentMessage = threadMessages[propertyName].mostRecentMessage;
if (mostRecentMessage == null) {
r5 = propertyName2;
continue;
}
property = threadMessages[propertyName];
object3 = {};
copyDataProperties(object3, mostRecentMessage, r14);
author = mostRecentMessage.author;
prototype = UserRecord.prototype;
value2 = Object.create(prototype, {constructor: {value: UserRecord}});
userRecord = new UserRecord();
value3 = userRecord instanceof Object ? userRecord : value2;
object3['author'] = value3;
prototype = MessageRecord.prototype;
value4 = Object.create(prototype, {constructor: {value: MessageRecord}});
messageRecord = new MessageRecord();
value5 = messageRecord instanceof Object ? messageRecord : value4;
property.mostRecentMessage = value5;
r5 = propertyName2;
r14 = UserRecord;
}
}
function GUILD_DELETE_54854({guild}) { // fn#54854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:4458, offset: 0x0136f88c, size: 29 bytes, params: 2, frame: 11
GUILD_DELETE_54854DeleteForGuild(guild.id);
}
function THREAD_LIST_SYNC_54857({threads, mostRecentMessages}) { // fn#54857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:4712, offset: 0x0136f90f, size: 59 bytes, params: 2, frame: 12
threads.forEach(updateFromThread);
if (mostRecentMessages != null) {
mostRecentMessages.forEach(function(a0) {
var env0_0 = a0;
var value2 = ChannelStore.getChannel(a0.channel_id);
if (value2 != null && a0.type !== MessageTypes.THREAD_STARTER_MESSAGE) {
updateState(value2, _fun54859);
}
});
}
}
function THREAD_DELETE_54860({channel}) { // fn#54860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:5357, offset: 0x0136f99d, size: 28 bytes, params: 2, frame: 2
delete env0_17[channel.id];
}
function CHANNEL_DELETE_54861({channel}) { // fn#54861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:5429, offset: 0x0136f9b9, size: 29 bytes, params: 2, frame: 11
CHANNEL_DELETE_54861DeleteForChannel(channel.id);
}
function MESSAGE_CREATE_54864({message, optimistic, isPushNotification, sendMessageOptions}) { // fn#54864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:5577, offset: 0x0136fa1b, size: 235 bytes, params: 2, frame: 19
var r4;
var r0;
var value6;
var isForumPost2;
var id;
var defaultImport;
var updateStateBinding;
if (optimistic) {
return false;
}
if (isPushNotification) {
return false;
}
if (sendMessageOptions != null) {
return false;
}
var value;
const channel = ChannelStore.getChannel(message.channel_id);
let r1 = channel == null || !THREAD_CHANNEL_TYPES.has(channel.type);
if (r1) {
r0 = !r1;
} else {
value6 = message.type !== MessageTypes.THREAD_STARTER_MESSAGE;
if (value6) {
isForumPost2 = channel.isForumPost();
if (isForumPost2) {
id = message.id;
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
r1 = id !== defaultImport.castChannelIdAsMessageId(channel.id);
} else {
r1 = !isForumPost2;
}
r4 = r1;
} else {
r4 = value6;
}
if (r4) {
updateStateBinding = updateState;
value = undefined;
updateStateBinding(channel, _fun54865);
r1 = value;
} else {
r1 = !!r4;
}
r0 = r1;
}
return r0;
}
function MESSAGE_UPDATE_54866({message}) { // fn#54866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:6043, offset: 0x0136fb4e, size: 114 bytes, params: 2, frame: 18
const property = env0_17[message.channel_id];
const r5 = property?.mostRecentRawMessage ?? property?.mostRecentMessage;
if (property == null) {
return false;
}
if (r5 == null) {
return false;
}
if (r5.id !== message.id) {
return false;
}
updateWithState(property, _fun54867);
}
function MESSAGE_DELETE_54868({id, channelId}) { // fn#54868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:6493, offset: 0x0136fc4d, size: 127 bytes, params: 2, frame: 18
const property = env0_17[channelId];
if (property == null) {
return false;
}
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
const env0_1 = defaultImport.castChannelIdAsMessageId(channelId) !== id;
const binding = env0_16;
const env0_2 = !binding.has(id);
updateWithState(property, _fun54869);
}
function MESSAGE_DELETE_BULK_54870({ids, channelId}) { // fn#54870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:6868, offset: 0x0136fd5f, size: 98 bytes, params: 2, frame: 16
const property = env0_17[channelId];
if (property == null) {
return false;
}
if (ids.filter(_fun54871).length > 0) {
updateWithState(property, _fun54872);
}
}
function LOAD_MESSAGES_SUCCESS_54874(a0) { // fn#54874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:7289, offset: 0x0136fe92, size: 190 bytes, params: 2, frame: 20
var r6;
var r7;
var r9;
var r0;
var updateFromServerThreadBinding;
var value5;
var thread;
var value6;
var value7;
const env0_0 = a0;
const value2 = _createForOfIteratorHelperLoose_54826(a0.messages);
const value3 = value2();
let done = value3.done;
const value4 = false;
if (done) {
r0 = value4;
} else {
r6 = value4;
r7 = value3;
while (true) {
updateFromServerThreadBinding = updateFromServerThread;
value5 = r7.value;
thread = value5.thread;
value6 = updateFromServerThreadBinding(thread);
r9 = value6 || r6;
value7 = value2();
done = value7.done;
if (done) {
r0 = r9;
break;
}
r6 = r9;
r7 = value7;
continue;
}
}
if (!a0.isAfter) {
if (a0.isBefore) {
return r0;
}
if (a0.hasMoreAfter) {
return r0;
}
var channel = ChannelStore.getChannel(a0.channelId);
if (channel == null) {
return r0;
}
if (THREAD_CHANNEL_TYPES.has(channel.type)) {
updateState(channel, _fun54875);
return undefined;
}
}
return r0;
}
function _fun54833(a0) { // fn#54833, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:2062, offset: 0x0136f404, size: 28 bytes, params: 2, frame: 2
a0.mostRecentRawMessage = env0_0;
a0.mostRecentMessage = null;
}
function _fun54835(a0) { // fn#54835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:2164, offset: 0x0136f43f, size: 118 bytes, params: 2, frame: 7
if (env0_0.messageCount != null) {
a0.count = env0_0.messageCount;
}
if (env0_0.lastMessageId != null && (a0.mostRecentRawMessage ?? a0.mostRecentMessage)?.id !== env0_0.lastMessageId) {
a0.mostRecentRawMessage = null;
a0.mostRecentMessage = null;
}
}
function _fun54840({messages, threads}) { // fn#54840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:2756, offset: 0x0136f54e, size: 53 bytes, params: 2, frame: 12
messages.forEach(function(a0) {
a0.forEach(_fun54842);
});
threads.forEach(updateFromServerThread);
}
function value_54847(a0) { // fn#54847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:3459, offset: 0x0136f6dc, size: 44 bytes, params: 2, frame: 4
let value = environment.__proto__;
const property = env1_17[a0];
value = null;
const count = value == property ? undefined : property.count;
return value != count ? count : value;
}
function value_54848(a0) { // fn#54848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:3569, offset: 0x0136f708, size: 153 bytes, params: 2, frame: 16
var value5;
let value = environment.__proto__;
const property = env1_17[a0];
const value2 = null;
if (value2 == property) {
return value2;
}
let mostRecentMessage = property.mostRecentMessage;
let r2 = value2 == mostRecentMessage && value2 != property.mostRecentRawMessage;
if (r2) {
value5 = MessageStore.getMessage(a0, property.mostRecentRawMessage.id);
if (value2 != value5) {
r2 = value5;
} else {
value = require(4625) /* metro dependency 4625: MessageRecordUtils */;
value = value.createMessageRecord(property.mostRecentRawMessage);
r2 = value;
}
property.mostRecentMessage = r2;
property.mostRecentRawMessage = value2;
}
mostRecentMessage = property.mostRecentMessage;
return value2 != mostRecentMessage ? mostRecentMessage : value2;
}
function GUILD_DELETE_54854DeleteForGuild(a0) { // fn#54855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:4497, owner: GUILD_DELETE_54854.deleteForGuild, offset: 0x0136f8a9, size: 61 bytes, params: 2, frame: 15
const env0_0 = a0;
const defaultImport = importDefault(22) /* metro dependency 22 */;
env1_17 = defaultImport.omitBy(env1_17, _fun54856);
}
function _fun54858(a0) { // fn#54858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:4824, offset: 0x0136f94a, size: 83 bytes, params: 2, frame: 15
const env0_0 = a0;
const channel = ChannelStore.getChannel(a0.channel_id);
if (channel != null && a0.type !== MessageTypes.THREAD_STARTER_MESSAGE) {
updateState(channel, _fun54859);
}
}
function CHANNEL_DELETE_54861DeleteForChannel(a0) { // fn#54862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:5472, owner: CHANNEL_DELETE_54861.deleteForChannel, offset: 0x0136f9d6, size: 69 bytes, params: 2, frame: 16
const env0_0 = a0;
const defaultImport = importDefault(22) /* metro dependency 22 */;
env1_17 = defaultImport.omitBy(env1_17, _fun54863);
delete env1_18[a0];
}
function _fun54865(a0) { // fn#54865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:5939, offset: 0x0136fb06, size: 72 bytes, params: 2, frame: 14
const Math = global.Math;
a0.count = Math.min(a0.count + 1, MAX_THREAD_MESSAGE_COUNT);
a0.mostRecentRawMessage = message;
a0.mostRecentMessage = null;
}
function _fun54867(a0) { // fn#54867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:6257, offset: 0x0136fbc0, size: 141 bytes, params: 2, frame: 15
var value;
if (a0.mostRecentMessage != null) {
value = environment.__proto__;
value = require(4625) /* metro dependency 4625: MessageRecordUtils */;
a0.mostRecentMessage = value.updateMessageRecord(a0.mostRecentMessage, message);
}
if (a0.mostRecentRawMessage != null) {
value = environment.__proto__;
value = require(4625) /* metro dependency 4625: MessageRecordUtils */;
a0.mostRecentRawMessage = value.updateServerMessage(a0.mostRecentRawMessage, message);
}
}
function _fun54869(a0) { // fn#54869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:6651, offset: 0x0136fccc, size: 147 bytes, params: 2, frame: 16
const r3 = a0.mostRecentRawMessage ?? a0.mostRecentMessage;
if (r3 != null && r3.id === id) {
a0.mostRecentMessage = null;
a0.mostRecentRawMessage = null;
}
a0.count = env0_1 && env0_2 ? global.Math.max(a0.count - 1, 0) : a0.count;
const binding = env1_16;
binding.add(id);
}
function _fun54871(a0) { // fn#54871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:6969, offset: 0x0136fdc1, size: 75 bytes, params: 2, frame: 13
const value = environment.__proto__;
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
const value3 = defaultImport.castChannelIdAsMessageId(channelId) !== a0;
const binding = env1_16;
return value3 && !binding.has(a0);
}
function _fun54872(a0) { // fn#54872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:7078, offset: 0x0136fe0c, size: 112 bytes, params: 2, frame: 14
const r3 = a0.mostRecentRawMessage ?? a0.mostRecentMessage;
if (r3 != null && ids.includes(r3.id)) {
a0.mostRecentMessage = null;
a0.mostRecentRawMessage = null;
}
a0.count = a0.count - length;
ids.forEach(_fun54873);
}
function _fun54875(a0) { // fn#54875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:7581, offset: 0x0136ff50, size: 164 bytes, params: 2, frame: 7
var r3;
var property;
var value2;
let messages = env0_0.messages;
let length = messages.length;
if (length === 0) {
a0.mostRecentRawMessage = null;
a0.mostRecentMessage = null;
a0.count = 0;
} else {
messages = env0_0.messages;
property = messages[0];
value2 = null;
r3 = value2 != property ? property : value2;
messages = env0_0.messages;
length = messages.length;
value = environment.__proto__;
a0.count = length >= MAX_THREAD_MESSAGE_COUNT ? MAX_THREAD_MESSAGE_COUNT : a0.count;
if ((value2 == r3 ? undefined : r3.type) !== MessageTypes.THREAD_STARTER_MESSAGE) {
a0.mostRecentRawMessage = r3;
a0.mostRecentMessage = value2;
}
}
}
function _fun54841(a0) { // fn#54841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:2794, offset: 0x0136f583, size: 24 bytes, params: 2, frame: 11
a0.forEach(function(a0) {
updateFromServerThread(a0.thread);
});
}
function _fun54856(a0) { // fn#54856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:4545, offset: 0x0136f8e6, size: 41 bytes, params: 2, frame: 3
var value2;
const guildId = a0.guildId;
const value = guildId === env0_0;
if (value) {
value2 = environment.__proto__.__proto__;
delete env2_18[a0.parentId];
}
return value;
}
function _fun54873(a0) { // fn#54873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7076:7249, offset: 0x0136fe7c, size: 22 bytes, params: 2, frame: 11
return env2_16.add(a0);
}
@@ -0,0 +1,68 @@
/* Metro module 10914; source: modules/threads/ThreadNotificationSettings.tsx; dependencies: [1379, 4864, 3786, 1243, 661, 1391, 566, 2] */
function _fun83640(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11100:6, offset: 0x01f21fa7, size: 207 bytes, params: 8, frame: 20
let env0_0 = require;
const closure = computeThreadNotificationSetting;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
const env0_5 = (require(1243) /* metro dependency 1243: ThreadConstants */).ThreadMemberFlags;
const env0_6 = (require(661) /* metro dependency 661: Constants */).UserNotificationSettings;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadNotificationSettings.tsx');
exports.computeThreadNotificationSetting = closure;
exports.useThreadNotificationSetting = function(a0) {
var env0_0 = a0;
return require(dependencyMap[6]).useStateFromStores([JoinedThreadsStore, UserGuildSettingsStore, ChannelStore],
_fun83643, [a0]);
};
}
function computeThreadNotificationSetting({id, parent_id}) { // fn#83641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11100:189, offset: 0x01f22076, size: 407 bytes, params: 2, frame: 20
let value = a1;
const value2 = a2;
const value3 = a3;
const r4 = value !== undefined ? value : JoinedThreadsStore;
const r3 = value2 !== undefined ? value2 : UserGuildSettingsStore;
const r5 = value3 !== undefined ? value3 : ChannelStore;
value = r4.flags(id);
if (value == null) {
value = environment;
return ThreadMemberFlags.NO_MESSAGES;
}
const flagUtilsModule = require(1391) /* metro dependency 1391: FlagUtils */;
let hasFlag = flagUtilsModule.hasFlag;
const ALL_MESSAGES = ThreadMemberFlags.ALL_MESSAGES;
if (Reflect.apply(hasFlag, flagUtilsModule, [value, ALL_MESSAGES])) {
return ThreadMemberFlags.ALL_MESSAGES;
}
const moduleValue2 = flagUtilsModule;
hasFlag = moduleValue2.hasFlag;
const ONLY_MENTIONS = ThreadMemberFlags.ONLY_MENTIONS;
if (Reflect.apply(hasFlag, moduleValue2, [value, ONLY_MENTIONS])) {
return ThreadMemberFlags.ONLY_MENTIONS;
}
const moduleValue3 = flagUtilsModule;
hasFlag = moduleValue3.hasFlag;
let NO_MESSAGES = ThreadMemberFlags.NO_MESSAGES;
if (Reflect.apply(hasFlag, moduleValue3, [value, NO_MESSAGES])) {
return ThreadMemberFlags.NO_MESSAGES;
}
value = r5.getChannel(parent_id);
if (value == null) {
return ThreadMemberFlags.NO_MESSAGES;
}
if (r3.isGuildOrCategoryOrChannelMuted(value.guild_id, value.id)) {
return ThreadMemberFlags.NO_MESSAGES;
}
value = r3.resolvedMessageNotifications(value);
NO_MESSAGES = UserNotificationSettings.NO_MESSAGES;
return value === NO_MESSAGES ? ThreadMemberFlags.NO_MESSAGES : value === UserNotificationSettings.ONLY_MENTIONS ? ThreadMemberFlags.ONLY_MENTIONS : ThreadMemberFlags.ALL_MESSAGES;
}
function useThreadNotificationSetting(a0) { // fn#83642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11100:923, offset: 0x01f2220d, size: 91 bytes, params: 2, frame: 17
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([JoinedThreadsStore,
UserGuildSettingsStore, ChannelStore], _fun83643, [a0]);
}
@@ -0,0 +1,83 @@
/* Metro module 7164; source: modules/threads/ThreadSummaryStore.tsx; dependencies: [6, 7, 15, 17, 18, 566, 694, 2] */
function _fun57493(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57493, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7342:6, offset: 0x013e716e, size: 286 bytes, params: 8, frame: 19
const closure = function() {
env0_5 = false;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(6) /* metro dependency 6 */;
const env0_1 = importDefault(7) /* metro dependency 7 */;
const env0_2 = importDefault(15) /* metro dependency 15 */;
const env0_3 = importDefault(17) /* metro dependency 17 */;
const env0_4 = importDefault(18) /* metro dependency 18 */;
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
let value = _fun57498(Store);
value.displayName = 'ThreadSummaryStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {SUMMARIZE_THREAD_START: function() {
env0_5 = true;
}, SUMMARIZE_THREAD_SUCCESS: closure, SUMMARIZE_THREAD_FAILURE: closure});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadSummaryStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_57494() { // fn#57494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7342:148, offset: 0x013e728c, 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_57494_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun57498(a0) { // fn#57498, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7342:400, offset: 0x013e72f7, size: 93 bytes, params: 2, frame: 16
const closure = ThreadSummaryStore;
env0_4(closure, a0);
return env0_1(closure, [{key: 'initialize', value: function() {
env1_5 = false;
}}, {key: 'isInProgress', value: value_57501}]);
}
function ThreadSummaryStore(a0) { // fn#57499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7342:412, offset: 0x013e7354, size: 136 bytes, params: 2, frame: 19
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_0;
binding(this, ThreadSummaryStore);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_3(ThreadSummaryStore);
binding = env1_2;
if (_isNativeReflectConstruct_57494()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_3(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
value = binding(this, r0);
value.summaryInProgress = false;
return value;
}
+167
View File
@@ -0,0 +1,167 @@
/* Metro module 7169; source: modules/threads/ThreadUtils.tsx; dependencies: [29, 4605, 4864, 3786, 1243, 661, 1244, 4911, 4863, 683, 7162, 6610, 1391, 566, 21, 3738, 2] */
function _fun57571(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7347:6, offset: 0x013e91d8, size: 316 bytes, params: 8, frame: 19
const env0_0 = require;
const env0_3 = ['can_send_message', 'parent_channel_type'];
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(29) /* metro dependency 29 */;
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
const userGuildSettingsStore = importDefault(4864) /* metro dependency 4864: UserGuildSettingsStore */;
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
const env0_8 = (require(1243) /* metro dependency 1243: ThreadConstants */).ThreadMemberFlags;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_9 = constantsModule.AnalyticEvents;
const env0_10 = constantsModule.UserNotificationSettings;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/ThreadUtils.tsx');
exports.getTimestampString = importDefault(4911) /* metro dependency 4911: getTimestampString */;
exports.getTimestampAccessibilityLabel = function(a0) {
return importDefault(dependencyMap[7])(a0, getAccessibilityLabelFormatter);
};
exports.trackThreadBrowserTab = function() {
require(dependencyMap[8]).trackWithMetadata(AnalyticEvents.THREAD_BROWSER_TAB_CHANGED);
};
exports.trackThreadBrowserOpened = trackThreadBrowserOpened;
exports.trackActiveThreadsPopoutOpened = function() {
var defaultImport = importDefault(dependencyMap[9]);
var OPEN_POPOUT = AnalyticEvents.OPEN_POPOUT;
defaultImport.track(OPEN_POPOUT, {type: 'Active Threads Popout'});
};
exports.trackThreadNotificationSettingsUpdated = trackThreadNotificationSettingsUpdated;
exports.useLastMessageTimestamp = useLastMessageTimestamp;
}
function getAccessibilityLabelFormatter() { // fn#57572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7347:302, offset: 0x013e9314, size: 152 bytes, params: 1, frame: 15
const object2 = {};
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.minutes = t['1Rcf/h'];
object2.hours = t.vgnx51;
object2.days = t.fNvE50;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const P7Gygz = t.P7Gygz;
object2.month = Reflect.apply(string, intl, [P7Gygz]);
return object2;
}
function trackThreadBrowserOpened() { // fn#57575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7347:741, offset: 0x013e9404, size: 77 bytes, params: 1, frame: 16
const value = a0;
const r5 = value !== undefined ? value : 'Modal';
const appAnalyticsUtilsModule = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = appAnalyticsUtilsModule.trackWithMetadata;
const OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
Reflect.apply(trackWithMetadata, appAnalyticsUtilsModule, [OPEN_MODAL, {type: 'Thread Browser',
location_section: r5}]);
}
function trackThreadNotificationSettingsUpdated(a0, a1) { // fn#57577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7347:1047, offset: 0x013e948d, size: 547 bytes, params: 3, frame: 28
var r12;
var r3;
var guildId;
var parent_id;
var currentChannelSettings;
var closure;
var flags;
var id;
var value7;
var isMuted;
var isMuted2;
var moduleValue3;
var muteConfigToTimestamp;
var getMuteConfig;
var value8;
var object2;
var moduleValue4;
var defaultImport;
const value2 = (require(7162) /* metro dependency 7162: ThreadAnalyticsUtils */).collectThreadMetadata(a0);
if (value2 != null) {
guildId = a0.getGuildId();
parent_id = a0.parent_id;
currentChannelSettings = (require(6610) /* metro dependency 6610: NotificationSettingsUtils */).getCurrentChannelSettings(guildId,
parent_id);
closure = getNotificationAnalyticsString;
flags = JoinedThreadsStore.flags;
id = a0.id;
r12 = Reflect.apply(flags, JoinedThreadsStore, [id]) ?? 0;
value7 = closure(r12);
isMuted = JoinedThreadsStore.isMuted;
id = a0.id;
isMuted2 = Reflect.apply(isMuted, JoinedThreadsStore, [id]);
moduleValue3 = require(6610) /* metro dependency 6610: NotificationSettingsUtils */;
muteConfigToTimestamp = moduleValue3.muteConfigToTimestamp;
getMuteConfig = JoinedThreadsStore.getMuteConfig;
id = a0.id;
value8 = Reflect.apply(muteConfigToTimestamp, moduleValue3, [Reflect.apply(getMuteConfig, JoinedThreadsStore,
[id])]);
value2.can_send_message;
value2.parent_channel_type;
object2 = {};
copyDataProperties(object2, env0_4(value2, env0_3), JoinedThreadsStore);
id = a0.id;
object2['channel_id'] = id;
object2['guild_id'] = guildId;
object2['parent_id'] = parent_id;
object2['channel_type'] = a0.type;
object2['has_interacted_with_thread'] = !!(r12 & ThreadMemberFlags.HAS_INTERACTED);
object2['parent_is_muted'] = UserGuildSettingsStore.isGuildOrCategoryOrChannelMuted(guildId, parent_id);
object2['old_thread_notification_setting'] = value7;
flags = a1.flags;
object2['new_thread_notification_setting'] = flags == null ? value7 : closure(a1.flags);
object2['parent_notification_setting'] = currentChannelSettings.channel_message_notification_settings;
object2['old_thread_is_muted'] = isMuted2;
object2['new_thread_is_muted'] = a1.muted ?? isMuted2;
object2['old_thread_muted_until'] = value8;
if (a1.mute_config == null) {
r3 = value8;
} else {
moduleValue4 = require(6610) /* metro dependency 6610: NotificationSettingsUtils */;
r3 = moduleValue4.muteConfigToTimestamp(a1.mute_config);
}
object2['new_thread_muted_until'] = r3;
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
defaultImport.track(AnalyticEvents.THREAD_NOTIFICATION_SETTINGS_UPDATED, object2);
}
}
function useLastMessageTimestamp(a0) { // fn#57579, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7347:2391, offset: 0x013e97b6, size: 217 bytes, params: 2, frame: 19
const env0_0 = a0;
var value;
const value2 = undefined;
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ReadStateStore], _fun57580);
const value4 = null;
const r5 = value4 != value3 ? (importDefault(21) /* metro dependency 21: SnowflakeUtils */).extractTimestamp(value3) : value4;
const threadMetadata = a0.threadMetadata;
const createTimestamp = value4 == threadMetadata ? value2 : threadMetadata.createTimestamp;
let r0 = value4 != createTimestamp ? (importDefault(3738) /* metro dependency 3738 */)(createTimestamp).valueOf() : value4;
r0 = value4 != r5 ? r5 : r0;
if (value4 == r0) {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.extractTimestamp(a0.id);
r0 = value;
}
return r0;
}
function getNotificationAnalyticsString(a0) { // fn#57578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7347:1264, owner: trackThreadNotificationSettingsUpdated.getNotificationAnalyticsString, offset: 0x013e96b0, size: 262 bytes, params: 2, frame: 19
var r0;
var moduleValue2;
var moduleValue3;
const MessageNotificationSettings = (require(6610) /* metro dependency 6610: NotificationSettingsUtils */).MessageNotificationSettings;
const flagUtilsModule = require(1391) /* metro dependency 1391: FlagUtils */;
const hasFlag = flagUtilsModule.hasFlag;
const ALL_MESSAGES = ThreadMemberFlags.ALL_MESSAGES;
if (Reflect.apply(hasFlag, flagUtilsModule, [a0, ALL_MESSAGES])) {
r0 = MessageNotificationSettings[UserNotificationSettings.ALL_MESSAGES];
} else {
moduleValue2 = flagUtilsModule;
if (moduleValue2.hasFlag(a0, ThreadMemberFlags.ONLY_MENTIONS)) {
r0 = MessageNotificationSettings[UserNotificationSettings.ONLY_MENTIONS];
} else {
moduleValue3 = require(1391) /* metro dependency 1391: FlagUtils */;
r0 = moduleValue3.hasFlag(a0,
ThreadMemberFlags.NO_MESSAGES) ? MessageNotificationSettings[UserNotificationSettings.NO_MESSAGES] : MessageNotificationSettings[UserNotificationSettings.NULL];
}
}
return r0;
}
@@ -0,0 +1,11 @@
/* Metro module 7170; source: modules/threads/convertServerThreadMember.tsx; dependencies: [2] */
function _fun57581(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7348:6, offset: 0x013e98af, size: 85 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/convertServerThreadMember.tsx');
exports.default = function(a0) {
return {id: a0.id, userId: a0.user_id, flags: a0.flags, muted: a0.muted, muteConfig: a0.mute_config,
joinTimestamp: a0.join_timestamp};
};
}
@@ -0,0 +1,41 @@
/* Metro module 5089; source: modules/threads/getThreadAutoArchiveTimeOnce.tsx; dependencies: [4605, 672, 21, 2] */
function _fun44190(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5267:6, offset: 0x0116a088, size: 129 bytes, params: 8, frame: 19
const closure = getThreadLastActivityTime;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/getThreadAutoArchiveTimeOnce.tsx');
exports.default = function(a0) {
if (a0.threadMetadata == null) {
return 0;
}
return getThreadLastActivityTime(a0) + a0.threadMetadata.autoArchiveDuration * importDefault(dependencyMap[1]).Millis.MINUTE;
};
exports.getThreadLastActivityTime = closure;
}
function getThreadLastActivityTime(a0) { // fn#44191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5267:106, offset: 0x0116a109, size: 179 bytes, params: 2, frame: 15
var r2;
var Date;
var value4;
var date;
if (a0.threadMetadata == null) {
return 0;
}
const r4 = ReadStateStore.lastMessageId(a0.id) ?? a0.id;
let value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.extractTimestamp(r4);
let archiveTimestamp = a0.threadMetadata.archiveTimestamp;
if (archiveTimestamp != null) {
Date = global.Date;
archiveTimestamp = a0.threadMetadata.archiveTimestamp;
value4 = Object.create(Date.prototype, {constructor: {value: Date}});
date = new Date(archiveTimestamp);
r2 = (date instanceof Object ? date : value4).getTime();
} else {
r2 = 0;
}
const Math = global.Math;
return Math.max(value, r2);
}
@@ -0,0 +1,104 @@
/* Metro module 4911; source: modules/threads/getTimestampString.tsx; dependencies: [1244, 3738, 2] */
function _fun43401(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#43401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5089:6, offset: 0x0115207b, size: 101 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/getTimestampString.tsx');
exports.default = _default;
}
function _default(a0, a1) { // fn#43402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5089:124, offset: 0x011520e0, size: 652 bytes, params: 3, frame: 25
var r0;
var value10;
var value12;
var value14;
var value16;
var value18;
const value = a2;
const value2 = undefined;
const env0_0 = !(value !== value2) || value;
const value3 = (importDefault(3738) /* metro dependency 3738 */)();
const value5 = value3.diff((importDefault(3738) /* metro dependency 3738 */)(a0), 's');
const r13 = a1 != null ? a1() : value2;
const object2 = {};
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.seconds = t.sMPmtq;
const N9M4N1 = t.N9M4N1;
object2.minutes = N9M4N1;
object2.hours = t.p0KedC;
object2.days = t.gjK5av;
object2.months = t.kHo4Or;
const KjKr2P = t.KjKr2P;
object2.years = KjKr2P;
const closure = _defaultFormatString;
if (value5 < 60) {
r0 = (r13 == null ? value2 : r13.seconds) != null ? closure('seconds', value5) : closure('minutes', 1);
if (r0 != null) {
return r0;
}
}
if (value5 < 3600) {
value10 = closure('minutes', global.Math.floor(value5 / 60));
if (value10 != null) {
return value10;
}
}
if (value5 < 86400) {
value12 = closure('hours', global.Math.floor(value5 / 3600));
if (value12 != null) {
return value12;
}
}
if (value5 < 2592000) {
value14 = closure('days', global.Math.floor(value5 / 86400));
if (value14 != null) {
return value14;
}
}
if (value5 < 31104000) {
value16 = closure('months', global.Math.floor(value5 / 2592000));
if (value16 != null) {
return value16;
}
}
if (value5 >= 31104000) {
if ((r13 == null ? value2 : r13.years) == null) {
return (importDefault(3738) /* metro dependency 3738 */)(a0).format('LL');
}
value18 = closure('years', global.Math.floor(value5 / 31104000));
if (value18 != null) {
return value18;
}
}
return (importDefault(3738) /* metro dependency 3738 */)(a0).format('LL');
}
function _defaultFormatString(a0, a1) { // fn#43403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5089:354, owner: _default.formatString, offset: 0x0115236c, size: 114 bytes, params: 3, frame: 17
var environment;
var r1;
var r0;
var value4;
let value = ((a0, a1, a2) => {
var r0;
var value = null;
r0 = value != a1 && value != a1[a0];
r0 = r0 ? value != (value != a1[a0] ? a1[a0] : value == a2 ? undefined : a2[a0]) ? value != a1[a0] ? a1[a0] : value == a2 ? undefined : a2[a0] : value : value != (value == a2 ? undefined : a2[a0]) ? value == a2 ? undefined : a2[a0] : value;
return r0;
})(a0, env0_1, env0_0 ? env0_2 : undefined);
const value3 = null;
if (value3 == value) {
r0 = value3;
} else {
if (typeof value === 'string') {
r1 = value;
} else {
value4 = environment.__proto__;
value = (require(1244) /* metro dependency 1244: indexNative */).intl.formatToPlainString(value,
{count: a1});
r1 = value;
}
r0 = r1;
}
return r0;
}
@@ -0,0 +1,47 @@
/* Metro module 15178; source: modules/threads/native/components/ThreadAutoArchiveBottomSheet.tsx; dependencies: [31, 1386, 33, 7878, 7988, 1244, 7987, 2] */
function _fun115954(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15375:6, offset: 0x02475b52, size: 163 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_2 = (require(1386) /* metro dependency 1386: ChannelConstants */).ChannelFlags;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
value = value.memo(_fun115955);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/ThreadAutoArchiveBottomSheet.tsx');
exports.AutoArchiveDurationOptions = value;
}
function _fun115955({title, description, channel, selected, onSelectDuration}) { // fn#115955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15375:153, offset: 0x02475bf5, size: 256 bytes, params: 2, frame: 21
const autoArchiveOptions = (require(7878) /* metro dependency 7878: ThreadAutoArchive */).getAutoArchiveOptions();
const env0_0 = channel != null && channel.isForumPost() && channel.hasFlag(ChannelFlags.PINNED);
const TableRadioGroup = (require(7988) /* metro dependency 7988: TableRadioGroupNative */).TableRadioGroup;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const H4mGfI = (require(1244) /* metro dependency 1244: indexNative */).t.H4mGfI;
return (
<TableRadioGroup
value={selected}
title={title}
description={description}
accessibilityLabel={Reflect.apply(string, intl, [H4mGfI])}
onChange={onSelectDuration}
hasIcons={false}
>
{autoArchiveOptions.map(_fun115956)}
</TableRadioGroup>
);
}
function _fun115956(a0) { // fn#115956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15375:473, offset: 0x02475cf5, size: 83 bytes, params: 2, frame: 16
const value = environment.__proto__;
const TableRadioRow = (require(7987) /* metro dependency 7987: TableRadioRowNative */).TableRadioRow;
return (
<TableRadioRow
value={a0.value}
disabled={env0_0}
label={a0.label}
key={a0.value}
/>
);
}
@@ -0,0 +1,248 @@
/* Metro module 15097; source: modules/threads/native/components/ThreadBrowserRowSubtext.tsx; dependencies: [31, 27, 4502, 1945, 1878, 6898, 661, 482, 33, 4501, 697, 566, 7169, 6630, 6593, 4573, 1244, 3995, 6902, 4634, 21, 1305, 8349, 8206, 4020, 2] */
function _fun114222(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#114222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15294:6, offset: 0x02418455, size: 543 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const threadMessageStore = importDefault(6898) /* metro dependency 6898: ThreadMessageStore */;
const MessageTypes = (require(661) /* metro dependency 661: Constants */).MessageTypes;
const Fonts = (require(482) /* metro dependency 482: Constants */).Fonts;
const value2 = require(33) /* metro dependency 33 */;
const env0_9 = value2.jsx;
const env0_10 = value2.jsxs;
const env0_11 = value2.Fragment;
const CHANNEL_NAME_CHANGE = MessageTypes.CHANNEL_NAME_CHANGE;
object = [CHANNEL_NAME_CHANGE];
const THREAD_STARTER_MESSAGE = MessageTypes.THREAD_STARTER_MESSAGE;
object[1] = THREAD_STARTER_MESSAGE;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object = {};
object.row = {flexDirection: 'row'};
object.subtextContent = {'lineHeight': 18, 'flexShrink': 1};
object.timestamp = {lineHeight: 18};
const object2 = {'fontSize': 14, 'lineHeight': 18};
const PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD;
object2.fontFamily = PRIMARY_SEMIBOLD;
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
object2.color = TEXT_SUBTLE;
object.username = object2;
const BACKGROUND_MOD_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_STRONG;
object.dividerDot = {'width': 4, 'height': 4, 'marginHorizontal': 4, 'borderRadius': 2, 'backgroundColor': null,
'alignSelf': 'center', backgroundColor: BACKGROUND_MOD_STRONG};
const env0_13 = Reflect.apply(createStyles, createStylesModule, [object]);
const env0_14 = value.memo(_fun114231);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/ThreadBrowserRowSubtext.tsx');
exports.ThreadSubtext = ThreadSubtext;
}
function MessageContent({thread, message}) { // fn#114223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15294:1751, offset: 0x02418674, size: 511 bytes, params: 2, frame: 23
const styles = useStyles();
(require(6902) /* metro dependency 6902: subscribeGuildMembers */).useSubscribeGuildMembers({[thread.guild_id]: [message.author.id]},
'ThreadBrowserRowSubtext');
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getUser(message.author.id) ?? message.author;
});
const env0_1 = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore], function() {
return AccessibilityStore.roleStyle;
});
const value3 = (importDefault(4634) /* metro dependency 4634: useMessageAuthor */)(message);
const env0_2 = value3.nick;
const env0_3 = value3.colorString;
const env0_4 = value3.colorStrings;
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
const value4 = defaultImport.extractTimestamp(message.id);
const timestampString = (require(7169) /* metro dependency 7169: ThreadUtils */).getTimestampString(value4);
const timestampAccessibilityLabel = (require(7169) /* metro dependency 7169: ThreadUtils */).getTimestampAccessibilityLabel(value4);
const env0_5 = (importDefault(6630) /* metro dependency 6630: useHasEnhancedRoleColors */)(thread.guild_id,
value2.id);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const format = intl.format;
const M79KAH = (require(1244) /* metro dependency 1244: indexNative */).t.M79KAH;
return (
<SubstringRow
user={value2}
timestamp={timestampString}
accessibilityLabel={timestampAccessibilityLabel}
>
<Text
lineClamp={1}
ellipsizeMode="tail"
lineBreakMode="tail"
style={styles.subtextContent}
variant="text-sm/medium"
color="text-default"
>
{Reflect.apply(format, intl, [M79KAH, {usernameHook: usernameHook_114226,
messageTextHook: messageTextHook}])}
</Text>
</SubstringRow>
);
}
function SubstringRow({user, children, timestamp, accessibilityLabel}) { // fn#114228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15294:2798, offset: 0x02418994, size: 334 bytes, params: 2, frame: 23
const styles = useStyles();
return user == null ? <View style={styles.row}>{((Text) => <Text style={styles.timestamp} accessibilityLabel={accessibilityLabel} variant="text-sm/medium" color="text-muted">{' ' + timestamp}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}</View> : <View style={styles.row}>{children}<View style={styles.dividerDot} />{((Text) => <Text style={styles.timestamp} accessibilityLabel={accessibilityLabel} variant="text-sm/medium" color="text-muted">{'' + timestamp}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}</View>;
}
function Username_114229({nickname, usernameColor, roleColor, roleColors, shouldShowRoleDot}) { // fn#114229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15294:3220, offset: 0x02418ae2, size: 330 bytes, params: 2, frame: 25
const styles = useStyles();
const value3 = env0_3.useMemo(function() {
return usernameColor != null ? [styles.username, {color: usernameColor}] : styles.username;
}, [usernameColor, styles]);
const value4 = (require(8206) /* metro dependency 8206: EnhancedRoleColorUtils */).useProcessColorStringsArray(roleColors);
const r12 = !shouldShowRoleDot && value4.length > 1;
const jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
const r6 = shouldShowRoleDot && ((RoleDot) => <RoleDot color={roleColor} colors={roleColors} size="small" />)((require(1305) /* metro dependency 1305: native */).RoleDot);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const fabricUtilsModule = require(4020) /* metro dependency 4020: FabricUtils */;
return (
<>
{r6}
<Text
variant="text-sm/semibold"
color="mobile-text-heading-primary"
experimental_useNativeText={!fabricUtilsModule.isFabric()}
gradientColors={r12 ? value4 : undefined}
style={value3}
>
{nickname}
</Text>
</>
);
}
function _fun114231({thread, timestamp, accessibilityLabel}) { // fn#114231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15294:665, offset: 0x02418c6a, size: 549 bytes, params: 2, frame: 24
const styles = useStyles();
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getUser(thread.ownerId);
});
const member = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], function() {
var threadBinding = thread;
return GuildMemberStore.getMember(threadBinding.guild_id, threadBinding.ownerId);
});
const env0_3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore], function() {
return AccessibilityStore.roleStyle;
});
const env0_4 = member?.colorString ?? null;
const env0_5 = member?.colorStrings ?? null;
const env0_6 = (importDefault(6630) /* metro dependency 6630: useHasEnhancedRoleColors */)(thread.guild_id,
user?.id);
const env0_7 = env0_3.useRef(thread);
env0_3.useEffect(_fun114235);
env0_3.useEffect(_fun114236, [member, user]);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return (
<SubstringRow
user={user}
timestamp={timestamp}
accessibilityLabel={accessibilityLabel}
>
<Text
lineClamp={1}
ellipsizeMode="tail"
lineBreakMode="tail"
style={styles.subtextContent}
accessibilityLabel={accessibilityLabel}
variant="text-sm/medium"
color="text-default"
>
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.imPXd5,
{usernameHook: usernameHook})}
</Text>
</SubstringRow>
);
}
function ThreadSubtext({thread}) { // fn#114238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15294:3816, offset: 0x02418ff0, size: 255 bytes, params: 2, frame: 21
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ThreadMessageStore], function() {
return ThreadMessageStore.getMostRecentMessage(id);
}, [thread.id]);
const value3 = (require(7169) /* metro dependency 7169: ThreadUtils */).useLastMessageTimestamp(thread);
if (value2 == null) {
return ((Component) => <Component thread={thread} timestamp={(require(7169) /* metro dependency 7169: ThreadUtils */).getTimestampString(value3)} accessibilityLabel={(require(7169) /* metro dependency 7169: ThreadUtils */).getTimestampAccessibilityLabel(value3)} />)(env0_14);
}
const binding = env0_12;
if (binding.includes(value2.type)) {
return ((Component) => <Component thread={thread} timestamp={(require(7169) /* metro dependency 7169: ThreadUtils */).getTimestampString(value3)} accessibilityLabel={(require(7169) /* metro dependency 7169: ThreadUtils */).getTimestampAccessibilityLabel(value3)} />)(env0_14);
}
if (thread.isArchivedThread()) {
return ((Component) => <Component thread={thread} timestamp={(require(7169) /* metro dependency 7169: ThreadUtils */).getTimestampString(value3)} accessibilityLabel={(require(7169) /* metro dependency 7169: ThreadUtils */).getTimestampAccessibilityLabel(value3)} />)(env0_14);
}
return <MessageContent thread={thread} message={value2} />;
}
function MessageContentUsernameHook(a0, a1) { // fn#114226, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15294:2524, owner: MessageContent.usernameHook, offset: 0x024188a9, size: 134 bytes, params: 3, frame: 18
const value = environment.__proto__;
const nickBinding = nick;
const value2 = null;
return (
<Username_114229
nickname={value2 != nickBinding ? nick : ''}
usernameColor={roleStyle !== 'username' ? value2 : colorString}
roleColor={colorString}
roleColors={env0_5 ? colorStrings : value2}
shouldShowRoleDot={roleStyle === 'dot' && value2 != colorString}
key={a1}
/>
);
}
function messageTextHook(a0, a1) { // fn#114227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15294:2690, owner: MessageContent.messageTextHook, offset: 0x0241892f, size: 101 bytes, params: 3, frame: 17
const value = environment.__proto__;
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
return (
<LegacyText key={a1}>
{(importDefault(8349) /* metro dependency 8349: renderMessageMarkup */)(message, {'formatInline': true,
'allowGameMentions': true}).content}
</LegacyText>
);
}
function _fun114236() { // fn#114236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15294:1130, offset: 0x02418ed7, size: 90 bytes, params: 1, frame: 14
var current;
var value;
if (user == null) {
current = env0_7.current;
value = environment.__proto__;
value = importDefault(6593) /* metro dependency 6593: GuildActionCreators */;
value.requestMembersById(current.guild_id, [current.ownerId]);
} else if (member == null) {
current = env0_7.current;
value = environment.__proto__;
value = importDefault(6593) /* metro dependency 6593: GuildActionCreators */;
value.requestMembersById(current.guild_id, [current.ownerId]);
}
}
function usernameHook(a0, a1) { // fn#114237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15294:1509, offset: 0x02418f31, size: 191 bytes, params: 3, frame: 20
var r7;
let value = environment.__proto__;
const memberBinding = member;
const value3 = null;
const nick = value3 == memberBinding ? undefined : member.nick;
if (value3 != nick) {
r7 = nick;
} else {
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
value = value.getName(user);
r7 = value;
}
return (
<Username_114229
nickname={value3 != r7 ? r7 : ''}
usernameColor={roleStyle !== 'username' ? value3 : env0_4}
roleColor={env0_4}
roleColors={env0_6 ? env0_5 : value3}
shouldShowRoleDot={roleStyle === 'dot' && value3 != env0_4}
key={a1}
/>
);
}
@@ -0,0 +1,381 @@
/* Metro module 14535; source: modules/threads/native/components/ThreadLongPressActionSheet.tsx; dependencies: [31, 1379, 1867, 4297, 3786, 661, 33, 1244, 8999, 5097, 11234, 4054, 7153, 10859, 8850, 4076, 4066, 11237, 6705, 9646, 8148, 4056, 12148, 10629, 4080, 10936, 1962, 9216, 11241, 11243, 566, 6860, 22, 9626, 4805, 3829, 11247, 6819, 1305, 6805, 11251, 6807, 8772, 6797, 3856, 2] */
function _fun109962(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:6, offset: 0x023635d2, size: 278 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */;
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_8 = value.AnalyticsObjectTypes;
const env0_9 = value.AnalyticsObjects;
const env0_10 = value.AnalyticsSections;
const env0_11 = value.ChannelSettingsSections;
value = require(33) /* metro dependency 33 */;
const env0_12 = value.jsx;
const env0_13 = value.jsxs;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/ThreadLongPressActionSheet.tsx');
exports.default = ThreadLongPressActionSheet;
}
function ThreadLongPressActionSheetConnected({channel, onClose}) { // fn#109963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:279, offset: 0x023636e8, size: 1012 bytes, params: 2, frame: 37
var object2;
var r5;
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
var Group;
var intl;
const env0_2 = channel.getGuildId();
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], _fun109964);
const {isMuted,
hasJoined} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([JoinedThreadsStore],
function() {
var object = {};
var channelBinding = channel;
object.isMuted = JoinedThreadsStore.isMuted(channelBinding.id);
object.hasJoined = JoinedThreadsStore.hasJoined(channelBinding.id);
return object;
});
const value3 = (require(6860) /* metro dependency 6860: ThreadHooks */).useCanManageThread(channel);
const value4 = (require(6860) /* metro dependency 6860: ThreadHooks */).useIsThreadModerator(channel);
const value5 = (require(6860) /* metro dependency 6860: ThreadHooks */).useCanUnarchiveThread(channel);
const value6 = (require(6860) /* metro dependency 6860: ThreadHooks */).useCanJoinThreadVoice(channel);
const value7 = (require(566) /* metro dependency 566: flux */).useStateFromStores([VoiceStateStore], function() {
return VoiceStateStore.isInChannel(channel.id);
});
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([VoiceStateStore], function() {
return !importDefault(dependencyMap[32]).isEmpty(VoiceStateStore.getVoiceStatesForChannel(channel.id));
});
const value9 = (importDefault(9626) /* metro dependency 9626: useHandleJoinThreadVoice */)(channel);
const value10 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel, true);
const DeveloperMode = (require(3829) /* metro dependency 3829: UserSettings */).DeveloperMode;
const value11 = DeveloperMode.useSetting();
const env0_3 = value11;
const value12 = (importDefault(11247) /* metro dependency 11247: useMobileChannelFavoriteActions */)(channel,
'ThreadLongPressActionSheet');
const r10 = guild != null ? ((Component) => <Component guild={guild} size={(require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes.LARGE} />)(importDefault(6819) /* metro dependency 6819: GuildIcon */) : ((Avatar) => <Avatar size={(require(1305) /* metro dependency 1305: native */).AvatarSizes.LARGE} channel={channel} />)((require(1305) /* metro dependency 1305: native */).Avatar);
object2 = {channel: channel, guild: guild, canManageThread: value3, canModerateThread: value4,
canUnarchiveThread: value5, isMuted: isMuted, hasJoined: hasJoined};
object2.isForumPost = channel.isForumPost();
object2.handleJoinThreadVoice = value6 ? value7 ? null : value9 : null;
object2.hasActiveThreadVoice = value8;
object2.favorites = value12;
const value16 = ThreadLongPressActionSheetConnectedGetActionSheetButtons(object2);
env0_3.useEffect(_fun109981, [value16.length, value11, onClose]);
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
object2 = {};
const ActionSheetIconHeader = (require(11251) /* metro dependency 11251: ActionSheetIconHeaderNative */).ActionSheetIconHeader;
object2.header = <ActionSheetIconHeader title={value10} icon={r10} />;
const value17 = value16.map(_fun109982);
if (value11) {
Group = ActionSheetRow.Group;
var actionSheetRowProps = {icon: ((Icon) => <Icon IconComponent={(require(8772) /* metro dependency 8772: IdIcon */).IdIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
actionSheetRowProps.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.DQ797g);
actionSheetRowProps.onPress = onPress_109985;
r5 = <Group hasIcons key="developer-actions"><ActionSheetRow {...actionSheetRowProps} /></Group>;
} else {
r5 = value11;
}
return (
<ActionSheet {...object2}>
{value17}
{r5}
</ActionSheet>
);
}
function ThreadLongPressActionSheet({channelId, onClose}) { // fn#109986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:5222, offset: 0x02364738, size: 153 bytes, params: 2, frame: 18
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(channelId);
});
env0_3.useEffect(function() {
if (channel == null) {
onClose();
}
}, [channel, onClose]);
return channel != null ? <ThreadLongPressActionSheetConnected channel={channel} onClose={onClose} /> : null;
}
function ThreadLongPressActionSheetConnectedGetActionSheetButtons({channel, canManageThread, canModerateThread, canUnarchiveThread, isMuted, hasJoined, isForumPost, handleJoinThreadVoice, hasActiveThreadVoice, favorites}) { // fn#109968, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:1096, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons, offset: 0x02363b80, size: 1846 bytes, params: 2, frame: 31
var object;
var object3;
var object8;
const XLargeIcon = (require(4066) /* metro dependency 4066: XLargeIcon */).XLargeIcon;
var object16;
var isLockedThread2;
var object17;
var object18;
const items2 = [];
let push = items2.push;
const object19 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object19.label = Reflect.apply(string, intl, [t.e6RscS]);
const EyeIcon = (require(8999) /* metro dependency 8999: EyeIcon */).EyeIcon;
object19.IconComponent = EyeIcon;
object19.onPress = function() {
require(dependencyMap[9]).ack(channel.id, {section: AnalyticsSections.THREAD_ACTION_SHEET,
object: AnalyticsObjects.MARK_THREAD_AS_READ_BUTTON, objectType: AnalyticsObjectTypes.ACK_MANUAL}, true,
true);
};
Reflect.apply(push, items2, [{sectionKey: 'mark-as-read', buttons: [object19]}]);
const value2 = (importDefault(11234) /* metro dependency 11234: buildFavoritesSectionButtonsNative */)(favorites);
if (value2 != null) {
items2.push({sectionKey: 'favorites', buttons: [value2]});
}
const object20 = {sectionKey: 'channel-actions', buttons: []};
let buttons = object20.buttons;
push = buttons.push;
if (hasJoined) {
object3 = {};
string = intl.string;
object3.label = isForumPost ? Reflect.apply(string, intl, [t['2LsZdT']]) : Reflect.apply(string, intl,
[t['fa/84m']]);
object3.IconComponent = (require(4054) /* metro dependency 4054: UserMinusIcon */).UserMinusIcon;
object3.isDestructive = true;
object3.onPress = onPress_109970;
Reflect.apply(push, buttons, [object3]);
} else {
object = {};
string = intl.string;
object.label = isForumPost ? Reflect.apply(string, intl, [t.ihLPiO]) : Reflect.apply(string, intl,
[t['10kukS']]);
object.IconComponent = (require(10859) /* metro dependency 10859: GroupPlusIcon */).GroupPlusIcon;
object.onPress = onPress_109971;
Reflect.apply(push, buttons, [object]);
}
if (handleJoinThreadVoice != null) {
buttons = object20.buttons;
push = buttons.push;
object8 = {};
string = intl.string;
object8.label = hasActiveThreadVoice ? Reflect.apply(string, intl, [t['0D/6Rz']]) : Reflect.apply(string, intl,
[t.My50nf]);
object8.IconComponent = (require(8850) /* metro dependency 8850: PhoneCallIcon */).PhoneCallIcon;
object8.onPress = handleJoinThreadVoice;
Reflect.apply(push, buttons, [object8]);
}
const threadMetadata = channel.threadMetadata;
if (threadMetadata == null) {
if (canManageThread) {
buttons = object20.buttons;
push = buttons.push;
string = intl.string;
Reflect.apply(push, buttons, [{label: isForumPost ? Reflect.apply(string, intl,
[t.BTs4Kb]) : Reflect.apply(string,
intl, [t.wiIevd]), IconComponent: XLargeIcon, onPress: onPress_109973}]);
}
} else if (threadMetadata.archived) {
if (canUnarchiveThread) {
buttons = object20.buttons;
push = buttons.push;
object16 = {};
string = intl.string;
object16.label = isForumPost ? Reflect.apply(string, intl, [t.cnRubV]) : Reflect.apply(string, intl,
[t.S9E4G7]);
object16.IconComponent = (require(4076) /* metro dependency 4076: ClockIcon */).ClockIcon;
object16.onPress = onPress_109972;
Reflect.apply(push, buttons, [object16]);
}
} else if (canManageThread) {
buttons = object20.buttons;
push = buttons.push;
string = intl.string;
Reflect.apply(push, buttons, [{label: isForumPost ? Reflect.apply(string, intl,
[t.BTs4Kb]) : Reflect.apply(string,
intl, [t.wiIevd]), IconComponent: XLargeIcon, onPress: onPress_109973}]);
}
if (canModerateThread) {
isLockedThread2 = channel.isLockedThread();
buttons = object20.buttons;
push = buttons.push;
object17 = {};
string = intl.string;
if (isLockedThread2) {
object17.label = isForumPost ? Reflect.apply(string, intl, [t['/OKSxp']]) : Reflect.apply(string, intl,
[t['jeyb/W']]);
object17.IconComponent = (require(11237) /* metro dependency 11237: LockUnlockedIcon */).LockUnlockedIcon;
object17.onPress = onPress_109974;
Reflect.apply(push, buttons, [object17]);
} else {
object17.label = isForumPost ? Reflect.apply(string, intl, [t['Ur/0Na']]) : Reflect.apply(string, intl,
[t.HoCqm8]);
object17.IconComponent = (require(6705) /* metro dependency 6705: LockIcon */).LockIcon;
object17.onPress = onPress_109975;
Reflect.apply(push, buttons, [object17]);
}
}
if (canModerateThread) {
buttons = object20.buttons;
push = buttons.push;
object18 = {};
string = intl.string;
object18.label = isForumPost ? Reflect.apply(string, intl, [t.NP1yHG]) : Reflect.apply(string, intl,
[t['2Mk1TP']]);
object18.IconComponent = (require(9646) /* metro dependency 9646: PencilIcon */).PencilIcon;
object18.onPress = onPress_109976;
Reflect.apply(push, buttons, [object18]);
}
buttons = object20.buttons;
push = buttons.push;
const object21 = {};
string = intl.string;
const WqhZss = t.WqhZss;
object21.label = Reflect.apply(string, intl, [WqhZss]);
const LinkIcon = (require(4056) /* metro dependency 4056: LinkIcon */).LinkIcon;
object21.IconComponent = LinkIcon;
object21.isDestructive = false;
object21.onPress = onPress_109977;
Reflect.apply(push, buttons, [object21]);
items2.push(object20);
const object22 = {sectionKey: 'notifications', buttons: []};
buttons = object22.buttons;
push = buttons.push;
const object23 = {};
string = intl.string;
if (isMuted) {
object23.label = isForumPost ? Reflect.apply(string, intl, [t['0JQfsP']]) : Reflect.apply(string, intl,
[t['Cq/TzF']]);
object23.IconComponent = (require(9216) /* metro dependency 9216: BellIcon */).BellIcon;
object23.onPress = onPress_109978;
Reflect.apply(push, buttons, [object23]);
} else {
object23.label = isForumPost ? Reflect.apply(string, intl, [t['nP+Ykd']]) : Reflect.apply(string, intl,
[t.bUUd8q]);
object23.IconComponent = (require(10629) /* metro dependency 10629: BellSlashIcon */).BellSlashIcon;
object23.onPress = onPress_109979;
Reflect.apply(push, buttons, [object23]);
}
buttons = object22.buttons;
push = buttons.push;
const object24 = {};
object24.label = intl.string(t.h850Ss);
const ChannelNotificationIcon = (require(11241) /* metro dependency 11241: ChannelNotificationIcon */).ChannelNotificationIcon;
object24.IconComponent = ChannelNotificationIcon;
object24.onPress = onPress_109980;
object24.disableColor = true;
Reflect.apply(push, buttons, [object24]);
items2.push(object22);
return items2;
}
function _fun109982(a0) { // fn#109982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:4479, offset: 0x023645ba, size: 97 bytes, params: 2, frame: 18
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Group = ActionSheetRow.Group;
return (
<Group hasIcons key={a0.sectionKey}>
{a0.buttons.map(_fun109983)}
</Group>
);
}
function ThreadLongPressActionSheetConnectedOnPress() { // fn#109985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:5029, owner: ThreadLongPressActionSheetConnected.onPress, offset: 0x023646e8, size: 80 bytes, params: 1, frame: 14
onClose();
const clipboardUtilsNativeModule = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
clipboardUtilsNativeModule.copy(channel.id);
(require(3856) /* metro dependency 3856: ToastUtils */).presentIdCopied();
}
function getActionSheetButtonsOnPress_109970() { // fn#109970, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:1836, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x02364320, size: 52 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__;
value = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
value.leaveThread(channel, 'Context Menu');
}
function getActionSheetButtonsOnPress_109971() { // fn#109971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:2028, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x02364354, size: 52 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__;
value = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
value.joinThread(channel, 'Context Menu');
}
function getActionSheetButtonsOnPress_109972() { // fn#109972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:2415, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x02364388, size: 48 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__;
value = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
value.unarchiveThread(channel, false);
}
function getActionSheetButtonsOnPress_109973() { // fn#109973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:2596, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x023643b8, size: 48 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__;
value = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
value.archiveThread(channel, false);
}
function getActionSheetButtonsOnPress_109974() { // fn#109974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:2807, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x023643e8, size: 45 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
value.unlockThread(channel);
}
function getActionSheetButtonsOnPress_109975() { // fn#109975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:2980, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x02364415, size: 45 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
value.lockThread(channel);
}
function getActionSheetButtonsOnPress_109976() { // fn#109976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:3157, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x02364442, size: 80 bytes, params: 1, frame: 15
let value = environment.__proto__.__proto__;
const defaultImport = importDefault(8148) /* metro dependency 8148: ChannelSettingsActionCreators */;
const setSection = defaultImport.setSection;
const OVERVIEW = ChannelSettingsSections.OVERVIEW;
Reflect.apply(setSection, defaultImport, [OVERVIEW]);
value = defaultImport;
value.open(channel.id);
}
function getActionSheetButtonsOnPress_109977() { // fn#109977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:3331, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x02364492, size: 56 bytes, params: 1, frame: 14
let value = environment.__proto__.__proto__;
value = require(12148) /* metro dependency 12148: ChannelActionSheetUtils */;
const copyGuildChannelOrThreadLink = value.copyGuildChannelOrThreadLink;
const channelBinding = channel;
Reflect.apply(copyGuildChannelOrThreadLink, value, [channelBinding.guild_id, channelBinding.id]);
}
function getActionSheetButtonsOnPress_109978() { // fn#109978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:3602, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x023644ca, size: 60 bytes, params: 1, frame: 15
let value = environment.__proto__.__proto__;
value = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
value.setNotificationSettings(channel, {muted: !isMuted});
}
function getActionSheetButtonsOnPress_109979() { // fn#109979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:3802, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x02364506, size: 135 bytes, params: 1, frame: 18
let value = environment.__proto__.__proto__;
const defaultImport = importDefault(dependencyMap[24]);
const openLazy = defaultImport.openLazy;
value = require(dependencyMap[26]);
value = value(dependencyMap[25], dependencyMap.paths);
const channelBinding = channel;
const value3 = 'muteSettings' + channelBinding.id;
const object2 = {};
object2.guildId = channelBinding.getGuildId();
object2.channelId = channelBinding.id;
Reflect.apply(openLazy, defaultImport, [value, value3, object2]);
}
function getActionSheetButtonsOnPress_109980() { // fn#109980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:4027, owner: ThreadLongPressActionSheetConnected.getActionSheetButtons.onPress, offset: 0x0236458d, size: 45 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = require(11243) /* metro dependency 11243: threadActionSheets */;
value.showThreadNotificationsBottomSheet(channel);
}
function _fun109983({label, IconComponent, trailing, isDestructive, disableColor, onPress}, a1) { // fn#109983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14732:4551, offset: 0x0236461b, size: 179 bytes, params: 3, frame: 22
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const r7 = isDestructive ? 'danger' : 'default';
const ActionSheetRow2 = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const Icon = ActionSheetRow2.Icon;
return (
<ActionSheetRow
label={label}
variant={r7}
icon={<Icon IconComponent={IconComponent} disableColor={disableColor} />}
trailing={trailing}
onPress={function() {
onClose();
onPress();
}}
key={a1}
/>
);
}
@@ -0,0 +1,50 @@
/* Metro module 11244; source: modules/threads/native/components/ThreadNotificationSettingsBottomSheet.tsx; dependencies: [1243, 33, 10914, 6805, 6758, 1244, 7988, 7153, 7987, 2] */
function _fun85961(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11430:6, offset: 0x01f82b9a, size: 145 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(1243) /* metro dependency 1243: ThreadConstants */).getThreadNotificationOptions;
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/ThreadNotificationSettingsBottomSheet.tsx');
exports.default = ThreadNotificationsBottomSheet;
}
function ThreadNotificationsBottomSheet({channel}) { // fn#85962, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11430:268, offset: 0x01f82c2b, size: 293 bytes, params: 2, frame: 24
const value2 = (require(10914) /* metro dependency 10914: ThreadNotificationSettings */).useThreadNotificationSetting(channel);
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
const object2 = {};
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.header = <BottomSheetTitleHeader title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.h850Ss)} />;
const TableRadioGroup = (require(7988) /* metro dependency 7988: TableRadioGroupNative */).TableRadioGroup;
return (
<ActionSheet {...object2}>
<TableRadioGroup
hasIcons={false}
value={value2}
onChange={onChange_85963}
accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.h850Ss)}
>
{getThreadNotificationOptions().map(_fun85964)}
</TableRadioGroup>
</ActionSheet>
);
}
function ThreadNotificationsBottomSheetOnChange(a0) { // fn#85963, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11430:549, owner: ThreadNotificationsBottomSheet.onChange, offset: 0x01f82d50, size: 55 bytes, params: 2, frame: 14
let value = environment.__proto__;
value = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
return value.setNotificationSettings(channel, {flags: a0});
}
function _fun85964({setting, label}) { // fn#85964, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11430:672, offset: 0x01f82d87, size: 90 bytes, params: 2, frame: 17
const TableRadioRow = (require(7987) /* metro dependency 7987: TableRadioRowNative */).TableRadioRow;
return (
<TableRadioRow
value={setting}
label={label}
key={'' + setting}
/>
);
}
@@ -0,0 +1,58 @@
/* Metro module 15014; source: modules/threads/native/components/ThreadParentMessage.tsx; dependencies: [31, 4833, 4814, 33, 8177, 566, 5278, 1230, 9773, 2] */
function _fun113494(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#113494, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15211:6, offset: 0x023fc6b5, size: 265 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const referencedMessageStore = importDefault(4833) /* metro dependency 4833: ReferencedMessageStore */;
const env0_4 = (require(4833) /* metro dependency 4833: ReferencedMessageStore */).ReferencedMessageState;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
let value = importDefault(8177) /* metro dependency 8177: RowGenerator */;
value = new value();
value.setOptions({'renderCodedLinks': false, 'renderGiftCode': false, 'renderActivityInstanceEmbed': false,
'renderActivityInviteEmbed': false, 'renderEmbeds': true, 'ignoreMentioned': true,
'inlineAttachmentMedia': true, 'inlineEmbedMedia': true, 'renderReactions': false, 'renderReplies': true,
'renderThreadEmbeds': false});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/ThreadParentMessage.tsx');
exports.ThreadChannelStarterMessage = ThreadChannelStarterMessage;
exports.ThreadCreationStarterMessage = ThreadCreationStarterMessage;
}
function ThreadChannelStarterMessage({guildId, messageId, channelId}) { // fn#113495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15211:559, offset: 0x023fc7be, size: 224 bytes, params: 2, frame: 19
var r0;
var PressableOpacity;
var ChatItem;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
let object = [ReferencedMessageStore];
let message = Reflect.apply(useStateFromStores, fluxModule, [object, function() {
return ReferencedMessageStore.getMessage(channelId, messageId);
}]);
const state = message?.state;
const LOADED = ReferencedMessageState.LOADED;
if (state !== LOADED) {
r0 = null;
} else {
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
object = {accessibilityRole: 'button', onPress: onPress_113497};
ChatItem = importDefault(9773) /* metro dependency 9773: ChatItem */;
message = message.message;
r0 = <PressableOpacity {...object}><ChatItem rowGenerator={env0_7} message={message} /></PressableOpacity>;
}
return r0;
}
function ThreadCreationStarterMessage({messageId, channelId}) { // fn#113498, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15211:933, offset: 0x023fc8f5, size: 134 bytes, params: 2, frame: 17
const message = (require(566) /* metro dependency 566: flux */).useStateFromStores([MessageStore], function() {
return MessageStore.getMessage(channelId, messageId);
});
return message == null ? null : ((Component) => <Component rowGenerator={env0_7} message={message} />)(importDefault(9773) /* metro dependency 9773: ChatItem */);
}
function ThreadChannelStarterMessageOnPress() { // fn#113497, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15211:805, owner: ThreadChannelStarterMessage.onPress, offset: 0x023fc8be, size: 55 bytes, params: 1, frame: 16
let value = environment.__proto__;
value = require(1230) /* metro dependency 1230: router_utils */;
value.transitionToGuild(guildId, channelId, messageId);
}
@@ -0,0 +1,323 @@
/* Metro module 15095; source: modules/threads/native/components/redesign/ThreadList.tsx; dependencies: [31, 27, 33, 4501, 4573, 15096, 4017, 4508, 4577, 4581, 12057, 1388, 1390, 1244, 6238, 7975, 11757, 15098, 15099, 8416, 2] */
function _fun114198(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#114198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:6, offset: 0x024173df, size: 439 bytes, params: 8, frame: 20
const env0_0 = require;
const keyExtractor_114201 = function(a0) {
var type = a0.type;
if (type === 'section') {
return a0.title;
}
if (type === 'thread') {
return a0.threadId;
}
};
const getThreadListStateKey = function(a0) {
return a0;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const value = require(27) /* metro dependency 27 */;
const env0_4 = value.StyleSheet;
const env0_5 = value.View;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
const env0_7 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({container: {'flex': 1,
'flexGrow': 1}, center: {'justifyContent': 'center', 'alignItems': 'center'}, header: {'marginTop': 24,
'marginBottom': 10}, footer: {'marginVertical': 16, 'justifyContent': 'center', 'alignItems': 'center'},
section: {'marginTop': 16, 'marginBottom': 8}});
const Set = global.Set;
const set = new Set();
object = {code: "function ThreadListTsx1(){const{withSpring,opacity,springStandard,state,TransitionStates,runOnJS,cleanUp}=this.__closure;return{opacity:withSpring(opacity.get(),springStandard,'respect-motion-settings',function(finished){if(finished&&state===TransitionStates.YEETED){runOnJS(cleanUp)();}})};}"};
object = {code: 'function ThreadListTsx2(finished){const{state,TransitionStates,runOnJS,cleanUp}=this.__closure;if(finished&&state===TransitionStates.YEETED){runOnJS(cleanUp)();}}'};
object = {LIST: 'list', EMPTY: 'empty', LOADING: 'loading'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/redesign/ThreadList.tsx');
exports.default = ThreadList;
}
function ThreadListSection({title}) { // fn#114199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:421, offset: 0x02417596, size: 98 bytes, params: 2, frame: 16
const styles = useStyles();
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<Text
style={styles.section}
accessibilityRole="header"
variant="text-xs/bold"
color="text-default"
>
{title.toUpperCase()}
</Text>
);
}
function renderItem_114200({item}) { // fn#114200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:606, offset: 0x024175f8, size: 142 bytes, params: 2, frame: 15
const type = item.type;
if (type === 'section') {
return <ThreadListSection title={item.title} />;
}
if (type === 'thread') {
return ((Component) => <Component threadId={item.threadId} onPress={item.onPress} start={item.start} end={item.end} />)(importDefault(15096) /* metro dependency 15096: ThreadListTableRow */);
}
}
function EnterExitCrossFadeContainer({contentContainerStyle, cleanUp, state, children}) { // fn#114202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:1389, offset: 0x024176b1, size: 396 bytes, params: 2, frame: 26
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useSharedValue = reanimatedRexportModule.useSharedValue;
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
const MOUNTED = TransitionStates.MOUNTED;
const value4 = Reflect.apply(useSharedValue, reanimatedRexportModule, [state !== MOUNTED ? 0 : 1]);
const moduleValue2 = reanimatedRexportModule;
const useAnimatedStyle = moduleValue2.useAnimatedStyle;
const closure = EnterExitCrossFadeContainerP;
const object2 = {};
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.opacity = value4;
object2.springStandard = (require(4581) /* metro dependency 4581: springPresets */).springStandard;
object2.state = state;
object2.TransitionStates = TransitionStates;
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.cleanUp = cleanUp;
closure.__closure = object2;
closure.__workletHash = 5037750127944;
closure.__initData = env0_9;
const value5 = Reflect.apply(useAnimatedStyle, moduleValue2, [closure]);
env0_3.useEffect(_fun114205, [value4, state]);
const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<View2 style={[StyleSheet.absoluteFill, value5]}>
<View style={contentContainerStyle}>
{children}
</View>
</View2>
);
}
function ThreadList({channel, onThreadPress, onCreateThreadPress, contentContainerStyle}) { // fn#114207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:2528, offset: 0x024179b0, size: 525 bytes, params: 2, frame: 30
const styles = useStyles();
const env0_3 = styles;
const {joinedThreadIds,
unjoinedThreadIds} = (require(12057) /* metro dependency 12057: ThreadBrowserHooks */).useActiveThreads(channel);
const threadBrowserHooksModule = require(12057) /* metro dependency 12057: ThreadBrowserHooks */;
const useArchivedThreads = threadBrowserHooksModule.useArchivedThreads;
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
const LATEST_ACTIVITY = ThreadSortOrder.LATEST_ACTIVITY;
const binding = env0_8;
const ThreadSearchTagSetting = (require(1390) /* metro dependency 1390: ThreadSearchTagSetting */).ThreadSearchTagSetting;
const MATCH_SOME = ThreadSearchTagSetting.MATCH_SOME;
const {threadIds, canLoadMore, loadMore, loading} = Reflect.apply(useArchivedThreads, threadBrowserHooksModule,
[channel, LATEST_ACTIVITY, binding, MATCH_SOME]);
const value4 = env0_3.useCallback(function() {
if (!loading && canLoadMore) {
loadMore();
}
}, [loading, canLoadMore, loadMore]);
const value5 = env0_3.useMemo(_fun114209, [threadIds, joinedThreadIds, onThreadPress, unjoinedThreadIds]);
const value6 = env0_3.useMemo(_fun114213, [value5.length, loading]);
const value8 = env0_3.useCallback(_fun114215, [contentContainerStyle, value5, loading, onCreateThreadPress, value4,
styles.center, styles.container, styles.header, styles.footer, env0_3.useMemo(_fun114214,
[onCreateThreadPress])]);
const TransitionGroup = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionGroup;
return (
<TransitionGroup
items={value6}
renderItem={value8}
getItemKey={getThreadListStateKey}
/>
);
}
function EnterExitCrossFadeContainerP() { // fn#114203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:1586, owner: EnterExitCrossFadeContainer.p, offset: 0x0241783d, size: 195 bytes, params: 1, frame: 24
const springModule = require(4577) /* metro dependency 4577: spring */;
const withSpring = springModule.withSpring;
const value3 = env0_2.get();
const springStandard = (require(4581) /* metro dependency 4581: springPresets */).springStandard;
const closure = pT_114204;
const object = {};
object.state = state;
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
object.TransitionStates = TransitionStates;
object.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object.cleanUp = cleanUp;
closure.__closure = object;
closure.__workletHash = 2519144051135;
closure.__initData = env1_10;
return {opacity: Reflect.apply(withSpring, springModule, [value3, springStandard, 'respect-motion-settings',
closure])};
}
function _fun114205() { // fn#114205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:2158, offset: 0x0241796b, size: 69 bytes, params: 1, frame: 14
const binding = env0_2;
const set = binding.set;
const stateBinding = state;
const value = environment.__proto__;
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
const YEETED = TransitionStates.YEETED;
Reflect.apply(set, binding, [stateBinding !== YEETED ? 1 : 0]);
}
function _fun114209() { // fn#114209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:2937, offset: 0x02417bdf, size: 401 bytes, params: 1, frame: 21
var environment;
var push;
var value2;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var formatToPlainString;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var fcXlhe;
var value3;
var GHY7yQ;
var value4;
const items2 = [];
if (joinedThreadIds.length > 0) {
push = items2.push;
value2 = environment.__proto__;
formatToPlainString = intl.formatToPlainString;
fcXlhe = t.fcXlhe;
joinedThreadIdsBinding = joinedThreadIds;
Reflect.apply(push, items2, [{type: 'section', title: Reflect.apply(formatToPlainString, intl, [fcXlhe,
{count: joinedThreadIdsBinding.length}])}]);
joinedThreadIdsBinding.forEach(_fun114210);
}
if (unjoinedThreadIds.length > 0) {
push = items2.push;
value3 = environment.__proto__;
formatToPlainString = intl.formatToPlainString;
GHY7yQ = t.GHY7yQ;
unjoinedThreadIdsBinding = unjoinedThreadIds;
Reflect.apply(push, items2, [{type: 'section', title: Reflect.apply(formatToPlainString, intl, [GHY7yQ,
{count: unjoinedThreadIdsBinding.length}])}]);
unjoinedThreadIdsBinding.forEach(_fun114211);
}
if (threadIds.length > 0) {
push = items2.push;
value4 = environment.__proto__;
Reflect.apply(push, items2, [{type: 'section', title: intl.string(t.XsgrjS)}]);
threadIds.forEach(_fun114212);
}
return items2;
}
function _fun114213() { // fn#114213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:3589, offset: 0x02417e6f, size: 115 bytes, params: 1, frame: 3
return loading && env0_11.length === 0 ? [env1_11.LOADING] : env0_11.length === 0 ? [env1_11.EMPTY] : [env1_11.LIST];
}
function _fun114214() { // fn#114214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:3681, offset: 0x02417ee2, size: 202 bytes, params: 1, frame: 21
var r0;
var value3;
var TableRow;
var object;
var intl;
const onCreateThreadPressBinding = onCreateThreadPress;
const value2 = null;
if (value2 != onCreateThreadPressBinding) {
value3 = environment.__proto__;
TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
var tableRowProps = {'icon': null, 'onPress': null, 'label': null, 'start': true, 'end': true, 'arrow': true,
icon: ((Icon) => <Icon IconComponent={(require(11757) /* metro dependency 11757: ThreadPlusIcon */).ThreadPlusIcon} />)((require(7975) /* metro dependency 7975: RowButtonNative */).RowButton.Icon),
onPress: onCreateThreadPress};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
tableRowProps.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.rBIGBL);
r0 = <TableRow {...tableRowProps} />;
} else {
r0 = value2;
}
return r0;
}
function _fun114215(a0, a1, a2, a3) { // fn#114215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:3897, offset: 0x02417fac, size: 544 bytes, params: 5, frame: 27
var object2;
var stylesBinding;
var value3;
var AnimatedFlashList;
var intl;
const value = environment.__proto__;
const EMPTY = env1_11.EMPTY;
if (EMPTY === a1) {
return (
<EnterExitCrossFadeContainer
contentContainerStyle={styles.container}
state={a2}
cleanUp={a3}
key={a0}
>
{((Component) => <Component onCreateThreadPress={onCreateThreadPress} />)(importDefault(15098) /* metro dependency 15098: ThreadListEmpty */)}
</EnterExitCrossFadeContainer>
);
}
const LOADING = env1_11.LOADING;
if (LOADING === a1) {
stylesBinding = styles;
return (
<EnterExitCrossFadeContainer
contentContainerStyle={[stylesBinding.container, stylesBinding.center]}
state={a2}
cleanUp={a3}
key={a0}
>
{((Component) => <Component />)(importDefault(15099) /* metro dependency 15099: ThreadListLoadingIndicator */)}
</EnterExitCrossFadeContainer>
);
}
const LIST = env1_11.LIST;
if (LIST === a1) {
object2 = {};
stylesBinding = styles;
object2.contentContainerStyle = stylesBinding.container;
object2.state = a2;
object2.cleanUp = a3;
value3 = undefined;
AnimatedFlashList = (require(8416) /* metro dependency 8416: flashList */).AnimatedFlashList;
var animatedFlashListProps = {data: env0_11, ListHeaderComponent: env0_12,
ListHeaderComponentStyle: stylesBinding.header, renderItem: renderItem_114200,
keyExtractor: keyExtractor_114201, onEndReached: env0_10, onEndReachedThreshold: 0.4};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
animatedFlashListProps.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.B2panI);
animatedFlashListProps.estimatedItemSize = 64;
animatedFlashListProps.ListFooterComponent = loading ? importDefault(15099) /* metro dependency 15099: ThreadListLoadingIndicator */ : value3;
animatedFlashListProps.ListFooterComponentStyle = loading ? styles.footer : value3;
animatedFlashListProps.contentContainerStyle = contentContainerStyle;
return (
<EnterExitCrossFadeContainer {...object2} key={a0}>
<AnimatedFlashList {...animatedFlashListProps} />
</EnterExitCrossFadeContainer>
);
}
}
function pT_114204(a0) { // fn#114204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:1685, owner: EnterExitCrossFadeContainer.p.t, offset: 0x02417900, size: 107 bytes, params: 2, frame: 13
var r0;
var stateBinding;
var runOnJS;
var value2;
let value = a0;
if (value) {
value = environment.__proto__;
stateBinding = state;
value = environment.__proto__.__proto__;
value = stateBinding === (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates.YEETED;
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
runOnJS = value.runOnJS;
value2 = environment.__proto__;
Reflect.apply(runOnJS, value, [cleanUp])();
}
}
function _fun114210(a0, a1) { // fn#114210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:3083, offset: 0x02417d70, size: 85 bytes, params: 3, frame: 15
return env0_0.push({type: 'thread', threadId: a0, start: a1 === 0, end: a1 === joinedThreadIds.length - 1,
onPress: onThreadPress});
}
function _fun114211(a0, a1) { // fn#114211, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:3294, offset: 0x02417dc5, size: 85 bytes, params: 3, frame: 15
return env0_0.push({type: 'thread', threadId: a0, start: a1 === 0, end: a1 === unjoinedThreadIds.length - 1,
onPress: onThreadPress});
}
function _fun114212(a0, a1) { // fn#114212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15292:3475, offset: 0x02417e1a, size: 85 bytes, params: 3, frame: 15
return env0_0.push({type: 'thread', threadId: a0, start: a1 === 0, end: a1 === threadIds.length - 1,
onPress: onThreadPress});
}
@@ -0,0 +1,60 @@
/* Metro module 15098; source: modules/threads/native/components/redesign/ThreadListEmpty.tsx; dependencies: [31, 27, 33, 4501, 697, 1305, 11758, 4573, 1244, 4578, 2] */
function _fun114240(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#114240, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15295:6, offset: 0x0241910a, size: 325 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const value2 = require(33) /* metro dependency 33 */;
const env0_4 = value2.jsx;
const env0_5 = value2.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const object = {};
const BACKGROUND_MOD_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_SUBTLE;
object.backgroundColor = BACKGROUND_MOD_SUBTLE;
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object.padding = 12;
const env0_6 = Reflect.apply(createStyles, createStylesModule, [{container: {'flex': 1, 'justifyContent': 'center',
'alignItems': 'center'}, iconWrapper: object, title: {'textAlign': 'center', 'marginTop': 16,
'marginHorizontal': 16}, subtext: {'textAlign': 'center', 'marginTop': 4, 'marginHorizontal': 16,
'marginBottom': 16}}]);
value = value.memo(_fun114241);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/redesign/ThreadListEmpty.tsx');
exports.default = value;
}
function _fun114241({onCreateThreadPress}) { // fn#114241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15295:495, offset: 0x0241924f, size: 477 bytes, params: 2, frame: 27
var r5;
var Button;
var object6;
const styles = useStyles();
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const iconProps = {source: importDefault(11758) /* metro dependency 11758 */};
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
const Sizes = Icon2.Sizes;
const MEDIUM = Sizes.MEDIUM;
iconProps.size = MEDIUM;
const items2 = [<View style={styles.iconWrapper}><Icon {...iconProps} /></View>];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const HgTQ8p = (require(1244) /* metro dependency 1244: indexNative */).t.HgTQ8p;
items2[1] = <Text style={styles.title} accessibilityRole="header" maxFontSizeMultiplier={2} variant="heading-lg/semibold" color="mobile-text-heading-primary">{Reflect.apply(string,
intl, [HgTQ8p])}</Text>;
items2[2] = <Text style={styles.subtext} maxFontSizeMultiplier={2} variant="text-sm/medium" color="text-default">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.jmq9GC)}</Text>;
const value3 = onCreateThreadPress != null;
if (value3) {
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
r5 = <Button onPress={onCreateThreadPress} text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.rBIGBL)} />;
} else {
r5 = value3;
}
items2[3] = r5;
return (
<View style={styles.container}>
{items2}
</View>
);
}
@@ -0,0 +1,18 @@
/* Metro module 15099; source: modules/threads/native/components/redesign/ThreadListLoadingIndicator.tsx; dependencies: [31, 33, 4501, 10686, 2] */
function _fun114242(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#114242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15296:6, offset: 0x0241942c, size: 191 bytes, params: 8, frame: 20
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_2 = (require(33) /* metro dependency 33 */).jsx;
const env0_3 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({spinner: {'width': 32,
'height': 32}});
value = value.memo(_fun114243);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/redesign/ThreadListLoadingIndicator.tsx');
exports.default = value;
}
function _fun114243() { // fn#114243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15296:185, offset: 0x024194eb, size: 64 bytes, params: 1, frame: 15
const styles = useStyles();
return ((Component) => <Component style={styles.spinner} animate />)(importDefault(10686) /* metro dependency 10686: MessageLoadingSpinner */);
}
@@ -0,0 +1,53 @@
/* Metro module 15096; source: modules/threads/native/components/redesign/ThreadListTableRow.tsx; dependencies: [31, 27, 1379, 33, 4501, 6238, 15097, 566, 2] */
function _fun114216(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#114216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15293:6, offset: 0x024181cc, size: 243 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
const env0_6 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({subLabel: {'maxWidth': '100%',
'marginTop': 2}});
value = value.memo(_fun114220);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/redesign/ThreadListTableRow.tsx');
exports.default = value;
}
function ThreadListTableRow({thread, onPress, start, end}) { // fn#114217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15293:210, offset: 0x024182bf, size: 224 bytes, params: 2, frame: 24
const styles = useStyles();
const value2 = env0_2.useMemo(function() {
if (onPress != null) {
return _fun114219;
}
}, [onPress, thread.id]);
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
const name = thread.name;
const ThreadSubtext = (require(15097) /* metro dependency 15097: ThreadBrowserRowSubtext */).ThreadSubtext;
return (
<TableRow
label={name}
subLabel={<View style={styles.subLabel}><ThreadSubtext thread={thread} /></View>}
onPress={value2}
start={start}
end={end}
arrow
/>
);
}
function _fun114220({threadId, onPress, start, end}) { // fn#114220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15293:510, offset: 0x024183d4, size: 129 bytes, params: 2, frame: 19
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(threadId);
});
return channel == null ? null : <ThreadListTableRow thread={channel} start={start} end={end} onPress={onPress} />;
}
function _fun114218() { // fn#114218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15293:297, offset: 0x0241839f, size: 28 bytes, params: 1, frame: 2
if (onPress != null) {
return function() {
return onPress(thread.id);
};
}
}
@@ -0,0 +1,23 @@
/* Metro module 14534; source: modules/threads/native/components/showThreadLongPressActionSheet.tsx; dependencies: [4080, 14535, 1962, 2] */
function _fun109959(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#109959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14731:6, offset: 0x023634da, size: 103 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/showThreadLongPressActionSheet.tsx');
exports.default = showThreadLongPressActionSheet;
}
function showThreadLongPressActionSheet(a0) { // fn#109960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14731:204, offset: 0x02363541, size: 102 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'ThreadLongPressActionSheet', {channelId: a0,
onClose: onClose_109961}]);
}
function showThreadLongPressActionSheetOnClose() { // fn#109961, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14731:328, owner: showThreadLongPressActionSheet.onClose, offset: 0x023635a7, size: 43 bytes, params: 1, frame: 12
const value = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet('ThreadLongPressActionSheet');
}
@@ -0,0 +1,606 @@
/* Metro module 15011; source: modules/threads/native/components/thread_creation/CreateThreadView.tsx; dependencies: [5, 57, 31, 27, 4645, 7080, 661, 33, 4501, 697, 7876, 7165, 6771, 6789, 1585, 5463, 7704, 6684, 15012, 6808, 1244, 15014, 11789, 11525, 11959, 11285, 1485, 683, 4863, 1230, 11010, 15013, 4015, 2] */
function _fun113467(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#113467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15208:6, offset: 0x023fb089, size: 820 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const StyleSheet = value2.StyleSheet;
const env0_6 = value2.View;
const env0_7 = value2.ScrollView;
const env0_8 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const env0_9 = (require(7080) /* metro dependency 7080: SlowmodeStore */).SlowmodeType;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_10 = constantsModule.AbortCodes;
const env0_11 = constantsModule.AnalyticEvents;
const env0_12 = constantsModule.NOOP;
const value4 = require(33) /* metro dependency 33 */;
const env0_13 = value4.jsx;
const env0_14 = value4.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.container = {backgroundColor: BACKGROUND_BASE_LOW, flex: 1};
object2.containerContent = {flexGrow: 0};
object2.expander = {flex: 1};
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object2.border = {'height': 1, 'backgroundColor': null, 'alignSelf': 'stretch', 'marginBottom': 16,
backgroundColor: BORDER_SUBTLE};
object2.options = {marginHorizontal: 12};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.optionsInner = {paddingBottom: PX_16};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object2.optionPrivateThread = {paddingTop: PX_8};
const object3 = {};
let PX_64 = (importDefault(697) /* metro dependency 697: native */).space.PX_64;
object3.width = PX_64;
PX_64 = (importDefault(697) /* metro dependency 697: native */).space.PX_64;
object3.height = PX_64;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.marginTop = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.marginBottom = PX_16;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xxl;
const BACKGROUND_MOD_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_SUBTLE;
object3.backgroundColor = BACKGROUND_MOD_SUBTLE;
object3.justifyContent = 'center';
object3.alignItems = 'center';
object2.threadIconContainer = object3;
const object4 = {};
object4.borderBottomWidth = StyleSheet.hairlineWidth;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object4.paddingHorizontal = PX_16;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object4.paddingVertical = PX_4;
object4.justifyContent = 'flex-end';
object4.flexDirection = 'row';
const CHAT_BORDER = (importDefault(697) /* metro dependency 697: native */).colors.CHAT_BORDER;
object4.borderColor = CHAT_BORDER;
object2.typingWrapper = object4;
object2.parentMessageContainer = {marginBottom: 16};
const env0_15 = Reflect.apply(createStyles, createStylesModule, [object2]);
value = value.memo(_fun113478);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/thread_creation/CreateThreadView.tsx');
exports.CreateThreadView = value;
}
function CreateThreadViewInner({threadSettingsDraft, parentChannel, screenIndex}) { // fn#113468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15208:1187, offset: 0x023fb3bd, size: 1409 bytes, params: 2, frame: 55
var r29;
var TableSwitchRow;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const styles = useStyles();
const value2 = (require(7876) /* metro dependency 7876: ThreadCreationHooks */).usePrivateThreadMode(parentChannel);
env0_5.useEffect(function() {
return _fun113470;
}, [parentChannel.id]);
const value5 = env0_4(env0_5.useState(null), 2);
const property = value5[0];
const value6 = useSubmitForm({parentChannel: parentChannel, threadSettingsDraft: threadSettingsDraft,
privateThreadMode: value2, setNameError: value5[1]});
const defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
const CREATE_THREAD = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).CREATE_THREAD;
const analyticsLocations = defaultImport(CREATE_THREAD).analyticsLocations;
const value7 = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
const insets = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)({'isKeyboardAwareOnAndroid': false,
'includeKeyboardHeight': true}).insets;
const isForumLikeChannel2 = parentChannel.isForumLikeChannel();
const value8 = env0_5.useRef(null);
const value9 = env0_5.useRef(null);
const value10 = threadSettingsDraft.parentMessageId != null;
const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
const value11 = ((Component) => <Component absolute />)(importDefault(7704) /* metro dependency 7704: ThemedGradient */);
const items2 = [styles.container];
items2[1] = {marginBottom: insets.bottom - value7.bottom};
const items3 = [<View style={styles.expander} />];
const ThreadIcon = (require(6684) /* metro dependency 6684: ThreadIcon */).ThreadIcon;
const items4 = [<View style={styles.threadIconContainer}><ThreadIcon size="lg" /></View>];
items4[1] = ((Component) => <Component ref={value9} chatInputRef={value8} threadSettingsDraft={threadSettingsDraft} threadNameError={property} optional={value10} />)(importDefault(15012) /* metro dependency 15012: ThreadCreationTitleInput */);
if (isForumLikeChannel2) {
r29 = null;
} else if (threadSettingsDraft.parentMessageId != null) {
r29 = null;
} else if (value2 === (require(7876) /* metro dependency 7876: ThreadCreationHooks */).PrivateThreadMode.Disabled) {
r29 = null;
} else {
var viewBinding6Props = {style: styles.optionPrivateThread};
TableSwitchRow = (require(6808) /* metro dependency 6808: TableSwitchRowNative */).TableSwitchRow;
r29 = <View {...viewBinding6Props}><TableSwitchRow start end disabled={value2 !== (require(7876) /* metro dependency 7876: ThreadCreationHooks */).PrivateThreadMode.Enabled} label={intl.string(t.F1zyvU)} subLabel={intl.string(t.Wy5RIQ)} value={(require(7876) /* metro dependency 7876: ThreadCreationHooks */).getIsPrivate(threadSettingsDraft,
value2)} onValueChange={onValueChange_113477} /></View>;
}
items4[2] = r29;
items3[1] = <ScrollView style={styles.containerContent}><View style={styles.options}><View style={styles.optionsInner}>{items4}</View>{threadSettingsDraft.parentMessageId != null ? <View style={styles.parentMessageContainer}><View style={styles.border} />{((ThreadCreationStarterMessage) => <ThreadCreationStarterMessage channelId={parentChannel.id} messageId={threadSettingsDraft.parentMessageId} />)((require(15014) /* metro dependency 15014: ThreadParentMessage */).ThreadCreationStarterMessage)}</View> : null}</View></ScrollView>;
items3[2] = parentChannel.rateLimitPerUser > 0 ? <View style={styles.typingWrapper}>{((Component) => <Component channel={parentChannel} hasTypingText={false} slowmodeType={SlowmodeType.CreateThread} />)(importDefault(11789) /* metro dependency 11789: SlowModeIndicator */)}</View> : null;
items3[3] = ((Component) => <Component ref={value8} channel={parentChannel} onJumpToPresent={NOOP} screenIndex={screenIndex} secondaryTextFieldRef={value9} threadCreationCallback={value6} />)(importDefault(11525) /* metro dependency 11525: ChatInput */);
items3[4] = ((Component) => <Component channelId={parentChannel.id} />)(importDefault(11959) /* metro dependency 11959: ChannelSafeAreaBottomAndroid */);
return (
<AnalyticsLocationProvider value={analyticsLocations}>
{value11}
<View style={items2}>
{items3}
</View>
</AnalyticsLocationProvider>
);
}
function _fun113478({channelId, screenIndex}) { // fn#113478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15208:4815, offset: 0x023fbf22, size: 98 bytes, params: 2, frame: 17
const value2 = (importDefault(11285) /* metro dependency 11285: useCreateThreadViewProps */)(channelId);
return value2 == null ? null : <CreateThreadViewInner parentChannel={value2.parentChannel} screenIndex={screenIndex} threadSettingsDraft={value2.threadSettingsDraft} />;
}
function _fun113469() { // fn#113469, offset: 0x023fb93e, size: 11 bytes, params: 1, frame: 1
return function() {
var defaultImport = importDefault(dependencyMap[11]);
var parentChannelBinding = parentChannel;
defaultImport.clearDraft(parentChannelBinding.id, DraftType.ThreadSettings);
importDefault(dependencyMap[11]).clearDraft(parentChannelBinding.id, DraftType.FirstThreadMessage);
};
}
function useSubmitForm({parentChannel, threadSettingsDraft, privateThreadMode, setNameError}) { // fn#113471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15208:1488, owner: CreateThreadViewInner.useSubmitForm, offset: 0x023fb9aa, size: 330 bytes, params: 2, frame: 23
var environment;
const value = environment.__proto__;
const value2 = (require(1485) /* metro dependency 1485 */).useNavigation();
let binding = env1_5;
const env0_4 = binding.useRef(false);
const value3 = threadSettingsDraft.parentMessageId == null;
binding = env1_5;
const useCallback = binding.useCallback;
return env1_5.useCallback(_fun113473(), [setNameError, threadSettingsDraft.parentMessageId,
threadSettingsDraft.name,
(importDefault(11010) /* metro dependency 11010: useCreateThread */)({parentChannel: parentChannel,
parentMessageId: threadSettingsDraft.parentMessageId, threadSettings: threadSettingsDraft,
privateThreadMode: privateThreadMode, location: threadSettingsDraft.location ?? '(unknown)',
onThreadCreated: Reflect.apply(useCallback, binding, [_fun113472, [value3, value2, threadSettingsDraft.location,
threadSettingsDraft.parentMessageId, parentChannel]]), useDefaultThreadName: true}), parentChannel]);
}
function CreateThreadViewInnerOnValueChange(a0) { // fn#113477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15208:4239, owner: CreateThreadViewInner.onValueChange, offset: 0x023fbedc, size: 70 bytes, params: 2, frame: 14
var value;
const parentChannelId = threadSettingsDraft.parentChannelId;
if (parentChannelId != null) {
value = environment.__proto__;
value = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
value.changeThreadSettings(parentChannelId, {isPrivate: a0});
}
}
function _fun113472(a0) { // fn#113472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15208:1678, offset: 0x023fbaf4, size: 367 bytes, params: 2, frame: 22
var guild_id;
var r12;
var value2;
var value3;
var defaultImport;
var track;
var MESSAGE_SHORTCUT_ACTION_SENT;
var object2;
var parentChannelBinding;
var moduleValue;
var collectGuildAnalyticsMetadata;
var value4;
var moduleValue2;
var value;
if (threadSettingsDraft.location === 'Message Shortcut') {
value2 = environment.__proto__.__proto__;
value3 = undefined;
defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
track = defaultImport.track;
MESSAGE_SHORTCUT_ACTION_SENT = AnalyticEvents.MESSAGE_SHORTCUT_ACTION_SENT;
object2 = {};
parentChannelBinding = parentChannel;
object2.channel_id = parentChannelBinding.id;
guild_id = parentChannelBinding == null ? value3 : parentChannel.guild_id;
object2.guild_id = guild_id;
object2.original_message_id = threadSettingsDraft.parentMessageId;
object2.action = 'thread';
moduleValue = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
collectGuildAnalyticsMetadata = moduleValue.collectGuildAnalyticsMetadata;
value4 = parentChannel == null;
if (value4) {
guild_id = value3;
r12 = value4;
} else {
parentChannelBinding = parentChannel;
guild_id = parentChannelBinding.guild_id;
r12 = parentChannelBinding;
}
copyDataProperties(object2, Reflect.apply(collectGuildAnalyticsMetadata, moduleValue, [guild_id]), r12);
moduleValue2 = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
copyDataProperties(object2, moduleValue2.collectChannelAnalyticsMetadata(parentChannel), r12);
Reflect.apply(track, defaultImport, [MESSAGE_SHORTCUT_ACTION_SENT, object2]);
}
if (env0_3 != null) {
env0_3.navigate({'name': 'channel', 'key': 'new-thread', 'params': null, 'merge': true,
params: {guildId: a0.guild_id, channelId: a0.id, showCreateThread: false}});
} else if (result) {
value = environment.__proto__.__proto__;
value = require(1230) /* metro dependency 1230: router_utils */;
value.transitionToGuild(a0.guild_id, a0.id);
}
}
function _fun113473() { // fn#113473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15208:2406, offset: 0x023fbc63, size: 36 bytes, params: 1, frame: 12
const env0_0 = env2_3(_fun113475);
return _fun113476;
}
function* _fun113475(a0, a1) { // fn#113475, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15208:2426, offset: 0x023fbc92, size: 586 bytes, params: 3, frame: 24
var code;
var name;
var r4;
var parentChannelBinding;
var parentMessageId;
var value4;
var value5;
var trim;
var value6;
var value7;
var binding;
var value8;
var value9;
var value10;
var value11;
var binding2;
var property;
var value12;
var saveDraft;
var threadSettingsDraftBinding;
var id;
var FirstThreadMessage;
var value13;
var binding3;
var binding4;
var value14;
var makeEmptyTitleError;
var emptyTitleError;
var value15;
var dismissKeyboard;
var error;
var body;
var value16;
var AUTOMOD_TITLE_BLOCKED;
var INVALID_FORM_BODY;
var value17;
var errors;
var value18;
var binding5;
var binding6;
var value19;
var makeApiNameRequiredError;
var value20;
var binding7;
var binding8;
var value21;
var makeAutomodViolationError;
var value22;
let value = undefined;
if (true) {
value = undefined;
if (!env2_4.current) {
env2_4.current = true;
env2_2(null);
reducibleJoin4: while (true) {
reduciblePort66: while (true) {
exceptionLanding53: while (true) {
try {
parentChannelBinding = parentChannel;
} catch (error) {
break exceptionLanding53;
}
break reducibleJoin4;
}
body = error.body;
reducibleJoin55: while (true) {
if (body == null) {
code = value;
break reducibleJoin55;
}
code = body.code;
break reducibleJoin55;
}
value16 = environment.__proto__.__proto__.__proto__.__proto__;
AUTOMOD_TITLE_BLOCKED = env4_10.AUTOMOD_TITLE_BLOCKED;
if (code === AUTOMOD_TITLE_BLOCKED) {
binding = env2_2;
binding7 = env4_0;
binding8 = env4_2;
value21 = binding7(binding8[31]);
makeAutomodViolationError = value21.makeAutomodViolationError;
body = error.body;
binding(Reflect.apply(makeAutomodViolationError, value21, [body, threadSettingsDraft]));
value22 = binding7(binding8[32]);
dismissKeyboard = value22.dismissKeyboard;
Reflect.apply(dismissKeyboard, value22, []);
} else {
body = error.body;
reducibleJoin58: while (true) {
if (body == null) {
code = value;
break reducibleJoin58;
}
code = body.code;
break reducibleJoin58;
}
INVALID_FORM_BODY = env4_10.INVALID_FORM_BODY;
value17 = code === INVALID_FORM_BODY;
reducibleJoin63: while (true) {
if (value17) {
body = error.body;
reducibleJoin62: while (true) {
if (body == null) {
name = value;
break reducibleJoin62;
}
errors = body.errors;
if (errors == null) {
name = value;
break reducibleJoin62;
}
name = errors.name;
break reducibleJoin62;
}
value18 = name != null;
r4 = value18;
break reducibleJoin63;
}
r4 = value17;
break reducibleJoin63;
}
reducibleJoin66: while (true) {
if (r4) {
binding = env2_2;
binding5 = env4_0;
binding6 = env4_2;
value19 = binding5(binding6[31]);
makeApiNameRequiredError = value19.makeApiNameRequiredError;
binding(Reflect.apply(makeApiNameRequiredError, value19, []));
value20 = binding5(binding6[32]);
dismissKeyboard = value20.dismissKeyboard;
Reflect.apply(dismissKeyboard, value20, []);
break reducibleJoin66;
}
break reducibleJoin66;
}
}
break reduciblePort66;
}
env2_4.current = false;
return value;
}
try {
parentMessageId = parentChannelBinding.parentMessageId;
} catch (error) {
break exceptionLanding53;
}
try {
value4 = parentMessageId != null;
} catch (error) {
break exceptionLanding53;
}
reducibleJoin67: while (true) {
reducibleJoin19: while (true) {
if (!value4) {
try {
parentChannelBinding = parentChannel;
} catch (error) {
break exceptionLanding53;
}
try {
name = parentChannelBinding.name;
} catch (error) {
break exceptionLanding53;
}
try {
value5 = name == null;
} catch (error) {
break exceptionLanding53;
}
if (!value5) {
try {
parentChannelBinding = parentChannel;
} catch (error) {
break exceptionLanding53;
}
try {
name = parentChannelBinding.name;
} catch (error) {
break exceptionLanding53;
}
try {
trim = name.trim;
} catch (error) {
break exceptionLanding53;
}
try {
value6 = Reflect.apply(trim, name, []);
} catch (error) {
break exceptionLanding53;
}
try {
value7 = value6 === '';
} catch (error) {
break exceptionLanding53;
}
reducibleJoin34: while (true) {
if (value7) {
break reducibleJoin34;
}
try {
binding = env2_6;
} catch (error) {
break exceptionLanding53;
}
try {
value8 = binding(a0, a1);
} catch (error) {
break exceptionLanding53;
}
yield value8;
try {
value9 = undefined;
value10 = false;
} catch (error) {
break exceptionLanding53;
}
break reducibleJoin19;
}
}
try {
binding = env2_2;
} catch (error) {
break exceptionLanding53;
}
value13 = environment.__proto__.__proto__.__proto__.__proto__;
try {
binding3 = env4_0;
} catch (error) {
break exceptionLanding53;
}
try {
binding4 = env4_2;
} catch (error) {
break exceptionLanding53;
}
try {
property = binding4[31];
} catch (error) {
break exceptionLanding53;
}
try {
value14 = binding3(property);
} catch (error) {
break exceptionLanding53;
}
try {
makeEmptyTitleError = value14.makeEmptyTitleError;
} catch (error) {
break exceptionLanding53;
}
try {
emptyTitleError = Reflect.apply(makeEmptyTitleError, value14, []);
} catch (error) {
break exceptionLanding53;
}
try {
binding(emptyTitleError);
} catch (error) {
break exceptionLanding53;
}
try {
property = binding4[32];
} catch (error) {
break exceptionLanding53;
}
try {
value15 = binding3(property);
} catch (error) {
break exceptionLanding53;
}
try {
dismissKeyboard = value15.dismissKeyboard;
} catch (error) {
break exceptionLanding53;
}
try {
Reflect.apply(dismissKeyboard, value15, []);
} catch (error) {
break exceptionLanding53;
}
try {
binding = env2_4;
} catch (error) {
break exceptionLanding53;
}
try {
binding.current = false;
} catch (error) {
break exceptionLanding53;
}
return value;
}
try {
binding = env2_6;
} catch (error) {
break exceptionLanding53;
}
try {
value8 = binding(a0, a1);
} catch (error) {
break exceptionLanding53;
}
yield value8;
try {
value9 = undefined;
value10 = false;
} catch (error) {
break exceptionLanding53;
}
break reducibleJoin19;
}
if (value10) {
return value9;
}
value11 = environment.__proto__.__proto__.__proto__.__proto__;
try {
binding = env4_1;
} catch (error) {
break exceptionLanding53;
}
try {
binding2 = env4_2;
} catch (error) {
break exceptionLanding53;
}
try {
property = binding2[11];
} catch (error) {
break exceptionLanding53;
}
try {
value12 = binding(property);
} catch (error) {
break exceptionLanding53;
}
try {
saveDraft = value12.saveDraft;
} catch (error) {
break exceptionLanding53;
}
try {
threadSettingsDraftBinding = threadSettingsDraft;
} catch (error) {
break exceptionLanding53;
}
try {
id = threadSettingsDraftBinding.id;
} catch (error) {
break exceptionLanding53;
}
try {
binding = env4_8;
} catch (error) {
break exceptionLanding53;
}
try {
FirstThreadMessage = binding.FirstThreadMessage;
} catch (error) {
break exceptionLanding53;
}
try {
Reflect.apply(saveDraft, value12, [id, '', FirstThreadMessage]);
} catch (error) {
break exceptionLanding53;
}
env2_4.current = false;
break reducibleJoin67;
}
}
}
return value;
}
@@ -0,0 +1,120 @@
/* Metro module 15012; source: modules/threads/native/components/thread_creation/ThreadCreationTitleInput.tsx; dependencies: [31, 1379, 661, 33, 15013, 7165, 7877, 566, 7876, 1244, 7981, 6619, 2] */
function _fun113479(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#113479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15209:6, offset: 0x023fbf84, size: 201 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const env0_5 = (require(661) /* metro dependency 661: Constants */).MAX_CHANNEL_NAME_LENGTH;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
value = value.memo(value.forwardRef(_fun113480));
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/components/thread_creation/ThreadCreationTitleInput.tsx');
exports.default = value;
}
function _fun113480({chatInputRef, threadSettingsDraft, threadNameError, optional}, a1) { // fn#113480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15209:180, offset: 0x023fc04d, size: 675 bytes, params: 3, frame: 28
var r5;
var moduleValue3;
const env0_2 = a1;
const value3 = (require(15013) /* metro dependency 15013: FormError */).renderError(threadNameError,
{content: threadSettingsDraft.name});
const binding = env0_3;
const value4 = binding.useRef(threadSettingsDraft.name);
const value5 = binding.useCallback(_fun113481, [threadSettingsDraft.parentChannelId]);
const value6 = binding.useCallback(_fun113482, [threadSettingsDraft]);
const value7 = binding.useCallback(function() {
var current = chatInputRef.current;
if (current != null) {
current.focus();
}
}, [chatInputRef]);
binding.useEffect(_fun113484, [threadSettingsDraft.name, a1]);
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(threadSettingsDraft.parentChannelId);
});
const value8 = '';
if (channel != null) {
moduleValue3 = require(7876) /* metro dependency 7876: ThreadCreationHooks */;
r5 = moduleValue3.getDefaultThreadName(channel, threadSettingsDraft.parentMessageId);
} else {
r5 = value8;
}
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const r13 = optional ? Reflect.apply(string, intl, [t.JPvIiL]) : Reflect.apply(string, intl, [t.j3XWjD]);
const TextInput = (require(7981) /* metro dependency 7981: TextInputNative */).TextInput;
const textInputProps = {defaultValue: (importDefault(6619) /* metro dependency 6619: useRefValue */)(value4),
errorMessage: value3, label: r13, accessibilityLabel: r13,
accessibilityHint: optional ? undefined : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['/+VEZN']),
required: !optional, isClearable: true, autoFocus: true, maxLength: MAX_CHANNEL_NAME_LENGTH,
onSubmitEditing: value7, onBlur: value6, onChange: value5};
r5 = value8 === r5 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['Nb2/RE']) : r5;
textInputProps.placeholder = r5;
textInputProps.ref = a1;
textInputProps.returnKeyType = 'next';
textInputProps.textContentType = 'none';
return <TextInput {...textInputProps} />;
}
function _fun113481(a0) { // fn#113481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15209:346, offset: 0x023fc2f0, size: 109 bytes, params: 2, frame: 19
var value2;
var defaultImport;
var changeThreadSettings;
var object2;
let parentChannelId = threadSettingsDraft.parentChannelId;
if (parentChannelId != null) {
value2 = environment.__proto__;
defaultImport = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
changeThreadSettings = defaultImport.changeThreadSettings;
parentChannelId = threadSettingsDraft.parentChannelId;
object2 = {};
object2.name = (importDefault(7877) /* metro dependency 7877: sanitizeThreadName */)(a0, false);
Reflect.apply(changeThreadSettings, defaultImport, [parentChannelId, object2]);
env0_3.current = a0;
}
}
function _fun113482() { // fn#113482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15209:498, offset: 0x023fc35d, size: 135 bytes, params: 1, frame: 16
var value2;
var defaultImport;
var value3;
var defaultImport2;
let name = threadSettingsDraft.name;
if (name != null) {
if (threadSettingsDraft.parentChannelId != null) {
value2 = environment.__proto__;
defaultImport = importDefault(7877) /* metro dependency 7877: sanitizeThreadName */;
threadSettingsDraftBinding = threadSettingsDraft;
name = threadSettingsDraftBinding.name;
value3 = defaultImport(name, true);
name = threadSettingsDraftBinding.name;
if (value3 !== name) {
defaultImport2 = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
defaultImport2.changeThreadSettings(threadSettingsDraft.parentChannelId, {name: value3});
}
}
}
}
function _fun113484() { // fn#113484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15209:726, offset: 0x023fc404, size: 104 bytes, params: 1, frame: 13
var r2;
var value4;
let current = env0_3.current;
let r1 = current !== threadSettingsDraft.name && threadSettingsDraft.name != null;
if (r1) {
value4 = require == null;
if (value4) {
r1 = value4;
r2 = undefined;
} else {
current = require.current;
r1 = current == null;
r2 = current;
}
if (!r1) {
r2.setText(threadSettingsDraft.name);
}
}
}
@@ -0,0 +1,20 @@
/* Metro module 11120; source: modules/threads/native/navigateToThreadCreation.tsx; dependencies: [7153, 4007, 4601, 2] */
function _fun85119(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85119, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11306:6, offset: 0x01f64ece, size: 103 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/navigateToThreadCreation.tsx');
exports.navigateToThreadCreation = navigateToThreadCreation;
}
function navigateToThreadCreation(a0, a1) { // fn#85120, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11306:204, offset: 0x01f64f35, size: 122 bytes, params: 3, frame: 17
var value;
(importDefault(7153) /* metro dependency 7153: ThreadActionCreators */).openThreadCreationForMobile(a0, undefined,
a1);
const navigationRouteUtilsNativeModule = require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */;
if (!navigationRouteUtilsNativeModule.navigateToCreateThread(a0.guild_id, a0.id)) {
value = require(4601) /* metro dependency 4601: transitionToChannel */;
value.transitionToChannel(a0.id);
}
}
@@ -0,0 +1,16 @@
/* Metro module 9695; source: modules/threads/native/showThreadBrowserModal.tsx; dependencies: [9696, 7169, 4008, 2] */
function _fun76214(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9881:6, offset: 0x01dc68bd, size: 117 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(9696) /* metro dependency 9696: ChannelDetailsConstants */).ChannelDetailsNavigatorScreens;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/showThreadBrowserModal.tsx');
exports.default = function(a0) {
require(dependencyMap[1]).trackThreadBrowserOpened();
var value2 = require(dependencyMap[2]).getRootNavigationRef();
if (value2 != null && value2.isReady()) {
value2.navigate('sidebar', {channelId: a0.id, initialRouteName: ChannelDetailsNavigatorScreens.THREADS});
}
};
}
@@ -0,0 +1,17 @@
/* Metro module 11243; source: modules/threads/native/threadActionSheets.tsx; dependencies: [4080, 11244, 1962, 2] */
function _fun85959(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11429:6, offset: 0x01f82adb, size: 103 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/threadActionSheets.tsx');
exports.showThreadNotificationsBottomSheet = showThreadNotificationsBottomSheet;
}
function showThreadNotificationsBottomSheet(a0) { // fn#85960, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11429:208, offset: 0x01f82b42, size: 88 bytes, params: 2, frame: 16
const defaultImport = importDefault(dependencyMap[0]);
const openLazy = defaultImport.openLazy;
let value = require(dependencyMap[2]);
value = value(dependencyMap[1], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'ThreadNotificationsBottomSheet', {channel: a0}]);
}
@@ -0,0 +1,113 @@
/* Metro module 11010; source: modules/threads/native/useCreateThread.tsx; dependencies: [5, 31, 4645, 4503, 6771, 7876, 7067, 7076, 7880, 7879, 7224, 4697, 4655, 7881, 2] */
function _fun84350(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:6, offset: 0x01f46ada, size: 194 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const env0_5 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const env0_6 = (require(4503) /* metro dependency 4503: MessageConstants */).MessageSendLocation;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/useCreateThread.tsx');
exports.default = useCreateThread;
exports.useCreateForumPost = useCreateForumPost;
}
function useCreateThread({parentChannel, parentMessageId, threadSettings, privateThreadMode, location, onThreadCreated, useDefaultThreadName}) { // fn#84351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:253, offset: 0x01f46b9c, size: 162 bytes, params: 2, frame: 21
const env0_0 = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
return (require(7876) /* metro dependency 7876: ThreadCreationHooks */).useCreateThreadCommon({parentChannel: parentChannel,
parentMessageId: parentMessageId, threadSettings: threadSettings, privateThreadMode: privateThreadMode,
location: location, onThreadCreated: onThreadCreated, useDefaultThreadName: useDefaultThreadName,
uploadHandler: uploadHandler});
}
function useCreateForumPost({parentChannel, threadSettings, appliedTags, onThreadCreated}) { // fn#84354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:995, offset: 0x01f46d6f, size: 198 bytes, params: 2, frame: 22
const analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations;
return (require(7876) /* metro dependency 7876: ThreadCreationHooks */).useCreateForumPostCommon({parentChannel: parentChannel,
name: threadSettings?.name ?? '', appliedTags: appliedTags, analyticsLocations: analyticsLocations,
onThreadCreated: onThreadCreated, upload: env0_4.useCallback(_fun84355(), [analyticsLocations, parentChannel])});
}
function uploadHandler(a0, a1, a2) { // fn#84352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:614, owner: useCreateThread.uploadHandler, offset: 0x01f46c3e, size: 129 bytes, params: 4, frame: 22
const env0_0 = a0;
const env0_1 = a1;
const defaultImport = importDefault(7067) /* metro dependency 7067: MessageActionCreators */;
const sendMessage = defaultImport.sendMessage;
const id = a0.id;
const value2 = (importDefault(7076) /* metro dependency 7076: MessageParser */).parse(a0, a2);
const THREAD_CREATION = MessageSendLocation.THREAD_CREATION;
Reflect.apply(sendMessage, defaultImport, [id, value2, undefined, {location: THREAD_CREATION,
attachmentsToUpload: a1, onAttachmentUploadError: onAttachmentUploadError_84353}]);
}
function _fun84355() { // fn#84355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:1144, offset: 0x01f46e35, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_3(_fun84357);
return _fun84359;
}
function uploadHandlerOnAttachmentUploadError(a0, a1, a2) { // fn#84353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:749, owner: useCreateThread.uploadHandler.onAttachmentUploadError, offset: 0x01f46cbf, size: 176 bytes, params: 4, frame: 16
const handleUploadAttachmentErrorsNativeModule = require(7880) /* metro dependency 7880: handleUploadAttachmentErrorsNative */;
const handleUploadMessageAttachmentsErrors = handleUploadAttachmentErrorsNativeModule.handleUploadMessageAttachmentsErrors;
const object2 = {file: a0};
object2.guildId = env0_0.getGuildId();
object2.analyticsLocations = analyticsLocations;
object2.code = a1;
object2.reason = a2;
if (Reflect.apply(handleUploadMessageAttachmentsErrors, handleUploadAttachmentErrorsNativeModule, [object2])) {
(importDefault(7879) /* metro dependency 7879: UploadAttachmentActionCreators */).setUploads({channelId: env0_0.id,
uploads: require, draftType: DraftType.FirstThreadMessage, resetState: true});
}
}
function* _fun84357(a0) { // fn#84357, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:1164, offset: 0x01f46e64, size: 251 bytes, params: 2, frame: 21
var environment;
if (false) {
return undefined;
}
const env0_0 = a0;
value = environment.__proto__.__proto__.__proto__;
let binding = env3_1;
const binding2 = env3_2;
const value5 = new binding(binding2[10])();
binding = env3_0;
value = binding(binding2[11]);
value = value.getKestrelConfig({location: 'native.useCreateForumPost'});
const value7 = binding(binding2[11]);
const getEffectiveKestrelLimit = value7.getEffectiveKestrelLimit;
const value8 = binding(binding2[12]);
const maxFileSize = value8.maxFileSize;
const getGuildId = require.getGuildId;
const env0_2 = Reflect.apply(getEffectiveKestrelLimit, value7, [value, Reflect.apply(maxFileSize, value8,
[Reflect.apply(getGuildId, require, [])])]);
value5.on('progress', _fun84358);
yield value5.uploadFiles(a0);
value = undefined;
if (false) {
return value;
}
return {uploaderFile: value5._file, files: value};
}
function _fun84358(a0) { // fn#84358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11196:1358, offset: 0x01f46f5f, size: 168 bytes, params: 2, frame: 19
var binding;
var value2;
var binding2;
var value3;
var setUploads;
var value4;
if (a0.currentSize > env0_2) {
binding = env0_1;
binding.cancel();
value2 = environment.__proto__.__proto__.__proto__.__proto__;
binding = env4_1;
binding2 = env4_2;
value3 = binding(binding2[9]);
setUploads = value3.setUploads;
value4 = environment.__proto__.__proto__.__proto__;
Reflect.apply(setUploads, value3, [{channelId: require.id, uploads: env0_0,
draftType: env4_5.FirstThreadMessage,
resetState: true}]);
binding(binding2[13])({file: a0, maxSize: env0_2, analyticsLocations: importDefault});
}
}
@@ -0,0 +1,22 @@
/* Metro module 11285; source: modules/threads/native/useCreateThreadViewProps.tsx; dependencies: [1379, 9725, 632, 2] */
function _fun86165(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86165, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11471:6, offset: 0x01f8a4be, size: 118 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/useCreateThreadViewProps.tsx');
exports.default = useCreateThreadViewProps;
}
function useCreateThreadViewProps(a0) { // fn#86166, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11471:201, offset: 0x01f8a534, size: 131 bytes, params: 2, frame: 17
const value2 = (importDefault(9725) /* metro dependency 9725: useGetThreadDraftSettings */)(a0);
const value = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([ChannelStore],
_fun86167, [value2]);
const value3 = null;
return value3 == value2 || value3 == value ? value3 : {threadSettingsDraft: value2, parentChannel: value};
}
function _fun86167() { // fn#86167, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11471:289, offset: 0x01f8a5b7, size: 47 bytes, params: 1, frame: 13
return ChannelStore.getChannel(env0_0?.parentChannelId);
}
@@ -0,0 +1,122 @@
/* Metro module 9626; source: modules/threads/native/useHandleJoinThreadVoice.tsx; dependencies: [5, 3786, 6664, 8919, 1962, 7153, 7709, 2] */
function _fun75514(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9812:6, offset: 0x01daf497, size: 134 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/native/useHandleJoinThreadVoice.tsx');
exports.default = useHandleJoinThreadVoice;
}
function useHandleJoinThreadVoice(a0) { // fn#75515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9812:211, offset: 0x01daf51d, size: 32 bytes, params: 2, frame: 11
const env0_0 = a0;
return env0_3(_fun75517);
}
function* _fun75517() { // fn#75517, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9812:258, offset: 0x01daf548, size: 359 bytes, params: 1, frame: 21
var binding;
var value6;
var value7;
var unarchiveThreadIfNecessary;
var id;
var hasJoined;
var value10;
var binding2;
var value14;
var binding3;
if (true) {
value = environment.__proto__;
var guildId = require.getGuildId();
if (guildId == null) {
value6 = environment.__proto__.__proto__;
binding = env2_1;
value7 = binding(env2_2[5]);
unarchiveThreadIfNecessary = value7.unarchiveThreadIfNecessary;
id = require.id;
yield Reflect.apply(unarchiveThreadIfNecessary, value7, [id]);
if (false) {
return undefined;
}
binding = env2_4;
hasJoined = binding.hasJoined;
id = require.id;
if (Reflect.apply(hasJoined, binding, [id])) {
binding = env2_0;
binding2 = env2_2;
yield binding(binding2[4])(binding2[6], binding2.paths);
value14 = undefined;
if (false) {
return value14;
}
value14.openGuildVoiceModal(require, 'Thread Header');
return undefined;
}
binding = env2_1;
value10 = binding(env2_2[5]);
yield value10.joinThread(require, 'Join Voice');
if (false) {
return undefined;
}
binding = env2_0;
binding2 = env2_2;
yield binding(binding2[4])(binding2[6], binding2.paths);
value14 = undefined;
if (false) {
return value14;
}
value14.openGuildVoiceModal(require, 'Thread Header');
} else {
binding = env2_0;
var value5 = binding(env2_2[2]);
if (value5.shouldShowMembershipVerificationGate(guildId)) {
binding = env2_0;
binding3 = env2_2;
value = binding(binding3[4]);
yield value(binding3[3], binding3.paths);
value = undefined;
if (false) {
return value;
}
return value.openMemberVerificationModal(guildId);
}
binding = env2_1;
value7 = binding(env2_2[5]);
unarchiveThreadIfNecessary = value7.unarchiveThreadIfNecessary;
id = require.id;
yield Reflect.apply(unarchiveThreadIfNecessary, value7, [id]);
if (false) {
return undefined;
}
binding = env2_4;
hasJoined = binding.hasJoined;
id = require.id;
if (Reflect.apply(hasJoined, binding, [id])) {
binding = env2_0;
binding2 = env2_2;
yield binding(binding2[4])(binding2[6], binding2.paths);
value14 = undefined;
if (false) {
return value14;
}
value14.openGuildVoiceModal(require, 'Thread Header');
return undefined;
}
binding = env2_1;
value10 = binding(env2_2[5]);
yield value10.joinThread(require, 'Join Voice');
if (false) {
return undefined;
}
binding = env2_0;
binding2 = env2_2;
yield binding(binding2[4])(binding2[6], binding2.paths);
value14 = undefined;
if (false) {
return value14;
}
value14.openGuildVoiceModal(require, 'Thread Header');
}
}
}
@@ -0,0 +1,18 @@
/* Metro module 7877; source: modules/threads/sanitizeThreadName.tsx; dependencies: [2] */
function _fun63161(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63161, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8055:6, offset: 0x01b73034, size: 85 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/sanitizeThreadName.tsx');
exports.default = function(a0, a1) {
var r0;
var value = a0;
if (a1) {
value = value.trim();
r0 = value;
} else {
r0 = value;
}
return r0;
};
}
@@ -0,0 +1,79 @@
/* Metro module 9725; source: modules/threads/useGetThreadDraftSettings.tsx; dependencies: [4645, 566, 21, 2] */
function _fun76413(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9911:6, offset: 0x01dce8ec, size: 133 bytes, params: 8, frame: 19
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const draftStore = importDefault(4645) /* metro dependency 4645: DraftStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/threads/useGetThreadDraftSettings.tsx');
exports.default = function(a0) {
var env0_0 = a0;
return require(dependencyMap[1]).useStateFromStores([DraftStore], _fun76415);
};
exports.useHasThreadDraft = function(a0) {
var env0_0 = a0;
return require(dependencyMap[1]).useStateFromStores([DraftStore], _fun76417);
};
}
function useGetThreadDraftSettings(a0) { // fn#76414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9911:195, offset: 0x01dce971, size: 66 bytes, params: 2, frame: 14
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([DraftStore], _fun76415);
}
function useHasThreadDraft(a0) { // fn#76416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9911:435, offset: 0x01dcea18, size: 66 bytes, params: 2, frame: 14
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([DraftStore], _fun76417);
}
function _fun76415() { // fn#76415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9911:272, offset: 0x01dce9b3, size: 101 bytes, params: 1, frame: 16
var r1;
var r0;
var value3;
var threadSettings;
var getThreadDraftWithParentMessageId;
var defaultImport;
const value2 = null;
if (value2 == env0_0) {
r0 = value2;
} else {
value3 = environment.__proto__;
threadSettings = DraftStore.getThreadSettings(env0_0);
if (value2 != threadSettings) {
r1 = threadSettings;
} else {
getThreadDraftWithParentMessageId = DraftStore.getThreadDraftWithParentMessageId;
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
r1 = Reflect.apply(getThreadDraftWithParentMessageId, DraftStore,
[defaultImport.castChannelIdAsMessageId(env0_0)]);
}
r0 = r1;
}
return r0;
}
function _fun76417() { // fn#76417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9911:504, offset: 0x01dcea5a, size: 100 bytes, params: 1, frame: 17
var r1;
var r0;
var value3;
var threadSettings;
var getThreadDraftWithParentMessageId;
var defaultImport;
const value2 = env0_0 != null;
if (value2) {
value3 = environment.__proto__;
threadSettings = DraftStore.getThreadSettings(env0_0);
if (threadSettings != null) {
r1 = threadSettings;
} else {
getThreadDraftWithParentMessageId = DraftStore.getThreadDraftWithParentMessageId;
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
r1 = Reflect.apply(getThreadDraftWithParentMessageId, DraftStore,
[defaultImport.castChannelIdAsMessageId(env0_0)]);
}
r0 = r1 != null;
} else {
r0 = value2;
}
return r0;
}