local _ = game:GetService("VRService");
local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
local l_AppStorageService_0 = game:GetService("AppStorageService");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_Players_0 = game:GetService("Players");
local l_CorePackages_0 = game:GetService("CorePackages");
local _ = game:GetService("RobloxReplicatedStorage");
local l_RobloxGui_0 = l_CoreGui_0:WaitForChild("RobloxGui");
local v8 = require(l_RobloxGui_0.Modules.RobloxTranslator);
local v9 = require(l_RobloxGui_0.Modules.Common.IXPServiceWrapper);
local v10 = require(l_RobloxGui_0.Modules.Logger):new(script.Name);
local l_default_0 = require(l_CorePackages_0.Workspace.Packages.CallProtocol).CallProtocol.default;
local l_Enums_0 = require(l_CorePackages_0.Workspace.Packages.CallProtocol).Enums;
local l_game_EngineFeature_0 = game:GetEngineFeature("LoadStreamAnimationReplaceErrorsWithTelemetryFeature");
local l_game_EngineFeature_1 = game:GetEngineFeature("FaceAnimatorNotifyLODRecommendCameraInputDisable");
local v15 = game:DefineFastFlag("FacialAnimationStreamingClearTrackImprovementsV2", false);
game:DefineFastFlag("FacialAnimationStreamingValidateAnimatorBeforeRemoving", false);
game:DefineFastFlag("FacialAnimationStreamingSearchForReplacementWhenRemovingAnimator", false);
game:DefineFastFlag("StopStreamTrackOnDeath", false);
game:DefineFastFlag("FacialAnimationStreamingClearAllConnectionsFix", false);
game:DefineFastFlag("FacialAnimationStreamingIfNoDynamicHeadDisableA2C", false);
local v16 = game:DefineFastFlag("FacialAnimationStreamingCheckPauseStateAfterEmote2", false);
local v17 = require(l_RobloxGui_0.Modules.Flags.GetFFlagAvatarChatServiceEnabled);
local v18 = if not v17() then nil else game:GetService("AvatarChatService");
local l_FaceAnimatorService_0 = game:GetService("FaceAnimatorService");
local l_FacialAnimationStreamingServiceV2_0 = game:GetService("FacialAnimationStreamingServiceV2");
local v21 = game:DefineFastFlag("UXForCameraPerformanceEnabled", false);
local v22 = game:DefineFastInt("UXForCameraPerformanceSessionDelay", 300);
local v23 = game:DefineFastInt("UXForCameraPerformanceDeviceDelay", 43200);
local v24 = require(l_RobloxGui_0.Modules.Flags.GetFFlagUXForCameraPerformanceIXPEnabled);
local v25 = require(l_RobloxGui_0.Modules.Flags.GetFStringUXForCameraPerformanceIXPLayerName);
local v26 = require(l_RobloxGui_0.Modules.FacialAnimationStreaming.FacialAnimationStreamingHeartbeatStats);
if l_FaceAnimatorService_0 and l_FacialAnimationStreamingServiceV2_0 then
    l_FaceAnimatorService_0.FlipHeadOrientation = true;
    local v27 = require(l_RobloxGui_0.Modules.Emote.EmoteHelper);
    local v28 = require(l_RobloxGui_0.Modules.Tracker.TrackerMenu);
    local v29 = require(l_RobloxGui_0.Modules.Tracker.TrackerPromptType);
    local l_default_1 = require(l_RobloxGui_0.Modules.VoiceChat.VoiceChatServiceManager).default;
    local v31 = {
        CharacterAdded = "CharacterAdded",
        CharacterRemoving = "CharacterRemoving",
        CharacterDescendantAdded = "CharacterDescendantAdded",
        CharacterDescendantRemoving = "CharacterDescendantRemoving",
        AnimatorDataModelReady = "AnimatorDataModelReady",
        PlayerEmoted = "PlayerEmoted",
        PlayerChatted = "PlayerChatted",
        EmoteFinished = "EmoteFinished",
        PlayerDied = "PlayerDied"
    };
    local _ = v8:FormatByKey("Feature.FaceChat.Message.PlaceUnavailable");
    local v33 = false;
    local v34 = os.time();
    local v35 = {};
    local v36 = {};
    local v37 = {};
    local v38 = {};
    local v39 = {};
    local v40 = {};
    local v41 = nil;
    local v42 = nil;
    local v43 = nil;
    local v44 = nil;
    local v45 = nil;
    local function _(v46, v47)
        local v48 = "";
        local v49 = "";
        if v47 then
            if v47.UserId then
                v48 = tostring(v47.UserId);
            end;
            if v47.Name then
                v49 = v47.Name;
            end;
        end;
        v10:trace(string.format("%s {id: %s, name: %s}.", v46, v48, v49));
    end;
    local function _(v51, v52)
        if not (not v38[v51.UserId] or not v38[v51.UserId][v52]) then
            v38[v51.UserId][v52]:Disconnect();
            v38[v51.UserId][v52] = nil;
        end;
    end;
    local function v59(v54)
        if not game:GetFastFlag("FacialAnimationStreamingClearAllConnectionsFix") then
            for _, v56 in ipairs(v31) do
                if not (not v38[v54.UserId] or not v38[v54.UserId][v56]) then
                    v38[v54.UserId][v56]:Disconnect();
                    v38[v54.UserId][v56] = nil;
                end;
            end;
        else
            for _, v58 in pairs(v31) do
                if not (not v38[v54.UserId] or not v38[v54.UserId][v58]) then
                    v38[v54.UserId][v58]:Disconnect();
                    v38[v54.UserId][v58] = nil;
                end;
            end;
        end;
        v38[v54.UserId] = {};
    end;
    local function v63(v60)
        local v61 = "";
        local v62 = "";
        if v60 then
            if v60.UserId then
                v61 = tostring(v60.UserId);
            end;
            if v60.Name then
                v62 = v60.Name;
            end;
        end;
        v10:trace(string.format("%s {id: %s, name: %s}.", "clearCharacterAnimations", v61, v62));
        if v37[v60.UserId] then
            if not v15 then
                if v37[v60.UserId].animation then
                    v37[v60.UserId].animation:Destroy();
                    v37[v60.UserId].animation = nil;
                end;
                if v37[v60.UserId].animationTrack then
                    v37[v60.UserId].animationTrack:Stop(0);
                    v37[v60.UserId].animationTrack:Destroy();
                    v37[v60.UserId].animationTrack = nil;
                end;
            else
                if v37[v60.UserId].animationTrack then
                    v37[v60.UserId].animationTrack:Stop(0);
                    v37[v60.UserId].animationTrack = nil;
                end;
                if v37[v60.UserId].animation then
                    v37[v60.UserId].animation = nil;
                end;
            end;
            v37[v60.UserId] = nil;
        end;
    end;
    local function v65(v64)
        if not v64 or not v64.Character then
            return nil;
        else
            return v64.Character:FindFirstChildWhichIsA("FaceControls", true);
        end;
    end;
    local function v67(v66)
        if not v66.Character then
            return nil;
        else
            return v66.Character:FindFirstChildOfClass("Humanoid");
        end;
    end;
    local function v70(v68)
        local v69 = if not v68.Character then nil else v68.Character:FindFirstChildOfClass("Humanoid");
        if not v69 then
            return nil;
        else
            return v69:FindFirstChildOfClass("Animator");
        end;
    end;
    local function _(v71)
        if not (not v37[v71.UserId] or not v37[v71.UserId].animationTrack) then
            local v72 = "";
            local v73 = "";
            if v71 then
                if v71.UserId then
                    v72 = tostring(v71.UserId);
                end;
                if v71.Name then
                    v73 = v71.Name;
                end;
            end;
            v10:trace(string.format("%s {id: %s, name: %s}.", "Pausing facial streaming animations...", v72, v73));
            v37[v71.UserId].animationTrack:AdjustWeight(0.1, 0.5);
        end;
    end;
    local function _(v75)
        if not (not v37[v75.UserId] or not v37[v75.UserId].animationTrack) then
            local v76 = "";
            local v77 = "";
            if v75 then
                if v75.UserId then
                    v76 = tostring(v75.UserId);
                end;
                if v75.Name then
                    v77 = v75.Name;
                end;
            end;
            v10:trace(string.format("%s {id: %s, name: %s}.", "Resuming facial streaming animations...", v76, v77));
            v37[v75.UserId].animationTrack:AdjustWeight(1, 0.5);
        end;
    end;
    local function _()
        local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
        if l_LocalPlayer_0 then
            if not (l_FaceAnimatorService_0.AudioAnimationEnabled or l_FaceAnimatorService_0.VideoAnimationEnabled) then
                if not (not v37[l_LocalPlayer_0.UserId] or not v37[l_LocalPlayer_0.UserId].animationTrack) then
                    local v80 = "";
                    local v81 = "";
                    if l_LocalPlayer_0 then
                        if l_LocalPlayer_0.UserId then
                            v80 = tostring(l_LocalPlayer_0.UserId);
                        end;
                        if l_LocalPlayer_0.Name then
                            v81 = l_LocalPlayer_0.Name;
                        end;
                    end;
                    v10:trace(string.format("%s {id: %s, name: %s}.", "Pausing facial streaming animations...", v80, v81));
                    v37[l_LocalPlayer_0.UserId].animationTrack:AdjustWeight(0.1, 0.5);
                end;
            elseif not (not v37[l_LocalPlayer_0.UserId] or not v37[l_LocalPlayer_0.UserId].animationTrack) then
                local v82 = "";
                local v83 = "";
                if l_LocalPlayer_0 then
                    if l_LocalPlayer_0.UserId then
                        v82 = tostring(l_LocalPlayer_0.UserId);
                    end;
                    if l_LocalPlayer_0.Name then
                        v83 = l_LocalPlayer_0.Name;
                    end;
                end;
                v10:trace(string.format("%s {id: %s, name: %s}.", "Resuming facial streaming animations...", v82, v83));
                v37[l_LocalPlayer_0.UserId].animationTrack:AdjustWeight(1, 0.5);
                return ;
            end;
            return ;
        else
            return ;
        end;
    end;
    local function v98(v85, v86, v87)
        local v88 = string.format("handleEmote {isChatTriggered:%s}", (tostring(v87)));
        local v89 = "";
        local v90 = "";
        if v85 then
            if v85.UserId then
                v89 = tostring(v85.UserId);
            end;
            if v85.Name then
                v90 = v85.Name;
            end;
        end;
        v10:trace(string.format("%s {id: %s, name: %s}.", v88, v89, v90));
        if v86 then
            v88 = v31.EmoteFinished;
            if not (not v38[v85.UserId] or not v38[v85.UserId][v88]) then
                v38[v85.UserId][v88]:Disconnect();
                v38[v85.UserId][v88] = nil;
            end;
            if not (not v37[v85.UserId] or not v37[v85.UserId].animationTrack) then
                v88 = "";
                v89 = "";
                if v85 then
                    if v85.UserId then
                        v88 = tostring(v85.UserId);
                    end;
                    if v85.Name then
                        v89 = v85.Name;
                    end;
                end;
                v10:trace(string.format("%s {id: %s, name: %s}.", "Pausing facial streaming animations...", v88, v89));
                v37[v85.UserId].animationTrack:AdjustWeight(0.1, 0.5);
            end;
            v38[v85.UserId][v31.EmoteFinished] = v27.createEmoteFinishEvent(v85, v86, v87):Connect(function()
                local l_v85_0 = v85;
                local l_EmoteFinished_0 = v31.EmoteFinished;
                if not (not v38[l_v85_0.UserId] or not v38[l_v85_0.UserId][l_EmoteFinished_0]) then
                    v38[l_v85_0.UserId][l_EmoteFinished_0]:Disconnect();
                    v38[l_v85_0.UserId][l_EmoteFinished_0] = nil;
                end;
                if not v16 then
                    l_v85_0 = v85;
                    if not (not v37[l_v85_0.UserId] or not v37[l_v85_0.UserId].animationTrack) then
                        l_EmoteFinished_0 = "";
                        local v93 = "";
                        if l_v85_0 then
                            if l_v85_0.UserId then
                                l_EmoteFinished_0 = tostring(l_v85_0.UserId);
                            end;
                            if l_v85_0.Name then
                                v93 = l_v85_0.Name;
                            end;
                        end;
                        v10:trace(string.format("%s {id: %s, name: %s}.", "Resuming facial streaming animations...", l_EmoteFinished_0, v93));
                        v37[l_v85_0.UserId].animationTrack:AdjustWeight(1, 0.5);
                    end;
                elseif not (l_FaceAnimatorService_0.AudioAnimationEnabled or l_FaceAnimatorService_0.VideoAnimationEnabled) then
                    l_EmoteFinished_0 = v85;
                    if not (not v37[l_EmoteFinished_0.UserId] or not v37[l_EmoteFinished_0.UserId].animationTrack) then
                        local v94 = "";
                        local v95 = "";
                        if l_EmoteFinished_0 then
                            if l_EmoteFinished_0.UserId then
                                v94 = tostring(l_EmoteFinished_0.UserId);
                            end;
                            if l_EmoteFinished_0.Name then
                                v95 = l_EmoteFinished_0.Name;
                            end;
                        end;
                        v10:trace(string.format("%s {id: %s, name: %s}.", "Pausing facial streaming animations...", v94, v95));
                        v37[l_EmoteFinished_0.UserId].animationTrack:AdjustWeight(0.1, 0.5);
                        return ;
                    end;
                else
                    l_EmoteFinished_0 = v85;
                    if not (not v37[l_EmoteFinished_0.UserId] or not v37[l_EmoteFinished_0.UserId].animationTrack) then
                        local v96 = "";
                        local v97 = "";
                        if l_EmoteFinished_0 then
                            if l_EmoteFinished_0.UserId then
                                v96 = tostring(l_EmoteFinished_0.UserId);
                            end;
                            if l_EmoteFinished_0.Name then
                                v97 = l_EmoteFinished_0.Name;
                            end;
                        end;
                        v10:trace(string.format("%s {id: %s, name: %s}.", "Resuming facial streaming animations...", v96, v97));
                        v37[l_EmoteFinished_0.UserId].animationTrack:AdjustWeight(1, 0.5);
                        return ;
                    end;
                end;
            end);
        end;
    end;
    local function v103(v99, v100)
        if if not v99.Character then nil else v99.Character:FindFirstChildOfClass("Humanoid") then
            local v101 = nil;
            if string.sub(v100, 1, 3) == "/e " then
                v101 = string.sub(v100, 4);
            elseif string.sub(v100, 1, 7) == "/emote " then
                v101 = string.sub(v100, 8);
            end;
            if not (not v101 or not v27.LegacyDefaultEmotes[v101]) then
                wait(v27.EMOTE_LOOP_TRANSITION_WAIT_TIME);
                local v102 = v27.getAnyActiveDefaultChatTriggeredEmoteTrack(v99);
                if v102 then
                    v98(v99, v102, true);
                end;
            end;
        end;
    end;
    local function v118(v104, v105)
        if v105 then
            if v105.Parent and v105.Parent:IsA("Humanoid") then
                if not v37[v104.UserId] then
                    local l_AnimatorDataModelReady_0 = v31.AnimatorDataModelReady;
                    if not (not v38[v104.UserId] or not v38[v104.UserId][l_AnimatorDataModelReady_0]) then
                        v38[v104.UserId][l_AnimatorDataModelReady_0]:Disconnect();
                        v38[v104.UserId][l_AnimatorDataModelReady_0] = nil;
                    end;
                    l_AnimatorDataModelReady_0 = function()
                        local v107 = {
                            animation = Instance.new("TrackerStreamAnimation")
                        };
                        v107.animationTrack = v105:LoadStreamAnimation(v107.animation);
                        if not l_game_EngineFeature_0 or v107.animationTrack then
                            v107.animationTrack.Priority = Enum.AnimationPriority.Idle;
                            v107.animationTrack:Play(0.1, 1);
                            v37[v104.UserId] = v107;
                            local v108 = l_FaceAnimatorService_0.AudioAnimationEnabled or l_FaceAnimatorService_0.VideoAnimationEnabled;
                            if not (not (v104 == l_Players_0.LocalPlayer) or v108) then
                                local l_v104_0 = v104;
                                if not (not v37[l_v104_0.UserId] or not v37[l_v104_0.UserId].animationTrack) then
                                    local v110 = "";
                                    local v111 = "";
                                    if l_v104_0 then
                                        if l_v104_0.UserId then
                                            v110 = tostring(l_v104_0.UserId);
                                        end;
                                        if l_v104_0.Name then
                                            v111 = l_v104_0.Name;
                                        end;
                                    end;
                                    v10:trace(string.format("%s {id: %s, name: %s}.", "Pausing facial streaming animations...", v110, v111));
                                    v37[l_v104_0.UserId].animationTrack:AdjustWeight(0.1, 0.5);
                                end;
                            end;
                            if game:GetFastFlag("FacialAnimationStreamingValidateAnimatorBeforeRemoving") then
                                v39[v104.UserId] = v105;
                            end;
                            return ;
                        else
                            return ;
                        end;
                    end;
                    if not v105:IsDescendantOf(game) then
                        v38[v104.UserId][v31.AnimatorDataModelReady] = v105.AncestryChanged:Connect(function(_, _)
                            if v105:IsDescendantOf(game) then
                                local l_v104_1 = v104;
                                local l_AnimatorDataModelReady_1 = v31.AnimatorDataModelReady;
                                if not (not v38[l_v104_1.UserId] or not v38[l_v104_1.UserId][l_AnimatorDataModelReady_1]) then
                                    v38[l_v104_1.UserId][l_AnimatorDataModelReady_1]:Disconnect();
                                    v38[l_v104_1.UserId][l_AnimatorDataModelReady_1] = nil;
                                end;
                                l_AnimatorDataModelReady_0();
                            end;
                        end);
                        return ;
                    else
                        l_AnimatorDataModelReady_0();
                        return ;
                    end;
                else
                    local v116 = "";
                    local v117 = "";
                    if v104 then
                        if v104.UserId then
                            v116 = tostring(v104.UserId);
                        end;
                        if v104.Name then
                            v117 = v104.Name;
                        end;
                    end;
                    v10:trace(string.format("%s {id: %s, name: %s}.", "onAnimatorAdded already done; skipping", v116, v117));
                    return ;
                end;
            else
                return ;
            end;
        else
            return ;
        end;
    end;
    local function v124(v119, v120)
        if v120 then
            local l_PlayerEmoted_0 = v31.PlayerEmoted;
            if not (not v38[v119.UserId] or not v38[v119.UserId][l_PlayerEmoted_0]) then
                v38[v119.UserId][l_PlayerEmoted_0]:Disconnect();
                v38[v119.UserId][l_PlayerEmoted_0] = nil;
            end;
            v38[v119.UserId][v31.PlayerEmoted] = v120.EmoteTriggered:Connect(function(v122, v123)
                if v122 then
                    v98(v119, v123, false);
                end;
            end);
            if game:GetFastFlag("StopStreamTrackOnDeath") then
                l_PlayerEmoted_0 = v31.PlayerDied;
                if not (not v38[v119.UserId] or not v38[v119.UserId][l_PlayerEmoted_0]) then
                    v38[v119.UserId][l_PlayerEmoted_0]:Disconnect();
                    v38[v119.UserId][l_PlayerEmoted_0] = nil;
                end;
                v38[v119.UserId][v31.PlayerDied] = v120.Died:Connect(function()
                    v63(v119);
                end);
            end;
            return ;
        else
            return ;
        end;
    end;
    local function v135(v125, v126)
        assert(game:GetFastFlag("FacialAnimationStreamingIfNoDynamicHeadDisableA2C"));
        if v125 ~= l_Players_0.LocalPlayer then
            return ;
        elseif v40[v125.UserId] ~= nil and v126 == v40[v125.UserId] then
            return ;
        else
            v40[v125.UserId] = v126;
            if not v40[v125.UserId] then
                if not l_FaceAnimatorService_0.AudioAnimationEnabled then
                    local v127 = "";
                    local v128 = "";
                    if v125 then
                        if v125.UserId then
                            v127 = tostring(v125.UserId);
                        end;
                        if v125.Name then
                            v128 = v125.Name;
                        end;
                    end;
                    v10:trace(string.format("%s {id: %s, name: %s}.", "FaceControls NOT found -> won't disable A2C (already is disabled)...", v127, v128));
                    return ;
                else
                    local v129 = "";
                    local v130 = "";
                    if v125 then
                        if v125.UserId then
                            v129 = tostring(v125.UserId);
                        end;
                        if v125.Name then
                            v130 = v125.Name;
                        end;
                    end;
                    v10:trace(string.format("%s {id: %s, name: %s}.", "FaceControls NOT found -> disabling A2C...", v129, v130));
                    l_FaceAnimatorService_0.AudioAnimationEnabled = false;
                    return ;
                end;
            elseif not l_default_1 or l_default_1.localMuted then
                local v131 = "";
                local v132 = "";
                if v125 then
                    if v125.UserId then
                        v131 = tostring(v125.UserId);
                    end;
                    if v125.Name then
                        v132 = v125.Name;
                    end;
                end;
                v10:trace(string.format("%s {id: %s, name: %s}.", "FaceControls found -> won't enable A2C (Mic is MUTED)...", v131, v132));
                return ;
            else
                local v133 = "";
                local v134 = "";
                if v125 then
                    if v125.UserId then
                        v133 = tostring(v125.UserId);
                    end;
                    if v125.Name then
                        v134 = v125.Name;
                    end;
                end;
                v10:trace(string.format("%s {id: %s, name: %s}.", "FaceControls found -> enabling A2C (Mic is ON)...", v133, v134));
                l_FaceAnimatorService_0.AudioAnimationEnabled = true;
                return ;
            end;
        end;
    end;
    local function v138(v136, v137)
        if v137:IsDescendantOf(game) then
            if not v137:IsA("Animator") then
                if not v137:IsA("Humanoid") then
                    if not (not game:GetFastFlag("FacialAnimationStreamingIfNoDynamicHeadDisableA2C") or not v137:IsA("MeshPart")) and v137.Name == "Head" then
                        v135(v136, v65(v136));
                        return ;
                    elseif not (not game:GetFastFlag("FacialAnimationStreamingIfNoDynamicHeadDisableA2C") or not v137:IsA("FaceControls")) then
                        v135(v136, v137);
                    end;
                else
                    v124(v136, v137);
                    return ;
                end;
            else
                v118(v136, v137);
                return ;
            end;
        end;
    end;
    local function v145(v139, v140)
        if not v140:IsA("Animator") then
            if not v140:IsA("Humanoid") then
                if not (not game:GetFastFlag("FacialAnimationStreamingIfNoDynamicHeadDisableA2C") or (not v140:IsA("MeshPart") or v140.Name ~= "Head") and not v140:IsA("FaceControls")) then
                    v135(v139, v65(v139));
                end;
            else
                local l_PlayerEmoted_1 = v31.PlayerEmoted;
                if not (not v38[v139.UserId] or not v38[v139.UserId][l_PlayerEmoted_1]) then
                    v38[v139.UserId][l_PlayerEmoted_1]:Disconnect();
                    v38[v139.UserId][l_PlayerEmoted_1] = nil;
                end;
                if game:GetFastFlag("StopStreamTrackOnDeath") then
                    l_PlayerEmoted_1 = v31.PlayerDied;
                    if not (not v38[v139.UserId] or not v38[v139.UserId][l_PlayerEmoted_1]) then
                        v38[v139.UserId][l_PlayerEmoted_1]:Disconnect();
                        v38[v139.UserId][l_PlayerEmoted_1] = nil;
                        return ;
                    end;
                end;
            end;
        elseif not game:GetFastFlag("FacialAnimationStreamingValidateAnimatorBeforeRemoving") then
            local l_AnimatorDataModelReady_2 = v31.AnimatorDataModelReady;
            if not (not v38[v139.UserId] or not v38[v139.UserId][l_AnimatorDataModelReady_2]) then
                v38[v139.UserId][l_AnimatorDataModelReady_2]:Disconnect();
                v38[v139.UserId][l_AnimatorDataModelReady_2] = nil;
            end;
            v63(v139);
            return ;
        elseif v140 == v39[v139.UserId] then
            local l_AnimatorDataModelReady_3 = v31.AnimatorDataModelReady;
            if not (not v38[v139.UserId] or not v38[v139.UserId][l_AnimatorDataModelReady_3]) then
                v38[v139.UserId][l_AnimatorDataModelReady_3]:Disconnect();
                v38[v139.UserId][l_AnimatorDataModelReady_3] = nil;
            end;
            v63(v139);
            v39[v139.UserId] = nil;
            if game:GetFastFlag("FacialAnimationStreamingSearchForReplacementWhenRemovingAnimator") then
                local v144 = if not v139.Character then nil else v139.Character:FindFirstChildOfClass("Humanoid");
                l_AnimatorDataModelReady_3 = if not v144 then nil else v144:FindFirstChildOfClass("Animator");
                if l_AnimatorDataModelReady_3 then
                    v118(v139, l_AnimatorDataModelReady_3);
                    return ;
                end;
            end;
        end;
    end;
    local function v152(v146, v147)
        local v148 = "";
        local v149 = "";
        if v146 then
            if v146.UserId then
                v148 = tostring(v146.UserId);
            end;
            if v146.Name then
                v149 = v146.Name;
            end;
        end;
        v10:trace(string.format("%s {id: %s, name: %s}.", "Player character added", v148, v149));
        v148 = v31.CharacterDescendantAdded;
        if not (not v38[v146.UserId] or not v38[v146.UserId][v148]) then
            v38[v146.UserId][v148]:Disconnect();
            v38[v146.UserId][v148] = nil;
        end;
        v148 = v31.CharacterDescendantRemoving;
        if not (not v38[v146.UserId] or not v38[v146.UserId][v148]) then
            v38[v146.UserId][v148]:Disconnect();
            v38[v146.UserId][v148] = nil;
        end;
        v38[v146.UserId][v31.CharacterDescendantAdded] = v147.DescendantAdded:Connect(function(v150)
            v138(v146, v150);
        end);
        v38[v146.UserId][v31.CharacterDescendantRemoving] = v147.DescendantRemoving:Connect(function(v151)
            v145(v146, v151);
        end);
        if game:GetFastFlag("FacialAnimationStreamingIfNoDynamicHeadDisableA2C") then
            v135(v146, v65(v146));
        end;
        v124(v146, v67(v146));
        v118(v146, v70(v146));
    end;
    local function v157(v153, _)
        local v155 = "";
        local v156 = "";
        if v153 then
            if v153.UserId then
                v155 = tostring(v153.UserId);
            end;
            if v153.Name then
                v156 = v153.Name;
            end;
        end;
        v10:trace(string.format("%s {id: %s, name: %s}.", "Player character removing", v155, v156));
        if not game:GetFastFlag("FacialAnimationStreamingClearAllConnectionsFix") then
            v59(v153);
        else
            v155 = v31.CharacterDescendantAdded;
            if not (not v38[v153.UserId] or not v38[v153.UserId][v155]) then
                v38[v153.UserId][v155]:Disconnect();
                v38[v153.UserId][v155] = nil;
            end;
            v155 = v31.CharacterDescendantRemoving;
            if not (not v38[v153.UserId] or not v38[v153.UserId][v155]) then
                v38[v153.UserId][v155]:Disconnect();
                v38[v153.UserId][v155] = nil;
            end;
        end;
        v63(v153);
    end;
    local function v167(v158)
        local v159 = "";
        local v160 = "";
        if v158 then
            if v158.UserId then
                v159 = tostring(v158.UserId);
            end;
            if v158.Name then
                v160 = v158.Name;
            end;
        end;
        v10:trace(string.format("%s {id: %s, name: %s}.", "Player update", v159, v160));
        v159 = v36[v158.UserId];
        v59(v158);
        if not v159 then
            v160 = "";
            local v161 = "";
            if v158 then
                if v158.UserId then
                    v160 = tostring(v158.UserId);
                end;
                if v158.Name then
                    v161 = v158.Name;
                end;
            end;
            v10:trace(string.format("%s {id: %s, name: %s}.", "Player update - left", v160, v161));
            v63(v158);
            return ;
        elseif not v37[v158.UserId] then
            v160 = "";
            local v162 = "";
            if v158 then
                if v158.UserId then
                    v160 = tostring(v158.UserId);
                end;
                if v158.Name then
                    v162 = v158.Name;
                end;
            end;
            v10:trace(string.format("%s {id: %s, name: %s}.", "Player update - joined", v160, v162));
            if v158.Character then
                v152(v158, v158.Character);
            end;
            v38[v158.UserId][v31.CharacterAdded] = v158.CharacterAdded:Connect(function(v163)
                v152(v158, v163);
            end);
            v38[v158.UserId][v31.CharacterRemoving] = v158.CharacterRemoving:Connect(function(v164)
                v157(v158, v164);
            end);
            v38[v158.UserId][v31.PlayerChatted] = v158.Chatted:Connect(function(v165)
                v103(v158, v165);
            end);
            return ;
        else
            v160 = "";
            local v166 = "";
            if v158 then
                if v158.UserId then
                    v160 = tostring(v158.UserId);
                end;
                if v158.Name then
                    v166 = v158.Name;
                end;
            end;
            v10:trace(string.format("%s {id: %s, name: %s}.", "Player already setup", v160, v166));
            return ;
        end;
    end;
    local function _(v168, v169)
        if not (not v37[v168] or not v37[v168].animationTrack) then
            v37[v168].animationTrack:TogglePause(v169);
        end;
    end;
    local function v173()
        for _, v172 in ipairs(l_Players_0:GetPlayers()) do
            v36[v172.UserId] = true;
            v167(v172);
        end;
    end;
    local function v200()
        local v174 = l_default_1:getService();
        local l_UserId_0 = l_Players_0.LocalPlayer.UserId;
        l_default_1.participantsUpdate.Event:Connect(function(v176)
            for v177, v178 in pairs(v176) do
                local v179 = tonumber(v177);
                if v179 ~= l_UserId_0 then
                    local l_isMutedLocally_0 = v178.isMutedLocally;
                    if not (not v37[v179] or not v37[v179].animationTrack) then
                        v37[v179].animationTrack:TogglePause(l_isMutedLocally_0);
                    end;
                end;
            end;
        end);
        if not v174 then
            v10:trace("Could not find VoiceChatService");
        else
            v174.ParticipantsStateChanged:Connect(function(v181, v182, _)
                for _, v185 in ipairs(v181) do
                    local l_l_Players_0_PlayerByUserId_0 = l_Players_0:GetPlayerByUserId(v185);
                    if l_l_Players_0_PlayerByUserId_0 then
                        local v187 = "";
                        local v188 = "";
                        if l_l_Players_0_PlayerByUserId_0 then
                            if l_l_Players_0_PlayerByUserId_0.UserId then
                                v187 = tostring(l_l_Players_0_PlayerByUserId_0.UserId);
                            end;
                            if l_l_Players_0_PlayerByUserId_0.Name then
                                v188 = l_l_Players_0_PlayerByUserId_0.Name;
                            end;
                        end;
                        v10:trace(string.format("%s {id: %s, name: %s}.", "Player leaving chat", v187, v188));
                        v35[l_l_Players_0_PlayerByUserId_0.UserId] = nil;
                        v167(l_l_Players_0_PlayerByUserId_0);
                    end;
                end;
                for _, v190 in ipairs(v182) do
                    local l_l_Players_0_PlayerByUserId_1 = l_Players_0:GetPlayerByUserId(v190);
                    if l_l_Players_0_PlayerByUserId_1 then
                        local v192 = "";
                        local v193 = "";
                        if l_l_Players_0_PlayerByUserId_1 then
                            if l_l_Players_0_PlayerByUserId_1.UserId then
                                v192 = tostring(l_l_Players_0_PlayerByUserId_1.UserId);
                            end;
                            if l_l_Players_0_PlayerByUserId_1.Name then
                                v193 = l_l_Players_0_PlayerByUserId_1.Name;
                            end;
                        end;
                        v10:trace(string.format("%s {id: %s, name: %s}.", "Player joining chat", v192, v193));
                        v35[l_l_Players_0_PlayerByUserId_1.UserId] = true;
                        v167(l_l_Players_0_PlayerByUserId_1);
                    end;
                end;
            end);
        end;
        l_Players_0.PlayerRemoving:Connect(function(v194)
            local v195 = "";
            local v196 = "";
            if v194 then
                if v194.UserId then
                    v195 = tostring(v194.UserId);
                end;
                if v194.Name then
                    v196 = v194.Name;
                end;
            end;
            v10:trace(string.format("%s {id: %s, name: %s}.", "Player leaving game", v195, v196));
            v36[v194.UserId] = nil;
            v167(v194);
        end);
        l_Players_0.PlayerAdded:Connect(function(v197)
            local v198 = "";
            local v199 = "";
            if v197 then
                if v197.UserId then
                    v198 = tostring(v197.UserId);
                end;
                if v197.Name then
                    v199 = v197.Name;
                end;
            end;
            v10:trace(string.format("%s {id: %s, name: %s}.", "Player joining game", v198, v199));
            v36[v197.UserId] = true;
            v167(v197);
        end);
    end;
    local function v201(v202)
        if v24() then
            local l_status_0, l_result_0 = pcall(function()
                return v9:GetLayerData(v25());
            end);
            if l_status_0 then
                if l_result_0 then
                    if not l_result_0.UXForCameraPerformanceEnabled then
                        return ;
                    end;
                else
                    return ;
                end;
            else
                return ;
            end;
        end;
        local v205 = os.time() - v34;
        if not v202 and v205 < v22 then
            task.delay(v22 - v205, function()
                v201(true);
            end);
            return ;
        else
            local v206 = 0;
            local l_status_1, l_result_1 = pcall(function()
                return l_AppStorageService_0:GetItem("CameraPerformanceUXUnixTimestamp");
            end);
            if not l_status_1 then
                return ;
            else
                v206 = tonumber(l_result_1);
                if os.time() - v206 < v23 then
                    return ;
                else
                    pcall(function()
                        l_AppStorageService_0:SetItem("CameraPerformanceUXUnixTimestamp", (tostring(v206)));
                        l_AppStorageService_0:Flush();
                        v28:showPrompt(v29.LODCameraRecommendDisable);
                        l_RbxAnalyticsService_0:SendEventDeferred("client", "avatarChat", "UXForCameraPerformanceShown", {
                            userId = l_Players_0.LocalPlayer.UserId,
                            pid = tostring(game.PlaceId)
                        });
                    end);
                    return ;
                end;
            end;
        end;
    end;
    InitializeVoiceChat = function()
        local function v209()
            v173();
            v200();
        end;
        if not l_default_1 then
            v173();
            v200();
            return ;
        else
            l_default_1:asyncInit():catch(function(_)
                v10:trace("VoiceChat:asyncInit failed (possibly denied mic permission)");
            end):finally(v209);
            v43 = l_default_1.muteChanged.Event:connect(function(v211)
                if not game:GetFastFlag("FacialAnimationStreamingIfNoDynamicHeadDisableA2C") then
                    v10:trace("Syncing audio processing with VoiceChat mute changed: muted=" .. tostring(v211));
                    l_FaceAnimatorService_0.AudioAnimationEnabled = not v211;
                    return ;
                else
                    local l_LocalPlayer_1 = l_Players_0.LocalPlayer;
                    local v213 = if not not l_LocalPlayer_1 and l_LocalPlayer_1.Character then l_LocalPlayer_1.Character:FindFirstChildWhichIsA("FaceControls", true) else nil;
                    v10:trace("Syncing audio processing with VoiceChat mute changed: muted=" .. tostring(v211) .. " hasFaceControls=" .. tostring(v213 ~= nil));
                    l_FaceAnimatorService_0.AudioAnimationEnabled = not v211 and v213 ~= nil;
                    return ;
                end;
            end);
            local v214 = false;
            if l_default_1.localMuted ~= nil then
                v10:trace("Syncing audio processing with VoiceChat mute status: muted=" .. tostring(l_default_1.localMuted));
                v214 = not l_default_1.localMuted;
            end;
            if game:GetFastFlag("FacialAnimationStreamingIfNoDynamicHeadDisableA2C") then
                local l_LocalPlayer_2 = l_Players_0.LocalPlayer;
                local v216 = if not not l_LocalPlayer_2 and l_LocalPlayer_2.Character then l_LocalPlayer_2.Character:FindFirstChildWhichIsA("FaceControls", true) else nil;
                v10:trace("Syncing audio processing with Dynamic Head status: hasFaceControls=" .. tostring(v216 ~= nil));
                v214 = v214 and v216 ~= nil;
            end;
            l_FaceAnimatorService_0.AudioAnimationEnabled = v214;
            return ;
        end;
    end;
    CleanupVoiceChat = function()
        if v43 then
            v43:Disconnect();
            v43 = nil;
        end;
    end;
    InitializeFacialAnimationStreaming = function(v217)
        if not v33 then
            v33 = true;
            v41 = l_FaceAnimatorService_0.TrackerError:Connect(function(v218)
                v10:trace(string.format("%s {id: %s, name: %s}.", string.format("TrackerError: %s", (tostring(v218))), "", ""));
                if v218 == Enum.TrackerError.VideoNoPermission then
                    v28:showPrompt(v29.VideoNoPermission);
                    return ;
                elseif v218 == Enum.TrackerError.VideoUnsupported then
                    v28:showPrompt(v29.VideoUnsupported);
                    return ;
                elseif v218 == Enum.TrackerError.UnsupportedDevice then
                    v28:showPrompt(v29.UnsupportedDevice);
                    return ;
                else
                    v28:showPrompt(v29.NotAvailable);
                    return ;
                end;
            end);
            if not v17() then
                local l_status_2, l_result_2 = pcall(l_FacialAnimationStreamingServiceV2_0.ResolveStateForUser, l_FacialAnimationStreamingServiceV2_0, l_Players_0.LocalPlayer.UserId);
                if l_status_2 then
                    l_FaceAnimatorService_0:Init(l_FacialAnimationStreamingServiceV2_0:IsVideoEnabled(v217) and l_FacialAnimationStreamingServiceV2_0:IsVideoEnabled(l_result_2), l_FacialAnimationStreamingServiceV2_0:IsAudioEnabled(v217) and l_FacialAnimationStreamingServiceV2_0:IsAudioEnabled(l_result_2));
                else
                    local l_LocalPlayer_3 = l_Players_0.LocalPlayer;
                    local v222 = "";
                    local v223 = "";
                    if l_LocalPlayer_3 then
                        if l_LocalPlayer_3.UserId then
                            v222 = tostring(l_LocalPlayer_3.UserId);
                        end;
                        if l_LocalPlayer_3.Name then
                            v223 = l_LocalPlayer_3.Name;
                        end;
                    end;
                    v10:trace(string.format("%s {id: %s, name: %s}.", "Failed to resolve state for user.", v222, v223));
                    return ;
                end;
            else
                l_FaceAnimatorService_0:Init(v18:IsEnabled(v217, Enum.AvatarChatServiceFeature.UserVideo), v18:IsEnabled(v217, Enum.AvatarChatServiceFeature.UserAudio));
            end;
            if l_game_EngineFeature_1 then
                v42 = l_FaceAnimatorService_0.TrackerPrompt:Connect(function(v224)
                    v10:trace(string.format("%s {id: %s, name: %s}.", string.format("TrackerPrompt: %s", (tostring(v224))), "", ""));
                    if v224 == Enum.TrackerPromptEvent.LODCameraRecommendDisable then
                        if not v21 then
                            v28:showPrompt(v29.LODCameraRecommendDisable);
                        else
                            v201();
                            return ;
                        end;
                    end;
                end);
            end;
            l_default_0:getCallState():andThen(function(v225)
                if v33 then
                    if v225.status ~= l_Enums_0.CallStatus.Idle.rawValue() and v225.status ~= l_Enums_0.CallStatus.Ringing.rawValue() then
                        l_FaceAnimatorService_0.VideoAnimationEnabled = v225.camEnabled;
                    else
                        l_FaceAnimatorService_0.VideoAnimationEnabled = false;
                    end;
                    InitializeVoiceChat();
                    v26.Initialize();
                    return ;
                else
                    return ;
                end;
            end);
            return ;
        else
            return ;
        end;
    end;
    CleanupFacialAnimationStreaming = function()
        if v33 then
            v33 = false;
            CleanupVoiceChat();
            v26.Cleanup();
            for _, v227 in ipairs(l_Players_0:GetPlayers()) do
                v36[v227.UserId] = nil;
                v167(v227);
            end;
            if v41 then
                v41:Disconnect();
                v41 = nil;
            end;
            if v44 then
                v44:Disconnect();
                v44 = nil;
            end;
            if v45 then
                v45:Disconnect();
                v45 = nil;
            end;
            if not (not l_game_EngineFeature_1 or not v42) then
                v42:Disconnect();
                v42 = nil;
            end;
            return ;
        else
            return ;
        end;
    end;
    local function _(v228, v229, v230)
        v10:trace(string.format("[onThrottleUpdate] allowed: %s, optedIn:%s, state: %s", tostring(v228), tostring(v229), (tostring(v230))));
        if not v228 or not l_FacialAnimationStreamingServiceV2_0:IsServerEnabled(v230) then
            CleanupFacialAnimationStreaming();
            if v229 then
                v28:showPrompt(v29.FeatureDisabled);
            end;
            return ;
        else
            InitializeFacialAnimationStreaming(v230);
            return ;
        end;
    end;
    local function v233(v232)
        v10:trace(string.format("[updateWithServiceState] state: %s", (tostring(v232))));
        if not v17() then
            CleanupFacialAnimationStreaming();
            return ;
        elseif not (v18:IsEnabled(v232, Enum.AvatarChatServiceFeature.UserAudioEligible) or v18:IsEnabled(v232, Enum.AvatarChatServiceFeature.UserVideoEligible)) or not v18:IsPlaceEnabled() then
            CleanupFacialAnimationStreaming();
            return ;
        else
            InitializeFacialAnimationStreaming(v232);
            return ;
        end;
    end;
    v44 = l_FaceAnimatorService_0:GetPropertyChangedSignal("AudioAnimationEnabled"):Connect(function()
        local l_LocalPlayer_4 = l_Players_0.LocalPlayer;
        if l_LocalPlayer_4 then
            if not (l_FaceAnimatorService_0.AudioAnimationEnabled or l_FaceAnimatorService_0.VideoAnimationEnabled) then
                if not (not v37[l_LocalPlayer_4.UserId] or not v37[l_LocalPlayer_4.UserId].animationTrack) then
                    local v235 = "";
                    local v236 = "";
                    if l_LocalPlayer_4 then
                        if l_LocalPlayer_4.UserId then
                            v235 = tostring(l_LocalPlayer_4.UserId);
                        end;
                        if l_LocalPlayer_4.Name then
                            v236 = l_LocalPlayer_4.Name;
                        end;
                    end;
                    v10:trace(string.format("%s {id: %s, name: %s}.", "Pausing facial streaming animations...", v235, v236));
                    v37[l_LocalPlayer_4.UserId].animationTrack:AdjustWeight(0.1, 0.5);
                end;
            elseif not (not v37[l_LocalPlayer_4.UserId] or not v37[l_LocalPlayer_4.UserId].animationTrack) then
                local v237 = "";
                local v238 = "";
                if l_LocalPlayer_4 then
                    if l_LocalPlayer_4.UserId then
                        v237 = tostring(l_LocalPlayer_4.UserId);
                    end;
                    if l_LocalPlayer_4.Name then
                        v238 = l_LocalPlayer_4.Name;
                    end;
                end;
                v10:trace(string.format("%s {id: %s, name: %s}.", "Resuming facial streaming animations...", v237, v238));
                v37[l_LocalPlayer_4.UserId].animationTrack:AdjustWeight(1, 0.5);
                return ;
            end;
            return ;
        else
            return ;
        end;
    end);
    v45 = l_FaceAnimatorService_0:GetPropertyChangedSignal("VideoAnimationEnabled"):Connect(function()
        local l_LocalPlayer_5 = l_Players_0.LocalPlayer;
        if l_LocalPlayer_5 then
            if not (l_FaceAnimatorService_0.AudioAnimationEnabled or l_FaceAnimatorService_0.VideoAnimationEnabled) then
                if not (not v37[l_LocalPlayer_5.UserId] or not v37[l_LocalPlayer_5.UserId].animationTrack) then
                    local v240 = "";
                    local v241 = "";
                    if l_LocalPlayer_5 then
                        if l_LocalPlayer_5.UserId then
                            v240 = tostring(l_LocalPlayer_5.UserId);
                        end;
                        if l_LocalPlayer_5.Name then
                            v241 = l_LocalPlayer_5.Name;
                        end;
                    end;
                    v10:trace(string.format("%s {id: %s, name: %s}.", "Pausing facial streaming animations...", v240, v241));
                    v37[l_LocalPlayer_5.UserId].animationTrack:AdjustWeight(0.1, 0.5);
                end;
            elseif not (not v37[l_LocalPlayer_5.UserId] or not v37[l_LocalPlayer_5.UserId].animationTrack) then
                local v242 = "";
                local v243 = "";
                if l_LocalPlayer_5 then
                    if l_LocalPlayer_5.UserId then
                        v242 = tostring(l_LocalPlayer_5.UserId);
                    end;
                    if l_LocalPlayer_5.Name then
                        v243 = l_LocalPlayer_5.Name;
                    end;
                end;
                v10:trace(string.format("%s {id: %s, name: %s}.", "Resuming facial streaming animations...", v242, v243));
                v37[l_LocalPlayer_5.UserId].animationTrack:AdjustWeight(1, 0.5);
                return ;
            end;
            return ;
        else
            return ;
        end;
    end);
    if not v17() then
        l_FacialAnimationStreamingServiceV2_0:GetPropertyChangedSignal("ServiceState"):Connect(function()
            v233(l_FacialAnimationStreamingServiceV2_0.ServiceState);
        end);
        v233(l_FacialAnimationStreamingServiceV2_0.ServiceState);
    elseif not v18.ClientFeaturesInitialized then
        local v244 = nil;
        do
            local l_v244_0 = v244;
            l_v244_0 = v18:GetPropertyChangedSignal("ClientFeatures"):Connect(function()
                v233(v18.ClientFeatures);
                l_v244_0:Disconnect();
            end);
        end;
    else
        v233(v18.ClientFeatures);
    end;
    return ;
else
    return ;
end;


local l_StarterGui_0 = game:GetService("StarterGui");
local l_Players_0 = game:GetService("Players");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
local l_RobloxGui_0 = l_CoreGui_0:WaitForChild("RobloxGui");
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
while l_LocalPlayer_0 == nil do
    l_Players_0.ChildAdded:wait();
    l_LocalPlayer_0 = l_Players_0.LocalPlayer;
end;
local l_Modules_0 = l_RobloxGui_0:WaitForChild("Modules");
local l_PromptCreator_0 = require(l_Modules_0:WaitForChild("PromptCreator"));
local l_SocialUtil_0 = require(l_Modules_0:WaitForChild("SocialUtil"));
local l_FriendingUtility_0 = require(l_Modules_0:WaitForChild("FriendingUtility"));
local l_RobloxTranslator_0 = require(l_Modules_0:WaitForChild("RobloxTranslator"));
local v11 = require(l_Modules_0.Common.LegacyThumbnailUrls);
local _ = v11.Thumbnail;
local _ = v11.Bust;
local l_Size150x150_0 = Enum.ThumbnailSize.Size150x150;
local l_Size352x352_0 = Enum.ThumbnailSize.Size352x352;
local l_HeadShot_0 = Enum.ThumbnailType.HeadShot;
local l_AvatarThumbnail_0 = Enum.ThumbnailType.AvatarThumbnail;
local l_status_0, l_result_0 = pcall(function()
    return settings():GetFFlag("UseNotificationsLocalization");
end);
local v20 = l_status_0 and l_result_0;
local function _(v21, v22)
    pcall(function()
        v22 = l_RobloxTranslator_0:FormatByKey(v21);
    end);
    return v22;
end;
createFetchImageFunction = function(...)
    local v24 = {
        ...
    };
    return function(v25)
        spawn(function()
            local v26 = l_SocialUtil_0.GetPlayerImage(unpack(v24));
            if not (not v25 or not v25.Parent) then
                v25.Image = v26;
            end;
        end);
    end;
end;
SendFriendRequest = function(v27)
    l_RbxAnalyticsService_0:ReportCounter("FriendPlayerPrompt-RequestFriendship");
    l_RbxAnalyticsService_0:TrackEvent("Game", "RequestFriendship", "FriendPlayerPrompt");
    return (pcall(function()
        l_LocalPlayer_0:RequestFriendship(v27);
    end));
end;
AtFriendLimit = function(v28)
    local l_l_FriendingUtility_0_FriendCountAsync_0 = l_FriendingUtility_0:GetFriendCountAsync(v28.UserId);
    if l_l_FriendingUtility_0_FriendCountAsync_0 == nil then
        return false;
    elseif l_FriendingUtility_0:MaxFriendCount() <= l_l_FriendingUtility_0_FriendCountAsync_0 then
        return true;
    else
        return false;
    end;
end;
DoPromptRequestFriendPlayer = function(v30)
    if not l_LocalPlayer_0:IsFriendsWith(v30.UserId) then
        local function v46(v31)
            if v31 then
                if not AtFriendLimit(l_LocalPlayer_0) then
                    if not AtFriendLimit(v30) then
                        if not SendFriendRequest(v30) then
                            while l_PromptCreator_0:IsCurrentlyPrompting() do
                                wait();
                            end;
                            local v32 = string.format("An error occurred while sending %s a friend request. Please try again later.", v30.Name);
                            if v20 then
                                local l_gsub_0 = string.gsub;
                                local l_v32_0 = v32;
                                local l_pcall_0 = pcall;
                                local v36 = "FriendPlayerPrompt.promptCompletedCallback.UnknownError";
                                local v37;
                                do
                                    local l_l_v32_0_0 = l_v32_0;
                                    l_pcall_0(function()
                                        l_l_v32_0_0 = l_RobloxTranslator_0:FormatByKey(v36);
                                    end);
                                    v37 = l_l_v32_0_0;
                                end;
                                v32 = l_gsub_0(v37, "{RBX_NAME}", v30.Name);
                            end;
                            l_PromptCreator_0:CreatePrompt({
                                WindowTitle = "Error Sending Friend Request",
                                MainText = v32,
                                ConfirmationText = "Okay",
                                CancelActive = false,
                                Image = "",
                                ImageConsoleVR = "",
                                FetchImageFunction = createFetchImageFunction(v30.UserId, l_Size150x150_0, l_HeadShot_0),
                                FetchImageFunctionConsoleVR = createFetchImageFunction(v30.UserId, l_Size352x352_0, l_AvatarThumbnail_0),
                                StripeColor = Color3.fromRGB(183, 34, 54)
                            });
                        end;
                    else
                        local v39 = string.format("You can not send a friend request to %s because they are at the max friend limit.", v30.Name);
                        if v20 then
                            local l_gsub_1 = string.gsub;
                            local l_v39_0 = v39;
                            local l_pcall_1 = pcall;
                            local v43 = "FriendPlayerPrompt.promptCompletedCallback.AtFriendLimit";
                            local v44;
                            do
                                local l_l_v39_0_0 = l_v39_0;
                                l_pcall_1(function()
                                    l_l_v39_0_0 = l_RobloxTranslator_0:FormatByKey(v43);
                                end);
                                v44 = l_l_v39_0_0;
                            end;
                            v39 = l_gsub_1(v44, "{RBX_NAME}", v30.Name);
                        end;
                        l_PromptCreator_0:CreatePrompt({
                            WindowTitle = "Error Sending Friend Request",
                            MainText = v39,
                            ConfirmationText = "Okay",
                            CancelActive = false,
                            Image = "",
                            ImageConsoleVR = "",
                            FetchImageFunction = createFetchImageFunction(v30.UserId, l_Size150x150_0, l_HeadShot_0),
                            FetchImageFunctionConsoleVR = createFetchImageFunction(v30.UserId, l_Size352x352_0, l_AvatarThumbnail_0),
                            StripeColor = Color3.fromRGB(183, 34, 54)
                        });
                        return ;
                    end;
                else
                    while l_PromptCreator_0:IsCurrentlyPrompting() do
                        wait();
                    end;
                    l_PromptCreator_0:CreatePrompt({
                        WindowTitle = "Friend Limit Reached",
                        MainText = "You can not send a friend request because you are at the max friend limit.",
                        ConfirmationText = "Okay",
                        CancelActive = false,
                        Image = "",
                        ImageConsoleVR = "",
                        FetchImageFunction = createFetchImageFunction(v30.UserId, l_Size150x150_0, l_HeadShot_0),
                        FetchImageFunctionConsoleVR = createFetchImageFunction(v30.UserId, l_Size352x352_0, l_AvatarThumbnail_0),
                        StripeColor = Color3.fromRGB(183, 34, 54)
                    });
                    return ;
                end;
            end;
        end;
        local v47 = string.format("Would you like to send %s a Friend Request?", v30.Name);
        if v20 then
            local l_gsub_2 = string.gsub;
            local l_v47_0 = v47;
            local l_pcall_2 = pcall;
            local v51 = "FriendPlayerPrompt.DoPromptRequestFriendPlayer";
            local v52;
            do
                local l_l_v47_0_0 = l_v47_0;
                l_pcall_2(function()
                    l_l_v47_0_0 = l_RobloxTranslator_0:FormatByKey(v51);
                end);
                v52 = l_l_v47_0_0;
            end;
            v47 = l_gsub_2(v52, "{RBX_NAME}", v30.Name);
        end;
        l_PromptCreator_0:CreatePrompt({
            WindowTitle = "Send Friend Request?",
            MainText = v47,
            ConfirmationText = "Send Request",
            CancelText = "Cancel",
            CancelActive = true,
            Image = "",
            ImageConsoleVR = "",
            FetchImageFunction = createFetchImageFunction(v30.UserId, l_Size150x150_0, l_HeadShot_0),
            FetchImageFunctionConsoleVR = createFetchImageFunction(v30.UserId, l_Size352x352_0, l_AvatarThumbnail_0),
            PromptCompletedCallback = v46
        });
        return ;
    else
        return ;
    end;
end;
PromptRequestFriendPlayer = function(v54)
    if l_LocalPlayer_0.UserId < 0 then
        error("PromptSendFriendRequest can not be called for guests");
    end;
    if not (typeof(v54) == "Instance") or not v54:IsA("Player") then
        error("Invalid argument to PromptSendFriendRequest");
        return ;
    else
        if v54.UserId < 0 then
            error("PromptSendFriendRequest can not be called on guests");
        end;
        if v54 == l_LocalPlayer_0 then
            error("PromptSendFriendRequest: A user can not friend themselves");
        end;
        DoPromptRequestFriendPlayer(v54);
        return ;
    end;
end;
UnFriendPlayer = function(v55)
    return (pcall(function()
        l_LocalPlayer_0:RevokeFriendship(v55);
    end));
end;
DoPromptUnfriendPlayer = function(v56)
    if l_LocalPlayer_0:IsFriendsWith(v56.UserId) then
        local function v65(v57)
            if not (not v57 or UnFriendPlayer(v56)) then
                while l_PromptCreator_0:IsCurrentlyPrompting() do
                    wait();
                end;
                local v58 = string.format("An error occurred while unfriending %s. Please try again later.", v56.Name);
                if v20 then
                    local l_gsub_3 = string.gsub;
                    local l_v58_0 = v58;
                    local l_pcall_3 = pcall;
                    local v62 = "FriendPlayerPrompt.promptCompletedCallback.UnknownError";
                    local v63;
                    do
                        local l_l_v58_0_0 = l_v58_0;
                        l_pcall_3(function()
                            l_l_v58_0_0 = l_RobloxTranslator_0:FormatByKey(v62);
                        end);
                        v63 = l_l_v58_0_0;
                    end;
                    v58 = l_gsub_3(v63, "{RBX_NAME}", v56.Name);
                end;
                l_PromptCreator_0:CreatePrompt({
                    WindowTitle = "Error Unfriending Person",
                    MainText = v58,
                    ConfirmationText = "Okay",
                    CancelActive = false,
                    Image = "",
                    ImageConsoleVR = "",
                    FetchImageFunction = createFetchImageFunction(v56.UserId, l_Size150x150_0, l_HeadShot_0),
                    FetchImageFunctionConsoleVR = createFetchImageFunction(v56.UserId, l_Size352x352_0, l_AvatarThumbnail_0),
                    StripeColor = Color3.fromRGB(183, 34, 54)
                });
            end;
        end;
        local v66 = string.format("Would you like to remove %s from your friends list?", v56.Name);
        if v20 then
            local l_gsub_4 = string.gsub;
            local l_v66_0 = v66;
            local l_pcall_4 = pcall;
            local v70 = "FriendPlayerPrompt.DoPromptUnfriendPlayer";
            local v71;
            do
                local l_l_v66_0_0 = l_v66_0;
                l_pcall_4(function()
                    l_l_v66_0_0 = l_RobloxTranslator_0:FormatByKey(v70);
                end);
                v71 = l_l_v66_0_0;
            end;
            v66 = l_gsub_4(v71, "{RBX_NAME}", v56.Name);
        end;
        l_PromptCreator_0:CreatePrompt({
            WindowTitle = "Unfriend Person?",
            MainText = v66,
            ConfirmationText = "Unfriend",
            CancelText = "Cancel",
            CancelActive = true,
            Image = "",
            ImageConsoleVR = "",
            FetchImageFunction = createFetchImageFunction(v56.UserId, l_Size150x150_0, l_HeadShot_0),
            FetchImageFunctionConsoleVR = createFetchImageFunction(v56.UserId, l_Size352x352_0, l_AvatarThumbnail_0),
            PromptCompletedCallback = v65
        });
        return ;
    else
        return ;
    end;
end;
PromptUnfriendPlayer = function(v73)
    if l_LocalPlayer_0.UserId < 0 then
        error("PromptUnfriend can not be called for guests");
    end;
    if not (typeof(v73) == "Instance") or not v73:IsA("Player") then
        error("Invalid argument to PromptUnfriend");
        return ;
    else
        if v73.UserId < 0 then
            error("PromptUnfriend can not be called on guests");
        end;
        if v73 == l_LocalPlayer_0 then
            error("PromptUnfriend: A user can not unfriend themselves");
        end;
        DoPromptUnfriendPlayer(v73);
        return ;
    end;
end;
l_StarterGui_0:RegisterSetCore("PromptSendFriendRequest", PromptRequestFriendPlayer);
l_StarterGui_0:RegisterSetCore("PromptUnfriend", PromptUnfriendPlayer);


local l_CorePackages_0 = game:GetService("CorePackages");
local l_CoreGui_0 = game:GetService("CoreGui");
local v2 = require(l_CoreGui_0:WaitForChild("RobloxGui").Modules.PlayerList.PlayerListManager);
local v3 = require(l_CorePackages_0.Workspace.Packages.GameInvite);
local l_renderCoreScriptGameInviteModalContainer_0 = v3.renderCoreScriptGameInviteModalContainer;
local l_GameInviteModalManager_0 = v3.GameInviteModalManager;
local v6 = require(l_CoreGui_0.RobloxGui.Modules.ApolloClient);
local function v8(v7)
    if not v7 then
        v2:HideTemp("GameInviteMenu", false);
        return ;
    else
        v2:HideTemp("GameInviteMenu", true);
        return ;
    end;
end;
l_renderCoreScriptGameInviteModalContainer_0(v6);
l_GameInviteModalManager_0.ToggleGameInviteModalEvent.Event:Connect(v8);


local l_CorePackages_0 = game:GetService("CorePackages");
local l_GuiService_0 = game:GetService("GuiService");
local l_RobloxGui_0 = game:GetService("CoreGui"):WaitForChild("RobloxGui");
local l_InspectAndBuy_0 = l_RobloxGui_0:WaitForChild("Modules"):WaitForChild("InspectAndBuy");
local v4 = require(l_CorePackages_0.Roact);
local v5 = require(l_InspectAndBuy_0.Components.InspectAndBuy);
local v6 = nil;
local v7 = require(l_RobloxGui_0.Modules.Common.renderWithCoreScriptsStyleProvider);
local v8 = require(l_RobloxGui_0.Modules.TopBar);
local function v13(v9, v10, v11, v12)
    if v6 then
        v4.unmount(v6);
        v6 = nil;
    end;
    v6 = v4.mount(v7({
        inspectAndBuy = v4.createElement(v5, {
            humanoidDescription = v9,
            playerName = v10,
            playerId = v11,
            ctx = v12
        })
    }), l_RobloxGui_0, "InspectAndBuy");
    l_GuiService_0:SetMenuIsOpen(true, "InspectMenu");
    v8:setInspectMenuOpen(true);
end;
local function _()
    if v6 then
        v4.unmount(v6);
        v6 = nil;
        l_GuiService_0:SetMenuIsOpen(false, "InspectMenu");
        v8:setInspectMenuOpen(false);
    end;
end;
local function _(v15, v16, v17)
    v13(v15, v16, nil, v17);
end;
local function _(v19, v20)
    v13(nil, nil, v19, v20);
end;
l_GuiService_0.InspectPlayerFromHumanoidDescriptionRequest:Connect(function(v22, v23)
    v13(v22, v23, nil, "developerThroughHumanoidDescription");
end);
l_GuiService_0.InspectPlayerFromUserIdWithCtxRequest:Connect(function(v24, v25)
    v13(nil, nil, v24, v25);
end);
l_GuiService_0.CloseInspectMenuRequest:Connect(function()
    if not (not v6 or not v6) then
        v4.unmount(v6);
        v6 = nil;
        l_GuiService_0:SetMenuIsOpen(false, "InspectMenu");
        v8:setInspectMenuOpen(false);
    end;
end);
l_GuiService_0.InspectMenuEnabledChangedSignal:Connect(function(v26)
    if not ((v26 or not v6) or not v6) then
        v4.unmount(v6);
        v6 = nil;
        l_GuiService_0:SetMenuIsOpen(false, "InspectMenu");
        v8:setInspectMenuOpen(false);
    end;
end);


local l_bubbleChat_0 = game:GetService("CoreGui"):WaitForChild("ExperienceChat"):WaitForChild("bubbleChat");
l_bubbleChat_0.ChildAdded:Wait();
l_bubbleChat_0:GetChildren()[1].AlwaysOnTop = true;


local l_CoreGui_0 = game:GetService("CoreGui");
local l_CorePackages_0 = game:GetService("CorePackages");
local v2 = require(l_CoreGui_0.RobloxGui.Modules.Settings.getCamMicPermissions);
local v3 = require(l_CoreGui_0.RobloxGui.Modules.Settings.Resources.MicrophoneDevicePermissionsLogging);
local l_default_0 = require(l_CorePackages_0.Workspace.Packages.PermissionsProtocol).PermissionsProtocol.default;
if require(l_CoreGui_0.RobloxGui.Modules.Flags.getFFlagMicrophoneDevicePermissionsPromptLogging)() then
    v2(function(v5)
        v3:init(v5.hasMicPermissions);
    end, {
        l_default_0.Permissions.MICROPHONE_ACCESS
    }, true);
end;


local l_Players_0 = game:GetService("Players");
local l_CoreGui_0 = game:GetService("CoreGui");
local _ = game:GetService("StarterGui");
local l_RunService_0 = game:GetService("RunService");
local l_GuiService_0 = game:GetService("GuiService");
local l_Modules_0 = l_CoreGui_0:WaitForChild("RobloxGui"):WaitForChild("Modules");
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
while not l_LocalPlayer_0 do
    wait();
    l_LocalPlayer_0 = l_Players_0.LocalPlayer;
end;
local v7 = require(l_Modules_0.NetworkPauseNotification);
local v8 = require(l_Modules_0.Common.Create);
local v9 = game:DefineFastFlag("GameplayPausePausesInteraction", false);
local v10 = true;
local v11 = v7.new();
local v12 = v9 and v8("Frame")({
    Name = "Container",
    Size = UDim2.new(1, 0, 1, 0),
    BackgroundTransparency = 1,
    Active = false
});
local v13 = v8("ScreenGui")({
    Name = "RobloxNetworkPauseNotification",
    OnTopOfCoreBlur = true,
    DisplayOrder = 8,
    Parent = l_CoreGui_0,
    IgnoreGuiInset = v9,
    AutoLocalize = false;
    v12
});
l_LocalPlayer_0:GetPropertyChangedSignal("GameplayPaused"):Connect(function()
    local v14 = (l_LocalPlayer_0.GameplayPaused and v13.Enabled) and not v10;
    v10 = false;
    if not v14 then
        v11:Hide();
    else
        v11:Show();
    end;
    if v9 then
        v12.Active = v14;
    end;
    l_RunService_0:SetRobloxGuiFocused(v14);
end);
local function v17(v15)
    assert(type(v15) == "boolean", "Specified argument 'enabled' must be of type boolean");
    if v15 == v13.Enabled then
        return ;
    else
        v13.Enabled = v15;
        local v16 = (l_LocalPlayer_0.GameplayPaused and v13.Enabled) and not v10;
        v10 = false;
        if not v16 then
            v11:Hide();
        else
            v11:Show();
        end;
        if v9 then
            v12.Active = v16;
        end;
        l_RunService_0:SetRobloxGuiFocused(v16);
        return ;
    end;
end;
if not v9 then
    v11:SetParent(v13);
else
    v11:SetParent(v12);
end;
l_GuiService_0.NetworkPausedEnabledChanged:Connect(v17);


local l_Players_0 = game:GetService("Players");
local l_GameSettings_0 = UserSettings().GameSettings;
local l_CoreGui_0 = game:GetService("CoreGui");
local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
local v4 = require(l_CoreGui_0.RobloxGui.Modules.Stats.StatsAggregatorManager);
local v5 = require(l_CoreGui_0.RobloxGui.Modules.Stats.StatsButton);
local v6 = require(l_CoreGui_0.RobloxGui.Modules.Stats.StatsUtils);
local v7 = require(l_CoreGui_0.RobloxGui.Modules.Stats.StatsViewer);
local l_Frame_0 = Instance.new("Frame");
l_Frame_0.Name = "PerformanceStats";
local v9 = v4.getSingleton();
local v10 = v7.new();
local v11 = {};
local v12 = nil;
local v13 = nil;
for _, v15 in ipairs(v6.AllStatTypes) do
    v11[v15] = v5.new(v15);
end;
ShowMasterFrame = function()
    l_Frame_0.Visible = true;
    l_Frame_0.Parent = l_CoreGui_0.RobloxGui;
end;
HideMasterFrame = function()
    l_Frame_0.Visible = false;
    l_Frame_0.Parent = nil;
end;
ConfigureMasterFrame = function()
    l_Frame_0.Position = UDim2.new(0, 0, 0, 0);
    l_Frame_0.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_0.Selectable = false;
    l_Frame_0.BackgroundTransparency = 1;
    l_Frame_0.Active = false;
    l_Frame_0.ZIndex = 0;
    HideMasterFrame();
end;
ConfigureStatButtonsInMasterFrame = function()
    for v16, v17 in ipairs(v6.AllStatTypes) do
        AddButton(v17, v16);
    end;
end;
OnButtonToggled = function(v18)
    if v11[v18]._isSelected then
        v12 = nil;
    else
        v12 = v18;
    end;
    UpdateButtonSelectedStates();
    UpdateViewerVisibility();
end;
UpdateButtonSelectedStates = function()
    for _, v20 in ipairs(v6.AllStatTypes) do
        v11[v20]:SetIsSelected(v20 == v12);
    end;
end;
UpdateViewerVisibility = function()
    if v12 == nil then
        if v10:GetIsVisible() then
            v10:SetVisible(false);
            v10:SetStatsAggregator(nil);
            return ;
        end;
    else
        local v21 = false;
        if not v10:GetIsVisible() then
            v21 = true;
            v10:SetVisible(true);
        end;
        if v12 ~= v10:GetStatType() then
            v10:SetStatType(v12);
            v10:SetStatsAggregator(v9:GetAggregator(v12));
            v21 = true;
        end;
        if v21 then
            l_RbxAnalyticsService_0:TrackEvent("Game", "Enlarge PerfStat", v12, 0);
        end;
    end;
end;
AddButton = function(v22, v23)
    local v24 = v11[v22];
    v24:SetParent(l_Frame_0);
    v24:SetStatsAggregator(v9:GetAggregator(v22));
    local v25 = 1 / v6.NumButtonTypes;
    v24:SetSizeAndPosition(UDim2.new(v25, 0, 0, v6.ButtonHeight), (UDim2.new(v25 * (v23 - 1), 0, 0, 0)));
    v24:SetToggleCallbackFunction(OnButtonToggled);
end;
ConfigureStatViewerInMasterFrame = function()
    v10:SetParent(l_Frame_0);
    v10:SetSizeAndPosition(UDim2.new(0, v6.ViewerWidth, 0, v6.ViewerHeight), (UDim2.new(1, -v6.ViewerWidth, 0, v6.ButtonHeight + v6.ViewerTopMargin)));
end;
UpdatePerformanceStatsVisibility = function()
    local v26 = v6.PerformanceStatsShouldBeVisible();
    if v26 == l_Frame_0.Visible then
        return ;
    else
        if not v26 then
            HideMasterFrame();
        else
            ShowMasterFrame();
        end;
        v10:OnPerformanceStatsShouldBeVisibleChanged();
        for _, v28 in ipairs(v6.AllStatTypes) do
            v11[v28]:OnPerformanceStatsShouldBeVisibleChanged();
        end;
        local v29 = "Hide PerfStats";
        if v26 then
            v29 = "Show PerfStats";
        end;
        l_RbxAnalyticsService_0:TrackEvent("Game", v29, "", 0);
        if not v26 then
            if v13 then
                l_RbxAnalyticsService_0:ReportStats("TimeOpenPerformanceProfiler", time() - v13);
            end;
            return ;
        else
            v13 = time();
            l_RbxAnalyticsService_0:ReportCounter("OpenPerformanceProfiler", 1);
            return ;
        end;
    end;
end;
ConfigureMasterFrame();
ConfigureStatButtonsInMasterFrame();
ConfigureStatViewerInMasterFrame();
l_GameSettings_0.PerformanceStatsVisibleChanged:connect(UpdatePerformanceStatsVisibility);
UpdateButtonSelectedStates();
UpdateViewerVisibility();
UpdatePerformanceStatsVisibility();
spawn(function()
    local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
    while not l_LocalPlayer_0 do
        l_Players_0.PlayerAdded:wait();
        l_LocalPlayer_0 = l_Players_0.LocalPlayer;
    end;
    UpdatePerformanceStatsVisibility();
end);


local l_Chat_0 = game:GetService("Chat");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_CorePackages_0 = game:GetService("CorePackages");
local l_Players_0 = game:GetService("Players");
local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local _ = game:GetService("StarterGui");
local l_TextChatService_0 = game:GetService("TextChatService");
local v7 = l_CoreGui_0:WaitForChild("RobloxGui", math.huge);
local v8 = require(l_CorePackages_0.Packages.Roact);
local v9 = require(l_CorePackages_0.Packages.Rodux);
local v10 = require(v7.Modules.InGameChat.BubbleChat.Components.App);
local v11 = require(v7.Modules.InGameChat.BubbleChat.Reducers.chatReducer);
local v12 = require(v7.Modules.InGameChat.BubbleChat.Actions.SetMessageText);
local v13 = require(v7.Modules.InGameChat.BubbleChat.Actions.AddMessageFromEvent);
local v14 = require(v7.Modules.InGameChat.BubbleChat.Actions.AddMessageWithTimeout);
local v15 = require(v7.Modules.InGameChat.BubbleChat.Actions.UpdateChatSettings);
local v16 = require(v7.Modules.InGameChat.BubbleChat.Actions.BubbleChatEnabledChanged);
local v17 = require(v7.Modules.VoiceChat.Actions.VoiceEnabledChanged);
local v18 = require(v7.Modules.VoiceChat.Actions.ParticipantsChanged);
local v19 = require(v7.Modules.VoiceChat.Actions.VoiceStateChanged);
local v20 = require(v7.Modules.VoiceChat.Actions.ParticipantAdded);
local v21 = require(v7.Modules.VoiceChat.Actions.ParticipantRemoved);
local v22 = require(v7.Modules.VoiceChat.Actions.PlayerRemoved);
local v23 = require(v7.Modules.InGameChat.BubbleChat.Helpers.getPlayerFromPart);
local v24 = require(v7.Modules.InGameChat.BubbleChat.Helpers.validateMessage);
local v25 = require(v7.Modules.InGameChat.BubbleChat.Constants);
local v26 = require(v7.Modules.InGameChat.BubbleChat.Types);
local v27 = require(v7.Modules.BlockingUtility);
local v28 = require(v7.Modules.GameTranslator);
local l_default_0 = require(v7.Modules.VoiceChat.VoiceChatServiceManager).default;
local v30 = require(v7.Modules.VoiceChat.initVoiceChatStore);
local v31 = require(v7.Modules.Flags.GetFFlagEnableVoiceChatVoiceUISync);
local v32 = require(v7.Modules.Flags.GetFFlagLocalMutedNilFix);
local v33 = require(v7.Modules.Flags.GetFFlagConsolidateBubbleChat);
local v34 = require(v7.Modules.Flags.GetFFlagBatchVoiceParticipantsUpdates);
local v35 = game:DefineFastFlag("FixMessageReceivedEventLeak", false);
local v36 = require(l_CorePackages_0.ExperienceChat);
local v37 = require(v7.Modules.InGameChat.BubbleChat.Logger)(script.Name);
local v38 = "Malformed message data sent to chat event %q. If you have modified the chat system, " .. "check what you are firing to this event";
local v39 = nil;
local v45 = {
    [v17.name] = function(v40)
        v36.Events.VoiceEnabledChanged(v40.enabled);
    end,
    [v19.name] = function(v41)
        v36.Events.VoiceStateChanged(v41.userId, v41.newState);
    end,
    [v18.name] = function(v42)
        v36.Events.VoiceParticipantsChanged(v42.newParticipants);
    end,
    [v20.name] = function(v43)
        v36.Events.VoiceParticipantAdded(v43.userId);
    end,
    [v21.name] = function(v44)
        v36.Events.VoiceParticipantRemoved(v44.userId);
    end
};
v39 = v9.Store.new(v11, nil, {
    v9.thunkMiddleware,
    function(v46)
        return function(v47)
            local v48 = v45[v47.type];
            if v48 then
                v48(v47);
            end;
            v46(v47);
        end;
    end
});
local v49 = nil;
local function _()
    return l_TextChatService_0.ChatVersion == Enum.ChatVersion.TextChatService;
end;
if not game:IsLoaded() or not (l_TextChatService_0.ChatVersion == Enum.ChatVersion.TextChatService) then
    v49 = game.Loaded:Connect(function()
        if game:IsLoaded() then
            v49:Disconnect();
            if not v33() then
                if not (l_TextChatService_0.ChatVersion == Enum.ChatVersion.TextChatService) then
                    v8.mount(v8.createElement(v10, {
                        store = v39
                    }), l_CoreGui_0, "BubbleChat");
                else
                    return ;
                end;
            end;
        end;
    end);
    local function v55(v51, v52)
        local v53, v54 = v24(v52);
        if not v53 then
            if not v54 then
                warn(("Message text %q sent to chat event %q is not a valid UTF-8 characters sequence"):format(v52, v51));
            else
                warn(("Message text %q is too long for chat event %q (expected a message of length %i, got %i)"):format(v52, v51, v25.MAX_MESSAGE_LENGTH, v54));
                return v53;
            end;
        end;
        return v53;
    end;
    local function _(v56, v57)
        local v58, v59 = v26.IMessageData(v57);
        if not v58 then
            warn(v38:format(v56));
            warn(v59);
        end;
        return v58;
    end;
    local _ = nil;
    local v62 = nil;
    local v63 = nil;
    local v64 = nil;
    local v65 = nil;
    local v66 = nil;
    local v67 = 0;
    local v68 = 0;
    local v69 = {};
    local function v89()
        coroutine.resume(coroutine.create(function()
            local v70 = l_ReplicatedStorage_0:WaitForChild("DefaultChatSystemChatEvents", math.huge);
            v62 = v70:WaitForChild("OnNewMessage", math.huge).OnClientEvent:Connect(function(v71)
                local v72, v73 = v26.IMessageData(v71);
                if not v72 then
                    warn(v38:format("OnNewMessage"));
                    warn(v73);
                end;
                if v72 then
                    if v71.FromSpeaker == l_Players_0.LocalPlayer.Name then
                        if v55("OnNewMessage", v71.Message) then
                            if not v33() then
                                v39:dispatch(v13(v71));
                            else
                                local v74 = table.clone(v71);
                                v74.Time = workspace:GetServerTimeNow() * 1000;
                                v39:dispatch(v13(v74));
                                return ;
                            end;
                        else
                            return ;
                        end;
                    end;
                    return ;
                else
                    return ;
                end;
            end);
            v63 = v70:WaitForChild("OnMessageDoneFiltering", math.huge).OnClientEvent:Connect(function(v75)
                local v76, v77 = v26.IMessageData(v75);
                if not v76 then
                    warn(v38:format("OnMessageDoneFiltering"));
                    warn(v77);
                end;
                if v76 and v55("OnMessageDoneFiltering", v75.Message) then
                    local v78 = tostring(v75.ID);
                    if not v39:getState().messages[v78] then
                        if not v33() then
                            v39:dispatch(v13(v75));
                            return ;
                        else
                            v76 = table.clone(v75);
                            v76.Time = workspace:GetServerTimeNow() * 1000;
                            v39:dispatch(v13(v76));
                            return ;
                        end;
                    else
                        v39:dispatch(v12(v78, v75.Message));
                        return ;
                    end;
                else
                    return ;
                end;
            end);
        end));
        local function v86(v79, v80, v81)
            local v82 = nil;
            v82 = if not v79:IsA("Model") then v79 else if v79.PrimaryPart then v79.PrimaryPart else v79:FindFirstChildWhichIsA("BasePart", true);
            local v83 = nil;
            if v82 then
                v83 = v23(v82);
            end;
            local v84 = nil;
            if not v83 then
                local v85 = v69[v79];
                if not v85 then
                    v67 = v67 + 1;
                    v84 = "adornee_" .. v67;
                    v69[v79] = v84;
                else
                    v84 = v85;
                end;
            else
                v84 = tostring(v83.UserId);
            end;
            v39:dispatch(v14({
                id = "chatted_" .. v81,
                userId = v84,
                name = v79.Name,
                text = v28:TranslateGameText(l_CoreGui_0, v80),
                timestamp = os.time(),
                adornee = v79
            }));
        end;
        v64 = l_Chat_0.Chatted:Connect(function(v87, v88)
            v68 = v68 + 1;
            v86(v87, v88, v68);
        end);
    end;
    local function v90()
        if v62 then
            v62:Disconnect();
            v62 = nil;
        end;
        if v63 then
            v63:Disconnect();
            v63 = nil;
        end;
        if v64 then
            v64:Disconnect();
            v64 = nil;
        end;
        if v35 then
            if v66 then
                v66:Disconnect();
                v66 = nil;
            end;
            if v65 then
                v65:Disconnect();
                v65 = nil;
            end;
        end;
    end;
    local function v92()
        v90();
        local v91 = not game:GetEngineFeature("EnableBubbleChatFromChatService") or l_Chat_0.BubbleChatEnabled;
        if v91 then
            v89();
        end;
        v39:dispatch(v16(v91));
    end;
    local v93 = {};
    local function v99(v94)
        local v95 = tostring(l_Players_0.LocalPlayer.UserId);
        v39:dispatch(v17(v94 ~= Enum.VoiceChatState.Ended));
        if v93[v94] then
            v39:dispatch(v19(v95, v93[v94]));
        else
            v37:warning("LOCAL_STATE_MAP does not exist for {} state", v94);
            v39:dispatch(v19(v95, v25.VOICE_STATE.MUTED));
        end;
        if v94 == Enum.VoiceChatState.Failed then
            for _, v97 in pairs(l_Players_0:GetPlayers()) do
                local v98 = tostring(v97.UserId);
                if v97 ~= l_Players_0.LocalPlayer then
                    v39:dispatch(v19(v98, v25.VOICE_STATE.HIDDEN));
                end;
            end;
            return ;
        else
            if not (not (v94 == Enum.VoiceChatState.Joined) or not if not v32 then not l_default_0.localMuted else l_default_0.localMuted == false) then
                v39:dispatch(v19(v95, v25.VOICE_STATE.INACTIVE));
            end;
            return ;
        end;
    end;
    local function _(v100)
        return "..." .. string.sub(tostring(v100), -4);
    end;
    local function v118()
        if not v31() then
            v37:debug("Initializing VoiceChatService connections");
            local v102 = l_default_0:getService();
            if v102 then
                if Enum.VoiceChatState then
                    v93 = {
                        [Enum.VoiceChatState.Idle] = v25.VOICE_STATE.HIDDEN,
                        [Enum.VoiceChatState.Joining] = v25.VOICE_STATE.CONNECTING,
                        [Enum.VoiceChatState.JoiningRetry] = v25.VOICE_STATE.CONNECTING,
                        [Enum.VoiceChatState.Joined] = v25.VOICE_STATE.MUTED,
                        [Enum.VoiceChatState.Leaving] = v25.VOICE_STATE.MUTED,
                        [Enum.VoiceChatState.Ended] = v25.VOICE_STATE.HIDDEN,
                        [Enum.VoiceChatState.Failed] = v25.VOICE_STATE.ERROR
                    };
                    local l_UserId_0 = l_Players_0.LocalPlayer.UserId;
                    for _, v105 in pairs(l_Players_0:GetPlayers()) do
                        v37:trace("Adding existing player {}", "..." .. string.sub(tostring(v105.UserId), -4));
                        v39:dispatch(v20((tostring(v105.UserId))));
                    end;
                    l_Players_0.PlayerAdded:Connect(function(v106)
                        v37:trace("Adding joining player {}", "..." .. string.sub(tostring(v106.UserId), -4));
                        v39:dispatch(v20((tostring(v106.userId))));
                    end);
                    l_Players_0.PlayerRemoving:Connect(function(v107)
                        v37:trace("Removing player {}", "..." .. string.sub(tostring(v107.UserId), -4));
                        v39:dispatch(v22((tostring(v107.userId))));
                        v39:dispatch(v21((tostring(v107.userId))));
                    end);
                    v39:dispatch(v19(l_UserId_0, v25.VOICE_STATE.HIDDEN));
                    l_default_0.muteChanged.Event:connect(function(v108)
                        v37:debug("Mute changed to {}", v108);
                        v39:dispatch(v19(l_UserId_0, not not v108 and v25.VOICE_STATE.MUTED or v25.VOICE_STATE.INACTIVE));
                    end);
                    l_default_0.participantsUpdate.Event:Connect(function(v109)
                        if not v34() then
                            for v110, v111 in pairs(v109) do
                                local l_INACTIVE_0 = v25.VOICE_STATE.INACTIVE;
                                if v111.subscriptionCompleted then
                                    if not v111.isMutedLocally then
                                        if not v111.isMuted then
                                            if v111.isSignalActive then
                                                l_INACTIVE_0 = v25.VOICE_STATE.TALKING;
                                            end;
                                        else
                                            l_INACTIVE_0 = v25.VOICE_STATE.MUTED;
                                        end;
                                    else
                                        l_INACTIVE_0 = v25.VOICE_STATE.LOCAL_MUTED;
                                    end;
                                else
                                    l_INACTIVE_0 = v25.VOICE_STATE.CONNECTING;
                                end;
                                v37:trace("Participant update for {}, voice state {}", "..." .. string.sub(tostring(v110), -4), l_INACTIVE_0);
                                v39:dispatch(v19(v110, l_INACTIVE_0));
                            end;
                            return ;
                        else
                            v39:dispatch(v18(v109));
                            return ;
                        end;
                    end);
                    l_default_0.talkingChanged.Event:Connect(function(v113)
                        if not v113 then
                            v39:dispatch(v19(l_UserId_0, v25.VOICE_STATE.INACTIVE));
                            return ;
                        else
                            v39:dispatch(v19(l_UserId_0, v25.VOICE_STATE.TALKING));
                            return ;
                        end;
                    end);
                    v27:GetBlockedStatusChangedEvent():Connect(function(v114, v115)
                        if not v115 then
                            v39:dispatch(v20((tostring(v114))));
                            return ;
                        else
                            v39:dispatch(v21((tostring(v114))));
                            return ;
                        end;
                    end);
                    v37:debug("Initial voice state is {}", v102.VoiceChatState);
                    v99(v102.VoiceChatState);
                    v102.StateChanged:Connect(function(_, v117)
                        v37:debug("Voice state changed to {}", v117);
                        v99(v117);
                    end);
                    return ;
                else
                    v37:error("Enum.VoiceChatState does not exist but voice is enabled");
                    return ;
                end;
            else
                v37:debug("VoiceChatService is not available");
                return ;
            end;
        else
            v30(v39);
            return ;
        end;
    end;
    if game:GetEngineFeature("EnableBubbleChatFromChatService") then
        l_Chat_0:GetPropertyChangedSignal("BubbleChatEnabled"):Connect(v92);
    end;
    v90();
    local v119 = not game:GetEngineFeature("EnableBubbleChatFromChatService") or l_Chat_0.BubbleChatEnabled;
    if v119 then
        v89();
    end;
    v39:dispatch(v16(v119));
    if game:GetEngineFeature("BubbleChatSettingsApi") then
        l_Chat_0.BubbleChatSettingsChanged:Connect(function(v120)
            local v121, v122 = v26.IChatSettings(v120);
            assert(v121, "Bad settings object passed to Chat:SetBubbleChatSettings:\n" .. (v122 or ""));
            v39:dispatch(v15(v120));
        end);
    end;
    l_default_0:asyncInit():andThen(v118):catch(function()
        v37:debug("VoiceChatServiceManager failed to initialize");
    end);
    return ;
else
    return ;
end;


local l_Players_0 = game:GetService("Players");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_RobloxReplicatedStorage_0 = game:GetService("RobloxReplicatedStorage");
local _ = game:GetService("StarterPlayer");
local l_Common_0 = l_CoreGui_0:FindFirstChild("RobloxGui"):FindFirstChild("Modules"):FindFirstChild("Common");
local l_RagdollRigging_0 = require(l_Common_0:FindFirstChild("RagdollRigging"));
local l_HumanoidReadyUtil_0 = require(l_Common_0:FindFirstChild("HumanoidReadyUtil"));
local l_game_EngineFeature_0 = game:GetEngineFeature("AvatarJointUpgradeFeature");
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
if not l_LocalPlayer_0 then
    l_Players_0:GetPropertyChangedSignal("LocalPlayer"):Wait();
    l_LocalPlayer_0 = l_Players_0.LocalPlayer;
end;
local v9 = l_RobloxReplicatedStorage_0:WaitForChild("DeathType", math.huge);
if not v9 or not l_game_EngineFeature_0 and v9.Value ~= "Ragdoll" then
    return ;
else
    local v10 = nil;
    if not l_game_EngineFeature_0 then
        v10 = l_RobloxReplicatedStorage_0:WaitForChild("OnRagdoll", math.huge);
        if not (v10 and v10:IsA("RemoteEvent")) then
            return ;
        end;
    end;
    local function v15(v11, v12)
        if not l_game_EngineFeature_0 then
            local v13 = l_RagdollRigging_0.disableMotors(v11, v12.RigType);
            local l_Animator_0 = v12:FindFirstChildWhichIsA("Animator");
            if l_Animator_0 then
                l_Animator_0:ApplyJointVelocities(v13);
            end;
            v10:FireServer(v12);
            wait(0.1);
            l_RagdollRigging_0.easeJointFriction_OLD(v11, 0.85);
        elseif v9.Value == "Ragdoll" then
            l_RagdollRigging_0.disableMotors(v11, v12.RigType);
            return ;
        end;
    end;
    l_HumanoidReadyUtil_0.registerHumanoidReady(function(v16, v17, v18)
        local v19 = nil;
        local v20 = nil;
        local function _()
            v19:Disconnect();
            v20:Disconnect();
        end;
        v20 = v18.Died:Connect(function()
            v19:Disconnect();
            v20:Disconnect();
            if v9.Value == "Ragdoll" then
                delay(2, function()
                    l_RagdollRigging_0.disableParticleEmittersAndFadeOut(v17, 0.4);
                end);
            end;
            if v16 == l_LocalPlayer_0 then
                v15(v17, v18);
            end;
        end);
        v19 = v16.CharacterRemoving:Connect(function(v22)
            if v22 == v17 then
                v19:Disconnect();
                v20:Disconnect();
            end;
        end);
    end);
    return ;
end;


local l_CoreGui_0 = game:GetService("CoreGui");
local l_RobloxReplicatedStorage_0 = game:GetService("RobloxReplicatedStorage");
local l_PlayerViewService_0 = game:GetService("PlayerViewService");
local l_RobloxGui_0 = l_CoreGui_0:WaitForChild("RobloxGui");
local v4 = require(l_RobloxGui_0.Modules.Flags.GetFFlagPlayerViewRemoteEventTimeoutEnabled);
local v5 = require(l_RobloxGui_0.Modules.Flags.GetFIntPlayerViewRemoteEventTimeout);
if not v4() then
    local l_RequestDeviceCameraCFrame_0 = l_RobloxReplicatedStorage_0:WaitForChild("RequestDeviceCameraCFrame");
    local l_ReplicateDeviceCameraCFrame_0 = l_RobloxReplicatedStorage_0:WaitForChild("ReplicateDeviceCameraCFrame");
    local l_game_EngineFeature_0 = game:GetEngineFeature("PlayerViewRemoteEventSupport");
    l_ReplicateDeviceCameraCFrame_0.OnClientEvent:Connect(function(v9, v10, v11)
        if l_game_EngineFeature_0 then
            l_PlayerViewService_0:UpdateDeviceCFrame(v9, v10, v11);
        end;
    end);
    l_RequestDeviceCameraCFrame_0.OnClientEvent:Connect(function()
        if l_game_EngineFeature_0 then
            l_PlayerViewService_0:OnCameraCFrameReplicationRequest();
        end;
    end);
    return ;
else
    local v12 = v5();
    local v13 = l_RobloxReplicatedStorage_0:WaitForChild("RequestDeviceCameraCFrame", v12);
    local v14 = l_RobloxReplicatedStorage_0:WaitForChild("ReplicateDeviceCameraCFrame", v12);
    local l_game_EngineFeature_1 = game:GetEngineFeature("PlayerViewRemoteEventSupport");
    if not v13 or not v14 then
        warn("PlayerViewService failed to initialize.");
        return ;
    else
        v14.OnClientEvent:Connect(function(v16, v17, v18)
            if l_game_EngineFeature_1 then
                l_PlayerViewService_0:UpdateDeviceCFrame(v16, v17, v18);
            end;
        end);
        v13.OnClientEvent:Connect(function()
            if l_game_EngineFeature_1 then
                l_PlayerViewService_0:OnCameraCFrameReplicationRequest();
            end;
        end);
        return ;
    end;
end;