decord/source/modules/replies/PendingReplyStore.tsx

315 lines
8.9 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 5912
2026-07-27 11:26:19 +00:00
// Function ID: 52469
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-25 08:10:48 +00:00
// Dependencies: [57, 6, 7, 15, 17, 18, 1348, 4350, 21, 566, 686, 2]
2026-07-20 16:05:17 +00:00
2026-07-25 08:10:48 +00:00
// Module 5912 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_4 from "_isNativeReflectConstruct";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import closure_8 from "_isNativeReflectConstruct";
import closure_9 from "_isNativeReflectConstruct";
function _createForOfIteratorHelperLoose(iterable) {
let closure_0 = iterable;
iterable = "undefined" !== typeof Symbol;
if (iterable) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol;
2026-07-23 10:11:24 +00:00
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (!iterable) {
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (iterable) {
const iter = iterable.call(iterable);
2026-07-20 16:05:17 +00:00
const next = iter.next;
return next.bind(iter);
} else {
const _Array = Array;
2026-07-23 10:11:24 +00:00
let tmp = iterable;
if (!Array.isArray(iterable)) {
2026-07-20 16:05:17 +00:00
let tmp2;
2026-07-23 10:11:24 +00:00
if (iterable) {
if ("string" === typeof iterable) {
tmp2 = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
const toString = {}.toString;
2026-07-23 10:11:24 +00:00
const substr = toString.call(iterable).slice(8, -1);
2026-07-20 16:05:17 +00:00
let name = substr;
if (tmp3) {
2026-07-23 10:11:24 +00:00
name = iterable.constructor.name;
2026-07-20 16:05:17 +00:00
}
if ("Map" !== name) {
if ("Set" !== name) {
if ("Arguments" === name) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr;
}
const _Array2 = Array;
2026-07-23 10:11:24 +00:00
arr = Array.from(iterable);
const callResult = toString.call(iterable);
tmp3 = "Object" === substr && iterable.constructor;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2;
if (!tmp2) {
const _TypeError = TypeError;
const typeError = new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
throw typeError;
}
}
if (tmp) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0;
2026-07-20 16:05:17 +00:00
return () => {
2026-07-23 10:11:24 +00:00
if (closure_1 >= length.length) {
2026-07-20 16:05:17 +00:00
let obj = { done: true };
} else {
obj = { done: false };
closure_1 = tmp3 + 1;
2026-07-23 10:11:24 +00:00
obj.value = length[+closure_1];
2026-07-20 16:05:17 +00:00
}
return obj;
};
}
}
function _arrayLikeToArray(arg0, arg1) {
let length;
if (tmp) {
length = arg0.length;
}
const ArrayResult = Array(length);
for (let num = 0; num < length; num = num + 1) {
ArrayResult[num] = arg0[num];
}
return ArrayResult;
}
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
function tryHydratePendingReply(channelId) {
if (null == channelId) {
return false;
2026-07-23 10:11:24 +00:00
} else if (null == dependencyMap2[channelId]) {
2026-07-20 16:05:17 +00:00
return false;
} else {
2026-07-23 10:11:24 +00:00
message = message.getMessage(channelId, tmp10.messageId);
channel = channel.getChannel(tmp10.channelId);
2026-07-20 16:05:17 +00:00
if (null != message) {
if (null != channel) {
const obj = { channel, message };
2026-07-23 10:11:24 +00:00
({ shouldMention: obj.shouldMention, showMentionToggle: obj.showMentionToggle } = tmp10);
2026-07-20 16:05:17 +00:00
closure_10[channelId] = obj;
2026-07-23 10:11:24 +00:00
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
}
return false;
}
}
let closure_10 = {};
let closure_11 = {};
let closure_12 = {};
2026-07-23 10:11:24 +00:00
let tmp2 = ((PersistedStore) => {
2026-07-20 16:05:17 +00:00
class PendingReplyStore {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_3(this, PendingReplyStore);
obj = outer1_6(PendingReplyStore);
tmp2 = outer1_5;
if (outer1_15()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_6;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_6(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(PendingReplyStore, PersistedStore);
let obj = {
key: "getState",
value() {
let done;
let obj = {};
2026-07-23 10:11:24 +00:00
const tmp = outer1_13(PendingReplyStore(outer1_1[8]).entries(outer1_10));
2026-07-20 16:05:17 +00:00
let iter = tmp();
if (!iter.done) {
do {
2026-07-23 10:11:24 +00:00
let tmp2 = outer1_2;
let tmp3 = outer1_2(iter.value, 2);
2026-07-20 16:05:17 +00:00
let first = tmp3[0];
let tmp5 = tmp3[1];
obj = { channelId: first, messageId: tmp5.message.id, shouldMention: tmp5.shouldMention, showMentionToggle: tmp5.showMentionToggle };
obj[first] = obj;
let iter2 = tmp();
iter = iter2;
done = iter2.done;
} while (!done);
}
obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(outer1_11);
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(obj);
return obj;
}
};
const items = [obj, , , ];
obj = {
key: "initialize",
value(arg0) {
let obj = arg0;
2026-07-23 10:11:24 +00:00
this.waitFor(outer1_9, outer1_8);
2026-07-20 16:05:17 +00:00
if (null == arg0) {
obj = {};
}
2026-07-23 10:11:24 +00:00
const outer1_11 = obj;
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "getPendingReply",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_10[arg0];
2026-07-20 16:05:17 +00:00
}
};
items[2] = obj;
items[3] = {
key: "getPendingReplyActionSource",
value(arg0) {
2026-07-23 10:11:24 +00:00
return outer1_12[arg0];
2026-07-20 16:05:17 +00:00
}
};
return callback(PendingReplyStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").PersistedStore);
2026-07-20 16:05:17 +00:00
tmp2.displayName = "PendingReplyStore";
tmp2.persistKey = "PendingReplyStore";
2026-07-23 10:11:24 +00:00
let items = [
2026-07-20 16:05:17 +00:00
(arg0) => {
let obj = arg0;
if (null == arg0) {
obj = {};
}
return obj;
}
];
tmp2.migrations = items;
2026-07-23 10:11:24 +00:00
tmp2 = new tmp2(require("dispatcher"), {
2026-07-20 16:05:17 +00:00
CREATE_PENDING_REPLY: function handleCreatePendingReply(message) {
let channel;
let shouldMention;
({ channel, shouldMention } = message);
if (shouldMention === undefined) {
shouldMention = true;
}
let flag = message.showMentionToggle;
if (flag === undefined) {
flag = true;
}
const obj = { channel, message: message.message, shouldMention, showMentionToggle: flag, mediaMention: message.mediaMention };
closure_10[channel.id] = obj;
closure_12[channel.id] = message.source;
},
CREATE_SHALLOW_PENDING_REPLY: function handleCreateShallowPendingReply(messageId) {
let channel;
let shouldMention;
({ channel, shouldMention } = messageId);
if (shouldMention === undefined) {
shouldMention = true;
}
let flag = messageId.showMentionToggle;
if (flag === undefined) {
flag = true;
}
const obj = { channelId: channel.id, messageId: messageId.messageId, shouldMention, showMentionToggle: flag };
closure_11[channel.id] = obj;
},
SET_PENDING_REPLY_SHOULD_MENTION: function handleSetPendingReplyShouldMention(arg0) {
let channelId;
let shouldMention;
({ channelId, shouldMention } = arg0);
2026-07-23 10:11:24 +00:00
if (channelId in dependencyMap) {
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-23 10:11:24 +00:00
const merged = Object.assign(dependencyMap[channelId]);
2026-07-20 16:05:17 +00:00
obj["shouldMention"] = shouldMention;
2026-07-23 10:11:24 +00:00
dependencyMap[channelId] = obj;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (channelId in dependencyMap2) {
2026-07-20 16:05:17 +00:00
obj = {};
2026-07-23 10:11:24 +00:00
const merged1 = Object.assign(dependencyMap2[channelId]);
2026-07-20 16:05:17 +00:00
obj["shouldMention"] = shouldMention;
2026-07-23 10:11:24 +00:00
dependencyMap2[channelId] = obj;
2026-07-20 16:05:17 +00:00
}
},
DELETE_PENDING_REPLY: function handleDeletePendingReply(arg0) {
2026-07-23 10:11:24 +00:00
delete tmp3[tmp2];
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
},
CONNECTION_OPEN: function handleConnectionOpen() {
2026-07-23 10:11:24 +00:00
const keys = importDefault(21).keys(closure_11);
2026-07-20 16:05:17 +00:00
const item = keys.forEach((channelId) => {
2026-07-23 10:11:24 +00:00
if (null == outer1_8.getChannel(channelId)) {
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
}
});
},
LOGOUT: function handleLogout() {
let closure_10 = {};
let closure_11 = {};
let closure_12 = {};
},
MESSAGE_DELETE: function handleMessageDelete(arg0) {
let channelId;
let id;
({ id, channelId } = arg0);
id = undefined;
2026-07-23 10:11:24 +00:00
if (null != dependencyMap[channelId]) {
const message = tmp4.message;
2026-07-20 16:05:17 +00:00
if (null != message) {
id = message.id;
}
}
if (id === id) {
2026-07-23 10:11:24 +00:00
delete tmp3[tmp2];
delete tmp[tmp2];
2026-07-20 16:05:17 +00:00
} else {
let messageId;
2026-07-23 10:11:24 +00:00
if (null != dependencyMap2[channelId]) {
messageId = tmp7.messageId;
2026-07-20 16:05:17 +00:00
}
if (messageId !== id) {
return false;
} else {
2026-07-23 10:11:24 +00:00
delete tmp3[tmp2];
delete tmp3[tmp2];
2026-07-20 16:05:17 +00:00
}
}
},
CHANNEL_SELECT: function handleChannelSelect(channelId) {
tryHydratePendingReply(channelId.channelId);
},
LOAD_MESSAGES_SUCCESS: function handleLoadMessagesSuccess(channelId) {
tryHydratePendingReply(channelId.channelId);
}
});
2026-07-23 10:11:24 +00:00
let result = require("_defineProperties").fileFinishedImporting("modules/replies/PendingReplyStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp2;