This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,57 @@
// Metro module 16195 (f16196).
import * as _GuildRoomActionCreators_shared from "./GuildRoomActionCreators.shared";
for (const key in _GuildRoomActionCreators_shared) {
exports[key] = _GuildRoomActionCreators_shared[key];
}
export async function guildRoomConnect(c28272_0, c28272_1, c28272_2) {
let c28272_6 = 0;
L10: {
try {
c28272_6 = 1;
await _GuildRoomActionCreators_shared.guildRoomConnect(c28272_0, c28272_1, c28272_2);
c28272_6 = 0;
} catch ($e) {
let r8 = $e;
if (c28272_6 !== 0) {
while (true) {
try {
c28272_6 = 0;
break L10;
} catch ($e) {
r8 = $e;
if (c28272_6 === 0) {
break;
}
}
}
}
throw r8;
}
}
}
export async function guildRoomUpdate(c28273_0, c28273_1, c28273_2) {
let c28273_6 = 0;
L10: {
try {
c28273_6 = 1;
await _GuildRoomActionCreators_shared.guildRoomUpdate(c28273_0, c28273_1, c28273_2);
c28273_6 = 0;
} catch ($e) {
let r8 = $e;
if (c28273_6 !== 0) {
while (true) {
try {
c28273_6 = 0;
break L10;
} catch ($e) {
r8 = $e;
if (c28273_6 === 0) {
break;
}
}
}
}
throw r8;
}
}
}
@@ -0,0 +1,450 @@
// Metro module 16196 (f16197).
import AuthenticationStore from "../../stores/AuthenticationStore";
import GuildRoomStore from "./GuildRoomStore";
import { Endpoints } from "../../Constants";
import { HTTP } from "../../_bundle/sendRequest";
import { serverGuildRoomToClient } from "./GuildRoomUtils";
import Dispatcher from "../../Dispatcher";
import { trackGuildRoomUserConnected, trackGuildRoomSeatSelected, trackGuildRoomUserUpdated, trackGuildRoomUserDisconnected, trackGuildRoomObjectInteracted } from "./GuildRoomAnalytics";
import { fireSurveyAction } from "../qualtrics/QualtricsActionCreators";
import { SurveyActionTypes } from "../../_bundle/Module9280";
import { GuildRoomObjectTypes } from "./GuildRoomTypes";
let c11613_7, guildRoomObjectDelete, deletePendingGuildRoomNote;
const guildRoomObjectCreate = async function guildRoomObjectCreate(c28277_0, c28277_1, body2) {
return await HTTP.post({
url: Endpoints.GUILD_ROOM_OBJECT_CREATE(c28277_0, c28277_1),
body: body2,
rejectWithError: true
});
};
guildRoomObjectDelete = async function guildRoomObjectDelete(c28279_0, c28279_1, c28279_2, body4) {
return await HTTP.del({
url: Endpoints.GUILD_ROOM_OBJECT_DELETE(c28279_0, c28279_1, c28279_2),
body: body4,
rejectWithError: true
});
};
deletePendingGuildRoomNote = function deletePendingGuildRoomNote(a0) {
Dispatcher.dispatch({
type: "GUILD_ROOM_PENDING_NOTE_DELETE",
roomId: a0
});
};
c11613_7 = {
x: 0,
y: 0
};
export async function guildRoomConnect(c28274_0, c28274_1, c28274_2) {
let r33;
let position, c28274_4, c28274_5, c28274_8;
let c28274_9 = 0;
let c30987_0, c30987_1, c30987_2, c30987_3, c30987_4, c30987_5, c30987_6, c30987_7, c30987_8;
L18: {
try {
c30987_0 = c28274_0;
c30987_1 = c28274_1;
c30987_2 = c28274_2;
c30987_3 = void 0;
c30987_4 = void 0;
c30987_5 = void 0;
c30987_6 = void 0;
c30987_7 = void 0;
c30987_8 = void 0;
c28274_9 = 1;
position = c28274_2;
if (c28274_2 == null) {
position = c11613_7;
}
c30987_3 = position;
c30987_4 = await HTTP.post({
url: Endpoints.GUILD_ROOM_CONNECT(c28274_0, c28274_1),
body: {
position
},
rejectWithError: true
});
c30987_5 = serverGuildRoomToClient(c30987_4.body);
Dispatcher.dispatch({
type: "GUILD_ROOM_CONNECT",
room: c30987_5,
guildId: c30987_0,
pendingPosition: c30987_3
});
if (c30987_1 !== c30987_0) {
trackGuildRoomUserConnected({
guildId: c30987_0,
channelId: c30987_1
});
fireSurveyAction(SurveyActionTypes.GUILD_ROOM_JOINED);
c30987_6 = c30987_5.users.get(AuthenticationStore.getId());
if (c30987_6 != null) {
c30987_7 = [{
updateType: "position",
updateReason: "default",
position: c30987_6.position
}, {
updateType: "status_id",
updateReason: "default",
statusId: c30987_6.statusId
}, {
updateType: "status_text",
updateReason: "default",
statusText: c30987_6.statusText
}];
const r132 = c30987_7;
c28274_5 = r132;
const r134 = r132[Symbol.iterator]();
c28274_5 = r134.next;
c28274_4 = r134;
while (true) {
const r136 = c28274_5;
let r137 = c28274_4;
const r138 = r137 === void 0 ? void 0 : (r33 = r136.call(r137)).done ? r137 = void 0 : r33.value;
c28274_4 = r137;
if (r137 === void 0) {
trackGuildRoomSeatSelected({
guildId: c30987_0,
channelId: c30987_1,
actualSeatPosition: c30987_6.position,
targetSeatPosition: c30987_2
});
break;
}
c28274_9 = 2;
c30987_8 = r138;
trackGuildRoomUserUpdated({
channelId: c30987_1,
update: c30987_8
});
c28274_9 = 1;
}
}
}
c28274_9 = 0;
} catch ($e) {
const r39 = $e;
let r8 = r39;
c28274_8 = r39;
let r40 = c28274_9;
if (r40 !== 0) {
while (true) {
if (r40 === 1) {
try {
c28274_9 = 0;
Dispatcher.dispatch({
type: "GUILD_ROOM_CONNECT_FAILURE",
guildId: c30987_0,
roomId: c30987_1
});
break L18;
} catch (r174) {
r8 = r174;
c28274_8 = r174;
r40 = c28274_9;
if (r40 === 0) {
break;
}
}
} else {
try {
const r169 = c28274_8;
c28274_9 = 1;
const r171 = c28274_4;
if (r171 !== void 0 && typeof r171.return === "function") {
try {
r171.return();
} catch {}
}
throw r169;
} catch (r168) {
r8 = r168;
c28274_8 = r168;
r40 = c28274_9;
if (r40 === 0) {
break;
}
}
}
}
}
throw r8;
}
}
}
export async function guildRoomDisconnect(c28275_0, roomId) {
let c28275_5 = 0;
let c30988_0, c30988_1;
L12: {
try {
c30988_0 = c28275_0;
c30988_1 = roomId;
c28275_5 = 1;
Dispatcher.dispatch({
type: "GUILD_ROOM_DISCONNECT",
userId: AuthenticationStore.getId(),
roomId
});
await HTTP.post({
url: Endpoints.GUILD_ROOM_DISCONNECT(c28275_0, roomId),
rejectWithError: true
});
if (c30988_1 !== c30988_0) {
trackGuildRoomUserDisconnected({
guildId: c30988_0,
channelId: c30988_1
});
}
c28275_5 = 0;
} catch ($e) {
let r8 = $e;
if (c28275_5 !== 0) {
while (true) {
try {
c28275_5 = 0;
break L12;
} catch ($e) {
r8 = $e;
if (c28275_5 === 0) {
break;
}
}
}
}
throw r8;
}
}
}
export function guildRoomLocalDisconnect(a0, a1) {
Dispatcher.dispatch({
type: "GUILD_ROOM_DISCONNECT",
userId: a0,
roomId: a1
});
}
export async function guildRoomUpdate(c28276_0, roomId2, body) {
let c28276_6 = 0;
let c30989_0, c30989_1, c30989_2, c30989_3, c30989_4, c30989_5, c30989_6, c30989_7, c30989_8;
L44: {
try {
c30989_0 = c28276_0;
c30989_1 = roomId2;
c30989_2 = body;
c30989_3 = void 0;
c30989_4 = void 0;
c30989_5 = void 0;
c30989_6 = void 0;
c30989_7 = void 0;
c30989_8 = void 0;
c30989_3 = GuildRoomStore.getRoom(roomId2);
c30989_4 = GuildRoomStore.getRoomUsers(roomId2);
c30989_5 = GuildRoomStore.getRoomObjects(roomId2);
c28276_6 = 1;
const r37 = {
type: "GUILD_ROOM_LOCAL_UPDATE",
roomId: roomId2
};
if (body?.background != null) {
r37.background = body.background;
}
if (body?.user_position != null) {
r37.position = body.user_position;
}
if (body?.user_status_id != null) {
r37.statusId = body.user_status_id;
}
if (body?.user_status_text != null) {
r37.statusText = body.user_status_text;
}
Dispatcher.dispatch(r37);
c30989_6 = await HTTP.post({
url: Endpoints.GUILD_ROOM_UPDATE(c28276_0, roomId2),
body,
rejectWithError: true
});
c30989_7 = serverGuildRoomToClient(c30989_6.body);
if (c30989_0 !== c30989_1) {
if (c30989_2?.user_position != null) {
trackGuildRoomUserUpdated({
channelId: c30989_1,
update: {
updateType: "position",
updateReason: "user_selected",
position: c30989_2.user_position
}
});
}
if (c30989_2?.user_status_id != null) {
trackGuildRoomUserUpdated({
channelId: c30989_1,
update: {
updateType: "status_id",
updateReason: "user_selected",
statusId: c30989_2.user_status_id
}
});
}
if (c30989_2?.user_status_text != null) {
trackGuildRoomUserUpdated({
channelId: c30989_1,
update: {
updateType: "status_text",
updateReason: "user_selected",
statusText: c30989_2.user_status_text
}
});
}
if (c30989_2?.user_position != null) {
c30989_8 = c30989_7.users.get(AuthenticationStore.getId());
if (c30989_8 != null) {
trackGuildRoomSeatSelected({
guildId: c30989_0,
channelId: c30989_1,
actualSeatPosition: c30989_8.position,
targetSeatPosition: c30989_2.user_position
});
}
}
}
c28276_6 = 0;
} catch ($e) {
let r8 = $e;
if (c28276_6 !== 0) {
while (true) {
try {
c28276_6 = 0;
Dispatcher.dispatch({
type: "GUILD_ROOM_UPDATE_FAILURE",
originalRoom: c30989_3,
originalRoomUsers: c30989_4,
originalRoomObjects: c30989_5,
guildId: c30989_0
});
break L44;
} catch ($e) {
r8 = $e;
if (c28276_6 === 0) {
break;
}
}
}
}
throw r8;
}
}
}
export function selectGuildRoomLocalPosition(a0) {
Dispatcher.dispatch({
type: "GUILD_ROOM_LOCAL_POSITION_REQUESTED",
position: a0
});
}
export function guildRoomToggleLayout(a0, a1) {
Dispatcher.dispatch({
type: "GUILD_ROOM_TOGGLE_LAYOUT",
roomId: a0,
clearLayout: a1
});
}
export { guildRoomObjectCreate };
export async function guildRoomObjectUpdate(c28278_0, c28278_1, c28278_2, body3) {
return await HTTP.post({
url: Endpoints.GUILD_ROOM_OBJECT_UPDATE(c28278_0, c28278_1, c28278_2),
body: body3,
rejectWithError: true
});
}
export { guildRoomObjectDelete };
export function startPendingGuildRoomNote(a0) {
Dispatcher.dispatch({
type: "GUILD_ROOM_PENDING_NOTE_START",
roomId: a0
});
}
export function placePendingGuildRoomNote(a0, a1) {
Dispatcher.dispatch({
type: "GUILD_ROOM_PENDING_NOTE_PLACE",
roomId: a0,
position: a1
});
}
export { deletePendingGuildRoomNote };
export async function createGuildRoomNote(c28280_0, c28280_1, content, position2) {
let c28280_7 = 0;
let c30990_0, c30990_1;
L12: {
try {
c30990_0 = c28280_0;
c30990_1 = c28280_1;
deletePendingGuildRoomNote(c28280_1);
c28280_7 = 1;
await guildRoomObjectCreate(c28280_0, c28280_1, {
object_type: GuildRoomObjectTypes.NOTE,
content,
position: position2
});
if (c30990_1 !== c30990_0) {
trackGuildRoomObjectInteracted({
interactionType: "note_created",
guildId: c30990_0,
channelId: c30990_1
});
}
Dispatcher.dispatch({
type: "GUILD_ROOM_NOTE_CREATE_COMPLETE",
roomId: c30990_1
});
c28280_7 = 0;
} catch ($e) {
let r8 = $e;
if (c28280_7 !== 0) {
while (true) {
try {
c28280_7 = 0;
Dispatcher.dispatch({
type: "GUILD_ROOM_NOTE_CREATE_COMPLETE",
roomId: c30990_1
});
break L12;
} catch ($e) {
r8 = $e;
if (c28280_7 === 0) {
break;
}
}
}
}
throw r8;
}
}
}
export async function deleteGuildRoomNote(c28281_0, c28281_1, c28281_2) {
let c28281_4;
c28281_4 = void 0;
let c30991_0 = c28281_0;
let c30991_1 = c28281_1;
await guildRoomObjectDelete(c28281_0, c28281_1, c28281_2, {
object_type: GuildRoomObjectTypes.NOTE
});
if (c30991_1 !== c30991_0) {
trackGuildRoomObjectInteracted({
interactionType: "note_deleted",
guildId: c30991_0,
channelId: c30991_1
});
}
}
export async function fetchGuildRoom(c28282_0, c28282_1) {
let c28282_3;
c28282_3 = void 0;
let c30992_0 = c28282_0;
let c30992_1 = await HTTP.get({
url: Endpoints.GUILD_ROOM(c28282_0, c28282_1),
rejectWithError: true
});
let c30992_2 = serverGuildRoomToClient(c30992_1.body);
Dispatcher.dispatch({
type: "GUILD_ROOM_FETCH_SUCCESS",
guildId: c30992_0,
room: c30992_2
});
}
+524
View File
@@ -0,0 +1,524 @@
// Metro module 16197 (f16198).
import AuthenticationStore from "../../stores/AuthenticationStore";
import ChannelStore from "../../stores/ChannelStore";
import RTCConnectionStore from "../../stores/RTCConnectionStore";
import VoiceStateStore from "../../stores/VoiceStateStore";
import GuildRoomStore from "./GuildRoomStore";
import { getSeatName } from "./GuildRoomConstants";
import { AnalyticEvents } from "../../Constants";
import AppAnalyticsUtils from "../app_analytics/AppAnalyticsUtils";
import { HermesBuiltin } from "../../_hermes/prelude";
function $mk98940($env) {
return function onChange() {
const r7 = $env.$parent;
const r5 = r7[4];
const mediaSessionId = r5.getMediaSessionId();
if (mediaSessionId != null) {
const r4 = $env;
r5.removeChangeListener(r4[3]);
clearTimeout(r4[2]);
(0, r4[1])({
voice_state_count: Object.keys(r7[5].getVoiceStatesForChannel(r4[0])).length,
voice_media_session_id: mediaSessionId
});
}
};
}
function $mk98941($env) {
return () => {
const r3 = $env;
const r6 = $env.$parent;
r6[4].removeChangeListener(r3[3]);
clearTimeout(r3[2]);
(0, r3[1])({
voice_state_count: Object.keys(r6[5].getVoiceStatesForChannel(r3[0])).length
});
};
}
let env11614 = {};
export function trackGuildRoomObjectInteracted({ interactionType, ...rest }) {
let env22865;
let c22864_1 = rest;
const channelId = rest.channelId;
const r7 = (a0) => {
const GUILD_ROOM_OBJECT_INTERACTED = AnalyticEvents.GUILD_ROOM_OBJECT_INTERACTED;
let userId = c22864_1.userId;
let guildId = c22864_1.guildId;
const channelId = c22864_1.channelId;
if (userId == null) {
userId = AuthenticationStore.getId();
}
const roomUsers = GuildRoomStore.getRoomUsers(channelId);
if (guildId == null) {
const channel = ChannelStore.getChannel(channelId);
let r27 = channel == null ? void 0 : channel.getGuildId();
if (r27 == null) {
r27 = void 0;
}
guildId = r27;
}
AppAnalyticsUtils.trackWithMetadata(GUILD_ROOM_OBJECT_INTERACTED, {
...{
user_id: userId,
guild_id: guildId,
channel_id: channelId,
guild_room_user_count: roomUsers.size,
guild_room_user_connected: roomUsers.has(userId)
},
interaction_type: interactionType,
...a0
});
};
const r18 = env22865 = {
$parent: env11614
};
env22865[0] = channelId;
env22865[1] = r7;
env22865[2] = void 0;
const r5 = $mk98940(r18);
env22865[3] = r5;
const mediaSessionId = RTCConnectionStore.getMediaSessionId();
if (mediaSessionId == null) {
env22865[2] = setTimeout($mk98941(r18), 2500);
RTCConnectionStore.addChangeListener(r5);
} else {
r7({
voice_state_count: Object.keys(VoiceStateStore.getVoiceStatesForChannel(channelId)).length,
voice_media_session_id: mediaSessionId
});
}
}
export function trackGuildRoomInteracted({ interactionType: interactionType2, ...rest }) {
let env22867;
let c22866_1 = rest;
const channelId = rest.channelId;
const r7 = (a0) => {
const GUILD_ROOM_INTERACTED = AnalyticEvents.GUILD_ROOM_INTERACTED;
let userId = c22866_1.userId;
let guildId = c22866_1.guildId;
const channelId = c22866_1.channelId;
if (userId == null) {
userId = AuthenticationStore.getId();
}
const roomUsers = GuildRoomStore.getRoomUsers(channelId);
if (guildId == null) {
const channel = ChannelStore.getChannel(channelId);
let r27 = channel == null ? void 0 : channel.getGuildId();
if (r27 == null) {
r27 = void 0;
}
guildId = r27;
}
AppAnalyticsUtils.trackWithMetadata(GUILD_ROOM_INTERACTED, {
...{
user_id: userId,
guild_id: guildId,
channel_id: channelId,
guild_room_user_count: roomUsers.size,
guild_room_user_connected: roomUsers.has(userId)
},
interaction_type: interactionType2,
...a0
});
};
const r18 = env22867 = {
$parent: env11614
};
env22867[0] = channelId;
env22867[1] = r7;
env22867[2] = void 0;
const r5 = $mk98940(r18);
env22867[3] = r5;
const mediaSessionId = RTCConnectionStore.getMediaSessionId();
if (mediaSessionId == null) {
env22867[2] = setTimeout($mk98941(r18), 2500);
RTCConnectionStore.addChangeListener(r5);
} else {
r7({
voice_state_count: Object.keys(VoiceStateStore.getVoiceStatesForChannel(channelId)).length,
voice_media_session_id: mediaSessionId
});
}
}
export function trackGuildRoomLayoutToggled({ location: location2, guildRoomOpen, ...rest }) {
let env22869;
let c22868_2 = rest;
const channelId = rest.channelId;
const r7 = (a0) => {
const GUILD_ROOM_LAYOUT_TOGGLED = AnalyticEvents.GUILD_ROOM_LAYOUT_TOGGLED;
let userId = c22868_2.userId;
let guildId = c22868_2.guildId;
const channelId = c22868_2.channelId;
if (userId == null) {
userId = AuthenticationStore.getId();
}
const roomUsers = GuildRoomStore.getRoomUsers(channelId);
if (guildId == null) {
const channel = ChannelStore.getChannel(channelId);
let r27 = channel == null ? void 0 : channel.getGuildId();
if (r27 == null) {
r27 = void 0;
}
guildId = r27;
}
AppAnalyticsUtils.trackWithMetadata(GUILD_ROOM_LAYOUT_TOGGLED, {
...{
user_id: userId,
guild_id: guildId,
channel_id: channelId,
guild_room_user_count: roomUsers.size,
guild_room_user_connected: roomUsers.has(userId)
},
location: location2,
guild_room_open: guildRoomOpen,
...a0
});
};
const r19 = env22869 = {
$parent: env11614
};
env22869[0] = channelId;
env22869[1] = r7;
env22869[2] = void 0;
const r5 = $mk98940(r19);
env22869[3] = r5;
const mediaSessionId = RTCConnectionStore.getMediaSessionId();
if (mediaSessionId == null) {
env22869[2] = setTimeout($mk98941(r19), 2500);
RTCConnectionStore.addChangeListener(r5);
} else {
r7({
voice_state_count: Object.keys(VoiceStateStore.getVoiceStatesForChannel(channelId)).length,
voice_media_session_id: mediaSessionId
});
}
}
export function trackGuildRoomOpened({ location: location3, ...rest }) {
let env22871;
let c22870_1 = rest;
const channelId = rest.channelId;
const r7 = (a0) => {
const GUILD_ROOM_OPENED = AnalyticEvents.GUILD_ROOM_OPENED;
let userId = c22870_1.userId;
let guildId = c22870_1.guildId;
const channelId = c22870_1.channelId;
if (userId == null) {
userId = AuthenticationStore.getId();
}
const roomUsers = GuildRoomStore.getRoomUsers(channelId);
if (guildId == null) {
const channel = ChannelStore.getChannel(channelId);
let r27 = channel == null ? void 0 : channel.getGuildId();
if (r27 == null) {
r27 = void 0;
}
guildId = r27;
}
AppAnalyticsUtils.trackWithMetadata(GUILD_ROOM_OPENED, {
...{
user_id: userId,
guild_id: guildId,
channel_id: channelId,
guild_room_user_count: roomUsers.size,
guild_room_user_connected: roomUsers.has(userId)
},
location: location3,
...a0
});
};
const r18 = env22871 = {
$parent: env11614
};
env22871[0] = channelId;
env22871[1] = r7;
env22871[2] = void 0;
const r5 = $mk98940(r18);
env22871[3] = r5;
const mediaSessionId = RTCConnectionStore.getMediaSessionId();
if (mediaSessionId == null) {
env22871[2] = setTimeout($mk98941(r18), 2500);
RTCConnectionStore.addChangeListener(r5);
} else {
r7({
voice_state_count: Object.keys(VoiceStateStore.getVoiceStatesForChannel(channelId)).length,
voice_media_session_id: mediaSessionId
});
}
}
export function trackGuildRoomSeatSelected({ actualSeatPosition, targetSeatPosition, ...rest }) {
let env22873;
let c22872_2 = rest;
const channelId = rest.channelId;
const r7 = (a0) => {
const GUILD_ROOM_SEAT_SELECTED = AnalyticEvents.GUILD_ROOM_SEAT_SELECTED;
let userId = c22872_2.userId;
let guildId = c22872_2.guildId;
const channelId = c22872_2.channelId;
if (userId == null) {
userId = AuthenticationStore.getId();
}
const roomUsers = GuildRoomStore.getRoomUsers(channelId);
if (guildId == null) {
const channel = ChannelStore.getChannel(channelId);
let r27 = channel == null ? void 0 : channel.getGuildId();
if (r27 == null) {
r27 = void 0;
}
guildId = r27;
}
const r29 = {
...{
user_id: userId,
guild_id: guildId,
channel_id: channelId,
guild_room_user_count: roomUsers.size,
guild_room_user_connected: roomUsers.has(userId)
},
seat_name: (0, getSeatName)(actualSeatPosition.x, actualSeatPosition.y),
seat_position_v2: [actualSeatPosition.x, actualSeatPosition.y]
};
const update_reason = actualSeatPosition.x === targetSeatPosition?.x ? actualSeatPosition.y !== targetSeatPosition?.y ? "default" : "user_selected" : "default";
r29.update_reason = update_reason;
const channelId2 = c22872_2.channelId;
const seated_user_ids = [];
let c28283_0 = seated_user_ids;
const seated_user_seat_names = [];
let c28283_1 = seated_user_seat_names;
const seated_user_x_positions = [];
let c28283_2 = seated_user_x_positions;
const seated_user_y_positions = [];
let c28283_3 = seated_user_y_positions;
GuildRoomStore.getRoomUsers(channelId2).forEach((item, index) => {
c28283_0.push(index);
c28283_1.push((0, getSeatName)(item.position.x, item.position.y));
c28283_2.push(item.position.x);
c28283_3.push(item.position.y);
});
HermesBuiltin.copyDataProperties(r29, {
seated_user_ids,
seated_user_seat_names,
seated_user_x_positions,
seated_user_y_positions
});
HermesBuiltin.copyDataProperties(r29, a0);
AppAnalyticsUtils.trackWithMetadata(GUILD_ROOM_SEAT_SELECTED, r29);
};
const r19 = env22873 = {
$parent: env11614
};
env22873[0] = channelId;
env22873[1] = r7;
env22873[2] = void 0;
const r5 = $mk98940(r19);
env22873[3] = r5;
const mediaSessionId = RTCConnectionStore.getMediaSessionId();
if (mediaSessionId == null) {
env22873[2] = setTimeout($mk98941(r19), 2500);
RTCConnectionStore.addChangeListener(r5);
} else {
r7({
voice_state_count: Object.keys(VoiceStateStore.getVoiceStatesForChannel(channelId)).length,
voice_media_session_id: mediaSessionId
});
}
}
export function trackGuildRoomUserInteracted({ targetUserId, interactionType: interactionType3, ...rest }) {
let env22875;
let c22874_2 = rest;
const channelId = rest.channelId;
const r7 = (a0) => {
const GUILD_ROOM_USER_INTERACTED = AnalyticEvents.GUILD_ROOM_USER_INTERACTED;
let userId = c22874_2.userId;
let guildId = c22874_2.guildId;
const channelId = c22874_2.channelId;
if (userId == null) {
userId = AuthenticationStore.getId();
}
const roomUsers = GuildRoomStore.getRoomUsers(channelId);
if (guildId == null) {
const channel = ChannelStore.getChannel(channelId);
let r27 = channel == null ? void 0 : channel.getGuildId();
if (r27 == null) {
r27 = void 0;
}
guildId = r27;
}
AppAnalyticsUtils.trackWithMetadata(GUILD_ROOM_USER_INTERACTED, {
...{
user_id: userId,
guild_id: guildId,
channel_id: channelId,
guild_room_user_count: roomUsers.size,
guild_room_user_connected: roomUsers.has(userId)
},
target_user_id: targetUserId,
interaction_type: interactionType3,
...a0
});
};
const r19 = env22875 = {
$parent: env11614
};
env22875[0] = channelId;
env22875[1] = r7;
env22875[2] = void 0;
const r5 = $mk98940(r19);
env22875[3] = r5;
const mediaSessionId = RTCConnectionStore.getMediaSessionId();
if (mediaSessionId == null) {
env22875[2] = setTimeout($mk98941(r19), 2500);
RTCConnectionStore.addChangeListener(r5);
} else {
r7({
voice_state_count: Object.keys(VoiceStateStore.getVoiceStatesForChannel(channelId)).length,
voice_media_session_id: mediaSessionId
});
}
}
export function trackGuildRoomUserConnected(a0) {
let env22877;
let c22876_0 = a0;
const channelId = a0.channelId;
const r7 = (a0) => {
const GUILD_ROOM_USER_CONNECTED = AnalyticEvents.GUILD_ROOM_USER_CONNECTED;
let userId = c22876_0.userId;
let guildId = c22876_0.guildId;
const channelId = c22876_0.channelId;
if (userId == null) {
userId = AuthenticationStore.getId();
}
const roomUsers = GuildRoomStore.getRoomUsers(channelId);
if (guildId == null) {
const channel = ChannelStore.getChannel(channelId);
let r27 = channel == null ? void 0 : channel.getGuildId();
if (r27 == null) {
r27 = void 0;
}
guildId = r27;
}
AppAnalyticsUtils.trackWithMetadata(GUILD_ROOM_USER_CONNECTED, {
...{
user_id: userId,
guild_id: guildId,
channel_id: channelId,
guild_room_user_count: roomUsers.size,
guild_room_user_connected: roomUsers.has(userId)
},
...a0
});
};
const r6 = env22877 = {
$parent: env11614
};
env22877[0] = channelId;
env22877[1] = r7;
env22877[2] = void 0;
const r5 = $mk98940(r6);
env22877[3] = r5;
const mediaSessionId = RTCConnectionStore.getMediaSessionId();
if (mediaSessionId == null) {
env22877[2] = setTimeout($mk98941(r6), 2500);
RTCConnectionStore.addChangeListener(r5);
} else {
r7({
voice_state_count: Object.keys(VoiceStateStore.getVoiceStatesForChannel(channelId)).length,
voice_media_session_id: mediaSessionId
});
}
}
export function trackGuildRoomUserDisconnected(a0) {
const GUILD_ROOM_USER_DISCONNECTED = AnalyticEvents.GUILD_ROOM_USER_DISCONNECTED;
let userId = a0.userId;
let guildId = a0.guildId;
const channelId = a0.channelId;
if (userId == null) {
userId = AuthenticationStore.getId();
}
const roomUsers = GuildRoomStore.getRoomUsers(channelId);
if (guildId == null) {
const channel = ChannelStore.getChannel(channelId);
let r26 = channel == null ? void 0 : channel.getGuildId();
if (r26 == null) {
r26 = void 0;
}
guildId = r26;
}
AppAnalyticsUtils.trackWithMetadata(GUILD_ROOM_USER_DISCONNECTED, {
...{
user_id: userId,
guild_id: guildId,
channel_id: channelId,
guild_room_user_count: roomUsers.size,
guild_room_user_connected: roomUsers.has(userId)
},
voice_state_count: Object.keys(VoiceStateStore.getVoiceStatesForChannel(a0.channelId)).length,
voice_media_session_id: GuildRoomStore.getMediaSessionId(a0.channelId)
});
}
export function trackGuildRoomUserUpdated({ update, ...rest }) {
let env22879;
let c22878_1 = rest;
const channelId = rest.channelId;
const r7 = (a0) => {
const GUILD_ROOM_USER_UPDATED = AnalyticEvents.GUILD_ROOM_USER_UPDATED;
let userId = c22878_1.userId;
let guildId = c22878_1.guildId;
const channelId = c22878_1.channelId;
if (userId == null) {
userId = AuthenticationStore.getId();
}
const roomUsers = GuildRoomStore.getRoomUsers(channelId);
if (guildId == null) {
const channel = ChannelStore.getChannel(channelId);
let r27 = channel == null ? void 0 : channel.getGuildId();
if (r27 == null) {
r27 = void 0;
}
guildId = r27;
}
const r29 = {
...{
user_id: userId,
guild_id: guildId,
channel_id: channelId,
guild_room_user_count: roomUsers.size,
guild_room_user_connected: roomUsers.has(userId)
}
};
const r36 = {
update_type: update.updateType,
update_reason: update.updateReason
};
const updateType = update.updateType;
HermesBuiltin.copyDataProperties(r29, updateType === "position" ? {
...r36,
position_v2: [update.position.x, update.position.y]
} : updateType === "status_id" ? {
...r36,
status_id: update.statusId
} : updateType === "status_text" ? {
...r36,
status_text: update.statusText
} : void 0);
HermesBuiltin.copyDataProperties(r29, a0);
AppAnalyticsUtils.trackWithMetadata(GUILD_ROOM_USER_UPDATED, r29);
};
const r18 = env22879 = {
$parent: env11614
};
env22879[0] = channelId;
env22879[1] = r7;
env22879[2] = void 0;
const r5 = $mk98940(r18);
env22879[3] = r5;
const mediaSessionId = RTCConnectionStore.getMediaSessionId();
if (mediaSessionId == null) {
env22879[2] = setTimeout($mk98941(r18), 2500);
RTCConnectionStore.addChangeListener(r5);
} else {
r7({
voice_state_count: Object.keys(VoiceStateStore.getVoiceStatesForChannel(channelId)).length,
voice_media_session_id: mediaSessionId
});
}
}
+279
View File
@@ -0,0 +1,279 @@
// Metro module 16198 (f16199).
import { GuildRoomBackgrounds } from "../../_bundle/Module16199";
import { intl } from "../../intl/index.native";
import GuildRooms_messages from "./GuildRooms.messages";
import Module16200 from "../../_bundle/Module16200";
import { GUILD_ROOM_BACKGROUND_POSITIONS } from "../../_bundle/Module16201";
function $mk98950($env) {
return () => {
const r6 = $env;
const r2 = $env.$parent;
const r8 = r2[0];
const r7 = r2[2];
return r8(r7[1]).intl.formatToPlainString((0, r2[1])(r7[2]).crFI7e, {
seatType: r8(r7[1]).intl.string(r6[0]),
number: r6[1]
});
};
}
function $mk98951($env) {
return () => {
const r5 = $env;
const r1 = $env.$parent;
const r7 = r1[0];
const r6 = r1[2];
return r7(r6[1]).intl.formatToPlainString((0, r1[1])(r6[2]).LFdLjz, {
seatType: r7(r6[1]).intl.string(r5[0]),
position: r7(r6[1]).intl.string(r5[1])
});
};
}
let c11616_1, c11617_1, c11618_1, c11624_1, c11625_1, c11627_0, c11627_1, c11628_0, c11628_1, c11629_0, c11629_1, c11630_0, c11631_1, c11632_1, c11633_1, c11634_1, c11635_1, c11636_1, c11615_3;
let env11615;
let env11616;
let env11617;
let env11618;
let env11619;
let env11620;
let env11621;
let env11622;
let env11623;
let env11624;
let env11625;
let env11626;
let env11627;
let env11628;
let env11629;
let env11630;
let env11631;
let env11632;
let env11633;
let env11634;
let env11635;
let env11636;
const r6 = env11615 = {};
const r19 = {};
const DEFAULT = GuildRoomBackgrounds.DEFAULT;
const r26 = {
background: Module16200,
aspectRatio: 1.375514403292181,
getName: () => intl.string(GuildRooms_messages["4KcB5R"]),
seats: null,
plants: null
};
const r30 = env11616 = {
$parent: r6
};
c11616_1 = 1;
const r12 = {
name: "PC_SEAT_1",
getLabel: $mk98950(r30),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][0]
};
const r44 = env11617 = {
$parent: r6
};
c11617_1 = 2;
const r46 = {
name: "PC_SEAT_2",
getLabel: $mk98950(r44),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][1]
};
const r59 = env11618 = {
$parent: r6
};
c11618_1 = 3;
const r61 = {
name: "PC_SEAT_3",
getLabel: $mk98950(r59),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][2]
};
const r76 = env11619 = {
$parent: r6
};
const r78 = {
name: "DUO_SEAT_1",
getLabel: $mk98951(r76),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][3]
};
const r94 = env11620 = {
$parent: r6
};
const r96 = {
name: "DUO_SEAT_2",
getLabel: $mk98951(r94),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][4]
};
const r112 = env11621 = {
$parent: r6
};
const r114 = {
name: "DUO_SEAT_STANDING_1",
getLabel: $mk98951(r112),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][5]
};
const r130 = env11622 = {
$parent: r6
};
const r132 = {
name: "MAIN_COUCH_SEAT_1",
getLabel: $mk98951(r130),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][6]
};
const r148 = env11623 = {
$parent: r6
};
const r150 = {
name: "MAIN_COUCH_SEAT_2",
getLabel: $mk98951(r148),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][7]
};
const r165 = GuildRooms_messages["yG+xS0"];
const r166 = env11624 = {
$parent: r6
};
c11624_1 = r165;
const r168 = {
name: "MAIN_COUCH_SEAT_3",
getLabel: $mk98951(r166),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][8]
};
const r183 = GuildRooms_messages["5ZigwU"];
const r184 = env11625 = {
$parent: r6
};
c11625_1 = r183;
const r186 = {
name: "MAIN_COUCH_SEAT_4",
getLabel: $mk98951(r184),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][9]
};
const r202 = env11626 = {
$parent: r6
};
const r204 = {
name: "MAIN_COUCH_SEAT_5",
getLabel: $mk98951(r202),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][10]
};
const r216 = GuildRooms_messages["C+LGlh"];
const r217 = env11627 = {
$parent: r6
};
c11627_0 = r216;
c11627_1 = 1;
const r219 = {
name: "SIDE_GROUP_SEAT_1",
getLabel: $mk98950(r217),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][11]
};
const r231 = GuildRooms_messages["C+LGlh"];
const r232 = env11628 = {
$parent: r6
};
c11628_0 = r231;
c11628_1 = 2;
const r234 = {
name: "SIDE_GROUP_SEAT_2",
getLabel: $mk98950(r232),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][12]
};
const r246 = GuildRooms_messages["C+LGlh"];
const r247 = env11629 = {
$parent: r6
};
c11629_0 = r246;
c11629_1 = 3;
const r249 = {
name: "SIDE_GROUP_SEAT_3",
getLabel: $mk98950(r247),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][13]
};
const r261 = GuildRooms_messages["C+LGlh"];
const r265 = env11630 = {
$parent: r6
};
c11630_0 = r261;
const r267 = {
name: "SIDE_GROUP_SEAT_STANDING_1",
getLabel: $mk98951(r265),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][14]
};
const r280 = env11631 = {
$parent: r6
};
c11631_1 = 1;
const r282 = {
name: "BACKROOM_SEAT_1",
getLabel: $mk98950(r280),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][15],
dim: true
};
const r295 = env11632 = {
$parent: r6
};
c11632_1 = 2;
const r297 = {
name: "BACKROOM_SEAT_2",
getLabel: $mk98950(r295),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][16],
dim: true
};
const r310 = env11633 = {
$parent: r6
};
c11633_1 = 3;
const r312 = {
name: "BACKROOM_SEAT_3",
getLabel: $mk98950(r310),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][17],
dim: true
};
const r325 = env11634 = {
$parent: r6
};
c11634_1 = 1;
const r327 = {
name: "RAFTERS_SEAT_1",
getLabel: $mk98950(r325),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][18]
};
const r340 = env11635 = {
$parent: r6
};
c11635_1 = 2;
const r342 = {
name: "RAFTERS_SEAT_2",
getLabel: $mk98950(r340),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][19]
};
const r355 = env11636 = {
$parent: r6
};
c11636_1 = 3;
r26.seats = [r12, r46, r61, r78, r96, r114, r132, r150, r168, r186, r204, r219, r234, r249, r267, r282, r297, r312, r327, r342, {
name: "RAFTERS_SEAT_3",
getLabel: $mk98950(r355),
position: GUILD_ROOM_BACKGROUND_POSITIONS[GuildRoomBackgrounds.DEFAULT][20]
}];
r26.plants = [{
x: 45.57,
y: 50.62
}];
r19[DEFAULT] = r26;
c11615_3 = r19;
export const GUILD_ROOM_SPATIAL_AUDIO_MODE = "guild-room";
export const DEFAULT_BACKGROUND_POSITION = {
imageOffsetX: 0,
imageOffsetY: 0,
imageWidth: 0,
imageHeight: 0
};
export function getSeatName(c22880_0, c22880_1) {
let r19 = c11615_3[GuildRoomBackgrounds.DEFAULT].seats.find((seat) => seat.position.x === c22880_0 && seat.position.y === c22880_1)?.name;
if (r19 == null) {
r19 = "";
}
return r19;
}
export { r19 as GUILD_ROOM_BACKGROUND_CONFIG };
+159
View File
@@ -0,0 +1,159 @@
// Metro module 16192 (f16193).
import AuthenticationStore from "../../stores/AuthenticationStore";
import ChannelStore from "../../stores/ChannelStore";
import GuildRoomStore from "./GuildRoomStore";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
import GuildRoomsExperiment from "./GuildRoomsExperiment";
import { guildRoomDisconnect, guildRoomConnect, guildRoomLocalDisconnect, guildRoomToggleLayout } from "./GuildRoomActionCreators.native";
let c11610_7 = null;
let c11610_8 = null;
class GuildRoomManager extends AutomaticLifecycleManager {
actions = {
VOICE_STATE_UPDATES: (a0) => this.handleVoiceStateUpdates(a0),
EMBEDDED_ACTIVITY_LAUNCH_SUCCESS: (a0) => this.handleEmbeddedActivityLaunchSuccess(a0)
};
isExperimentEnabled(a0, a1) {
return GuildRoomsExperiment.getCurrentConfig({
guildId: a0,
location: a1
}).enabled;
}
async handleVoiceStateUpdates({ voiceStates }) {
let r32;
const _this = this;
let c28271_0, voiceStates2, c28271_4;
let c28271_5 = 0;
let c30986_0, c30986_1, c30986_2, c30986_3, c30986_4, c30986_5, c30986_6;
L52: {
L51: {
try {
c30986_0 = void 0;
c30986_1 = void 0;
c30986_2 = void 0;
c30986_3 = void 0;
c30986_4 = void 0;
c30986_5 = void 0;
c30986_6 = void 0;
voiceStates2 = voiceStates;
const r44 = voiceStates[Symbol.iterator]();
voiceStates2 = r44.next;
c28271_0 = r44;
while (true) {
const r46 = voiceStates2;
let r47 = c28271_0;
const r17 = r47 === void 0 ? void 0 : (r32 = r46.call(r47)).done ? r47 = void 0 : r32.value;
c28271_0 = r47;
if (r47 === void 0) {
break L52;
}
c28271_5 = 1;
c30986_0 = r17;
c30986_1 = c30986_0.userId;
c30986_2 = c30986_0.guildId;
c30986_3 = c30986_0.channelId;
c30986_4 = c30986_0.sessionId;
c30986_5 = c30986_0.oldChannelId;
if (c30986_1 === AuthenticationStore.getId()) {
if (c30986_4 === AuthenticationStore.getSessionId()) {
if (c30986_3 !== c11610_7) {
if (c11610_7 != null && c11610_8 != null && _this.isExperimentEnabled(c11610_8, "VOICE_STATE_UPDATE")) {
await guildRoomDisconnect(c11610_8, c11610_7);
loop29: while (true) {
if (c30986_3 != null && c30986_2 != null) {
c30986_6 = GuildRoomStore.getPendingPosition();
if (_this.isExperimentEnabled(c30986_2, "VOICE_STATE_UPDATE")) {
guildRoomConnect(c30986_2, c30986_3, c30986_6);
}
}
c11610_7 = c30986_3;
c11610_8 = c30986_2;
while (true) {
c28271_5 = 0;
const r192 = voiceStates2;
let r193 = c28271_0;
const r194 = r193 === void 0 ? void 0 : (r32 = r192.call(r193)).done ? r193 = void 0 : r32.value;
c28271_0 = r193;
if (r193 === void 0) {
break L51;
}
c28271_5 = 1;
c30986_0 = r194;
c30986_1 = c30986_0.userId;
c30986_2 = c30986_0.guildId;
c30986_3 = c30986_0.channelId;
c30986_4 = c30986_0.sessionId;
c30986_5 = c30986_0.oldChannelId;
if (c30986_1 === AuthenticationStore.getId()) {
if (c30986_4 === AuthenticationStore.getSessionId()) {
if (c30986_3 !== c11610_7) {
if (c11610_7 != null && c11610_8 != null && _this.isExperimentEnabled(c11610_8, "VOICE_STATE_UPDATE")) {
await guildRoomDisconnect(c11610_8, c11610_7);
continue loop29;
}
continue loop29;
}
}
} else if (c30986_5 != null && c30986_5 !== c30986_3) {
guildRoomLocalDisconnect(c30986_1, c30986_5);
}
}
}
} else {
if (c30986_3 != null && c30986_2 != null) {
c30986_6 = GuildRoomStore.getPendingPosition();
if (_this.isExperimentEnabled(c30986_2, "VOICE_STATE_UPDATE")) {
guildRoomConnect(c30986_2, c30986_3, c30986_6);
}
}
c11610_7 = c30986_3;
c11610_8 = c30986_2;
}
}
}
} else if (c30986_5 != null && c30986_5 !== c30986_3) {
guildRoomLocalDisconnect(c30986_1, c30986_5);
}
c28271_5 = 0;
}
} catch ($e) {
const r40 = $e;
let r8 = r40;
c28271_4 = r40;
if (c28271_5 !== 0) {
while (true) {
try {
const r284 = c28271_4;
c28271_5 = 0;
const r286 = c28271_0;
if (r286 !== void 0 && typeof r286.return === "function") {
try {
r286.return();
} catch {}
}
throw r284;
} catch (r282) {
r8 = r282;
c28271_4 = r282;
if (c28271_5 === 0) {
break;
}
}
}
}
throw r8;
}
}
return void 0;
}
}
handleEmbeddedActivityLaunchSuccess(a0) {
if (a0.channelId != null) {
const channel = ChannelStore.getChannel(a0.channelId);
if (channel != null && this.isExperimentEnabled(channel.guild_id, "EMBEDDED_ACTIVITY_LAUNCH_SUCCESS") && GuildRoomStore.isVisible(a0.channelId)) {
guildRoomToggleLayout(a0.channelId, true);
}
}
}
}
const guildRoomManager = new GuildRoomManager();
export default guildRoomManager;
@@ -0,0 +1,64 @@
// Metro module 16203 (f16204).
import AuthenticationStore from "../../stores/AuthenticationStore";
import GuildRoomStore from "./GuildRoomStore";
import { GUILD_ROOM_BACKGROUND_CONFIG, GUILD_ROOM_SPATIAL_AUDIO_MODE } from "./GuildRoomConstants";
import { GuildRoomBackgrounds } from "../../_bundle/Module16199";
import { useStateFromStores } from "../../_bundle/Module589";
import GuildRoomsExperiment from "./GuildRoomsExperiment";
let c11638_7;
const computeLivingRoomWorldPoints = function computeLivingRoomWorldPoints({ users, currentUserId, channelId: channelId2 }) {
let r15 = users.get(currentUserId)?.position;
if (r15 == null) {
r15 = null;
}
let c22883_1 = r15;
let r20 = GuildRoomStore.getRoom(channelId2)?.background;
if (r20 == null) {
r20 = GuildRoomBackgrounds.DEFAULT;
}
const aspectRatio = GUILD_ROOM_BACKGROUND_CONFIG[r20].aspectRatio;
return Object.fromEntries([...users.values()].filter((item) => item.userId !== currentUserId).map(({ userId, position }) => {
const r11 = [userId, ,];
let r12 = c22883_1;
if (r12 == null) {
r12 = c11638_7;
}
r11[1] = {
worldX: (position.x - r12.x) / 100 * aspectRatio * 8,
worldY: 0,
worldZ: 8 * ((position.y - r12.y) / 100)
};
return r11;
}));
};
c11638_7 = {
x: 50,
y: 50
};
export { computeLivingRoomWorldPoints };
export function livingRoomWorldPointToMediaEnginePoint(a0) {
return {
x: a0.worldX,
y: a0.worldY,
z: a0.worldZ
};
}
export function useGuildRoomSpatialAudio({ channelId, guildId, mode }) {
let c22884_2;
c22884_2 = void 0;
const stateFromStores = useStateFromStores([AuthenticationStore], () => AuthenticationStore.getId());
const available = GuildRoomsExperiment.useExperiment({
guildId,
location: "SpatialAudioPanel"
}).interactionsEnabled && guildId != null;
const r24 = available && mode === GUILD_ROOM_SPATIAL_AUDIO_MODE;
c22884_2 = r24;
return {
available,
worldPoints: useStateFromStores([GuildRoomStore], () => c22884_2 && channelId != null ? computeLivingRoomWorldPoints({
users: GuildRoomStore.getRoomUsers(channelId),
currentUserId: stateFromStores,
channelId
}) : {}, [r24, channelId, stateFromStores])
};
}
@@ -0,0 +1,65 @@
// Metro module 16202 (f16203).
import _slicedToArray from "../../_bundle/_slicedToArray";
import ExperimentStore from "../experiments/ExperimentStore";
import ApexExperimentStore from "../experiments/apex/ApexExperimentStore";
import AuthenticationStore from "../../stores/AuthenticationStore";
import ChannelStore from "../../stores/ChannelStore";
import MediaEngineStore from "../../stores/MediaEngineStore";
import RTCConnectionStore from "../../stores/RTCConnectionStore";
import GuildRoomStore from "./GuildRoomStore";
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
import AudioActionCreators from "../../actions/AudioActionCreators";
import GuildRoomsExperiment from "./GuildRoomsExperiment";
import { computeLivingRoomWorldPoints, livingRoomWorldPointToMediaEnginePoint } from "./GuildRoomSpatialAudio";
class GuildRoomSpatialAudioManager extends AutomaticLifecycleManager {
actions = {
AUDIO_SET_AUDIO_MIXER_SETTINGS: () => this.apply(),
RTC_CONNECTION_STATE: () => this.apply(),
RTC_CONNECTION_USERS_MERGED: () => this.apply(),
MEDIA_SESSION_JOINED: () => this.apply(),
GUILD_ROOM_CONNECT: () => this.apply(),
GUILD_ROOM_UPDATE: () => this.apply(),
GUILD_ROOM_LOCAL_UPDATE: () => this.apply(),
GUILD_ROOM_DISCONNECT: () => this.apply()
};
reapplyForExperimentUpdate = () => {
AudioActionCreators.setAudioMixerSettings(MediaEngineStore.getAudioMixerSettings());
this.apply();
};
_initialize() {
this.stores = new Map().set(ExperimentStore, this.reapplyForExperimentUpdate).set(ApexExperimentStore, this.reapplyForExperimentUpdate);
}
_terminate() {}
isLivingRoomAvailable() {
const guildId = RTCConnectionStore.getGuildId();
return guildId != null && GuildRoomsExperiment.getCurrentConfig({
guildId,
location: "GuildRoomSpatialAudioManager"
}, {
autoTrackExposure: false
}).interactionsEnabled;
}
apply() {
if (MediaEngineStore.getAudioMixerSettings().enabled) {
const channelId = RTCConnectionStore.getChannelId();
if (channelId != null && this.isLivingRoomAvailable()) {
const channel = ChannelStore.getChannel(channelId);
if (!(channel == null ? void 0 : channel.isGuildStageVoice())) {
let c22882_0 = computeLivingRoomWorldPoints({
users: GuildRoomStore.getRoomUsers(channelId),
currentUserId: AuthenticationStore.getId(),
channelId
});
MediaEngineStore.getMediaEngine().eachConnection((a0) => {
for (const item of Object.entries(c22882_0)) {
const r32 = _slicedToArray(item, 2);
a0.setUserPosition(r32[0], livingRoomWorldPointToMediaEnginePoint(r32[1]));
}
});
}
}
}
}
}
const guildRoomSpatialAudioManager = new GuildRoomSpatialAudioManager();
export default guildRoomSpatialAudioManager;
+242
View File
@@ -0,0 +1,242 @@
// Metro module 16193 (f16194).
import _objectWithoutProperties from "../../_bundle/_objectWithoutProperties";
import AuthenticationStore from "../../stores/AuthenticationStore";
import RTCConnectionStore from "../../stores/RTCConnectionStore";
import SelectedChannelStore from "../../stores/SelectedChannelStore";
import Module589 from "../../_bundle/Module589";
import { GuildRoomObjectTypes } from "./GuildRoomTypes";
import Dispatcher from "../../Dispatcher";
let _excluded, _excluded2, _excluded3, c11611_9, c11611_10, c11611_11, c11611_12, c11611_13, c11611_14, c11611_15, position, c11611_17, c11611_18, c11611_19, c11611_20;
const handleSelectedChannelStoreChange = function handleSelectedChannelStoreChange() {
const voiceChannelId = SelectedChannelStore.getVoiceChannelId();
if (voiceChannelId != null) {
c11611_18.delete(voiceChannelId);
let r9 = c11611_17[voiceChannelId];
if (r9 == null) {
r9 = true;
}
c11611_17[voiceChannelId] = r9;
}
};
const handleNoteCreateComplete = function handleNoteCreateComplete(a0) {
delete c11611_20[a0.roomId];
};
_excluded = ["users", "objects"];
_excluded2 = ["users", "objects"];
_excluded3 = ["users"];
c11611_9 = new Map();
c11611_10 = {};
c11611_11 = [];
c11611_12 = new Map();
c11611_13 = {};
c11611_14 = {};
c11611_15 = {};
position = null;
c11611_17 = {};
c11611_18 = new Map();
c11611_19 = false;
c11611_20 = {};
class GuildRoomStore extends Module589.Store {
initialize() {
this.waitFor(AuthenticationStore, RTCConnectionStore, SelectedChannelStore);
this.syncWith([SelectedChannelStore], handleSelectedChannelStoreChange);
}
getRoom(a0) {
let r4 = c11611_13[a0];
if (r4 == null) {
r4 = c11611_10;
}
return r4;
}
getRoomUsers(a0) {
let r4 = c11611_14[a0];
if (r4 == null) {
r4 = c11611_9;
}
return r4;
}
getRoomObjects(a0) {
let r4 = c11611_15[a0];
if (r4 == null) {
r4 = c11611_12;
}
return r4;
}
getPendingPosition() {
return position;
}
getMediaSessionId(a0) {
return c11611_18.get(a0);
}
isVisible(a0) {
let r4 = c11611_17[a0];
if (r4 == null) {
r4 = true;
}
return r4;
}
getPendingNote(a0) {
let r4 = c11611_20[a0];
if (r4 == null) {
r4 = null;
}
return r4;
}
getNotes(a0) {
let r13 = this.getRoomObjects(a0).get(GuildRoomObjectTypes.NOTE);
if (r13 == null) {
r13 = c11611_11;
}
return r13;
}
}
const guildRoomStore = new GuildRoomStore(Dispatcher, {
GUILD_ROOM_CONNECT: function handleConnect({ room, guildId }) {
const { users, objects } = room;
c11611_13[room.roomId] = _objectWithoutProperties(room, _excluded);
c11611_14[room.roomId] = users;
c11611_15[room.roomId] = objects;
if (guildId != null && position != null) {
position = null;
}
},
GUILD_ROOM_CONNECT_FAILURE: function handleConnectFailure({ roomId }) {
if (c11611_13[roomId] == null) {
return false;
}
const id = AuthenticationStore.getId();
const map = new Map(c11611_14[roomId]);
map.delete(id);
c11611_14[roomId] = map;
},
GUILD_ROOM_DISCONNECT: function handleDisconnect({ userId, roomId }) {
if (c11611_13[roomId] == null) {
return false;
}
const map = new Map(c11611_14[roomId]);
map.delete(userId);
c11611_14[roomId] = map;
if (c11611_19 && userId === AuthenticationStore.getId()) {
c11611_17[roomId] = true;
c11611_19 = false;
}
if (userId === AuthenticationStore.getId()) {
delete c11611_20[roomId];
}
},
GUILD_ROOM_UPDATE: function handleUpdate({ room }) {
const { users, objects } = room;
c11611_13[room.roomId] = _objectWithoutProperties(room, _excluded2);
c11611_15[room.roomId] = objects;
const id = AuthenticationStore.getId();
const r20 = c11611_14[room.roomId];
const r21 = r20 == null ? void 0 : r20.get(id);
c11611_14[room.roomId] = users;
if (r21 != null) {
const r25 = c11611_14[room.roomId];
if (r25 != null) {
r25.set(id, r21);
}
}
},
GUILD_ROOM_UPDATE_FAILURE: function handleUpdateFailure({ originalRoom, originalRoomUsers }) {
const r7 = c11611_13[originalRoom.roomId];
if (r7 == null) {
return false;
}
c11611_13[originalRoom.roomId] = {
...r7,
background: originalRoom.background
};
const id = AuthenticationStore.getId();
const r19 = originalRoomUsers.get(id);
if (r19 == null) {
const map = new Map(c11611_14[originalRoom.roomId]);
map.delete(id);
c11611_14[originalRoom.roomId] = map;
} else {
const r22 = c11611_14[originalRoom.roomId];
if (r22 != null) {
r22.set(id, r19);
}
}
},
GUILD_ROOM_FETCH_SUCCESS: function handleFetchSuccess({ room }) {
const users = room.users;
c11611_13[room.roomId] = _objectWithoutProperties(room, _excluded3);
c11611_14[room.roomId] = users;
},
GUILD_ROOM_LOCAL_POSITION_REQUESTED: function handleLocalPositionRequested(a0) {
position = a0.position;
},
GUILD_ROOM_TOGGLE_LAYOUT: function handleToggleLayout({ roomId, clearLayout }) {
c11611_17[roomId] = !c11611_17[roomId];
if (clearLayout) {
c11611_19 = true;
}
},
GUILD_ROOM_LOCAL_UPDATE: function handleLocalUpdate(a0) {
const { roomId, background } = a0;
let position2 = a0.position;
let statusId = a0.statusId;
let statusText = a0.statusText;
if (c11611_13[roomId] == null) {
return false;
}
const id = AuthenticationStore.getId();
if (background != null) {
c11611_13[roomId] = {
...c11611_13[roomId],
background
};
}
if (!(position2 == null && statusId == null)) {
const r22 = c11611_14[roomId].get(id);
if (r22 != null) {
const map = new Map(c11611_14[roomId]);
if (position2 == null) {
position2 = r22.position;
}
if (statusId == null) {
statusId = r22.statusId;
}
if (statusText == null) {
statusText = r22.statusText;
}
map.set(id, {
...r22,
position: position2,
statusId,
statusText
});
c11611_14[roomId] = map;
}
}
},
MEDIA_SESSION_JOINED: function handleMediaSessionJoined() {
const channelId = RTCConnectionStore.getChannelId();
const mediaSessionId = RTCConnectionStore.getMediaSessionId();
if (channelId != null && mediaSessionId != null) {
c11611_18.set(channelId, mediaSessionId);
}
},
GUILD_ROOM_PENDING_NOTE_START: function handlePendingNoteStart(a0) {
c11611_20[a0.roomId] = {
position: null
};
},
GUILD_ROOM_PENDING_NOTE_PLACE: function handlePendingNotePlace({ roomId, position: position2 }) {
const r5 = c11611_20[roomId];
if (r5 == null) {
return false;
}
c11611_20[roomId] = {
...r5,
position: position2
};
},
GUILD_ROOM_PENDING_NOTE_DELETE: handleNoteCreateComplete,
GUILD_ROOM_NOTE_CREATE_COMPLETE: handleNoteCreateComplete
});
export default guildRoomStore;
export { c11611_10 as DEFAULT_ROOM };
+8
View File
@@ -0,0 +1,8 @@
// Metro module 12815 (f12816).
const r9 = {
NOTE: 1,
1: "NOTE",
PLANT: 2,
2: "PLANT"
};
export { r9 as GuildRoomObjectTypes };
+43
View File
@@ -0,0 +1,43 @@
// Metro module 12814 (f12815).
import { GuildRoomObjectTypes } from "./GuildRoomTypes";
const serverGuildRoomObjectToClient = function serverGuildRoomObjectToClient(a0) {
return a0.object_type === GuildRoomObjectTypes.PLANT ? {
objectType: GuildRoomObjectTypes.PLANT,
...{
objectId: a0.object_id,
createdBy: a0.created_by,
updatedAt: a0.updated_at != null ? new Date(a0.updated_at) : void 0,
updatedBy: a0.updated_by
}
} : {
objectType: GuildRoomObjectTypes.NOTE,
...{
objectId: a0.object_id,
createdBy: a0.created_by,
updatedAt: a0.updated_at != null ? new Date(a0.updated_at) : void 0,
updatedBy: a0.updated_by
},
content: a0.content,
position: a0.position
};
};
export function serverGuildRoomToClient(a0) {
return {
roomId: a0.room_id,
users: a0.users.reduce((acc, user) => {
acc.set(user.user_id, {
userId: user.user_id,
position: user.position,
statusId: user.status_id,
statusText: user.status_text
});
return acc;
}, new Map()),
background: a0.background,
objects: Object.entries(a0.objects).reduce((acc, item) => {
const [r24, r8] = item;
acc.set(+r24, r8.map(serverGuildRoomObjectToClient));
return acc;
}, new Map())
};
}
@@ -0,0 +1,12 @@
// Metro module 2157 (f2158).
import { loadJsonAsset } from "../asset_json/native/AssetJsonUtils";
import * as _Module2158 from "../../_bundle/Module2158";
import { createLoader, makeMessagesProxy } from "../../_bundle/Module1274";
const loader = createLoader({
"en-US": () => loadJsonAsset(_Module2158).then((result) => ({
default: result
}))
}, "en-US");
const r21 = makeMessagesProxy(loader);
export default r21;
export { loader as messagesLoader };
@@ -0,0 +1,51 @@
// Metro module 16194 (f16195).
import { createExperiment } from "../experiments/index";
const experiment = createExperiment({
kind: "guild",
id: "2026-06_guild_rooms",
label: "Guild Rooms",
defaultConfig: {
enabled: false,
interactionsEnabled: false,
multipleRoomsEnabled: false,
posturesEnabled: false
},
treatments: [{
id: 1,
label: "Enable Guild Rooms in this guild",
config: {
enabled: true,
interactionsEnabled: true,
multipleRoomsEnabled: false,
posturesEnabled: true
}
}, {
id: 2,
label: "Enable Guild Rooms without Interactions",
config: {
enabled: true,
interactionsEnabled: false,
multipleRoomsEnabled: false,
posturesEnabled: true
}
}, {
id: 3,
label: "Enable Guild Rooms with Room Variants",
config: {
enabled: true,
interactionsEnabled: true,
multipleRoomsEnabled: true,
posturesEnabled: true
}
}, {
id: 4,
label: "Enable Guild Rooms without Postures",
config: {
enabled: true,
interactionsEnabled: true,
multipleRoomsEnabled: false,
posturesEnabled: false
}
}]
});
export default experiment;