374 lines
17 KiB
TypeScript
374 lines
17 KiB
TypeScript
/* Metro module 7069; source: modules/guild_templates/GuildTemplateStore.tsx; dependencies: [6, 7, 15, 17, 18, 6934, 6933, 566, 694, 2] */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as GuildTemplatesConstantsModule from './GuildTemplatesConstants.tsx'; /* Metro dependency 6934 */
|
|
|
|
function _fun56304(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#56304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:6, offset: 0x013c4b60, size: 480 bytes, params: 8, frame: 22
|
|
const _arrayLikeToArray_56307 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const closure = function(a0) {
|
|
resolveGuildTemplate_56313(a0.guildTemplate);
|
|
};
|
|
const resolveGuildTemplate_56313 = function(a0) {
|
|
var env0_0 = a0;
|
|
updateGuildTemplate_56311(a0.code, _fun56314);
|
|
};
|
|
const closure2 = function(a0) {
|
|
updateGuildTemplate_56311(a0.code, _fun56316);
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Map = global.Map;
|
|
let map = new Map();
|
|
const Store = (Flux).Store;
|
|
_fun56317(Store).displayName = 'GuildTemplateStore';
|
|
map = new map(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{GUILD_TEMPLATE_RESOLVE: GUILD_TEMPLATE_RESOLVE, GUILD_TEMPLATE_CREATE_SUCCESS: closure,
|
|
GUILD_TEMPLATE_SYNC_SUCCESS: closure, GUILD_TEMPLATE_RESOLVE_SUCCESS: closure,
|
|
GUILD_TEMPLATE_LOAD_FOR_GUILD_SUCCESS: function({guildTemplates}) {
|
|
guildTemplates.forEach(_fun56325);
|
|
}, GUILD_TEMPLATE_RESOLVE_FAILURE: closure2, GUILD_TEMPLATE_DELETE_SUCCESS: closure2,
|
|
GUILD_TEMPLATE_ACCEPT: function(a0) {
|
|
updateGuildTemplate_56311(a0.code, _fun56327);
|
|
}, GUILD_TEMPLATE_ACCEPT_SUCCESS: function(a0) {
|
|
updateGuildTemplate_56311(a0.code, _fun56329);
|
|
}, GUILD_TEMPLATE_ACCEPT_FAILURE: function(a0) {
|
|
updateGuildTemplate_56311(a0.code, _fun56331);
|
|
}, GUILD_TEMPLATE_MODAL_SHOW: function(a0) {
|
|
env0_9 = a0.code;
|
|
}, GUILD_TEMPLATE_MODAL_HIDE: function() {
|
|
env0_9 = null;
|
|
}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_templates/GuildTemplateStore.tsx');
|
|
exports.default = map;
|
|
function _createForOfIteratorHelperLoose_56305(a0, a1) { // fn#56305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:181, offset: 0x013c4d40, 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 _fun56306;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_56307(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_56307(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_56307(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun56306;
|
|
}
|
|
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 _fun56306() { // fn#56306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:752, 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_56308() { // fn#56308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:1091, offset: 0x013c4eb2, 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_56308_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function updateGuildTemplate_56311(a0, a1) { // fn#56311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:1305, offset: 0x013c4f10, size: 128 bytes, params: 3, frame: 15
|
|
var r2;
|
|
var binding;
|
|
var value2;
|
|
var object;
|
|
var Map;
|
|
var value3;
|
|
var map;
|
|
if (a0 != null) {
|
|
binding = env0_8;
|
|
value2 = binding.get(a0);
|
|
if (value2 != null) {
|
|
object = {};
|
|
copyDataProperties(object, value2, undefined);
|
|
r2 = object;
|
|
} else {
|
|
r2 = {code: a0, state: GuildTemplateStates.RESOLVING};
|
|
}
|
|
a1(r2);
|
|
Map = global.Map;
|
|
binding = env0_8;
|
|
value3 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
map = new Map();
|
|
(map instanceof Object ? map : value3).set(a0, r2);
|
|
}
|
|
}
|
|
|
|
function resolveGuildTemplate_56313(a0) { // fn#56313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:1524, offset: 0x013c4fa9, size: 36 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
updateGuildTemplate_56311(a0.code, _fun56314);
|
|
function _fun56314(a0) { // fn#56314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:1592, offset: 0x013c4fcd, size: 75 bytes, params: 2, frame: 18
|
|
var propertyName;
|
|
let value = environment.__proto__;
|
|
value = importDefault(6933) /* metro dependency 6933: createResolvedGuildTemplate */;
|
|
value = value(env0_0);
|
|
for (propertyName in value) {
|
|
a0[propertyName] = value[propertyName];
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function GUILD_TEMPLATE_DELETE_SUCCESS({code}) { // fn#56315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:1641, offset: 0x013c5018, size: 32 bytes, params: 2, frame: 13
|
|
updateGuildTemplate_56311(code, function(a0) {
|
|
a0.state = GuildTemplateStates.EXPIRED;
|
|
});
|
|
function _fun56316(a0) { // fn#56316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:1722, offset: 0x013c5038, size: 26 bytes, params: 2, frame: 2
|
|
const EXPIRED = GuildTemplateStates.EXPIRED;
|
|
a0.state = EXPIRED;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun56317(a0) { // fn#56317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:1753, offset: 0x013c5052, size: 141 bytes, params: 2, frame: 16
|
|
const GuildTemplateStore2 = GuildTemplateStore;
|
|
Inherits(GuildTemplateStore2, a0);
|
|
return CreateClass(GuildTemplateStore2, [{key: 'getGuildTemplate', value: value_56319}, {key: 'getGuildTemplates',
|
|
value: value_56320}, {key: 'getForGuild', value: value_56321}, {key: 'getDisplayedGuildTemplateCode',
|
|
value: value_56322}]);
|
|
function GuildTemplateStore() { // fn#56318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:1765, offset: 0x00de700a, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, GuildTemplateStore);
|
|
const value3 = env1_5(GuildTemplateStore);
|
|
return env1_4(this, _isNativeReflectConstruct_56308() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_56319(a0) { // fn#56319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:2079, offset: 0x010677c7, size: 32 bytes, params: 2, frame: 11
|
|
var value;
|
|
if (a0 != null) {
|
|
value = environment.__proto__;
|
|
return env1_8.get(a0);
|
|
}
|
|
}
|
|
|
|
function value_56320() { // fn#56320, offset: 0x00fbd9d4, size: 9 bytes, params: 1, frame: 1
|
|
return env1_8;
|
|
}
|
|
|
|
function value_56321(a0) { // fn#56321, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:2198, offset: 0x013c50df, size: 131 bytes, params: 2, frame: 18
|
|
var r3;
|
|
var value5;
|
|
var get;
|
|
var value6;
|
|
var sourceGuildId;
|
|
var state;
|
|
var EXPIRED;
|
|
var value7;
|
|
const _createForOfIteratorHelperLoose_56305Binding = _createForOfIteratorHelperLoose_56305;
|
|
let binding = env1_8;
|
|
const value3 = _createForOfIteratorHelperLoose_56305Binding(binding.keys());
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r3 = value4;
|
|
reducibleLoop1: while (true) {
|
|
value5 = r3.value;
|
|
binding = env1_8;
|
|
get = binding.get;
|
|
value6 = Reflect.apply(get, binding, [value5]);
|
|
if (value6 != null) {
|
|
reducibleJoin5: while (true) {
|
|
if ('sourceGuildId' in value6) {
|
|
sourceGuildId = value6.sourceGuildId;
|
|
if (sourceGuildId !== a0) {
|
|
break reducibleJoin5;
|
|
}
|
|
state = value6.state;
|
|
EXPIRED = GuildTemplateStates.EXPIRED;
|
|
if (state !== EXPIRED) {
|
|
return value6;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
}
|
|
value7 = value3();
|
|
done = value7.done;
|
|
if (done) {
|
|
return undefined;
|
|
}
|
|
r3 = value7;
|
|
continue reducibleLoop1;
|
|
}
|
|
}
|
|
}
|
|
|
|
function value_56322() { // fn#56322, offset: 0x00e07a77, size: 9 bytes, params: 1, frame: 1
|
|
return env1_9;
|
|
}
|
|
|
|
}
|
|
|
|
function GUILD_TEMPLATE_RESOLVE({code}) { // fn#56323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:2553, offset: 0x013c5162, size: 82 bytes, params: 2, frame: 15
|
|
const Map = global.Map;
|
|
const map = new Map(env0_8);
|
|
const set = map.set;
|
|
const RESOLVING = GuildTemplateStates.RESOLVING;
|
|
Reflect.apply(set, map, [code, {code: code, state: RESOLVING}]);
|
|
}
|
|
|
|
function GUILD_TEMPLATE_LOAD_FOR_GUILD_SUCCESS({guildTemplates}) { // fn#56324, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:2878, offset: 0x013c51b4, size: 30 bytes, params: 2, frame: 11
|
|
guildTemplates.forEach(function(a0) {
|
|
resolveGuildTemplate_56313(a0);
|
|
});
|
|
function _fun56325(a0) { // fn#56325, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:2957, offset: 0x013c51d2, size: 19 bytes, params: 2, frame: 11
|
|
resolveGuildTemplate_56313(a0);
|
|
}
|
|
|
|
}
|
|
|
|
function GUILD_TEMPLATE_ACCEPT({code}) { // fn#56326, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:3138, offset: 0x013c51e5, size: 32 bytes, params: 2, frame: 13
|
|
updateGuildTemplate_56311(code, function(a0) {
|
|
a0.state = GuildTemplateStates.ACCEPTING;
|
|
});
|
|
function _fun56327(a0) { // fn#56327, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:3211, offset: 0x0103583c, size: 26 bytes, params: 2, frame: 2
|
|
const ACCEPTING = GuildTemplateStates.ACCEPTING;
|
|
a0.state = ACCEPTING;
|
|
}
|
|
|
|
}
|
|
|
|
function GUILD_TEMPLATE_ACCEPT_SUCCESS({code}) { // fn#56328, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:3269, offset: 0x013c5205, size: 32 bytes, params: 2, frame: 13
|
|
updateGuildTemplate_56311(code, _fun56329);
|
|
function _fun56329(a0) { // fn#56329, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:3349, offset: 0x013c5225, size: 59 bytes, params: 2, frame: 4
|
|
const value = environment.__proto__;
|
|
const ACCEPTED = GuildTemplateStates.ACCEPTED;
|
|
a0.state = ACCEPTED;
|
|
a0.usageCount = (a0.usageCount ?? 0) + 1;
|
|
}
|
|
|
|
}
|
|
|
|
function GUILD_TEMPLATE_ACCEPT_FAILURE({code}) { // fn#56330, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:3456, offset: 0x013c5260, size: 32 bytes, params: 2, frame: 13
|
|
updateGuildTemplate_56311(code, function(a0) {
|
|
a0.state = GuildTemplateStates.RESOLVED;
|
|
});
|
|
function _fun56331(a0) { // fn#56331, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7247:3529, offset: 0x013c5280, size: 26 bytes, params: 2, frame: 2
|
|
const RESOLVED = GuildTemplateStates.RESOLVED;
|
|
a0.state = RESOLVED;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun56304, 7069, [6, 7, 15, 17, 18, 6934, 6933, 566, 694,
|
|
2]) /* metro module 7069, dependencies: [6, 7, 15, 17, 18, 6934, 6933, 566, 694, 2] */;
|