This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

@@ -1,45 +1,48 @@
/* Metro module 5228; source: modules/app_database/system/AppDatabaseManager.Entry.tsx; dependencies: [6, 7, 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 * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
function _fun46277(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5406:6, offset: 0x011a4720, size: 124 bytes, params: 8, frame: 18
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 value = _fun46278();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_database/system/AppDatabaseManager.Entry.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/app_database/system/AppDatabaseManager.Entry.tsx');
exports.Entry = value;
}
function _fun46278() { // fn#46278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5406:118, offset: 0x011a479c, size: 149 bytes, params: 1, frame: 15
return env0_1(Entry_46279, [{key: 'actions', get: function() {
return this.definition.actions;
}}, {key: 'load', value: function() {
if (this.module == null) {
this.module = this.definition.require();
}
}}, {key: 'reset', value: function() {
var module = this.module;
if (module != null) {
module.resetInMemoryState();
}
}}, {key: 'execute', value: function(a0, a1) {
var actions;
var property;
this.load();
if (this.module != null) {
actions = this.module.actions;
property = actions[a0.type];
if (property != null) {
property.call(actions, a0, a1);
function _fun46278() { // fn#46278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5406:118, offset: 0x011a479c, size: 149 bytes, params: 1, frame: 15
return CreateClass(Entry_46279, [{key: 'actions', get: function() {
return this.definition.actions;
}}, {key: 'load', value: function() {
if (this.module == null) {
this.module = this.definition.require();
}
}}, {key: 'reset', value: function() {
var module = this.module;
if (module != null) {
module.resetInMemoryState();
}
}}, {key: 'execute', value: function(a0, a1) {
var actions;
var property;
this.load();
if (this.module != null) {
actions = this.module.actions;
property = actions[a0.type];
if (property != null) {
property.call(actions, a0, a1);
}
}
}}, {key: 'validateInDev', value: function() {
}}]);
function Entry_46279(a0, a1) { // fn#46279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5406:139, offset: 0x011a4831, size: 53 bytes, params: 3, frame: 13
env1_0(this, Entry_46279);
this.parent = a0;
this.module = null;
this.definition = a1;
}
}}, {key: 'validateInDev', value: function() {
}}]);
}
function Entry_46279(a0, a1) { // fn#46279, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5406:139, offset: 0x011a4831, size: 53 bytes, params: 3, frame: 13
env1_0(this, Entry_46279);
this.parent = a0;
this.module = null;
this.definition = a1;
}
}
global.__d(_fun46277, 5228, [6, 7, 2]) /* metro module 5228, dependencies: [6, 7, 2] */;
@@ -1,4 +1,14 @@
/* Metro module 5227; source: modules/app_database/system/AppDatabaseManager.tsx; dependencies: [57, 6, 7, 1226, 3, 1926, 1911, 694, 5228, 2] */
import Logger from '../../debug/Logger.tsx'; /* Metro dependency 3 */
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 Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as DispatcherModule from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
import * as AppDatabaseManagerEntryModule from './AppDatabaseManager.Entry.tsx'; /* Metro dependency 5228 */
function _fun46257(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#46257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:6, offset: 0x011a3d53, size: 266 bytes, params: 8, frame: 20
const env0_0 = require;
const _arrayLikeToArray_46260 = function(a0, a1) {
@@ -46,342 +56,345 @@ function _fun46257(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
const env0_4 = importDefault(6) /* metro dependency 6 */;
const env0_5 = importDefault(7) /* metro dependency 7 */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
let value = importDefault(3) /* metro dependency 3: Logger */;
let value = Logger;
value = new value('AppDatabaseManager');
const Set = global.Set;
let set = new Set(['MESSAGE_CREATE']);
set = _fun46261();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_database/system/AppDatabaseManager.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/app_database/system/AppDatabaseManager.tsx');
exports.AppDatabaseManager = set;
}
function _createForOfIteratorHelperLoose_46258(a0, a1) { // fn#46258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:140, offset: 0x011a3e5d, 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)) {
function _createForOfIteratorHelperLoose_46258(a0, a1) { // fn#46258, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:140, offset: 0x011a3e5d, 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);
}
return _fun46259;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_46260(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') {
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun46259;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_46260(a0, value);
r6 = value;
r5 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
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_46260(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_46260(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
r5 = r6;
} else {
r5 = value;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun46259;
}
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 _fun46261() { // fn#46261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:1123, offset: 0x011a3fcf, size: 208 bytes, params: 1, frame: 17
return env0_5(AppDatabaseManager, [{key: 'handleAction', value: value_46264}, {key: 'resetModules',
value: value_46265}, {key: 'executeModules', value: value_46266}, {key: 'validateInDev', value: function() {
}}], [{key: 'handleException', value: value_46271}, {key: 'computeEntries', value: value_46272}, {key: 'register',
value: value_46274}]);
}
function AppDatabaseManager(a0, a1, a2) { // fn#46262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:1134, offset: 0x011a409f, size: 288 bytes, params: 4, frame: 25
let binding = env1_4;
binding(this, AppDatabaseManager);
const value3 = env1_3(AppDatabaseManager.computeEntries(a0, a2), 2);
const property = value3[0];
const property2 = value3[1];
this.name = a0;
this.entries = property2;
this.actions = property;
this.lastDatabase = null;
let register = AppDatabaseManager.register;
const value4 = a0 + '_CLEAR_CACHES';
const closure = _fun46263;
Reflect.apply(register, AppDatabaseManager, [value4, ['CLEAR_CACHES'], [], closure]);
register = AppDatabaseManager.register;
const value5 = this.actions.keys();
items2 = [];
arraySpread(items2, value5, 0, closure);
Reflect.apply(register, AppDatabaseManager, [a0, items2, a1, this.handleAction.bind(this)]);
binding = env1_7;
binding.verbose('' + a0 + ' created with ' + a2.length + ' modules, ' + this.actions.size + ' distinct actions.');
}
function value_46264(a0) { // fn#46264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:1728, offset: 0x011a4206, size: 106 bytes, params: 2, frame: 15
this.validateInDev(a0.type);
let value = environment.__proto__;
const id = AuthenticationStore.getId();
value = importDefault(1926) /* metro dependency 1926: DatabaseManager */;
value = value.database(id);
this.resetModules(a0, value);
this.executeModules(a0, value);
return false;
}
function value_46265(a0, a1) { // fn#46265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:1891, offset: 0x011a4270, size: 164 bytes, params: 3, frame: 25
var r3;
var value;
var binding;
var verbose;
var type;
var HermesInternal;
var concat;
var _createForOfIteratorHelperLoose_46258Binding;
var entries;
var value2;
var done;
var value3;
var reset;
var value4;
let lastDatabase = this.lastDatabase;
reducibleJoin4: while (true) {
if (a1 === lastDatabase) {
break reducibleJoin4;
}
value = environment.__proto__;
binding = env1_7;
verbose = binding.verbose;
lastDatabase = this.lastDatabase;
type = a0.type;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(verbose, binding,
['database has changed (was: ' + lastDatabase + ', now: ' + a1 + ', action: ' + type + '). resetting modules.']);
_createForOfIteratorHelperLoose_46258Binding = _createForOfIteratorHelperLoose_46258;
entries = this.entries;
value = _createForOfIteratorHelperLoose_46258Binding(entries);
value2 = value();
done = value2.done;
if (!done) {
r3 = value2;
reducibleLoop2: while (true) {
value3 = r3.value;
reset = value3.reset;
Reflect.apply(reset, value3, []);
value4 = value();
done = value4.done;
if (done) {
break reducibleLoop2;
}
r3 = value4;
continue reducibleLoop2;
if (r5) {
}
return _fun46259;
}
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 _fun46259() { // fn#46259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:711, 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]};
}
this.lastDatabase = a1;
break reducibleJoin4;
}
}
function value_46266(a0, a1) { // fn#46266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2184, offset: 0x011a4314, size: 317 bytes, params: 3, frame: 28
var environment;
var binding;
var transaction;
var has;
const env0_0 = a0;
const env0_1 = a1;
let type = a0.type;
let value = this.actions.get(type);
const value2 = null;
const value3 = undefined;
const r13 = value2 == a1 ? value3 : a1.state();
if (value2 != value) {
if (value.length !== 0) {
if (value2 == a1) {
value = environment.__proto__;
env1_7.verbose('no usable database; skipping action (type: ' + type + ', database: ' + a1 + ', state: ' + r13 + ')');
} else {
value = environment.__proto__;
if (r13 === (require(1911) /* metro dependency 1911: js */).DatabaseState.Open) {
transaction = a1.transaction;
binding = env1_8;
has = binding.has;
type = a0.type;
value = Reflect.apply(transaction, a1, [_fun46267, Reflect.apply(has, binding,
[type]) ? value2 : 'Dispatch ' + a0.type]);
value = value.catch(_fun46269);
type = a0.type;
if (type === 'WRITE_CACHES') {
a0.promisesToWaitOn.push(value);
}
function _fun46261() { // fn#46261, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:1123, offset: 0x011a3fcf, size: 208 bytes, params: 1, frame: 17
return CreateClass(AppDatabaseManager, [{key: 'handleAction', value: value_46264}, {key: 'resetModules',
value: value_46265}, {key: 'executeModules', value: value_46266}, {key: 'validateInDev', value: function() {
}}], [{key: 'handleException', value: value_46271}, {key: 'computeEntries', value: value_46272}, {key: 'register',
value: value_46274}]);
function AppDatabaseManager(a0, a1, a2) { // fn#46262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:1134, offset: 0x011a409f, size: 288 bytes, params: 4, frame: 25
let binding = env1_4;
binding(this, AppDatabaseManager);
const value3 = env1_3(AppDatabaseManager.computeEntries(a0, a2), 2);
const property = value3[0];
const property2 = value3[1];
this.name = a0;
this.entries = property2;
this.actions = property;
this.lastDatabase = null;
let register = AppDatabaseManager.register;
const value4 = a0 + '_CLEAR_CACHES';
const closure = _fun46263;
Reflect.apply(register, AppDatabaseManager, [value4, ['CLEAR_CACHES'], [], closure]);
register = AppDatabaseManager.register;
const value5 = this.actions.keys();
items2 = [];
arraySpread(items2, value5, 0, closure);
Reflect.apply(register, AppDatabaseManager, [a0, items2, a1, this.handleAction.bind(this)]);
binding = env1_7;
binding.verbose('' + a0 + ' created with ' + a2.length + ' modules, ' + this.actions.size + ' distinct actions.');
function _fun46263() { // fn#46263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:1396, offset: 0x011a41bf, size: 71 bytes, params: 1, frame: 13
var r2;
var value3;
var value4;
let value = environment.__proto__.__proto__;
value = _createForOfIteratorHelperLoose_46258(env0_0.entries);
const value2 = value();
let done = value2.done;
if (!done) {
for (r2 = value2; true; r2 = value4) {
value3 = r2.value;
value3.reset();
value4 = value();
done = value4.done;
if (done) {
break;
}
}
} else {
value = environment.__proto__;
env1_7.verbose('no usable database; skipping action (type: ' + type + ', database: ' + a1 + ', state: ' + r13 + ')');
}
}
}
}
return value3;
}
function value_46271(a0, {type}, a2) { // fn#46271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2703, offset: 0x011a44b5, size: 133 bytes, params: 4, frame: 19
const value = environment.__proto__;
const binding = env1_7;
binding.info('disabling database · error encountered during dispatch', a2, a2.stack);
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'RESET_SOCKET', args: {error: a2,
action: 'AppDatabaseManager(' + type + ')'}});
}
function value_46264(a0) { // fn#46264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:1728, offset: 0x011a4206, size: 106 bytes, params: 2, frame: 15
this.validateInDev(a0.type);
let value = environment.__proto__;
const id = AuthenticationStore.getId();
value = importDefault(1926) /* metro dependency 1926: DatabaseManager */;
value = value.database(id);
this.resetModules(a0, value);
this.executeModules(a0, value);
return false;
}
function value_46272(a0, a1) { // fn#46272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2919, offset: 0x011a453a, size: 256 bytes, params: 3, frame: 22
var r4;
var r8;
var value6;
var actions;
var value7;
var value8;
var value9;
var has;
var value10;
var value11;
var value12;
const env0_0 = a0;
const Map = global.Map;
const map = new Map();
const value2 = a1.map(_fun46273);
map.set('LOGOUT', []);
map.set('LOGIN_RESET', []);
const value4 = _createForOfIteratorHelperLoose_46258(value2);
const value5 = value4();
let done = value5.done;
if (!done) {
r4 = value5;
while (true) {
value6 = r4.value;
_createForOfIteratorHelperLoose_46258Binding = _createForOfIteratorHelperLoose_46258;
actions = value6.actions;
value7 = _createForOfIteratorHelperLoose_46258Binding(actions);
value8 = value7();
done = value8.done;
function value_46265(a0, a1) { // fn#46265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:1891, offset: 0x011a4270, size: 164 bytes, params: 3, frame: 25
var r3;
var value;
var binding;
var verbose;
var type;
var HermesInternal;
var concat;
var _createForOfIteratorHelperLoose_46258Binding;
var entries;
var value2;
var done;
var value3;
var reset;
var value4;
let lastDatabase = this.lastDatabase;
reducibleJoin4: while (true) {
if (a1 === lastDatabase) {
break reducibleJoin4;
}
value = environment.__proto__;
binding = env1_7;
verbose = binding.verbose;
lastDatabase = this.lastDatabase;
type = a0.type;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(verbose, binding,
['database has changed (was: ' + lastDatabase + ', now: ' + a1 + ', action: ' + type + '). resetting modules.']);
_createForOfIteratorHelperLoose_46258Binding = _createForOfIteratorHelperLoose_46258;
entries = this.entries;
value = _createForOfIteratorHelperLoose_46258Binding(entries);
value2 = value();
done = value2.done;
if (!done) {
r3 = value2;
reducibleLoop2: while (true) {
value3 = r3.value;
reset = value3.reset;
Reflect.apply(reset, value3, []);
value4 = value();
done = value4.done;
if (done) {
break reducibleLoop2;
}
r3 = value4;
continue reducibleLoop2;
}
}
this.lastDatabase = a1;
break reducibleJoin4;
}
}
function value_46266(a0, a1) { // fn#46266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2184, offset: 0x011a4314, size: 317 bytes, params: 3, frame: 28
var environment;
var binding;
var transaction;
var has;
const env0_0 = a0;
const env0_1 = a1;
let type = a0.type;
let value = this.actions.get(type);
const value2 = null;
const value3 = undefined;
const r13 = value2 == a1 ? value3 : a1.state();
if (value2 != value) {
if (value.length !== 0) {
if (value2 == a1) {
value = environment.__proto__;
env1_7.verbose('no usable database; skipping action (type: ' + type + ', database: ' + a1 + ', state: ' + r13 + ')');
} else {
value = environment.__proto__;
if (r13 === (require(1911) /* metro dependency 1911: js */).DatabaseState.Open) {
transaction = a1.transaction;
binding = env1_8;
has = binding.has;
type = a0.type;
value = Reflect.apply(transaction, a1, [_fun46267, Reflect.apply(has, binding,
[type]) ? value2 : 'Dispatch ' + a0.type]);
value = value.catch(_fun46269);
type = a0.type;
if (type === 'WRITE_CACHES') {
a0.promisesToWaitOn.push(value);
}
} else {
value = environment.__proto__;
env1_7.verbose('no usable database; skipping action (type: ' + type + ', database: ' + a1 + ', state: ' + r13 + ')');
}
}
}
}
return value3;
function _fun46267(a0) { // fn#46267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2351, offset: 0x011a4451, size: 33 bytes, params: 2, frame: 11
const env0_0 = a0;
return env0_2.forEach(_fun46268);
function _fun46268(a0) { // fn#46268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2365, offset: 0x011a4472, size: 31 bytes, params: 2, frame: 13
return a0.execute(env1_0, env0_0);
}
}
function _fun46269(a0) { // fn#46269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2434, offset: 0x011a4491, size: 36 bytes, params: 2, frame: 15
return AppDatabaseManager.handleException(require, env0_0, a0);
}
}
function value_46271(a0, {type}, a2) { // fn#46271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2703, offset: 0x011a44b5, size: 133 bytes, params: 4, frame: 19
const value = environment.__proto__;
const binding = env1_7;
binding.info('disabling database · error encountered during dispatch', a2, a2.stack);
(Dispatcher).dispatch({type: 'RESET_SOCKET', args: {error: a2,
action: 'AppDatabaseManager(' + type + ')'}});
}
function value_46272(a0, a1) { // fn#46272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2919, offset: 0x011a453a, size: 256 bytes, params: 3, frame: 22
var r4;
var r8;
var value6;
var actions;
var value7;
var value8;
var value9;
var has;
var value10;
var value11;
var value12;
const env0_0 = a0;
const Map = global.Map;
const map = new Map();
const value2 = a1.map(_fun46273);
map.set('LOGOUT', []);
map.set('LOGIN_RESET', []);
const value4 = _createForOfIteratorHelperLoose_46258(value2);
const value5 = value4();
let done = value5.done;
if (!done) {
r8 = value8;
r4 = value5;
while (true) {
value9 = r8.value;
has = map.has;
if (!Reflect.apply(has, map, [value9])) {
map.set(value9, []);
value6 = r4.value;
_createForOfIteratorHelperLoose_46258Binding = _createForOfIteratorHelperLoose_46258;
actions = value6.actions;
value7 = _createForOfIteratorHelperLoose_46258Binding(actions);
value8 = value7();
done = value8.done;
if (!done) {
r8 = value8;
while (true) {
value9 = r8.value;
has = map.has;
if (!Reflect.apply(has, map, [value9])) {
map.set(value9, []);
}
value10 = map.get(value9);
value10.push(value6);
value11 = value7();
done = value11.done;
if (done) {
break;
}
r8 = value11;
continue;
}
}
value10 = map.get(value9);
value10.push(value6);
value11 = value7();
done = value11.done;
value12 = value4();
done = value12.done;
if (done) {
break;
}
r8 = value11;
r4 = value12;
continue;
}
}
value12 = value4();
done = value12.done;
if (done) {
break;
return [map, value2];
function _fun46273(a0) { // fn#46273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2956, offset: 0x011a463a, size: 63 bytes, params: 2, frame: 13
let value = environment.__proto__.__proto__;
const Entry = (AppDatabaseManagerEntryModule).Entry;
const binding = env0_0;
value = Object.create(Entry.prototype, {constructor: {value: Entry}});
const entry = new Entry(binding, a0);
return entry instanceof Object ? entry : value;
}
r4 = value12;
continue;
}
}
return [map, value2];
}
function value_46274(a0, a1, a2, a3) { // fn#46274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:3261, offset: 0x011a4679, size: 143 bytes, params: 5, frame: 24
var environment;
const env0_0 = a3;
let value = environment.__proto__;
const defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
const register = defaultImport.register;
const Object = global.Object;
const value2 = Object.fromEntries(a1.map(function(a0) {
return [a0, importAll];
}));
const DispatchBand = (require(694) /* metro dependency 694: Dispatcher */).DispatchBand;
const Database = DispatchBand.Database;
value = Reflect.apply(register, defaultImport, [a0, value2, function() {
}, Database]);
defaultImport.addDependencies(value, a2);
return value;
}
function _fun46263() { // fn#46263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:1396, offset: 0x011a41bf, size: 71 bytes, params: 1, frame: 13
var r2;
var value3;
var value4;
let value = environment.__proto__.__proto__;
value = _createForOfIteratorHelperLoose_46258(env0_0.entries);
const value2 = value();
let done = value2.done;
if (!done) {
for (r2 = value2; true; r2 = value4) {
value3 = r2.value;
value3.reset();
value4 = value();
done = value4.done;
if (done) {
break;
}
function value_46274(a0, a1, a2, a3) { // fn#46274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:3261, offset: 0x011a4679, size: 143 bytes, params: 5, frame: 24
var environment;
const env0_0 = a3;
let value = environment.__proto__;
const defaultImport = Dispatcher;
const register = defaultImport.register;
const Object = global.Object;
const value2 = Object.fromEntries(a1.map(function(a0) {
return [a0, importAll];
}));
const DispatchBand = (DispatcherModule).DispatchBand;
const Database = DispatchBand.Database;
value = Reflect.apply(register, defaultImport, [a0, value2, function() {
}, Database]);
defaultImport.addDependencies(value, a2);
return value;
}
}
}
function _fun46267(a0) { // fn#46267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2351, offset: 0x011a4451, size: 33 bytes, params: 2, frame: 11
const env0_0 = a0;
return env0_2.forEach(_fun46268);
}
function _fun46269(a0) { // fn#46269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2434, offset: 0x011a4491, size: 36 bytes, params: 2, frame: 15
return AppDatabaseManager.handleException(require, env0_0, a0);
}
function _fun46273(a0) { // fn#46273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2956, offset: 0x011a463a, size: 63 bytes, params: 2, frame: 13
let value = environment.__proto__.__proto__;
const Entry = (require(5228) /* metro dependency 5228: AppDatabaseManagerEntry */).Entry;
const binding = env0_0;
value = Object.create(Entry.prototype, {constructor: {value: Entry}});
const entry = new Entry(binding, a0);
return entry instanceof Object ? entry : value;
}
function _fun46268(a0) { // fn#46268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5405:2365, offset: 0x011a4472, size: 31 bytes, params: 2, frame: 13
return a0.execute(env1_0, env0_0);
}
global.__d(_fun46257, 5227, [57, 6, 7, 1226, 3, 1926, 1911, 694, 5228,
2]) /* metro module 5227, dependencies: [57, 6, 7, 1226, 3, 1926, 1911, 694, 5228, 2] */;
@@ -1,4 +1,18 @@
/* Metro module 1926; source: modules/app_database/system/DatabaseManager.tsx; dependencies: [5, 6, 7, 15, 17, 18, 1226, 3, 694, 1927, 1911, 566, 2] */
import Logger from '../../debug/Logger.tsx'; /* Metro dependency 3 */
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
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 Flux from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import Dispatcher from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as DispatcherModule from '../../../Dispatcher.tsx'; /* Metro dependency 694 */
import * as JsModule from '../../../external/discord_common/js/packages/kv-storage/js/index.tsx'; /* Metro dependency 1911 */
function _fun21293(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#21293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:6, offset: 0x00eed014, size: 349 bytes, params: 8, frame: 19
const env0_0 = require;
const _arrayLikeToArray_21296 = function(a0, a1) {
@@ -49,466 +63,486 @@ function _fun21293(global, require, importDefault, importAll, module, exports, d
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(5) /* metro dependency 5 */;
const env0_5 = importDefault(6) /* metro dependency 6 */;
const env0_6 = importDefault(7) /* metro dependency 7 */;
const env0_7 = importDefault(15) /* metro dependency 15 */;
const env0_8 = importDefault(17) /* metro dependency 17 */;
const env0_9 = importDefault(18) /* metro dependency 18 */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
let value = importDefault(3) /* metro dependency 3: Logger */;
let value = Logger;
value = new value('DatabaseManager');
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
const Store = (Flux).Store;
value = _fun21304(Store);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_database/system/DatabaseManager.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/app_database/system/DatabaseManager.tsx');
exports.default = value;
}
function _createForOfIteratorHelperLoose_21294(a0, a1) { // fn#21294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:178, offset: 0x00eed171, 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)) {
function _createForOfIteratorHelperLoose_21294(a0, a1) { // fn#21294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:178, offset: 0x00eed171, 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);
}
return _fun21295;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_21296(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') {
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun21295;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_21296(a0, value);
r6 = value;
r5 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
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_21296(a0, value);
r6 = value;
} else {
r6 = value;
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_21296(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun21295;
}
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 _fun21295() { // fn#21295, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:749, 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 _isNativeReflectConstruct_21297() { // fn#21297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1088, offset: 0x00eed2e3, 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_21297_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _trySpeculativelyOpenDatabaseAsync() { // fn#21301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:4788, offset: 0x00eed35e, size: 48 bytes, params: 1, frame: 14
return Module00005(_fun21303).apply(this, arguments);
function* _fun21303(a0) { // fn#21303, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:4879, offset: 0x00eed397, size: 155 bytes, params: 2, frame: 18
var binding2;
var property;
var value4;
var Database;
var open;
var value5;
var value6;
var value7;
var error;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const value3 = env2_15(a0);
let binding = env2_11;
binding.verbose('speculatively opening ' + value3);
try {
binding = env2_0;
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
binding2 = env2_3;
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
property = binding2[10];
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
value4 = binding(property);
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
Database = value4.Database;
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
open = Database.open;
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
value5 = Reflect.apply(open, Database, [value3]);
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
yield value5;
try {
value6 = undefined;
value7 = false;
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
return value7 ? value6 : value6;
}
}
function _fun21304(a0) { // fn#21304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1322, offset: 0x00eed432, size: 297 bytes, params: 2, frame: 17
const DatabaseManager2 = DatabaseManager;
Inherits(DatabaseManager2, a0);
const items2 = [{key: 'initialize', value: value_21310}];
items2[1] = {key: 'databaseName', value: function(a0) {
return _databaseName(a0);
}};
items2[2] = {key: 'database', value: function(a0) {
var r0;
var value2;
var value = null;
if (value != a0) {
value2 = this.databases.get(a0);
r0 = value != value2 ? value2 : value;
} else {
r0 = value;
}
return r0;
}};
items2[3] = {key: 'carefullyOpenDatabase', value: value_21314};
items2[4] = {key: 'replaceDisableAllDatabases', value: value_21317};
items2[5] = {key: 'remove', value: value_21318};
items2[6] = {key: 'handleClearCaches', value: function(a0) {
if (a0.preventWritingCachesAgainThisSession) {
this.preventWritingCachesAgainThisSession = true;
}
this.replaceDisableAllDatabases('DatabaseManager (' + a0.reason + ')');
}};
items2[7] = {key: 'handleConnectionOpen', value: value_21320};
items2[8] = {key: 'handleAuthenticationStoreChanged', value: value_21321};
const env0_0 = Module00005(_fun21323);
items2[9] = {key: 'carefullySpeculativelyOpen', value: value_21325};
return CreateClass(DatabaseManager2, items2);
function DatabaseManager() { // fn#21305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1334, offset: 0x00eed55b, size: 263 bytes, params: 1, frame: 20
var environment;
let value = environment.__proto__;
env1_5(this, DatabaseManager);
const items2 = [Dispatcher];
items2[1] = {CLEAR_CACHES: CLEAR_CACHES_21306, CONNECTION_CLOSED: CONNECTION_CLOSED_21307,
CONNECTION_OPEN: CONNECTION_OPEN_21308, LOGOUT: LOGOUT_21309};
const DispatchBand = (DispatcherModule).DispatchBand;
const Early = DispatchBand.Early;
items2[2] = Early;
const value3 = env1_8(DatabaseManager);
value = env1_7(this, _isNativeReflectConstruct_21297() ? global.Reflect.construct(value3, items2,
env1_8(this).constructor) : value3.apply(this, items2));
const Map = global.Map;
const value4 = Object.create(Map.prototype, {constructor: {value: Map}});
const map = new Map();
value.databases = map instanceof Object ? map : value4;
value.activeUserId = null;
value.preventWritingCachesAgainThisSession = false;
return value;
function DatabaseManagerCLEAR_CACHES(a0) { // fn#21306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1578, owner: DatabaseManager.CLEAR_CACHES, offset: 0x00eed662, size: 25 bytes, params: 2, frame: 11
return env0_0.handleClearCaches(a0);
}
function DatabaseManagerCONNECTION_CLOSED() { // fn#21307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1622, owner: DatabaseManager.CONNECTION_CLOSED, offset: 0x00eed67b, size: 19 bytes, params: 1, frame: 9
return env0_0.handleAuthenticationStoreChanged();
}
function DatabaseManagerCONNECTION_OPEN() { // fn#21308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1679, owner: DatabaseManager.CONNECTION_OPEN, offset: 0x00eed68e, size: 19 bytes, params: 1, frame: 9
return env0_0.handleConnectionOpen();
}
function DatabaseManagerLOGOUT() { // fn#21309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1715, owner: DatabaseManager.LOGOUT, offset: 0x00eed67b, size: 19 bytes, params: 1, frame: 9
return env0_0.handleAuthenticationStoreChanged();
}
}
function value_21310() { // fn#21310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1941, offset: 0x00eed6a1, size: 100 bytes, params: 1, frame: 15
var environment;
const waitFor = this.waitFor;
let value = environment.__proto__;
const authenticationStoreBinding = AuthenticationStore;
Reflect.apply(waitFor, this, [authenticationStoreBinding]);
const carefullySpeculativelyOpen = this.carefullySpeculativelyOpen;
value = importAll(1927) /* metro dependency 1927: StartupDataNative */;
const getUserId = value.getUserId;
Reflect.apply(carefullySpeculativelyOpen, this, [Reflect.apply(getUserId, value, [])]);
this.handleAuthenticationStoreChanged();
authenticationStoreBinding.addChangeListener(_fun21311);
function _fun21311() { // fn#21311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:2083, offset: 0x00eed67b, size: 19 bytes, params: 1, frame: 9
return env0_0.handleAuthenticationStoreChanged();
}
}
function value_21314(a0) { // fn#21314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:2327, offset: 0x00eed747, size: 184 bytes, params: 2, frame: 20
var environment;
var databases;
var value;
var value2;
if (this.preventWritingCachesAgainThisSession) {
value = environment.__proto__;
env1_11.verbose('Not opening database because caches have been manually cleared.');
return null;
}
if (a0 != null) {
databases = this.databases;
if (!databases.has(a0)) {
value = tryOpenDatabase(a0);
value2 = environment.__proto__;
env1_11.verbose('added database (' + a0 + ' → ' + value + ')');
this.databases.set(a0, value);
this.emitChange();
}
}
r5 = r6;
return this.database(a0);
function tryOpenDatabase(a0) { // fn#21315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:2515, owner: value_21314.tryOpenDatabase, offset: 0x00eed7ff, size: 140 bytes, params: 2, frame: 23
var r0;
var value4;
var error;
var error2;
var value5;
var value6;
const value2 = _databaseName(a0);
let binding = env2_11;
const verbose = binding.verbose;
let HermesInternal = global.HermesInternal;
Reflect.apply(verbose, binding, ['synchronously opening ' + value2]);
const closure = _fun21316;
let r7 = 0;
exceptionMain1: while (true) {
try {
value4 = closure();
} catch (error) {
while (true) {
binding = env2_11;
error2 = binding.error;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(error2, binding, ['tryUntil ' + r7, error]);
value5 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
value6 = null;
if (value5 < 50) {
r7 = value5;
break;
}
r0 = value6;
continue;
return r0;
continue exceptionMain1;
}
}
r0 = value4;
return r0;
}
function _fun21316() { // fn#21316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:2724, offset: 0x00eed88b, size: 61 bytes, params: 1, frame: 14
const Database = (JsModule).Database;
return Database.openSyncUnsafe(env0_0, {invalidateDisabledHandles: true});
}
}
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun21295;
}
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_21297() { // fn#21297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1088, offset: 0x00eed2e3, 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_21297_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _trySpeculativelyOpenDatabaseAsync() { // fn#21301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:4788, offset: 0x00eed35e, size: 48 bytes, params: 1, frame: 14
return env0_4(_fun21303).apply(this, arguments);
}
function _fun21304(a0) { // fn#21304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1322, offset: 0x00eed432, size: 297 bytes, params: 2, frame: 17
const closure = DatabaseManager;
env0_9(closure, a0);
const binding = env0_6;
const items2 = [{key: 'initialize', value: value_21310}];
items2[1] = {key: 'databaseName', value: function(a0) {
return _databaseName(a0);
}};
items2[2] = {key: 'database', value: function(a0) {
var r0;
var value2;
var value = null;
if (value != a0) {
value2 = this.databases.get(a0);
r0 = value != value2 ? value2 : value;
} else {
r0 = value;
}
return r0;
}};
items2[3] = {key: 'carefullyOpenDatabase', value: value_21314};
items2[4] = {key: 'replaceDisableAllDatabases', value: value_21317};
items2[5] = {key: 'remove', value: value_21318};
items2[6] = {key: 'handleClearCaches', value: function(a0) {
if (a0.preventWritingCachesAgainThisSession) {
this.preventWritingCachesAgainThisSession = true;
}
this.replaceDisableAllDatabases('DatabaseManager (' + a0.reason + ')');
}};
items2[7] = {key: 'handleConnectionOpen', value: value_21320};
items2[8] = {key: 'handleAuthenticationStoreChanged', value: value_21321};
const env0_0 = env0_4(_fun21323);
items2[9] = {key: 'carefullySpeculativelyOpen', value: value_21325};
return binding(closure, items2);
}
function* _fun21303(a0) { // fn#21303, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:4879, offset: 0x00eed397, size: 155 bytes, params: 2, frame: 18
var binding2;
var property;
var value4;
var Database;
var open;
var value5;
var value6;
var value7;
var error;
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const value3 = env2_15(a0);
let binding = env2_11;
binding.verbose('speculatively opening ' + value3);
try {
binding = env2_0;
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
binding2 = env2_3;
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
property = binding2[10];
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
value4 = binding(property);
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
Database = value4.Database;
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
open = Database.open;
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
try {
value5 = Reflect.apply(open, Database, [value3]);
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
yield value5;
try {
value6 = undefined;
value7 = false;
} catch (error) {
binding = env2_11;
binding.warn("couldn't speculatively open database.", error);
return null;
}
return value7 ? value6 : value6;
}
function DatabaseManager() { // fn#21305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1334, offset: 0x00eed55b, size: 263 bytes, params: 1, frame: 20
var environment;
let value = environment.__proto__;
env1_5(this, DatabaseManager);
const items2 = [importDefault(694) /* metro dependency 694: Dispatcher */];
items2[1] = {CLEAR_CACHES: CLEAR_CACHES_21306, CONNECTION_CLOSED: CONNECTION_CLOSED_21307,
CONNECTION_OPEN: CONNECTION_OPEN_21308, LOGOUT: LOGOUT_21309};
const DispatchBand = (require(694) /* metro dependency 694: Dispatcher */).DispatchBand;
const Early = DispatchBand.Early;
items2[2] = Early;
const value3 = env1_8(DatabaseManager);
value = env1_7(this, _isNativeReflectConstruct_21297() ? global.Reflect.construct(value3, items2,
env1_8(this).constructor) : value3.apply(this, items2));
const Map = global.Map;
const value4 = Object.create(Map.prototype, {constructor: {value: Map}});
const map = new Map();
value.databases = map instanceof Object ? map : value4;
value.activeUserId = null;
value.preventWritingCachesAgainThisSession = false;
return value;
}
function value_21310() { // fn#21310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1941, offset: 0x00eed6a1, size: 100 bytes, params: 1, frame: 15
var environment;
const waitFor = this.waitFor;
let value = environment.__proto__;
Reflect.apply(waitFor, this, [AuthenticationStore]);
const carefullySpeculativelyOpen = this.carefullySpeculativelyOpen;
value = importAll(1927) /* metro dependency 1927: StartupDataNative */;
const getUserId = value.getUserId;
Reflect.apply(carefullySpeculativelyOpen, this, [Reflect.apply(getUserId, value, [])]);
this.handleAuthenticationStoreChanged();
AuthenticationStore.addChangeListener(_fun21311);
}
function value_21314(a0) { // fn#21314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:2327, offset: 0x00eed747, size: 184 bytes, params: 2, frame: 20
var environment;
var databases;
var value;
var value2;
if (this.preventWritingCachesAgainThisSession) {
value = environment.__proto__;
env1_11.verbose('Not opening database because caches have been manually cleared.');
return null;
}
if (a0 != null) {
databases = this.databases;
if (!databases.has(a0)) {
value = tryOpenDatabase(a0);
value2 = environment.__proto__;
env1_11.verbose('added database (' + a0 + ' → ' + value + ')');
this.databases.set(a0, value);
function value_21317(a0) { // fn#21317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:2954, offset: 0x00eed8c8, size: 189 bytes, params: 2, frame: 18
var r3;
var value3;
var value4;
var value5;
let value = environment.__proto__;
env1_11.info('disabling and nulling all databases (reason: ' + a0 + ')');
const _createForOfIteratorHelperLoose_21294Binding = _createForOfIteratorHelperLoose_21294;
let databases = this.databases;
value = databases.keys();
value = _createForOfIteratorHelperLoose_21294Binding(value);
const value2 = value();
let done = value2.done;
if (!done) {
r3 = value2;
while (true) {
value3 = r3.value;
databases = this.databases;
value4 = databases.get(value3);
if (value4 != null) {
value4.disable(a0);
}
if (value4 == null) {
continue;
}
value4.close();
databases = this.databases;
databases.set(value3, null);
value5 = value();
done = value5.done;
if (done) {
break;
}
r3 = value5;
continue;
}
}
this.emitChange();
}
}
return this.database(a0);
}
function value_21317(a0) { // fn#21317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:2954, offset: 0x00eed8c8, size: 189 bytes, params: 2, frame: 18
var r3;
var value3;
var value4;
var value5;
let value = environment.__proto__;
env1_11.info('disabling and nulling all databases (reason: ' + a0 + ')');
const _createForOfIteratorHelperLoose_21294Binding = _createForOfIteratorHelperLoose_21294;
let databases = this.databases;
value = databases.keys();
value = _createForOfIteratorHelperLoose_21294Binding(value);
const value2 = value();
let done = value2.done;
if (!done) {
r3 = value2;
while (true) {
value3 = r3.value;
databases = this.databases;
value4 = databases.get(value3);
if (value4 != null) {
value4.disable(a0);
}
if (value4 == null) {
continue;
}
value4.close();
databases = this.databases;
databases.set(value3, null);
value5 = value();
done = value5.done;
if (done) {
break;
}
r3 = value5;
continue;
}
}
this.emitChange();
}
function value_21318(a0) { // fn#21318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:3256, offset: 0x00eed985, size: 127 bytes, params: 2, frame: 20
const value = this.databases.get(a0);
env1_11.log('removing database (user: ' + a0 + ', database: ' + value + ')');
if (value != null) {
value.close();
}
this.databases.delete(a0);
this.emitChange();
}
function value_21320() { // fn#21320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:3647, offset: 0x00eeda4f, size: 128 bytes, params: 1, frame: 16
const value = environment.__proto__;
const id = AuthenticationStore.getId();
const value3 = this.databases.get(id);
const value4 = undefined;
if (value3 == null && (value3 == null ? value4 : value3.state()) !== (require(1911) /* metro dependency 1911: js */).DatabaseState.Open) {
this.remove(id);
}
this.carefullyOpenDatabase(id);
return value4;
}
function value_21321() { // fn#21321, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:3861, offset: 0x00eedacf, size: 189 bytes, params: 1, frame: 24
var databases;
var value3;
const value = environment.__proto__;
const id = AuthenticationStore.getId();
const activeUserId = this.activeUserId;
if (id !== activeUserId) {
databases = this.databases;
value3 = databases.get(activeUserId);
env1_11.verbose('active user changed (now: ' + id + ', was: ' + activeUserId + ', was: ' + value3 + ')');
if (value3 != null) {
value3.close();
}
(importAll(1927) /* metro dependency 1927: StartupDataNative */).setUserId(id);
this.activeUserId = id;
databases = this.databases;
databases.delete(activeUserId);
}
}
function* _fun21323(a0) { // fn#21323, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:4148, offset: 0x00eedb95, size: 285 bytes, params: 2, frame: 22
var environment;
var databases;
var value4;
var value5;
let value = undefined;
if (false) {
return value;
}
if (this.preventWritingCachesAgainThisSession) {
value = environment.__proto__.__proto__;
env2_11.verbose('Not opening database because caches have been manually cleared.');
} else {
if (a0 == null) {
return undefined;
}
yield trySpeculativelyOpenDatabaseAsync(a0);
value = undefined;
if (false) {
return value;
}
if (value == null) {
value5 = environment.__proto__.__proto__;
env2_11.verbose('discarding speculative database (' + a0 + ' → ' + value + ')');
function value_21318(a0) { // fn#21318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:3256, offset: 0x00eed985, size: 127 bytes, params: 2, frame: 20
const value = this.databases.get(a0);
env1_11.log('removing database (user: ' + a0 + ', database: ' + value + ')');
if (value != null) {
value.close();
}
} else {
databases = this.databases;
if (databases.has(a0)) {
value5 = environment.__proto__.__proto__;
env2_11.verbose('discarding speculative database (' + a0 + ' → ' + value + ')');
if (value != null) {
value.close();
this.databases.delete(a0);
this.emitChange();
}
function value_21320() { // fn#21320, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:3647, offset: 0x00eeda4f, size: 128 bytes, params: 1, frame: 16
const value = environment.__proto__;
const id = AuthenticationStore.getId();
const value3 = this.databases.get(id);
const value4 = undefined;
if (value3 == null && (value3 == null ? value4 : value3.state()) !== (require(1911) /* metro dependency 1911: js */).DatabaseState.Open) {
this.remove(id);
}
this.carefullyOpenDatabase(id);
return value4;
}
function value_21321() { // fn#21321, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:3861, offset: 0x00eedacf, size: 189 bytes, params: 1, frame: 24
var databases;
var value3;
const value = environment.__proto__;
const id = AuthenticationStore.getId();
const activeUserId = this.activeUserId;
if (id !== activeUserId) {
databases = this.databases;
value3 = databases.get(activeUserId);
env1_11.verbose('active user changed (now: ' + id + ', was: ' + activeUserId + ', was: ' + value3 + ')');
if (value3 != null) {
value3.close();
}
(importAll(1927) /* metro dependency 1927: StartupDataNative */).setUserId(id);
this.activeUserId = id;
databases = this.databases;
databases.delete(activeUserId);
}
}
function* _fun21323(a0) { // fn#21323, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:4148, offset: 0x00eedb95, size: 285 bytes, params: 2, frame: 22
var environment;
var databases;
var value4;
var value5;
let value = undefined;
if (false) {
return value;
}
if (this.preventWritingCachesAgainThisSession) {
value = environment.__proto__.__proto__;
env2_11.verbose('Not opening database because caches have been manually cleared.');
} else {
value4 = environment.__proto__.__proto__;
env2_11.verbose('added speculative database (' + a0 + ' → ' + value + ')');
this.databases.set(a0, value);
this.emitChange();
}
}
}
}
function DatabaseManagerCLEAR_CACHES(a0) { // fn#21306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1578, owner: DatabaseManager.CLEAR_CACHES, offset: 0x00eed662, size: 25 bytes, params: 2, frame: 11
return env0_0.handleClearCaches(a0);
}
function DatabaseManagerCONNECTION_CLOSED() { // fn#21307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:1622, owner: DatabaseManager.CONNECTION_CLOSED, offset: 0x00eed67b, size: 19 bytes, params: 1, frame: 9
return env0_0.handleAuthenticationStoreChanged();
}
function tryOpenDatabase(a0) { // fn#21315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:2515, owner: value_21314.tryOpenDatabase, offset: 0x00eed7ff, size: 140 bytes, params: 2, frame: 23
var r0;
var value4;
var error;
var error2;
var value5;
var value6;
const value2 = _databaseName(a0);
let binding = env2_11;
const verbose = binding.verbose;
let HermesInternal = global.HermesInternal;
Reflect.apply(verbose, binding, ['synchronously opening ' + value2]);
const closure = _fun21316;
let r7 = 0;
exceptionMain1: while (true) {
try {
value4 = closure();
} catch (error) {
while (true) {
binding = env2_11;
error2 = binding.error;
HermesInternal = global.HermesInternal;
concat = HermesInternal.concat;
Reflect.apply(error2, binding, ['tryUntil ' + r7, error]);
value5 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
value6 = null;
if (value5 < 50) {
r7 = value5;
break;
if (a0 == null) {
return undefined;
}
yield trySpeculativelyOpenDatabaseAsync(a0);
value = undefined;
if (false) {
return value;
}
if (value == null) {
value5 = environment.__proto__.__proto__;
env2_11.verbose('discarding speculative database (' + a0 + ' → ' + value + ')');
if (value != null) {
value.close();
}
} else {
databases = this.databases;
if (databases.has(a0)) {
value5 = environment.__proto__.__proto__;
env2_11.verbose('discarding speculative database (' + a0 + ' → ' + value + ')');
if (value != null) {
value.close();
}
} else {
value4 = environment.__proto__.__proto__;
env2_11.verbose('added speculative database (' + a0 + ' → ' + value + ')');
this.databases.set(a0, value);
this.emitChange();
}
}
r0 = value6;
continue;
return r0;
continue exceptionMain1;
}
function trySpeculativelyOpenDatabaseAsync() { // fn#21324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:4312, offset: 0x00eedcb2, size: 30 bytes, params: 1, frame: 13
return env3_16.apply(this, arguments);
}
}
r0 = value4;
return r0;
function value_21325() { // fn#21325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:4642, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
return env0_0.apply(this, arguments);
}
}
}
function _fun21316() { // fn#21316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2053:2724, offset: 0x00eed88b, size: 61 bytes, params: 1, frame: 14
const Database = (require(1911) /* metro dependency 1911: js */).Database;
return Database.openSyncUnsafe(env0_0, {invalidateDisabledHandles: true});
}
global.__d(_fun21293, 1926, [5, 6, 7, 15, 17, 18, 1226, 3, 694, 1927, 1911, 566,
2]) /* metro module 1926, dependencies: [5, 6, 7, 15, 17, 18, 1226, 3, 694, 1927, 1911, 566, 2] */;
@@ -1,35 +1,37 @@
/* Metro module 1927; source: modules/app_database/system/StartupData.native.tsx; dependencies: [27, 477, 1928, 2] */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
function _fun21326(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#21326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2054:6, offset: 0x00eedcd0, size: 133 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(27) /* metro dependency 27 */).NativeModules;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/app_database/system/StartupData.native.tsx');
(FileImportTrackerModule).fileFinishedImporting('modules/app_database/system/StartupData.native.tsx');
exports.getUserId = getUserId;
exports.setUserId = setUserId;
}
function getUserId() { // fn#21327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2054:216, offset: 0x00eedd55, size: 116 bytes, params: 1, frame: 13
var userId;
var value;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
value = importDefault(1928) /* metro dependency 1928: NativeAppDatabaseModule */;
userId = value.getConstants().userId;
} else {
var DCDAppDatabase = NativeModules.DCDAppDatabase;
userId = DCDAppDatabase.userId;
function getUserId() { // fn#21327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2054:216, offset: 0x00eedd55, size: 116 bytes, params: 1, frame: 13
var userId;
var value;
if (PlatformUtilsModule.isAndroid()) {
value = importDefault(1928) /* metro dependency 1928: NativeAppDatabaseModule */;
userId = value.getConstants().userId;
} else {
var DCDAppDatabase = NativeModules.DCDAppDatabase;
userId = DCDAppDatabase.userId;
}
value = null;
return value != userId ? userId : value;
}
value = null;
return value != userId ? userId : value;
}
function setUserId(a0) { // fn#21328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2054:386, offset: 0x00eeddc9, size: 97 bytes, params: 2, frame: 13
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
(importDefault(1928) /* metro dependency 1928: NativeAppDatabaseModule */).setUserId(a0);
} else {
NativeModules.DCDAppDatabase.setUserId(a0);
function setUserId(a0) { // fn#21328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2054:386, offset: 0x00eeddc9, size: 97 bytes, params: 2, frame: 13
if (PlatformUtilsModule.isAndroid()) {
(importDefault(1928) /* metro dependency 1928: NativeAppDatabaseModule */).setUserId(a0);
} else {
NativeModules.DCDAppDatabase.setUserId(a0);
}
}
}
global.__d(_fun21326, 1927, [27, 477, 1928, 2]) /* metro module 1927, dependencies: [27, 477, 1928, 2] */;