166 lines
6.1 KiB
TypeScript
166 lines
6.1 KiB
TypeScript
/* Metro module 11566; source: modules/chat/useTypingText.tsx; dependencies: [57, 1878, 566, 4617, 1244, 2] */
|
|
function _fun88599(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11752:6, offset: 0x01feacd5, size: 156 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_88602 = 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 Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/chat/useTypingText.tsx');
|
|
exports.default = useTypingText;
|
|
}
|
|
|
|
function _createForOfIteratorHelperLoose_88600(a0, a1) { // fn#88600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11752:123, offset: 0x01fead71, size: 372 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 _fun88601;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_88602(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_88602(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_88602(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun88601;
|
|
}
|
|
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 useTypingText({channelId, guildId, typingUserIds}) { // fn#88603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11752:1110, offset: 0x01feaee5, size: 437 bytes, params: 2, frame: 23
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const fluxModule = require(566) /* metro dependency 566: flux */;
|
|
const useStateFromStoresArray = fluxModule.useStateFromStoresArray;
|
|
const value3 = env0_3(Reflect.apply(useStateFromStoresArray, fluxModule, [[UserStore], _fun88604, [channelId,
|
|
guildId, typingUserIds]]), 4);
|
|
const property = value3[0];
|
|
const property2 = value3[1];
|
|
const property3 = value3[2];
|
|
return property == null ? null : property2 == null ? intl.format(t.lJ9sZX,
|
|
{a: property}) : property3 == null ? intl.format(t.rB0CUa, {a: property,
|
|
b: property2}) : value3[3] == null ? intl.format(t.StKThj, {a: property, b: property2,
|
|
c: property3}) : intl.string(t.uVDhqZ);
|
|
}
|
|
|
|
function _fun88604() { // fn#88604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11752:1219, offset: 0x01feb09a, size: 131 bytes, params: 1, frame: 24
|
|
var r2;
|
|
var value5;
|
|
var user;
|
|
var push;
|
|
var defaultImport;
|
|
var getName;
|
|
var value7;
|
|
const items2 = [];
|
|
const value3 = _createForOfIteratorHelperLoose_88600(typingUserIds);
|
|
const value4 = value3();
|
|
let done = value4.done;
|
|
if (!done) {
|
|
r2 = value4;
|
|
while (true) {
|
|
value5 = r2.value;
|
|
user = UserStore.getUser(value5);
|
|
if (user != null) {
|
|
push = items2.push;
|
|
defaultImport = importDefault(4617) /* metro dependency 4617: NicknameUtils */;
|
|
getName = defaultImport.getName;
|
|
Reflect.apply(push, items2, [Reflect.apply(getName, defaultImport, [guildId, channelId, user])]);
|
|
}
|
|
value7 = value3();
|
|
done = value7.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r2 = value7;
|
|
continue;
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
|