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

385 lines
18 KiB
TypeScript

/* Metro module 7158; source: modules/threads/ThreadMembersStore.tsx; dependencies: [6, 7, 15, 17, 18, 1383, 1379, 22, 566, 694, 2] */
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
import Module00022 from '../../by-id/module-00022.js'; /* Metro dependency 22 */
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ChannelRecordModule from '../../records/ChannelRecord.tsx'; /* Metro dependency 1383 */
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 SEARCH_MESSAGES_SUCCESS_574362 = SEARCH_MESSAGES_SUCCESS_57436;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let env0_9 = {};
const Store = (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: SEARCH_MESSAGES_SUCCESS_574362,
MOD_VIEW_SEARCH_MESSAGES_SUCCESS: SEARCH_MESSAGES_SUCCESS_574362, 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;
}});
(FileImportTrackerModule).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 _fun57430() { // fn#57430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:953, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
return env0_1 >= env0_0.length ? {done: true} : {done: false,
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
}
}
function 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 object;
var property;
if (ALL_CHANNEL_TYPES.has(a0.type)) {
id = a0.id;
if (!(id in env0_9)) {
binding = env0_9;
id = a0.id;
object = {};
object.guildId = a0.guild_id;
object.parentId = a0.parent_id;
r5 = a0.memberCount ?? 0;
object.memberCount = r5;
r5 = a0.memberIdsPreview ?? [];
object.memberIdsPreview = r5;
binding[id] = object;
}
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 _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 _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 _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__;
}
}
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 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 ThreadMembersStore2 = ThreadMembersStore;
Inherits(ThreadMembersStore2, a0);
return CreateClass(ThreadMembersStore2, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore);
}}, {key: 'getMemberCount', value: value_57445}, {key: 'getMemberIdsPreview', value: value_57446},
{key: 'getInitialOverlayState', value: value_57447}]);
function ThreadMembersStore() { // fn#57443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:2329, offset: 0x00ec62ac, size: 113 bytes, params: 1, frame: 20
const value = environment.__proto__;
env1_2(this, ThreadMembersStore);
const value3 = env1_5(ThreadMembersStore);
return env1_4(this, _isNativeReflectConstruct_57426() ? global.Reflect.construct(value3, arguments,
env1_5(this).constructor) : value3.apply(this, arguments));
}
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 value_57447() { // fn#57447, offset: 0x00e07a77, size: 9 bytes, params: 1, frame: 1
return env1_9;
}
}
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 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 = Module00022;
env1_9 = defaultImport.omitBy(env1_9, _fun57453);
function _fun57453({guildId}) { // fn#57453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3368, offset: 0x00f81f21, size: 21 bytes, params: 2, frame: 2
return guildId === env0_0;
}
}
}
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 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 = Module00022;
env1_9 = defaultImport.omitBy(env1_9, _fun57456);
function _fun57456({parentId}) { // fn#57456, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7336:3502, offset: 0x011768ae, size: 22 bytes, params: 2, frame: 2
return parentId === env0_0;
}
}
}
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];
}
}
global.__d(_fun57425, 7158, [6, 7, 15, 17, 18, 1383, 1379, 22, 566, 694,
2]) /* metro module 7158, dependencies: [6, 7, 15, 17, 18, 1383, 1379, 22, 566, 694, 2] */;