// Metro module 13565 (f13566). import { ApplicationFlags, RPCErrors, RPCCommands } from "../../../../Constants"; import { createRPCCommand } from "../../../../_bundle/Module13535"; import { activityInstanceConnectedParticipantsScope, activityInstanceConnectedParticipants } from "../../helpers/activityInstanceConnectedParticipants"; import { validatePostMessageTransport, validateApplication } from "../../RPCHelpers"; import { hasApplicationFlag } from "../../../applications/utils/ApplicationFlagUtils"; import RPCError from "../../RPCError"; import getCurrentEmbeddedActivityChannel from "../../helpers/getCurrentEmbeddedActivityChannel"; import { createProxyTicket } from "../../../activities/EmbeddedActivitiesActionCreators"; const r22 = {}; r22[RPCCommands.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS] = createRPCCommand(RPCCommands.GET_ACTIVITY_INSTANCE_CONNECTED_PARTICIPANTS, { scope: activityInstanceConnectedParticipantsScope, handler: (a0) => { validatePostMessageTransport(a0.socket.transport); return activityInstanceConnectedParticipants(); } }); r22[RPCCommands.REQUEST_PROXY_TICKET_REFRESH] = createRPCCommand(RPCCommands.REQUEST_PROXY_TICKET_REFRESH, { scope: activityInstanceConnectedParticipantsScope, handler: async ({ socket }) => { let value; let c27513_3 = 0; try { validatePostMessageTransport(socket.transport); const r43 = validateApplication(socket.application); if (!hasApplicationFlag(socket.application, ApplicationFlags.EMBEDDED)) { throw new RPCError({ errorCode: RPCErrors.UNAUTHORIZED_FOR_APPLICATION }, "This application cannot access this API"); } const currentEmbeddedActivityChannel = getCurrentEmbeddedActivityChannel(); c27513_3 = 1; value = {}; value.ticket = await createProxyTicket(r43, currentEmbeddedActivityChannel?.id); c27513_3 = 0; } catch ($e) { let r8 = $e; if (c27513_3 !== 0) { while (true) { try { c27513_3 = 0; throw new RPCError({ errorCode: RPCErrors.UNKNOWN_ERROR }, "Failed to create proxy ticket"); } catch ($e) { r8 = $e; if (c27513_3 === 0) { break; } } } } throw r8; } return value; } }); export default r22;