2026-10-12 16:32:48 +00:00
|
|
|
// Module ID: 7244
|
|
|
|
|
// Function ID: 7245
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: DraftStore
|
2026-10-12 16:32:48 +00:00
|
|
|
// Dependencies: [32, 502, 2065, 5965, 1085, 7245, 12, 11, 504, 1388, 584, 2]
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-12 16:32:48 +00:00
|
|
|
// Module 7244 (DraftStore)
|
2026-09-18 19:45:33 +00:00
|
|
|
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
|
|
|
|
|
import _modDef12 from "module_12" /* 12 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import get_initializedDefault from "get initialized" /* 504 */;
|
2026-10-07 22:43:51 +00:00
|
|
|
import DispatcherDefault from "Dispatcher" /* 584 */;
|
|
|
|
|
import Constants from "Constants" /* 1085 */;
|
2026-10-12 16:32:48 +00:00
|
|
|
import GlobalUtils from "GlobalUtils" /* 1388 */;
|
|
|
|
|
import DraftCommand from "DraftCommand" /* 7245 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import _slicedToArray from "_slicedToArray" /* 32 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
import AuthenticationStore from "AuthenticationStore" /* 502 */;
|
2026-10-12 16:32:48 +00:00
|
|
|
import ChannelStore from "ChannelStore" /* 2065 */;
|
|
|
|
|
import GuildAvailabilityStore from "GuildAvailabilityStore" /* 5965 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
|
|
|
|
|
|
|
|
|
let closure_9;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
|
|
|
|
function handleChanged(type) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let channelId;
|
|
|
|
|
let command;
|
|
|
|
|
let draft;
|
|
|
|
|
let draftType;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ channelId, draft, draftType, command } = type);
|
2026-10-01 14:13:23 +00:00
|
|
|
type = type.type;
|
2026-09-18 19:45:33 +00:00
|
|
|
const channel = ChannelStore.getChannel(channelId);
|
|
|
|
|
let template;
|
|
|
|
|
if (channel != null) {
|
|
|
|
|
template = channel.template;
|
|
|
|
|
}
|
|
|
|
|
if (draft === template) {
|
|
|
|
|
draft = "";
|
|
|
|
|
}
|
|
|
|
|
const id = AuthenticationStore.getId();
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = AuthenticationStore;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != id) {
|
|
|
|
|
if (null != draft) {
|
|
|
|
|
if ("" !== draft) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp9 = closure_9[id];
|
|
|
|
|
if (null == tmp9) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj2 = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9[id] = obj2;
|
|
|
|
|
tmp9 = obj2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp11 = tmp9[channelId];
|
|
|
|
|
if (null == tmp11) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj3 = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp9[channelId] = obj3;
|
|
|
|
|
tmp11 = obj3;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
let substr = draft;
|
|
|
|
|
if (draft.length > closure_7) {
|
2026-10-01 14:13:23 +00:00
|
|
|
substr = draft.substr(0, tmp12);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (command == null) {
|
|
|
|
|
let command1;
|
2026-10-01 14:13:23 +00:00
|
|
|
const isDraftCommandValidForText = DraftCommand.isDraftCommandValidForText;
|
|
|
|
|
DraftCommand;
|
|
|
|
|
if (tmp11[draftType] != null) {
|
|
|
|
|
command1 = tmp14.command;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp19;
|
|
|
|
|
if (isDraftCommandValidForText(command1, substr)) {
|
2026-09-18 19:45:33 +00:00
|
|
|
let command2;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp11[draftType] != null) {
|
|
|
|
|
command2 = tmp14.command;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp19 = command2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
command = tmp19;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
let draft1;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp11[draftType] != null) {
|
|
|
|
|
draft1 = tmp14.draft;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
let isEqualResult = substr === draft1;
|
|
|
|
|
if (isEqualResult) {
|
|
|
|
|
let command3;
|
2026-10-01 14:13:23 +00:00
|
|
|
const isEqual = _modDef12.isEqual;
|
|
|
|
|
_modDef12;
|
|
|
|
|
if (tmp11[draftType] != null) {
|
|
|
|
|
command3 = tmp14.command;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
isEqualResult = isEqual(command, command3);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (!isEqualResult) {
|
|
|
|
|
const _Date = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp11[draftType] = { timestamp: Date.now(), draft: substr, command };
|
|
|
|
|
const obj4 = { timestamp: Date.now(), draft: substr, command };
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return "DRAFT_SAVE" === type;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const id1 = obj.getId();
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != id1) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp6 = closure_9[id1];
|
|
|
|
|
if (null == tmp6) {
|
|
|
|
|
const obj5 = {};
|
|
|
|
|
closure_9[id1] = obj5;
|
|
|
|
|
tmp6 = obj5;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null != tmp6[channelId]) {
|
|
|
|
|
delete tmp6[channelId][draftType];
|
|
|
|
|
const obj6 = _modDef12;
|
|
|
|
|
if (obj6.isEmpty(tmp6[channelId])) {
|
|
|
|
|
delete tmp6[channelId];
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function deleteDraft(arg0, arg1) {
|
|
|
|
|
let id = arg2;
|
|
|
|
|
if (arg2 === undefined) {
|
|
|
|
|
id = AuthenticationStore.getId();
|
|
|
|
|
}
|
|
|
|
|
if (null == id) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp4 = closure_9[id];
|
|
|
|
|
if (null == tmp4) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9[id] = obj;
|
|
|
|
|
tmp4 = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null == tmp4[arg0]) {
|
2026-09-18 19:45:33 +00:00
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete tmp4[arg0][arg1];
|
|
|
|
|
const obj2 = _modDef12;
|
|
|
|
|
if (obj2.isEmpty(tmp4[arg0])) {
|
|
|
|
|
delete tmp4[tmp6];
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
function handleChannelDelete(channel) {
|
|
|
|
|
const id = channel.channel.id;
|
|
|
|
|
const id1 = AuthenticationStore.getId();
|
|
|
|
|
if (null != id1) {
|
|
|
|
|
let tmp3 = closure_9[id1];
|
|
|
|
|
if (null == tmp3) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9[id1] = obj;
|
|
|
|
|
tmp3 = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
delete tmp3[id];
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_7 = Constants.MAX_MESSAGE_LENGTH_PREMIUM + 500;
|
2026-09-18 19:45:33 +00:00
|
|
|
const DraftType = { ChannelMessage: 0, [0]: "ChannelMessage", ThreadSettings: 1, [1]: "ThreadSettings", FirstThreadMessage: 2, [2]: "FirstThreadMessage", ApplicationLauncherCommand: 3, [3]: "ApplicationLauncherCommand", Poll: 4, [4]: "Poll", SlashCommand: 5, [5]: "SlashCommand", ForwardContextMessage: 6, [6]: "ForwardContextMessage", InteractionModal: 7, [7]: "InteractionModal", ScheduledMessage: 8, [8]: "ScheduledMessage" };
|
2026-10-01 14:13:23 +00:00
|
|
|
const React4 = {};
|
|
|
|
|
const PersistedStore = get_initializedDefault.PersistedStore;
|
2026-09-18 19:45:33 +00:00
|
|
|
class DraftStore extends PersistedStore {
|
2026-10-01 14:13:23 +00:00
|
|
|
initialize(arg0) {
|
|
|
|
|
let ChannelMessage;
|
|
|
|
|
function pruneEmptyDrafts() {
|
|
|
|
|
let first;
|
|
|
|
|
let tmp7;
|
|
|
|
|
const obj = SnowflakeUtilsDefault;
|
|
|
|
|
const entries = obj.entries(closure_1_9);
|
|
|
|
|
const tmp2 = entries[Symbol.iterator]();
|
|
|
|
|
while (tmp2 !== undefined) {
|
|
|
|
|
[first, tmp7] = tmp3;
|
|
|
|
|
let obj2 = SnowflakeUtilsDefault;
|
|
|
|
|
let entries1 = obj2.entries(tmp7);
|
|
|
|
|
for (const item10033 of entries1) {
|
|
|
|
|
let tmp14 = _slicedToArray(item10033, 2);
|
|
|
|
|
let first1 = tmp14[0];
|
|
|
|
|
let tmp17 = tmp14[1][ChannelMessage.ChannelMessage];
|
|
|
|
|
let tmp18 = tmp17;
|
|
|
|
|
if (null != tmp17) {
|
|
|
|
|
let tmp20 = "" !== tmp18.draft;
|
|
|
|
|
if (tmp20) {
|
|
|
|
|
let str = tmp18.draft;
|
|
|
|
|
tmp20 = "" !== str.trim();
|
|
|
|
|
}
|
|
|
|
|
if (!tmp20) {
|
|
|
|
|
let tmp25 = deleteDraft(first1, tmp16.ChannelMessage, first);
|
|
|
|
|
}
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
continue;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj = arg0;
|
|
|
|
|
if (arg0 == null) {
|
|
|
|
|
obj = {};
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9 = obj;
|
|
|
|
|
pruneEmptyDrafts();
|
|
|
|
|
this.waitFor(AuthenticationStore, ChannelStore, GuildAvailabilityStore);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getState() {
|
|
|
|
|
return closure_9;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getThreadDraftWithParentMessageId(arg0) {
|
|
|
|
|
const self = this;
|
|
|
|
|
let closure_0 = arg0;
|
|
|
|
|
const id = AuthenticationStore.getId();
|
|
|
|
|
if (null != id) {
|
|
|
|
|
let tmp3 = closure_9[id];
|
|
|
|
|
if (null == tmp3) {
|
|
|
|
|
const obj = {};
|
|
|
|
|
closure_9[id] = obj;
|
|
|
|
|
tmp3 = obj;
|
|
|
|
|
}
|
|
|
|
|
const obj2 = SnowflakeUtilsDefault;
|
|
|
|
|
const keys = obj2.keys(tmp3);
|
|
|
|
|
const found = keys.find((item) => {
|
|
|
|
|
const threadSettings = self.getThreadSettings(item);
|
|
|
|
|
let parentMessageId;
|
|
|
|
|
if (threadSettings != null) {
|
|
|
|
|
parentMessageId = threadSettings.parentMessageId;
|
|
|
|
|
}
|
|
|
|
|
return parentMessageId === closure_0;
|
|
|
|
|
});
|
|
|
|
|
let threadSettings;
|
|
|
|
|
if (null != found) {
|
|
|
|
|
threadSettings = self.getThreadSettings(found);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
return threadSettings;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getRecentlyEditedDrafts(ChannelMessage) {
|
|
|
|
|
let closure_0 = ChannelMessage;
|
|
|
|
|
const id = AuthenticationStore.getId();
|
|
|
|
|
if (null == id) {
|
|
|
|
|
return [];
|
|
|
|
|
} else {
|
|
|
|
|
let tmp3 = closure_9[id];
|
|
|
|
|
if (null == tmp3) {
|
|
|
|
|
const obj = {};
|
|
|
|
|
closure_9[id] = obj;
|
|
|
|
|
tmp3 = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj2 = _modDef12(tmp3);
|
|
|
|
|
const mapValuesResult = obj2.mapValues((arg0) => {
|
|
|
|
|
let tmp;
|
|
|
|
|
if (arg0 != null) {
|
|
|
|
|
tmp = arg0[closure_0];
|
|
|
|
|
}
|
|
|
|
|
return tmp;
|
|
|
|
|
});
|
|
|
|
|
const pickByResult = mapValuesResult.pickBy(GlobalUtils.isNotNullish);
|
|
|
|
|
const toPairsResult = pickByResult.toPairs();
|
|
|
|
|
const mapped = toPairsResult.map((item) => {
|
|
|
|
|
let tmp;
|
|
|
|
|
[tmp, ] = item;
|
|
|
|
|
return { channelId, timestamp, draft };
|
|
|
|
|
});
|
|
|
|
|
const iter = mapped.sortBy((timestamp) => -timestamp.timestamp);
|
|
|
|
|
return iter.value();
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
getDraft(arg0, arg1) {
|
|
|
|
|
const id = AuthenticationStore.getId();
|
|
|
|
|
if (null == id) {
|
|
|
|
|
return "";
|
|
|
|
|
} else {
|
|
|
|
|
let tmp3 = closure_9[id];
|
|
|
|
|
if (null == tmp3) {
|
|
|
|
|
const obj = {};
|
|
|
|
|
closure_9[id] = obj;
|
|
|
|
|
tmp3 = obj;
|
|
|
|
|
}
|
|
|
|
|
if (null != tmp3[arg0]) {
|
|
|
|
|
if (null != tmp3[arg0][arg1]) {
|
|
|
|
|
return tmp3[arg0][arg1].draft;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return "";
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
getDraftCommand(id, ChannelMessage) {
|
|
|
|
|
id = AuthenticationStore.getId();
|
|
|
|
|
if (null != id) {
|
|
|
|
|
let tmp3 = closure_9[id];
|
|
|
|
|
if (null == tmp3) {
|
|
|
|
|
const obj = {};
|
|
|
|
|
closure_9[id] = obj;
|
|
|
|
|
tmp3 = obj;
|
|
|
|
|
}
|
|
|
|
|
let command;
|
|
|
|
|
if (tmp3[id] != null) {
|
|
|
|
|
if (tmp3[id][ChannelMessage] != null) {
|
|
|
|
|
command = tmp9.command;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return command;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-02 13:37:24 +00:00
|
|
|
getThreadSettings(id) {
|
|
|
|
|
id = AuthenticationStore.getId();
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null == id) {
|
|
|
|
|
return null;
|
|
|
|
|
} else {
|
|
|
|
|
let obj;
|
|
|
|
|
let tmp3 = closure_9[id];
|
|
|
|
|
if (null == tmp3) {
|
|
|
|
|
obj = {};
|
|
|
|
|
closure_9[id] = obj;
|
|
|
|
|
tmp3 = obj;
|
|
|
|
|
}
|
|
|
|
|
let tmp7 = null;
|
2026-10-02 13:37:24 +00:00
|
|
|
if (null != tmp3[id]) {
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp7 = tmp6[obj.ThreadSettings];
|
|
|
|
|
}
|
|
|
|
|
return tmp7;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
getScheduledMessage(id) {
|
|
|
|
|
id = AuthenticationStore.getId();
|
|
|
|
|
if (null != id) {
|
|
|
|
|
let obj;
|
|
|
|
|
let tmp3 = closure_9[id];
|
|
|
|
|
if (null == tmp3) {
|
|
|
|
|
obj = {};
|
|
|
|
|
closure_9[id] = obj;
|
|
|
|
|
tmp3 = obj;
|
|
|
|
|
}
|
|
|
|
|
let tmp7;
|
|
|
|
|
if (tmp3[id] != null) {
|
|
|
|
|
tmp7 = tmp6[obj.ScheduledMessage];
|
|
|
|
|
}
|
|
|
|
|
return tmp7;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
}
|
|
|
|
|
const prototype = DraftStore.prototype;
|
2026-09-18 19:45:33 +00:00
|
|
|
DraftStore.displayName = "DraftStore";
|
|
|
|
|
DraftStore.persistKey = "DraftStore";
|
|
|
|
|
const items = [
|
|
|
|
|
(obj) => {
|
|
|
|
|
if (null == obj) {
|
|
|
|
|
return {};
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
for (const key10005 in obj) {
|
|
|
|
|
if (!("timestamp" in obj[key10005])) {
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
} else {
|
|
|
|
|
obj = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
obj[obj.ChannelMessage] = obj[key10005];
|
|
|
|
|
obj[key10005] = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
(obj) => {
|
|
|
|
|
const id = AuthenticationStore.getId();
|
|
|
|
|
if (null != obj) {
|
|
|
|
|
if (null != id) {
|
|
|
|
|
obj = {};
|
|
|
|
|
const obj2 = {};
|
|
|
|
|
obj[id] = obj2;
|
2026-10-01 14:13:23 +00:00
|
|
|
for (const key10009 in obj) {
|
|
|
|
|
obj2[key10009] = obj[key10009];
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
DraftStore.migrations = items;
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj2 = {
|
2026-09-18 19:45:33 +00:00
|
|
|
CONNECTION_OPEN: function handleConnectionOpen() {
|
|
|
|
|
const id = AuthenticationStore.getId();
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = AuthenticationStore;
|
|
|
|
|
if (!(id in closure_9)) {
|
|
|
|
|
closure_9[id] = {};
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const id1 = obj.getId();
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != id1) {
|
|
|
|
|
if (GuildAvailabilityStore.totalUnavailableGuilds <= 0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp6 = closure_9[id1];
|
|
|
|
|
if (null == tmp6) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj2 = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9[id1] = obj2;
|
|
|
|
|
tmp6 = obj2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
for (const key10019 in tmp6) {
|
|
|
|
|
let tmp9 = key10019;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != ChannelStore.getChannel(key10019)) {
|
|
|
|
|
continue;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete tmp6[tmp9];
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
LOGOUT: function handleLogout(isSwitchingAccount) {
|
|
|
|
|
if (!isSwitchingAccount.isSwitchingAccount) {
|
|
|
|
|
closure_9 = {};
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
MULTI_ACCOUNT_REMOVE_ACCOUNT: function handleMultiAccountRemove(userId) {
|
|
|
|
|
if (userId.userId in closure_9) {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete closure_9[userId.userId];
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
GUILD_DELETE: function handleGuildDelete() {
|
|
|
|
|
const id = AuthenticationStore.getId();
|
|
|
|
|
if (null != id) {
|
|
|
|
|
if (GuildAvailabilityStore.totalUnavailableGuilds <= 0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp4 = closure_9[id];
|
|
|
|
|
if (null == tmp4) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9[id] = obj;
|
|
|
|
|
tmp4 = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
for (const key10013 in tmp4) {
|
|
|
|
|
let tmp7 = key10013;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != ChannelStore.getChannel(key10013)) {
|
|
|
|
|
continue;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
delete tmp4[tmp7];
|
2026-09-18 19:45:33 +00:00
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
CHANNEL_DELETE: handleChannelDelete,
|
|
|
|
|
THREAD_DELETE: handleChannelDelete,
|
|
|
|
|
THREAD_CREATE: function handleThreadCreate(channel) {
|
|
|
|
|
channel = channel.channel;
|
2026-10-01 14:13:23 +00:00
|
|
|
const id1 = AuthenticationStore.getId();
|
|
|
|
|
if (null != id1) {
|
|
|
|
|
if (channel.ownerId !== id1) {
|
|
|
|
|
let tmp3 = closure_9[id1];
|
|
|
|
|
if (null == tmp3) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj2 = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9[id1] = obj2;
|
|
|
|
|
tmp3 = obj2;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null == tmp3[channel.parent_id]) {
|
2026-09-18 19:45:33 +00:00
|
|
|
return false;
|
2026-10-01 14:13:23 +00:00
|
|
|
} else if (null == tmp3[channel.parent_id][AuthenticationStore.ThreadSettings]) {
|
2026-09-18 19:45:33 +00:00
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
const parentMessageId = tmp18.parentMessageId;
|
|
|
|
|
const obj9 = SnowflakeUtilsDefault;
|
|
|
|
|
if (parentMessageId !== obj9.castChannelIdAsMessageId(channel.id)) {
|
2026-09-18 19:45:33 +00:00
|
|
|
return false;
|
2026-10-01 14:13:23 +00:00
|
|
|
} else if (null == tmp3[channel.parent_id]) {
|
2026-09-18 19:45:33 +00:00
|
|
|
return false;
|
|
|
|
|
} else {
|
|
|
|
|
let str;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (tmp3[channel.parent_id][AuthenticationStore.FirstThreadMessage] != null) {
|
|
|
|
|
str = tmp22.draft;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
if (str == null) {
|
|
|
|
|
str = "";
|
|
|
|
|
}
|
|
|
|
|
if ("" !== str) {
|
|
|
|
|
const obj3 = {};
|
|
|
|
|
const _Date = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
const id = channel.id;
|
|
|
|
|
const ChannelMessage = tmp17.ChannelMessage;
|
|
|
|
|
obj3[ChannelMessage] = { timestamp: Date.now(), draft: str };
|
|
|
|
|
tmp3[id] = obj3;
|
|
|
|
|
const obj4 = { timestamp: Date.now(), draft: str };
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const parent_id = channel.parent_id;
|
|
|
|
|
const ThreadSettings = tmp17.ThreadSettings;
|
|
|
|
|
const id2 = obj.getId();
|
|
|
|
|
if (null != id2) {
|
|
|
|
|
let tmp8 = closure_9[id2];
|
|
|
|
|
if (null == tmp8) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj5 = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9[id2] = obj5;
|
|
|
|
|
tmp8 = obj5;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null != tmp8[parent_id]) {
|
|
|
|
|
delete tmp8[parent_id][ThreadSettings];
|
|
|
|
|
const tmp19Result = _modDef12;
|
|
|
|
|
if (tmp19Result.isEmpty(tmp8[parent_id])) {
|
|
|
|
|
delete tmp8[parent_id];
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const parent_id2 = channel.parent_id;
|
|
|
|
|
const FirstThreadMessage = tmp17.FirstThreadMessage;
|
|
|
|
|
const id3 = obj.getId();
|
|
|
|
|
if (null != id3) {
|
|
|
|
|
let tmp13 = closure_9[id3];
|
|
|
|
|
if (null == tmp13) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj6 = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9[id3] = obj6;
|
|
|
|
|
tmp13 = obj6;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null != tmp13[parent_id2]) {
|
|
|
|
|
delete tmp13[parent_id2][FirstThreadMessage];
|
|
|
|
|
const tmp19Result2 = _modDef12;
|
|
|
|
|
if (tmp19Result2.isEmpty(tmp13[parent_id2])) {
|
|
|
|
|
delete tmp13[parent_id2];
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
DRAFT_SAVE: handleChanged,
|
|
|
|
|
DRAFT_CHANGE: handleChanged,
|
2026-10-01 14:13:23 +00:00
|
|
|
DRAFT_CLEAR: function handleDraftClear(channelId) {
|
|
|
|
|
channelId = channelId.channelId;
|
|
|
|
|
const draftType = channelId.draftType;
|
2026-09-18 19:45:33 +00:00
|
|
|
const id = AuthenticationStore.getId();
|
|
|
|
|
let flag = false;
|
|
|
|
|
if (null != id) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp3 = closure_9[id];
|
|
|
|
|
if (null == tmp3) {
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9[id] = obj;
|
|
|
|
|
tmp3 = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
flag = false;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null != tmp3[channelId]) {
|
|
|
|
|
delete tmp3[channelId][draftType];
|
|
|
|
|
const obj2 = _modDef12;
|
|
|
|
|
if (obj2.isEmpty(tmp3[channelId])) {
|
|
|
|
|
delete tmp3[channelId];
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
},
|
|
|
|
|
DRAFT_COMMAND_CLEAR: function handleDraftCommandClear(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let channelId;
|
|
|
|
|
let draftType;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ channelId, draftType } = arg0);
|
|
|
|
|
const id = AuthenticationStore.getId();
|
|
|
|
|
if (null == id) {
|
|
|
|
|
return false;
|
|
|
|
|
} else {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp3 = closure_9[id];
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null == tmp3) {
|
|
|
|
|
const obj = {};
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_9[id] = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
tmp3 = obj;
|
|
|
|
|
}
|
|
|
|
|
let tmp6;
|
|
|
|
|
if (tmp3[channelId] != null) {
|
|
|
|
|
tmp6 = tmp5[draftType];
|
|
|
|
|
}
|
|
|
|
|
let command;
|
|
|
|
|
if (tmp6 != null) {
|
|
|
|
|
command = tmp6.command;
|
|
|
|
|
}
|
|
|
|
|
if (null != command) {
|
|
|
|
|
tmp6.command = undefined;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
THREAD_SETTINGS_DRAFT_CHANGE: function handleThreadSettingsDraftChanged(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let channelId;
|
|
|
|
|
let draft;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ channelId, draft } = arg0);
|
|
|
|
|
const id = AuthenticationStore.getId();
|
|
|
|
|
if (null != id) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj;
|
|
|
|
|
let tmp3 = closure_9[id];
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null == tmp3) {
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = {};
|
|
|
|
|
closure_9[id] = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
tmp3 = obj;
|
|
|
|
|
}
|
|
|
|
|
let tmp5 = tmp3[channelId];
|
|
|
|
|
if (null == tmp5) {
|
|
|
|
|
const obj2 = {};
|
|
|
|
|
tmp3[channelId] = obj2;
|
|
|
|
|
tmp5 = obj2;
|
|
|
|
|
}
|
|
|
|
|
const _Date = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
const ThreadSettings = obj.ThreadSettings;
|
|
|
|
|
const obj3 = { timestamp: Date.now(), parentChannelId: channelId };
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged = Object.assign(tmp5[obj.ThreadSettings]);
|
|
|
|
|
const merged1 = Object.assign(draft);
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp5[ThreadSettings] = obj3;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
SCHEDULED_MESSAGE_DRAFT_CHANGE: function handleScheduledMessageDraftChanged(arg0) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let channelId;
|
|
|
|
|
let draft;
|
2026-09-18 19:45:33 +00:00
|
|
|
({ channelId, draft } = arg0);
|
|
|
|
|
const id = AuthenticationStore.getId();
|
|
|
|
|
if (null != id) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj;
|
|
|
|
|
let tmp3 = closure_9[id];
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null == tmp3) {
|
2026-10-01 14:13:23 +00:00
|
|
|
obj = {};
|
|
|
|
|
closure_9[id] = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
tmp3 = obj;
|
|
|
|
|
}
|
|
|
|
|
let tmp5 = tmp3[channelId];
|
|
|
|
|
if (null == tmp5) {
|
|
|
|
|
const obj2 = {};
|
|
|
|
|
tmp3[channelId] = obj2;
|
|
|
|
|
tmp5 = obj2;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const ScheduledMessage = obj.ScheduledMessage;
|
|
|
|
|
const obj3 = { timestamp: Date.now() };
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged = Object.assign(tmp5[obj.ScheduledMessage]);
|
|
|
|
|
const merged1 = Object.assign(draft);
|
|
|
|
|
const _Date = Date;
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp5[ScheduledMessage] = obj3;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
},
|
2026-10-01 14:13:23 +00:00
|
|
|
SCHEDULED_MESSAGES_CREATE_SUCCESS: function handleScheduledMessageCreateSuccess(channelId) {
|
|
|
|
|
let obj;
|
|
|
|
|
channelId = channelId.channelId;
|
|
|
|
|
const ScheduledMessage = obj.ScheduledMessage;
|
2026-09-18 19:45:33 +00:00
|
|
|
const id = AuthenticationStore.getId();
|
|
|
|
|
let flag = false;
|
|
|
|
|
if (null != id) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let tmp3 = closure_9[id];
|
|
|
|
|
if (null == tmp3) {
|
|
|
|
|
obj = {};
|
|
|
|
|
closure_9[id] = obj;
|
|
|
|
|
tmp3 = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
flag = false;
|
2026-10-01 14:13:23 +00:00
|
|
|
if (null != tmp3[channelId]) {
|
|
|
|
|
delete tmp3[channelId][ScheduledMessage];
|
|
|
|
|
const obj2 = _modDef12;
|
|
|
|
|
if (obj2.isEmpty(tmp3[channelId])) {
|
|
|
|
|
delete tmp3[channelId];
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
};
|
|
|
|
|
const draftStore = new DraftStore(DispatcherDefault, obj2);
|
2026-09-18 19:45:33 +00:00
|
|
|
const result = size.fileFinishedImporting("stores/DraftStore.tsx");
|
|
|
|
|
|
|
|
|
|
export default draftStore;
|
|
|
|
|
export { DraftType };
|