326 lines
13 KiB
JavaScript
326 lines
13 KiB
JavaScript
/* Metro module 1171; source: unknown; dependencies: [57, 6, 7] */
|
|
import ClassCallCheck from './module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from './module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import Module00057 from './module-00057.js'; /* Metro dependency 57 */
|
|
|
|
function _fun13014(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#13014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1298:6, offset: 0x00dddd99, size: 109 bytes, params: 8, frame: 18
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
exports.AsyncExpiringMap = _fun13015();
|
|
function _fun13015() { // fn#13015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1298:128, offset: 0x00ddde06, size: 241 bytes, params: 1, frame: 15
|
|
return CreateClass(AsyncExpiringMap, [{key: 'set', value: value_13017}, {key: 'pop', value: function(a0) {
|
|
var value = this.get(a0);
|
|
this._map.delete(a0);
|
|
return value;
|
|
}}, {key: 'get', value: function(a0) {
|
|
var r0;
|
|
var property = this._map;
|
|
var value = property.get(a0);
|
|
if (value) {
|
|
if (value.promise) {
|
|
r0 = value.promise;
|
|
} else {
|
|
property = value.expiresAt;
|
|
if (property && value.expiresAt <= global.Date.now()) {
|
|
this._map.delete(a0);
|
|
}
|
|
property = value.value;
|
|
r0 = property;
|
|
}
|
|
return r0;
|
|
}
|
|
}}, {key: 'has', value: function(a0) {
|
|
var r2;
|
|
var r1;
|
|
var r0;
|
|
var property = this._map;
|
|
var value = property.get(a0);
|
|
if (value) {
|
|
property = value.promise;
|
|
if (property) {
|
|
r1 = !!property;
|
|
} else {
|
|
property = value.expiresAt;
|
|
if (property) {
|
|
value = value.expiresAt <= global.Date.now();
|
|
r2 = value;
|
|
} else {
|
|
r2 = property;
|
|
}
|
|
value = !r2;
|
|
if (r2) {
|
|
this._map.delete(a0);
|
|
r2 = false;
|
|
} else {
|
|
r2 = value;
|
|
}
|
|
r1 = r2;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = !!value;
|
|
}
|
|
return r0;
|
|
}}, {key: 'ttl', value: function(a0) {
|
|
var value3;
|
|
var value = this._map.get(a0);
|
|
var value2 = undefined;
|
|
if (value == null ? value2 : value.expiresAt) {
|
|
value = value.expiresAt - global.Date.now();
|
|
value3 = 0;
|
|
return value > value3 ? value : value3;
|
|
}
|
|
return value2;
|
|
}}, {key: 'cleanup', value: value_13024}, {key: 'clear', value: function() {
|
|
if (this._cleanupInterval) {
|
|
global.clearInterval(this._cleanupInterval);
|
|
}
|
|
this._map.clear();
|
|
}}, {key: 'stopCleanup', value: function() {
|
|
if (this._cleanupInterval) {
|
|
global.clearInterval(this._cleanupInterval);
|
|
}
|
|
}}, {key: 'startCleanup', value: function() {
|
|
var env0_0 = this;
|
|
this._cleanupInterval = global.setInterval(_fun13028, this._cleanupIntervalMs);
|
|
}}]);
|
|
function AsyncExpiringMap() { // fn#13016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1298:149, offset: 0x00dddef7, size: 150 bytes, params: 1, frame: 15
|
|
let r3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
const cleanupInterval = r3.cleanupInterval;
|
|
const r1 = cleanupInterval === undefined ? 5000 : cleanupInterval;
|
|
const ttl = r3.ttl;
|
|
r3 = ttl === undefined ? 2000 : ttl;
|
|
value = environment.__proto__;
|
|
env1_1(this, AsyncExpiringMap);
|
|
this._ttl = r3;
|
|
const Map = global.Map;
|
|
this._map = new Map();
|
|
this._cleanupIntervalMs = r1;
|
|
this.startCleanup();
|
|
}
|
|
|
|
function value_13017(a0, a1) { // fn#13017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1298:428, offset: 0x00dddf8d, size: 189 bytes, params: 3, frame: 18
|
|
var _map;
|
|
var set;
|
|
var object;
|
|
if (!this._cleanupInterval) {
|
|
this.startCleanup();
|
|
}
|
|
if (typeof a1 !== 'object') {
|
|
_map = this._map;
|
|
set = _map.set;
|
|
object = {value: a1};
|
|
object.expiresAt = global.Date.now() + this._ttl;
|
|
object.promise = null;
|
|
Reflect.apply(set, _map, [a0, object]);
|
|
} else if (a1) {
|
|
if ('then' in a1) {
|
|
this._map.set(a0, {value: undefined, expiresAt: null, promise: a1});
|
|
a1.then(_fun13018, _fun13019);
|
|
} else {
|
|
_map = this._map;
|
|
set = _map.set;
|
|
object = {value: a1};
|
|
object.expiresAt = global.Date.now() + this._ttl;
|
|
object.promise = null;
|
|
Reflect.apply(set, _map, [a0, object]);
|
|
}
|
|
} else {
|
|
_map = this._map;
|
|
set = _map.set;
|
|
object = {value: a1};
|
|
object.expiresAt = global.Date.now() + this._ttl;
|
|
object.promise = null;
|
|
Reflect.apply(set, _map, [a0, object]);
|
|
}
|
|
function _fun13018(a0) { // fn#13018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1298:611, offset: 0x00dde04a, size: 73 bytes, params: 2, frame: 11
|
|
ClassCallCheck.value = a0;
|
|
const Date = global.Date;
|
|
ClassCallCheck.expiresAt = Date.now() + Module00057._ttl;
|
|
ClassCallCheck.promise = null;
|
|
}
|
|
|
|
function _fun13019() { // fn#13019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1298:681, offset: 0x00dde093, size: 60 bytes, params: 1, frame: 11
|
|
const Date = global.Date;
|
|
ClassCallCheck.expiresAt = Date.now() + Module00057._ttl;
|
|
ClassCallCheck.promise = null;
|
|
}
|
|
|
|
}
|
|
|
|
function value_13024() { // fn#13024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1298:1365, offset: 0x00dde223, size: 180 bytes, params: 1, frame: 23
|
|
var r11;
|
|
var binding;
|
|
var value3;
|
|
var property;
|
|
var property2;
|
|
var expiresAt;
|
|
var value4;
|
|
var property3;
|
|
var error;
|
|
var size;
|
|
var stopCleanup;
|
|
const Date = global.Date;
|
|
const value = Date.now();
|
|
let _map = this._map;
|
|
const iterator = _map.entries()[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let r3 = iterator;
|
|
let item2 = Reflect.apply(iterator2, r3, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : r3;
|
|
reducibleJoin2: while (true) {
|
|
if (item2 === undefined) {
|
|
_map = this._map;
|
|
size = _map.size;
|
|
reducibleJoin21: while (true) {
|
|
if (size) {
|
|
break reducibleJoin21;
|
|
}
|
|
stopCleanup = this.stopCleanup;
|
|
Reflect.apply(stopCleanup, this, []);
|
|
break reducibleJoin21;
|
|
}
|
|
return undefined;
|
|
}
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleLoop2: while (true) {
|
|
try {
|
|
binding = env1_0;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
value3 = binding(item, 2);
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
property = value3[0];
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
property2 = value3[1];
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
expiresAt = property2.expiresAt;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
reducibleJoin13: while (true) {
|
|
if (expiresAt) {
|
|
try {
|
|
expiresAt = property2.expiresAt;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
value4 = expiresAt <= value;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
r11 = value4;
|
|
break reducibleJoin13;
|
|
}
|
|
r11 = expiresAt;
|
|
break reducibleJoin13;
|
|
}
|
|
reducibleJoin1: while (true) {
|
|
if (r11) {
|
|
try {
|
|
_map = this._map;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
property3 = _map.delete;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
Reflect.apply(property3, _map, [property]);
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
r3 = item2;
|
|
break reducibleJoin1;
|
|
}
|
|
r3 = item2;
|
|
break reducibleJoin1;
|
|
}
|
|
item2 = Reflect.apply(iterator2, r3, []);
|
|
item = item2.value;
|
|
item2 = item2.done ? undefined : r3;
|
|
if (item2 === undefined) {
|
|
break reducibleLoop2;
|
|
}
|
|
continue reducibleLoop2;
|
|
}
|
|
reducibleJoin21: while (true) {
|
|
if (this._map.size) {
|
|
break reducibleJoin21;
|
|
}
|
|
stopCleanup = this.stopCleanup;
|
|
Reflect.apply(stopCleanup, this, []);
|
|
break reducibleJoin21;
|
|
}
|
|
}
|
|
|
|
function value_13027() { // fn#13027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1298:1800, offset: 0x00dde331, size: 44 bytes, params: 1, frame: 14
|
|
this._cleanupInterval = global.setInterval(_fun13028, this._cleanupIntervalMs);
|
|
function _fun13028() { // fn#13028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1298:1870, offset: 0x00dde35d, size: 19 bytes, params: 1, frame: 9
|
|
return Module00057.cleanup();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun13014, 1171, [57, 6, 7]) /* metro module 1171, dependencies: [57, 6, 7] */;
|