Files
discord-decomp/modules/gateway/dispatchSocketMessage.tsx
T
2026-11-01 12:12:55 +02:00

3470 lines
93 KiB
TypeScript

// Metro module 12735 (f12736).
import _objectWithoutProperties from "../../_bundle/_objectWithoutProperties";
import { createChannelRecordFromServer } from "../../records/ChannelRecord";
import GuildBoostSlotRecord from "../../records/GuildBoostSlotRecord";
import UserRecord from "../../records/UserRecord";
import ChannelStore, { ChannelLoader } from "../../stores/ChannelStore";
import GuildMemberStore from "../../stores/GuildMemberStore";
import UserStore from "../../stores/UserStore";
import VoiceStateStore from "../../stores/VoiceStateStore";
import SubscriptionPlanStore from "../../stores/billing/SubscriptionPlanStore";
import SubscriptionStore from "../../stores/billing/SubscriptionStore";
import "../../Constants";
import Logger from "../debug/Logger";
import ActionBatcher from "./ActionBatcher";
import { socket, localVoiceState, localPresenceState } from "./GatewaySocketSingleton";
import TTITracker from "../tti_analytics/TTITracker";
import Module589 from "../../_bundle/Module589";
import { hydrateInitialGuild, hydrateReadySupplementalPayload, preloadReadyPayloadData, hydrateReadyPayloadPrioritized, hydratePreviouslyUnavailableGuild } from "../../utils/ReadyPayloadUtils";
import { b64ToPreloadedUserSettingsProto, b64ToProtoWithType } from "../user_settings/UserSettingsUtils";
import timeRequire from "../../_bundle/timeRequire";
import * as _AllGatewayConnectionStores_native from "../app_startup/AllGatewayConnectionStores.native";
import Dispatcher from "../../Dispatcher";
import Module12 from "../../_bundle/Module12";
import convertServerThreadMember from "../threads/convertServerThreadMember";
import { parseServerUserCollectibles } from "../collectibles/utils/mappers";
import { parseServerDisplayNameStyles } from "../display_name_styles/DisplayNameStylesUtils";
import { savedMessageCreateObjectToClient, savedMessageDeleteObjectToClient } from "../saved_messages/SavedMessagesTypes";
import { ReactionTypes } from "../messages/MessageReactionsTypes";
import { isUserSettingsOpen } from "../user_settings/core/isUserSettingsOpen.native";
import { fetchPaymentSources, fetchSubscriptions } from "../billing/actions/BillingActionCreators";
import { fetchSubscriptionPlansBySKUs } from "../../actions/SubscriptionPlanActionCreators";
import { fetchCurrentUser } from "../../actions/UserActionCreators";
import { fetchBadge } from "../badges/BadgeDirectoryActionCreators";
import { getPurchaseTokenHash } from "../../utils/PurchaseTokenUtils";
import { transformComponents } from "../interaction_components/InteractionComponentUtils";
import { serverGuildRoomToClient } from "../guild_rooms/GuildRoomUtils";
import { parseRoom } from "../haven/HavenUtils";
import { isEqualAvatarDecoration } from "../collectibles/avatar_decorations/AvatarDecorationUtils";
import splitAgeRestrictedActivities from "../presence/splitAgeRestrictedActivities";
function $mk90287($env) {
return (a0) => {
const end = a0.timestamps?.end;
const created_at = a0.created_at;
return end != null ? created_at != null ? {
...a0,
timestamps: {
...a0.timestamps,
isCountDown: end > created_at && a0.type !== $env[16].LISTENING
}
} : a0 : a0;
};
}
function $mk90289($env) {
return (a0) => {
const r1 = $env.$parent;
const r6 = r1[17];
const r4 = $env[0];
r6.error(`dispatchOrResetSocket error during ${r4.type}:`, a0);
(0, r1[0])(r1[3][13]).socket.resetSocketOnDispatchError({
error: a0,
action: r4.type
});
};
}
function $mk90290($env) {
return (a0) => {
if (a0.member != null) {
const r4 = $env[0];
if (r4 != null) {
const member = a0.member;
delete a0["member"];
(0, $env.$parent[25])(r4, a0, member);
}
}
};
}
function $mk90291($env) {
return (a0) => {
let activities = a0.activities;
if (activities == null) {
activities = [];
}
const r1 = {
sessionId: a0.session_id,
lastModified: a0.last_modified,
status: a0.status,
activities: activities.map($mk90287($env)),
hiddenActivities: null,
active: null,
clientInfo: null
};
let hidden_activities = a0.hidden_activities;
if (hidden_activities == null) {
hidden_activities = [];
}
r1.hiddenActivities = hidden_activities;
r1.active = !!a0.active;
r1.clientInfo = a0.client_info;
return r1;
};
}
function $mk90292($env) {
return (a0) => {
const r6 = $env.$parent;
const guildId = $env[0];
const r7 = (0, r6[1])(r6[3][37]);
let activities = a0.activities;
if (activities == null) {
activities = [];
}
let hidden_activities = a0.hidden_activities;
if (hidden_activities == null) {
hidden_activities = [];
}
const r13 = r7(activities, hidden_activities);
return {
user: a0.user,
status: a0.status,
clientStatus: a0.client_status,
activities: r13.activities.map($mk90287(r6)),
hiddenActivities: r13.hiddenActivities,
guildId,
processedAtTimestamp: a0.processed_at_timestamp
};
};
}
let dispatchVoiceStateUpdates, dispatchOrResetSocket, dispatchGuildMemberAdd, dispatchPresence, _excluded, c8774_17, c8774_18, c8774_19, c8774_20, c8774_21, c8774_22;
let env8774 = {};
const defineSimpleDispatch = function defineSimpleDispatch(a0, a1) {
for (const item of a0) {
c8774_22[item] = {
preload: () => null,
dispatch: a1
};
}
};
const definePreloadableDispatch = function definePreloadableDispatch(a0, a1, a2) {
for (const item of a0) {
c8774_22[item] = {
preload: a1,
dispatch: a2
};
}
};
dispatchVoiceStateUpdates = function dispatchVoiceStateUpdates(a0) {
const voiceStates = [];
for (const item of a0) {
if (item.member != null) {
dispatchGuildMemberAdd(item.guild_id, item.member.user, item.member);
}
const selfVideo = item.self_video || false;
const selfStream = item.self_stream || false;
let request_to_speak_timestamp = item.request_to_speak_timestamp;
if (request_to_speak_timestamp == null) {
request_to_speak_timestamp = null;
}
let discoverable = item.discoverable;
if (discoverable == null) {
discoverable = true;
}
voiceStates.push({
userId: item.user_id,
guildId: item.guild_id,
sessionId: item.session_id,
channelId: item.channel_id,
mute: item.mute,
deaf: item.deaf,
selfMute: item.self_mute,
selfDeaf: item.self_deaf,
selfVideo,
suppress: item.suppress,
selfStream,
requestToSpeakTimestamp: request_to_speak_timestamp,
discoverable,
oldChannelId: VoiceStateStore.getUserVoiceChannelId(item.guild_id, item.user_id),
connectedAt: item.connected_at
});
}
dispatchOrResetSocket({
type: "VOICE_STATE_UPDATES",
voiceStates
});
};
dispatchOrResetSocket = function dispatchOrResetSocket(a0) {
let env19991;
const r1 = env19991 = {
$parent: env8774
};
env19991[0] = a0;
Dispatcher.dispatch(a0).catch($mk90289(r1));
};
dispatchGuildMemberAdd = function dispatchGuildMemberAdd(a0, a1, { roles, nick, avatar, avatar_decoration_data, flags, premium_since, pending, joined_at, communication_disabled_until, unusual_dm_activity_until, collectibles, display_name_styles }) {
const member = GuildMemberStore.getMember(a0, a1.id);
const collectibles3 = parseServerUserCollectibles(collectibles);
const styles = parseServerDisplayNameStyles(display_name_styles);
let r35 = member != null && member.nick === nick && member.avatar === avatar && Module12.isEqual(member.roles, roles);
if (r35) {
let avatarDecoration = member.avatarDecoration;
if (avatarDecoration == null) {
avatarDecoration = null;
}
let r45 = avatar_decoration_data;
if (r45 == null) {
r45 = null;
}
r35 = isEqualAvatarDecoration(avatarDecoration, r45);
}
if (r35) {
r35 = member.premiumSince === premium_since;
}
if (r35) {
r35 = member.isPending === pending;
}
if (r35) {
r35 = member.joinedAt === joined_at;
}
if (r35) {
r35 = member.communicationDisabledUntil === communication_disabled_until;
}
if (r35) {
r35 = member.flags === flags;
}
if (r35) {
let unusualDMActivityUntil = member.unusualDMActivityUntil;
if (unusualDMActivityUntil == null) {
unusualDMActivityUntil = null;
}
let r52 = unusual_dm_activity_until;
if (r52 == null) {
r52 = null;
}
r35 = unusualDMActivityUntil === r52;
}
if (r35) {
let collectibles2 = member.collectibles;
if (collectibles2 == null) {
collectibles2 = null;
}
let r58 = collectibles3;
if (r58 == null) {
r58 = null;
}
r35 = Module12.isEqual(collectibles2, r58);
}
if (r35) {
let displayNameStyles = member.displayNameStyles;
if (displayNameStyles == null) {
displayNameStyles = null;
}
let r64 = styles;
if (r64 == null) {
r64 = null;
}
r35 = Module12.isEqual(displayNameStyles, r64);
}
if (!r35) {
let env19992;
const r65 = {
type: "GUILD_MEMBER_ADD",
guildId: a0,
user: a1,
roles,
nick,
avatar,
avatarDecoration: avatar_decoration_data,
premiumSince: premium_since,
isPending: pending,
joinedAt: joined_at,
communicationDisabledUntil: communication_disabled_until,
unusualDMActivityUntil: unusual_dm_activity_until,
flags,
collectibles: collectibles3,
displayNameStyles: styles
};
const r66 = env19992 = {
$parent: env8774
};
env19992[0] = r65;
Dispatcher.dispatch(r65).catch($mk90289(r66));
}
};
dispatchPresence = function dispatchPresence(a0) {
c8774_21.add(a0);
};
_excluded = ["newly_created"];
c8774_17 = new Logger("ConnectionStore");
c8774_18 = new ActionBatcher(socket, (a0, a1) => {
const r3 = a0 == null ? {
type: "CHANNEL_UPDATES",
channels: []
} : a0;
const r7 = (0, createChannelRecordFromServer)(a1);
const channel = ChannelStore.getChannel(a1.id);
const r2 = channel == null;
let r18 = void 0;
if (!r2) {
let bitrate = r7.bitrate;
if (bitrate == null) {
bitrate = channel.bitrate;
}
r18 = channel.merge({
...r7,
recipients: channel.recipients,
bitrate
});
}
const channels = r3.channels;
if (r18 == null) {
r18 = r7;
}
channels.push(r18);
return r3;
}, (a0) => a0 !== "CHANNEL_UPDATE");
c8774_19 = new ActionBatcher(socket, (a0, a1) => {
let r1 = a0;
if (a0 == null) {
r1 = {
type: "SOUNDBOARD_SOUNDS_RECEIVED",
updates: []
};
}
r1.updates.push({
guildId: a1.guild_id,
sounds: a1.soundboard_sounds.map((soundboard_sound) => ({
name: soundboard_sound.name,
soundId: soundboard_sound.sound_id,
emojiName: soundboard_sound.emoji_name,
emojiId: soundboard_sound.emoji_id,
userId: soundboard_sound.user_id,
volume: soundboard_sound.volume,
available: soundboard_sound.available,
guildId: a1.guild_id
}))
});
return r1;
}, (a0) => a0 !== "SOUNDBOARD_SOUNDS");
c8774_20 = new ActionBatcher(socket, (a0, a1) => {
const r1 = a0 == null ? {
type: "GUILD_MEMBERS_CHUNK_BATCH",
chunks: []
} : a0;
r1.chunks.push(a1);
return r1;
}, (a0) => a0 !== "GUILD_MEMBERS_CHUNK");
c8774_21 = new ActionBatcher(socket, (a0, a1) => {
const r1 = a0 == null ? {
type: "PRESENCE_UPDATES",
updates: []
} : a0;
r1.updates.push(a1);
return r1;
}, (a0) => a0 !== "PRESENCE_UPDATE" && a0 !== "GUILD_MEMBERS_CHUNK");
c8774_22 = {};
definePreloadableDispatch(["INITIAL_GUILD"], (a0) => a0.data_mode !== "full" ? ChannelLoader.loadGuildIds([a0.id]) : null, (c19994_0) => {
TTITracker.initialGuild.measure(() => {
Module589.Emitter.batched(() => {
const r3 = env8774;
const guild = hydrateInitialGuild(c19994_0, socket.identifyStartTime);
let c30573_0 = guild;
if (UserStore.getCurrentUser() != null) {
let env30574;
let env30575;
const r11 = {
type: "GUILD_CREATE",
guild
};
const r22 = env30574 = {
$parent: r3
};
env30574[0] = r11;
Dispatcher.dispatch(r11).catch($mk90289(r22));
const r34 = {
type: "VOICE_STATE_UPDATES",
voiceStates: guild.voice_states.map((voice_state) => {
const selfVideo = voice_state.self_video || false;
const selfStream = voice_state.self_stream || false;
let request_to_speak_timestamp = voice_state.request_to_speak_timestamp;
if (request_to_speak_timestamp == null) {
request_to_speak_timestamp = null;
}
let discoverable = voice_state.discoverable;
if (discoverable == null) {
discoverable = true;
}
return {
userId: voice_state.user_id,
guildId: c30573_0.id,
sessionId: voice_state.session_id,
channelId: voice_state.channel_id,
mute: voice_state.mute,
deaf: voice_state.deaf,
selfMute: voice_state.self_mute,
selfDeaf: voice_state.self_deaf,
selfVideo,
suppress: voice_state.suppress,
selfStream,
requestToSpeakTimestamp: request_to_speak_timestamp,
discoverable,
connectedAt: voice_state.connected_at
};
})
};
const r35 = env30575 = {
$parent: r3
};
env30575[0] = r34;
Dispatcher.dispatch(r34).catch($mk90289(r35));
c8774_17.log(`Dispatched INITIAL_GUILD ${c19994_0.id}`);
}
});
});
});
defineSimpleDispatch(["READY_SUPPLEMENTAL"], (c19995_0) => {
TTITracker.readySupplemental.measure(() => {
Module589.Emitter.batched(() => {
let guilds, presences, lazyPrivateChannels, c30576_3;
const r3 = env8774;
const r13 = TTITracker.hydrateReadySupplemental.measure(() => hydrateReadySupplementalPayload(c19995_0, socket.identifyStartTime));
c19995_0 = r13;
guilds = r13.guilds.filter((guild) => guild.unavailable !== true);
guilds.forEach((guild) => {
const r4 = guild.presences || [];
let env31662;
const id = guild.id;
const r1 = env31662 = {
$parent: env8774
};
env31662[0] = id;
guild.presences = r4.map($mk90292(r1));
});
let presences2 = c19995_0.presences;
if (presences2 == null) {
presences2 = [];
}
let env30577;
const map = presences2.map;
const r23 = env30577 = {
$parent: r3
};
presences = map.call(presences2, $mk90292(r23));
let lazy_private_channels = c19995_0.lazy_private_channels;
if (lazy_private_channels == null) {
lazy_private_channels = [];
}
let env30578;
lazyPrivateChannels = lazy_private_channels.map((lazy_private_channel) => (0, createChannelRecordFromServer)(lazy_private_channel));
TTITracker.dispatchReadySupplemental.measure(() => {
let env31663;
const r2 = env8774;
const r4 = {
type: "CONNECTION_OPEN_SUPPLEMENTAL",
guilds,
presences,
lazyPrivateChannels
};
const r7 = env31663 = {
$parent: r2
};
env31663[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
const voiceStates = [];
c30576_3 = voiceStates;
guilds.forEach((guild) => {
guild.voice_states.forEach((voice_state) => {
const selfVideo = voice_state.self_video || false;
const selfStream = voice_state.self_stream || false;
let request_to_speak_timestamp = voice_state.request_to_speak_timestamp;
if (request_to_speak_timestamp == null) {
request_to_speak_timestamp = null;
}
let discoverable = voice_state.discoverable;
if (discoverable == null) {
discoverable = true;
}
c30576_3.push({
userId: voice_state.user_id,
guildId: guild.id,
sessionId: voice_state.session_id,
channelId: voice_state.channel_id,
mute: voice_state.mute,
deaf: voice_state.deaf,
selfMute: voice_state.self_mute,
selfDeaf: voice_state.self_deaf,
selfVideo,
suppress: voice_state.suppress,
selfStream,
requestToSpeakTimestamp: request_to_speak_timestamp,
discoverable,
connectedAt: voice_state.connected_at
});
});
});
const r41 = {
type: "VOICE_STATE_UPDATES",
voiceStates,
initial: true
};
const r42 = env30578 = {
$parent: r3
};
env30578[0] = r41;
Dispatcher.dispatch(r41).catch($mk90289(r42));
localVoiceState.update();
});
});
setTimeout(() => {
let env27355;
const r4 = {
type: "POST_CONNECTION_OPEN"
};
const r1 = env27355 = {
$parent: env8774
};
env27355[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r1));
}, 2000);
});
definePreloadableDispatch(["READY"], (a0) => {
const r6 = preloadReadyPayloadData();
let r19 = ChannelLoader.loadGuildIds(a0.guilds.filter((guild) => {
const unavailable = guild.unavailable;
let r2 = !unavailable;
if (!unavailable) {
let r3 = guild.data_mode === "partial";
if (r3) {
let channels = guild.partial_updates.channels;
if (channels == null) {
channels = [];
}
let r1 = channels.length > 0;
if (!r1) {
let deleted_channel_ids = guild.partial_updates.deleted_channel_ids;
if (deleted_channel_ids == null) {
deleted_channel_ids = [];
}
r1 = deleted_channel_ids.length > 0;
}
if (!r1) {
r1 = void 0;
}
r3 = r1;
}
r2 = r3;
}
return r2;
}).map((item) => item.id));
if (r19 == null) {
r19 = Promise.resolve();
}
return Promise.all([r6, r19]).then((result) => {
const [r8] = result;
return r8;
});
}, (a0, a1, c19996_1) => {
let c19996_0 = a0;
if (a0.user.bot) {
let env19997;
const r15 = {
type: "LOGOUT"
};
const r16 = env19997 = {
$parent: env8774
};
env19997[0] = r15;
Dispatcher.dispatch(r15).catch($mk90289(r16));
} else {
TTITracker.ready.measure(() => {
Module589.Emitter.batched(() => {
let initialPrivateChannels, unavailableGuilds, guilds2, geoRestrictedGuilds, userSettingsProto;
const r4 = env8774;
const r14 = TTITracker.hydrateReady.measure(() => hydrateReadyPayloadPrioritized(c19996_0, socket.identifyStartTime, c19996_1));
c19996_0 = r14;
initialPrivateChannels = r14.private_channels.map((private_channel) => (0, createChannelRecordFromServer)(private_channel));
unavailableGuilds = c19996_0.guilds.filter((guild) => guild.unavailable === true && guild.geo_restricted !== true).map((item) => item.id);
guilds2 = c19996_0.guilds.filter((guild) => guild.unavailable !== true);
geoRestrictedGuilds = c19996_0.guilds.filter((guild) => guild.geo_restricted === true);
userSettingsProto = c19996_0.user_settings_proto == null ? void 0 : b64ToPreloadedUserSettingsProto(c19996_0.user_settings_proto);
timeRequire("AllGatewayConnectionStores", () => _AllGatewayConnectionStores_native);
TTITracker.dispatchReady.measure(() => {
let relationships = c19996_0.relationships;
if (relationships == null) {
relationships = [];
}
let apex_experiments = c19996_0.apex_experiments;
if (apex_experiments == null) {
apex_experiments = void 0;
}
let sessions = c19996_0.sessions;
if (sessions == null) {
sessions = [];
}
const r48 = env8774;
const r5 = {
type: "CONNECTION_OPEN",
sessionId: c19996_0.session_id,
authSessionIdHash: c19996_0.auth_session_id_hash,
staticAuthSessionId: c19996_0.static_client_session_id,
user: c19996_0.user,
users: c19996_0.users,
guilds: guilds2,
initialPrivateChannels,
unavailableGuilds,
readState: c19996_0.read_state,
userGuildSettings: c19996_0.user_guild_settings,
tutorial: c19996_0.tutorial,
relationships,
gameRelationships: c19996_0.game_relationships,
friendSuggestionCount: c19996_0.friend_suggestion_count,
analyticsToken: c19996_0.analytics_token,
experiments: c19996_0.experiments,
connectedAccounts: c19996_0.connected_accounts,
guildExperiments: c19996_0.guild_experiments,
apexExperiments: apex_experiments,
requiredAction: c19996_0.required_action,
consents: c19996_0.consents,
sessions: sessions.map($mk90291(r48)),
pendingPayments: c19996_0.pending_payments,
countryCode: null,
guildJoinRequests: null,
userSettingsProto: null,
apiCodeVersion: null,
auth: null,
notificationSettings: null,
geoRestrictedGuilds: null,
explicitContentScanVersion: null,
failedStates: null,
linkedUsers: null,
regionalFeatureConfig: null
};
let country_code = c19996_0.country_code;
if (country_code == null) {
country_code = void 0;
}
r5.countryCode = country_code;
let guild_join_requests = c19996_0.guild_join_requests;
if (guild_join_requests == null) {
guild_join_requests = [];
}
r5.guildJoinRequests = guild_join_requests;
r5.userSettingsProto = userSettingsProto;
r5.apiCodeVersion = c19996_0.api_code_version;
r5.auth = c19996_0.auth;
r5.notificationSettings = {
flags: c19996_0.notification_settings.flags
};
r5.geoRestrictedGuilds = geoRestrictedGuilds;
r5.explicitContentScanVersion = c19996_0.explicit_content_scan_version;
r5.failedStates = c19996_0.failed_states;
let linked_users = c19996_0.linked_users;
if (linked_users == null) {
linked_users = void 0;
}
r5.linkedUsers = linked_users;
let regional_feature_config = c19996_0.regional_feature_config;
if (regional_feature_config == null) {
regional_feature_config = void 0;
}
let env31665;
r5.regionalFeatureConfig = regional_feature_config;
const r74 = env31665 = {
$parent: r48
};
env31665[0] = r5;
Dispatcher.dispatch(r5).catch($mk90289(r74));
});
if (c19996_0.auth_token != null) {
let env30580;
const r60 = {
type: "UPDATE_TOKEN",
token: c19996_0.auth_token,
userId: c19996_0.user.id
};
const r64 = env30580 = {
$parent: r4
};
env30580[0] = r60;
Dispatcher.dispatch(r60).catch($mk90289(r64));
}
if (c19996_0.ad_personalization_toggles_disabled != null) {
let env30581;
const r76 = {
type: "AD_PERSONALIZATION_TOGGLES_RESTRICTED",
disabled: c19996_0.ad_personalization_toggles_disabled
};
const r77 = env30581 = {
$parent: r4
};
env30581[0] = r76;
Dispatcher.dispatch(r76).catch($mk90289(r77));
}
localPresenceState.update();
localVoiceState.update();
});
});
}
});
defineSimpleDispatch(["STATE_UPDATE"], ({ apex_experiments }) => {
if (apex_experiments == null) {
apex_experiments = void 0;
}
let env19998;
const r4 = {
type: "CONNECTION_OPEN_STATE_UPDATE",
apexExperiments: apex_experiments
};
const r6 = env19998 = {
$parent: env8774
};
env19998[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["EXPERIMENT_SESSION_OVERRIDE_CREATE"], (a0) => {
Dispatcher.dispatch({
type: "APEX_EXPERIMENT_SESSION_OVERRIDE_CREATE",
experimentName: a0.experiment_name,
variantId: a0.variant_id
});
});
defineSimpleDispatch(["EXPERIMENT_SESSION_OVERRIDE_DELETE"], (a0) => {
Dispatcher.dispatch({
type: "APEX_EXPERIMENT_SESSION_OVERRIDE_DELETE",
experimentName: a0.experiment_name
});
});
defineSimpleDispatch(["RESUMED"], () => {
let env19999;
localPresenceState.forceUpdate();
localVoiceState.forceUpdate();
const r14 = {
type: "CONNECTION_RESUMED"
};
const r15 = env19999 = {
$parent: env8774
};
env19999[0] = r14;
Dispatcher.dispatch(r14).catch($mk90289(r15));
});
defineSimpleDispatch(["TYPING_START"], (a0) => {
if (a0.member != null) {
dispatchGuildMemberAdd(a0.guild_id, a0.member.user, a0.member);
}
let env20000;
const r12 = {
type: "TYPING_START",
guildId: a0.guild_id,
channelId: a0.channel_id,
userId: a0.user_id
};
const r15 = env20000 = {
$parent: env8774
};
env20000[0] = r12;
Dispatcher.dispatch(r12).catch($mk90289(r15));
});
defineSimpleDispatch(["GUILD_RING_START"], (a0) => {
let env20001;
const r4 = {
type: "GUILD_RING_START",
ongoingRings: a0.ongoing_rings,
channelId: a0.channel_id,
guildId: a0.guild_id
};
const r7 = env20001 = {
$parent: env8774
};
env20001[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GUILD_RING_STOP"], (a0) => {
let env20002;
const r4 = {
type: "GUILD_RING_STOP",
ringing: a0.ringing,
channelId: a0.channel_id,
guildId: a0.guild_id
};
const r7 = env20002 = {
$parent: env8774
};
env20002[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["ACTIVITY_START"], (a0) => {
let env20003;
const r4 = {
type: "ACTIVITY_START",
userId: a0.user_id,
activity: a0.activity
};
const r6 = env20003 = {
$parent: env8774
};
env20003[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["ACTIVITY_USER_ACTION"], (a0) => {
let env20004;
const r4 = {
type: "ACTIVITY_USER_ACTION",
actionType: a0.action_type,
user: a0.user,
applicationId: a0.application_id,
channelId: a0.channel_id,
messageId: a0.message_id
};
const r9 = env20004 = {
$parent: env8774
};
env20004[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r9));
});
definePreloadableDispatch(["MESSAGE_CREATE"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
let env20005;
const r6 = env20005 = {
$parent: env8774
};
const { member, mentions, author, guild_id } = a0;
env20005[0] = guild_id;
if (member != null && guild_id != null) {
dispatchGuildMemberAdd(guild_id, author, member);
}
if (mentions != null) {
mentions.forEach($mk90290(r6));
}
if (a0.author != null) {
let env20006;
const r18 = {
type: "MESSAGE_CREATE",
guildId: a0.guild_id,
channelId: a0.channel_id,
message: a0,
optimistic: false,
isPushNotification: false
};
const r20 = env20006 = {
$parent: env8774
};
env20006[0] = r18;
Dispatcher.dispatch(r18).catch($mk90289(r20));
}
});
definePreloadableDispatch(["MESSAGE_UPDATE"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
let env20007;
const r6 = env20007 = {
$parent: env8774
};
const { member, mentions, author, guild_id } = a0;
env20007[0] = guild_id;
if (member != null && guild_id != null) {
dispatchGuildMemberAdd(guild_id, author, member);
}
if (mentions != null) {
mentions.forEach($mk90290(r6));
}
let env20008;
const r17 = {
type: "MESSAGE_UPDATE",
guildId: a0.guild_id,
message: a0
};
const r18 = env20008 = {
$parent: env8774
};
env20008[0] = r17;
Dispatcher.dispatch(r17).catch($mk90289(r18));
});
definePreloadableDispatch(["MESSAGE_DELETE"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
let env20009;
const r4 = {
type: "MESSAGE_DELETE",
guildId: a0.guild_id,
id: a0.id,
channelId: a0.channel_id
};
const r7 = env20009 = {
$parent: env8774
};
env20009[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
definePreloadableDispatch(["MESSAGE_DELETE_BULK"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
let env20010;
const r4 = {
type: "MESSAGE_DELETE_BULK",
guildId: a0.guild_id,
ids: a0.ids,
channelId: a0.channel_id
};
const r7 = env20010 = {
$parent: env8774
};
env20010[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
definePreloadableDispatch(["MESSAGE_ACK"], (a0) => ChannelLoader.loadGuildFromChannelId(a0.channel_id), (a0) => {
let env20011;
const r4 = {
type: "MESSAGE_ACK",
channelId: a0.channel_id,
messageId: a0.message_id,
manual: a0.manual,
newMentionCount: a0.mention_count,
version: a0.version
};
const r9 = env20011 = {
$parent: env8774
};
env20011[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r9));
});
defineSimpleDispatch(["GUILD_FEATURE_ACK"], (a0) => {
let env20012;
const r4 = {
type: "GUILD_FEATURE_ACK",
id: a0.resource_id,
ackType: a0.ack_type,
ackedId: a0.entity_id
};
const r7 = env20012 = {
$parent: env8774
};
env20012[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["USER_NON_CHANNEL_ACK"], (a0) => {
let env20013;
const r4 = {
type: "USER_NON_CHANNEL_ACK",
ackType: a0.ack_type,
ackedId: a0.entity_id
};
const r6 = env20013 = {
$parent: env8774
};
env20013[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
definePreloadableDispatch(["CHANNEL_PINS_ACK"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
let env20014;
const r4 = {
type: "CHANNEL_PINS_ACK",
channelId: a0.channel_id,
timestamp: a0.timestamp,
version: a0.version
};
const r7 = env20014 = {
$parent: env8774
};
env20014[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
definePreloadableDispatch(["CHANNEL_PINS_UPDATE"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
let env20015;
const r4 = {
type: "CHANNEL_PINS_UPDATE",
channelId: a0.channel_id,
lastPinTimestamp: a0.last_pin_timestamp
};
const r6 = env20015 = {
$parent: env8774
};
env20015[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
definePreloadableDispatch(["CHANNEL_CREATE", "CHANNEL_DELETE"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0, a1) => {
let env20016;
const r4 = {
type: a1,
channel: (0, createChannelRecordFromServer)(a0)
};
const r7 = env20016 = {
$parent: env8774
};
env20016[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["VOICE_CHANNEL_STATUS_UPDATE"], (a0, a1) => {
let env20017;
const r4 = {
type: a1,
id: a0.id,
guildId: a0.guild_id,
status: a0.status
};
const r8 = env20017 = {
$parent: env8774
};
env20017[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r8));
});
defineSimpleDispatch(["VOICE_CHANNEL_START_TIME_UPDATE"], (a0, a1) => {
let voice_start_time = a0.voice_start_time;
if (voice_start_time == null) {
voice_start_time = void 0;
}
let env20018;
const r4 = {
type: a1,
id: a0.id,
guildId: a0.guild_id,
voiceStartTime: voice_start_time
};
const r9 = env20018 = {
$parent: env8774
};
env20018[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r9));
});
defineSimpleDispatch(["CHANNEL_INFO"], (a0, a1) => {
let env20019;
const r4 = {
type: a1,
guildId: a0.guild_id,
channels: a0.channels.map((channel) => ({
id: channel.id,
status: channel.status,
voiceStartTime: channel.voice_start_time
}))
};
const r10 = env20019 = {
$parent: env8774
};
env20019[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r10));
});
defineSimpleDispatch(["CHANNEL_MEMBER_COUNT_UPDATE"], (a0, a1) => {
let env20020;
const r4 = {
type: a1,
guildId: a0.guild_id,
channelId: a0.channel_id,
online: a0.presence_count,
total: a0.member_count
};
const r9 = env20020 = {
$parent: env8774
};
env20020[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r9));
});
definePreloadableDispatch(["CHANNEL_UPDATE"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
c8774_18.add(a0);
});
definePreloadableDispatch(["THREAD_CREATE", "THREAD_UPDATE", "THREAD_DELETE"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0, a1) => {
let env20021;
const r8 = {
type: a1,
isNewlyCreated: a0.newly_created,
channel: (0, createChannelRecordFromServer)(_objectWithoutProperties(a0, _excluded))
};
const r11 = env20021 = {
$parent: env8774
};
env20021[0] = r8;
Dispatcher.dispatch(r8).catch($mk90289(r11));
});
definePreloadableDispatch(["THREAD_LIST_SYNC"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
const r4 = {
type: "THREAD_LIST_SYNC",
guildId: a0.guild_id,
threads: a0.threads.map((thread) => {
const channel = ChannelStore.getChannel(thread.parent_id);
if (channel != null) {
thread.nsfw = channel.nsfw;
thread.parentChannelThreadType = channel.type;
}
return (0, createChannelRecordFromServer)(thread);
}),
mostRecentMessages: a0.most_recent_messages,
members: null,
channelIds: null
};
const members = a0.members ? Module12.map(a0.members, convertServerThreadMember) : void 0;
let env20022;
r4.members = members;
r4.channelIds = a0.channel_ids;
const r21 = env20022 = {
$parent: env8774
};
env20022[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r21));
});
defineSimpleDispatch(["THREAD_MEMBER_UPDATE"], (a0) => {
let env20023;
const r4 = {
type: "THREAD_MEMBER_UPDATE",
id: a0.id,
guildId: a0.guild_id,
userId: a0.user_id,
flags: a0.flags,
muted: a0.muted,
muteConfig: a0.mute_config,
joinTimestamp: a0.join_timestamp
};
const r11 = env20023 = {
$parent: env8774
};
env20023[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r11));
});
defineSimpleDispatch(["THREAD_MEMBERS_UPDATE"], (a0) => {
const added_members = a0.added_members;
const addedMembers = added_members == null ? void 0 : added_members.map((added_member) => ({
id: added_member.id,
guildId: a0.guild_id,
userId: added_member.user_id,
flags: added_member.flags,
joinTimestamp: added_member.join_timestamp
}));
let env20025;
const r5 = {
type: "THREAD_MEMBERS_UPDATE",
id: a0.id,
guildId: a0.guild_id,
memberCount: a0.member_count,
addedMembers,
removedMemberIds: a0.removed_member_ids,
memberIdsPreview: a0.member_ids_preview
};
const r16 = env20025 = {
$parent: env8774
};
env20025[0] = r5;
Dispatcher.dispatch(r5).catch($mk90289(r16));
});
defineSimpleDispatch(["FORUM_UNREADS"], (a0) => {
if (!a0.permission_denied) {
let env20026;
const r4 = {
type: "FORUM_UNREADS",
channelId: a0.channel_id,
threads: a0.threads.map((thread) => ({
threadId: thread.thread_id,
missing: thread.missing,
count: thread.count
}))
};
const r10 = env20026 = {
$parent: env8774
};
env20026[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r10));
}
});
defineSimpleDispatch(["SOUNDBOARD_SOUNDS"], (a0) => {
c8774_19.add(a0);
});
defineSimpleDispatch(["CHANNEL_RECIPIENT_ADD", "CHANNEL_RECIPIENT_REMOVE"], (a0, a1) => {
let env20027;
const r9 = {
type: a1,
channelId: a0.channel_id,
user: a0.user,
nick: a0.nick,
isMember: ChannelStore.getBasicChannel(a0.channel_id) != null
};
const r13 = env20027 = {
$parent: env8774
};
env20027[0] = r9;
Dispatcher.dispatch(r9).catch($mk90289(r13));
});
definePreloadableDispatch(["GUILD_CREATE"], (a0) => a0.data_mode !== "full" ? ChannelLoader.loadGuildIds([a0.id]) : null, (a0) => {
if (a0.unavailable) {
let env20031;
const r35 = {
type: "GUILD_UNAVAILABLE",
guildId: a0.id
};
const r36 = env20031 = {
$parent: env8774
};
env20031[0] = r35;
Dispatcher.dispatch(r35).catch($mk90289(r36));
} else {
let env20029;
let env20030;
const guild = hydratePreviouslyUnavailableGuild(a0);
let c20028_0 = guild;
const r10 = {
type: "GUILD_CREATE",
guild
};
const r14 = env20029 = {
$parent: env8774
};
env20029[0] = r10;
Dispatcher.dispatch(r10).catch($mk90289(r14));
const r25 = {
type: "VOICE_STATE_UPDATES",
voiceStates: guild.voice_states.map((voice_state) => {
const selfVideo = voice_state.self_video || false;
const selfStream = voice_state.self_stream || false;
let request_to_speak_timestamp = voice_state.request_to_speak_timestamp;
if (request_to_speak_timestamp == null) {
request_to_speak_timestamp = null;
}
let discoverable = voice_state.discoverable;
if (discoverable == null) {
discoverable = true;
}
return {
userId: voice_state.user_id,
guildId: c20028_0.id,
sessionId: voice_state.session_id,
channelId: voice_state.channel_id,
mute: voice_state.mute,
deaf: voice_state.deaf,
selfMute: voice_state.self_mute,
selfDeaf: voice_state.self_deaf,
selfVideo,
suppress: voice_state.suppress,
selfStream,
requestToSpeakTimestamp: request_to_speak_timestamp,
discoverable,
connectedAt: voice_state.connected_at
};
})
};
const r26 = env20030 = {
$parent: env8774
};
env20030[0] = r25;
Dispatcher.dispatch(r25).catch($mk90289(r26));
}
});
defineSimpleDispatch(["GUILD_UPDATE"], (a0) => {
let env20032;
const r7 = {
type: "GUILD_UPDATE",
guild: a0
};
const r4 = env20032 = {
$parent: env8774
};
env20032[0] = r7;
Dispatcher.dispatch(r7).catch($mk90289(r4));
if (a0.unavailable) {
let env20033;
const r16 = {
type: "GUILD_UNAVAILABLE",
guildId: a0.id
};
const r17 = env20033 = {
$parent: env8774
};
env20033[0] = r16;
Dispatcher.dispatch(r16).catch($mk90289(r17));
}
});
defineSimpleDispatch(["GUILD_PRUNE_UPDATE"], (a0) => {
let env20034;
const r4 = {
type: "GUILD_PRUNE_UPDATE",
guildId: a0.guild_id,
prune: {
isPreview: a0.prune.is_preview,
isFinished: a0.prune.is_finished,
days: a0.prune.days,
pruneCount: a0.prune.prune_count,
includeRoles: a0.prune.include_roles
}
};
const r16 = env20034 = {
$parent: env8774
};
env20034[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r16));
});
defineSimpleDispatch(["GUILD_BULK_BAN_UPDATE"], (a0) => {
let bannedUsers = a0.bulk_ban?.banned_users;
if (bannedUsers == null) {
bannedUsers = [];
}
let failedUsers = a0.bulk_ban?.failed_users;
if (failedUsers == null) {
failedUsers = [];
}
let env20035;
const r6 = {
type: "GUILD_BULK_BAN_UPDATE",
guildId: a0.guild_id,
bulkBan: {
bannedUsers,
failedUsers
}
};
const r13 = env20035 = {
$parent: env8774
};
env20035[0] = r6;
Dispatcher.dispatch(r6).catch($mk90289(r13));
});
defineSimpleDispatch(["GUILD_DELETE"], (a0) => {
let env20036;
const r7 = {
type: "GUILD_DELETE",
guild: a0
};
const r4 = env20036 = {
$parent: env8774
};
env20036[0] = r7;
Dispatcher.dispatch(r7).catch($mk90289(r4));
if (a0.geo_restricted) {
let env20038;
const r27 = {
type: "GUILD_GEO_RESTRICTED",
guildId: a0.id,
icon: a0.icon,
name: a0.name
};
const r30 = env20038 = {
$parent: env8774
};
env20038[0] = r27;
Dispatcher.dispatch(r27).catch($mk90289(r30));
} else if (a0.unavailable) {
let env20037;
const r17 = {
type: "GUILD_UNAVAILABLE",
guildId: a0.id
};
const r18 = env20037 = {
$parent: env8774
};
env20037[0] = r17;
Dispatcher.dispatch(r17).catch($mk90289(r18));
}
});
defineSimpleDispatch(["GUILD_MEMBERS_CHUNK"], (c20039_0) => {
Module589.Emitter.batched(() => {
const r1 = env8774;
c8774_20.add({
guildId: c20039_0.guild_id,
members: c20039_0.members,
notFound: c20039_0.not_found
});
if (c20039_0.presences != null) {
let env27356;
const { presences: presences2, guild_id } = c20039_0;
const r14 = env27356 = {
$parent: r1
};
env27356[0] = guild_id;
presences2.map($mk90292(r14)).forEach(dispatchPresence);
}
ActionBatcher.flush("GUILD_MEMBERS_CHUNK");
});
});
defineSimpleDispatch(["THREAD_MEMBER_LIST_UPDATE"], (c20040_0) => {
Module589.Emitter.batched(() => {
let env27357;
const r4 = env8774;
const r9 = {
type: "THREAD_MEMBER_LIST_UPDATE",
guildId: c20040_0.guild_id,
threadId: c20040_0.thread_id,
members: c20040_0.members
};
const r6 = env27357 = {
$parent: r4
};
env27357[0] = r9;
Dispatcher.dispatch(r9).catch($mk90289(r6));
if (c20040_0.presences != null) {
let env27358;
const { presences: presences2, guild_id } = c20040_0;
const r22 = env27358 = {
$parent: r4
};
env27358[0] = guild_id;
presences2.map($mk90292(r22)).forEach(dispatchPresence);
}
ActionBatcher.flush();
});
});
defineSimpleDispatch(["GUILD_BAN_ADD", "GUILD_BAN_REMOVE", "GUILD_MEMBER_ADD", "GUILD_MEMBER_UPDATE", "GUILD_MEMBER_REMOVE"], (a0, a1) => {
let env20041;
const r4 = {
type: a1,
guildId: a0.guild_id,
user: a0.user,
avatar: a0.avatar,
avatarDecoration: a0.avatar_decoration_data,
roles: a0.roles,
nick: a0.nick,
premiumSince: a0.premium_since,
isPending: a0.pending,
joinedAt: a0.joined_at,
communicationDisabledUntil: a0.communication_disabled_until,
unusualDMActivityUntil: a0.unusual_dm_activity_until,
flags: a0.flags,
collectibles: parseServerUserCollectibles(a0.collectibles),
displayNameStyles: parseServerDisplayNameStyles(a0.display_name_styles)
};
const r29 = env20041 = {
$parent: env8774
};
env20041[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r29));
});
definePreloadableDispatch(["GUILD_ROLE_CREATE", "GUILD_ROLE_UPDATE"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0, a1) => {
let env20042;
const r4 = {
type: a1,
guildId: a0.guild_id,
role: a0.role
};
const r7 = env20042 = {
$parent: env8774
};
env20042[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
definePreloadableDispatch(["GUILD_ROLE_DELETE"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
let env20043;
const r4 = {
type: "GUILD_ROLE_DELETE",
guildId: a0.guild_id,
roleId: a0.role_id,
version: a0.version
};
const r7 = env20043 = {
$parent: env8774
};
env20043[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GUILD_EMOJIS_UPDATE"], (a0) => {
let env20044;
const r4 = {
type: "GUILD_EMOJIS_UPDATE",
guildId: a0.guild_id,
emojis: a0.emojis
};
const r6 = env20044 = {
$parent: env8774
};
env20044[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["GUILD_STICKERS_UPDATE"], (a0) => {
let env20045;
const r4 = {
type: "GUILD_STICKERS_UPDATE",
guildId: a0.guild_id,
stickers: a0.stickers
};
const r6 = env20045 = {
$parent: env8774
};
env20045[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["GUILD_INTEGRATIONS_UPDATE"], (a0) => {
let env20046;
const r4 = {
type: "GUILD_INTEGRATIONS_UPDATE",
guildId: a0.guild_id
};
const r6 = env20046 = {
$parent: env8774
};
env20046[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["INTEGRATION_CREATE"], (a0) => {
let env20047;
const r4 = {
type: "INTEGRATION_CREATE",
application: a0.application,
guildId: a0.guild_id
};
const r6 = env20047 = {
$parent: env8774
};
env20047[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["INTEGRATION_DELETE"], (a0) => {
let env20048;
const r4 = {
type: "INTEGRATION_DELETE",
applicationId: a0.application_id,
guildId: a0.guild_id
};
const r6 = env20048 = {
$parent: env8774
};
env20048[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["USER_UPDATE"], (a0) => {
let env20049;
const r4 = {
type: "CURRENT_USER_UPDATE",
user: a0
};
const r5 = env20049 = {
$parent: env8774
};
env20049[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["USER_SETTINGS_PROTO_UPDATE"], (a0) => {
const proto = b64ToProtoWithType(a0.settings.type, a0.settings.proto);
if (proto != null) {
if (typeof proto === "string") {
throw Error("UserSettingsProto must not be a string");
}
let env20050;
const r18 = {
type: "USER_SETTINGS_PROTO_UPDATE",
settings: {
proto,
type: a0.settings.type
},
partial: a0.partial
};
const r19 = env20050 = {
$parent: env8774
};
env20050[0] = r18;
Dispatcher.dispatch(r18).catch($mk90289(r19));
}
});
defineSimpleDispatch(["USER_GUILD_SETTINGS_UPDATE"], (a0) => {
let env20051;
const r4 = {
type: "USER_GUILD_SETTINGS_FULL_UPDATE",
userGuildSettings: [a0]
};
const r5 = env20051 = {
$parent: env8774
};
env20051[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["USER_CONNECTIONS_UPDATE"], () => {
let env20052;
const r4 = {
type: "USER_CONNECTIONS_UPDATE"
};
const r1 = env20052 = {
$parent: env8774
};
env20052[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r1));
});
defineSimpleDispatch(["USER_REQUIRED_ACTION_UPDATE"], (a0) => {
let env20053;
const r4 = {
type: "USER_REQUIRED_ACTION_UPDATE",
requiredAction: a0.required_action
};
const r6 = env20053 = {
$parent: env8774
};
env20053[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["USER_NOTE_UPDATE"], (a0) => {
let env20054;
const r4 = {
type: "USER_NOTE_UPDATE",
...a0
};
const r7 = env20054 = {
$parent: env8774
};
env20054[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["RELATIONSHIP_ADD"], (a0) => {
const isSpamRequest = a0.is_spam_request || false;
const isStrangerRequest = a0.is_stranger_request || false;
const userIgnored = a0.user_ignored || false;
let env20055;
const r4 = {
type: "RELATIONSHIP_ADD",
relationship: {
id: a0.id,
type: a0.type,
user: a0.user,
since: a0.since,
nickname: a0.nickname,
isSpamRequest,
isStrangerRequest,
userIgnored,
originApplicationId: a0.origin_application_id,
note: a0.note
},
shouldNotify: a0.should_notify === true
};
const r17 = env20055 = {
$parent: env8774
};
env20055[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r17));
});
defineSimpleDispatch(["RELATIONSHIP_REMOVE"], (a0) => {
let env20056;
const r4 = {
type: "RELATIONSHIP_REMOVE",
relationship: a0
};
const r5 = env20056 = {
$parent: env8774
};
env20056[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["RELATIONSHIP_UPDATE"], (a0) => {
const isSpamRequest = a0.is_spam_request || false;
const isStrangerRequest = a0.is_stranger_request || false;
const userIgnored = a0.user_ignored || false;
let env20057;
const r4 = {
type: "RELATIONSHIP_UPDATE",
relationship: {
id: a0.id,
type: a0.type,
user: a0.user,
nickname: a0.nickname,
since: a0.since,
isSpamRequest,
isStrangerRequest,
userIgnored,
originApplicationId: a0.origin_application_id,
note: a0.note
}
};
const r15 = env20057 = {
$parent: env8774
};
env20057[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r15));
});
defineSimpleDispatch(["GAME_RELATIONSHIP_ADD"], (a0) => {
let env20058;
const r4 = {
type: "GAME_RELATIONSHIP_ADD",
gameRelationship: {
id: a0.id,
applicationId: a0.application_id,
type: a0.type,
since: a0.since,
dmAccessType: a0.dm_access_type,
user: a0.user
}
};
const r11 = env20058 = {
$parent: env8774
};
env20058[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r11));
});
defineSimpleDispatch(["GAME_RELATIONSHIP_REMOVE"], (a0) => {
let env20059;
const r4 = {
type: "GAME_RELATIONSHIP_REMOVE",
userId: a0.id,
applicationId: a0.application_id
};
const r6 = env20059 = {
$parent: env8774
};
env20059[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["PRESENCE_UPDATE"], (a0) => {
const r2 = env8774;
const guild_id = a0.guild_id;
let activities = a0.activities;
if (activities == null) {
activities = [];
}
let hidden_activities = a0.hidden_activities;
if (hidden_activities == null) {
hidden_activities = [];
}
const r13 = splitAgeRestrictedActivities(activities, hidden_activities);
c8774_21.add({
user: a0.user,
status: a0.status,
clientStatus: a0.client_status,
activities: r13.activities.map($mk90287(r2)),
hiddenActivities: r13.hiddenActivities,
guildId: guild_id,
processedAtTimestamp: a0.processed_at_timestamp
});
});
defineSimpleDispatch(["PRESENCES_REPLACE"], (a0) => {
let env20060;
let env20061;
const map = a0.map;
const r1 = env20060 = {
$parent: env8774
};
const r4 = {
type: "PRESENCES_REPLACE",
presences: map.call(a0, $mk90292(r1))
};
const r8 = env20061 = {
$parent: env8774
};
env20061[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r8));
});
defineSimpleDispatch(["SESSIONS_REPLACE"], (a0) => {
let env20062;
const r4 = {
type: "SESSIONS_REPLACE",
sessions: a0.map($mk90291(env8774))
};
const r7 = env20062 = {
$parent: env8774
};
env20062[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["VOICE_STATE_UPDATE"], (a0) => {
dispatchVoiceStateUpdates([a0]);
});
defineSimpleDispatch(["VOICE_STATE_UPDATE_BATCH"], (a0) => {
dispatchVoiceStateUpdates(a0.voice_states);
});
defineSimpleDispatch(["VOICE_SERVER_UPDATE"], (a0) => {
let env20063;
const r4 = {
type: "VOICE_SERVER_UPDATE",
guildId: a0.guild_id,
channelId: a0.channel_id,
endpoint: a0.endpoint,
token: a0.token
};
const r8 = env20063 = {
$parent: env8774
};
env20063[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r8));
});
defineSimpleDispatch(["CALL_CREATE"], (a0) => {
let env20064;
const r8 = {
type: "CALL_CREATE",
channelId: a0.channel_id,
messageId: a0.message_id,
region: a0.region,
ongoingRings: a0.ongoing_rings
};
const r5 = env20064 = {
$parent: env8774
};
env20064[0] = r8;
Dispatcher.dispatch(r8).catch($mk90289(r5));
const voice_states = a0.voice_states;
if (voice_states != null) {
let env20065;
const r23 = {
type: "VOICE_STATE_UPDATES",
voiceStates: voice_states.map((voice_state) => {
const selfVideo = voice_state.self_video || false;
const selfStream = voice_state.self_stream || false;
let request_to_speak_timestamp = voice_state.request_to_speak_timestamp;
if (request_to_speak_timestamp == null) {
request_to_speak_timestamp = null;
}
let discoverable = voice_state.discoverable;
if (discoverable == null) {
discoverable = true;
}
return {
userId: voice_state.user_id,
guildId: null,
sessionId: voice_state.session_id,
channelId: voice_state.channel_id,
mute: voice_state.mute,
deaf: voice_state.deaf,
selfMute: voice_state.self_mute,
selfDeaf: voice_state.self_deaf,
selfVideo,
suppress: voice_state.suppress,
selfStream,
requestToSpeakTimestamp: request_to_speak_timestamp,
discoverable,
connectedAt: voice_state.connected_at
};
})
};
const r24 = env20065 = {
$parent: env8774
};
env20065[0] = r23;
Dispatcher.dispatch(r23).catch($mk90289(r24));
}
});
defineSimpleDispatch(["CALL_UPDATE"], (a0) => {
let env20066;
const r4 = {
type: "CALL_UPDATE",
channelId: a0.channel_id,
messageId: a0.message_id,
region: a0.region,
ongoingRings: a0.ongoing_rings
};
const r8 = env20066 = {
$parent: env8774
};
env20066[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r8));
});
defineSimpleDispatch(["CALL_DELETE"], (a0) => {
let env20067;
const r4 = {
type: "CALL_DELETE",
channelId: a0.channel_id,
unavailable: a0.unavailable
};
const r6 = env20067 = {
$parent: env8774
};
env20067[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["OAUTH2_TOKEN_CREATE"], (a0) => {
let env20068;
const r4 = {
type: "OAUTH2_TOKEN_CREATE",
id: a0.id,
scopes: a0.scopes,
application: a0.application
};
const r7 = env20068 = {
$parent: env8774
};
env20068[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["OAUTH2_TOKEN_DELETE"], (a0) => {
let env20069;
const r4 = {
type: "OAUTH2_TOKEN_DELETE",
id: a0.id,
applicationId: a0.application_id
};
const r6 = env20069 = {
$parent: env8774
};
env20069[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["OAUTH2_TOKEN_REVOKE"], (a0) => {
let env20070;
const r4 = {
type: "OAUTH2_TOKEN_REVOKE",
accessToken: a0.access_token
};
const r6 = env20070 = {
$parent: env8774
};
env20070[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["RECENT_MENTION_DELETE"], (a0) => {
let env20071;
const r4 = {
type: "RECENT_MENTION_DELETE",
id: a0.message_id
};
const r6 = env20071 = {
$parent: env8774
};
env20071[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["SAVED_MESSAGE_CREATE"], (a0) => {
let env20072;
const r4 = {
type: "SAVED_MESSAGE_CREATE",
savedMessage: savedMessageCreateObjectToClient(a0)
};
const r10 = env20072 = {
$parent: env8774
};
env20072[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r10));
});
defineSimpleDispatch(["SAVED_MESSAGE_DELETE"], (a0) => {
let env20073;
const r4 = {
type: "SAVED_MESSAGE_DELETE",
savedMessageData: savedMessageDeleteObjectToClient(a0)
};
const r10 = env20073 = {
$parent: env8774
};
env20073[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r10));
});
defineSimpleDispatch(["FRIEND_SUGGESTION_CREATE"], (a0) => {
let env20074;
const r4 = {
type: "FRIEND_SUGGESTION_CREATE",
suggestion: a0
};
const r5 = env20074 = {
$parent: env8774
};
env20074[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["FRIEND_SUGGESTION_DELETE"], (a0) => {
let env20075;
const r4 = {
type: "FRIEND_SUGGESTION_DELETE",
suggestedUserId: a0.suggested_user_id
};
const r6 = env20075 = {
$parent: env8774
};
env20075[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["WEBHOOKS_UPDATE"], (a0) => {
let env20076;
const r4 = {
type: "WEBHOOKS_UPDATE",
guildId: a0.guild_id,
channelId: a0.channel_id
};
const r6 = env20076 = {
$parent: env8774
};
env20076[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["MESSAGE_REACTION_ADD", "MESSAGE_REACTION_REMOVE"], (a0, a1) => {
let env20077;
const r4 = {
type: a1,
channelId: a0.channel_id,
messageId: a0.message_id,
userId: a0.user_id,
emoji: a0.emoji,
colors: a0.burst_colors,
reactionType: a0.type,
messageAuthorId: a0.message_author_id
};
const r12 = env20077 = {
$parent: env8774
};
env20077[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r12));
});
defineSimpleDispatch(["MESSAGE_POLL_VOTE_ADD", "MESSAGE_POLL_VOTE_REMOVE"], (a0, a1) => {
const type = a1 === "MESSAGE_POLL_VOTE_ADD" ? "MESSAGE_REACTION_ADD" : "MESSAGE_REACTION_REMOVE";
let env20078;
const r4 = {
type,
channelId: a0.channel_id,
messageId: a0.message_id,
userId: a0.user_id,
emoji: {
id: a0.answer_id,
name: ""
},
reactionType: ReactionTypes.VOTE
};
const r18 = env20078 = {
$parent: env8774
};
env20078[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r18));
});
defineSimpleDispatch(["MESSAGE_POLL_VOTE_ADD_MANY"], (a0) => {
let env20079;
const r4 = {
type: "MESSAGE_REACTION_ADD_MANY",
channelId: a0.channel_id,
messageId: a0.message_id,
reactions: a0.votes.map((vote) => ({
...vote,
emoji: {
id: vote.answer_id,
name: ""
},
reactionType: ReactionTypes.VOTE
}))
};
const r10 = env20079 = {
$parent: env8774
};
env20079[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r10));
});
defineSimpleDispatch(["MESSAGE_REACTION_REMOVE_ALL"], (a0) => {
let env20080;
const r4 = {
type: "MESSAGE_REACTION_REMOVE_ALL",
channelId: a0.channel_id,
messageId: a0.message_id
};
const r6 = env20080 = {
$parent: env8774
};
env20080[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["MESSAGE_REACTION_REMOVE_EMOJI"], (a0) => {
let env20081;
const r4 = {
type: "MESSAGE_REACTION_REMOVE_EMOJI",
channelId: a0.channel_id,
messageId: a0.message_id,
emoji: a0.emoji
};
const r7 = env20081 = {
$parent: env8774
};
env20081[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["MESSAGE_REACTION_ADD_MANY"], (a0) => {
let env20082;
const r4 = {
type: "MESSAGE_REACTION_ADD_MANY",
channelId: a0.channel_id,
messageId: a0.message_id,
reactions: a0.reactions
};
const r7 = env20082 = {
$parent: env8774
};
env20082[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["PAYMENT_UPDATE"], (a0) => {
let env20083;
const r4 = {
type: "PAYMENT_UPDATE",
payment: a0
};
const r5 = env20083 = {
$parent: env8774
};
env20083[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["ENTITLEMENT_CREATE", "ENTITLEMENT_UPDATE", "ENTITLEMENT_DELETE"], (a0, a1) => {
let env20084;
const r4 = {
type: a1,
entitlement: a0
};
const r6 = env20084 = {
$parent: env8774
};
env20084[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["USER_PAYMENT_SOURCES_UPDATE"], () => {
if (isUserSettingsOpen()) {
fetchPaymentSources();
fetchSubscriptionPlansBySKUs(SubscriptionPlanStore.getFetchedSKUIDs());
}
});
defineSimpleDispatch(["USER_SUBSCRIPTIONS_UPDATE"], () => {
fetchCurrentUser();
if (isUserSettingsOpen()) {
fetchSubscriptions();
}
});
defineSimpleDispatch(["WISHLIST_ITEM_PURCHASED"], (a0) => {
let env20085;
const r4 = {
type: "WISHLIST_ITEM_PURCHASED",
recipientId: a0.recipient_id,
skuId: a0.sku_id
};
const r6 = env20085 = {
$parent: env8774
};
env20085[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["USER_BADGE_STATE_UPDATE"], (a0) => {
fetchBadge(a0.badge_id);
});
defineSimpleDispatch(["USER_PREMIUM_GUILD_SUBSCRIPTION_SLOT_CREATE"], (a0) => {
let env20086;
const r4 = {
type: "GUILD_BOOST_SLOT_CREATE",
guildBoostSlot: GuildBoostSlotRecord.createFromServer(a0, SubscriptionStore.getSubscriptionById(a0.subscription_id))
};
const r11 = env20086 = {
$parent: env8774
};
env20086[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r11));
});
defineSimpleDispatch(["USER_PREMIUM_GUILD_SUBSCRIPTION_SLOT_UPDATE"], (a0) => {
let env20087;
const r4 = {
type: "GUILD_BOOST_SLOT_UPDATE",
guildBoostSlot: GuildBoostSlotRecord.createFromServer(a0, SubscriptionStore.getSubscriptionById(a0.subscription_id))
};
const r11 = env20087 = {
$parent: env8774
};
env20087[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r11));
});
defineSimpleDispatch(["BILLING_POPUP_BRIDGE_CALLBACK"], (a0) => {
let env20088;
const r4 = {
type: "BILLING_POPUP_BRIDGE_CALLBACK",
paymentSourceType: a0.payment_source_type,
state: a0.state,
path: a0.path,
query: a0.query
};
const r8 = env20088 = {
$parent: env8774
};
env20088[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r8));
});
defineSimpleDispatch(["USER_PAYMENT_BROWSER_CHECKOUT_DONE"], (a0) => {
let env20089;
const r4 = {
type: "USER_PAYMENT_BROWSER_CHECKOUT_DONE",
loadId: a0.load_id,
skuId: a0.sku_id,
skuSubscriptionPlanId: a0.sku_subscription_plan_id
};
const r7 = env20089 = {
$parent: env8774
};
env20089[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["USER_PAYMENT_CLIENT_ADD"], (c20090_0) => {
getPurchaseTokenHash().then((result) => {
const purchase_token_hash = c20090_0.purchase_token_hash;
if (purchase_token_hash === result) {
let env27359;
const r6 = env8774;
const r4 = {
type: "USER_PAYMENT_CLIENT_ADD",
purchaseTokenHash: purchase_token_hash,
expiresAt: c20090_0.expires_at
};
const r8 = env27359 = {
$parent: r6
};
env27359[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r8));
}
});
});
defineSimpleDispatch(["GUILD_MEMBER_LIST_UPDATE"], (c20091_0) => {
Module589.Emitter.batched(() => {
let env27361;
const handleItem2 = (a0) => {
if (a0.member != null) {
const member = a0.member;
const r12 = env8774;
dispatchGuildMemberAdd(c20091_0.guild_id, member.user, member);
if (member.presence != null) {
const presence = member.presence;
const guild_id = c20091_0.guild_id;
let activities = presence.activities;
if (activities == null) {
activities = [];
}
let hidden_activities = presence.hidden_activities;
if (hidden_activities == null) {
hidden_activities = [];
}
const r24 = splitAgeRestrictedActivities(activities, hidden_activities);
c8774_21.add({
user: presence.user,
status: presence.status,
clientStatus: presence.client_status,
activities: r24.activities.map($mk90287(r12)),
hiddenActivities: r24.hiddenActivities,
guildId: guild_id,
processedAtTimestamp: presence.processed_at_timestamp
});
}
}
};
c20091_0.ops.forEach((a0) => {
L5: {
const { op, items, item } = a0;
if (op === "SYNC") {
items.forEach(handleItem2);
} else {
if (op !== "UPDATE" && op !== "INSERT") {
break L5;
}
handleItem2(item);
}
}
});
const r11 = env8774;
ActionBatcher.flush();
const r17 = {
type: "GUILD_MEMBER_LIST_UPDATE",
guildId: c20091_0.guild_id,
id: c20091_0.id,
ops: c20091_0.ops,
groups: c20091_0.groups,
memberCount: c20091_0.member_count,
onlineCount: c20091_0.online_count
};
const r23 = env27361 = {
$parent: r11
};
env27361[0] = r17;
Dispatcher.dispatch(r17).catch($mk90289(r23));
});
});
defineSimpleDispatch(["GIFT_CODE_UPDATE"], (a0) => {
let env20092;
const r4 = {
type: "GIFT_CODE_UPDATE",
uses: a0.uses,
code: a0.code
};
const r6 = env20092 = {
$parent: env8774
};
env20092[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["GIFT_CODE_CREATE"], (a0) => {
let env20093;
const r4 = {
type: "GIFT_CODE_CREATE",
giftCode: a0
};
const r5 = env20093 = {
$parent: env8774
};
env20093[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["LIBRARY_APPLICATION_UPDATE"], (a0) => {
let env20094;
const r4 = {
type: "LIBRARY_APPLICATION_UPDATE",
libraryApplication: a0
};
const r5 = env20094 = {
$parent: env8774
};
env20094[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["STREAM_CREATE"], (a0) => {
let env20095;
const r4 = {
type: "STREAM_CREATE",
streamKey: a0.stream_key,
region: a0.region,
viewerIds: a0.viewer_ids,
rtcServerId: a0.rtc_server_id,
rtcChannelId: a0.rtc_channel_id,
paused: a0.paused
};
const r10 = env20095 = {
$parent: env8774
};
env20095[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r10));
});
defineSimpleDispatch(["STREAM_SERVER_UPDATE"], (a0) => {
let env20096;
const r4 = {
type: "STREAM_SERVER_UPDATE",
streamKey: a0.stream_key,
endpoint: a0.endpoint,
token: a0.token
};
const r7 = env20096 = {
$parent: env8774
};
env20096[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["STREAM_UPDATE"], (a0) => {
let env20097;
const r4 = {
type: "STREAM_UPDATE",
streamKey: a0.stream_key,
region: a0.region,
viewerIds: a0.viewer_ids,
paused: a0.paused
};
const r8 = env20097 = {
$parent: env8774
};
env20097[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r8));
});
defineSimpleDispatch(["STREAM_DELETE"], (a0) => {
let env20098;
const r4 = {
type: "STREAM_DELETE",
streamKey: a0.stream_key,
unavailable: a0.unavailable,
reason: a0.reason
};
const r7 = env20098 = {
$parent: env8774
};
env20098[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GENERIC_PUSH_NOTIFICATION_SENT"], (a0) => {
let env20099;
const r4 = {
type: "GENERIC_PUSH_NOTIFICATION_SENT",
title: a0.title,
body: a0.body,
trackingType: a0.tracking_type,
icon: a0.icon,
route: a0.route,
tag: a0.tag
};
const r10 = env20099 = {
$parent: env8774
};
env20099[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r10));
});
defineSimpleDispatch(["REACTION_NOTIFICATION_SENT"], (a0) => {
let env20100;
const r4 = {
type: "REACTION_NOTIFICATION_SENT",
route: a0.route,
message: a0.message,
emoji: a0.emoji,
reactorUserId: a0.reactor_user_id,
title: a0.title,
body: a0.body,
trackingType: a0.tracking_type,
icon: a0.icon
};
const r12 = env20100 = {
$parent: env8774
};
env20100[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r12));
});
defineSimpleDispatch(["NOTIFICATION_CENTER_ITEM_CREATE"], (a0) => {
let env20101;
const r4 = {
type: "NOTIFICATION_CENTER_ITEM_CREATE",
item: a0
};
const r5 = env20101 = {
$parent: env8774
};
env20101[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["NOTIFICATION_CENTER_ITEM_DELETE"], (a0) => {
let env20102;
const r4 = {
type: "NOTIFICATION_CENTER_ITEM_DELETE",
id: a0.id
};
const r6 = env20102 = {
$parent: env8774
};
env20102[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["NOTIFICATION_CENTER_ITEMS_ACK"], (a0) => {
let env20103;
const r4 = {
type: "NOTIFICATION_CENTER_ITEMS_ACK",
ids: [a0.id],
optimistic: false
};
const r6 = env20103 = {
$parent: env8774
};
env20103[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["NOTIFICATION_CENTER_ITEM_COMPLETED"], (a0) => {
let env20104;
const r4 = {
type: "NOTIFICATION_CENTER_ITEM_COMPLETED",
item_enum: a0.item_enum
};
const r6 = env20104 = {
$parent: env8774
};
env20104[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["QUESTS_USER_STATUS_UPDATE"], (a0) => {
let env20105;
const r4 = {
type: "QUESTS_USER_STATUS_UPDATE",
user_status: a0.user_status
};
const r6 = env20105 = {
$parent: env8774
};
env20105[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["QUESTS_USER_COMPLETION_UPDATE"], (a0) => {
let env20106;
const r4 = {
type: "QUESTS_USER_COMPLETION_UPDATE",
quest_enrollment_blocked_until: a0.quest_enrollment_blocked_until
};
const r6 = env20106 = {
$parent: env8774
};
env20106[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["QUEST_PREVIEW_UPDATE"], (a0) => {
let env20107;
const r4 = {
type: "QUEST_PREVIEW_UPDATE",
quest_id: a0.quest_id
};
const r6 = env20107 = {
$parent: env8774
};
env20107[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["APPLICATION_COMMAND_PERMISSIONS_UPDATE"], (a0, a1) => {
let env20108;
const r4 = {
type: a1,
guildId: a0.guild_id
};
const r7 = env20108 = {
$parent: env8774
};
env20108[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GUILD_APPLICATION_COMMAND_INDEX_UPDATE"], (a0) => {
let env20109;
const r4 = {
type: "GUILD_APPLICATION_COMMAND_INDEX_UPDATE",
guildId: a0.guild_id,
version: a0.version
};
const r6 = env20109 = {
$parent: env8774
};
env20109[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["GUILD_JOIN_REQUEST_CREATE"], (a0) => {
let env20110;
const r4 = {
type: "GUILD_JOIN_REQUEST_CREATE",
request: a0.request,
status: a0.status,
guildId: a0.guild_id
};
const r7 = env20110 = {
$parent: env8774
};
env20110[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GUILD_JOIN_REQUEST_UPDATE"], (a0) => {
let env20111;
const r4 = {
type: "GUILD_JOIN_REQUEST_UPDATE",
request: a0.request,
status: a0.status,
guildId: a0.guild_id
};
const r7 = env20111 = {
$parent: env8774
};
env20111[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GUILD_JOIN_REQUEST_DELETE"], (a0) => {
let env20112;
const r4 = {
type: "GUILD_JOIN_REQUEST_DELETE",
id: a0.id,
userId: a0.user_id,
guildId: a0.guild_id
};
const r7 = env20112 = {
$parent: env8774
};
env20112[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["INTERACTION_CREATE"], (a0) => {
let env20113;
const r4 = {
type: "INTERACTION_CREATE",
interactionId: a0.id,
nonce: a0.nonce
};
const r6 = env20113 = {
$parent: env8774
};
env20113[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["INTERACTION_SUCCESS"], (a0) => {
let env20114;
const r4 = {
type: "INTERACTION_SUCCESS",
interactionId: a0.id,
nonce: a0.nonce
};
const r6 = env20114 = {
$parent: env8774
};
env20114[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["INTERACTION_FAILURE"], (a0) => {
let env20115;
const r4 = {
type: "INTERACTION_FAILURE",
interactionId: a0.id,
nonce: a0.nonce,
reasonCode: a0.reason_code
};
const r7 = env20115 = {
$parent: env8774
};
env20115[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE"], (a0) => {
let env20116;
const r4 = {
type: "APPLICATION_COMMAND_AUTOCOMPLETE_RESPONSE",
choices: a0.choices,
nonce: a0.nonce
};
const r6 = env20116 = {
$parent: env8774
};
env20116[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["INTERACTION_MODAL_CREATE"], (a0) => {
let env20117;
const r4 = {
type: "INTERACTION_MODAL_CREATE",
id: a0.id,
channelId: a0.channel_id,
customId: a0.custom_id,
application: a0.application,
title: a0.title,
components: transformComponents(a0.components),
nonce: a0.nonce,
resolved: a0.resolved
};
const r18 = env20117 = {
$parent: env8774
};
env20117[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r18));
});
defineSimpleDispatch(["INTERACTION_IFRAME_MODAL_CREATE"], (a0) => {
let env20118;
const r4 = {
type: "INTERACTION_IFRAME_MODAL_CREATE",
id: a0.id,
channelId: a0.channel_id,
customId: a0.custom_id,
application: a0.application,
title: a0.title,
iframePath: a0.iframe_path,
modalSize: a0.modal_size,
nonce: a0.nonce
};
const r12 = env20118 = {
$parent: env8774
};
env20118[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r12));
});
defineSimpleDispatch(["STAGE_INSTANCE_CREATE"], (a0) => {
let env20119;
const r4 = {
type: "STAGE_INSTANCE_CREATE",
instance: a0
};
const r5 = env20119 = {
$parent: env8774
};
env20119[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["STAGE_INSTANCE_UPDATE"], (a0) => {
let env20120;
const r4 = {
type: "STAGE_INSTANCE_UPDATE",
instance: a0
};
const r5 = env20120 = {
$parent: env8774
};
env20120[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["STAGE_INSTANCE_DELETE"], (a0) => {
let env20121;
const r4 = {
type: "STAGE_INSTANCE_DELETE",
instance: a0
};
const r5 = env20121 = {
$parent: env8774
};
env20121[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["GUILD_SCHEDULED_EVENT_CREATE"], (a0) => {
let env20122;
const r4 = {
type: "GUILD_SCHEDULED_EVENT_CREATE",
guildScheduledEvent: a0
};
const r5 = env20122 = {
$parent: env8774
};
env20122[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["GUILD_SCHEDULED_EVENT_UPDATE"], (a0) => {
let env20123;
const r4 = {
type: "GUILD_SCHEDULED_EVENT_UPDATE",
guildScheduledEvent: a0
};
const r5 = env20123 = {
$parent: env8774
};
env20123[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["GUILD_SCHEDULED_EVENT_DELETE"], (a0) => {
let env20124;
const r4 = {
type: "GUILD_SCHEDULED_EVENT_DELETE",
guildScheduledEvent: a0
};
const r5 = env20124 = {
$parent: env8774
};
env20124[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["GUILD_SCHEDULED_EVENT_EXCEPTION_CREATE"], (a0) => {
let env20125;
const r4 = {
type: "GUILD_SCHEDULED_EVENT_EXCEPTION_CREATE",
eventException: a0
};
const r5 = env20125 = {
$parent: env8774
};
env20125[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["GUILD_SCHEDULED_EVENT_EXCEPTION_UPDATE"], (a0) => {
let env20126;
const r4 = {
type: "GUILD_SCHEDULED_EVENT_EXCEPTION_UPDATE",
eventException: a0
};
const r5 = env20126 = {
$parent: env8774
};
env20126[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["GUILD_SCHEDULED_EVENT_EXCEPTION_DELETE"], (a0) => {
let env20127;
const r4 = {
type: "GUILD_SCHEDULED_EVENT_EXCEPTION_DELETE",
eventException: a0
};
const r5 = env20127 = {
$parent: env8774
};
env20127[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["GUILD_SCHEDULED_EVENT_EXCEPTIONS_DELETE"], (a0) => {
let env20128;
const r4 = {
type: "GUILD_SCHEDULED_EVENT_EXCEPTIONS_DELETE",
eventId: a0.event_id
};
const r6 = env20128 = {
$parent: env8774
};
env20128[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["GUILD_SCHEDULED_EVENT_USER_ADD"], (a0) => {
let env20129;
const r4 = {
type: "GUILD_SCHEDULED_EVENT_USER_ADD",
userId: a0.user_id,
guildId: a0.guild_id,
guildEventId: a0.guild_scheduled_event_id,
guildEventExceptionId: a0.guild_scheduled_event_exception_id,
response: a0.response
};
const r9 = env20129 = {
$parent: env8774
};
env20129[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r9));
});
defineSimpleDispatch(["GUILD_SCHEDULED_EVENT_USER_REMOVE"], (a0) => {
let env20130;
const r4 = {
type: "GUILD_SCHEDULED_EVENT_USER_REMOVE",
userId: a0.user_id,
guildId: a0.guild_id,
guildEventId: a0.guild_scheduled_event_id,
guildEventExceptionId: a0.guild_scheduled_event_exception_id,
response: a0.response
};
const r9 = env20130 = {
$parent: env8774
};
env20130[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r9));
});
defineSimpleDispatch(["GUILD_DIRECTORY_ENTRY_CREATE"], (a0) => {
let env20131;
const r4 = {
type: "GUILD_DIRECTORY_ENTRY_CREATE",
channelId: a0.directory_channel_id,
entry: a0
};
const r5 = env20131 = {
$parent: env8774
};
env20131[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["GUILD_DIRECTORY_ENTRY_UPDATE"], (a0) => {
let env20132;
const r4 = {
type: "GUILD_DIRECTORY_ENTRY_UPDATE",
channelId: a0.directory_channel_id,
entry: a0
};
const r5 = env20132 = {
$parent: env8774
};
env20132[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["GUILD_DIRECTORY_ENTRY_DELETE"], (a0) => {
let env20133;
const r4 = {
type: "GUILD_DIRECTORY_ENTRY_DELETE",
channelId: a0.directory_channel_id,
guildId: a0.entity_id
};
const r6 = env20133 = {
$parent: env8774
};
env20133[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["AUTO_MODERATION_MENTION_RAID_DETECTION"], (a0) => {
let env20134;
const r4 = {
type: "AUTO_MODERATION_MENTION_RAID_DETECTION",
guildId: a0.guild_id,
decisionId: a0.decision_id,
suspiciousMentionActivityUntil: a0.suspicious_mention_activity_until
};
const r7 = env20134 = {
$parent: env8774
};
env20134[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["VOICE_CHANNEL_EFFECT_SEND"], (a0) => {
let env20135;
const r4 = {
type: "VOICE_CHANNEL_EFFECT_SEND",
emoji: a0.emoji,
channelId: a0.channel_id,
userId: a0.user_id,
animationType: a0.animation_type,
animationId: a0.animation_id,
soundId: a0.sound_id,
soundVolume: a0.sound_volume
};
const r11 = env20135 = {
$parent: env8774
};
env20135[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r11));
});
defineSimpleDispatch(["CLIPS_REMOTE_TRIGGER"], (a0) => {
let party_id = a0.party_id;
if (party_id == null) {
party_id = null;
}
let env20136;
const r4 = {
type: "CLIPS_REMOTE_TRIGGER",
userId: a0.user_id,
applicationId: a0.application_id,
partyId: party_id,
remoteClipId: a0.remote_clip_id
};
const r8 = env20136 = {
$parent: env8774
};
env20136[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r8));
});
defineSimpleDispatch(["GUILD_SOUNDBOARD_SOUND_CREATE"], (a0) => {
let env20137;
const r4 = {
type: "GUILD_SOUNDBOARD_SOUND_CREATE",
sound: {
guildId: a0.guild_id,
name: a0.name,
soundId: a0.sound_id,
user: new UserRecord(a0.user),
userId: a0.user_id,
volume: a0.volume,
emojiId: a0.emoji_id,
emojiName: a0.emoji_name,
available: a0.available
}
};
const r19 = env20137 = {
$parent: env8774
};
env20137[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r19));
});
defineSimpleDispatch(["GUILD_SOUNDBOARD_SOUND_UPDATE"], (a0) => {
let env20138;
const r4 = {
type: "GUILD_SOUNDBOARD_SOUND_UPDATE",
sound: {
guildId: a0.guild_id,
name: a0.name,
soundId: a0.sound_id,
user: new UserRecord(a0.user),
userId: a0.user_id,
volume: a0.volume,
emojiId: a0.emoji_id,
emojiName: a0.emoji_name,
available: a0.available
}
};
const r19 = env20138 = {
$parent: env8774
};
env20138[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r19));
});
defineSimpleDispatch(["GUILD_SOUNDBOARD_SOUND_DELETE"], (a0) => {
let env20139;
const r4 = {
type: "GUILD_SOUNDBOARD_SOUND_DELETE",
guildId: a0.guild_id,
soundId: a0.sound_id
};
const r6 = env20139 = {
$parent: env8774
};
env20139[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["GUILD_SOUNDBOARD_SOUNDS_UPDATE"], (a0) => {
let env20141;
const r4 = {
type: "GUILD_SOUNDBOARD_SOUNDS_UPDATE",
guildId: a0.guild_id,
soundboardSounds: a0.soundboard_sounds.map((soundboard_sound) => ({
name: soundboard_sound.name,
soundId: soundboard_sound.sound_id,
emojiName: soundboard_sound.emoji_name,
emojiId: soundboard_sound.emoji_id,
userId: soundboard_sound.user_id,
volume: soundboard_sound.volume,
available: soundboard_sound.available,
guildId: a0.guild_id
}))
};
const r10 = env20141 = {
$parent: env8774
};
env20141[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r10));
});
definePreloadableDispatch(["EMBEDDED_ACTIVITY_UPDATE_V2"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
let participants = a0.participants;
if (participants == null) {
participants = [];
}
let env20142;
const r4 = {
type: "EMBEDDED_ACTIVITY_UPDATE_V2",
instance: {
application_id: a0.application_id,
launch_id: a0.launch_id,
composite_instance_id: a0.composite_instance_id,
location: a0.location,
participants,
content_classification: a0.content_classification
}
};
const r11 = env20142 = {
$parent: env8774
};
env20142[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r11));
});
defineSimpleDispatch(["AUTH_SESSION_CHANGE"], (a0) => {
let env20143;
const r4 = {
type: "AUTH_SESSION_CHANGE",
authSessionIdHash: a0.auth_session_id_hash
};
const r6 = env20143 = {
$parent: env8774
};
env20143[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["USER_CONNECTIONS_LINK_CALLBACK"], (a0) => {
let env20144;
const r4 = {
type: "USER_CONNECTIONS_LINK_CALLBACK",
provider: a0.provider,
callbackCode: a0.callback_code,
callbackState: a0.callback_state
};
const r7 = env20144 = {
$parent: env8774
};
env20144[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["USER_CONNECTIONS_CALLBACK"], (a0) => {
let env20145;
const r4 = {
type: "USER_CONNECTIONS_CALLBACK",
provider: a0.provider,
code: a0.code,
state: a0.state,
openid_params: a0.openid_params
};
const r8 = env20145 = {
$parent: env8774
};
env20145[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r8));
});
defineSimpleDispatch(["DELETED_ENTITY_IDS"], (a0) => {
let env20146;
const r4 = {
type: "DELETED_ENTITY_IDS",
...a0
};
const r7 = env20146 = {
$parent: env8774
};
env20146[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
definePreloadableDispatch(["CHANNEL_SYNC"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
if (!a0.integrity_check) {
a0.channels.forEach((channel) => {
c8774_18.add(channel);
});
}
let env20147;
const r9 = {
type: "CHANNEL_SYNC",
guild_id: a0.guild_id,
channels: a0.channels,
integrity_check: a0.integrity_check
};
const r12 = env20147 = {
$parent: env8774
};
env20147[0] = r9;
Dispatcher.dispatch(r9).catch($mk90289(r12));
});
defineSimpleDispatch(["CONSOLE_COMMAND_UPDATE"], (a0) => {
let env20148;
const r4 = {
type: "CONSOLE_COMMAND_UPDATE",
id: a0.id,
result: a0.result,
error: a0.error
};
const r7 = env20148 = {
$parent: env8774
};
env20148[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
definePreloadableDispatch(["PASSIVE_UPDATE_V2"], (a0) => ChannelLoader.loadGuildIds([a0.guild_id]), (a0) => {
let env20149;
const r4 = {
type: "PASSIVE_UPDATE_V2",
guildId: a0.guild_id,
members: a0.updated_members,
channels: a0.updated_channels.map((updated_channel) => ({
id: updated_channel.id,
lastMessageId: updated_channel.last_message_id,
lastPinTimestamp: updated_channel.last_pin_timestamp
})),
voiceStates: a0.updated_voice_states.map((updated_voice_state) => {
const deaf = updated_voice_state.deaf || false;
const mute = updated_voice_state.mute || false;
let request_to_speak_timestamp = updated_voice_state.request_to_speak_timestamp;
if (request_to_speak_timestamp == null) {
request_to_speak_timestamp = null;
}
const selfDeaf = updated_voice_state.self_deaf || false;
const selfMute = updated_voice_state.self_mute || false;
const selfStream = updated_voice_state.self_stream || false;
const selfVideo = updated_voice_state.self_video || false;
let discoverable = updated_voice_state.discoverable;
if (discoverable == null) {
discoverable = true;
}
return {
channelId: updated_voice_state.channel_id,
deaf,
mute,
requestToSpeakTimestamp: request_to_speak_timestamp,
selfDeaf,
selfMute,
selfStream,
selfVideo,
sessionId: updated_voice_state.session_id,
suppress: updated_voice_state.suppress,
userId: updated_voice_state.user_id,
discoverable,
connectedAt: updated_voice_state.connected_at
};
}),
removedVoiceStateUsers: a0.removed_voice_states
};
const r15 = env20149 = {
$parent: env8774
};
env20149[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r15));
});
defineSimpleDispatch(["CREATOR_MONETIZATION_RESTRICTIONS_UPDATE"], (a0) => {
let env20150;
const r4 = {
type: "GUILD_ROLE_SUBSCRIPTIONS_FETCH_RESTRICTIONS_SUCCESS",
guildId: a0.guild_id,
restrictions: a0.restrictions
};
const r6 = env20150 = {
$parent: env8774
};
env20150[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["BILLING_REFERRAL_TRIAL_OFFER_UPDATE"], (a0) => {
let env20151;
const r4 = {
type: "BILLING_REFERRAL_TRIAL_OFFER_UPDATE",
userTrialOfferId: a0.user_trial_offer_id,
recipientId: a0.recipient_id
};
const r6 = env20151 = {
$parent: env8774
};
env20151[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["LAST_MESSAGES"], (a0) => {
let env20152;
const r4 = {
type: "MESSAGE_PREVIEWS_LOADED",
guildId: a0.guild_id,
messages: a0.messages
};
const r6 = env20152 = {
$parent: env8774
};
env20152[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["AUTHENTICATOR_UPDATE"], (a0) => {
let env20153;
const r4 = {
type: "AUTHENTICATOR_UPDATE",
credential: a0
};
const r5 = env20153 = {
$parent: env8774
};
env20153[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["AUTHENTICATOR_CREATE"], (a0) => {
let env20154;
const r4 = {
type: "AUTHENTICATOR_CREATE",
credential: a0
};
const r5 = env20154 = {
$parent: env8774
};
env20154[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["AUTHENTICATOR_DELETE"], (a0) => {
let env20155;
const r4 = {
type: "AUTHENTICATOR_DELETE",
credential: a0
};
const r5 = env20155 = {
$parent: env8774
};
env20155[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["NOTIFICATION_SETTINGS_UPDATE"], (a0) => {
let env20156;
const r4 = {
type: "NOTIFICATION_SETTINGS_UPDATE",
settings: {
flags: a0.flags
}
};
const r6 = env20156 = {
$parent: env8774
};
env20156[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["CONVERSATION_SUMMARY_UPDATE"], (a0) => {
let env20157;
const r4 = {
type: "CONVERSATION_SUMMARY_UPDATE",
...a0
};
const r7 = env20157 = {
$parent: env8774
};
env20157[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["PREMIUM_MARKETING_PREVIEW"], (a0) => {
let env20158;
const r4 = {
type: "PREMIUM_MARKETING_PREVIEW",
data: a0
};
const r5 = env20158 = {
$parent: env8774
};
env20158[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r5));
});
defineSimpleDispatch(["USER_APPLICATION_UPDATE"], (a0) => {
let env20159;
const r4 = {
type: "USER_APPLICATION_UPDATE",
applicationId: a0.application_id
};
const r6 = env20159 = {
$parent: env8774
};
env20159[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["USER_APPLICATION_REMOVE"], (a0) => {
let env20160;
const r4 = {
type: "USER_APPLICATION_REMOVE",
applicationId: a0.application_id
};
const r6 = env20160 = {
$parent: env8774
};
env20160[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["DM_SETTINGS_UPSELL_SHOW"], (a0) => {
let env20161;
const r4 = {
type: "DM_SETTINGS_UPSELL_SHOW",
guildId: a0.guild_id
};
const r6 = env20161 = {
$parent: env8774
};
env20161[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["CONTENT_INVENTORY_INBOX_STALE"], (a0) => {
let env20162;
const r4 = {
type: "CONTENT_INVENTORY_INBOX_STALE",
refreshAfterMs: a0.refresh_after_ms
};
const r6 = env20162 = {
$parent: env8774
};
env20162[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["VIRTUAL_CURRENCY_BALANCE_UPDATE"], (a0) => {
let env20163;
const r4 = {
type: "VIRTUAL_CURRENCY_BALANCE_UPDATE",
balance: a0.balance
};
const r6 = env20163 = {
$parent: env8774
};
env20163[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
defineSimpleDispatch(["WALLET_BALANCE_UPDATE"], (a0) => {
let env20164;
const r4 = {
type: "WALLET_BALANCE_UPDATE",
paymentSourceId: a0.payment_source_id,
balance: a0.balance,
currency: a0.currency
};
const r7 = env20164 = {
$parent: env8774
};
env20164[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GUILD_POWERUP_ENTITLEMENTS_CREATE", "GUILD_POWERUP_ENTITLEMENTS_DELETE"], (a0, a1) => {
let env20165;
const r4 = {
type: a1,
guildId: a0.guild_id,
entitlements: a0.entitlements
};
const r7 = env20165 = {
$parent: env8774
};
env20165[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GAME_SERVER_CREATE", "GAME_SERVER_UPDATE"], (a0, a1) => {
let env20166;
const r4 = {
type: a1,
guildId: a0.guild_id,
gameServer: a0.game_server
};
const r7 = env20166 = {
$parent: env8774
};
env20166[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GAME_SERVER_DELETE"], (a0, a1) => {
let env20167;
const r4 = {
type: a1,
guildId: a0.guild_id,
gameServerId: a0.game_server_id
};
const r7 = env20167 = {
$parent: env8774
};
env20167[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GUILD_APPLIED_BOOSTS_UPDATE"], (a0, a1) => {
let env20168;
const r4 = {
type: a1,
guildId: a0.guild_id
};
const r7 = env20168 = {
$parent: env8774
};
env20168[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["USER_APPLICATION_IDENTITY_UPDATE"], (a0, a1) => {
let env20169;
const r4 = {
type: a1,
user_id: a0.user_id,
application_id: a0.application_id,
username: a0.username,
avatar_hash: a0.avatar_hash,
metadata: a0.metadata
};
const r10 = env20169 = {
$parent: env8774
};
env20169[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r10));
});
defineSimpleDispatch(["USER_APPLICATION_IDENTITY_REMOVE"], (a0, a1) => {
let env20170;
const r4 = {
type: a1,
user_id: a0.user_id,
application_id: a0.application_id
};
const r7 = env20170 = {
$parent: env8774
};
env20170[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["SOCIAL_LAYER_SKU_PURCHASE_ELIGIBILITY_RESPONSE"], (a0) => {
let env20171;
const r4 = {
type: "SOCIAL_LAYER_SKU_PURCHASE_ELIGIBILITY_RESPONSE",
interactionId: a0.interaction_id,
applicationId: a0.application_id,
skuId: a0.sku_id,
recipientId: a0.recipient_id,
eligible: a0.eligible,
ineligibleReason: a0.ineligible_reason
};
const r10 = env20171 = {
$parent: env8774
};
env20171[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r10));
});
defineSimpleDispatch(["GUILD_ROOM_CONNECT"], (a0, a1) => {
let env20172;
const r4 = {
type: a1,
room: serverGuildRoomToClient(a0)
};
const r11 = env20172 = {
$parent: env8774
};
env20172[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r11));
});
defineSimpleDispatch(["GUILD_ROOM_DISCONNECT"], (a0, a1) => {
let env20173;
const r4 = {
type: a1,
userId: a0.user_id,
roomId: a0.room_id
};
const r7 = env20173 = {
$parent: env8774
};
env20173[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["GUILD_ROOM_UPDATE"], (a0, a1) => {
let env20174;
const r4 = {
type: a1,
room: serverGuildRoomToClient(a0)
};
const r11 = env20174 = {
$parent: env8774
};
env20174[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r11));
});
defineSimpleDispatch(["HAVEN_CONNECT"], (a0, a1) => {
let env20175;
const r4 = {
type: a1,
room: parseRoom(a0)
};
const r11 = env20175 = {
$parent: env8774
};
env20175[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r11));
});
defineSimpleDispatch(["HAVEN_DISCONNECT"], (a0, a1) => {
let env20176;
const r4 = {
type: a1,
userId: a0.user_id,
roomId: a0.room_id
};
const r7 = env20176 = {
$parent: env8774
};
env20176[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["HAVEN_UPDATE"], (a0, a1) => {
let env20177;
const r4 = {
type: a1,
room: parseRoom(a0)
};
const r11 = env20177 = {
$parent: env8774
};
env20177[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r11));
});
defineSimpleDispatch(["GUILD_OFFICIAL_GAME_APPLICATIONS_UPDATE"], (a0, a1) => {
let env20178;
const r4 = {
type: a1,
gameApplicationIds: a0.game_application_ids,
guildId: a0.guild_id
};
const r7 = env20178 = {
$parent: env8774
};
env20178[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r7));
});
defineSimpleDispatch(["MESSAGE_REQUEST_NOTIFICATION_SENT"], (a0) => {
let env20179;
const r4 = {
type: "MESSAGE_REQUEST_NOTIFICATION_SENT",
triggeringUserId: a0.triggering_user_id,
numMutualGuilds: a0.num_mutual_guilds
};
const r6 = env20179 = {
$parent: env8774
};
env20179[0] = r4;
Dispatcher.dispatch(r4).catch($mk90289(r6));
});
export default function getDispatchHandler(a0) {
return c8774_22[a0];
};