local l_Parent_0 = script.Parent.Parent;
local l_ChatSettings_0 = require(l_Parent_0:WaitForChild("ChatSettings"));
local l_ChatConstants_0 = require(l_Parent_0:WaitForChild("ChatConstants"));
local l_Util_0 = require(script.Parent:WaitForChild("Util"));
local v4 = nil;
pcall(function()
    v4 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
CreateSystemMessageLabel = function(v5, v6)
    local l_Message_0 = v5.Message;
    if not (not v4 or not v4.LocalizeFormattedMessage) then
        l_Message_0 = v4:LocalizeFormattedMessage(l_Message_0);
    end;
    local v8 = v5.ExtraData or {};
    local v9 = v8.Font or l_ChatSettings_0.DefaultFont;
    local v10 = v8.TextSize or l_ChatSettings_0.ChatWindowTextSize;
    local v11 = v8.ChatColor or l_ChatSettings_0.DefaultMessageColor;
    local v12 = v8.ChannelColor or v11;
    local l_l_Util_0_BaseMessage_0, v14 = l_Util_0:CreateBaseMessage(l_Message_0, v9, v10, v11);
    v14.AutoLocalize = true;
    local v15 = nil;
    if v6 ~= v5.OriginalChannel then
        local v16 = nil;
        v16 = if not not v4 and v5.OriginalChannel == "System" then string.format("{%s}", (v4:Get("InGame.Chat.Label.SystemMessagePrefix", "System"))) else if v4 and v5.OriginalChannel == "Team" then string.format("{%s}", (v4:Get("InGame.Chat.Label.TeamMessagePrefix", "System"))) else string.format("{%s}", v5.OriginalChannel);
        v15 = l_Util_0:AddChannelButtonToBaseMessage(v14, v12, v16, v5.OriginalChannel);
        v14.Text = l_Util_0:CreateLeadingSpaces(l_Util_0:GetNumberOfSpaces(v16, v9, v10) + 1) .. l_Util_0:SanitizeForRichText(l_Message_0);
    end;
    local function v18(v17)
        return l_Util_0:GetMessageHeight(v14, l_l_Util_0_BaseMessage_0, v17);
    end;
    local v19 = {
        [v14] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        }
    };
    if v15 then
        v19[v15] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        };
    end;
    local l_l_Util_0_FadeFunctions_0, v21, v22 = l_Util_0:CreateFadeFunctions(v19);
    return {
        [l_Util_0.KEY_BASE_FRAME] = l_l_Util_0_BaseMessage_0,
        [l_Util_0.KEY_BASE_MESSAGE] = v14,
        [l_Util_0.KEY_UPDATE_TEXT_FUNC] = nil,
        [l_Util_0.KEY_GET_HEIGHT] = v18,
        [l_Util_0.KEY_FADE_IN] = l_l_Util_0_FadeFunctions_0,
        [l_Util_0.KEY_FADE_OUT] = v21,
        [l_Util_0.KEY_UPDATE_ANIMATION] = v22
    };
end;
return {
    [l_Util_0.KEY_MESSAGE_TYPE] = l_ChatConstants_0.MessageTypeSystem,
    [l_Util_0.KEY_CREATOR_FUNCTION] = CreateSystemMessageLabel
};


local _ = require(script.Parent.Parent:WaitForChild("ChatSettings"));
local l_Util_0 = require(script.Parent:WaitForChild("Util"));
CreateUnknownMessageLabel = function(v2)
    print("No message creator for message: " .. v2.Message);
end;
return {
    [l_Util_0.KEY_MESSAGE_TYPE] = "UnknownMessage",
    [l_Util_0.KEY_CREATOR_FUNCTION] = CreateUnknownMessageLabel
};


local v0 = false;
local l_status_0, l_result_0 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserFixOverlappingRtlChatMessages2");
end);
if l_status_0 then
    v0 = l_result_0;
end;
l_status_0 = game:GetService("TextService");
l_result_0 = game:GetService("Players");
local l_LocalPlayer_0 = l_result_0.LocalPlayer;
while not l_LocalPlayer_0 do
    l_result_0.ChildAdded:wait();
    l_LocalPlayer_0 = l_result_0.LocalPlayer;
end;
local l_Parent_0 = script.Parent.Parent;
local l_ChatSettings_0 = require(l_Parent_0:WaitForChild("ChatSettings"));
local l_ChatConstants_0 = require(l_Parent_0:WaitForChild("ChatConstants"));
local v7 = {};
local v8 = {};
v8.__index = v8;
v8.GetStringTextBounds = function(_, v10, v11, v12, v13)
    return l_status_0:GetTextSize(v10, v12, v11, v13 or Vector2.new(10000, 10000));
end;
v8.GetMessageHeight = function(v14, v15, v16, v17)
    local l_v14_StringTextBounds_0 = v14:GetStringTextBounds(if not v0 then v15.Text else v15.ContentText, v15.Font, v15.TextSize, Vector2.new(v17 or v16.AbsoluteSize.X, 1000));
    if l_v14_StringTextBounds_0.Y ~= math.floor(l_v14_StringTextBounds_0.Y) then
        return l_v14_StringTextBounds_0.Y + 1;
    else
        return l_v14_StringTextBounds_0.Y;
    end;
end;
v8.GetNumberOfSpaces = function(v19, v20, v21, v22)
    return (math.ceil(v19:GetStringTextBounds(v20, v21, v22).X / v19:GetStringTextBounds(" ", v21, v22).X));
end;
v8.CreateLeadingSpaces = function(_, v24)
    if not v0 then
        return string.rep(" ", v24);
    else
        return "" .. string.rep(" ", v24) .. "";
    end;
end;
v8.SanitizeForRichText = function(_, v26)
    if not v0 then
        return v26;
    else
        return string.gsub(v26, "%p", {
            ["<"] = "<",
            [">"] = ">",
            ["&"] = "&"
        });
    end;
end;
v8.CreateBaseMessage = function(v27, v28, v29, v30, v31)
    local l_v27_FromObjectPool_0 = v27:GetFromObjectPool("Frame");
    l_v27_FromObjectPool_0.Selectable = false;
    l_v27_FromObjectPool_0.Size = UDim2.new(1, 0, 0, 18);
    l_v27_FromObjectPool_0.Visible = true;
    l_v27_FromObjectPool_0.BackgroundTransparency = 1;
    local l_v27_FromObjectPool_1 = v27:GetFromObjectPool("TextLabel");
    l_v27_FromObjectPool_1.Selectable = false;
    l_v27_FromObjectPool_1.Size = UDim2.new(1, -14, 1, 0);
    l_v27_FromObjectPool_1.Position = UDim2.new(0, 8, 0, 0);
    l_v27_FromObjectPool_1.BackgroundTransparency = 1;
    l_v27_FromObjectPool_1.Font = v29;
    l_v27_FromObjectPool_1.TextSize = v30;
    l_v27_FromObjectPool_1.TextXAlignment = Enum.TextXAlignment.Left;
    l_v27_FromObjectPool_1.TextYAlignment = Enum.TextYAlignment.Top;
    l_v27_FromObjectPool_1.TextTransparency = 0;
    l_v27_FromObjectPool_1.TextStrokeTransparency = 0.75;
    l_v27_FromObjectPool_1.TextColor3 = v31;
    l_v27_FromObjectPool_1.TextWrapped = true;
    l_v27_FromObjectPool_1.ClipsDescendants = true;
    l_v27_FromObjectPool_1.Text = v28;
    l_v27_FromObjectPool_1.Visible = true;
    l_v27_FromObjectPool_1.RichText = not not v0 or false;
    l_v27_FromObjectPool_1.Parent = l_v27_FromObjectPool_0;
    return l_v27_FromObjectPool_0, l_v27_FromObjectPool_1;
end;
v8.AddNameButtonToBaseMessage = function(v34, v35, v36, v37, v38)
    local l_v34_StringTextBounds_0 = v34:GetStringTextBounds(v37, v35.Font, v35.TextSize);
    local l_v34_FromObjectPool_0 = v34:GetFromObjectPool("TextButton");
    l_v34_FromObjectPool_0.Selectable = false;
    l_v34_FromObjectPool_0.Size = UDim2.new(0, l_v34_StringTextBounds_0.X, 0, l_v34_StringTextBounds_0.Y);
    l_v34_FromObjectPool_0.Position = UDim2.new(0, 0, 0, 0);
    l_v34_FromObjectPool_0.BackgroundTransparency = 1;
    l_v34_FromObjectPool_0.Font = v35.Font;
    l_v34_FromObjectPool_0.TextSize = v35.TextSize;
    l_v34_FromObjectPool_0.TextXAlignment = v35.TextXAlignment;
    l_v34_FromObjectPool_0.TextYAlignment = v35.TextYAlignment;
    l_v34_FromObjectPool_0.TextTransparency = v35.TextTransparency;
    l_v34_FromObjectPool_0.TextStrokeTransparency = v35.TextStrokeTransparency;
    l_v34_FromObjectPool_0.TextColor3 = v36;
    l_v34_FromObjectPool_0.Text = v37;
    l_v34_FromObjectPool_0.Visible = true;
    l_v34_FromObjectPool_0.Parent = v35;
    local v41 = l_v34_FromObjectPool_0.MouseButton1Click:connect(function()
        v34:NameButtonClicked(l_v34_FromObjectPool_0, v38);
    end);
    local v42 = nil;
    v42 = l_v34_FromObjectPool_0.Changed:connect(function(v43)
        if v43 == "Parent" then
            v41:Disconnect();
            v42:Disconnect();
        end;
    end);
    return l_v34_FromObjectPool_0;
end;
v8.AddTranslationButtonToBaseMessage = function(v44, v45)
    local v46 = math.floor(v45.TextSize * 0.9);
    local v47 = Vector2.new(v46, v46);
    local l_v44_FromObjectPool_0 = v44:GetFromObjectPool("ImageButton");
    l_v44_FromObjectPool_0.Selectable = false;
    l_v44_FromObjectPool_0.Size = UDim2.new(0, v47.X, 0, v47.Y);
    l_v44_FromObjectPool_0.Position = UDim2.new(0, 0, 0, 0);
    l_v44_FromObjectPool_0.BackgroundTransparency = 1;
    l_v44_FromObjectPool_0.Visible = false;
    l_v44_FromObjectPool_0.Parent = v45;
    l_v44_FromObjectPool_0.Image = "rbxasset://textures/translateIcon.png";
    l_v44_FromObjectPool_0.HoverImage = "rbxasset://textures/translateIconDark.png";
    l_v44_FromObjectPool_0.PressedImage = "rbxasset://textures/translateIconDark.png";
    return l_v44_FromObjectPool_0;
end;
v8.AddChannelButtonToBaseMessage = function(v49, v50, v51, v52, v53)
    local l_v49_StringTextBounds_0 = v49:GetStringTextBounds(v52, v50.Font, v50.TextSize);
    local l_v49_FromObjectPool_0 = v49:GetFromObjectPool("TextButton");
    l_v49_FromObjectPool_0.Selectable = false;
    l_v49_FromObjectPool_0.Size = UDim2.new(0, l_v49_StringTextBounds_0.X, 0, l_v49_StringTextBounds_0.Y);
    l_v49_FromObjectPool_0.Position = UDim2.new(0, 0, 0, 0);
    l_v49_FromObjectPool_0.BackgroundTransparency = 1;
    l_v49_FromObjectPool_0.Font = v50.Font;
    l_v49_FromObjectPool_0.TextSize = v50.TextSize;
    l_v49_FromObjectPool_0.TextXAlignment = v50.TextXAlignment;
    l_v49_FromObjectPool_0.TextYAlignment = v50.TextYAlignment;
    l_v49_FromObjectPool_0.TextTransparency = v50.TextTransparency;
    l_v49_FromObjectPool_0.TextStrokeTransparency = v50.TextStrokeTransparency;
    l_v49_FromObjectPool_0.TextColor3 = v51;
    l_v49_FromObjectPool_0.Text = v52;
    l_v49_FromObjectPool_0.Visible = true;
    l_v49_FromObjectPool_0.Parent = v50;
    local v56 = l_v49_FromObjectPool_0.MouseButton1Click:connect(function()
        v49:ChannelButtonClicked(l_v49_FromObjectPool_0, v53);
    end);
    local v57 = nil;
    v57 = l_v49_FromObjectPool_0.Changed:connect(function(v58)
        if v58 == "Parent" then
            v56:Disconnect();
            v57:Disconnect();
        end;
    end);
    return l_v49_FromObjectPool_0;
end;
v8.AddTagLabelToBaseMessage = function(v59, v60, v61, v62)
    local l_v59_StringTextBounds_0 = v59:GetStringTextBounds(v62, v60.Font, v60.TextSize);
    local l_v59_FromObjectPool_0 = v59:GetFromObjectPool("TextLabel");
    l_v59_FromObjectPool_0.Selectable = false;
    l_v59_FromObjectPool_0.Size = UDim2.new(0, l_v59_StringTextBounds_0.X, 0, l_v59_StringTextBounds_0.Y);
    l_v59_FromObjectPool_0.Position = UDim2.new(0, 0, 0, 0);
    l_v59_FromObjectPool_0.BackgroundTransparency = 1;
    l_v59_FromObjectPool_0.Font = v60.Font;
    l_v59_FromObjectPool_0.TextSize = v60.TextSize;
    l_v59_FromObjectPool_0.TextXAlignment = v60.TextXAlignment;
    l_v59_FromObjectPool_0.TextYAlignment = v60.TextYAlignment;
    l_v59_FromObjectPool_0.TextTransparency = v60.TextTransparency;
    l_v59_FromObjectPool_0.TextStrokeTransparency = v60.TextStrokeTransparency;
    l_v59_FromObjectPool_0.TextColor3 = v61;
    l_v59_FromObjectPool_0.Text = v62;
    l_v59_FromObjectPool_0.Visible = true;
    l_v59_FromObjectPool_0.Parent = v60;
    return l_v59_FromObjectPool_0;
end;
GetWhisperChannelPrefix = function()
    if not l_ChatConstants_0.WhisperChannelPrefix then
        return "To ";
    else
        return l_ChatConstants_0.WhisperChannelPrefix;
    end;
end;
v8.NameButtonClicked = function(v65, _, v67)
    if v65.ChatWindow then
        if l_ChatSettings_0.ClickOnPlayerNameToWhisper then
            local l_l_result_0_FirstChild_0 = l_result_0:FindFirstChild(v67);
            if l_l_result_0_FirstChild_0 and l_l_result_0_FirstChild_0 ~= l_LocalPlayer_0 then
                local v69 = GetWhisperChannelPrefix() .. v67;
                if not v65.ChatWindow:GetChannel(v69) then
                    if not v65.ChatBar:IsInCustomState() then
                        v65.ChatBar:SetText("/w " .. v67);
                        v65.ChatBar:CaptureFocus();
                    end;
                else
                    v65.ChatBar:ResetCustomState();
                    if v65.ChatWindow:GetTargetMessageChannel() ~= v69 then
                        v65.ChatWindow:SwitchCurrentChannel(v69);
                    end;
                    v65.ChatBar:SetText("/w " .. v67);
                    v65.ChatBar:CaptureFocus();
                    return ;
                end;
            end;
        end;
        return ;
    else
        return ;
    end;
end;
v8.ChannelButtonClicked = function(v70, _, v72)
    if v70.ChatWindow then
        if not (not l_ChatSettings_0.ClickOnChannelNameToSetMainChannel or not v70.ChatWindow:GetChannel(v72)) then
            v70.ChatBar:ResetCustomState();
            if v70.ChatWindow:GetTargetMessageChannel() ~= v72 then
                v70.ChatWindow:SwitchCurrentChannel(v72);
            end;
            v70.ChatBar:ResetText();
            v70.ChatBar:CaptureFocus();
        end;
        return ;
    else
        return ;
    end;
end;
v8.RegisterChatWindow = function(v73, v74)
    v73.ChatWindow = v74;
    v73.ChatBar = v74:GetChatBar();
end;
v8.GetFromObjectPool = function(v75, v76)
    if v75.ObjectPool == nil then
        return Instance.new(v76);
    else
        return v75.ObjectPool:GetInstance(v76);
    end;
end;
v8.RegisterObjectPool = function(v77, v78)
    v77.ObjectPool = v78;
end;
v8.CreateFadeFunctions = function(_, v80)
    local v81 = {};
    for v82, v83 in pairs(v80) do
        v81[v82] = {};
        for v84, v85 in pairs(v83) do
            v81[v82][v84] = {
                Target = v85.FadedIn,
                Current = v82[v84],
                NormalizedExptValue = 1
            };
        end;
    end;
    local function v92(v86, v87)
        for v88, v89 in pairs(v81) do
            for v90, v91 in pairs(v89) do
                v91.Target = v80[v88][v90].FadedIn;
                v91.NormalizedExptValue = v87:NormalizedDefaultExptValueInSeconds(v86);
            end;
        end;
    end;
    local function v99(v93, v94)
        for v95, v96 in pairs(v81) do
            for v97, v98 in pairs(v96) do
                v98.Target = v80[v95][v97].FadedOut;
                v98.NormalizedExptValue = v94:NormalizedDefaultExptValueInSeconds(v93);
            end;
        end;
    end;
    local function v104()
        for v100, v101 in pairs(v81) do
            for v102, v103 in pairs(v101) do
                v100[v102] = v103.Current;
            end;
        end;
    end;
    return v92, v99, function(v105, v106)
        for _, v108 in pairs(v81) do
            for _, v110 in pairs(v108) do
                v110.Current = v106:Expt(v110.Current, v110.Target, v110.NormalizedExptValue, v105);
            end;
        end;
        v104();
    end;
end;
v8.NewBindableEvent = function(_, v112)
    local l_BindableEvent_0 = Instance.new("BindableEvent");
    l_BindableEvent_0.Name = v112;
    return l_BindableEvent_0;
end;
v8.RegisterGuiRoot = function(_)
end;
v7.new = function()
    local v115 = setmetatable({}, v8);
    v115.ObjectPool = nil;
    v115.ChatWindow = nil;
    v115.DEFAULT_MESSAGE_CREATOR = "UnknownMessage";
    v115.MESSAGE_CREATOR_MODULES_VERSION = 1;
    v115.KEY_MESSAGE_TYPE = "MessageType";
    v115.KEY_CREATOR_FUNCTION = "MessageCreatorFunc";
    v115.KEY_BASE_FRAME = "BaseFrame";
    v115.KEY_BASE_MESSAGE = "BaseMessage";
    v115.KEY_UPDATE_TEXT_FUNC = "UpdateTextFunction";
    v115.KEY_GET_HEIGHT = "GetHeightFunction";
    v115.KEY_FADE_IN = "FadeInFunction";
    v115.KEY_FADE_OUT = "FadeOutFunction";
    v115.KEY_UPDATE_ANIMATION = "UpdateAnimFunction";
    return v115;
end;
return v7.new();


local l_Parent_0 = script.Parent.Parent;
local l_ChatSettings_0 = require(l_Parent_0:WaitForChild("ChatSettings"));
local l_ChatConstants_0 = require(l_Parent_0:WaitForChild("ChatConstants"));
local l_Util_0 = require(script.Parent:WaitForChild("Util"));
pcall(function()
    ChatLocalization = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
CreateWelcomeMessageLabel = function(v4, v5)
    local l_Message_0 = v4.Message;
    if not (not ChatLocalization or not ChatLocalization.LocalizeFormattedMessage) then
        l_Message_0 = ChatLocalization:LocalizeFormattedMessage(l_Message_0);
    end;
    local v7 = v4.ExtraData or {};
    local v8 = v7.Font or l_ChatSettings_0.DefaultFont;
    local v9 = v7.FontSize or l_ChatSettings_0.ChatWindowTextSize;
    local v10 = v7.ChatColor or l_ChatSettings_0.DefaultMessageColor;
    local v11 = v7.ChannelColor or v10;
    local l_l_Util_0_BaseMessage_0, v13 = l_Util_0:CreateBaseMessage(l_Message_0, v8, v9, v10);
    local v14 = nil;
    if v5 ~= v4.OriginalChannel then
        local l_OriginalChannel_0 = v4.OriginalChannel;
        if ChatLocalization.tryLocalize then
            l_OriginalChannel_0 = ChatLocalization:tryLocalize(v4.OriginalChannel);
        end;
        local v16 = string.format("{%s}", l_OriginalChannel_0);
        v14 = l_Util_0:AddChannelButtonToBaseMessage(v13, v11, v16, v4.OriginalChannel);
        v13.Text = l_Util_0:CreateLeadingSpaces(l_Util_0:GetNumberOfSpaces(v16, v8, v9) + 1) .. l_Util_0:SanitizeForRichText(l_Message_0);
    end;
    local function v18(v17)
        return l_Util_0:GetMessageHeight(v13, l_l_Util_0_BaseMessage_0, v17);
    end;
    local v19 = {
        [v13] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        }
    };
    if v14 then
        v19[v14] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        };
    end;
    local l_l_Util_0_FadeFunctions_0, v21, v22 = l_Util_0:CreateFadeFunctions(v19);
    return {
        [l_Util_0.KEY_BASE_FRAME] = l_l_Util_0_BaseMessage_0,
        [l_Util_0.KEY_BASE_MESSAGE] = v13,
        [l_Util_0.KEY_UPDATE_TEXT_FUNC] = nil,
        [l_Util_0.KEY_GET_HEIGHT] = v18,
        [l_Util_0.KEY_FADE_IN] = l_l_Util_0_FadeFunctions_0,
        [l_Util_0.KEY_FADE_OUT] = v21,
        [l_Util_0.KEY_UPDATE_ANIMATION] = v22
    };
end;
return {
    [l_Util_0.KEY_MESSAGE_TYPE] = l_ChatConstants_0.MessageTypeWelcome,
    [l_Util_0.KEY_CREATOR_FUNCTION] = CreateWelcomeMessageLabel
};


local l_Players_0 = game:GetService("Players");
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
while not l_LocalPlayer_0 do
    l_Players_0.ChildAdded:wait();
    l_LocalPlayer_0 = l_Players_0.LocalPlayer;
end;
local l_Parent_0 = script.Parent.Parent;
local l_ChatSettings_0 = require(l_Parent_0:WaitForChild("ChatSettings"));
local l_ChatConstants_0 = require(l_Parent_0:WaitForChild("ChatConstants"));
local l_Util_0 = require(script.Parent:WaitForChild("Util"));
local v6 = utf8.char(57344);
local v7 = nil;
pcall(function()
    v7 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
IsPlayerVerified = function(v8)
    local l_l_Players_0_PlayerByUserId_0 = l_Players_0:GetPlayerByUserId(v8);
    if l_l_Players_0_PlayerByUserId_0 then
        local l_status_0, l_result_0 = pcall(function()
            return l_l_Players_0_PlayerByUserId_0.HasVerifiedBadge;
        end);
        if not l_status_0 then
            return false;
        else
            return l_result_0;
        end;
    else
        return false;
    end;
end;
AppendVerifiedBadge = function(v12)
    return v12 .. v6;
end;
CreateMessageLabel = function(v13, v14)
    local l_FromSpeaker_0 = v13.FromSpeaker;
    local v16 = nil;
    v16 = if not not l_ChatSettings_0.PlayerDisplayNamesEnabled and v13.SpeakerDisplayName then v13.SpeakerDisplayName else l_FromSpeaker_0;
    if IsPlayerVerified(v13.SpeakerUserId) then
        v16 = AppendVerifiedBadge(v16);
    end;
    local _ = v13.Message;
    local v18 = v13.ExtraData or {};
    local v19 = v18.Font or l_ChatSettings_0.DefaultFont;
    local v20 = v18.TextSize or l_ChatSettings_0.ChatWindowTextSize;
    local v21 = v18.NameColor or l_ChatSettings_0.DefaultNameColor;
    local v22 = v18.ChatColor or l_ChatSettings_0.DefaultMessageColor;
    local v23 = v18.ChannelColor or v22;
    local v24 = string.format("[%s]:", v16);
    local _ = l_Util_0:GetStringTextBounds(v24, v19, v20);
    local v26 = l_Util_0:GetNumberOfSpaces(v24, v19, v20) + 1;
    local l_l_Util_0_BaseMessage_0, v28 = l_Util_0:CreateBaseMessage("", v19, v20, v22);
    local v29 = l_Util_0:AddNameButtonToBaseMessage(v28, v21, v24, l_FromSpeaker_0);
    local v30 = nil;
    if v14 ~= v13.OriginalChannel then
        local l_OriginalChannel_0 = v13.OriginalChannel;
        if v13.FromSpeaker ~= l_LocalPlayer_0.Name then
            l_OriginalChannel_0 = string.format("From %s", v13.FromSpeaker);
        end;
        if v7.tryLocalize then
            l_OriginalChannel_0 = v7:tryLocalize(l_OriginalChannel_0);
        end;
        local v32 = string.format("{%s}", l_OriginalChannel_0);
        v30 = l_Util_0:AddChannelButtonToBaseMessage(v28, v23, v32, v13.OriginalChannel);
        v29.Position = UDim2.new(0, v30.Size.X.Offset + l_Util_0:GetStringTextBounds(" ", v19, v20).X, 0, 0);
        v26 = (v26 + l_Util_0:GetNumberOfSpaces(v32, v19, v20)) + 1;
    end;
    local function v34(v33)
        if not v13.IsFiltered then
            v28.Text = l_Util_0:CreateLeadingSpaces(v26) .. string.rep("_", v33.MessageLengthUtf8 or v33.MessageLength);
            return ;
        else
            v28.Text = l_Util_0:CreateLeadingSpaces(v26) .. l_Util_0:SanitizeForRichText(v33.Message);
            return ;
        end;
    end;
    v34(v13);
    local function v36(v35)
        return l_Util_0:GetMessageHeight(v28, l_l_Util_0_BaseMessage_0, v35);
    end;
    local v37 = {
        [v29] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        },
        [v28] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        }
    };
    if v30 then
        v37[v30] = {
            TextTransparency = {
                FadedIn = 0,
                FadedOut = 1
            },
            TextStrokeTransparency = {
                FadedIn = 0.75,
                FadedOut = 1
            }
        };
    end;
    local l_l_Util_0_FadeFunctions_0, v39, v40 = l_Util_0:CreateFadeFunctions(v37);
    return {
        [l_Util_0.KEY_BASE_FRAME] = l_l_Util_0_BaseMessage_0,
        [l_Util_0.KEY_BASE_MESSAGE] = v28,
        [l_Util_0.KEY_UPDATE_TEXT_FUNC] = v34,
        [l_Util_0.KEY_GET_HEIGHT] = v36,
        [l_Util_0.KEY_FADE_IN] = l_l_Util_0_FadeFunctions_0,
        [l_Util_0.KEY_FADE_OUT] = v39,
        [l_Util_0.KEY_UPDATE_ANIMATION] = v40
    };
end;
return {
    [l_Util_0.KEY_MESSAGE_TYPE] = l_ChatConstants_0.MessageTypeWhisper,
    [l_Util_0.KEY_CREATOR_FUNCTION] = CreateMessageLabel
};


local v0 = {};
local l_Chat_0 = game:GetService("Chat");
local l_ClientChatModules_0 = l_Chat_0:WaitForChild("ClientChatModules");
local l_MessageCreatorModules_0 = l_ClientChatModules_0:WaitForChild("MessageCreatorModules");
local l_Util_0 = require(l_MessageCreatorModules_0:WaitForChild("Util"));
local l_Parent_0 = script.Parent;
local _ = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
local l_ObjectPool_0 = require(l_Parent_0:WaitForChild("ObjectPool"));
local _ = require(l_Parent_0:WaitForChild("MessageSender"));
local v9 = {};
v9.__index = v9;
mergeProps = function(v10, v11)
    if v10 then
        for v12, v13 in pairs(v10) do
            v11[v12] = v13;
        end;
        return ;
    else
        return ;
    end;
end;
ReturnToObjectPoolRecursive = function(v14, v15)
    local l_v14_Children_0 = v14:GetChildren();
    for v17 = 1, #l_v14_Children_0 do
        ReturnToObjectPoolRecursive(l_v14_Children_0[v17], v15);
    end;
    v14.Parent = nil;
    v15:ReturnInstance(v14);
end;
GetMessageCreators = function()
    local v18 = {};
    local l_l_MessageCreatorModules_0_Children_0 = l_MessageCreatorModules_0:GetChildren();
    for v20 = 1, #l_l_MessageCreatorModules_0_Children_0 do
        if l_l_MessageCreatorModules_0_Children_0[v20]:IsA("ModuleScript") and l_l_MessageCreatorModules_0_Children_0[v20].Name ~= "Util" then
            local v21 = require(l_l_MessageCreatorModules_0_Children_0[v20]);
            v18[v21[l_Util_0.KEY_MESSAGE_TYPE]] = v21[l_Util_0.KEY_CREATOR_FUNCTION];
        end;
    end;
    return v18;
end;
v9.WrapIntoMessageObject = function(v22, v23, v24)
    local v25 = v24[l_Util_0.KEY_BASE_FRAME];
    local v26 = nil;
    if l_Util_0.KEY_BASE_MESSAGE then
        v26 = v24[l_Util_0.KEY_BASE_MESSAGE];
    end;
    return {
        ID = v23.ID,
        BaseFrame = v25,
        BaseMessage = v26,
        UpdateTextFunction = v24[l_Util_0.KEY_UPDATE_TEXT_FUNC] or function()
            warn("NO MESSAGE RESIZE FUNCTION");
        end,
        GetHeightFunction = v24[l_Util_0.KEY_GET_HEIGHT],
        FadeInFunction = v24[l_Util_0.KEY_FADE_IN],
        FadeOutFunction = v24[l_Util_0.KEY_FADE_OUT],
        UpdateAnimFunction = v24[l_Util_0.KEY_UPDATE_ANIMATION],
        ObjectPool = v22.ObjectPool,
        Destroyed = false,
        Destroy = function(v27)
            ReturnToObjectPoolRecursive(v27.BaseFrame, v27.ObjectPool);
            v27.Destroyed = true;
        end
    };
end;
v9.CreateMessageLabel_Chat = function(v28, v29, v30, v31)
    v29.Channel = v30;
    local v32 = nil;
    pcall(function()
        v32 = l_Chat_0:InvokeChatCallback(Enum.ChatCallbackType.OnClientFormattingMessage, v29);
    end);
    v29.ExtraData = v29.ExtraData or {};
    mergeProps(v32, v29.ExtraData);
    local l_MessageType_0 = v29.MessageType;
    if not v28.MessageCreators[l_MessageType_0] then
        if not v28.DefaultCreatorType then
            error("No message creator available for message type: " .. l_MessageType_0);
        else
            local v34 = v28.MessageCreators[v28.DefaultCreatorType](v29, v30, v31);
            if v34 then
                return v28:WrapIntoMessageObject(v29, v34);
            end;
        end;
    else
        local v35 = v28.MessageCreators[l_MessageType_0](v29, v30, v31);
        if v35 then
            return v28:WrapIntoMessageObject(v29, v35);
        end;
    end;
end;
v9.CreateMessageLabel = function(v36, v37, v38)
    v37.Channel = v38;
    local v39 = nil;
    pcall(function()
        v39 = l_Chat_0:InvokeChatCallback(Enum.ChatCallbackType.OnClientFormattingMessage, v37);
    end);
    v37.ExtraData = v37.ExtraData or {};
    mergeProps(v39, v37.ExtraData);
    local l_MessageType_1 = v37.MessageType;
    if not v36.MessageCreators[l_MessageType_1] then
        if not v36.DefaultCreatorType then
            error("No message creator available for message type: " .. l_MessageType_1);
        else
            local v41 = v36.MessageCreators[v36.DefaultCreatorType](v37, v38);
            if v41 then
                return v36:WrapIntoMessageObject(v37, v41);
            end;
        end;
    else
        local v42 = v36.MessageCreators[l_MessageType_1](v37, v38);
        if v42 then
            return v36:WrapIntoMessageObject(v37, v42);
        end;
    end;
end;
v0.new = function()
    local v43 = setmetatable({}, v9);
    v43.ObjectPool = l_ObjectPool_0.new(50);
    v43.MessageCreators = GetMessageCreators();
    v43.DefaultCreatorType = l_Util_0.DEFAULT_MESSAGE_CREATOR;
    l_Util_0:RegisterObjectPool(v43.ObjectPool);
    return v43;
end;
v0.GetStringTextBounds = function(_, v45, v46, v47, v48)
    return l_Util_0:GetStringTextBounds(v45, v46, v47, v48);
end;
return v0;


local v0 = nil;
local l_status_0, l_result_0 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserRemoveMessageOnTextFilterFailures");
end);
v0 = l_status_0 and l_result_0;
l_status_0 = false;
local v3;
l_result_0, v3 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserIsChatTranslationEnabled2");
end);
l_status_0 = l_result_0 and v3;
l_result_0 = {
    ScrollBarThickness = 4
};
local l_ClientChatModules_0 = game:GetService("Chat"):WaitForChild("ClientChatModules");
local l_Parent_0 = script.Parent;
local l_MessageLabelCreator_0 = require(l_Parent_0:WaitForChild("MessageLabelCreator"));
local l_CurveUtil_0 = require(l_Parent_0:WaitForChild("CurveUtil"));
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
local v9 = l_MessageLabelCreator_0.new();
local v10 = {};
v10.__index = v10;
local function v14()
    local l_Frame_0 = Instance.new("Frame");
    l_Frame_0.Selectable = false;
    l_Frame_0.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_0.BackgroundTransparency = 1;
    local l_ScrollingFrame_0 = Instance.new("ScrollingFrame");
    l_ScrollingFrame_0.Selectable = l_ChatSettings_0.GamepadNavigationEnabled;
    l_ScrollingFrame_0.Name = "Scroller";
    l_ScrollingFrame_0.BackgroundTransparency = 1;
    l_ScrollingFrame_0.BorderSizePixel = 0;
    l_ScrollingFrame_0.Position = UDim2.new(0, 0, 0, 3);
    l_ScrollingFrame_0.Size = UDim2.new(1, -4, 1, -6);
    l_ScrollingFrame_0.CanvasSize = UDim2.new(0, 0, 0, 0);
    l_ScrollingFrame_0.ScrollBarThickness = l_result_0.ScrollBarThickness;
    l_ScrollingFrame_0.Active = true;
    l_ScrollingFrame_0.Parent = l_Frame_0;
    local l_UIListLayout_0 = Instance.new("UIListLayout");
    l_UIListLayout_0.SortOrder = Enum.SortOrder.LayoutOrder;
    l_UIListLayout_0.Parent = l_ScrollingFrame_0;
    return l_Frame_0, l_ScrollingFrame_0, l_UIListLayout_0;
end;
v10.Destroy = function(v15)
    v15.GuiObject:Destroy();
    v15.Destroyed = true;
end;
v10.SetActive = function(v16, v17)
    v16.GuiObject.Visible = v17;
end;
v10.UpdateMessageFiltered = function(v18, v19)
    local v20 = nil;
    local v21 = 1;
    local l_MessageObjectLog_0 = v18.MessageObjectLog;
    while v21 <= #l_MessageObjectLog_0 do
        local v23 = l_MessageObjectLog_0[v21];
        if v23.ID == v19.ID then
            v20 = v23;
            break;
        else
            v21 = v21 + 1;
        end;
    end;
    if v20 then
        if not v0 then
            v20.UpdateTextFunction(v19);
            v18:PositionMessageLabelInWindow(v20, v21);
        elseif v19.Message == "" then
            v18:RemoveMessageAtIndex(v21);
            return ;
        else
            v20.UpdateTextFunction(v19);
            v18:PositionMessageLabelInWindow(v20, v21);
            return ;
        end;
    end;
end;
v10.RefreshMessagePlacement = function(v24, v25)
    local v26 = nil;
    local v27 = 1;
    local l_MessageObjectLog_1 = v24.MessageObjectLog;
    while v27 <= #l_MessageObjectLog_1 do
        local v29 = l_MessageObjectLog_1[v27];
        if v29.ID == v25.ID then
            v26 = v29;
            break;
        else
            v27 = v27 + 1;
        end;
    end;
    if v26 then
        v24:PositionMessageLabelInWindow(v26, v27);
    end;
end;
v10.AddMessage = function(v30, v31)
    v30:WaitUntilParentedCorrectly();
    local v32 = nil;
    v32 = if not l_status_0 then v9:CreateMessageLabel(v31, v30.CurrentChannelName) else v9:CreateMessageLabel_Chat(v31, v30.CurrentChannelName, function()
        v30:RefreshMessagePlacement(v31);
    end);
    if v32 == nil then
        return ;
    else
        table.insert(v30.MessageObjectLog, v32);
        v30:PositionMessageLabelInWindow(v32, #v30.MessageObjectLog);
        return ;
    end;
end;
v10.RemoveMessageAtIndex = function(v33, v34)
    v33:WaitUntilParentedCorrectly();
    local v35 = v33.MessageObjectLog[v34];
    if v35 then
        v35:Destroy();
        table.remove(v33.MessageObjectLog, v34);
    end;
end;
v10.AddMessageAtIndex = function(v36, v37, v38)
    local v39 = nil;
    v39 = if not l_status_0 then v9:CreateMessageLabel(v37, v36.CurrentChannelName) else v9:CreateMessageLabel_Chat(v37, v36.CurrentChannelName, function()
        v36:RefreshMessagePlacement(v37);
    end);
    if v39 == nil then
        return ;
    else
        table.insert(v36.MessageObjectLog, v38, v39);
        v36:PositionMessageLabelInWindow(v39, v38);
        return ;
    end;
end;
v10.RemoveLastMessage = function(v40)
    v40:WaitUntilParentedCorrectly();
    v40.MessageObjectLog[1]:Destroy();
    table.remove(v40.MessageObjectLog, 1);
end;
v10.IsScrolledDown = function(v41)
    local l_Offset_0 = v41.Scroller.CanvasSize.Y.Offset;
    local l_Y_0 = v41.Scroller.AbsoluteWindowSize.Y;
    local l_Y_1 = v41.Scroller.CanvasPosition.Y;
    local v45 = true;
    if l_Offset_0 >= l_Y_0 then
        v45 = l_Offset_0 - l_Y_1 <= l_Y_0 + 5;
    end;
    return v45;
end;
v10.UpdateMessageTextHeight = function(v46, v47)
    local l_BaseFrame_0 = v47.BaseFrame;
    for v49 = 1, 10 do
        if not v47.BaseMessage.TextFits then
            l_BaseFrame_0.Size = UDim2.new(1, 0, 0, v47.GetHeightFunction(v46.Scroller.AbsoluteSize.X - v49));
        else
            break;
        end;
    end;
end;
v10.PositionMessageLabelInWindow = function(v50, v51, v52)
    v50:WaitUntilParentedCorrectly();
    local v53 = v50:IsScrolledDown();
    local l_BaseFrame_1 = v51.BaseFrame;
    local v55 = 1;
    if v50.MessageObjectLog[v52 - 1] then
        v55 = if v52 == #v50.MessageObjectLog then v50.MessageObjectLog[v52 - 1].BaseFrame.LayoutOrder + 1 else v50.MessageObjectLog[v52 - 1].BaseFrame.LayoutOrder;
    end;
    l_BaseFrame_1.LayoutOrder = v55;
    l_BaseFrame_1.Size = UDim2.new(1, 0, 0, v51.GetHeightFunction(v50.Scroller.AbsoluteSize.X));
    l_BaseFrame_1.Parent = v50.Scroller;
    if v51.BaseMessage then
        v50:UpdateMessageTextHeight(v51);
    end;
    if v53 then
        v50.Scroller.CanvasPosition = Vector2.new(0, (math.max(0, v50.Scroller.CanvasSize.Y.Offset - v50.Scroller.AbsoluteSize.Y)));
    end;
end;
v10.ReorderAllMessages = function(v56)
    v56:WaitUntilParentedCorrectly();
    if v56.GuiObject.AbsoluteSize.Y < 1 then
        return ;
    else
        local l_CanvasPosition_0 = v56.Scroller.CanvasPosition;
        local v58 = v56:IsScrolledDown();
        for _, v60 in pairs(v56.MessageObjectLog) do
            v56:UpdateMessageTextHeight(v60);
        end;
        if v58 then
            v56.Scroller.CanvasPosition = Vector2.new(0, (math.max(0, v56.Scroller.CanvasSize.Y.Offset - v56.Scroller.AbsoluteSize.Y)));
            return ;
        else
            v56.Scroller.CanvasPosition = l_CanvasPosition_0;
            return ;
        end;
    end;
end;
v10.Clear = function(v61)
    for _, v63 in pairs(v61.MessageObjectLog) do
        v63:Destroy();
    end;
    v61.MessageObjectLog = {};
end;
v10.SetCurrentChannelName = function(v64, v65)
    v64.CurrentChannelName = v65;
end;
v10.FadeOutBackground = function(_, _)
end;
v10.FadeInBackground = function(_, _)
end;
v10.FadeOutText = function(v70, v71)
    for v72 = 1, #v70.MessageObjectLog do
        if v70.MessageObjectLog[v72].FadeOutFunction then
            v70.MessageObjectLog[v72].FadeOutFunction(v71, l_CurveUtil_0);
        end;
    end;
end;
v10.FadeInText = function(v73, v74)
    for v75 = 1, #v73.MessageObjectLog do
        if v73.MessageObjectLog[v75].FadeInFunction then
            v73.MessageObjectLog[v75].FadeInFunction(v74, l_CurveUtil_0);
        end;
    end;
end;
v10.Update = function(v76, v77)
    for v78 = 1, #v76.MessageObjectLog do
        if v76.MessageObjectLog[v78].UpdateAnimFunction then
            v76.MessageObjectLog[v78].UpdateAnimFunction(v77, l_CurveUtil_0);
        end;
    end;
end;
v10.WaitUntilParentedCorrectly = function(v79)
    while not v79.GuiObject:IsDescendantOf(game:GetService("Players").LocalPlayer) do
        v79.GuiObject.AncestryChanged:wait();
    end;
end;
l_result_0.new = function()
    local v80 = setmetatable({}, v10);
    v80.Destroyed = false;
    local v81, v82, v83 = v14();
    v80.GuiObject = v81;
    v80.Scroller = v82;
    v80.Layout = v83;
    v80.MessageObjectLog = {};
    v80.Name = "MessageLogDisplay";
    v80.GuiObject.Name = "Frame_" .. v80.Name;
    v80.CurrentChannelName = "";
    v80.GuiObject:GetPropertyChangedSignal("AbsoluteSize"):Connect(function()
        spawn(function()
            v80:ReorderAllMessages();
        end);
    end);
    local v84 = true;
    v80.Layout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
        local l_AbsoluteContentSize_0 = v80.Layout.AbsoluteContentSize;
        v80.Scroller.CanvasSize = UDim2.new(0, 0, 0, l_AbsoluteContentSize_0.Y);
        if v84 then
            v80.Scroller.CanvasPosition = Vector2.new(0, l_AbsoluteContentSize_0.Y - v80.Scroller.AbsoluteWindowSize.Y);
        end;
    end);
    v80.Scroller:GetPropertyChangedSignal("CanvasPosition"):Connect(function()
        v84 = v80:IsScrolledDown();
    end);
    return v80;
end;
return l_result_0;


local v0 = {};
local _ = script.Parent;
local v2 = {};
v2.__index = v2;
v2.SendMessage = function(v3, v4, v5)
    v3.SayMessageRequest:FireServer(v4, v5);
end;
v2.RegisterSayMessageFunction = function(v6, v7)
    v6.SayMessageRequest = v7;
end;
v0.new = function()
    local v8 = setmetatable({}, v2);
    v8.SayMessageRequest = nil;
    return v8;
end;
return v0.new();


local v0 = {};
local l_RunService_0 = game:GetService("RunService");
local _ = script.Parent;
local v4 = {
    __ClassName = "TransparencyTweener",
    __tostring = function(v3)
        return v3.__ClassName .. ": " .. v3.MemoryLocation;
    end,
    __metatable = "The metatable is locked"
};
v4.__index = function(v5, v6, _)
    if not rawget(v5, v6) then
        if not rawget(v4, v6) then
            if v6 == "Transparency" then
                return (rawget(v5, "InternalLastTweenPercentage"));
            else
                error(v6 .. " is not a valid member of " .. v5.__ClassName);
                return ;
            end;
        else
            return (rawget(v4, v6));
        end;
    else
        return (rawget(v5, v6));
    end;
end;
v4.__newindex = function(v8, v9, v10)
    if v9 == "Transparency" then
        v8.InternalLastTweenPercentage = v10;
        v8:SetPropertiesToTweenPercentage(v10);
        return ;
    else
        error(v9 .. " is not a valid member of " .. v8.__ClassName);
        return ;
    end;
end;
v4.Dump = function(v11)
    local v12 = tostring(v11);
    for v13, v14 in pairs(v11.TweenObjects) do
        local v15 = " | ";
        if type(v13) == "table" then
            v15 = v15 .. "{{" .. v13:Dump() .. "}}";
        elseif type(v13) == "userdata" then
            v15 = v15 .. v13.Name .. "/" .. v13:GetFullName();
        end;
        for v16, v17 in pairs(v14) do
            v15 = v15 .. " [" .. v16 .. "=" .. string.sub(tostring(v17), 1, 4) .. "]";
        end;
        v12 = v12 .. v15;
    end;
    return v12;
end;
v4.OutputTest = function(v18)
    print("Test Output for {={" .. v18:Dump() .. "}=}");
    for v19, v20 in pairs(v18.TweenObjects) do
        print("TweenObject:", v19);
        for v21, v22 in pairs(v20) do
            print("\t[" .. v21 .. "=" .. string.sub(tostring(v22), 1, 4) .. "] Actual:" .. v19[v21]);
        end;
    end;
end;
v4.RegisterTweenObjectProperty = function(v23, v24, v25, v26)
    v26 = v26 or v24[v25];
    if not v23.TweenObjects[v24] then
        v23.TweenObjects[v24] = {};
    end;
    v23.TweenObjects[v24][v25] = v26;
    v23:SetObjectPropertyToPercentValue(v24, v25, v26, v23.InternalLastTweenPercentage);
end;
v4.UnregisterTweenObject = function(v27, v28)
    v27.TweenObjects[v28] = nil;
end;
v4.SetObjectPropertyToPercentValue = function(_, v30, v31, v32, v33)
    v30[v31] = v32 + (1 - v32) * v33;
end;
v4.SetPropertiesToTweenPercentage = function(v34, v35)
    for v36, v37 in pairs(v34.TweenObjects) do
        for v38, v39 in pairs(v37) do
            v34:SetObjectPropertyToPercentValue(v36, v38, v39, v35);
        end;
    end;
end;
v4.Tween = function(v40, v41, v42, v43)
    if not v40.Tweening then
        v40.Tweening = true;
        local l_v43_0 = v43;
        if not l_v43_0 then
            l_v43_0 = v40.InternalLastTweenPercentage;
        else
            v40:SetPropertiesToTweenPercentage(l_v43_0);
        end;
        local v45 = tick();
        local v46 = v45 + v41;
        local v47 = v42 - l_v43_0;
        local v48 = 0;
        spawn(function()
            local v49 = tick();
            while not (not (v49 < v46) or v40.Canceled) do
                v48 = math.min(math.max((v49 - v45) / v41, 0), 1);
                local v50 = l_v43_0 + v47 * v48;
                v40.InternalLastTweenPercentage = v50;
                v40:SetPropertiesToTweenPercentage(v50);
                l_RunService_0.RenderStepped:wait();
                v49 = tick();
            end;
            if v40.Canceled then
                v40.Canceled = false;
                if v40.TweenIsQueued then
                    v40.TweenIsQueued = false;
                    v40.Tweening = false;
                    v40:Tween(unpack(v40.QueuedTween));
                    return ;
                end;
            else
                v40.InternalLastTweenPercentage = v42;
                v40:SetPropertiesToTweenPercentage(v42);
            end;
            v40.Tweening = false;
        end);
        return ;
    else
        v40.QueuedTween = {
            v41,
            v42,
            v43
        };
        v40.TweenIsQueued = true;
        v40:CancelTween();
        return ;
    end;
end;
v4.CancelTween = function(v51)
    v51.Canceled = true;
end;
v0.new = function()
    local v52 = {};
    v52.MemoryLocation = tostring(v52):match("[0123456789ABCDEF]+");
    v52.TweenObjects = setmetatable({}, {
        __mode = "k"
    });
    v52.Transparency = nil;
    v52.InternalLastTweenPercentage = 0;
    v52.Tweening = false;
    v52.Canceled = false;
    v52.TweenIsQueued = false;
    v52.QueuedTween = {};
    return (setmetatable(v52, v4));
end;
return v0;


local l_abs_0 = math.abs;
local l_clamp_0 = math.clamp;
local l_exp_0 = math.exp;
local l_rad_0 = math.rad;
local l_sign_0 = math.sign;
local l_sqrt_0 = math.sqrt;
local l_tan_0 = math.tan;
local l_ContextActionService_0 = game:GetService("ContextActionService");
local l_Players_0 = game:GetService("Players");
local l_RunService_0 = game:GetService("RunService");
local l_StarterGui_0 = game:GetService("StarterGui");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_Workspace_0 = game:GetService("Workspace");
local l_GameSettings_0 = UserSettings().GameSettings;
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 l_CurrentCamera_0 = l_Workspace_0.CurrentCamera;
l_Workspace_0:GetPropertyChangedSignal("CurrentCamera"):Connect(function()
    local l_CurrentCamera_1 = l_Workspace_0.CurrentCamera;
    if l_CurrentCamera_1 then
        l_CurrentCamera_0 = l_CurrentCamera_1;
    end;
end);
local v17 = nil;
local l_status_0, l_result_0 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserExitFreecamBreaksWithShiftlock");
end);
v17 = l_status_0 and l_result_0;
l_status_0 = nil;
local v20;
l_result_0, v20 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserShowGuiHideToggles");
end);
l_status_0 = l_result_0 and v20;
l_result_0 = Enum.ContextActionPriority.Low.Value;
v20 = Enum.ContextActionPriority.High.Value;
local v21 = {
    Enum.KeyCode.LeftShift,
    Enum.KeyCode.P
};
local v22 = Vector3.new(1, 1, 1) * 64;
local v23 = Vector2.new(0.75, 1) * 8;
local v24 = {};
v24.__index = v24;
v24.new = function(v25, v26)
    local v27 = setmetatable({}, v24);
    v27.f = v25;
    v27.p = v26;
    v27.v = v26 * 0;
    return v27;
end;
v24.Update = function(v28, v29, v30)
    local v31 = (v28.f * 2) * 3.141592653589793;
    local l_p_0 = v28.p;
    local l_v_0 = v28.v;
    local v34 = v30 - l_p_0;
    local v35 = l_exp_0(-v31 * v29);
    local v36 = v30 + (l_v_0 * v29 - v34 * (v31 * v29 + 1)) * v35;
    local v37 = ((v31 * v29) * (v34 * v31 - l_v_0) + l_v_0) * v35;
    v28.p = v36;
    v28.v = v37;
    return v36;
end;
v24.Reset = function(v38, v39)
    v38.p = v39;
    v38.v = v39 * 0;
end;
local v40 = Vector3.new();
local v41 = Vector2.new();
local v42 = 0;
local v43 = v24.new(1.5, (Vector3.new()));
local v44 = v24.new(1, Vector2.new());
local v45 = v24.new(4, 0);
local v46 = {};
local v47 = nil;
local function v49(v48)
    return (l_exp_0(2 * v48) - 1) / 6.38905609893065;
end;
local function v51(v50)
    return (l_exp_0(2 * ((v50 - 0.15) / 0.85)) - 1) / 6.38905609893065;
end;
v47 = function(v52)
    return l_sign_0(v52) * l_clamp_0((l_exp_0(2 * ((l_abs_0(v52) - 0.15) / 0.85)) - 1) / 6.38905609893065, 0, 1);
end;
v49 = {
    ButtonX = 0,
    ButtonY = 0,
    DPadDown = 0,
    DPadUp = 0,
    ButtonL2 = 0,
    ButtonR2 = 0,
    Thumbstick1 = Vector2.new(),
    Thumbstick2 = Vector2.new()
};
v51 = {
    W = 0,
    A = 0,
    S = 0,
    D = 0,
    E = 0,
    Q = 0,
    U = 0,
    H = 0,
    J = 0,
    K = 0,
    I = 0,
    Y = 0,
    Up = 0,
    Down = 0,
    LeftShift = 0,
    RightShift = 0
};
local v53 = {
    Delta = Vector2.new(),
    MouseWheel = 0
};
local v54 = Vector3.new(1, 1, 1);
local v55 = Vector3.new(1, 1, 1);
local v56 = Vector2.new(1, 1) * 0.04908738521234052;
local v57 = Vector2.new(1, 1) * 0.39269908169872414;
local v58 = 1;
local l_v51_0 = v51 --[[ copy: 34 -> 48 ]];
local l_v49_0 = v49 --[[ copy: 33 -> 49 ]];
local l_v54_0 = v54 --[[ copy: 36 -> 50 ]];
local l_v55_0 = v55 --[[ copy: 37 -> 51 ]];
do
    local l_v47_0, l_v58_0 = v47, v58;
    v46.Vel = function(v65)
        l_v58_0 = l_clamp_0(l_v58_0 + (v65 * (l_v51_0.Up - l_v51_0.Down)) * 0.75, 0.01, 4);
        return (Vector3.new(l_v47_0(l_v49_0.Thumbstick1.X), l_v47_0(l_v49_0.ButtonR2) - l_v47_0(l_v49_0.ButtonL2), l_v47_0(-l_v49_0.Thumbstick1.Y)) * l_v54_0 + Vector3.new(((l_v51_0.D - l_v51_0.A) + l_v51_0.K) - l_v51_0.H, ((l_v51_0.E - l_v51_0.Q) + l_v51_0.I) - l_v51_0.Y, ((l_v51_0.S - l_v51_0.W) + l_v51_0.J) - l_v51_0.U) * l_v55_0) * (l_v58_0 * (not (l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftShift) or l_UserInputService_0:IsKeyDown(Enum.KeyCode.RightShift)) and 1 or 0.25));
    end;
    local l_v57_0 = v57 --[[ copy: 39 -> 52 ]];
    local l_v53_0 = v53 --[[ copy: 35 -> 53 ]];
    local l_v56_0 = v56 --[[ copy: 38 -> 54 ]];
    v46.Pan = function(_)
        local v70 = Vector2.new(l_v47_0(l_v49_0.Thumbstick2.Y), l_v47_0(-l_v49_0.Thumbstick2.X)) * l_v57_0;
        local v71 = l_v53_0.Delta * l_v56_0;
        l_v53_0.Delta = Vector2.new();
        return v70 + v71;
    end;
    v46.Fov = function(_)
        local v73 = (l_v49_0.ButtonX - l_v49_0.ButtonY) * 0.25;
        local v74 = l_v53_0.MouseWheel * 1;
        l_v53_0.MouseWheel = 0;
        return v73 + v74;
    end;
    local function v78(_, v76, v77)
        l_v51_0[v77.KeyCode.Name] = v76 == Enum.UserInputState.Begin and 1 or 0;
        return Enum.ContextActionResult.Sink;
    end;
    local function v82(_, v80, v81)
        l_v49_0[v81.KeyCode.Name] = v80 == Enum.UserInputState.Begin and 1 or 0;
        return Enum.ContextActionResult.Sink;
    end;
    local function v87(_, _, v85)
        local l_Delta_0 = v85.Delta;
        l_v53_0.Delta = Vector2.new(-l_Delta_0.y, -l_Delta_0.x);
        return Enum.ContextActionResult.Sink;
    end;
    local function v91(_, _, v90)
        l_v49_0[v90.KeyCode.Name] = v90.Position;
        return Enum.ContextActionResult.Sink;
    end;
    local function v95(_, _, v94)
        l_v49_0[v94.KeyCode.Name] = v94.Position.z;
        return Enum.ContextActionResult.Sink;
    end;
    local function v99(_, _, v98)
        l_v53_0[v98.UserInputType.Name] = -v98.Position.z;
        return Enum.ContextActionResult.Sink;
    end;
    local function _(v100)
        for v101, v102 in pairs(v100) do
            v100[v101] = v102 * 0;
        end;
    end;
    local l_v78_0 = v78 --[[ copy: 41 -> 55 ]];
    local l_v87_0 = v87 --[[ copy: 43 -> 56 ]];
    local l_v82_0 = v82 --[[ copy: 42 -> 57 ]];
    v46.StartCapture = function()
        l_ContextActionService_0:BindActionAtPriority("FreecamKeyboard", l_v78_0, false, v20, Enum.KeyCode.W, Enum.KeyCode.U, Enum.KeyCode.A, Enum.KeyCode.H, Enum.KeyCode.S, Enum.KeyCode.J, Enum.KeyCode.D, Enum.KeyCode.K, Enum.KeyCode.E, Enum.KeyCode.I, Enum.KeyCode.Q, Enum.KeyCode.Y, Enum.KeyCode.Up, Enum.KeyCode.Down);
        l_ContextActionService_0:BindActionAtPriority("FreecamMousePan", l_v87_0, false, v20, Enum.UserInputType.MouseMovement);
        l_ContextActionService_0:BindActionAtPriority("FreecamMouseWheel", v99, false, v20, Enum.UserInputType.MouseWheel);
        l_ContextActionService_0:BindActionAtPriority("FreecamGamepadButton", l_v82_0, false, v20, Enum.KeyCode.ButtonX, Enum.KeyCode.ButtonY);
        l_ContextActionService_0:BindActionAtPriority("FreecamGamepadTrigger", v95, false, v20, Enum.KeyCode.ButtonR2, Enum.KeyCode.ButtonL2);
        l_ContextActionService_0:BindActionAtPriority("FreecamGamepadThumbstick", v91, false, v20, Enum.KeyCode.Thumbstick1, Enum.KeyCode.Thumbstick2);
    end;
    v46.StopCapture = function()
        l_v58_0 = 1;
        local l_l_v49_0_0 = l_v49_0;
        for v108, v109 in pairs(l_l_v49_0_0) do
            l_l_v49_0_0[v108] = v109 * 0;
        end;
        l_l_v49_0_0 = l_v51_0;
        for v110, v111 in pairs(l_l_v49_0_0) do
            l_l_v49_0_0[v110] = v111 * 0;
        end;
        l_l_v49_0_0 = l_v53_0;
        for v112, v113 in pairs(l_l_v49_0_0) do
            l_l_v49_0_0[v112] = v113 * 0;
        end;
        l_ContextActionService_0:UnbindAction("FreecamKeyboard");
        l_ContextActionService_0:UnbindAction("FreecamMousePan");
        l_ContextActionService_0:UnbindAction("FreecamMouseWheel");
        l_ContextActionService_0:UnbindAction("FreecamGamepadButton");
        l_ContextActionService_0:UnbindAction("FreecamGamepadTrigger");
        l_ContextActionService_0:UnbindAction("FreecamGamepadThumbstick");
    end;
end;
v47 = function(v114)
    local v115 = v43:Update(v114, v46.Vel(v114));
    local v116 = v44:Update(v114, v46.Pan(v114));
    local v117 = v45:Update(v114, v46.Fov(v114));
    local v118 = l_sqrt_0(0.7002075382097097 / l_tan_0((l_rad_0(v42 / 2))));
    v42 = l_clamp_0(v42 + (v117 * 300) * (v114 / v118), 1, 120);
    v41 = v41 + (v116 * v23) * (v114 / v118);
    v41 = Vector2.new(l_clamp_0(v41.x, -1.5707963267948966, 1.5707963267948966), v41.y % 6.283185307179586);
    local v119 = (CFrame.new(v40) * CFrame.fromOrientation(v41.x, v41.y, 0)) * CFrame.new((v115 * v22) * v114);
    v40 = v119.p;
    l_CurrentCamera_0.CFrame = v119;
    l_CurrentCamera_0.Focus = v119;
    l_CurrentCamera_0.FieldOfView = v42;
end;
v49 = function()
    return ((l_Players_0.LocalPlayer.DevEnableMouseLock and l_GameSettings_0.ControlMode == Enum.ControlMode.MouseLockSwitch) and not (l_GameSettings_0.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove)) and not (l_Players_0.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.Scriptable);
end;
v51 = {};
v53 = nil;
v54 = nil;
v55 = nil;
v56 = nil;
v57 = nil;
v58 = nil;
local v120 = {};
local v121 = {
    Backpack = true,
    Chat = true,
    Health = true,
    PlayerList = true
};
local v122 = {
    BadgesNotificationsActive = true,
    PointsNotificationsActive = true
};
do
    local l_v53_1, l_v54_1, l_v55_1, l_v56_1, l_v57_1, l_v58_1 = v53, v54, v55, v56, v57, v58;
    v51.Push = function()
        for v129 in pairs(v121) do
            v121[v129] = l_StarterGui_0:GetCoreGuiEnabled(Enum.CoreGuiType[v129]);
            l_StarterGui_0:SetCoreGuiEnabled(Enum.CoreGuiType[v129], false);
        end;
        for v130 in pairs(v122) do
            v122[v130] = l_StarterGui_0:GetCore(v130);
            l_StarterGui_0:SetCore(v130, false);
        end;
        local l_PlayerGui_0 = l_LocalPlayer_0:FindFirstChildOfClass("PlayerGui");
        if l_PlayerGui_0 then
            for _, v133 in pairs(l_PlayerGui_0:GetChildren()) do
                if not (not v133:IsA("ScreenGui") or not v133.Enabled) then
                    v120[#v120 + 1] = v133;
                    v133.Enabled = false;
                end;
            end;
        end;
        l_v58_1 = l_CurrentCamera_0.FieldOfView;
        l_CurrentCamera_0.FieldOfView = 70;
        l_v55_1 = l_CurrentCamera_0.CameraType;
        l_CurrentCamera_0.CameraType = Enum.CameraType.Custom;
        l_v57_1 = l_CurrentCamera_0.CFrame;
        l_v56_1 = l_CurrentCamera_0.Focus;
        l_v54_1 = l_UserInputService_0.MouseIconEnabled;
        l_UserInputService_0.MouseIconEnabled = false;
        if not v17 or not (((l_Players_0.LocalPlayer.DevEnableMouseLock and l_GameSettings_0.ControlMode == Enum.ControlMode.MouseLockSwitch) and not (l_GameSettings_0.ComputerMovementMode == Enum.ComputerMovementMode.ClickToMove)) and not (l_Players_0.LocalPlayer.DevComputerMovementMode == Enum.DevComputerMovementMode.Scriptable)) then
            l_v53_1 = l_UserInputService_0.MouseBehavior;
        else
            l_v53_1 = Enum.MouseBehavior.Default;
        end;
        l_UserInputService_0.MouseBehavior = Enum.MouseBehavior.Default;
    end;
    v51.Pop = function()
        for v134, v135 in pairs(v121) do
            l_StarterGui_0:SetCoreGuiEnabled(Enum.CoreGuiType[v134], v135);
        end;
        for v136, v137 in pairs(v122) do
            l_StarterGui_0:SetCore(v136, v137);
        end;
        for _, v139 in pairs(v120) do
            if v139.Parent then
                v139.Enabled = true;
            end;
        end;
        l_CurrentCamera_0.FieldOfView = l_v58_1;
        l_v58_1 = nil;
        l_CurrentCamera_0.CameraType = l_v55_1;
        l_v55_1 = nil;
        l_CurrentCamera_0.CFrame = l_v57_1;
        l_v57_1 = nil;
        l_CurrentCamera_0.Focus = l_v56_1;
        l_v56_1 = nil;
        l_UserInputService_0.MouseIconEnabled = l_v54_1;
        l_v54_1 = nil;
        l_UserInputService_0.MouseBehavior = l_v53_1;
        l_v53_1 = nil;
    end;
end;
v53 = function()
    if l_status_0 then
        script:SetAttribute("FreecamEnabled", true);
    end;
    local l_CFrame_0 = l_CurrentCamera_0.CFrame;
    v41 = Vector2.new(l_CFrame_0:toEulerAnglesYXZ());
    v40 = l_CFrame_0.p;
    v42 = l_CurrentCamera_0.FieldOfView;
    v43:Reset((Vector3.new()));
    v44:Reset(Vector2.new());
    v45:Reset(0);
    v51.Push();
    l_RunService_0:BindToRenderStep("Freecam", Enum.RenderPriority.Camera.Value, v47);
    v46.StartCapture();
end;
v54 = function()
    if l_status_0 then
        script:SetAttribute("FreecamEnabled", false);
    end;
    v46.StopCapture();
    l_RunService_0:UnbindFromRenderStep("Freecam");
    v51.Pop();
end;
v55 = false;
do
    local l_v55_2 = v55;
    v56 = function()
        if not l_v55_2 then
            v53();
        else
            if l_status_0 then
                script:SetAttribute("FreecamEnabled", false);
            end;
            v46.StopCapture();
            l_RunService_0:UnbindFromRenderStep("Freecam");
            v51.Pop();
        end;
        l_v55_2 = not l_v55_2;
    end;
    v57 = function(v142)
        for v143 = 1, #v142 - 1 do
            if not l_UserInputService_0:IsKeyDown(v142[v143]) then
                return ;
            end;
        end;
        if not l_v55_2 then
            v53();
        else
            if l_status_0 then
                script:SetAttribute("FreecamEnabled", false);
            end;
            v46.StopCapture();
            l_RunService_0:UnbindFromRenderStep("Freecam");
            v51.Pop();
        end;
        l_v55_2 = not l_v55_2;
    end;
    l_ContextActionService_0:BindActionAtPriority("FreecamToggle", function(_, v145, v146)
        if v145 == Enum.UserInputState.Begin and v146.KeyCode == v21[#v21] then
            v57(v21);
        end;
        return Enum.ContextActionResult.Pass;
    end, false, l_result_0, v21[#v21]);
    if l_status_0 then
        script:SetAttribute("FreecamEnabled", l_v55_2);
        script:GetAttributeChangedSignal("FreecamEnabled"):Connect(function()
            local l_script_Attribute_0 = script:GetAttribute("FreecamEnabled");
            if typeof(l_script_Attribute_0) ~= "boolean" then
                script:SetAttribute("FreecamEnabled", l_v55_2);
                return ;
            else
                if l_script_Attribute_0 ~= l_v55_2 then
                    if not l_script_Attribute_0 then
                        if l_status_0 then
                            script:SetAttribute("FreecamEnabled", false);
                        end;
                        v46.StopCapture();
                        l_RunService_0:UnbindFromRenderStep("Freecam");
                        v51.Pop();
                        l_v55_2 = false;
                    else
                        v53();
                        l_v55_2 = true;
                        return ;
                    end;
                end;
                return ;
            end;
        end);
    end;
end;


local v0 = game:DefineFastFlag("AllowLuobuFreecamGroup", false);
local v1 = {
    4358041
};
local v2 = {
    7842878
};
local l_HttpRbxApiService_0 = game:GetService("HttpRbxApiService");
local l_HttpService_0 = game:GetService("HttpService");
local l_Players_0 = game:GetService("Players");
local l_PolicyService_0 = game:GetService("PolicyService");
local l_RunService_0 = game:GetService("RunService");
local l_RobloxGui_0 = game:GetService("CoreGui"):WaitForChild("RobloxGui");
local v9 = require(l_RobloxGui_0.Modules.Common.Url);
local v10 = require(l_RobloxGui_0.Modules.Server.ServerUtil);
return function()
    local function v14(v11, v12)
        local l_v11_FirstChildOfClass_0 = v11:FindFirstChildOfClass(v12);
        while not l_v11_FirstChildOfClass_0 or l_v11_FirstChildOfClass_0.ClassName ~= v12 do
            l_v11_FirstChildOfClass_0 = v11.ChildAdded:Wait();
        end;
        return l_v11_FirstChildOfClass_0;
    end;
    local function v20(v15)
        local v16 = v14(v15, "PlayerGui");
        local l_FreeCamera_0 = script.Parent:WaitForChild("FreeCamera");
        local l_ScreenGui_0 = Instance.new("ScreenGui");
        l_ScreenGui_0.Name = "Freecam";
        l_ScreenGui_0.ResetOnSpawn = false;
        local l_LocalScript_0 = Instance.new("LocalScript");
        l_LocalScript_0.Name = "FreecamScript";
        if not v10.getFFlagServerCoreScriptSourceCode() then
            l_LocalScript_0.Source = l_FreeCamera_0.Source;
        else
            l_LocalScript_0.Source = v10.getSourceForServerScript(l_FreeCamera_0);
        end;
        l_LocalScript_0.Parent = l_ScreenGui_0;
        l_ScreenGui_0.Parent = v16;
    end;
    local function v32(v21)
        if not l_RunService_0:IsStudio() then
            if v21.UserId <= 0 then
                return false;
            else
                local l_status_0, l_result_0 = pcall(function()
                    return l_HttpService_0:JSONDecode((l_HttpRbxApiService_0:PostAsyncFullUrl(string.format(v9.APIS_URL .. "asset-permissions-api/v1/rcc/assets/check-permissions"), (l_HttpService_0:JSONEncode({
                        requests = {
                            {
                                subject = {
                                    subjectType = "User",
                                    subjectId = v21.UserId
                                },
                                action = "Edit",
                                assetId = game.PlaceId
                            }
                        }
                    })))));
                end);
                if l_status_0 then
                    l_result_0 = l_result_0.results[1];
                    if l_result_0.value and l_result_0.value.status == "HasPermission" then
                        return true;
                    end;
                end;
                for _, v25 in ipairs(v1) do
                    local l_status_1, l_result_1 = pcall(v21.IsInGroup, v21, v25);
                    if not (not l_status_1 or not l_result_1) then
                        return true;
                    end;
                end;
                if not (not v0 or not game:GetEngineFeature("LuobuModerationStatus")) and l_PolicyService_0.IsLuobuServer == Enum.TriStateBoolean.True then
                    for _, v29 in ipairs(v2) do
                        local l_status_2, l_result_2 = pcall(v21.IsInGroup, v21, v29);
                        if not (not l_status_2 or not l_result_2) then
                            return true;
                        end;
                    end;
                end;
                return false;
            end;
        else
            return true;
        end;
    end;
    local function v34(v33)
        if v32(v33) then
            v20(v33);
        end;
    end;
    l_Players_0.PlayerAdded:Connect(v34);
    for _, v36 in ipairs(l_Players_0:GetPlayers()) do
        coroutine.wrap(v34)(v36);
    end;
end;


local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
return function(v1, v2)
    if not v2 then
        v2 = {};
    end;
    assert(v2 ~= nil, "eventTable must not be nil");
    v2.gameId = tostring(game.GameId);
    v2.placeId = tostring(game.PlaceId);
    l_RbxAnalyticsService_0:SendEventDeferred("rcc", "lua_chat_system", v1, v2);
end;


local l_Chat_0 = game:GetService("Chat");
local l_ServerScriptService_0 = game:GetService("ServerScriptService");
local l_RobloxGui_0 = game:GetService("CoreGui"):WaitForChild("RobloxGui");
local v3 = require(l_RobloxGui_0.Modules.Common.Flags.FFlagEnableForkedChatAnalytics);
local v4 = require(l_RobloxGui_0.Modules.Server.ServerUtil);
local v5 = nil;
if v3 then
    v5 = require(l_RobloxGui_0.Modules.Server.SendChatAnalytics);
end;
local function v10(v6, v7)
    local v8 = script.Parent:WaitForChild(v6);
    local l_Script_0 = Instance.new("Script");
    l_Script_0.Name = v6;
    if not v4.getFFlagServerCoreScriptSourceCode() then
        l_Script_0.Source = v8.Source;
    else
        l_Script_0.Source = v4.getSourceForServerScript(v8);
    end;
    l_Script_0.Parent = v7;
    return l_Script_0;
end;
local function _(v11, v12, v13)
    local v14 = v11:WaitForChild(v12);
    local l_ModuleScript_0 = Instance.new("ModuleScript");
    l_ModuleScript_0.Name = v12;
    if not v4.getFFlagServerCoreScriptSourceCode() then
        l_ModuleScript_0.Source = v14.Source;
    else
        l_ModuleScript_0.Source = v4.getSourceForServerScript(v14);
    end;
    l_ModuleScript_0.Parent = v13;
    return l_ModuleScript_0;
end;
local function _(v17, v18, v19)
    local l_v17_FirstChild_0 = v17:FindFirstChild(v18);
    if not l_v17_FirstChild_0 or not l_v17_FirstChild_0:IsA("BoolValue") then
        return v19;
    else
        return l_v17_FirstChild_0.Value;
    end;
end;
local function v24(v22)
    local l_LocalizationTable_0 = Instance.new("LocalizationTable");
    l_LocalizationTable_0.Name = "ChatLocalization";
    l_LocalizationTable_0.Archivable = false;
    l_LocalizationTable_0.SourceLocaleId = "en-us";
    l_LocalizationTable_0:SetEntries(require(script.Parent:WaitForChild("DefaultChatLocalization")));
    l_LocalizationTable_0:SetIsExemptFromUGCAnalytics(true);
    l_LocalizationTable_0.Parent = v22;
end;
return function()
    local v25 = {};
    local l_ChatLocalization_0 = l_Chat_0:FindFirstChild("ChatLocalization");
    if not l_ChatLocalization_0 then
        v24(l_Chat_0);
    elseif l_ChatLocalization_0:IsA("LocalizationTable") then
        l_ChatLocalization_0:SetIsExemptFromUGCAnalytics(true);
    end;
    local v27 = true;
    local l_ChatServiceRunner_0 = l_Chat_0:FindFirstChild("ChatServiceRunner");
    if l_ChatServiceRunner_0 then
        if v3 then
            v25.ChatServiceRunner = "True";
        end;
    else
        v27 = false;
        l_ChatServiceRunner_0 = v10("ChatServiceRunner", l_Chat_0);
        local l_Parent_0 = script.Parent;
        local l_l_ChatServiceRunner_0_0 = l_ChatServiceRunner_0;
        local l_ChatService_0 = l_Parent_0:WaitForChild("ChatService");
        local l_ModuleScript_1 = Instance.new("ModuleScript");
        l_ModuleScript_1.Name = "ChatService";
        if not v4.getFFlagServerCoreScriptSourceCode() then
            l_ModuleScript_1.Source = l_ChatService_0.Source;
        else
            l_ModuleScript_1.Source = v4.getSourceForServerScript(l_ChatService_0);
        end;
        l_ModuleScript_1.Parent = l_l_ChatServiceRunner_0_0;
        l_Parent_0 = script.Parent;
        l_l_ChatServiceRunner_0_0 = l_ChatServiceRunner_0;
        l_ChatService_0 = l_Parent_0:WaitForChild("ChatChannel");
        l_ModuleScript_1 = Instance.new("ModuleScript");
        l_ModuleScript_1.Name = "ChatChannel";
        if not v4.getFFlagServerCoreScriptSourceCode() then
            l_ModuleScript_1.Source = l_ChatService_0.Source;
        else
            l_ModuleScript_1.Source = v4.getSourceForServerScript(l_ChatService_0);
        end;
        l_ModuleScript_1.Parent = l_l_ChatServiceRunner_0_0;
        l_Parent_0 = script.Parent;
        l_l_ChatServiceRunner_0_0 = l_ChatServiceRunner_0;
        l_ChatService_0 = l_Parent_0:WaitForChild("Speaker");
        l_ModuleScript_1 = Instance.new("ModuleScript");
        l_ModuleScript_1.Name = "Speaker";
        if not v4.getFFlagServerCoreScriptSourceCode() then
            l_ModuleScript_1.Source = l_ChatService_0.Source;
        else
            l_ModuleScript_1.Source = v4.getSourceForServerScript(l_ChatService_0);
        end;
        l_ModuleScript_1.Parent = l_l_ChatServiceRunner_0_0;
        l_Parent_0 = script.Parent;
        l_l_ChatServiceRunner_0_0 = l_ChatServiceRunner_0;
        l_ChatService_0 = l_Parent_0:WaitForChild("Util");
        l_ModuleScript_1 = Instance.new("ModuleScript");
        l_ModuleScript_1.Name = "Util";
        if not v4.getFFlagServerCoreScriptSourceCode() then
            l_ModuleScript_1.Source = l_ChatService_0.Source;
        else
            l_ModuleScript_1.Source = v4.getSourceForServerScript(l_ChatService_0);
        end;
        l_ModuleScript_1.Parent = l_l_ChatServiceRunner_0_0;
    end;
    local l_ChatModules_0 = l_Chat_0:FindFirstChild("ChatModules");
    if not l_ChatModules_0 then
        l_ChatModules_0 = Instance.new("Folder");
        l_ChatModules_0.Name = "ChatModules";
        l_ChatModules_0.Archivable = false;
        local l_BoolValue_0 = Instance.new("BoolValue");
        l_BoolValue_0.Name = "InsertDefaultModules";
        l_BoolValue_0.Value = true;
        l_BoolValue_0.Parent = l_ChatModules_0;
        l_ChatModules_0.Parent = l_Chat_0;
    end;
    assert(l_ChatModules_0, "");
    local l_InsertDefaultModules_0 = l_ChatModules_0:FindFirstChild("InsertDefaultModules");
    if not not l_InsertDefaultModules_0 and if l_InsertDefaultModules_0:IsA("BoolValue") then l_InsertDefaultModules_0.Value else false then
        if not l_ChatModules_0:FindFirstChild("Utility") then
            local l_Folder_0 = Instance.new("Folder");
            l_Folder_0.Name = "Utility";
            l_Folder_0.Parent = l_ChatModules_0;
        end;
        local l_Children_0 = script.Parent.DefaultChatModules:GetChildren();
        for v38 = 1, #l_Children_0 do
            if not (l_Children_0.className ~= "Folder") or l_ChatModules_0:FindFirstChild(l_Children_0[v38].Name) then
                if v3 and l_Children_0.className ~= "Folder" then
                    v25[l_Children_0[v38].Name] = "True";
                end;
            else
                local l_DefaultChatModules_0 = script.Parent.DefaultChatModules;
                local l_Name_0 = l_Children_0[v38].Name;
                local l_l_ChatModules_0_0 = l_ChatModules_0;
                local v42 = l_DefaultChatModules_0:WaitForChild(l_Name_0);
                local l_ModuleScript_2 = Instance.new("ModuleScript");
                l_ModuleScript_2.Name = l_Name_0;
                if not v4.getFFlagServerCoreScriptSourceCode() then
                    l_ModuleScript_2.Source = v42.Source;
                else
                    l_ModuleScript_2.Source = v4.getSourceForServerScript(v42);
                end;
                l_ModuleScript_2.Parent = l_l_ChatModules_0_0;
            end;
        end;
        for _, v45 in pairs(script.Parent.DefaultChatModules.Utility:GetChildren()) do
            if l_ChatModules_0.Utility:FindFirstChild(v45.Name) then
                if v3 then
                    v25[v45.Name] = "True";
                end;
            else
                local l_Utility_0 = script.Parent.DefaultChatModules.Utility;
                local l_Name_1 = v45.Name;
                local l_Utility_1 = l_ChatModules_0.Utility;
                local v49 = l_Utility_0:WaitForChild(l_Name_1);
                local l_ModuleScript_3 = Instance.new("ModuleScript");
                l_ModuleScript_3.Name = l_Name_1;
                if not v4.getFFlagServerCoreScriptSourceCode() then
                    l_ModuleScript_3.Source = v49.Source;
                else
                    l_ModuleScript_3.Source = v4.getSourceForServerScript(v49);
                end;
                l_ModuleScript_3.Parent = l_Utility_1;
            end;
        end;
    end;
    if not l_ServerScriptService_0:FindFirstChild("ChatServiceRunner") then
        local v51 = l_ChatServiceRunner_0:Clone();
        v51.Archivable = false;
        v51.Parent = l_ServerScriptService_0;
    end;
    l_ChatServiceRunner_0.Archivable = v27;
    if v3 then
        v5("LoadServerDefaultChatForkedModules", v25);
    end;
end;


local l_ClientChatModules_0 = game:GetService("Chat"):WaitForChild("ClientChatModules");
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
local l_ChatConstants_0 = require(l_ClientChatModules_0:WaitForChild("ChatConstants"));
local v3 = nil;
pcall(function()
    v3 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
if v3 == nil then
    v3 = {};
end;
if not (v3.FormatMessageToSend and v3.LocalizeFormattedMessage) then
    v3.FormatMessageToSend = function(_, _, v6)
        return v6;
    end;
end;
return function(v7)
    local function _()
        if l_ChatSettings_0.ShowJoinAndLeaveHelpText ~= nil then
            return l_ChatSettings_0.ShowJoinAndLeaveHelpText;
        else
            return false;
        end;
    end;
    v7:RegisterProcessCommandsFunction("chat_commands_inquiry", function(v9, v10, v11)
        if not (v10:lower() ~= "/?") or v10:lower() == "/help" then
            local l_v7_Speaker_0 = v7:GetSpeaker(v9);
            l_v7_Speaker_0:SendSystemMessage(v3:FormatMessageToSend("GameChat_ChatCommandsTeller_Desc", "These are the basic chat commands."), v11);
            if l_ChatSettings_0.AllowMeCommand then
                l_v7_Speaker_0:SendSystemMessage(v3:FormatMessageToSend("GameChat_ChatCommandsTeller_MeCommand", "/me <text> : roleplaying command for doing actions."), v11);
            end;
            l_v7_Speaker_0:SendSystemMessage(v3:FormatMessageToSend("GameChat_ChatCommandsTeller_SwitchChannelCommand", "/c <channel> : switch channel menu tabs."), v11);
            if if l_ChatSettings_0.ShowJoinAndLeaveHelpText ~= nil then l_ChatSettings_0.ShowJoinAndLeaveHelpText else false then
                l_v7_Speaker_0:SendSystemMessage(v3:FormatMessageToSend("GameChat_ChatCommandsTeller_JoinChannelCommand", "/join <channel> or /j <channel> : join channel."), v11);
                l_v7_Speaker_0:SendSystemMessage(v3:FormatMessageToSend("GameChat_ChatCommandsTeller_LeaveChannelCommand", "/leave <channel> or /l <channel> : leave channel. (leaves current if none specified)"), v11);
            end;
            l_v7_Speaker_0:SendSystemMessage(v3:FormatMessageToSend("GameChat_ChatCommandsTeller_WhisperCommand", "/whisper <speaker> or /w <speaker> : open private message channel with speaker."), v11);
            l_v7_Speaker_0:SendSystemMessage(v3:FormatMessageToSend("GameChat_ChatCommandsTeller_MuteCommand", "/mute <speaker> : mute a speaker."), v11);
            l_v7_Speaker_0:SendSystemMessage(v3:FormatMessageToSend("GameChat_ChatCommandsTeller_UnMuteCommand", "/unmute <speaker> : unmute a speaker."), v11);
            local l_l_v7_Speaker_0_Player_0 = l_v7_Speaker_0:GetPlayer();
            if not (not l_l_v7_Speaker_0_Player_0 or not l_l_v7_Speaker_0_Player_0.Team) then
                l_v7_Speaker_0:SendSystemMessage(v3:FormatMessageToSend("GameChat_ChatCommandsTeller_TeamCommand", "/team <message> or /t <message> : send a team chat to players on your team."), v11);
            end;
            return true;
        else
            return false;
        end;
    end, l_ChatConstants_0.StandardPriority);
    if l_ChatSettings_0.GeneralChannelName then
        local l_v7_Channel_0 = v7:GetChannel(l_ChatSettings_0.GeneralChannelName);
        if l_v7_Channel_0 then
            l_v7_Channel_0.WelcomeMessage = v3:FormatMessageToSend("GameChat_ChatCommandsTeller_AllChannelWelcomeMessage", "Chat '/?' or '/help' for a list of chat commands.");
        end;
    end;
end;


local l_ChatConstants_0 = require(game:GetService("Chat"):WaitForChild("ClientChatModules"):WaitForChild("ChatConstants"));
local v1 = false;
local l_status_0, l_result_0 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserAddChatThrottlingToAllChannels");
end);
if l_status_0 then
    v1 = l_result_0;
end;
l_status_0 = true;
if v1 then
    l_status_0 = false;
end;
l_result_0 = {};
local v4 = {};
local v5 = nil;
pcall(function()
    v5 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
if v5 == nil then
    v5 = {};
end;
if not (v5.FormatMessageToSend and v5.LocalizeFormattedMessage) then
    v5.FormatMessageToSend = function(_, _, v8)
        return v8;
    end;
end;
local function _(v9)
    table.insert(v9, tick() + 15);
end;
return function(v11)
    v11:RegisterProcessCommandsFunction("flood_detection", function(v12, _, v14)
        if not v4[v12] then
            local l_v11_Speaker_0 = v11:GetSpeaker(v12);
            if l_v11_Speaker_0 then
                if l_v11_Speaker_0:GetPlayer() then
                    if not l_result_0[v12] then
                        l_result_0[v12] = {};
                    end;
                    local v16 = nil;
                    if not l_status_0 then
                        v16 = l_result_0[v12];
                    else
                        if not l_result_0[v12][v14] then
                            l_result_0[v12][v14] = {};
                        end;
                        v16 = l_result_0[v12][v14];
                    end;
                    local v17 = tick();
                    while #v16 > 0 and v16[1] < v17 do
                        table.remove(v16, 1);
                    end;
                    if #v16 < 7 then
                        table.insert(v16, tick() + 15);
                        return false;
                    else
                        local v18 = math.ceil(v16[1] - v17);
                        l_v11_Speaker_0:SendSystemMessage(v5:FormatMessageToSend("GameChat_ChatFloodDetector_MessageDisplaySeconds", string.format("You must wait %d %s before sending another message", v18, v18 > 1 and "seconds" or "second"), "RBX_NUMBER", (tostring(v18))), v14);
                        return true;
                    end;
                else
                    return false;
                end;
            else
                return false;
            end;
        else
            return false;
        end;
    end, l_ChatConstants_0.LowPriority);
    v11.SpeakerRemoved:connect(function(v19)
        l_result_0[v19] = nil;
    end);
end;


local v0 = {
    Groups = {
        {
            GroupId = 1200769,
            ChatColor = Color3.new(1, 0.8431372549019608, 0)
        }
    },
    Players = {
        {}
    }
};
local _ = function(v1, v2)
    local v3 = true;
    if type(v2) ~= "nil" then
        v3 = type(v2) == "number";
    end;
    assert(v3, "requiredRank must be a number or nil");
    return function(v4)
        if not v4 or not v4.UserId then
            return false;
        else
            local _ = v4.UserId;
            local v6 = false;
            local l_status_0, l_result_0 = pcall(function()
                if not v2 then
                    v6 = v4:IsInGroup(v1);
                    return ;
                else
                    v6 = v2 < v4:GetRankInGroup(v1);
                    return ;
                end;
            end);
            if not (l_status_0 or not l_result_0) then
                print("Error checking in group: " .. l_result_0);
            end;
            return v6;
        end;
    end;
end;
(function()
    if v0.Groups then
        for _, v11 in pairs(v0.Groups) do
            local l_GroupId_0 = v11.GroupId;
            local l_Rank_0 = v11.Rank;
            local v14 = true;
            if type(l_Rank_0) ~= "nil" then
                v14 = type(l_Rank_0) == "number";
            end;
            assert(v14, "requiredRank must be a number or nil");
            v11.IsInGroup = function(v15)
                if not v15 or not v15.UserId then
                    return false;
                else
                    local _ = v15.UserId;
                    local v17 = false;
                    local l_status_1, l_result_1 = pcall(function()
                        if not l_Rank_0 then
                            v17 = v15:IsInGroup(l_GroupId_0);
                            return ;
                        else
                            v17 = l_Rank_0 < v15:GetRankInGroup(l_GroupId_0);
                            return ;
                        end;
                    end);
                    if not (l_status_1 or not l_result_1) then
                        print("Error checking in group: " .. l_result_1);
                    end;
                    return v17;
                end;
            end;
        end;
    end;
end)();
local l_Players_0 = game:GetService("Players");
local function v27(v21)
    if v0.Players then
        local l_l_Players_0_FirstChild_0 = l_Players_0:FindFirstChild(v21);
        if l_l_Players_0_FirstChild_0 then
            for _, v24 in pairs(v0.Players) do
                if l_l_Players_0_FirstChild_0.UserId == v24.UserId then
                    return v24.ChatColor;
                end;
            end;
        end;
    end;
    if v0.Groups then
        for _, v26 in pairs(v0.Groups) do
            if v26.IsInGroup(l_Players_0:FindFirstChild(v21)) then
                return v26.ChatColor;
            end;
        end;
    end;
end;
return function(v28)
    local v29 = {
        Color3.new(0.9921568627450981, 0.1607843137254902, 0.2627450980392157),
        Color3.new(0.00392156862745098, 0.6352941176470588, 1),
        Color3.new(0.00784313725490196, 0.7215686274509804, 0.3411764705882353),
        BrickColor.new("Bright violet").Color,
        BrickColor.new("Bright orange").Color,
        BrickColor.new("Bright yellow").Color,
        BrickColor.new("Light reddish violet").Color,
        BrickColor.new("Brick yellow").Color
    };
    local function v35(v30)
        local v31 = 0;
        for v32 = 1, #v30 do
            local v33 = string.byte((string.sub(v30, v32, v32)));
            local v34 = (#v30 - v32) + 1;
            if #v30 % 2 == 1 then
                v34 = v34 - 1;
            end;
            if v34 % 4 >= 2 then
                v33 = -v33;
            end;
            v31 = v31 + v33;
        end;
        return v31;
    end;
    local function _(v36)
        return v29[(v35(v36) + 0) % #v29 + 1];
    end;
    local function _(v38)
        local l_v38_Player_0 = v38:GetPlayer();
        if l_v38_Player_0 and l_v38_Player_0.Team ~= nil then
            return l_v38_Player_0.TeamColor.Color;
        else
            return v29[(v35(v38.Name) + 0) % #v29 + 1];
        end;
    end;
    local function v46(v41)
        local l_v28_Speaker_0 = v28:GetSpeaker(v41);
        if not l_v28_Speaker_0:GetExtraData("NameColor") then
            local v43 = "NameColor";
            local l_l_v28_Speaker_0_Player_0 = l_v28_Speaker_0:GetPlayer();
            l_v28_Speaker_0:SetExtraData(v43, if not not l_l_v28_Speaker_0_Player_0 and l_l_v28_Speaker_0_Player_0.Team ~= nil then l_l_v28_Speaker_0_Player_0.TeamColor.Color else v29[(v35(l_v28_Speaker_0.Name) + 0) % #v29 + 1]);
        end;
        if not l_v28_Speaker_0:GetExtraData("ChatColor") then
            local v45 = v27(v41);
            if v45 then
                l_v28_Speaker_0:SetExtraData("ChatColor", v45);
            end;
        end;
        if not l_v28_Speaker_0:GetExtraData("Tags") then
            l_v28_Speaker_0:SetExtraData("Tags", {});
        end;
    end;
    v28.SpeakerAdded:connect(v46);
    for _, v48 in pairs(v28:GetSpeakerList()) do
        v46(v48);
    end;
    local v49 = {};
    l_Players_0.PlayerAdded:connect(function(v50)
        v49[v50] = v50.Changed:connect(function(v51)
            local l_v28_Speaker_1 = v28:GetSpeaker(v50.Name);
            if l_v28_Speaker_1 and (not (v51 ~= "TeamColor" and v51 ~= "Neutral") or v51 == "Team") then
                local v53 = "NameColor";
                local l_l_v28_Speaker_1_Player_0 = l_v28_Speaker_1:GetPlayer();
                l_v28_Speaker_1:SetExtraData(v53, if not not l_l_v28_Speaker_1_Player_0 and l_l_v28_Speaker_1_Player_0.Team ~= nil then l_l_v28_Speaker_1_Player_0.TeamColor.Color else v29[(v35(l_v28_Speaker_1.Name) + 0) % #v29 + 1]);
            end;
        end);
    end);
    l_Players_0.PlayerRemoving:connect(function(v55)
        local v56 = v49[v55];
        if v56 then
            v56:Disconnect();
        end;
        v49[v55] = nil;
    end);
end;


local l_Chat_0 = game:GetService("Chat");
local l_Players_0 = game:GetService("Players");
local _ = game:GetService("FriendService");
local l_ClientChatModules_0 = l_Chat_0:WaitForChild("ClientChatModules");
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
local _ = require(l_ClientChatModules_0:WaitForChild("ChatConstants"));
local v6 = false;
local l_status_0, l_result_0 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserHandleFriendJoinNotifierOnClient");
end);
if l_status_0 then
    v6 = l_result_0;
end;
l_status_0 = nil;
pcall(function()
    l_status_0 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
if l_status_0 == nil then
    l_status_0 = {};
end;
if not (l_status_0.FormatMessageToSend and l_status_0.LocalizeFormattedMessage) then
    l_status_0.FormatMessageToSend = function(_, _, v11)
        return v11;
    end;
end;
local v12 = {
    ChatColor = Color3.fromRGB(255, 255, 255)
};
return function(v13)
    local function _()
        if v6 == false and l_ChatSettings_0.ShowFriendJoinNotification ~= nil then
            return l_ChatSettings_0.ShowFriendJoinNotification;
        else
            return false;
        end;
    end;
    local function v19(v15, v16)
        local l_v13_Speaker_0 = v13:GetSpeaker(v15.Name);
        if l_v13_Speaker_0 then
            local l_Name_0 = v16.Name;
            if l_ChatSettings_0.PlayerDisplayNamesEnabled then
                l_Name_0 = v16.DisplayName;
            end;
            l_v13_Speaker_0:SendSystemMessage(l_status_0:FormatMessageToSend("GameChat_FriendChatNotifier_JoinMessage", string.format("Your friend %s has joined the game.", l_Name_0), "RBX_NAME", l_Name_0), "System", v12);
        end;
    end;
    local function _(v20, v21)
        if v20 ~= v21 then
            coroutine.wrap(function()
                if v20:IsFriendsWith(v21.UserId) then
                    v19(v20, v21);
                end;
            end)();
        end;
    end;
    if v6 == false and if l_ChatSettings_0.ShowFriendJoinNotification ~= nil then l_ChatSettings_0.ShowFriendJoinNotification else false then
        l_Players_0.PlayerAdded:connect(function(v23)
            local l_l_Players_0_Players_0 = l_Players_0:GetPlayers();
            for v25 = 1, #l_l_Players_0_Players_0 do
                local v26 = l_l_Players_0_Players_0[v25];
                if v26 ~= v23 then
                    coroutine.wrap(function()
                        if v26:IsFriendsWith(v23.UserId) then
                            v19(v26, v23);
                        end;
                    end)();
                end;
            end;
        end);
    end;
end;


local l_ClientChatModules_0 = game:GetService("Chat"):WaitForChild("ClientChatModules");
local l_ChatConstants_0 = require(l_ClientChatModules_0:WaitForChild("ChatConstants"));
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
return function(v3)
    if not (not l_ChatSettings_0 or not l_ChatSettings_0.AllowMeCommand) then
        v3:RegisterFilterMessageFunction("me_command", function(_, v5, _)
            local l_Message_0 = v5.Message;
            if l_Message_0 and string.sub(l_Message_0, 1, 4):lower() == "/me " then
                v5.MessageType = l_ChatConstants_0.MessageTypeMeCommand;
            end;
        end);
    end;
end;


local l_ClientChatModules_0 = game:GetService("Chat"):WaitForChild("ClientChatModules");
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
local l_ChatConstants_0 = require(l_ClientChatModules_0:WaitForChild("ChatConstants"));
local v3 = nil;
pcall(function()
    v3 = require(game:GetService("Chat").ClientChatModules.ChatLocalization);
end);
if v3 == nil then
    v3 = {};
end;
if not (v3.FormatMessageToSend and v3.LocalizeFormattedMessage) then
    v3.FormatMessageToSend = function(_, _, v6)
        return v6;
    end;
end;
local v7 = {
    ChatColor = l_ChatSettings_0.ErrorMessageTextColor or Color3.fromRGB(245, 50, 50)
};
return function(v8)
    local l_Players_0 = game:GetService("Players");
    local v10 = v8:AddChannel("Team");
    v10.WelcomeMessage = v3:FormatMessageToSend("GameChat_TeamChat_WelcomeMessage", "This is a private channel between you and your team members.");
    v10.Joinable = false;
    v10.Leavable = false;
    v10.AutoJoin = false;
    v10.Private = true;
    v10:RegisterProcessCommandsFunction("replication_function", function(v11, v12, v13)
        local l_v8_Speaker_0 = v8:GetSpeaker(v11);
        local l_v8_Channel_0 = v8:GetChannel(v13);
        if not (not l_v8_Speaker_0 or not l_v8_Channel_0) then
            local l_l_v8_Speaker_0_Player_0 = l_v8_Speaker_0:GetPlayer();
            if l_l_v8_Speaker_0_Player_0 then
                for _, v18 in pairs(l_v8_Channel_0:GetSpeakerList()) do
                    local l_v8_Speaker_1 = v8:GetSpeaker(v18);
                    if l_v8_Speaker_1 then
                        local l_l_v8_Speaker_1_Player_0 = l_v8_Speaker_1:GetPlayer();
                        if l_l_v8_Speaker_1_Player_0 and l_l_v8_Speaker_0_Player_0.Team == l_l_v8_Speaker_1_Player_0.Team then
                            l_v8_Speaker_1:SendMessage(v12, v13, v11, {
                                NameColor = l_l_v8_Speaker_0_Player_0.TeamColor.Color,
                                ChatColor = l_l_v8_Speaker_0_Player_0.TeamColor.Color,
                                ChannelColor = l_l_v8_Speaker_0_Player_0.TeamColor.Color
                            });
                        end;
                    end;
                end;
            end;
        end;
        return true;
    end, l_ChatConstants_0.LowPriority);
    local function v27(v21, v22, v23)
        if v22 == nil then
            v22 = "";
        end;
        local l_v8_Speaker_2 = v8:GetSpeaker(v21);
        if l_v8_Speaker_2 then
            local l_l_v8_Speaker_2_Player_0 = l_v8_Speaker_2:GetPlayer();
            if l_l_v8_Speaker_2_Player_0 then
                if l_l_v8_Speaker_2_Player_0.Team == nil then
                    l_v8_Speaker_2:SendSystemMessage(v3:FormatMessageToSend("GameChat_TeamChat_CannotTeamChatIfNotInTeam", "You cannot team chat if you are not on a team"), v23, v7);
                    return ;
                else
                    local l_v8_Channel_1 = v8:GetChannel("Team");
                    if l_v8_Channel_1 then
                        if not l_v8_Speaker_2:IsInChannel(l_v8_Channel_1.Name) then
                            l_v8_Speaker_2:JoinChannel(l_v8_Channel_1.Name);
                        end;
                        if v22 and string.len(v22) > 0 then
                            l_v8_Speaker_2:SayMessage(v22, l_v8_Channel_1.Name);
                        end;
                        l_v8_Speaker_2:SetMainChannel(l_v8_Channel_1.Name);
                    end;
                end;
            end;
        end;
    end;
    v8:RegisterProcessCommandsFunction("team_commands", function(v28, v29, v30)
        local v31 = false;
        if v29 == nil then
            error("Message is nil");
        end;
        if v30 == "Team" then
            return false;
        elseif not (string.sub(v29, 1, 6):lower() ~= "/team ") or v29:lower() == "/team" then
            v27(v28, string.sub(v29, 7), v30);
            return true;
        elseif not (string.sub(v29, 1, 3):lower() ~= "/t ") or v29:lower() == "/t" then
            v27(v28, string.sub(v29, 4), v30);
            return true;
        else
            if not (string.sub(v29, 1, 2):lower() ~= "% ") or v29:lower() == "%" then
                v27(v28, string.sub(v29, 3), v30);
                v31 = true;
            end;
            return v31;
        end;
    end, l_ChatConstants_0.StandardPriority);
    local function v32()
        if not l_ChatSettings_0.DefaultChannelNameColor then
            return Color3.fromRGB(35, 76, 142);
        else
            return l_ChatSettings_0.DefaultChannelNameColor;
        end;
    end;
    local function v35(v33, v34)
        if v34.Neutral or v34.Team == nil then
            v33:UpdateChannelNameColor(v10.Name, v32());
            if v33:IsInChannel(v10.Name) then
                v33:LeaveChannel(v10.Name);
                return ;
            end;
        elseif not (v34.Neutral or not v34.Team) then
            v33:UpdateChannelNameColor(v10.Name, v34.Team.TeamColor.Color);
            if not v33:IsInChannel(v10.Name) then
                v33:JoinChannel(v10.Name);
            end;
        end;
    end;
    v8.SpeakerAdded:connect(function(v36)
        local l_v8_Speaker_3 = v8:GetSpeaker(v36);
        if l_v8_Speaker_3 then
            local l_l_v8_Speaker_3_Player_0 = l_v8_Speaker_3:GetPlayer();
            if l_l_v8_Speaker_3_Player_0 then
                v35(l_v8_Speaker_3, l_l_v8_Speaker_3_Player_0);
            end;
        end;
    end);
    local v39 = {};
    l_Players_0.PlayerAdded:connect(function(v40)
        v39[v40] = v40.Changed:connect(function(v41)
            local l_v8_Speaker_4 = v8:GetSpeaker(v40.Name);
            if l_v8_Speaker_4 then
                if v41 == "Neutral" then
                    v35(l_v8_Speaker_4, v40);
                    return ;
                elseif v41 == "Team" then
                    v35(l_v8_Speaker_4, v40);
                    if l_v8_Speaker_4:IsInChannel(v10.Name) then
                        l_v8_Speaker_4:SendSystemMessage(v3:FormatMessageToSend("GameChat_TeamChat_NowInTeam", string.format("You are now on the '%s' team.", v40.Team.Name), "RBX_NAME", v40.Team.Name), v10.Name);
                    end;
                end;
            end;
        end);
    end);
    l_Players_0.PlayerRemoving:connect(function(v43)
        local v44 = v39[v43];
        if v44 then
            v44:Disconnect();
        end;
        v39[v43] = nil;
    end);
end;


local l_Players_0 = game:GetService("Players");
local l_ChatSettings_0 = require(game:GetService("Chat"):WaitForChild("ClientChatModules"):WaitForChild("ChatSettings"));
local v2 = {
    ChattingToSelf = 1,
    NoMatches = 2,
    MultipleMatches = 3
};
return {
    CommandErrorCodes = v2,
    getUserNameFromChattedName = function(v3, v4, v5)
        if v4 == v3 then
            return v4, v2.ChattingToSelf;
        else
            local l_l_Players_0_Players_0 = l_Players_0:GetPlayers();
            for _, v8 in pairs(l_l_Players_0_Players_0) do
                if string.lower(v8.Name) == string.lower(v3) then
                    return v8.Name, nil;
                end;
            end;
            local v9 = 0;
            local v10 = nil;
            if l_ChatSettings_0.PlayerDisplayNamesEnabled then
                for _, v12 in pairs(l_l_Players_0_Players_0) do
                    if v12.Name ~= v4 and string.lower(v12.DisplayName) == string.lower(v3) then
                        v9 = v9 + 1;
                        v10 = v12.Name;
                    end;
                end;
            end;
            if v9 == 1 then
                return v10, nil;
            elseif v9 == 0 then
                if v5 == v3 then
                    return v5, v2.ChattingToSelf;
                else
                    return v3, v2.NoMatches;
                end;
            elseif v9 >= 2 then
                return v3, v2.MultipleMatches;
            else
                return ;
            end;
        end;
    end,
    getUsersWithDisplayNameString = function(v13, v14)
        local v15 = {};
        local v16 = "";
        for _, v18 in pairs((l_Players_0:GetPlayers())) do
            if v18.Name ~= v14 and string.lower(v18.DisplayName) == string.lower(v13) then
                table.insert(v15, v18.Name);
            end;
        end;
        for v19, v20 in pairs(v15) do
            if v19 ~= #v15 then
                v16 = v16 .. "@" .. v20 .. ", ";
            else
                v16 = v16 .. "@" .. v20;
            end;
        end;
        return v16;
    end
};


local l_StandardPriority_0 = require(game:GetService("Chat"):WaitForChild("ClientChatModules"):WaitForChild("ChatConstants")).StandardPriority;
if l_StandardPriority_0 == nil then
    l_StandardPriority_0 = 10;
end;
local v1 = {};
v1.__index = v1;
local v2 = {};
local v3 = {};
v3.__index = v3;
v3.RebuildProcessCommandsPriorities = function(v4)
    v4.RegisteredPriorites = {};
    for v5, v6 in pairs(v4.FunctionMap) do
        local v7 = true;
        for _, _ in pairs(v6) do
            v7 = false;
            break;
        end;
        if not v7 then
            table.insert(v4.RegisteredPriorites, v5);
        end;
    end;
    table.sort(v4.RegisteredPriorites, function(v10, v11)
        return v11 < v10;
    end);
end;
v3.HasFunction = function(v12, v13)
    if v12.RegisteredFunctions[v13] == nil then
        return false;
    else
        return true;
    end;
end;
v3.RemoveFunction = function(v14, v15)
    local v16 = v14.RegisteredFunctions[v15];
    v14.RegisteredFunctions[v15] = nil;
    v14.FunctionMap[v16][v15] = nil;
    v14:RebuildProcessCommandsPriorities();
end;
v3.AddFunction = function(v17, v18, v19, v20)
    if v20 == nil then
        v20 = l_StandardPriority_0;
    end;
    if v17.RegisteredFunctions[v18] then
        error(v18 .. " is already in use");
    end;
    v17.RegisteredFunctions[v18] = v20;
    if v17.FunctionMap[v20] == nil then
        v17.FunctionMap[v20] = {};
    end;
    v17.FunctionMap[v20][v18] = v19;
    v17:RebuildProcessCommandsPriorities();
end;
v3.GetIterator = function(v21)
    local v22 = 1;
    local v23 = nil;
    local v24 = nil;
    return function()
        while true do
            if #v21.RegisteredPriorites < v22 then
                return ;
            else
                local v25 = v21.RegisteredPriorites[v22];
                local v26, v27 = next(v21.FunctionMap[v25], v23);
                v23 = v26;
                v24 = v27;
                if v23 == nil then
                    v22 = v22 + 1;
                else
                    return v23, v24, v25;
                end;
            end;
        end;
    end;
end;
v2.new = function()
    local v28 = setmetatable({}, v3);
    v28.RegisteredFunctions = {};
    v28.RegisteredPriorites = {};
    v28.FunctionMap = {};
    return v28;
end;
v1.NewSortedFunctionContainer = function(_)
    return v2.new();
end;
return v1;


local v0 = require(game:GetService("CoreGui"):WaitForChild("RobloxGui").Modules.Server.ServerUtil);
return function()
    if game:GetService("StarterPlayer"):FindFirstChild("PlayerSettings") == nil then
        local l_ModuleScript_0 = Instance.new("ModuleScript");
        l_ModuleScript_0.Name = "PlayerSettings";
        if not v0.getFFlagServerCoreScriptSourceCode() then
            l_ModuleScript_0.Source = script.Parent.DefaultServerPlayerModules:WaitForChild("PlayerSettings").Source;
        else
            l_ModuleScript_0.Source = v0.getSourceForServerScript(script.Parent.DefaultServerPlayerModules:WaitForChild("PlayerSettings"));
        end;
        l_ModuleScript_0.Parent = game:GetService("StarterPlayer");
        l_ModuleScript_0.Archivable = false;
    end;
end;


local l_Players_0 = game:GetService("Players");
local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local v2 = {};
local l_DefaultSoundEvents_0 = l_ReplicatedStorage_0:FindFirstChild("DefaultSoundEvents");
if not l_DefaultSoundEvents_0 then
    l_DefaultSoundEvents_0 = Instance.new("Folder");
    l_DefaultSoundEvents_0.Name = "DefaultSoundEvents";
    l_DefaultSoundEvents_0.Archivable = false;
    l_DefaultSoundEvents_0.Parent = l_ReplicatedStorage_0;
end;
local function _(v4, v5)
    local l_l_DefaultSoundEvents_0_FirstChild_0 = l_DefaultSoundEvents_0:FindFirstChild(v4);
    if not l_l_DefaultSoundEvents_0_FirstChild_0 then
        l_l_DefaultSoundEvents_0_FirstChild_0 = Instance.new(v5);
        l_l_DefaultSoundEvents_0_FirstChild_0.Name = v4;
        l_l_DefaultSoundEvents_0_FirstChild_0.Parent = l_DefaultSoundEvents_0;
    end;
    return l_l_DefaultSoundEvents_0_FirstChild_0;
end;
local l_DefaultServerSoundEvent_0 = l_DefaultSoundEvents_0:FindFirstChild("DefaultServerSoundEvent");
if not l_DefaultServerSoundEvent_0 then
    l_DefaultServerSoundEvent_0 = Instance.new("RemoteEvent");
    l_DefaultServerSoundEvent_0.Name = "DefaultServerSoundEvent";
    l_DefaultServerSoundEvent_0.Parent = l_DefaultSoundEvents_0;
end;
local l_l_DefaultServerSoundEvent_0_0 = l_DefaultServerSoundEvent_0;
local l_AddCharacterLoadedEvent_0 = l_DefaultSoundEvents_0:FindFirstChild("AddCharacterLoadedEvent");
if not l_AddCharacterLoadedEvent_0 then
    l_AddCharacterLoadedEvent_0 = Instance.new("RemoteEvent");
    l_AddCharacterLoadedEvent_0.Name = "AddCharacterLoadedEvent";
    l_AddCharacterLoadedEvent_0.Parent = l_DefaultSoundEvents_0;
end;
l_DefaultServerSoundEvent_0 = l_AddCharacterLoadedEvent_0;
local l_RemoveCharacterEvent_0 = l_DefaultSoundEvents_0:FindFirstChild("RemoveCharacterEvent");
if not l_RemoveCharacterEvent_0 then
    l_RemoveCharacterEvent_0 = Instance.new("RemoteEvent");
    l_RemoveCharacterEvent_0.Name = "RemoveCharacterEvent";
    l_RemoveCharacterEvent_0.Parent = l_DefaultSoundEvents_0;
end;
l_AddCharacterLoadedEvent_0 = l_RemoveCharacterEvent_0;
l_RemoveCharacterEvent_0 = function(v12, v13, v14, v15)
    if v2[v12] then
        l_l_DefaultServerSoundEvent_0_0:FireClient(v12, v13, v14, v15);
    end;
end;
local function v17(v16)
    v2[v16] = true;
end;
local function v19(v18)
    v2[v18] = nil;
end;
local l_SoundDispatcher_0 = l_DefaultSoundEvents_0:FindFirstChild("SoundDispatcher");
if not l_SoundDispatcher_0 then
    l_SoundDispatcher_0 = Instance.new("BindableEvent");
    l_SoundDispatcher_0.Name = "SoundDispatcher";
    l_SoundDispatcher_0.Parent = l_DefaultSoundEvents_0;
end;
l_SoundDispatcher_0.Event:Connect(l_RemoveCharacterEvent_0);
l_l_DefaultServerSoundEvent_0_0.OnServerEvent:Connect(function()
end);
l_DefaultServerSoundEvent_0.OnServerEvent:Connect(v17);
l_AddCharacterLoadedEvent_0.OnServerEvent:Connect(v19);
l_Players_0.PlayerRemoving:Connect(v19);