/* Metro module 6888; source: lib/guild/GuildSubscriptions.tsx; dependencies: [6, 7, 661, 6889, 6890, 6891, 4041, 22, 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 GuildMemberSubscriptions from './GuildMemberSubscriptions.tsx'; /* Metro dependency 6889 */ import GuildChannelSubscriptions from './GuildChannelSubscriptions.tsx'; /* Metro dependency 6890 */ import GuildThreadSubscriptions from './GuildThreadSubscriptions.tsx'; /* Metro dependency 6891 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ import * as TimersModule from '../../external/discord_common/js/packages/timers/Timers.tsx'; /* Metro dependency 4041 */ import * as GuildChannelSubscriptionsModule from './GuildChannelSubscriptions.tsx'; /* Metro dependency 6890 */ function _fun54669(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:6, offset: 0x0136b7fd, size: 222 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const env0_5 = value.FAVORITES; const env0_6 = value.ME; value = _fun54671(); (FileImportTrackerModule).fileFinishedImporting('lib/guild/GuildSubscriptions.tsx'); exports.default = value; const MINIMUM_RANGE = (GuildChannelSubscriptionsModule).MINIMUM_RANGE; exports.MINIMUM_RANGE = MINIMUM_RANGE; const DEFAULT_RANGES = (GuildChannelSubscriptionsModule).DEFAULT_RANGES; exports.DEFAULT_RANGES = DEFAULT_RANGES; function validateGuildId(a0) { // fn#54670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:147, offset: 0x0136b8db, size: 61 bytes, params: 2, frame: 3 let r0 = a0 != null && a0 !== 'null' && a0 !== ME; r0 = r0 && a0 !== 'undefined' && a0 !== FAVORITES; return r0; } function _fun54671() { // fn#54671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:239, offset: 0x0136b918, size: 471 bytes, params: 1, frame: 15 return CreateClass(GuildSubscriptions, [{key: '_enqueue', value: function(a0, a1) { var property = this._pending; var object = {}; var _pending = this._pending; copyDataProperties(object, a1, copyDataProperties(object, _pending[a0], _pending)); property[a0] = object; this._flush.delay(); }}, {key: 'reset', value: value_54678}, {key: 'get', value: value_54679}, {key: 'getSubscribedThreadIds', value: function() { return this._threadMemberLists.getSubscribedThreadIds(); }}, {key: 'isSubscribedToThreads', value: function(a0) { return this._threads.has(a0); }}, {key: 'isSubscribedToAnyMember', value: function(a0) { var isSubscribedToAnyMember = this._members.isSubscribedToAnyMember(a0); return isSubscribedToAnyMember != null && isSubscribedToAnyMember; }}, {key: 'isSubscribedToMemberUpdates', value: function(a0) { var member_updates = this.get(a0).member_updates; return member_updates != null && member_updates; }}, {key: 'forEach', value: function(a0) { this._subscribed.forEach(a0); }}, {key: 'clearWithoutFlushing', value: value_54685}, {key: 'flush', value: value_54686}, {key: 'subscribeUser', value: function(a0, a1) { if (validateGuildId(a0)) { this._members.subscribe(a0, a1); } }}, {key: 'unsubscribeUser', value: function(a0, a1) { if (validateGuildId(a0)) { this._members.unsubscribe(a0, a1); } }}, {key: 'subscribeChannel', value: value_54690}, {key: 'subscribeToMemberUpdates', value: function(a0) { if (validateGuildId(a0)) { this._enqueue(a0, {member_updates: true}); this._memberUpdates.add(a0); return undefined; } return false; }}, {key: 'unsubscribeFromMemberUpdates', value: value_54692}, {key: 'subscribeThreadMemberList', value: value_54693}, {key: 'unsubscribeThreadMemberList', value: value_54694}, {key: 'subscribeToGuild', value: function(a0) { this._subscribeToFeature(a0, this._typing, {typing: true}); this._subscribeToFeature(a0, this._activities, {activities: true}); this._subscribeToFeature(a0, this._threads, {threads: true}); }}, {key: '_subscribeToFeature', value: function(a0, a1, a2) { if (validateGuildId(a0)) { if (!a1.has(a0)) { a1.add(a0); this._enqueue(a0, a2); } } }}]); function GuildSubscriptions(a0) { // fn#54672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:260, offset: 0x0136baef, size: 404 bytes, params: 2, frame: 18 var environment; const value = environment.__proto__; env1_3(this, GuildSubscriptions); const defaultImport = GuildMemberSubscriptions; const value3 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}}); const defaultImport4 = new defaultImport(_fun54673); this._members = defaultImport4 instanceof Object ? defaultImport4 : value3; const defaultImport2 = GuildChannelSubscriptions; const value6 = Object.create(defaultImport2.prototype, {constructor: {value: defaultImport2}}); const defaultImport22 = new defaultImport2(_fun54674); this._channels = defaultImport22 instanceof Object ? defaultImport22 : value6; const defaultImport3 = GuildThreadSubscriptions; const value9 = Object.create(defaultImport3.prototype, {constructor: {value: defaultImport3}}); const defaultImport32 = new defaultImport3(_fun54675); this._threadMemberLists = defaultImport32 instanceof Object ? defaultImport32 : value9; let Set = global.Set; const value12 = Object.create(Set.prototype, {constructor: {value: Set}}); let set = new Set(); this._typing = set instanceof Object ? set : value12; Set = global.Set; const value14 = Object.create(Set.prototype, {constructor: {value: Set}}); set = new Set(); this._threads = set instanceof Object ? set : value14; Set = global.Set; const value16 = Object.create(Set.prototype, {constructor: {value: Set}}); set = new Set(); this._activities = set instanceof Object ? set : value16; Set = global.Set; const value18 = Object.create(Set.prototype, {constructor: {value: Set}}); set = new Set(); this._memberUpdates = set instanceof Object ? set : value18; Set = global.Set; const value20 = Object.create(Set.prototype, {constructor: {value: Set}}); set = new Set(); this._subscribed = set instanceof Object ? set : value20; this._pending = {}; const DelayedCall = (TimersModule).DelayedCall; this._flush = new DelayedCall(0, _fun54676); this._onChange = a0; function _fun54673(a0, a1) { // fn#54673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:346, offset: 0x0136bc83, size: 34 bytes, params: 3, frame: 13 return env0_0._enqueue(a0, {members: a1}); } function _fun54674(a0, a1) { // fn#54674, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:413, offset: 0x0136bca5, size: 34 bytes, params: 3, frame: 13 return env0_0._enqueue(a0, {channels: a1}); } function _fun54675(a0, a1) { // fn#54675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:490, offset: 0x0136bcc7, size: 34 bytes, params: 3, frame: 13 return env0_0._enqueue(a0, {thread_member_lists: a1}); } function _fun54676() { // fn#54676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:718, offset: 0x0136bce9, size: 19 bytes, params: 1, frame: 9 return env0_0.flush(); } } function value_54686() { // fn#54686, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:2193, offset: 0x0136bfaf, size: 83 bytes, params: 1, frame: 15 var environment; let value = environment.__proto__; value = importDefault(22) /* metro dependency 22 */; value.forEach(this._pending, _fun54687); this._onChange(this._pending); this._pending = {}; function _fun54687(a0, a1) { // fn#54687, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:2235, offset: 0x0136c002, size: 30 bytes, params: 3, frame: 11 env0_0._subscribed.add(a1); } } function value_54690(a0, a1, a2) { // fn#54690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:2537, offset: 0x0136c07c, size: 56 bytes, params: 4, frame: 16 let value = environment.__proto__; value = validateGuildId(a0); return value ? this._channels.subscribe(a0, a1, a2) : !!value; } function value_54692(a0) { // fn#54692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:2805, offset: 0x0136c0f6, size: 48 bytes, params: 2, frame: 15 const value = environment.__proto__; if (validateGuildId(a0)) { this._enqueue(a0, {member_updates: false}); return undefined; } return false; } function value_54693(a0, a1, a2) { // fn#54693, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:2927, offset: 0x0136c126, size: 56 bytes, params: 4, frame: 16 let value = environment.__proto__; value = validateGuildId(a0); return value ? this._threadMemberLists.subscribe(a0, a1, a2) : !!value; } function value_54694(a0, a1) { // fn#54694, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:3055, offset: 0x0136c15e, size: 52 bytes, params: 3, frame: 14 let value = environment.__proto__; value = validateGuildId(a0); return value ? this._threadMemberLists.unsubscribe(a0, a1) : !!value; } } } function value_54678() { // fn#54678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:878, offset: 0x0136bd3d, size: 143 bytes, params: 1, frame: 10 this._subscribed.clear(); this._pending = {}; this._members.reset(); this._memberUpdates.clear(); this._channels.reset(); this._threadMemberLists.reset(); this._typing.clear(); this._threads.clear(); this._activities.clear(); } function value_54679(a0) { // fn#54679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:1123, offset: 0x0136bdcc, size: 157 bytes, params: 2, frame: 13 const object = {}; object.typing = this._typing.has(a0); object.threads = this._threads.has(a0); object.activities = this._activities.has(a0); object.members = this._members.get(a0); object.member_updates = this._memberUpdates.has(a0); object.channels = this._channels.get(a0); object.thread_member_lists = this._threadMemberLists.get(a0); return object; } function value_54685(a0, a1) { // fn#54685, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7066:1894, offset: 0x0136bef9, size: 182 bytes, params: 3, frame: 14 if (!(!a1 && this._threads.has(a0))) { this._subscribed.delete(a0); } delete this._pending[a0]; this._members.clear(a0); this._channels.clear(a0); this._threadMemberLists.clear(a0); this._typing.delete(a0); this._memberUpdates.delete(a0); if (a1) { this._threads.delete(a0); } this._activities.delete(a0); } global.__d(_fun54669, 6888, [6, 7, 661, 6889, 6890, 6891, 4041, 22, 2]) /* metro module 6888, dependencies: [6, 7, 661, 6889, 6890, 6891, 4041, 22, 2] */;