local l_CorePackages_0 = game:GetService("CorePackages");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_Packages_0 = l_CorePackages_0.Packages;
local l_useLocalization_0 = require(l_CorePackages_0.Workspace.Packages.Localization).Hooks.useLocalization;
local v4 = require(l_Packages_0.React);
local l_useSelector_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.RoactRodux.useSelector;
local v6 = require(l_Packages_0.LuauPolyfill);
local l_setTimeout_0 = v6.setTimeout;
local l_clearTimeout_0 = v6.clearTimeout;
local _ = require(script.Parent.Parent.Parent.Chrome.Service.WindowSizeSignal);
local v10 = require(script.Parent.Parent.Parent.Chrome.Hooks.useWindowSizeIsLarge);
local v11 = require(l_Packages_0.UIBlox);
local l_Interactable_0 = v11.Core.Control.Interactable;
local l_StyledTextLabel_0 = v11.App.Text.StyledTextLabel;
local l_useStyle_0 = v11.Core.Style.useStyle;
local l_withTooltip_0 = v11.App.Dialog.TooltipV2.withTooltip;
local l_TooltipOrientation_0 = v11.App.Dialog.Enum.TooltipOrientation;
local l_ControlState_0 = v11.Core.Control.Enum.ControlState;
local l_Images_0 = v11.App.ImageSet.Images;
local l_ImageSetLabel_0 = v11.Core.ImageSet.ImageSetLabel;
local v20 = require(script.Parent.CameraStatusIcon);
local v21 = require(script.Parent.CameraStatusDot);
local v22 = require(script.Parent.Parent.Utils.SizingUtils);
local v23 = require(script.Parent.Parent.Utils.FaceChatUtils);
local v24 = require(script.Parent.Parent.Utils.ModelUtils);
local v25 = require(script.Parent.Parent.Hooks.useCameraOn);
local v26 = require(script.Parent.Parent.Hooks.useLocalPlayer);
local v27 = require(script.Parent.Parent.Hooks.useTrackerMessage);
local v28 = require(script.Parent.Parent.Hooks.useTooltipDismissal);
local v29 = require(script.Parent.Parent.Parent.Chrome.Unibar.Constants);
local v30 = require(script.Parent.Parent.Parent.Chrome.Service);
local l_SelfieView_0 = script.Parent.Parent.Parent.SelfieView;
local v32 = require(l_SelfieView_0.Flags.GetFFlagSelfieViewPreviewShrinkIcon);
local v33 = require(l_SelfieView_0.Flags.GetFFlagSelfieViewDontWaitForCharacter);
local v34 = require(l_SelfieView_0.Flags.GetFFlagSelfieViewDontStartOnOpen);
local v35 = require(l_SelfieView_0.Flags.GetFFlagSelfieViewHideCameraStatusDot);
local v36 = require(l_CoreGui_0:WaitForChild("RobloxGui").Modules.SelfView.Analytics).new();
local v37 = l_Images_0["icons/actions/previewShrink"];
local v38 = UDim2.fromOffset(14, 14);
local v39 = v29.CLOSE_BUTTON_SIZE + UDim2.fromOffset(8, 8);
local v40 = require(script.Parent.FaceClone);
return function(v41)
    local l_id_0 = v41.id;
    local v43 = l_useStyle_0();
    local l_Theme_0 = v43.Theme;
    local l_Font_0 = v43.Font;
    local v46 = l_useLocalization_0({
        robloxPermissionErrorHeader = "CoreScripts.TopBar.RobloxPermissionErrorHeader",
        robloxPermissionErrorBody = "CoreScripts.TopBar.RobloxPermissionErrorBody",
        dynamicAvatarMissingErrorHeader = "CoreScripts.TopBar.DynamicAvatarMissingErrorHeader",
        dynamicAvatarMissingErrorBody = "CoreScripts.TopBar.DynamicAvatarMissingErrorBody"
    });
    local v47 = v25();
    local v48 = v27();
    local v49 = v10(v41.windowSize);
    local v51 = l_useSelector_0(function(v50)
        return v22.getSize(v50.displayOptions.screenSize, v49);
    end);
    v4.useEffect(function()
        v41.windowSize:requestSize(v51.X, v51.Y);
    end, {
        v51
    });
    local v52 = v26();
    local v53 = v4.useMemo(function()
        return v23.getPermissions().userCamEligible and v23.getPermissions().placeCamEnabled;
    end);
    local v54, v55, v56, v57 = v28(2000);
    local v58, v59 = v4.useState(true);
    local v60, v61 = v4.useState(false);
    local v62, v63 = v4.useState(false);
    local v64 = v4.useRef(nil);
    local function v65()
        if v64.current then
            l_clearTimeout_0(v64.current);
        end;
        v59(true);
        v64.current = l_setTimeout_0(function()
            v59(false);
        end, 2000);
    end;
    v4.useEffect(function()
        if v64.current then
            l_clearTimeout_0(v64.current);
        end;
        v59(true);
        v64.current = l_setTimeout_0(function()
            v59(false);
        end, 2000);
        return function()
            if v64.current then
                l_clearTimeout_0(v64.current);
            end;
        end;
    end, {
        v64
    });
    local function v67(v66)
        if v64.current then
            l_clearTimeout_0(v64.current);
        end;
        v59(true);
        v64.current = l_setTimeout_0(function()
            v59(false);
        end, 2000);
        if v23.getPermissions().userCamEnabled or v66 then
            if not v33() then
                if not ((v24.hasDynamicHead(v52.Character or v52.CharacterAdded:Wait()) or v23.isCameraOn()) or v66) then
                    v57(v46.dynamicAvatarMissingErrorHeader, v46.dynamicAvatarMissingErrorBody);
                end;
            elseif not (((not v52.Character or v24.hasDynamicHead(v52.Character)) or v23.isCameraOn()) or v66) then
                v57(v46.dynamicAvatarMissingErrorHeader, v46.dynamicAvatarMissingErrorBody);
            end;
            v36:setLastCtx("SelfView");
            v23.toggleVideoAnimation();
            return ;
        else
            v57(v46.robloxPermissionErrorHeader, v46.robloxPermissionErrorBody);
            return ;
        end;
    end;
    local v68 = v4.useCallback(function()
        v67(false);
    end, {
        v23,
        v24,
        v46,
        v52
    });
    local v69 = v4.useCallback(function()
        if v58 then
            v41.windowSize:toggleIsLarge();
        end;
        if v64.current then
            l_clearTimeout_0(v64.current);
        end;
        v59(true);
        v64.current = l_setTimeout_0(function()
            v59(false);
        end, 2000);
    end, {
        v65,
        v58,
        v41.windowSize
    });
    local v70 = v4.useRef(nil);
    v4.useEffect(function()
        if not _G.__TESTEZ_RUNNING_TEST__ then
            local v71 = v40(v52, v70.current);
            if not ((v23.isCameraOn() or v41.isDraggedOut) or v34()) then
                v67(true);
            end;
            return function()
                if v71 then
                    v71();
                end;
            end;
        else
            return ;
        end;
    end, {
        v52,
        v70
    });
    local v74 = v4.useCallback(function(_, v73)
        v63(v73 == l_ControlState_0.Hover);
    end, {
        v63
    });
    return v4.createElement("Frame", {
        Name = "SelfieViewFrame",
        Active = true,
        Size = UDim2.fromScale(1, 1),
        BackgroundColor3 = Color3.new(0, 0, 0),
        BackgroundTransparency = 0,
        [v4.Event.MouseEnter] = v65,
        [v4.Event.MouseMoved] = v65,
        ref = v70
    }, {}, {
        CloseButtonWrapper = v58 and v4.createElement("Frame", {
            ZIndex = 2,
            BackgroundTransparency = 1,
            Size = v29.CLOSE_BUTTON_FRAME
        }, {
            CloseButtonLayout = v4.createElement("UIListLayout", {
                FillDirection = Enum.FillDirection.Horizontal,
                SortOrder = Enum.SortOrder.LayoutOrder,
                VerticalAlignment = Enum.VerticalAlignment.Center,
                HorizontalAlignment = Enum.HorizontalAlignment.Center
            }),
            CloseButtonPadding = if not v32() then nil else v4.createElement("UIPadding", {
                PaddingTop = UDim.new(0, 4),
                PaddingLeft = UDim.new(0, 4),
                PaddingRight = UDim.new(0, 4),
                PaddingBottom = UDim.new(0, 4)
            }),
            CloseButtonInteractable = v4.createElement(l_Interactable_0, {
                Size = v29.CLOSE_BUTTON_FRAME,
                BackgroundTransparency = 1,
                onStateChanged = v4.useCallback(function(_, v76)
                    v61(v76 == l_ControlState_0.Hover);
                end, {
                    v61
                }),
                [v4.Event.Activated] = function()
                    v30:toggleWindow(l_id_0);
                end
            }, {
                CloseImage = if not v32() then nil else v4.createElement(l_ImageSetLabel_0, {
                    BackgroundTransparency = 1,
                    Size = UDim2.fromOffset(28, 28),
                    Position = UDim2.fromOffset(2, 2),
                    Image = v37,
                    ImageColor3 = l_Theme_0.TextEmphasis.Color,
                    ImageTransparency = l_Theme_0.TextEmphasis.Transparency
                }),
                Fragment = if v32() then nil else v4.createElement(v4.Fragment, nil, {
                    v4.createElement("Frame", {
                        Name = "X1",
                        Position = v38,
                        AnchorPoint = Vector2.new(0.5, 0),
                        Size = UDim2.new(0, 16, 0, 2),
                        BorderSizePixel = 0,
                        BackgroundColor3 = v43.Theme.IconEmphasis.Color,
                        BackgroundTransparency = 0,
                        Rotation = 45
                    }, {
                        Corner = v4.createElement("UICorner")
                    }),
                    (v4.createElement("Frame", {
                        Name = "X2",
                        Position = v38,
                        AnchorPoint = Vector2.new(0.5, 0),
                        Size = UDim2.new(0, 16, 0, 2),
                        BorderSizePixel = 0,
                        BackgroundColor3 = v43.Theme.IconEmphasis.Color,
                        BackgroundTransparency = 0,
                        Rotation = -45
                    }, {
                        Corner = v4.createElement("UICorner")
                    }))
                }),
                Hover = v4.createElement("Frame", {
                    Size = v39,
                    Position = if not v32() then nil else UDim2.fromOffset(1, 1),
                    Visible = v60,
                    BackgroundTransparency = v43.Theme.BackgroundOnHover.Transparency,
                    BackgroundColor3 = v43.Theme.BackgroundOnHover.Color
                }, {
                    Corner = v4.createElement("UICorner", {
                        CornerRadius = UDim.new(0, 8)
                    })
                })
            })
        }),
        Corners = v4.createElement("UICorner", {}),
        ControlMessage = v4.createElement("Frame", {
            AnchorPoint = Vector2.new(0.5, 1),
            Position = UDim2.new(0.5, 0, 1, -44),
            BackgroundColor3 = l_Theme_0.BackgroundUIDefault.Color,
            AutomaticSize = Enum.AutomaticSize.XY,
            ZIndex = 2,
            BorderSizePixel = 0,
            Visible = v48.visible
        }, {
            Corners = v4.createElement("UICorner", {}),
            UIPadding = v4.createElement("UIPadding", {
                PaddingTop = UDim.new(0, 4),
                PaddingRight = UDim.new(0, 8),
                PaddingBottom = UDim.new(0, 4),
                PaddingLeft = UDim.new(0, 8)
            }),
            UIListLayout = v4.createElement("UIListLayout", {
                FillDirection = Enum.FillDirection.Vertical
            }),
            Line1 = v4.createElement(l_StyledTextLabel_0, {
                text = v48.text,
                fontStyle = l_Font_0.Footer,
                colorStyle = l_Theme_0.TextDefault,
                textXAlignment = Enum.TextXAlignment.Center,
                layoutOrder = 1,
                size = UDim2.fromOffset(46, 36),
                TextWrapped = true
            }),
            Line2 = v4.createElement(l_StyledTextLabel_0, {
                text = v48.status,
                fontStyle = l_Font_0.Footer,
                colorStyle = l_Theme_0.ContextualPrimaryContent,
                textXAlignment = Enum.TextXAlignment.Center,
                layoutOrder = 2,
                size = UDim2.fromOffset(46, 12),
                automaticSize = Enum.AutomaticSize.Y
            })
        }),
        IconFrame = (not not v58 and v53) and v4.createElement("Frame", {
            BackgroundTransparency = 1,
            Size = UDim2.new(1, 0, 0, 44),
            Position = UDim2.fromScale(0.5, 1),
            AnchorPoint = Vector2.new(0.5, 1),
            ZIndex = 2
        }, {
            Tooltip = l_withTooltip_0({
                headerText = v54,
                bodyText = v55,
                textXAlignment = Enum.TextXAlignment.Left
            }, {
                guiTarget = l_CoreGui_0,
                active = v56,
                DisplayOrder = 101,
                preferredOrientation = l_TooltipOrientation_0.Bottom
            }, (v4.useCallback(function(v77)
                return v4.createElement(l_Interactable_0, {
                    Size = UDim2.fromOffset(38, 38),
                    BackgroundTransparency = 1,
                    onStateChanged = v74,
                    Position = UDim2.fromScale(0.5, 0.5),
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    [v4.Change.AbsoluteSize] = v77,
                    [v4.Change.AbsolutePosition] = v77,
                    [v4.Event.Activated] = v68
                });
            end, {
                v74,
                v68
            }))),
            Hover = v4.createElement("Frame", {
                Size = UDim2.fromOffset(38, 38),
                Visible = v62,
                AnchorPoint = Vector2.new(0.5, 0.5),
                Position = UDim2.fromScale(0.5, 0.5),
                BackgroundTransparency = v43.Theme.BackgroundOnHover.Transparency,
                BackgroundColor3 = v43.Theme.BackgroundOnHover.Color
            }, {
                Corner = v4.createElement("UICorner", {
                    CornerRadius = UDim.new(0, 8)
                })
            }),
            CameraStatusIcon = v4.createElement(v20, {
                iconSize = UDim2.fromOffset(28, 28),
                transparency = v23.getPermissions().userCamEnabled and 0 or 0.5
            })
        }) or nil,
        FocusDarken = not not v58 and v4.createElement("Frame", {
            Size = UDim2.fromScale(1, 1),
            BackgroundTransparency = 0.7,
            BackgroundColor3 = Color3.fromRGB(0, 0, 0),
            ZIndex = 2
        }, {
            Corners = v4.createElement("UICorner", {})
        }) or nil,
        CameraStatusDot = if not v35() then v47 and v4.createElement(v21, {
            Position = UDim2.new(1, -5, 0, 5),
            AnchorPoint = Vector2.new(1, 0),
            ZIndex = 2
        }) or nil else nil,
        Interactable = v4.createElement(l_Interactable_0, {
            Size = UDim2.fromScale(1, 1),
            BackgroundTransparency = 1,
            [v4.Event.Activated] = v69
        })
    });
end;


game:DefineFastFlag("SelfieViewDontStartOnOpen", false);
return function()
    return game:GetFastFlag("SelfieViewDontStartOnOpen");
end;


game:DefineFastFlag("SelfieViewDontWaitForCharacter", false);
return function()
    return game:GetFastFlag("SelfieViewDontWaitForCharacter");
end;


local v0 = game:DefineFastFlag("SelfieViewEnabled", false);
local v1 = game:DefineFastString("SelfieViewForcedUserIds", "");
local v2 = require(script.Parent.Parent.Parent.Chrome.Enabled);
local l_Players_0 = game:GetService("Players");
return function()
    local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
    while not l_LocalPlayer_0 do
        l_Players_0:GetPropertyChangedSignal("LocalPlayer"):Wait();
        l_LocalPlayer_0 = l_Players_0.LocalPlayer;
    end;
    for v5 in v1:gmatch("%d+") do
        if l_LocalPlayer_0 and tonumber(v5) == l_LocalPlayer_0.UserId then
            return true;
        end;
    end;
    return v0 or v2();
end;


game:DefineFastFlag("SelfieViewHideCameraStatusDot", false);
return function()
    return game:GetFastFlag("SelfieViewHideCameraStatusDot");
end;


game:DefineFastFlag("SelfieViewPreviewShrinkIcon", false);
return function()
    return game:GetFastFlag("SelfieViewPreviewShrinkIcon");
end;


local v0 = require(script.Parent.useTrackerMode);
return function()
    local v1 = v0();
    local v2 = true;
    if v1 ~= Enum.TrackerMode.Video then
        v2 = v1 == Enum.TrackerMode.AudioVideo;
    end;
    return v2;
end;


local v0 = require(game:GetService("CorePackages").Packages.React);
local l_Players_0 = game:GetService("Players");
return function()
    return v0.useMemo(function()
        local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
        while not l_LocalPlayer_0 do
            l_Players_0:GetPropertyChangedSignal("LocalPlayer"):Wait();
            l_LocalPlayer_0 = l_Players_0.LocalPlayer;
        end;
        assert(l_LocalPlayer_0 ~= nil);
        return l_LocalPlayer_0;
    end);
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_Packages_0 = l_CorePackages_0.Packages;
local v3 = require(l_Packages_0.React);
local v4 = require(l_Packages_0.LuauPolyfill);
local l_setTimeout_0 = v4.setTimeout;
local l_clearTimeout_0 = v4.clearTimeout;
local function _(v7)
    local v8 = true;
    if v7.UserInputType ~= Enum.UserInputType.MouseButton1 then
        v8 = v7.UserInputType == Enum.UserInputType.Touch;
    end;
    return v8;
end;
return function(v10)
    local v11, v12 = v3.useState("");
    local v13, v14 = v3.useState("");
    local v15, v16 = v3.useState(false);
    local v17 = v3.useRef(nil);
    local v18 = v3.useRef(nil);
    local v19 = v3.useCallback(function()
        if v18.current then
            l_clearTimeout_0(v18.current);
        end;
        if v17.current then
            v17.current:Disconnect();
            v17.current = nil;
        end;
    end, {
        v18,
        v17
    });
    local v23 = v3.useCallback(function()
        v19();
        v16(true);
        v18.current = l_setTimeout_0(function()
            v19();
            v16(false);
        end, v10);
        v17.current = l_UserInputService_0.InputBegan:Connect(function(v20, _)
            local v22 = true;
            if v20.UserInputType ~= Enum.UserInputType.MouseButton1 then
                v22 = v20.UserInputType == Enum.UserInputType.Touch;
            end;
            if v22 then
                v19();
                v16(false);
                return ;
            else
                return ;
            end;
        end);
    end, {
        v18,
        v17
    });
    v3.useEffect(function()
        return v19;
    end, {});
    return v11, v13, v15, (v3.useCallback(function(v24, v25)
        v12(v24);
        v14(v25);
        v23();
    end, {}));
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Packages_0 = l_CorePackages_0.Packages;
local v2 = require(l_Packages_0.React);
local v3 = require(l_Packages_0.LuauPolyfill);
local l_setTimeout_0 = v3.setTimeout;
local l_clearTimeout_0 = v3.clearTimeout;
local v6 = require(script.Parent.useTrackerMode);
local v7 = require(script.Parent.Parent.Utils.FaceChatUtils);
local l_useLocalization_0 = require(l_CorePackages_0.Workspace.Packages.Localization).Hooks.useLocalization;
local l_TrackerMode_0 = Enum.TrackerMode;
return function()
    local v10 = v2.useRef(v7.getTrackerMode());
    local v11 = v6();
    local v12 = l_useLocalization_0({
        controlMessageSound = "CoreScripts.TopBar.ControlMessageSound",
        controlMessageMotion = "CoreScripts.TopBar.ControlMessageMotion",
        controlMessageOn = "CoreScripts.TopBar.ControlMessageOn",
        controlMessageOff = "CoreScripts.TopBar.ControlMessageOff"
    });
    local v13, v14 = v2.useState({
        visible = false,
        text = v12.controlMessageMotion,
        status = v12.controlMessageOff
    });
    local v15 = v2.useRef(nil);
    local function v18()
        local l_controlMessageMotion_0 = v12.controlMessageMotion;
        local l_controlMessageOff_0 = v12.controlMessageOff;
        if v11 ~= l_TrackerMode_0.None then
            l_controlMessageOff_0 = v12.controlMessageOn;
            l_controlMessageMotion_0 = if not (v11 ~= l_TrackerMode_0.AudioVideo) or v11 == l_TrackerMode_0.Video then v12.controlMessageMotion else v12.controlMessageSound;
        else
            l_controlMessageOff_0 = v12.controlMessageOff;
            l_controlMessageMotion_0 = if v10.current == l_TrackerMode_0.Audio then v12.controlMessageSound else v12.controlMessageMotion;
        end;
        v10.current = v11;
        return {
            visible = true,
            text = l_controlMessageMotion_0,
            status = l_controlMessageOff_0
        };
    end;
    v2.useEffect(function()
        if v15.current then
            l_clearTimeout_0(v15.current);
        end;
        v14((v18()));
        v15.current = l_setTimeout_0(function()
            v14({
                visible = false,
                text = v13.text,
                status = v13.status
            });
        end, 2000);
    end, {
        v11
    });
    return v13;
end;


local v0 = require(game:GetService("CorePackages").Packages.React);
local l_VideoCaptureService_0 = game:GetService("VideoCaptureService");
local l_FaceAnimatorService_0 = game:GetService("FaceAnimatorService");
local v3 = require(script.Parent.Parent.Utils.FaceChatUtils);
local v4 = require(game:GetService("CoreGui"):WaitForChild("RobloxGui").Modules.SelfView.Analytics).new();
local l_TrackerMode_0 = Enum.TrackerMode;
local v6 = v3.getTrackerMode();
local v7 = true;
if v6 ~= l_TrackerMode_0.Video then
    v7 = v6 == l_TrackerMode_0.AudioVideo;
end;
local v8 = true;
if v6 ~= l_TrackerMode_0.Audio then
    v8 = v6 == l_TrackerMode_0.AudioVideo;
end;
return function()
    local v9, v10 = v0.useState(l_TrackerMode_0.None);
    local v14 = v0.useCallback(function()
        local v11 = v3.getTrackerMode();
        local v12 = true;
        if v11 ~= l_TrackerMode_0.Video then
            v12 = v11 == l_TrackerMode_0.AudioVideo;
        end;
        if v12 ~= v7 then
            v4:reportCamState(v12);
            v7 = v12;
        end;
        local v13 = true;
        if v11 ~= l_TrackerMode_0.Audio then
            v13 = v11 == l_TrackerMode_0.AudioVideo;
        end;
        if v13 ~= v8 then
            v4:reportMicState(v13);
            v8 = v13;
        end;
        v10(v11);
    end);
    v0.useEffect(function()
        if not l_VideoCaptureService_0 then
            return function()
            end;
        else
            v14();
            local v15 = l_VideoCaptureService_0.Started:Connect(v14);
            local v16 = l_VideoCaptureService_0.Stopped:Connect(v14);
            local v17 = l_VideoCaptureService_0.DevicesChanged:Connect(v14);
            local v18 = l_FaceAnimatorService_0:GetPropertyChangedSignal("VideoAnimationEnabled"):Connect(v14);
            local v19 = l_FaceAnimatorService_0:GetPropertyChangedSignal("AudioAnimationEnabled"):Connect(v14);
            return function()
                v15:Disconnect();
                v16:Disconnect();
                v17:Disconnect();
                v18:Disconnect();
                v19:Disconnect();
            end;
        end;
    end, {});
    return v9;
end;


local l_AvatarChatService_0 = game:GetService("AvatarChatService");
local l_RobloxGui_0 = game:GetService("CoreGui"):WaitForChild("RobloxGui");
local v2 = require(l_RobloxGui_0.Modules.Settings.getCamMicPermissions);
local l_default_0 = require(game:GetService("CorePackages").Workspace.Packages.PermissionsProtocol).PermissionsProtocol.default;
local v4 = require(l_RobloxGui_0.Modules.Flags.GetFFlagAvatarChatServiceEnabled);
local l_FaceAnimatorService_0 = game:GetService("FaceAnimatorService");
local v6 = nil;
local function v10()
    if v6 ~= nil then
        return v6;
    elseif v4() and not _G.__TESTEZ_RUNNING_TEST__ then
        local l_status_0, l_result_0 = pcall(l_AvatarChatService_0.GetClientFeaturesAsync, l_AvatarChatService_0);
        if l_status_0 then
            local v9 = {
                placeMicEnabled = l_AvatarChatService_0:IsEnabled(l_result_0, Enum.AvatarChatServiceFeature.PlaceAudio),
                userMicEnabled = l_AvatarChatService_0:IsEnabled(l_result_0, Enum.AvatarChatServiceFeature.UserAudio),
                userMicEligible = l_AvatarChatService_0:IsEnabled(l_result_0, Enum.AvatarChatServiceFeature.UserAudioEligible),
                placeCamEnabled = l_AvatarChatService_0:IsEnabled(l_result_0, Enum.AvatarChatServiceFeature.PlaceVideo),
                userCamEnabled = l_AvatarChatService_0:IsEnabled(l_result_0, Enum.AvatarChatServiceFeature.UserVideo),
                userCamEligible = l_AvatarChatService_0:IsEnabled(l_result_0, Enum.AvatarChatServiceFeature.UserVideoEligible)
            };
            v6 = v9;
            return v9;
        else
            warn("Unable to get Client Features from AvatarChatService");
            return {
                placeCamEnabled = false,
                placeMicEnabled = false,
                userCamEnabled = false,
                userCamEligible = false,
                userMicEnabled = false,
                userMicEligible = false
            };
        end;
    else
        return {
            placeCamEnabled = false,
            placeMicEnabled = false,
            userCamEnabled = false,
            userCamEligible = false,
            userMicEnabled = false,
            userMicEligible = false
        };
    end;
end;
local function v11()
    v2(function()
        if l_FaceAnimatorService_0 and l_FaceAnimatorService_0:IsStarted() then
            l_FaceAnimatorService_0.VideoAnimationEnabled = not l_FaceAnimatorService_0.VideoAnimationEnabled;
            return ;
        else
            return ;
        end;
    end, {
        l_default_0.Permissions.CAMERA_ACCESS
    });
end;
local function v12()
    if not l_FaceAnimatorService_0.AudioAnimationEnabled or l_FaceAnimatorService_0.VideoAnimationEnabled then
        if (l_FaceAnimatorService_0.AudioAnimationEnabled or not l_FaceAnimatorService_0.VideoAnimationEnabled) or not l_FaceAnimatorService_0:IsStarted() then
            if (not l_FaceAnimatorService_0.AudioAnimationEnabled or not l_FaceAnimatorService_0.VideoAnimationEnabled) or not l_FaceAnimatorService_0:IsStarted() then
                return Enum.TrackerMode.None;
            else
                return Enum.TrackerMode.AudioVideo;
            end;
        else
            return Enum.TrackerMode.Video;
        end;
    else
        return Enum.TrackerMode.Audio;
    end;
end;
return {
    getPermissions = v10,
    toggleVideoAnimation = v11,
    getTrackerMode = v12,
    isCameraOn = function()
        local v13 = v12();
        local v14 = true;
        if v13 ~= Enum.TrackerMode.AudioVideo then
            v14 = v13 == Enum.TrackerMode.Video;
        end;
        return v14;
    end
};


local l_CollectionService_0 = game:GetService("CollectionService");
local l_game_EngineFeature_0 = game:GetEngineFeature("AvatarJointUpgradeFeature");
local v2 = game:DefineFastFlag("SelfViewLookUpHumanoidByType", false);
local v3 = {
    Accessory = "Accessory",
    CharacterMesh = "CharacterMesh",
    Decal = "Decal",
    MeshPart = "MeshPart",
    Pants = "Pants",
    Part = "Part",
    Shirt = "Shirt",
    ShirtGraphic = "ShirtGraphic",
    SpecialMesh = "SpecialMesh",
    SurfaceAppearance = "SurfaceAppearance"
};
local function v5(v4)
    if v4 == nil then
        return ;
    else
        return (v4:FindFirstChildWhichIsA("FaceControls", true));
    end;
end;
local function v10(v6, v7)
    if not (v6 ~= nil) or v7 == nil then
        return nil;
    else
        for _, v9 in (v6:GetDescendants()), nil, nil do
            if v9:IsA("Motor6D") and (not (v9.Part1 ~= v7) or v9.Name == "Neck") then
                return v9;
            end;
        end;
        return nil;
    end;
end;
local function v16(v11, v12, v13)
    for _, v15 in (v13:GetDescendants()), nil, nil do
        if not (not (v15.Name == v11) or not v15:IsA(v12)) then
            return v15;
        end;
    end;
    return nil;
end;
local function v20(v17)
    if v17 then
        local v18 = nil;
        local v19 = if v17 == nil then nil else v17:FindFirstChildWhichIsA("FaceControls", true);
        if v19 ~= nil then
            v18 = v19.Parent;
        end;
        if not v18 then
            v18 = v16("Head", "MeshPart", v17);
        end;
        if not v18 then
            v18 = v16("Head", "Part", v17);
        end;
        return v18;
    else
        return nil;
    end;
end;
local function v26(v21, v22)
    local v23 = nil;
    local v24 = nil;
    if v22 > 0 then
        if not v2 then
            v24 = v21:WaitForChild("Humanoid", v22);
        else
            local v25 = v21:WaitForChild("Humanoid", v22);
            v24 = if not v25:IsA("Humanoid") then v21:FindFirstChildWhichIsA("Humanoid") else v25;
        end;
    else
        v24 = if not v2 then v21:FindFirstChild("Humanoid") else v21:FindFirstChildWhichIsA("Humanoid");
    end;
    if v24 ~= nil then
        v23 = if v22 > 0 then v24:WaitForChild("Animator", v22) else v24:FindFirstChild("Animator");
    end;
    if v23 == nil then
        v23 = v21:FindFirstChildWhichIsA("Animator", true);
    end;
    return v23;
end;
local v27 = {
    "Head",
    "UpperTorso",
    "LowerTorso",
    "Torso",
    "LeftFoot",
    "LeftLowerLeg",
    "LeftUpperLeg",
    "RightFoot",
    "RightLowerLeg",
    "RightUpperLeg",
    "LeftHand",
    "LeftLowerArm",
    "LeftUpperArm",
    "RightHand",
    "RightLowerArm",
    "RightUpperArm"
};
local function v32(v28, v29)
    for _, v31 in ipairs(v28:GetDescendants()) do
        if not v31:IsA("Decal") then
            if not v31:IsA("MeshPart") then
                if not (not v31:IsA("Part") or not (v31.Parent and v31.Parent:IsA("Accessory")) and not table.find(v27, v31.Name)) then
                    v31.Transparency = 0;
                end;
            elseif not (not (v31.Parent and v31.Parent:IsA("Accessory")) and not table.find(v27, v31.Name)) then
                if table.find(v29, v31.MeshId) then
                    v31.Transparency = v29[v31.MeshId];
                else
                    v29[v31.MeshId] = v31.Transparency;
                end;
            end;
        else
            v31.Transparency = 0;
        end;
    end;
end;
local function v34(v33)
    if not (v33:IsA("MeshPart") or v33:IsA("Part")) and not v33:IsA("Decal") then
        if v3[v33.ClassName] then
            return true;
        end;
    elseif v33.Transparency < 1 then
        return true;
    end;
    return false;
end;
local function v38(v35)
    for _, v37 in ipairs(v35:GetDescendants()) do
        if v37:IsA("Motor6D") then
            v37.C0 = CFrame.new(v37.C0.Position);
            v37.C1 = CFrame.new(v37.C1.Position);
        end;
    end;
end;
local function _(v39, v40)
    local l_v39_FirstChild_0 = v39:FindFirstChild(v40);
    if l_v39_FirstChild_0 then
        l_v39_FirstChild_0:Destroy();
    end;
end;
local function v47(v43)
    local l_Animate_0 = v43:FindFirstChild("Animate");
    if l_Animate_0 then
        l_Animate_0:Destroy();
    end;
    l_Animate_0 = v43:FindFirstChild("Health");
    if l_Animate_0 then
        l_Animate_0:Destroy();
    end;
    for _, v46 in pairs(v43:GetDescendants()) do
        if v46:IsA("BaseScript") then
            v46:Destroy();
        end;
    end;
end;
local function v56(v48)
    for _, v50 in ipairs((l_CollectionService_0:GetTags(v48))) do
        l_CollectionService_0:RemoveTag(v48, v50);
    end;
    for _, v52 in ipairs(v48:GetDescendants()) do
        for _, v54 in ipairs((l_CollectionService_0:GetTags(v52))) do
            l_CollectionService_0:RemoveTag(v52, v54);
        end;
    end;
    local _ = l_CollectionService_0:GetTags(v48);
end;
local v57 = {
    Accessory = "Accessory",
    Animator = "Animator",
    Attachment = "Attachment",
    AnimationConstraint = if not l_game_EngineFeature_0 then nil else "AnimationConstraint",
    BallSocketConstraint = if not l_game_EngineFeature_0 then nil else "BallSocketConstraint",
    BodyColors = "BodyColors",
    CharacterMesh = "CharacterMesh",
    Decal = "Decal",
    FaceControls = "FaceControls",
    Humanoid = "Humanoid",
    HumanoidDescription = "HumanoidDescription",
    MeshPart = "MeshPart",
    Motor6D = "Motor6D",
    NumberValue = "NumberValue",
    Pants = "Pants",
    Part = "Part",
    Shirt = "Shirt",
    ShirtGraphic = "ShirtGraphic",
    SpecialMesh = "SpecialMesh",
    StringValue = "StringValue",
    SurfaceAppearance = "SurfaceAppearance",
    Vector3Value = "Vector3Value",
    WrapTarget = "WrapTarget",
    Weld = "Weld",
    WrapLayer = "WrapLayer",
    WeldConstraint = "WeldConstraint",
    AccessoryWeld = "AccessoryWeld",
    PackageLink = "PackageLink"
};
local function v58(v59)
    for _, v61 in v59:GetChildren() do
        if v61:IsA("Script") then
            v61.Disabled = true;
            v61.Parent = nil;
        end;
        v58(v61);
    end;
end;
local function v62(v63)
    for _, v65 in v63:GetChildren() do
        if not (not (((v65:IsA("GuiObject") or v65:IsA("ScreenGui")) or v65:IsA("BillboardGui")) or v65:IsA("AdGui")) and not v65:IsA("SurfaceGui")) then
            v65.Parent = nil;
        end;
        v62(v65);
    end;
end;
local function v66(v67)
    for _, v69 in v67:GetChildren() do
        if not v57[v69.ClassName] then
            v69.Parent = nil;
        end;
        v66(v69);
    end;
end;
return {
    getFaceControls = v5,
    getNeck = v10,
    getHead = v20,
    getAnimator = v26,
    updateTransparency = v32,
    shouldMarkCloneDirtyForDescendant = v34,
    resetPartOrientation = v38,
    removeScripts = v47,
    removeTags = v56,
    sanitizeCharacter = function(v70)
        if v70 then
            v66(v70);
            return ;
        else
            return ;
        end;
    end,
    isValidAvatar = function(v71)
        if v26(v71, 10) then
            local v72;
            if v71 then
                local v73 = nil;
                local v74 = if v71 == nil then nil else v71:FindFirstChildWhichIsA("FaceControls", true);
                if v74 ~= nil then
                    v73 = v74.Parent;
                end;
                if not v73 then
                    v73 = v16("Head", "MeshPart", v71);
                end;
                if not v73 then
                    v73 = v16("Head", "Part", v71);
                end;
                v72 = v73;
            else
                v72 = nil;
            end;
            if v72 then
                return true;
            else
                return false;
            end;
        else
            return false;
        end;
    end,
    hasDynamicHead = function(v75)
        return if v75 == nil then nil else v75:FindFirstChildWhichIsA("FaceControls", true) ~= nil;
    end
};


local l_UserInputService_0 = game:GetService("UserInputService");
local v1 = {
    DESKTOP = "Desktop",
    MOBILE_PORTRAIT = "Portrait",
    MOBILE_LANDSCAPE = "Landscape",
    LARGE = "Large",
    SMALL = "Small"
};
local v2 = {
    [v1.MOBILE_PORTRAIT] = {
        [v1.SMALL] = {
            ratio = 0.24,
            max = 185
        },
        [v1.LARGE] = {
            ratio = 0.35,
            max = 324
        }
    },
    [v1.MOBILE_LANDSCAPE] = {
        [v1.SMALL] = {
            ratio = 0.43,
            max = 185
        },
        [v1.LARGE] = {
            ratio = 0.56,
            max = 240
        }
    },
    [v1.DESKTOP] = {
        [v1.SMALL] = {
            ratio = 0.33,
            max = 600
        },
        [v1.LARGE] = {
            ratio = 0.44,
            max = 760
        }
    }
};
local l_l_UserInputService_0_Platform_0 = l_UserInputService_0:GetPlatform();
local function _(v4)
    return v4 * 0.4648648648648649;
end;
local function _(v6)
    if not (l_l_UserInputService_0_Platform_0 ~= Enum.Platform.Android) or l_l_UserInputService_0_Platform_0 == Enum.Platform.IOS then
        return v6.Y < v6.X and v1.MOBILE_LANDSCAPE or v1.MOBILE_PORTRAIT;
    else
        return v1.DESKTOP;
    end;
end;
return {
    getSize = function(v8, v9)
        local v10 = v2[if not (l_l_UserInputService_0_Platform_0 ~= Enum.Platform.Android) or l_l_UserInputService_0_Platform_0 == Enum.Platform.IOS then v8.Y < v8.X and v1.MOBILE_LANDSCAPE or v1.MOBILE_PORTRAIT else v1.DESKTOP][not not v9 and v1.LARGE or v1.SMALL];
        local v11 = math.min(math.round(v8.Y * v10.ratio), v10.max);
        return Vector2.new(v11 * 0.4648648648648649, v11);
    end
};


return {
    Icon = require(script.Components.Icon),
    Window = require(script.Components.Window),
    CameraStatusDot = require(script.Components.CameraStatusDot),
    useCameraOn = require(script.Hooks.useCameraOn)
};


local l_Players_0 = game:GetService("Players");
local l_ReplicatedStorage_0 = game:GetService("ReplicatedStorage");
local l_Chat_0 = game:GetService("Chat");
local l_TextService_0 = game:GetService("TextService");
local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
while l_LocalPlayer_0 == nil do
    l_Players_0.ChildAdded:wait();
    l_LocalPlayer_0 = l_Players_0.LocalPlayer;
end;
local l_PlayerGui_0 = l_LocalPlayer_0:WaitForChild("PlayerGui");
local l_status_0, l_result_0 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserShouldLocalizeGameChatBubble");
end);
local v8 = l_status_0 and l_result_0;
local v9 = nil;
local l_status_1, l_result_1 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserFixBubbleChatText");
end);
v9 = l_status_1 and l_result_1;
l_status_1 = nil;
local v12;
l_result_1, v12 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserRoactBubbleChatBeta");
end);
l_status_1 = l_result_1 and v12;
l_result_1 = nil;
local v13;
v12, v13 = pcall(function()
    return UserSettings():IsUserFeatureEnabled("UserPreventOldBubbleChatOverlap");
end);
l_result_1 = v12 and v13;
v12 = function(v14)
    return utf8.len(utf8.nfcnormalize(v14));
end;
v13 = Enum.Font.SourceSans;
local l_Size24_0 = Enum.FontSize.Size24;
local v16 = (128 - utf8.len(utf8.nfcnormalize("..."))) - 1;
local v17 = {
    WHITE = "dub",
    BLUE = "blu",
    GREEN = "gre",
    RED = "red"
};
local l_ScreenGui_0 = Instance.new("ScreenGui");
l_ScreenGui_0.Name = "BubbleChat";
l_ScreenGui_0.ResetOnSpawn = false;
l_ScreenGui_0.Parent = l_PlayerGui_0;
local function _(v19, v20, v21)
    return v20 + (v21 - v20) * math.min(utf8.len(utf8.nfcnormalize(v19)) / 75, 1);
end;
local function v34()
    local v23 = {
        data = {}
    };
    local l_BindableEvent_0 = Instance.new("BindableEvent");
    v23.Emptied = l_BindableEvent_0.Event;
    v23.Size = function(_)
        return #v23.data;
    end;
    v23.Empty = function(_)
        return v23:Size() <= 0;
    end;
    v23.PopFront = function(_)
        table.remove(v23.data, 1);
        if v23:Empty() then
            l_BindableEvent_0:Fire();
        end;
    end;
    v23.Front = function(_)
        return v23.data[1];
    end;
    v23.Get = function(_, v30)
        return v23.data[v30];
    end;
    v23.PushBack = function(_, v32)
        table.insert(v23.data, v32);
    end;
    v23.GetData = function(_)
        return v23.data;
    end;
    return v23;
end;
local function _()
    return {
        Fifo = v34(),
        BillboardGui = nil
    };
end;
local function v49()
    local v36 = {
        data = {}
    };
    local v37 = 0;
    v36.Size = function(_)
        return v37;
    end;
    v36.Erase = function(_, v40)
        if v36.data[v40] then
            v37 = v37 - 1;
        end;
        v36.data[v40] = nil;
    end;
    v36.Set = function(_, v42, v43)
        v36.data[v42] = v43;
        if v43 then
            v37 = v37 + 1;
        end;
    end;
    v36.Get = function(_, v45)
        if v45 then
            if not v36.data[v45] then
                v36.data[v45] = {
                    Fifo = v34(),
                    BillboardGui = nil
                };
                local v46 = nil;
                do
                    local l_v46_0 = v46;
                    l_v46_0 = v36.data[v45].Fifo.Emptied:connect(function()
                        l_v46_0:disconnect();
                        v36:Erase(v45);
                    end);
                end;
            end;
            return v36.data[v45];
        else
            return ;
        end;
    end;
    v36.GetData = function(_)
        return v36.data;
    end;
    return v36;
end;
local function v57(v50, v51, v52)
    local v56 = {
        ComputeBubbleLifetime = function(_, v54, v55)
            if not v55 then
                return 12 + 8 * math.min(utf8.len(utf8.nfcnormalize(v54)) / 75, 1);
            else
                return 8 + 7 * math.min(utf8.len(utf8.nfcnormalize(v54)) / 75, 1);
            end;
        end,
        Origin = nil,
        RenderBubble = nil,
        Message = v50
    };
    v56.BubbleDieDelay = v56:ComputeBubbleLifetime(v50, v52);
    v56.BubbleColor = v51;
    v56.IsLocalPlayer = v52;
    return v56;
end;
local function _(v58, v59, v60)
    local v61 = v57(v59, v17.WHITE, v60);
    if v58 then
        v61.User = v58.Name;
        v61.Origin = v58.Character;
    end;
    return v61;
end;
local function _(v63, v64, v65, v66)
    local v67 = v57(v64, v66, v65);
    v67.Origin = v63;
    return v67;
end;
createChatBubbleMain = function(v69, v70)
    local l_ImageLabel_0 = Instance.new("ImageLabel");
    l_ImageLabel_0.Name = "ChatBubble";
    l_ImageLabel_0.ScaleType = Enum.ScaleType.Slice;
    l_ImageLabel_0.SliceCenter = v70;
    l_ImageLabel_0.Image = "rbxasset://textures/" .. tostring(v69) .. ".png";
    l_ImageLabel_0.BackgroundTransparency = 1;
    l_ImageLabel_0.BorderSizePixel = 0;
    l_ImageLabel_0.Size = UDim2.new(1, 0, 1, 0);
    l_ImageLabel_0.Position = UDim2.new(0, 0, 0, 0);
    return l_ImageLabel_0;
end;
createChatBubbleTail = function(v72, v73)
    local l_ImageLabel_1 = Instance.new("ImageLabel");
    l_ImageLabel_1.Name = "ChatBubbleTail";
    l_ImageLabel_1.Image = "rbxasset://textures/ui/dialog_tail.png";
    l_ImageLabel_1.BackgroundTransparency = 1;
    l_ImageLabel_1.BorderSizePixel = 0;
    l_ImageLabel_1.Position = v72;
    l_ImageLabel_1.Size = v73;
    return l_ImageLabel_1;
end;
createChatBubbleWithTail = function(v75, v76, v77, v78)
    local v79 = createChatBubbleMain(v75, v78);
    createChatBubbleTail(v76, v77).Parent = v79;
    return v79;
end;
createScaledChatBubbleWithTail = function(v80, v81, v82, v83)
    local v84 = createChatBubbleMain(v80, v83);
    local l_Frame_0 = Instance.new("Frame");
    l_Frame_0.Name = "ChatBubbleTailFrame";
    l_Frame_0.BackgroundTransparency = 1;
    l_Frame_0.SizeConstraint = Enum.SizeConstraint.RelativeXX;
    l_Frame_0.Position = UDim2.new(0.5, 0, 1, 0);
    l_Frame_0.Size = UDim2.new(v81, 0, v81, 0);
    l_Frame_0.Parent = v84;
    createChatBubbleTail(v82, UDim2.new(1, 0, 0.5, 0)).Parent = l_Frame_0;
    return v84;
end;
createChatImposter = function(v86, v87, v88)
    local l_ImageLabel_2 = Instance.new("ImageLabel");
    l_ImageLabel_2.Name = "DialogPlaceholder";
    l_ImageLabel_2.Image = "rbxasset://textures/" .. tostring(v86) .. ".png";
    l_ImageLabel_2.BackgroundTransparency = 1;
    l_ImageLabel_2.BorderSizePixel = 0;
    l_ImageLabel_2.Position = UDim2.new(0, 0, -1.25, 0);
    l_ImageLabel_2.Size = UDim2.new(1, 0, 1, 0);
    local l_ImageLabel_3 = Instance.new("ImageLabel");
    l_ImageLabel_3.Name = "DotDotDot";
    l_ImageLabel_3.Image = "rbxasset://textures/" .. tostring(v87) .. ".png";
    l_ImageLabel_3.BackgroundTransparency = 1;
    l_ImageLabel_3.BorderSizePixel = 0;
    l_ImageLabel_3.Position = UDim2.new(0.001, 0, v88, 0);
    l_ImageLabel_3.Size = UDim2.new(1, 0, 0.7, 0);
    l_ImageLabel_3.Parent = l_ImageLabel_2;
    return l_ImageLabel_2;
end;
local v91 = {
    ChatBubble = {},
    ChatBubbleWithTail = {},
    ScalingChatBubbleWithTail = {},
    CharacterSortedMsg = v49()
};
local function v97(v92, v93, _, v95, v96)
    v91.ChatBubble[v92] = createChatBubbleMain(v93, v96);
    v91.ChatBubbleWithTail[v92] = createChatBubbleWithTail(v93, UDim2.new(0.5, -14, 1, not v95 and 0 or -1), UDim2.new(0, 30, 0, 14), v96);
    v91.ScalingChatBubbleWithTail[v92] = createScaledChatBubbleWithTail(v93, 0.5, UDim2.new(-0.5, 0, 0, not v95 and 0 or -1), v96);
end;
v97(v17.WHITE, "ui/dialog_white", "ui/chatBubble_white_notify_bkg", false, Rect.new(5, 5, 15, 15));
v97(v17.BLUE, "ui/dialog_blue", "ui/chatBubble_blue_notify_bkg", true, Rect.new(7, 7, 33, 33));
v97(v17.RED, "ui/dialog_red", "ui/chatBubble_red_notify_bkg", true, Rect.new(7, 7, 33, 33));
v97(v17.GREEN, "ui/dialog_green", "ui/chatBubble_green_notify_bkg", true, Rect.new(7, 7, 33, 33));
v91.SanitizeChatLine = function(_, v99)
    if v16 < utf8.len(utf8.nfcnormalize(v99)) then
        return (string.sub(v99, 1, utf8.offset(v99, (v16 + utf8.len(utf8.nfcnormalize("..."))) + 1) - 1));
    else
        return v99;
    end;
end;
local function v104(v100)
    local l_BillboardGui_0 = Instance.new("BillboardGui");
    l_BillboardGui_0.Adornee = v100;
    l_BillboardGui_0.Size = UDim2.new(0, 400, 0, 250);
    l_BillboardGui_0.StudsOffset = Vector3.new(0, 1.5, 2);
    l_BillboardGui_0.Parent = l_ScreenGui_0;
    local l_Frame_1 = Instance.new("Frame");
    l_Frame_1.Name = "BillboardFrame";
    l_Frame_1.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_1.Position = UDim2.new(0, 0, -0.5, 0);
    l_Frame_1.BackgroundTransparency = 1;
    l_Frame_1.Parent = l_BillboardGui_0;
    local v103 = nil;
    v103 = l_Frame_1.ChildRemoved:connect(function()
        if #l_Frame_1:GetChildren() <= 1 then
            v103:disconnect();
            l_BillboardGui_0:Destroy();
        end;
    end);
    v91:CreateSmallTalkBubble(v17.WHITE).Parent = l_Frame_1;
    return l_BillboardGui_0;
end;
v91.CreateBillboardGuiHelper = function(_, v106, v107)
    if not (not v106 or v91.CharacterSortedMsg:Get(v106).BillboardGui) then
        if v107 or not v106:IsA("BasePart") then
            if v106:IsA("Model") then
                local l_Head_0 = v106:FindFirstChild("Head");
                if not (not l_Head_0 or not l_Head_0:IsA("BasePart")) then
                    v91.CharacterSortedMsg:Get(v106).BillboardGui = v104(l_Head_0);
                end;
            end;
        else
            v91.CharacterSortedMsg:Get(v106).BillboardGui = v104(v106);
            return ;
        end;
    end;
end;
local function _(v109)
    if v109 then
        return (v109.Position - game.Workspace.CurrentCamera.CoordinateFrame.Position).magnitude;
    else
        return 100000;
    end;
end;
local function _(v111)
    if not v111 or not l_Players_0.LocalPlayer.Character then
        return ;
    else
        return v111:IsDescendantOf(l_Players_0.LocalPlayer.Character);
    end;
end;
v91.SetBillboardLODNear = function(_, v114)
    local l_Adornee_0 = v114.Adornee;
    local v116 = if not not l_Adornee_0 and l_Players_0.LocalPlayer.Character then l_Adornee_0:IsDescendantOf(l_Players_0.LocalPlayer.Character) else nil;
    v114.Size = UDim2.new(0, 400, 0, 250);
    v114.StudsOffset = Vector3.new(0, not v116 and 2.5 or 1.5, not v116 and 0.1 or 2);
    v114.Enabled = true;
    l_Adornee_0 = v114.BillboardFrame:GetChildren();
    for v117 = 1, #l_Adornee_0 do
        l_Adornee_0[v117].Visible = true;
    end;
    v114.BillboardFrame.SmallTalkBubble.Visible = false;
end;
v91.SetBillboardLODDistant = function(_, v119)
    local l_Adornee_1 = v119.Adornee;
    local v121 = if not not l_Adornee_1 and l_Players_0.LocalPlayer.Character then l_Adornee_1:IsDescendantOf(l_Players_0.LocalPlayer.Character) else nil;
    v119.Size = UDim2.new(4, 0, 3, 0);
    v119.StudsOffset = Vector3.new(0, 3, not v121 and 0.1 or 2);
    v119.Enabled = true;
    l_Adornee_1 = v119.BillboardFrame:GetChildren();
    for v122 = 1, #l_Adornee_1 do
        l_Adornee_1[v122].Visible = false;
    end;
    v119.BillboardFrame.SmallTalkBubble.Visible = true;
end;
v91.SetBillboardLODVeryFar = function(_, v124)
    v124.Enabled = false;
end;
v91.SetBillboardGuiLOD = function(_, v126, v127)
    if v127 then
        if v127:IsA("Model") then
            v127 = v127:FindFirstChild("Head") or v127.PrimaryPart;
        end;
        local l_v127_0 = v127;
        local v129 = if l_v127_0 then (l_v127_0.Position - game.Workspace.CurrentCamera.CoordinateFrame.Position).magnitude else 100000;
        if v129 < 65 then
            v91:SetBillboardLODNear(v126);
            return ;
        elseif v129 >= 65 and v129 < 100 then
            v91:SetBillboardLODDistant(v126);
            return ;
        else
            v91:SetBillboardLODVeryFar(v126);
            return ;
        end;
    else
        return ;
    end;
end;
v91.CameraCFrameChanged = function(_)
    for v131, v132 in pairs(v91.CharacterSortedMsg:GetData()) do
        local l_BillboardGui_1 = v132.BillboardGui;
        if l_BillboardGui_1 then
            v91:SetBillboardGuiLOD(l_BillboardGui_1, v131);
        end;
    end;
end;
v91.CreateBubbleText = function(_, v135, v136)
    local l_TextLabel_0 = Instance.new("TextLabel");
    l_TextLabel_0.Name = "BubbleText";
    l_TextLabel_0.BackgroundTransparency = 1;
    if not v9 then
        l_TextLabel_0.Position = UDim2.new(0, 15, 0, 0);
        l_TextLabel_0.Size = UDim2.new(1, -30, 1, 0);
    else
        l_TextLabel_0.Size = UDim2.fromScale(1, 1);
    end;
    l_TextLabel_0.Font = v13;
    l_TextLabel_0.ClipsDescendants = true;
    l_TextLabel_0.TextWrapped = true;
    l_TextLabel_0.FontSize = l_Size24_0;
    l_TextLabel_0.Text = v135;
    l_TextLabel_0.Visible = false;
    l_TextLabel_0.AutoLocalize = v136;
    if v9 then
        local l_UIPadding_0 = Instance.new("UIPadding");
        l_UIPadding_0.PaddingTop = UDim.new(0, 12);
        l_UIPadding_0.PaddingRight = UDim.new(0, 12);
        l_UIPadding_0.PaddingBottom = UDim.new(0, 12);
        l_UIPadding_0.PaddingLeft = UDim.new(0, 12);
        l_UIPadding_0.Parent = l_TextLabel_0;
    end;
    return l_TextLabel_0;
end;
v91.CreateSmallTalkBubble = function(_, v140)
    local v141 = v91.ScalingChatBubbleWithTail[v140]:Clone();
    v141.Name = "SmallTalkBubble";
    v141.AnchorPoint = Vector2.new(0, 0.5);
    v141.Position = UDim2.new(0, 0, 0.5, 0);
    v141.Visible = false;
    local l_v91_BubbleText_0 = v91:CreateBubbleText("...");
    l_v91_BubbleText_0.TextScaled = true;
    l_v91_BubbleText_0.TextWrapped = false;
    l_v91_BubbleText_0.Visible = true;
    l_v91_BubbleText_0.Parent = v141;
    return v141;
end;
v91.UpdateChatLinesForOrigin = function(_, v144, v145)
    local l_Fifo_0 = v91.CharacterSortedMsg:Get(v144).Fifo;
    local v147 = l_Fifo_0:Size();
    local l_l_Fifo_0_Data_0 = l_Fifo_0:GetData();
    if #l_l_Fifo_0_Data_0 <= 1 then
        return ;
    else
        for v149 = #l_l_Fifo_0_Data_0 - 1, 1, -1 do
            local l_RenderBubble_0 = l_l_Fifo_0_Data_0[v149].RenderBubble;
            if l_RenderBubble_0 then
                if (v147 - v149) + 1 > 1 then
                    local l_ChatBubbleTail_0 = l_RenderBubble_0:FindFirstChild("ChatBubbleTail");
                    if l_ChatBubbleTail_0 then
                        l_ChatBubbleTail_0:Destroy();
                    end;
                    local l_BubbleText_0 = l_RenderBubble_0:FindFirstChild("BubbleText");
                    if l_BubbleText_0 then
                        l_BubbleText_0.TextTransparency = 0.5;
                    end;
                end;
                l_RenderBubble_0:TweenPosition(UDim2.new(l_RenderBubble_0.Position.X.Scale, l_RenderBubble_0.Position.X.Offset, 1, (v145 - l_RenderBubble_0.Size.Y.Offset) - 14), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 0.1, true);
                v145 = (v145 - l_RenderBubble_0.Size.Y.Offset) - 14;
            else
                return ;
            end;
        end;
        return ;
    end;
end;
v91.DestroyBubble = function(_, v154, v155)
    if v154 then
        if not v154:Empty() then
            local l_RenderBubble_1 = v154:Front().RenderBubble;
            if l_RenderBubble_1 then
                spawn(function()
                    while v154:Front().RenderBubble ~= v155 do
                        wait();
                    end;
                    l_RenderBubble_1 = v154:Front().RenderBubble;
                    local v157 = 0;
                    local l_BubbleText_1 = l_RenderBubble_1:FindFirstChild("BubbleText");
                    local l_ChatBubbleTail_1 = l_RenderBubble_1:FindFirstChild("ChatBubbleTail");
                    while l_RenderBubble_1 and l_RenderBubble_1.ImageTransparency < 1 do
                        v157 = wait();
                        if l_RenderBubble_1 then
                            local v160 = v157 * 1.5;
                            l_RenderBubble_1.ImageTransparency = l_RenderBubble_1.ImageTransparency + v160;
                            if l_BubbleText_1 then
                                l_BubbleText_1.TextTransparency = l_BubbleText_1.TextTransparency + v160;
                            end;
                            if l_ChatBubbleTail_1 then
                                l_ChatBubbleTail_1.ImageTransparency = l_ChatBubbleTail_1.ImageTransparency + v160;
                            end;
                        end;
                    end;
                    if l_RenderBubble_1 then
                        l_RenderBubble_1:Destroy();
                        v154:PopFront();
                    end;
                end);
                return ;
            else
                v154:PopFront();
                return ;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
end;
v91.CreateChatLineRender = function(_, v162, v163, v164, v165, v166)
    if v162 then
        if not v91.CharacterSortedMsg:Get(v162).BillboardGui then
            v91:CreateBillboardGuiHelper(v162, v164);
        end;
        local l_BillboardGui_2 = v91.CharacterSortedMsg:Get(v162).BillboardGui;
        if l_BillboardGui_2 then
            local v168 = v91.ChatBubbleWithTail[v163.BubbleColor]:Clone();
            v168.Visible = false;
            local l_v91_BubbleText_1 = v91:CreateBubbleText(v163.Message, v166);
            l_v91_BubbleText_1.Parent = v168;
            v168.Parent = l_BillboardGui_2.BillboardFrame;
            v163.RenderBubble = v168;
            local l_l_TextService_0_TextSize_0 = l_TextService_0:GetTextSize(l_v91_BubbleText_1.Text, 24, v13, Vector2.new(400, 250));
            local v171 = l_l_TextService_0_TextSize_0.Y / 24;
            if not v9 then
                local v172 = math.max((l_l_TextService_0_TextSize_0.X + 30) / 400, 0.1);
                v168.Size = UDim2.new(0, 0, 0, 0);
                v168.Position = UDim2.new(0.5, 0, 1, 0);
                local v173 = v171 * 34;
                v168:TweenSizeAndPosition(UDim2.new(v172, 0, 0, v173), UDim2.new((1 - v172) / 2, 0, 1, -v173), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true, function()
                    l_v91_BubbleText_1.Visible = true;
                end);
                v91:SetBillboardGuiLOD(l_BillboardGui_2, v163.Origin);
                v91:UpdateChatLinesForOrigin(v163.Origin, -v173);
            else
                local v174 = math.ceil(l_l_TextService_0_TextSize_0.X + 24);
                local v175 = v171 * 34;
                v168.Size = UDim2.fromOffset(0, 0);
                v168.Position = UDim2.fromScale(0.5, 1);
                v168:TweenSizeAndPosition(UDim2.fromOffset(v174, v175), UDim2.new(0.5, -v174 / 2, 1, -v175), Enum.EasingDirection.Out, Enum.EasingStyle.Elastic, 0.1, true, function()
                    l_v91_BubbleText_1.Visible = true;
                end);
                v91:SetBillboardGuiLOD(l_BillboardGui_2, v163.Origin);
                v91:UpdateChatLinesForOrigin(v163.Origin, -v175);
            end;
            delay(v163.BubbleDieDelay, function()
                v91:DestroyBubble(v165, v168);
            end);
        end;
        return ;
    else
        return ;
    end;
end;
v91.OnPlayerChatMessage = function(_, v177, v178, _)
    if v91:BubbleChatEnabled() then
        local l_LocalPlayer_1 = l_Players_0.LocalPlayer;
        local v181 = false;
        if l_LocalPlayer_1 ~= nil then
            v181 = v177 ~= l_LocalPlayer_1;
        end;
        local v182 = v57(v91:SanitizeChatLine(v178), v17.WHITE, not v181);
        if v177 then
            v182.User = v177.Name;
            v182.Origin = v177.Character;
        end;
        local l_v182_0 = v182;
        if not (not v177 or not l_v182_0.Origin) then
            local l_Fifo_1 = v91.CharacterSortedMsg:Get(l_v182_0.Origin).Fifo;
            l_Fifo_1:PushBack(l_v182_0);
            v91:CreateChatLineRender(v177.Character, l_v182_0, true, l_Fifo_1, false);
        end;
        return ;
    else
        return ;
    end;
end;
v91.OnGameChatMessage = function(_, v186, v187, v188)
    if not l_status_1 and (not l_result_1 or not l_Chat_0.BubbleChatEnabled) then
        local l_LocalPlayer_2 = l_Players_0.LocalPlayer;
        local v190 = false;
        if l_LocalPlayer_2 ~= nil then
            v190 = l_LocalPlayer_2.Character ~= v186;
        end;
        local l_WHITE_0 = v17.WHITE;
        if v188 == Enum.ChatColor.Blue then
            l_WHITE_0 = v17.BLUE;
        elseif v188 == Enum.ChatColor.Green then
            l_WHITE_0 = v17.GREEN;
        elseif v188 == Enum.ChatColor.Red then
            l_WHITE_0 = v17.RED;
        end;
        local v192 = v57(v91:SanitizeChatLine(v187), l_WHITE_0, not v190);
        v192.Origin = v186;
        local l_v192_0 = v192;
        v91.CharacterSortedMsg:Get(l_v192_0.Origin).Fifo:PushBack(l_v192_0);
        if not v8 then
            v91:CreateChatLineRender(v186, l_v192_0, false, v91.CharacterSortedMsg:Get(l_v192_0.Origin).Fifo, false);
            return ;
        else
            v91:CreateChatLineRender(v186, l_v192_0, false, v91.CharacterSortedMsg:Get(l_v192_0.Origin).Fifo, true);
            return ;
        end;
    else
        return ;
    end;
end;
v91.BubbleChatEnabled = function(_)
    if not l_status_1 and (not l_result_1 or not l_Chat_0.BubbleChatEnabled) then
        local l_ClientChatModules_0 = l_Chat_0:FindFirstChild("ClientChatModules");
        if l_ClientChatModules_0 then
            local l_ChatSettings_0 = l_ClientChatModules_0:FindFirstChild("ChatSettings");
            if l_ChatSettings_0 then
                l_ChatSettings_0 = require(l_ChatSettings_0);
                if l_ChatSettings_0.BubbleChatEnabled ~= nil then
                    return l_ChatSettings_0.BubbleChatEnabled;
                end;
            end;
        end;
        return l_Players_0.BubbleChat;
    else
        return false;
    end;
end;
v91.ShowOwnFilteredMessage = function(_)
    local l_ClientChatModules_1 = l_Chat_0:FindFirstChild("ClientChatModules");
    if l_ClientChatModules_1 then
        local l_ChatSettings_1 = l_ClientChatModules_1:FindFirstChild("ChatSettings");
        if l_ChatSettings_1 then
            return require(l_ChatSettings_1).ShowUserOwnFilteredMessage;
        end;
    end;
    return false;
end;
findPlayer = function(v200)
    for _, v202 in pairs(l_Players_0:GetPlayers()) do
        if v202.Name == v200 then
            return v202;
        end;
    end;
end;
l_Chat_0.Chatted:connect(function(v203, v204, v205)
    v91:OnGameChatMessage(v203, v204, v205);
end);
local v206 = nil;
if game.Workspace.CurrentCamera then
    v206 = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):Connect(function(_)
        v91:CameraCFrameChanged();
    end);
end;
game.Workspace.Changed:Connect(function(v208)
    if v208 == "CurrentCamera" then
        if v206 then
            v206:disconnect();
        end;
        if game.Workspace.CurrentCamera then
            v206 = game.Workspace.CurrentCamera:GetPropertyChangedSignal("CFrame"):Connect(function(_)
                v91:CameraCFrameChanged();
            end);
        end;
    end;
end);
local v210 = nil;
getAllowedMessageTypes = function()
    if not v210 then
        local l_ClientChatModules_2 = l_Chat_0:FindFirstChild("ClientChatModules");
        if not l_ClientChatModules_2 then
            return {
                "Message",
                "Whisper"
            };
        else
            local l_ChatSettings_2 = l_ClientChatModules_2:FindFirstChild("ChatSettings");
            if l_ChatSettings_2 then
                l_ChatSettings_2 = require(l_ChatSettings_2);
                if l_ChatSettings_2.BubbleChatMessageTypes then
                    v210 = l_ChatSettings_2.BubbleChatMessageTypes;
                    return v210;
                end;
            end;
            local l_ChatConstants_0 = l_ClientChatModules_2:FindFirstChild("ChatConstants");
            if l_ChatConstants_0 then
                l_ChatConstants_0 = require(l_ChatConstants_0);
                v210 = {
                    l_ChatConstants_0.MessageTypeDefault,
                    l_ChatConstants_0.MessageTypeWhisper
                };
            end;
            return v210;
        end;
    else
        return v210;
    end;
end;
checkAllowedMessageType = function(v214)
    local v215 = getAllowedMessageTypes();
    for v216 = 1, #v215 do
        if v215[v216] == v214.MessageType then
            return true;
        end;
    end;
    return false;
end;
local l_DefaultChatSystemChatEvents_0 = l_ReplicatedStorage_0:WaitForChild("DefaultChatSystemChatEvents");
local l_OnMessageDoneFiltering_0 = l_DefaultChatSystemChatEvents_0:WaitForChild("OnMessageDoneFiltering");
l_DefaultChatSystemChatEvents_0:WaitForChild("OnNewMessage").OnClientEvent:connect(function(v219, _)
    if checkAllowedMessageType(v219) then
        local v221 = findPlayer(v219.FromSpeaker);
        if v221 then
            if not (not v219.IsFiltered or v219.FromSpeaker == l_LocalPlayer_0.Name) or v219.FromSpeaker == l_LocalPlayer_0.Name and not v91:ShowOwnFilteredMessage() then
                v91:OnPlayerChatMessage(v221, v219.Message, nil);
                return ;
            else
                return ;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
end);
l_OnMessageDoneFiltering_0.OnClientEvent:connect(function(v222, _)
    if checkAllowedMessageType(v222) then
        local v224 = findPlayer(v222.FromSpeaker);
        if v224 then
            if not (v222.FromSpeaker == l_LocalPlayer_0.Name) or v91:ShowOwnFilteredMessage() then
                v91:OnPlayerChatMessage(v224, v222.Message, nil);
                return ;
            else
                return ;
            end;
        else
            return ;
        end;
    else
        return ;
    end;
end);


local v0 = {};
local l_ClientChatModules_0 = game:GetService("Chat"):WaitForChild("ClientChatModules");
local l_Parent_0 = script.Parent;
local l_ChannelsTab_0 = require(l_Parent_0:WaitForChild("ChannelsTab"));
local l_MessageSender_0 = require(l_Parent_0:WaitForChild("MessageSender"));
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
local l_CurveUtil_0 = require(l_Parent_0:WaitForChild("CurveUtil"));
local v7 = {};
v7.__index = v7;
v7.CreateGuiObjects = function(v8, v9)
    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;
    l_Frame_0.Parent = v9;
    local l_Frame_1 = Instance.new("Frame");
    l_Frame_1.Selectable = false;
    l_Frame_1.Name = "ScrollingBase";
    l_Frame_1.BackgroundTransparency = 1;
    l_Frame_1.ClipsDescendants = true;
    l_Frame_1.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_1.Position = UDim2.new(0, 0, 0, 0);
    l_Frame_1.Parent = l_Frame_0;
    local l_Frame_2 = Instance.new("Frame");
    l_Frame_2.Selectable = false;
    l_Frame_2.Name = "ScrollerSizer";
    l_Frame_2.BackgroundTransparency = 1;
    l_Frame_2.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_2.Position = UDim2.new(0, 0, 0, 0);
    l_Frame_2.Parent = l_Frame_1;
    local l_Frame_3 = Instance.new("Frame");
    l_Frame_3.Selectable = false;
    l_Frame_3.Name = "ScrollerFrame";
    l_Frame_3.BackgroundTransparency = 1;
    l_Frame_3.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_3.Position = UDim2.new(0, 0, 0, 0);
    l_Frame_3.Parent = l_Frame_2;
    local l_Frame_4 = Instance.new("Frame");
    l_Frame_4.Selectable = false;
    l_Frame_4.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_4.Position = UDim2.new(0, 0, 0, 0);
    l_Frame_4.ClipsDescendants = true;
    l_Frame_4.BackgroundTransparency = 1;
    l_Frame_4.Parent = l_Frame_0;
    local l_Frame_5 = Instance.new("Frame");
    l_Frame_5.Selectable = false;
    l_Frame_5.Name = "LeaveConfirmationFrame";
    l_Frame_5.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_5.Position = UDim2.new(0, 0, 1, 0);
    l_Frame_5.BackgroundTransparency = 0.6;
    l_Frame_5.BorderSizePixel = 0;
    l_Frame_5.BackgroundColor3 = Color3.new(0, 0, 0);
    l_Frame_5.Parent = l_Frame_4;
    local l_TextButton_0 = Instance.new("TextButton");
    l_TextButton_0.Selectable = false;
    l_TextButton_0.Size = UDim2.new(1, 0, 1, 0);
    l_TextButton_0.BackgroundTransparency = 1;
    l_TextButton_0.Text = "";
    l_TextButton_0.Parent = l_Frame_5;
    local l_TextButton_1 = Instance.new("TextButton");
    l_TextButton_1.Selectable = false;
    l_TextButton_1.Size = UDim2.new(0.25, 0, 1, 0);
    l_TextButton_1.BackgroundTransparency = 1;
    l_TextButton_1.Font = l_ChatSettings_0.DefaultFont;
    l_TextButton_1.TextSize = 18;
    l_TextButton_1.TextStrokeTransparency = 0.75;
    l_TextButton_1.Position = UDim2.new(0, 0, 0, 0);
    l_TextButton_1.TextColor3 = Color3.new(0, 1, 0);
    l_TextButton_1.Text = "Confirm";
    l_TextButton_1.Parent = l_Frame_5;
    local v18 = l_TextButton_1:Clone();
    v18.Parent = l_Frame_5;
    v18.Position = UDim2.new(0.75, 0, 0, 0);
    v18.TextColor3 = Color3.new(1, 0, 0);
    v18.Text = "Cancel";
    local l_TextLabel_0 = Instance.new("TextLabel");
    l_TextLabel_0.Selectable = false;
    l_TextLabel_0.Size = UDim2.new(0.5, 0, 1, 0);
    l_TextLabel_0.Position = UDim2.new(0.25, 0, 0, 0);
    l_TextLabel_0.BackgroundTransparency = 1;
    l_TextLabel_0.TextColor3 = Color3.new(1, 1, 1);
    l_TextLabel_0.TextStrokeTransparency = 0.75;
    l_TextLabel_0.Text = "Leave channel <XX>?";
    l_TextLabel_0.Font = l_ChatSettings_0.DefaultFont;
    l_TextLabel_0.TextSize = 18;
    l_TextLabel_0.Parent = l_Frame_5;
    local l_StringValue_0 = Instance.new("StringValue");
    l_StringValue_0.Name = "LeaveTarget";
    l_StringValue_0.Parent = l_Frame_5;
    local l_Position_0 = l_Frame_5.Position;
    l_TextButton_1.MouseButton1Click:connect(function()
        l_MessageSender_0:SendMessage(string.format("/leave %s", l_StringValue_0.Value), nil);
        l_Frame_5:TweenPosition(l_Position_0, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
    end);
    v18.MouseButton1Click:connect(function()
        l_Frame_5:TweenPosition(l_Position_0, Enum.EasingDirection.Out, Enum.EasingStyle.Quad, 0.2, true);
    end);
    local v22 = "rbxasset://textures/ui/Chat/TabArrowBackground.png";
    local v23 = "rbxasset://textures/ui/Chat/TabArrow.png";
    v22 = "rbxassetid://471630199";
    v23 = "rbxassetid://471630112";
    local v24 = Instance.new("ImageButton", l_Frame_0);
    v24.Selectable = l_ChatSettings_0.GamepadNavigationEnabled;
    v24.Name = "PageLeftButton";
    v24.SizeConstraint = Enum.SizeConstraint.RelativeYY;
    v24.Size = UDim2.new(0.7, 0, 0.7, 0);
    v24.BackgroundTransparency = 1;
    v24.Position = UDim2.new(0, 4, 0.15000000000000002, 0);
    v24.Visible = false;
    v24.Image = v22;
    local v25 = Instance.new("ImageLabel", v24);
    v25.Name = "ArrowLabel";
    v25.BackgroundTransparency = 1;
    v25.Size = UDim2.new(0.4, 0, 0.4, 0);
    v25.Image = v23;
    local v26 = Instance.new("Frame", l_Frame_0);
    v26.Selectable = false;
    v26.BackgroundTransparency = 1;
    v26.Name = "PositionalHelper";
    v26.Size = v24.Size;
    v26.SizeConstraint = v24.SizeConstraint;
    v26.Position = UDim2.new(1, 0, 0.15000000000000002, 0);
    local v27 = v24:Clone();
    v27.Parent = v26;
    v27.Name = "PageRightButton";
    v27.Size = UDim2.new(1, 0, 1, 0);
    v27.SizeConstraint = Enum.SizeConstraint.RelativeXY;
    v27.Position = UDim2.new(-1, -4, 0, 0);
    local v28 = UDim2.new(0.05, 0, 0, 0);
    v27.ArrowLabel.Position = UDim2.new(0.3, 0, 0.3, 0) + v28;
    v24.ArrowLabel.Position = UDim2.new(0.3, 0, 0.3, 0) - v28;
    v24.ArrowLabel.Rotation = 180;
    v8.GuiObject = l_Frame_0;
    v8.GuiObjects.BaseFrame = l_Frame_0;
    v8.GuiObjects.ScrollerSizer = l_Frame_2;
    v8.GuiObjects.ScrollerFrame = l_Frame_3;
    v8.GuiObjects.PageLeftButton = v24;
    v8.GuiObjects.PageRightButton = v27;
    v8.GuiObjects.LeaveConfirmationFrame = l_Frame_5;
    v8.GuiObjects.LeaveConfirmationNotice = l_TextLabel_0;
    v8.GuiObjects.PageLeftButtonArrow = v24.ArrowLabel;
    v8.GuiObjects.PageRightButtonArrow = v27.ArrowLabel;
    v8:AnimGuiObjects();
    v24.MouseButton1Click:connect(function()
        v8:ScrollChannelsFrame(-1);
    end);
    v27.MouseButton1Click:connect(function()
        v8:ScrollChannelsFrame(1);
    end);
    v8:ScrollChannelsFrame(0);
end;
v7.UpdateMessagePostedInChannel = function(v29, v30)
    local l_v29_ChannelTab_0 = v29:GetChannelTab(v30);
    if not l_v29_ChannelTab_0 then
        warn("ChannelsTab '" .. v30 .. "' does not exist");
        return ;
    else
        l_v29_ChannelTab_0:UpdateMessagePostedInChannel();
        return ;
    end;
end;
v7.AddChannelTab = function(v32, v33)
    if v32:GetChannelTab(v33) then
        error("Channel tab '" .. v33 .. "'already exists");
    end;
    local v34 = l_ChannelsTab_0.new(v33);
    v34.GuiObject.Parent = v32.GuiObjects.ScrollerFrame;
    v32.ChannelTabs[v33:lower()] = v34;
    v32.NumTabs = v32.NumTabs + 1;
    v32:OrganizeChannelTabs();
    if l_ChatSettings_0.RightClickToLeaveChannelEnabled then
        v34.NameTag.MouseButton2Click:connect(function()
            v32.LeaveConfirmationNotice.Text = string.format("Leave channel %s?", v34.ChannelName);
            v32.LeaveConfirmationFrame.LeaveTarget.Value = v34.ChannelName;
            v32.LeaveConfirmationFrame:TweenPosition(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.In, Enum.EasingStyle.Quad, 0.2, true);
        end);
    end;
    return v34;
end;
v7.RemoveChannelTab = function(v35, v36)
    if not v35:GetChannelTab(v36) then
        error("Channel tab '" .. v36 .. "'does not exist");
    end;
    local v37 = v36:lower();
    v35.ChannelTabs[v37]:Destroy();
    v35.ChannelTabs[v37] = nil;
    v35.NumTabs = v35.NumTabs - 1;
    v35:OrganizeChannelTabs();
end;
v7.GetChannelTab = function(v38, v39)
    return v38.ChannelTabs[v39:lower()];
end;
v7.OrganizeChannelTabs = function(v40)
    local v41 = {};
    table.insert(v41, v40:GetChannelTab(l_ChatSettings_0.GeneralChannelName));
    table.insert(v41, v40:GetChannelTab("System"));
    for _, v43 in pairs(v40.ChannelTabs) do
        if v43.ChannelName ~= l_ChatSettings_0.GeneralChannelName and v43.ChannelName ~= "System" then
            table.insert(v41, v43);
        end;
    end;
    for v44, v45 in pairs(v41) do
        v45.GuiObject.Position = UDim2.new(v44 - 1, 0, 0, 0);
    end;
    v40.GuiObjects.ScrollerSizer.Size = UDim2.new(1 / math.max(1, (math.min(l_ChatSettings_0.ChannelsBarFullTabSize, v40.NumTabs))), 0, 1, 0);
    v40:ScrollChannelsFrame(0);
end;
v7.ResizeChannelTabText = function(v46, v47)
    for _, v49 in pairs(v46.ChannelTabs) do
        v49:SetTextSize(v47);
    end;
end;
v7.ScrollChannelsFrame = function(v50, v51)
    if not v50.ScrollChannelsFrameLock then
        v50.ScrollChannelsFrameLock = true;
        local l_ChannelsBarFullTabSize_0 = l_ChatSettings_0.ChannelsBarFullTabSize;
        local v53 = v50.CurPageNum + v51;
        if v53 < 0 then
            v53 = 0;
        elseif v53 > 0 and v50.NumTabs < v53 + l_ChannelsBarFullTabSize_0 then
            v53 = v50.NumTabs - l_ChannelsBarFullTabSize_0;
        end;
        v50.CurPageNum = v53;
        local v54 = UDim2.new(-v50.CurPageNum, 0, 0, 0);
        v50.GuiObjects.PageLeftButton.Visible = v50.CurPageNum > 0;
        v50.GuiObjects.PageRightButton.Visible = v50.CurPageNum + l_ChannelsBarFullTabSize_0 < v50.NumTabs;
        if v51 == 0 then
            v50.ScrollChannelsFrameLock = false;
            return ;
        else
            local function v55()
                v50.ScrollChannelsFrameLock = false;
            end;
            v50:WaitUntilParentedCorrectly();
            v50.GuiObjects.ScrollerFrame:TweenPosition(v54, Enum.EasingDirection.InOut, Enum.EasingStyle.Quad, 0.15, true, v55);
            return ;
        end;
    else
        return ;
    end;
end;
v7.FadeOutBackground = function(v56, v57)
    for _, v59 in pairs(v56.ChannelTabs) do
        v59:FadeOutBackground(v57);
    end;
    v56.AnimParams.Background_TargetTransparency = 1;
    v56.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v57);
end;
v7.FadeInBackground = function(v60, v61)
    for _, v63 in pairs(v60.ChannelTabs) do
        v63:FadeInBackground(v61);
    end;
    v60.AnimParams.Background_TargetTransparency = 0.6;
    v60.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v61);
end;
v7.FadeOutText = function(v64, v65)
    for _, v67 in pairs(v64.ChannelTabs) do
        v67:FadeOutText(v65);
    end;
end;
v7.FadeInText = function(v68, v69)
    for _, v71 in pairs(v68.ChannelTabs) do
        v71:FadeInText(v69);
    end;
end;
v7.AnimGuiObjects = function(v72)
    v72.GuiObjects.PageLeftButton.ImageTransparency = v72.AnimParams.Background_CurrentTransparency;
    v72.GuiObjects.PageRightButton.ImageTransparency = v72.AnimParams.Background_CurrentTransparency;
    v72.GuiObjects.PageLeftButtonArrow.ImageTransparency = v72.AnimParams.Background_CurrentTransparency;
    v72.GuiObjects.PageRightButtonArrow.ImageTransparency = v72.AnimParams.Background_CurrentTransparency;
end;
v7.InitializeAnimParams = function(v73)
    v73.AnimParams.Background_TargetTransparency = 0.6;
    v73.AnimParams.Background_CurrentTransparency = 0.6;
    v73.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(0);
end;
v7.Update = function(v74, v75)
    for _, v77 in pairs(v74.ChannelTabs) do
        v77:Update(v75);
    end;
    v74.AnimParams.Background_CurrentTransparency = l_CurveUtil_0:Expt(v74.AnimParams.Background_CurrentTransparency, v74.AnimParams.Background_TargetTransparency, v74.AnimParams.Background_NormalizedExptValue, v75);
    v74:AnimGuiObjects();
end;
v7.WaitUntilParentedCorrectly = function(v78)
    while not v78.GuiObject:IsDescendantOf(game:GetService("Players").LocalPlayer) do
        v78.GuiObject.AncestryChanged:wait();
    end;
end;
v0.new = function()
    local v79 = setmetatable({}, v7);
    v79.GuiObject = nil;
    v79.GuiObjects = {};
    v79.ChannelTabs = {};
    v79.NumTabs = 0;
    v79.CurPageNum = 0;
    v79.ScrollChannelsFrameLock = false;
    v79.AnimParams = {};
    v79:InitializeAnimParams();
    l_ChatSettings_0.SettingsChanged:connect(function(v80, v81)
        if v80 == "ChatChannelsTabTextSize" then
            v79:ResizeChannelTabText(v81);
        end;
    end);
    return v79;
end;
return v0;


local v0 = {};
local l_ClientChatModules_0 = game:GetService("Chat"):WaitForChild("ClientChatModules");
local l_Parent_0 = script.Parent;
local l_ChatSettings_0 = require(l_ClientChatModules_0:WaitForChild("ChatSettings"));
local l_CurveUtil_0 = require(l_Parent_0:WaitForChild("CurveUtil"));
local v5 = {};
v5.__index = v5;
local function v19()
    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_Frame_1 = Instance.new("Frame");
    l_Frame_1.Selectable = false;
    l_Frame_1.Name = "BackgroundFrame";
    l_Frame_1.Size = UDim2.new(1, -2, 1, -2);
    l_Frame_1.Position = UDim2.new(0, 1, 0, 1);
    l_Frame_1.BackgroundTransparency = 1;
    l_Frame_1.Parent = l_Frame_0;
    local l_Frame_2 = Instance.new("Frame");
    l_Frame_2.Selectable = false;
    l_Frame_2.Name = "UnselectedFrame";
    l_Frame_2.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_2.Position = UDim2.new(0, 0, 0, 0);
    l_Frame_2.BorderSizePixel = 0;
    l_Frame_2.BackgroundColor3 = l_ChatSettings_0.ChannelsTabUnselectedColor;
    l_Frame_2.BackgroundTransparency = 0.6;
    l_Frame_2.Parent = l_Frame_1;
    local l_Frame_3 = Instance.new("Frame");
    l_Frame_3.Selectable = false;
    l_Frame_3.Name = "SelectedFrame";
    l_Frame_3.Size = UDim2.new(1, 0, 1, 0);
    l_Frame_3.Position = UDim2.new(0, 0, 0, 0);
    l_Frame_3.BorderSizePixel = 0;
    l_Frame_3.BackgroundColor3 = l_ChatSettings_0.ChannelsTabSelectedColor;
    l_Frame_3.BackgroundTransparency = 1;
    l_Frame_3.Parent = l_Frame_1;
    local l_ImageLabel_0 = Instance.new("ImageLabel");
    l_ImageLabel_0.Selectable = false;
    l_ImageLabel_0.Name = "BackgroundImage";
    l_ImageLabel_0.BackgroundTransparency = 1;
    l_ImageLabel_0.BorderSizePixel = 0;
    l_ImageLabel_0.Size = UDim2.new(1, 0, 1, 0);
    l_ImageLabel_0.Position = UDim2.new(0, 0, 0, 0);
    l_ImageLabel_0.ScaleType = Enum.ScaleType.Slice;
    l_ImageLabel_0.Parent = l_Frame_3;
    l_ImageLabel_0.BackgroundTransparency = -0.4;
    l_ImageLabel_0.BackgroundColor3 = Color3.fromRGB(93.6, 100.8, 115.19999999999999);
    local l_ImageLabel_1 = Instance.new("ImageLabel");
    l_ImageLabel_1.Selectable = false;
    l_ImageLabel_1.Size = UDim2.new(0.5, -2, 0, 4);
    l_ImageLabel_1.BackgroundTransparency = 1;
    l_ImageLabel_1.ScaleType = Enum.ScaleType.Slice;
    l_ImageLabel_1.SliceCenter = Rect.new(3, 3, 32, 21);
    l_ImageLabel_1.Parent = l_Frame_3;
    local v12 = l_ImageLabel_1:Clone();
    v12.Parent = l_Frame_3;
    l_ImageLabel_1.Position = UDim2.new(0, 2, 1, -4);
    v12.Position = UDim2.new(0.5, 0, 1, -4);
    l_ImageLabel_1.Image = "rbxasset://textures/ui/Settings/Slider/SelectedBarLeft.png";
    v12.Image = "rbxasset://textures/ui/Settings/Slider/SelectedBarRight.png";
    l_ImageLabel_1.Name = "BlueBarLeft";
    v12.Name = "BlueBarRight";
    local l_TextButton_0 = Instance.new("TextButton");
    l_TextButton_0.Selectable = l_ChatSettings_0.GamepadNavigationEnabled;
    l_TextButton_0.Size = UDim2.new(1, 0, 1, 0);
    l_TextButton_0.Position = UDim2.new(0, 0, 0, 0);
    l_TextButton_0.BackgroundTransparency = 1;
    l_TextButton_0.Font = l_ChatSettings_0.DefaultFont;
    l_TextButton_0.TextSize = l_ChatSettings_0.ChatChannelsTabTextSize;
    l_TextButton_0.TextColor3 = Color3.new(1, 1, 1);
    l_TextButton_0.TextStrokeTransparency = 0.75;
    l_TextButton_0.Parent = l_Frame_1;
    local v14 = l_TextButton_0:Clone();
    local v15 = l_TextButton_0:Clone();
    v14.Parent = l_Frame_2;
    v15.Parent = l_Frame_3;
    v14.Font = Enum.Font.SourceSans;
    v14.Active = false;
    v15.Active = false;
    local l_Frame_4 = Instance.new("Frame");
    l_Frame_4.Selectable = false;
    l_Frame_4.Size = UDim2.new(0, 18, 0, 18);
    l_Frame_4.Position = UDim2.new(0.8, -9, 0.5, -9);
    l_Frame_4.BackgroundTransparency = 1;
    l_Frame_4.Parent = l_Frame_1;
    local l_ImageLabel_2 = Instance.new("ImageLabel");
    l_ImageLabel_2.Selectable = false;
    l_ImageLabel_2.Size = UDim2.new(1, 0, 1, 0);
    l_ImageLabel_2.BackgroundTransparency = 1;
    l_ImageLabel_2.Image = "rbxasset://textures/ui/Chat/MessageCounter.png";
    l_ImageLabel_2.Visible = false;
    l_ImageLabel_2.Parent = l_Frame_4;
    local l_TextLabel_0 = Instance.new("TextLabel");
    l_TextLabel_0.Selectable = false;
    l_TextLabel_0.BackgroundTransparency = 1;
    l_TextLabel_0.Size = UDim2.new(0, 13, 0, 9);
    l_TextLabel_0.Position = UDim2.new(0.5, -7, 0.5, -7);
    l_TextLabel_0.Font = l_ChatSettings_0.DefaultFont;
    l_TextLabel_0.TextSize = 14;
    l_TextLabel_0.TextColor3 = Color3.new(1, 1, 1);
    l_TextLabel_0.Text = "";
    l_TextLabel_0.Parent = l_ImageLabel_2;
    return l_Frame_0, l_TextButton_0, v14, v15, l_ImageLabel_2, l_Frame_2, l_Frame_3;
end;
v5.Destroy = function(v20)
    v20.GuiObject:Destroy();
end;
v5.UpdateMessagePostedInChannel = function(v21, v22)
    if v21.Active and v22 ~= true then
        return ;
    else
        local v23 = v21.UnreadMessageCount + 1;
        v21.UnreadMessageCount = v23;
        local l_NewMessageIcon_0 = v21.NewMessageIcon;
        l_NewMessageIcon_0.Visible = true;
        l_NewMessageIcon_0.TextLabel.Text = v23 < 100 and tostring(v23) or "";
        local _ = l_NewMessageIcon_0.Position + UDim2.new(0, 0, -0.1, 0);
        local l_Out_0 = Enum.EasingDirection.Out;
        local l_Quad_0 = Enum.EasingStyle.Quad;
        l_NewMessageIcon_0.Position = UDim2.new(0, 0, -0.15, 0);
        l_NewMessageIcon_0:TweenPosition(UDim2.new(0, 0, 0, 0), l_Out_0, l_Quad_0, 0.15, true);
        return ;
    end;
end;
v5.SetActive = function(v28, v29)
    v28.Active = v29;
    v28.UnselectedFrame.Visible = not v29;
    v28.SelectedFrame.Visible = v29;
    if not v29 then
        v28.NameTag.Font = Enum.Font.SourceSans;
        return ;
    else
        v28.UnreadMessageCount = 0;
        v28.NewMessageIcon.Visible = false;
        v28.NameTag.Font = Enum.Font.SourceSansBold;
        return ;
    end;
end;
v5.SetTextSize = function(v30, v31)
    v30.NameTag.TextSize = v31;
end;
v5.FadeOutBackground = function(v32, v33)
    v32.AnimParams.Background_TargetTransparency = 1;
    v32.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v33);
end;
v5.FadeInBackground = function(v34, v35)
    v34.AnimParams.Background_TargetTransparency = 0.6;
    v34.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v35);
end;
v5.FadeOutText = function(v36, v37)
    v36.AnimParams.Text_TargetTransparency = 1;
    v36.AnimParams.Text_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v37);
    v36.AnimParams.TextStroke_TargetTransparency = 1;
    v36.AnimParams.TextStroke_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v37);
end;
v5.FadeInText = function(v38, v39)
    v38.AnimParams.Text_TargetTransparency = 0;
    v38.AnimParams.Text_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v39);
    v38.AnimParams.TextStroke_TargetTransparency = 0.75;
    v38.AnimParams.TextStroke_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(v39);
end;
v5.AnimGuiObjects = function(v40)
    v40.UnselectedFrame.BackgroundTransparency = v40.AnimParams.Background_CurrentTransparency;
    v40.SelectedFrame.BackgroundImage.BackgroundTransparency = v40.AnimParams.Background_CurrentTransparency;
    v40.SelectedFrame.BlueBarLeft.ImageTransparency = v40.AnimParams.Background_CurrentTransparency;
    v40.SelectedFrame.BlueBarRight.ImageTransparency = v40.AnimParams.Background_CurrentTransparency;
    v40.NameTagNonSelect.TextTransparency = v40.AnimParams.Background_CurrentTransparency;
    v40.NameTagNonSelect.TextStrokeTransparency = v40.AnimParams.Background_CurrentTransparency;
    v40.NameTag.TextTransparency = v40.AnimParams.Text_CurrentTransparency;
    v40.NewMessageIcon.ImageTransparency = v40.AnimParams.Text_CurrentTransparency;
    v40.WhiteTextNewMessageNotification.TextTransparency = v40.AnimParams.Text_CurrentTransparency;
    v40.NameTagSelect.TextTransparency = v40.AnimParams.Text_CurrentTransparency;
    v40.NameTag.TextStrokeTransparency = v40.AnimParams.TextStroke_CurrentTransparency;
    v40.WhiteTextNewMessageNotification.TextStrokeTransparency = v40.AnimParams.TextStroke_CurrentTransparency;
    v40.NameTagSelect.TextStrokeTransparency = v40.AnimParams.TextStroke_CurrentTransparency;
end;
v5.InitializeAnimParams = function(v41)
    v41.AnimParams.Text_TargetTransparency = 0;
    v41.AnimParams.Text_CurrentTransparency = 0;
    v41.AnimParams.Text_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(0);
    v41.AnimParams.TextStroke_TargetTransparency = 0.75;
    v41.AnimParams.TextStroke_CurrentTransparency = 0.75;
    v41.AnimParams.TextStroke_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(0);
    v41.AnimParams.Background_TargetTransparency = 0.6;
    v41.AnimParams.Background_CurrentTransparency = 0.6;
    v41.AnimParams.Background_NormalizedExptValue = l_CurveUtil_0:NormalizedDefaultExptValueInSeconds(0);
end;
v5.Update = function(v42, v43)
    v42.AnimParams.Background_CurrentTransparency = l_CurveUtil_0:Expt(v42.AnimParams.Background_CurrentTransparency, v42.AnimParams.Background_TargetTransparency, v42.AnimParams.Background_NormalizedExptValue, v43);
    v42.AnimParams.Text_CurrentTransparency = l_CurveUtil_0:Expt(v42.AnimParams.Text_CurrentTransparency, v42.AnimParams.Text_TargetTransparency, v42.AnimParams.Text_NormalizedExptValue, v43);
    v42.AnimParams.TextStroke_CurrentTransparency = l_CurveUtil_0:Expt(v42.AnimParams.TextStroke_CurrentTransparency, v42.AnimParams.TextStroke_TargetTransparency, v42.AnimParams.TextStroke_NormalizedExptValue, v43);
    v42:AnimGuiObjects();
end;
v0.new = function(v44)
    local v45 = setmetatable({}, v5);
    local v46, v47, v48, v49, v50, v51, v52 = v19();
    v45.GuiObject = v46;
    v45.NameTag = v47;
    v45.NameTagNonSelect = v48;
    v45.NameTagSelect = v49;
    v45.NewMessageIcon = v50;
    v45.UnselectedFrame = v51;
    v45.SelectedFrame = v52;
    v45.BlueBarLeft = v52.BlueBarLeft;
    v45.BlueBarRight = v52.BlueBarRight;
    v45.BackgroundImage = v52.BackgroundImage;
    v45.WhiteTextNewMessageNotification = v45.NewMessageIcon.TextLabel;
    v45.ChannelName = v44;
    v45.UnreadMessageCount = 0;
    v45.Active = false;
    v45.GuiObject.Name = "Frame_" .. v45.ChannelName;
    if l_ChatSettings_0.MaxChannelNameLength < string.len(v44) then
        v44 = string.sub(v44, 1, l_ChatSettings_0.MaxChannelNameLength - 3) .. "...";
    end;
    v45.NameTag.Text = "";
    v45.NameTagNonSelect.Text = v44;
    v45.NameTagSelect.Text = v44;
    v45.AnimParams = {};
    v45:InitializeAnimParams();
    v45:AnimGuiObjects();
    v45:SetActive(false);
    return v45;
end;
return v0;