/* Metro module 4621; source: modules/message_request/MessageRequestStore.tsx; dependencies: [6, 7, 15, 17, 18, 1379, 1228, 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 MobileCacheSnapshotStore from '../../stores/MobileCacheSnapshotStore.tsx'; /* Metro dependency 1228 */ import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ function _fun39651(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:6, offset: 0x010e7835, size: 404 bytes, params: 8, frame: 19 const _arrayLikeToArray_39657 = 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 isMessageRequest = function(a0) { return a0.isMessageRequest && !a0.isSpam; }; const handleChannelCreate = function({channel}) { return processChannel(channel); }; const handleChannelUpdates = function({channels}) { var r2; var value4; var value2 = _createForOfIteratorHelperLoose_39655(channels); var value3 = value2(); if (!value3.done) { for (r2 = value3; true; r2 = value4) { processChannel(r2.value); value4 = value2(); if (value4.done) { break; } } } }; const handleOverlayInitialize_39666 = function({messageRequestChannelIds}) { messageRequestChannelIds.forEach(_fun39667); }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = MobileCacheSnapshotStore; let Set = global.Set; let set = new Set(); Set = global.Set; set = new Set(); value = _fun39668(value); value.displayName = 'MessageRequestStore'; value.LATEST_SNAPSHOT_VERSION = 1; value = new value(); (FileImportTrackerModule).fileFinishedImporting('modules/message_request/MessageRequestStore.tsx'); exports.default = value; function _isNativeReflectConstruct_39652() { // fn#39652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:170, offset: 0x010e79c9, 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_39652_isNativeReflectConstruct = function() { return !!result; })(); } function _createForOfIteratorHelperLoose_39655(a0, a1) { // fn#39655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:363, offset: 0x010e7a27, 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 _fun39656; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_39657(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_39657(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_39657(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun39656; } 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 _fun39656() { // fn#39656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:934, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5 return CreateClass >= env0_0.length ? {done: true} : {done: false, value: env0_0[typeof CreateClass === 'bigint' ? CreateClass : +CreateClass]}; } } function processChannel(a0) { // fn#39659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:1368, offset: 0x010e7bb0, size: 186 bytes, params: 2, frame: 16 var r3; var r0; var binding; const isMessageRequest2 = isMessageRequest(a0); if (isMessageRequest2) { binding = env0_6; r3 = !binding.has(a0.id); } else { r3 = isMessageRequest2; } if (r3) { binding = env0_6; binding.add(a0.id); r0 = true; } else { r0 = false; } if (!isMessageRequest(a0) && env0_6.has(a0.id)) { env0_6.delete(a0.id); r0 = true; } if (!isMessageRequest(a0) && env0_7.has(a0.id)) { env0_7.delete(a0.id); r0 = true; } return r0; } function handleConnectionOpen_39660() { // fn#39660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:1581, offset: 0x010e7c6a, size: 90 bytes, params: 1, frame: 13 env0_6.clear(); env0_7.clear(); const Object = global.Object; const values = Object.values; const channelStoreBinding = ChannelStore; const getMutablePrivateChannels = channelStoreBinding.getMutablePrivateChannels; Reflect.apply(values, Object, [Reflect.apply(getMutablePrivateChannels, channelStoreBinding, [])]).forEach(function(a0) { processChannel(a0); }); } function handleMessageRequestAcceptOptimistic({channelId}) { // fn#39662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:1717, offset: 0x010e7cd7, size: 29 bytes, params: 2, frame: 11 env0_7.add(channelId); } function handleChannelDelete({channel}) { // fn#39665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:1986, offset: 0x010e7d4e, size: 62 bytes, params: 2, frame: 13 var r0; const binding = env0_6; const value2 = binding.has(channel.id); if (value2) { env0_6.delete(channel.id); r0 = true; } else { r0 = !!value2; } return r0; } function handleOverlayInitialize_39666({messageRequestChannelIds}) { // fn#39666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:2069, offset: 0x010e7d8c, size: 32 bytes, params: 2, frame: 11 messageRequestChannelIds.forEach(_fun39667); function _fun39667(a0) { // fn#39667, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:2143, offset: 0x010e7dac, size: 22 bytes, params: 2, frame: 11 return env1_6.add(a0); } } function _fun39668(a0) { // fn#39668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:2163, offset: 0x010e7dc2, size: 233 bytes, params: 2, frame: 16 const MessageRequestStore2 = MessageRequestStore; Inherits(MessageRequestStore2, a0); return CreateClass(MessageRequestStore2, [{key: 'initialize', value: function() { this.waitFor(ChannelStore); }}, {key: 'loadCache', value: value_39672}, {key: 'takeSnapshot', value: value_39673}, {key: 'getMessageRequestChannelIds', value: value_39674}, {key: 'getMessageRequestsCount', value: value_39675}, {key: 'isMessageRequest', value: value_39676}, {key: 'isAcceptedOptimistic', value: value_39677}, {key: 'isReady', value: value_39678}]); function MessageRequestStore() { // fn#39669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:2175, offset: 0x010e7eab, size: 189 bytes, params: 1, frame: 20 var environment; const value = environment.__proto__; env1_0(this, MessageRequestStore); const handleConnectionOpen_39660Binding = handleConnectionOpen_39660; const items2 = [{CONNECTION_OPEN: handleConnectionOpen_39660Binding, CONNECTION_OPEN_SUPPLEMENTAL: handleConnectionOpen_39660Binding, CACHE_LOADED_LAZY: CACHE_LOADED_LAZY_39670, OVERLAY_INITIALIZE: handleOverlayInitialize_39666, CHANNEL_CREATE: handleChannelCreate, CHANNEL_UPDATES: handleChannelUpdates, CHANNEL_DELETE: handleChannelDelete, MESSAGE_REQUEST_ACCEPT_OPTIMISTIC: handleMessageRequestAcceptOptimistic}]; const value3 = env1_3(MessageRequestStore); return env1_2(this, _isNativeReflectConstruct_39652() ? global.Reflect.construct(value3, items2, env1_3(this).constructor) : value3.apply(this, items2)); function MessageRequestStoreCACHE_LOADED_LAZY() { // fn#39670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:2513, owner: MessageRequestStore.CACHE_LOADED_LAZY, offset: 0x010e7f68, size: 19 bytes, params: 1, frame: 9 return ClassCallCheck.loadCache(); } } function value_39672() { // fn#39672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:2886, offset: 0x010e7f94, size: 75 bytes, params: 1, frame: 11 var set; var value3; const readSnapshot = this.readSnapshot; const LATEST_SNAPSHOT_VERSION = MessageRequestStore.LATEST_SNAPSHOT_VERSION; if (Reflect.apply(readSnapshot, this, [LATEST_SNAPSHOT_VERSION]) != null) { set = new global.Set(); value3 = environment.__proto__; } } function value_39673() { // fn#39673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:3018, offset: 0x010e7fdf, size: 51 bytes, params: 1, frame: 12 const object = {}; const LATEST_SNAPSHOT_VERSION = MessageRequestStore.LATEST_SNAPSHOT_VERSION; object.version = LATEST_SNAPSHOT_VERSION; const Array = global.Array; object.data = Array.from(env1_6); return object; } function value_39674() { // fn#39674, offset: 0x00c82288, size: 9 bytes, params: 1, frame: 1 return env1_6; } function value_39675() { // fn#39675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:3210, offset: 0x010e8012, size: 14 bytes, params: 1, frame: 1 return env1_6.size; } function value_39676(a0) { // fn#39676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:3267, offset: 0x010e8020, size: 22 bytes, params: 2, frame: 11 return env1_6.has(a0); } function value_39677(a0) { // fn#39677, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4799:3331, offset: 0x010e8036, size: 22 bytes, params: 2, frame: 11 return env1_7.has(a0); } function value_39678() { // fn#39678, offset: 0x00fbd9d4, size: 9 bytes, params: 1, frame: 1 return env1_8; } } } global.__d(_fun39651, 4621, [6, 7, 15, 17, 18, 1379, 1228, 2]) /* metro module 4621, dependencies: [6, 7, 15, 17, 18, 1379, 1228, 2] */;