local l_Parent_0 = script:FindFirstAncestor("ExpChat").Parent;
local v1 = require(l_Parent_0.Roact);
local v2 = require(l_Parent_0.RoactRodux);
local v3 = require(script.Parent.Localization);
local v4 = require(script.Parent.AppContainer);
local v5 = require(script.Parent.createStore);
local v6 = v1.Component:extend("App");
v6.defaultProps = {
    isChatWindowVisible = true,
    isChatInputBarVisible = true,
    isDefaultChatEnabled = true,
    store = v5(),
    translator = {
        FormatByKey = function(_, v8)
            return (tostring(v8));
        end
    }
};
v6.render = function(v9)
    return v9.props.isDefaultChatEnabled and v1.createElement(v2.StoreProvider, {
        store = v9.props.store
    }, {
        localization = v1.createElement(v3.Provider, {
            value = v9.props.translator
        }, {
            container = v1.createElement(v4, {
                isChatInputBarVisible = v9.props.isChatInputBarVisible,
                isChatWindowVisible = v9.props.isChatWindowVisible,
                getIconVoiceIndicator = v9.props.getIconVoiceIndicator,
                onClickedVoiceIndicator = v9.props.onClickedVoiceIndicator,
                onClickedCameraIndicator = v9.props.onClickedCameraIndicator,
                selfViewListenerChanged = v9.props.selfViewListenerChanged,
                getPermissions = v9.props.getPermissions,
                displayCameraDeniedToast = v9.props.displayCameraDeniedToast,
                isCamEnabledForUserAndPlace = v9.props.isCamEnabledForUserAndPlace,
                isCameraOnlyUser = v9.props.isCameraOnlyUser,
                isVoiceServiceInitialized = v9.props.isVoiceServiceInitialized
            })
        })
    });
end;
return v6;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Roact);
local v3 = require(l_Parent_0.RoactRodux);
local v4 = require(l_script_FirstAncestor_0.ClientSettings);
local v5 = require(script.Parent.mapStateToProps);
local v6 = require(script.Parent.mapDispatchToProps);
local v7 = require(script.Parent.Parent.BubbleChat);
local v8 = require(script.Parent.Parent.AppLayout);
local l_TextChatService_0 = game:GetService("TextChatService");
local v10 = require(l_script_FirstAncestor_0.GlobalFlags);
local v11 = require(l_script_FirstAncestor_0.Flags.getFFlagChatTranslationUIEnabled);
local v12 = require(l_script_FirstAncestor_0.Flags.getFFlagChatTranslationShowFTUX);
getChatWindowEnabled = function()
    local l_status_0, l_result_0 = pcall(function()
        local l_ChatWindowConfiguration_0 = l_TextChatService_0:FindFirstChildOfClass("ChatWindowConfiguration");
        if l_ChatWindowConfiguration_0 ~= nil then
            return l_ChatWindowConfiguration_0.Enabled;
        else
            return false;
        end;
    end);
    return l_status_0 and l_result_0;
end;
getChatTranslationEnabled = function()
    local l_status_1, l_result_1 = pcall(function()
        return l_TextChatService_0.ChatTranslationEnabled;
    end);
    return l_status_1 and l_result_1;
end;
getChatTranslationToggleEnabled = function()
    local l_status_2, l_result_2 = pcall(function()
        return l_TextChatService_0.ChatTranslationToggleEnabled;
    end);
    return l_status_2 and l_result_2;
end;
shouldShowChatTranslationFTUX = function()
    if not game:GetEngineFeature("TextChatServiceSettingsSaved") then
        return true;
    else
        local l_status_3, l_result_3 = pcall(function()
            return l_TextChatService_0.ChatTranslationFTUXShown;
        end);
        return not (l_status_3 and l_result_3);
    end;
end;
local v22 = shouldShowChatTranslationFTUX();
local v23 = require(script.Parent.Parent.ChatTranslationFTUX);
local v24 = v2.Component:extend("AppContainer");
v24.defaultProps = {
    isChatInputBarVisible = true,
    isChatWindowVisible = true,
    onSendChat = nil,
    messages = {},
    mutedUserIds = nil,
    textTimer = nil,
    timer = nil,
    textChatService = l_TextChatService_0
};
local v25 = nil;
v24.init = function(v26)
    v26:setState({
        showTranslationButton = false
    });
    local _ = nil;
    v26.isTextChatServiceOn = not v10.ConsolidateBubbleChat and true or v26.props.textChatService.ChatVersion == Enum.ChatVersion.TextChatService;
end;
v24.willUnmount = function(_)
    if v11() then
        v25:Disconnect();
    end;
end;
v24.didMount = function(v29)
    if v11() then
        local function v37(v30)
            if v30 == "ChatTranslationEnabled" then
                local l_status_4, l_result_4 = pcall(function()
                    return l_TextChatService_0.ChatTranslationEnabled;
                end);
                if l_status_4 then
                    v29.props.onToggleTranslation(l_result_4);
                    v29:setState({
                        showTranslationButton = getChatTranslationEnabled() and getChatTranslationToggleEnabled()
                    });
                    return ;
                end;
            elseif v30 == "ChatTranslationToggleEnabled" then
                local l_status_5, _ = pcall(function()
                    return l_TextChatService_0.ChatTranslationToggleEnabled;
                end);
                local l_status_6, l_result_6 = pcall(function()
                    return l_TextChatService_0.ChatTranslationEnabled;
                end);
                if l_status_5 then
                    if l_status_6 then
                        v29.props.onToggleTranslation(l_result_6);
                    end;
                    v29:setState({
                        showTranslationButton = getChatTranslationEnabled() and getChatTranslationToggleEnabled()
                    });
                end;
            end;
        end;
        if not v25 then
            v25 = l_TextChatService_0.Changed:Connect(v37);
        end;
        v29:setState({
            showTranslationButton = getChatTranslationEnabled() and getChatTranslationToggleEnabled()
        });
    end;
end;
v24.render = function(v38)
    local v39 = v2.createElement(v7, {
        getIconVoiceIndicator = v38.props.getIconVoiceIndicator,
        onClickedVoiceIndicator = v38.props.onClickedVoiceIndicator,
        onClickedCameraIndicator = v38.props.onClickedCameraIndicator,
        selfViewListenerChanged = v38.props.selfViewListenerChanged,
        getPermissions = v38.props.getPermissions,
        displayCameraDeniedToast = v38.props.displayCameraDeniedToast,
        isCamEnabledForUserAndPlace = v38.props.isCamEnabledForUserAndPlace,
        isCameraOnlyUser = v38.props.isCameraOnlyUser,
        isTextChatServiceOn = v38.isTextChatServiceOn,
        isVoiceServiceInitialized = v38.props.isVoiceServiceInitialized
    });
    if not v38.isTextChatServiceOn then
        if not v10.ConsolidateBubbleChat then
            return nil;
        else
            return v2.createElement(v4.Provider, {
                value = v38.props.clientSettings
            }, {
                bubbleChat = v39
            });
        end;
    else
        return v2.createElement(v4.Provider, {
            value = v38.props.clientSettings
        }, {
            app = v2.createFragment({
                appLayout = v2.createElement(v8, {
                    canLocalUserChat = v38.props.canLocalUserChat,
                    isChatInputBarVisible = v38.props.isChatInputBarVisible,
                    isChatWindowVisible = v38.props.isChatWindowVisible,
                    chatTopBarVisibility = v38.props.chatTopBarVisibility,
                    messages = v38.props.messages,
                    mutedUserIds = v38.props.mutedUserIds,
                    onSendChat = v38.props.onSendChat,
                    timer = v38.props.timer,
                    textTimer = v38.props.textTimer,
                    activateWhisperMode = v38.props.activateWhisperMode,
                    resetTargetChannel = v38.props.resetTargetChannel,
                    lastGeneralActivityTimestamp = v38.props.lastGeneralActivityTimestamp,
                    lastMessageActivityTimestamp = v38.props.lastMessageActivityTimestamp,
                    isTextBoxFocused = v38.props.isTextBoxFocused,
                    onHovered = v38.props.onHovered,
                    onUnhovered = v38.props.onUnhovered,
                    chatLayoutAlignment = v38.props.chatLayoutAlignment,
                    chatWindowSettings = v38.props.chatWindowSettings,
                    clientSettings = v38.props.clientSettings,
                    showTranslationButton = if not v11() then nil else v38.state.showTranslationButton
                }),
                bubbleChat = v39,
                ChatTranslationFTUX = if (((not not v11() and v12()) and v22) and getChatTranslationEnabled()) and getChatWindowEnabled() then v2.createElement(v23, {}) else nil
            })
        });
    end;
end;
return v3.connect(v5, v6)(v24);


local v0 = require(script:FindFirstAncestor("ExpChat").Logger);
return v0:new(v0.name .. "/AppContainer");


local l_Players_0 = game:GetService("Players");
local l_TextChatService_0 = game:GetService("TextChatService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v4 = require(l_Parent_0.Promise);
local l_List_0 = require(l_Parent_0.llama).List;
local v6 = require(l_script_FirstAncestor_0.Analytics);
local v7 = require(script.Parent.Logger);
local v8 = require(l_script_FirstAncestor_0.Config);
local v9 = require(l_script_FirstAncestor_0.Commands.autoCastCommand);
local v10 = require(l_script_FirstAncestor_0.Commands.Whisper.RBXWhisperCommand);
local v11 = require(l_script_FirstAncestor_0.Actions.ChatInputBarResetTargetChannel);
local v12 = require(l_script_FirstAncestor_0.Actions.UserInteraction);
local v13 = require(l_script_FirstAncestor_0.Actions.ChatTranslationGlobalToggled);
local v14 = require(l_script_FirstAncestor_0.Actions.ChatTranslationMessageToggled);
local v15 = require(l_script_FirstAncestor_0.Flags.getFFlagChatTranslationUIEnabled);
return function(v16)
    return {
        activateWhisperMode = function(v17)
            local l_l_Players_0_PlayerByUserId_0 = l_Players_0:GetPlayerByUserId(v17);
            local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
            if l_l_Players_0_PlayerByUserId_0 then
                if l_l_Players_0_PlayerByUserId_0 == l_LocalPlayer_0 then
                    return ;
                else
                    assert(l_LocalPlayer_0, "Players.LocalPlayer should be non-nil");
                    v4.any({
                        v9(v10, l_LocalPlayer_0.UserId, "/w @" .. l_l_Players_0_PlayerByUserId_0.Name)
                    }):catch(function(v20)
                        v7:debug("Could not send autoCastCommand. Error: {}", v20);
                    end);
                    return ;
                end;
            else
                return ;
            end;
        end,
        onToggleTranslation = if not v15() then nil else function(v21)
            v16(v13(v21));
        end,
        onToggleIndividualTranslation = if not v15() then nil else function(v22, v23)
            v6.FireClientAnalyticsWithEventName("MessageTranslationToggled", {
                useTranslation = v22,
                senderUserId = if not l_Players_0.LocalPlayer then nil else l_Players_0.LocalPlayer.UserId,
                localeId = if not l_Players_0.LocalPlayer then nil else l_Players_0.LocalPlayer.LocaleId
            });
            v16(v14(v22, v23));
        end,
        resetTargetChannel = function()
            v16(v11());
        end,
        onHovered = function()
            v16(v12("hover"));
        end,
        onUnhovered = function()
            v16(v12("unhover"));
        end,
        onSendChat = function(v24)
            local l_ChatInputBarConfiguration_0 = l_TextChatService_0:FindFirstChildOfClass("ChatInputBarConfiguration");
            local v26 = nil;
            if l_ChatInputBarConfiguration_0 then
                v26 = l_ChatInputBarConfiguration_0.TargetTextChannel;
            end;
            v7:debug("onSendChat: {} to {}", v24, not v26 and "nil" or v26.Name);
            if not v26 then
                v7:warning("TargetTextChannel was nil");
            else
                v4.try(function()
                    v26:SendAsync(v24);
                    v6.FireClientAnalyticsWithEventName("LuaMessageSent", {
                        channelName = v26.Name,
                        senderUserId = if not l_Players_0.LocalPlayer then nil else l_Players_0.LocalPlayer.UserId,
                        numParticipants = l_List_0.count(v26:GetChildren(), function(v27)
                            return v27:IsA("TextSource");
                        end),
                        isDefaultChannel = not v8[v26.Name] and "false" or "true"
                    });
                end):catch(function(v28)
                    warn(v28.error);
                end);
            end;
        end
    };
end;


return function(v0, _)
    return {
        canLocalUserChat = v0.CanLocalUserChat,
        isChatInputBarVisible = v0.ChatVisibility.isChatInputBarEnabled.value,
        isChatWindowVisible = v0.ChatVisibility.isChatWindowEnabled.value,
        chatTopBarVisibility = v0.ChatVisibility.isChatInputBarEnabled._topBarVisibility and v0.ChatVisibility.isChatWindowEnabled._topBarVisibility,
        messages = v0.Messages.windowMessagesInOrder,
        lastGeneralActivityTimestamp = v0.ChatVisibility.transparency.lastGeneralActivityTimestamp,
        lastMessageActivityTimestamp = v0.ChatVisibility.transparency.lastMessageActivityTimestamp,
        isTextBoxFocused = v0.ChatVisibility.transparency.isTextBoxFocused,
        chatLayoutAlignment = v0.ChatLayout.Alignment,
        chatWindowSettings = v0.ChatLayout.ChatWindowSettings,
        clientSettings = v0.ClientSettings
    };
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Otter);
local v3 = require(l_Parent_0.Roact);
local v4 = require(l_script_FirstAncestor_0.ChatInput);
local v5 = require(l_script_FirstAncestor_0.ChatWindow);
local v6 = require(l_script_FirstAncestor_0.Config);
local v7 = require(l_script_FirstAncestor_0.Timer);
local v8 = require(l_script_FirstAncestor_0.ClientSettings.ClientSettingsUtility);
local v9 = v3.Component:extend("AppLayout");
v9.defaultProps = {
    addTopPadding = true,
    canLocalUserChat = false,
    isChatInputBarVisible = true,
    isChatWindowVisible = true,
    LayoutOrder = 1,
    mutedUserIds = nil,
    onSendChat = nil,
    textTimer = v7.new(v6.ChatWindowTextFadeOutTime),
    timer = v7.new(v6.ChatWindowBackgroundFadeOutTime)
};
local v10 = {
    frequency = 1.25,
    dampingRatio = 1
};
v9.init = function(v11)
    local v12, v13 = v3.createBinding(0);
    v11.transparencyValue = v12;
    v11.updateBackgroundTransparency = v13;
    v11.backgroundTransparencyMotor = v2.createSingleMotor(0);
    v11.backgroundTransparencyMotor:onStep(v11.updateBackgroundTransparency);
    v12, v13 = v3.createBinding(0);
    v11.textTransparencyValue = v12;
    v11.updateTextTransparencyValue = v13;
    v11.textTransparencyMotor = v2.createSingleMotor(0);
    v11.textTransparencyMotor:onStep(v11.updateTextTransparencyValue);
    v11.resetBackgroundTransparency = function()
        v11.backgroundTransparencyMotor:setGoal(v2.instant(0));
        v11.props.timer:stop();
        if v11.props.isTextBoxFocused == false then
            v11.props.timer:start():andThen(function()
                v11.backgroundTransparencyMotor:setGoal(v2.spring(1, v10));
            end);
        end;
    end;
    v11.resetTextTransparency = function()
        v11.textTransparencyMotor:setGoal(v2.instant(0));
        v11.props.textTimer:stop();
        if v11.props.isTextBoxFocused == false then
            v11.props.textTimer:start():andThen(function()
                v11.textTransparencyMotor:setGoal(v2.spring(1, v10));
            end);
        end;
    end;
    v11.onAbsolutePositionChanged = function(v14, v15)
        v15.AbsolutePositionWrite = v14.AbsolutePosition;
    end;
    v11.onAbsoluteSizeChanged = function(v16, v17)
        v17.AbsoluteSizeWrite = v16.AbsoluteSize;
    end;
end;
v9.didMount = function(v18)
    v18.props.timer:start():andThen(function()
        v18.backgroundTransparencyMotor:setGoal(v2.spring(1, v10));
    end);
    v18.props.textTimer:start():andThen(function()
        v18.textTransparencyMotor:setGoal(v2.spring(1, v10));
    end);
end;
v9.didUpdate = function(v19, v20, _)
    if v20.lastGeneralActivityTimestamp ~= v19.props.lastGeneralActivityTimestamp then
        v19.resetBackgroundTransparency();
        v19.resetTextTransparency();
        return ;
    else
        if v20.lastMessageActivityTimestamp ~= v19.props.lastMessageActivityTimestamp then
            v19.resetTextTransparency();
        end;
        return ;
    end;
end;
v9.render = function(v22)
    local l_chatWindowSettings_0 = v22.props.chatWindowSettings;
    local v24 = v8.getBackgroundTransparency(l_chatWindowSettings_0, v22.props.clientSettings);
    local v25 = v8.getBackgroundColor(l_chatWindowSettings_0, v22.props.clientSettings);
    return v3.createElement("Frame", {
        BackgroundColor3 = Color3.new(0, 0, 0),
        BackgroundTransparency = 1,
        Position = v22.props.chatLayoutAlignment.Position,
        AnchorPoint = v22.props.chatLayoutAlignment.AnchorPoint,
        Size = UDim2.fromScale(v6.ChatWindowSize.X.Scale * l_chatWindowSettings_0.WidthScale, v6.ChatWindowSize.Y.Scale * l_chatWindowSettings_0.HeightScale)
    }, {
        uiSizeConstraint = v3.createElement("UISizeConstraint", {
            MaxSize = Vector2.new(v6.ChatWindowMaxWidth, math.huge)
        }),
        layout = v3.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder,
            VerticalAlignment = v22.props.chatLayoutAlignment.UIListLayoutVerticalAlignment
        }),
        topBorder = v3.createElement("ImageLabel", {
            BackgroundTransparency = 1,
            Image = "rbxasset://textures/ui/TopRoundedRect8px.png",
            ImageColor3 = v25,
            ImageTransparency = v22.transparencyValue:map(function(v26)
                local l_v24_0 = v24;
                return l_v24_0 + v26 * (1 - l_v24_0);
            end),
            LayoutOrder = 1,
            ScaleType = Enum.ScaleType.Slice,
            Size = UDim2.new(1, 0, 0, 8),
            SliceCenter = Rect.new(8, 8, 24, 32),
            Visible = v22.props.isChatWindowVisible or v22.props.isChatInputBarVisible,
            [v3.Event.MouseEnter] = v22.props.onHovered,
            [v3.Event.MouseLeave] = v22.props.onUnhovered
        }, {
            uiSizeConstraint = v3.createElement("UISizeConstraint", {
                MaxSize = Vector2.new(v6.ChatWindowMaxWidth, math.huge)
            })
        }),
        chatWindow = v3.createElement(v5, {
            LayoutOrder = 2,
            size = UDim2.fromScale(1, 1),
            transparencyValue = v22.transparencyValue,
            textTransparency = v22.textTransparencyValue,
            onHovered = v22.props.onHovered,
            onUnhovered = v22.props.onUnhovered,
            mutedUserIds = v22.props.mutedUserIds,
            canLocalUserChat = v22.props.canLocalUserChat,
            activateWhisperMode = v22.props.activateWhisperMode,
            resetTargetChannel = v22.props.resetTargetChannel,
            visible = v22.props.isChatWindowVisible,
            onAbsoluteSizeChanged = v22.onAbsoluteSizeChanged,
            onAbsolutePositionChanged = v22.onAbsolutePositionChanged,
            chatWindowSettings = l_chatWindowSettings_0,
            showTranslationButton = v22.props.showTranslationButton
        }),
        chatInputBar = v3.createElement(v4, {
            LayoutOrder = 3,
            addTopPadding = v22.props.isChatWindowVisible,
            onSendChat = v22.props.onSendChat,
            transparencyValue = v22.transparencyValue,
            canLocalUserChat = v22.props.canLocalUserChat,
            resetTargetChannel = v22.props.resetTargetChannel,
            visible = v22.props.isChatInputBarVisible,
            onAbsoluteSizeChanged = v22.onAbsoluteSizeChanged,
            onAbsolutePositionChanged = v22.onAbsolutePositionChanged,
            chatWindowSettings = l_chatWindowSettings_0
        }),
        bottomBorder = v3.createElement("ImageLabel", {
            BackgroundTransparency = 1,
            Image = "rbxasset://textures/ui/BottomRoundedRect8px.png",
            ImageColor3 = v25,
            ImageTransparency = v22.transparencyValue:map(function(v28)
                local l_v24_1 = v24;
                return l_v24_1 + v28 * (1 - l_v24_1);
            end),
            LayoutOrder = 4,
            ScaleType = Enum.ScaleType.Slice,
            Size = UDim2.new(1, 0, 0, 8),
            SliceCenter = Rect.new(8, 0, 24, 16),
            Visible = v22.props.isChatWindowVisible or v22.props.isChatInputBarVisible,
            [v3.Event.MouseEnter] = v22.props.onHovered,
            [v3.Event.MouseLeave] = v22.props.onUnhovered
        }, {
            uiSizeConstraint = v3.createElement("UISizeConstraint", {
                MaxSize = Vector2.new(v6.ChatWindowMaxWidth, math.huge)
            })
        })
    });
end;
v9.willUnmount = function(v30)
    v30.backgroundTransparencyMotor:destroy();
    v30.textTransparencyMotor:destroy();
end;
return v9;


local function v3(v0)
    local v1 = string.split(v0, "/");
    for v2 = #v1, 1, -1 do
        if v1[v2] == "" then
            table.remove(v1, v2);
        end;
    end;
    return v1;
end;
local _ = function(v4, v5)
    local v6 = 0;
    for _ in pairs(v4) do
        v6 = v6 + 1;
    end;
    assert(v6 <= v5, v6);
    return v6 == v5;
end;
local function v9(v10, v11)
    if v10.instance == nil then
        return ;
    else
        v10.instance = nil;
        local l_connections_0 = v10.connections;
        if l_connections_0 then
            for _, v14 in ipairs(l_connections_0) do
                v14:Disconnect();
            end;
            table.clear(l_connections_0);
        end;
        if not (not v11 or not v10.alias) then
            v11[v10.alias] = nil;
        end;
        local l_children_0 = v10.children;
        if l_children_0 then
            for _, v17 in pairs(l_children_0) do
                v9(v17, v11);
            end;
        end;
        return ;
    end;
end;
local v18 = {};
v18.__index = v18;
v18.new = function(v19, v20)
    local v21 = {};
    local v22 = {};
    local v23 = {};
    local v24 = {};
    local v25 = {};
    local v26 = 1;
    for v27, v28 in pairs(v19) do
        v25[v27] = v3(v28);
        v26 = v26 + 1;
    end;
    return (setmetatable({
        _boundFn = v20,
        _parsedManifest = v25,
        _manifestSizeTarget = v26,
        _dtorMap = v21,
        _connections = v22,
        _rootInstToRootNode = v23,
        _rootInstToManifest = v24
    }, v18));
end;
v18._startBoundFn = function(v29, v30, v31)
    local l__boundFn_0 = v29._boundFn;
    local l__dtorMap_0 = v29._dtorMap;
    local v34 = l__dtorMap_0[v30];
    if v34 then
        v34();
        l__dtorMap_0[v30] = nil;
    end;
    local v35 = l__boundFn_0(v31);
    if v35 then
        l__dtorMap_0[v30] = v35;
    end;
end;
v18._stopBoundFn = function(v36, v37)
    local l__dtorMap_1 = v36._dtorMap;
    local v39 = l__dtorMap_1[v37];
    if v39 then
        v39();
        l__dtorMap_1[v37] = nil;
    end;
end;
v18.bindRoot = function(v40, v41)
    debug.profilebegin("AtomicBinding:BindRoot");
    local l__parsedManifest_0 = v40._parsedManifest;
    local l__rootInstToRootNode_0 = v40._rootInstToRootNode;
    local l__rootInstToManifest_0 = v40._rootInstToManifest;
    local l__manifestSizeTarget_0 = v40._manifestSizeTarget;
    assert(l__rootInstToManifest_0[v41] == nil, "rootInstToManifest is nil");
    local v46 = {};
    l__rootInstToManifest_0[v41] = v46;
    debug.profilebegin("BuildTree");
    local v47 = {
        alias = "root",
        instance = v41
    };
    if next(l__parsedManifest_0) then
        v47.children = {};
        v47.connections = {};
    end;
    l__rootInstToRootNode_0[v41] = v47;
    for v48, v49 in pairs(l__parsedManifest_0) do
        local l_v47_0 = v47;
        for v51, v52 in ipairs(v49) do
            local v53 = v51 == #v49;
            local v54 = l_v47_0.children[v52] or {};
            if not v53 then
                v54.children = v54.children or {};
                v54.connections = v54.connections or {};
            else
                if v54.alias ~= nil then
                    error("Multiple aliases assigned to one instance");
                end;
                v54.alias = v48;
            end;
            l_v47_0.children[v52] = v54;
            l_v47_0 = v54;
        end;
    end;
    debug.profileend();
    local function v55(v56)
        local v57 = assert(v56.instance, "instance does not exist");
        local l_children_1 = v56.children;
        local l_alias_0 = v56.alias;
        local v60 = not l_children_1;
        if l_alias_0 then
            v46[l_alias_0] = v57;
        end;
        if not v60 then
            local function v63(v61)
                local v62 = l_children_1[v61.Name];
                if not v62 or v62.instance ~= nil then
                    return ;
                else
                    v62.instance = v61;
                    v55(v62);
                    return ;
                end;
            end;
            local function v69(v64)
                local l_Name_0 = v64.Name;
                local v66 = l_children_1[l_Name_0];
                if v66 then
                    if v66.instance ~= v64 then
                        return ;
                    else
                        v40:_stopBoundFn(v41);
                        v9(v66, v46);
                        assert(v66.instance == nil, "unbindNodeDescend failed");
                        local l_v57_FirstChild_0 = v57:FindFirstChild(l_Name_0);
                        if l_v57_FirstChild_0 then
                            local v68 = l_children_1[l_v57_FirstChild_0.Name];
                            if v68 then
                                if v68.instance ~= nil then
                                    return ;
                                else
                                    v68.instance = l_v57_FirstChild_0;
                                    v55(v68);
                                end;
                            end;
                        end;
                        return ;
                    end;
                else
                    return ;
                end;
            end;
            for _, v71 in ipairs(v57:GetChildren()) do
                local v72 = l_children_1[v71.Name];
                if not (not v72 or v72.instance ~= nil) then
                    v72.instance = v71;
                    v55(v72);
                end;
            end;
            table.insert(v56.connections, v57.ChildAdded:Connect(v63));
            table.insert(v56.connections, v57.ChildRemoved:Connect(v69));
        end;
        if v60 then
            local l_v46_0 = v46;
            local l_l__manifestSizeTarget_0_0 = l__manifestSizeTarget_0;
            local v75 = 0;
            for _ in pairs(l_v46_0) do
                v75 = v75 + 1;
            end;
            assert(v75 <= l_l__manifestSizeTarget_0_0, v75);
            if v75 == l_l__manifestSizeTarget_0_0 then
                v40:_startBoundFn(v41, v46);
            end;
        end;
    end;
    debug.profilebegin("ResolveTree");
    v55(v47);
    debug.profileend();
    debug.profileend();
end;
v18.unbindRoot = function(v77, v78)
    local l__rootInstToRootNode_1 = v77._rootInstToRootNode;
    local l__rootInstToManifest_1 = v77._rootInstToManifest;
    v77:_stopBoundFn(v78);
    local v81 = l__rootInstToRootNode_1[v78];
    if v81 then
        v9(v81, (assert(l__rootInstToManifest_1[v78], "rootInstToManifest is nil")));
        l__rootInstToRootNode_1[v78] = nil;
    end;
    l__rootInstToManifest_1[v78] = nil;
end;
v18.destroy = function(v82)
    debug.profilebegin("AtomicBinding:destroy");
    for _, v84 in pairs(v82._dtorMap) do
        v84:destroy();
    end;
    table.clear(v82._dtorMap);
    for _, v86 in ipairs(v82._connections) do
        v86:Disconnect();
    end;
    table.clear(v82._connections);
    local l__rootInstToManifest_2 = v82._rootInstToManifest;
    for v88, v89 in pairs(v82._rootInstToRootNode) do
        v9(v89, (assert(l__rootInstToManifest_2[v88], "rootInstToManifest is nil")));
    end;
    table.clear(v82._rootInstToManifest);
    table.clear(v82._rootInstToRootNode);
    debug.profileend();
end;
return v18;


local v0 = require(script:FindFirstAncestor("Autocomplete").Trie.Trie);
local v1 = {};
v1.__index = v1;
v1.new = function(v2)
    local v3 = {};
    setmetatable(v3, v1);
    v3.trie = v0.new();
    v3.trie = v2(v3);
    return v3;
end;
v1.getResults = function(v4, v5, v6)
    local v7 = v4.trie:autocomplete(v5);
    if not v6 then
        return v7;
    else
        return v6(v7);
    end;
end;
return v1;


local l_TextChatService_0 = game:GetService("TextChatService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_List_0 = require(l_script_FirstAncestor_0.Parent.llama).List;
local v3 = require(l_script_FirstAncestor_0.Flags.getTextChatServiceTextChatCommandAutocompleteVisible);
local function v7()
    local v4 = {};
    for _, v6 in ipairs((l_TextChatService_0:GetDescendants())) do
        if not v3() then
            if v6.ClassName == "TextChatCommand" and string.sub(v6.PrimaryAlias, 1, 1) == "/" then
                table.insert(v4, v6.PrimaryAlias);
            end;
        elseif not (not (v6.ClassName == "TextChatCommand") or not v6.AutocompleteVisible) and string.sub(v6.PrimaryAlias, 1, 1) == "/" then
            table.insert(v4, v6.PrimaryAlias);
        end;
    end;
    return v4;
end;
return function(v8)
    l_List_0.map(v7(), function(v9)
        v8.trie:insert(v9);
    end);
    return v8.trie;
end;


local l_Parent_0 = script:FindFirstAncestor("ExpChat").Parent;
local l_List_0 = require(l_Parent_0.llama).List;
local v2 = require(l_Parent_0.llama).Dictionary.keys((require(l_Parent_0.EmojiList)));
return function(v3)
    l_List_0.map(v2, function(v4)
        v3.trie:insert(v4);
    end);
    return v3.trie;
end;


local l_List_0 = require(script:FindFirstAncestor("ExpChat").Parent.llama).List;
return function(v1)
    return l_List_0.sort(v1);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local l_List_0 = require(l_Parent_0.llama).List;
local v3 = require(l_Parent_0.EmojiList);
local v4 = require(l_script_FirstAncestor_0.Flags.FFlagSortAutocompleteByPopularity);
return function(v5)
    if not v4() then
        return l_List_0.sort(v5);
    else
        return l_List_0.sort(v5, function(v6, v7)
            if v3[v6].popularity == v3[v7].popularity then
                return v6 < v7;
            else
                return v3[v6].popularity < v3[v7].popularity;
            end;
        end);
    end;
end;


local l_Parent_0 = script:FindFirstAncestor("ExpChat").Parent;
local l_script_FirstAncestor_0 = script:FindFirstAncestor("Autocomplete");
local l_List_0 = require(l_Parent_0.llama).List;
local v3 = require(l_script_FirstAncestor_0.Trie.TrieNode);
local v4 = {};
v4.__index = v4;
v4.new = function()
    local v5 = {};
    setmetatable(v5, v4);
    v5.root = v3.new("");
    return v5;
end;
v4.insert = function(v6, v7)
    local l_root_0 = v6.root;
    for v9 = 1, #v7 do
        local v10 = string.sub(v7, v9, v9);
        if not l_root_0.children[v10] then
            l_root_0.children[v10] = v3.new(v10);
        end;
        l_root_0 = l_root_0.children[v10];
    end;
    l_root_0.isEndOfWord = true;
end;
v4.autocomplete = function(v11, v12)
    local v13 = {};
    local l_root_1 = v11.root;
    for v15 = 1, #v12 do
        local v16 = string.sub(v12, v15, v15);
        if not l_root_1.children[v16] then
            return v13;
        else
            l_root_1 = l_root_1.children[v16];
        end;
    end;
    return (v11:helper(l_root_1, v13, (string.sub(v12, 1, #v12 - 1))));
end;
v4.helper = function(v17, v18, v19, v20)
    if v18.isEndOfWord then
        v19 = l_List_0.push(v19, v20 .. v18.data);
    end;
    for _, v22 in pairs(v18.children) do
        v19 = v17:helper(v22, v19, v20 .. v18.data);
    end;
    return v19;
end;
return v4;


local v0 = {};
v0.__index = v0;
v0.new = function(v1)
    local v2 = {};
    setmetatable(v2, v0);
    v2.children = {};
    v2.isEndOfWord = false;
    v2.data = v1;
    return v2;
end;
return v0;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local v1 = require(l_script_FirstAncestor_0.Logger):new("ExpChat/" .. script.Name);
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v3 = require(l_Parent_0.Roact);
local v4 = require(l_Parent_0.RoactRodux);
local l_List_0 = require(l_Parent_0.llama).List;
local v6 = require(l_Parent_0.Otter);
local l_Players_0 = game:GetService("Players");
local l_RunService_0 = game:GetService("RunService");
local l_StarterGui_0 = game:GetService("StarterGui");
local l_VRService_0 = game:GetService("VRService");
local v11 = require(l_script_FirstAncestor_0.memoize);
local l_script_FirstAncestor_1 = script:FindFirstAncestor("BubbleChat");
local v13 = require(l_script_FirstAncestor_1.VoiceIndicator);
local v14 = require(l_script_FirstAncestor_1.BlankBubble);
local v15 = require(l_script_FirstAncestor_1.BubbleChatList);
local v16 = require(l_script_FirstAncestor_1.ChatBubbleDistant);
local v17 = require(l_script_FirstAncestor_0.GlobalFlags);
local v18 = require(l_script_FirstAncestor_1.Helpers.getSettingsForMessage);
local v19 = game:DefineFastFlag("SelfViewNoApi", false);
local v20 = require(l_script_FirstAncestor_0.Flags.getFFlagHideLocalPlayerControlBubbleForVR);
local v21 = require(l_script_FirstAncestor_1.PlayerButtons);
local v22 = require(l_script_FirstAncestor_0.IXPServiceWrapper);
local v23 = game:DefineFastFlag("EasierUnmutingTCS4", false);
local v24 = game:DefineFastFlag("EasierUnmutingBasedOnCameraTCS", false);
local v25 = game:DefineFastFlag("EasierUnmutingHideIfMutedTCS", false);
local v26 = game:DefineFastInt("EasierUnmutingDisplayDistanceTCS", 20);
local v27 = game:DefineFastString("EasierUnmutingIXPLayerNameTCS", "Voice.UserAgency");
local v28 = game:DefineFastString("EasierUnmutingIXPLayerValueTCS", "VoiceUserAgencyEnabled");
local v29 = game:DefineFastFlag("FixTimestampNowComparisonForChatMessages", false);
local v30 = require(l_script_FirstAncestor_0.Flags.getFFlagEnableExperienceChatOptimizations);
local v31 = game:DefineFastInt("ExperienceChatHeartbeatIncrement", 5);
local v32 = require(l_script_FirstAncestor_0.Flags.getFFlagFixBubbleChatTailVisible);
local v33 = Vector2.new(28, 28);
local v34 = v3.PureComponent:extend("BubbleChatBillboard");
local v35 = {
    dampingRatio = 1,
    frequency = 4
};
getEasierUnmutingDistance = function(v36, v37)
    local v38 = workspace.CurrentCamera and workspace.CurrentCamera.CFrame.Position;
    if (not v24 and v37 or not v36) or not v38 then
        if not v36 or not v37 then
            return nil;
        else
            return (v36 - v37).Magnitude;
        end;
    else
        return (v36 - v38).Magnitude;
    end;
end;
v34.isShowingDueToEasierUnmuting = function(v39)
    local l_v23_0 = v23;
    if l_v23_0 then
        l_v23_0 = v39.state.isInEasierUnmutingTreatment;
        if l_v23_0 then
            l_v23_0 = false;
            if v39.props.voiceState == "LOCAL_MUTED" then
                l_v23_0 = v39.state.isInsideEasierUnmutingDistance and not (v25 and v39.props.isMuted);
            end;
        end;
    end;
    return l_v23_0;
end;
v34.init = function(v41)
    local v42 = nil;
    local v43 = nil;
    if v17.AvatarChatEnabled then
        v42 = v41.props.selfViewListenerChanged.getSelfViewVisibility();
        v43 = (v19 or l_StarterGui_0:GetCoreGuiEnabled(Enum.CoreGuiType.All)) or l_StarterGui_0:GetCoreGuiEnabled(Enum.CoreGuiType.SelfView);
    end;
    v41:setState({
        isInsideRenderDistance = false,
        isInsideMaximizeDistance = false,
        isInsideEasierUnmutingDistance = if not v23 then nil else false,
        savedChatSettings = v41.props.chatSettings,
        selfViewOpen = v42,
        selfViewEnabled = v43,
        voiceTimedOut = false,
        voiceStateCounter = 0,
        lastVoiceState = nil,
        isInEasierUnmutingTreatment = if not v23 then nil else false,
        haveLoggedUserExposure = if not v23 then nil else false
    });
    v41.isMounted = false;
    local v44, v45 = v3.createBinding((Vector3.new()));
    v41.offset = v44;
    v41.updateOffset = v45;
    v41.offsetMotor = v6.createSingleMotor(0);
    v41.offsetMotor:onStep(function(v46)
        v41.updateOffset((Vector3.new(0, v46, 0)));
    end);
    v41.offsetGoal = 0;
    if v30() then
        v41.heartbeatCount = 0;
    end;
    v41.onLastBubbleFadeOut = function()
        if not (not v41.props.onFadeOut or v41.isFadingOut) then
            v41.isFadingOut = true;
            v41.props.onFadeOut(v41.props.userId);
        end;
    end;
    v41.wrappedOnClickVoiceIndicator = function(v47, v48)
        return v41.props.onClickedVoiceIndicator(v47, v48, not v41:isShowingDueToEasierUnmuting() and "bubblechat" or "easierunmuting");
    end;
    v44 = l_Players_0.LocalPlayer;
    v45 = not v44 and "SpeakerDark" or (v41.props.userId ~= tostring(v44.UserId) and "SpeakerDark" or "MicDark");
    v41.renderInsert = function()
        return v3.createElement(v13, {
            userId = v41.props.userId,
            getIcon = v41.props.getIconVoiceIndicator,
            onClicked = v41.wrappedOnClickVoiceIndicator,
            iconStyle = v45
        });
    end;
    if v17.AvatarChatEnabled then
        local l_selfViewVisibilityUpdatedSignal_0 = v41.props.selfViewListenerChanged.selfViewVisibilityUpdatedSignal;
        local l_getSelfViewVisibility_0 = v41.props.selfViewListenerChanged.getSelfViewVisibility;
        local l_l_getSelfViewVisibility_0_0 = l_getSelfViewVisibility_0 --[[ copy: 6 -> 7 ]];
        v41.selfViewConnection = l_selfViewVisibilityUpdatedSignal_0:connect(function()
            v41:setState({
                selfViewOpen = l_l_getSelfViewVisibility_0_0()
            });
        end);
    end;
    if v23 then
        local l_status_0, l_result_0 = pcall(function()
            return v22:GetLayerData(v27);
        end);
        if not ((not l_status_0 or not l_result_0) or not l_result_0[v28]) then
            v41:setState({
                isInEasierUnmutingTreatment = true
            });
        end;
    end;
end;
v34.checkCounterForTimeout = function(v54, v55)
    if ((l_Players_0.LocalPlayer and v54.props.userId ~= tostring(l_Players_0.LocalPlayer.UserId)) and v54.state.lastVoiceState ~= "Talking") and v54.state.voiceStateCounter ~= v55 then
        local l_voiceStateCounter_0 = v54.state.voiceStateCounter;
        delay(1, function()
            if not (not (v54.state.voiceStateCounter == l_voiceStateCounter_0) or not v54.isMounted) then
                v54:setState({
                    voiceTimedOut = true
                });
            end;
        end);
    end;
end;
v34.checkCounterForTimeoutWithEasierUnmuting = function(v57, v58)
    local v59 = if not v58 then nil else v58.voiceStateCounter;
    if v23 and v57.state.isInEasierUnmutingTreatment then
        local v60 = not not l_Players_0.LocalPlayer and v57.props.userId ~= tostring(l_Players_0.LocalPlayer.UserId);
        local v61 = v57.state.voiceStateCounter ~= v59;
        local v62 = false;
        if v57.state.lastVoiceState ~= "Talking" then
            v62 = v57.state.lastVoiceState ~= "LOCAL_MUTED";
        end;
        if not ((not v60 or not v61) or not v62) then
            local l_voiceStateCounter_1 = v57.state.voiceStateCounter;
            delay(1, function()
                if not (not (v57.state.voiceStateCounter == l_voiceStateCounter_1) or not v57.isMounted) then
                    v57:setState({
                        voiceTimedOut = true
                    });
                end;
            end);
        end;
        return ;
    else
        return v57:checkCounterForTimeout(v59);
    end;
end;
v34.getVerticalOffset = function(v64)
    local l_adornee_0 = v64.props.adornee;
    if not l_adornee_0 or not l_adornee_0:IsA("Model") then
        if not l_adornee_0 or not l_adornee_0:IsA("BasePart") then
            return 0;
        else
            return l_adornee_0.Size.Y / 2;
        end;
    else
        local l_l_adornee_0_BoundingBox_0, v67 = l_adornee_0:GetBoundingBox();
        local v68 = getAdorneeInstance(v64.props.adornee, v64.state.savedChatSettings.AdorneeName);
        if v68 then
            if not v68:IsA("BasePart") then
                return 0;
            else
                return v67.Y / 2 - l_l_adornee_0_BoundingBox_0:PointToObjectSpace(v68.Position).Y;
            end;
        else
            return v67.Y / 2;
        end;
    end;
end;
getAdorneeInstance = function(v69, v70)
    if v69 then
        if not v69:IsA("Model") then
            if not (not v69:IsA("BasePart") and not v69:IsA("Attachment")) then
                return v69;
            end;
        else
            local v71 = v69:FindFirstChild(v70, true) or v69.PrimaryPart;
            if not (not (not v71 or v71:IsA("BasePart")) and not v71:IsA("Attachment")) then
                return v71;
            end;
        end;
        return nil;
    else
        return nil;
    end;
end;
v34.shouldRenderCaret = function(v72)
    return v72.state.savedChatSettings.TailVisible and not v72:shouldRenderPlayerButtons();
end;
v34.shouldRenderPlayerButtons = function(v73)
    if not v32() or v73.props.voiceEnabled then
        if not (not not l_Players_0.LocalPlayer and v73.props.userId == tostring(l_Players_0.LocalPlayer.UserId)) then
            local v74 = not v73.state.filteredMessages or #v73.state.filteredMessages == 0;
            if not (v73.props.voiceEnabled and not v73.state.voiceTimedOut) or v73.props.isBubbleChatEnabled and not v74 then
                return false;
            else
                return true;
            end;
        elseif not (v20() and l_VRService_0.VREnabled) and not v17.ChromeEnabled then
            if v73.state.selfViewOpen then
                return false;
            else
                return true;
            end;
        else
            return false;
        end;
    else
        return false;
    end;
end;
v34.render = function(v75)
    local v76 = getAdorneeInstance(v75.props.adornee, v75.state.savedChatSettings.AdorneeName);
    local v77 = not not l_Players_0.LocalPlayer and v75.props.userId == tostring(l_Players_0.LocalPlayer.UserId);
    local l_savedChatSettings_0 = v75.state.savedChatSettings;
    if v76 then
        if v75.state.isInsideRenderDistance then
            if not (not (not v23 or not v75.state.isInEasierUnmutingTreatment) and v75.props.voiceState == "LOCAL_MUTED") or v75.state.isInsideEasierUnmutingDistance and (not v25 or not v75.props.isMuted) then
                local v79 = {};
                local v80 = v75.state.filteredMessages and #v75.state.filteredMessages > 0;
                local v81 = v75.props.voiceEnabled and not v75.state.voiceTimedOut;
                if not (not v17.AvatarChatEnabled or not v77) then
                    v81 = v81 and not v75.state.selfViewOpen;
                end;
                if not (not v17.ChromeEnabled or not v77) then
                    v81 = false;
                end;
                local v82 = v81 and not v17.AvatarChatEnabled;
                local v83 = if not v81 then nil else v75.renderInsert;
                local l_v33_0 = v33;
                local l_clientSettings_0 = v75.props.clientSettings;
                if not v17.AvatarChatEnabled and not v17.ChromeEnabled then
                    if v81 and v80 == false then
                        v79.VoiceBubble = v3.createElement(v14, {
                            chatSettings = l_savedChatSettings_0,
                            userId = v75.props.userId,
                            renderInsert = v83,
                            insertSize = l_v33_0,
                            isDistant = not v75.state.isInsideMaximizeDistance,
                            clientSettings = l_clientSettings_0
                        });
                    end;
                elseif v75:shouldRenderPlayerButtons() then
                    v79.PlayerButtons = v3.createElement(v21, {
                        chatSettings = v75.props.chatSettings,
                        isInsideMaximizeDistance = v75.state.isInsideMaximizeDistance,
                        LayoutOrder = 2,
                        isLocalPlayer = v77,
                        userId = v75.props.userId,
                        getIcon = v75.props.getIconVoiceIndicator,
                        hasCameraPermissions = v75.props.hasCameraPermissions,
                        hasMicPermissions = v75.props.hasMicPermissions,
                        onClickedVoiceIndicator = v75.wrappedOnClickVoiceIndicator,
                        onClickedCameraIndicator = v75.props.onClickedCameraIndicator,
                        voiceEnabled = v75.props.voiceEnabled,
                        displayCameraDeniedToast = v75.props.displayCameraDeniedToast,
                        isCamEnabledForUserAndPlace = v75.props.isCamEnabledForUserAndPlace,
                        setCameraPermissionStateFromControl = v75.props.setCameraPermissionStateFromControl,
                        getPermissions = v75.props.getPermissions,
                        isCameraOnlyUser = v75.props.isCameraOnlyUser,
                        isVoiceServiceInitialized = v75.props.isVoiceServiceInitialized
                    });
                    v79.listLayout = v3.createElement("UIListLayout", {
                        SortOrder = Enum.SortOrder.LayoutOrder,
                        HorizontalAlignment = Enum.HorizontalAlignment.Center,
                        VerticalAlignment = Enum.VerticalAlignment.Bottom,
                        Padding = UDim.new(0, 8)
                    });
                    v79.padding = v3.createElement("UIPadding", {
                        PaddingBottom = UDim.new(0, 8)
                    });
                end;
                local v86 = if not v32() then nil else v75:shouldRenderCaret();
                if not v75.state.isInsideMaximizeDistance then
                    if v80 then
                        v79.DistantBubble = v3.createElement(v16, {
                            fadingOut = not v75.state.filteredMessages or #v75.state.filteredMessages == 0,
                            onFadeOut = v75.onLastBubbleFadeOut,
                            chatSettings = l_savedChatSettings_0,
                            renderInsert = if not v82 then nil else v83,
                            insertSize = l_v33_0,
                            clientSettings = l_clientSettings_0,
                            showCaret = v86
                        });
                    end;
                else
                    v79.BubbleChatList = v3.createElement(v15, {
                        userId = v75.props.userId,
                        isVisible = v75.state.isInsideMaximizeDistance,
                        onLastBubbleFadeOut = v75.onLastBubbleFadeOut,
                        chatSettings = l_savedChatSettings_0,
                        renderFirstInsert = if not v82 then nil else v83,
                        insertSize = l_v33_0,
                        messages = v75.state.filteredMessages,
                        clientSettings = l_clientSettings_0,
                        isTextChatServiceOn = v75.props.isTextChatServiceOn,
                        showCaret = v86
                    });
                end;
                return v3.createElement("BillboardGui", {
                    Adornee = v76,
                    Active = if not v17.AvatarChatEnabled then v81 else v75:shouldRenderPlayerButtons(),
                    Size = UDim2.fromOffset(500, 200),
                    SizeOffset = Vector2.new(0, 0.5),
                    StudsOffset = (not not v77 and l_savedChatSettings_0.LocalPlayerStudsOffset or Vector3.new(0, 1, 0.1)) + Vector3.new(0, l_savedChatSettings_0.VerticalStudsOffset, 0),
                    StudsOffsetWorldSpace = v75.offset,
                    ResetOnSpawn = false
                }, v79);
            else
                v1:trace("Unmute toggle not applicable for {}", v75.state.shortId);
                return ;
            end;
        else
            v1:trace("Not in range for {}", v75.state.shortId);
            return ;
        end;
    else
        v1:trace("No adornee for {}", v75.state.shortId);
        return ;
    end;
end;
v34.didUpdate = function(v87, _, v89)
    if not (not (not v87.state.filteredMessages or #v87.state.filteredMessages == 0) or v87.state.isInsideRenderDistance) then
        v87.onLastBubbleFadeOut();
    end;
    if v87.state.filteredMessages and #v87.state.filteredMessages > 0 then
        v87.isFadingOut = false;
    end;
    if not v23 or not v87.state.isInEasierUnmutingTreatment then
        v87:checkCounterForTimeout(v89.voiceStateCounter);
    else
        v87:checkCounterForTimeoutWithEasierUnmuting(v89);
    end;
    local v90 = v87.props.userId == tostring(not l_Players_0.LocalPlayer and 0 or l_Players_0.LocalPlayer.UserId);
    if not ((not v23 or not v90) or v87.state.haveLoggedUserExposure) and (not (v87.props.voiceState ~= "Inactive" and v87.props.voiceState ~= "Talking") or v87.props.voiceState == "Muted") then
        v22:LogUserLayerExposure(v27);
        v87:setState({
            haveLoggedUserExposure = true
        });
    end;
end;
local function v98(v91, v92, v93)
    local v94 = not not v29 and workspace:GetServerTimeNow() * 1000 or DateTime.now().UnixTimestampMillis;
    return l_List_0.filter(v91, function(v95, v96)
        if not v95.isVisibleInBubbleChat then
            return false;
        else
            local v97 = false;
            if #v91 - v93 < v96 then
                v97 = v94 - v95.timestamp.UnixTimestampMillis < v92;
            end;
            return v97;
        end;
    end);
end;
v34.didMount = function(v99)
    v99.isMounted = true;
    local v100 = v99:getVerticalOffset();
    v99.offsetGoal = v100;
    v99.offsetMotor:setGoal(v6.instant(v100));
    v99.heartbeatConn = l_RunService_0.Heartbeat:Connect(function()
        if not (not v30() or v99.props.tests_skipHeartbeatCheck) then
            if v99.heartbeatCount < v31 then
                local l_v99_0 = v99;
                l_v99_0.heartbeatCount = l_v99_0.heartbeatCount + 1;
                return ;
            else
                v99.heartbeatCount = 0;
            end;
        end;
        local v102 = getAdorneeInstance(v99.props.adornee, v99.state.savedChatSettings.AdorneeName);
        if not (not workspace.CurrentCamera or not v102) then
            local v103 = if not v102:IsA("Attachment") then v102.Position else v102.WorldPosition;
            local l_Magnitude_0 = (workspace.CurrentCamera.CFrame.Position - v103).Magnitude;
            local v105 = l_Magnitude_0 < v99.state.savedChatSettings.MaxDistance;
            local v106 = l_Magnitude_0 < v99.state.savedChatSettings.MinimizeDistance;
            local v107 = false;
            if not (not v23 or not v99.state.isInEasierUnmutingTreatment) then
                local v108 = nil;
                local v109 = getAdorneeInstance(v99.props.localAdornee, v99.state.savedChatSettings.AdorneeName);
                if v109 then
                    v108 = if not v109:IsA("Attachment") then v109.Position else v109.WorldPosition;
                end;
                local v110 = getEasierUnmutingDistance(v103, v108);
                if v110 ~= nil then
                    v107 = v110 < v26;
                end;
            end;
            if not (v106 == v99.state.isInsideMaximizeDistance and v105 == v99.state.isInsideRenderDistance) or not (not v23 or not v99.state.isInEasierUnmutingTreatment) and v107 ~= v99.state.isInsideEasierUnmutingDistance then
                v99:setState({
                    isInsideRenderDistance = v105,
                    isInsideMaximizeDistance = v106,
                    isInsideEasierUnmutingDistance = v107
                });
            end;
        end;
        local v111 = v99:getVerticalOffset();
        if math.abs(v111 - v99.offsetGoal) > 0.5 then
            v99.offsetGoal = v111;
            v99.offsetMotor:setGoal(v6.spring(v111, v35));
        end;
        local v112 = not not v29 and workspace:GetServerTimeNow() * 1000 or DateTime.now().UnixTimestampMillis;
        local v113 = v99.state.savedChatSettings.BubbleDuration * 1000;
        for _, v115 in ipairs(v99.state.filteredMessages) do
            if v113 <= v112 - v115.timestamp.UnixTimestampMillis then
                v99:setState(function(v116)
                    return {
                        filteredMessages = v98(v116.filteredMessages, v113, v99.props.chatSettings.MaxBubbles)
                    };
                end);
                return ;
            end;
        end;
    end);
    if not v23 or not v99.state.isInEasierUnmutingTreatment then
        v99:checkCounterForTimeout(nil);
        return ;
    else
        v99:checkCounterForTimeoutWithEasierUnmuting(nil);
        return ;
    end;
end;
v34.willUnmount = function(v117)
    v1:trace("Unmounting billboards for {}", v117.state.shortId);
    v117.isMounted = false;
    if v117.characterConn then
        v117.characterConn:Disconnect();
        v117.characterConn = nil;
    end;
    if v117.heartbeatConn then
        v117.heartbeatConn:Disconnect();
        v117.heartbeatConn = nil;
    end;
    if v117.humanoidDiedConn then
        v117.humanoidDiedConn:Disconnect();
        v117.humanoidDiedConn = nil;
    end;
    if v117.selfViewConnection then
        v117.selfViewConnection:disconnect();
        v117.selfViewConnection = nil;
    end;
    v117.offsetMotor:destroy();
end;
v34.getDerivedStateFromProps = function(v118, v119)
    local v120 = "..." .. string.sub(tostring(v118.userId), -4);
    local v121 = nil;
    local v122 = nil;
    local v123 = nil;
    if v119.lastVoiceState ~= v118.voiceState then
        v122 = (v119.voiceStateCounter or 0) + 1;
        v123 = false;
        v121 = v118.voiceState;
    end;
    return {
        savedChatSettings = v118.lastMessage and v118.chatSettings,
        shortId = v120,
        filteredMessages = v98(v118.messages, v119.savedChatSettings.BubbleDuration * 1000, v119.savedChatSettings.MaxBubbles),
        voiceStateCounter = v122,
        voiceTimedOut = v123,
        lastVoiceState = v121
    };
end;
local v127 = v11(function(v124, v125)
    return l_List_0.map(v124.bubbleMessagesInOrderBySenderId[v125] or {}, function(v126)
        return v124.byMessageId[v126];
    end);
end);
return v4.connect(function(v128, v129)
    local v130 = v127(v128.Messages, v129.userId);
    local v131 = v130[#v130];
    local v132 = not l_Players_0.LocalPlayer and "" or tostring(l_Players_0.LocalPlayer.UserId);
    local _ = nil;
    return {
        messages = v130,
        lastMessage = v131,
        chatSettings = if not v129.isTextChatServiceOn then v18(v128.LegacyBubbleChatSettings, v131) else v128.BubbleChatSettings,
        adornee = v128.Adornees[v129.userId] or v129.partOrModel,
        clientSettings = v128.ClientSettings,
        isMuted = v128.Voice.participantsMuted[v129.userId] or false,
        localAdornee = if not v23 then nil else v128.Adornees[v132]
    };
end)(v34);


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local v1 = require(l_script_FirstAncestor_0.Logger):new("ExpChat/" .. script.Name);
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local l_CorePackages_0 = game:GetService("CorePackages");
local v4 = require(l_Parent_0.React);
local l_List_0 = require(l_Parent_0.llama).List;
local v6 = require(l_Parent_0.Otter);
local l_useSelector_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.RoactRodux.useSelector;
local l_Players_0 = game:GetService("Players");
local l_RunService_0 = game:GetService("RunService");
local l_VRService_0 = game:GetService("VRService");
local l_Workspace_0 = game:GetService("Workspace");
local l_script_FirstAncestor_1 = script:FindFirstAncestor("BubbleChat");
local v13 = require(l_script_FirstAncestor_1.VoiceIndicator);
local v14 = require(l_script_FirstAncestor_1.BlankBubble);
local v15 = require(l_script_FirstAncestor_1.BubbleChatList);
local v16 = require(l_script_FirstAncestor_1.ChatBubbleDistant);
local v17 = require(l_script_FirstAncestor_0.GlobalFlags);
local v18 = require(l_script_FirstAncestor_1.Helpers.getSettingsForMessage);
local v19 = require(l_script_FirstAncestor_0.Flags.getFFlagHideLocalPlayerControlBubbleForVR);
local v20 = require(l_script_FirstAncestor_1.PlayerButtons);
local _ = require(l_script_FirstAncestor_0.Actions.VoiceStateChanged);
local v22 = require(l_script_FirstAncestor_0.IXPServiceWrapper);
local v23 = game:DefineFastFlag("EasierUnmutingTCS4", false);
local v24 = game:DefineFastFlag("EasierUnmutingBasedOnCameraTCS", false);
local v25 = game:DefineFastFlag("EasierUnmutingHideIfMutedTCS", false);
local v26 = game:DefineFastInt("EasierUnmutingDisplayDistanceTCS", 20);
local v27 = game:DefineFastString("EasierUnmutingIXPLayerNameTCS", "Voice.UserAgency");
local v28 = game:DefineFastString("EasierUnmutingIXPLayerValueTCS", "VoiceUserAgencyEnabled");
local v29 = game:DefineFastFlag("FixTimestampNowComparisonForChatMessages", false);
local v30 = game:DefineFastInt("ExperienceChatHeartbeatIncrement", 5);
local v31 = require(l_script_FirstAncestor_0.Flags.getFFlagFixBubbleChatTailVisible);
local v32 = Vector2.new(28, 28);
local v33 = {
    dampingRatio = 1,
    frequency = 4
};
getEasierUnmutingDistance = function(v34, v35)
    local v36 = l_Workspace_0.CurrentCamera and l_Workspace_0.CurrentCamera.CFrame.Position;
    if (not v24 and v35 or not v34) or not v36 then
        if not v34 or not v35 then
            return nil;
        else
            return (v34 - v35).Magnitude;
        end;
    else
        return (v34 - v36).Magnitude;
    end;
end;
getAdorneeInstance = function(v37, v38)
    if v37 then
        if not v37:IsA("Model") then
            if not (not v37:IsA("BasePart") and not v37:IsA("Attachment")) then
                return v37;
            end;
        else
            local v39 = v37:FindFirstChild(v38, true) or v37.PrimaryPart;
            if not (not (not v39 or v39:IsA("BasePart")) and not v39:IsA("Attachment")) then
                return v39;
            end;
        end;
        return nil;
    else
        return nil;
    end;
end;
local function v47(v40, v41, v42)
    local v43 = not not v29 and l_Workspace_0:GetServerTimeNow() * 1000 or DateTime.now().UnixTimestampMillis;
    return l_List_0.filter(v40, function(v44, v45)
        if not v44.isVisibleInBubbleChat then
            return false;
        else
            local v46 = false;
            if #v40 - v42 < v45 then
                v46 = v43 - v44.timestamp.UnixTimestampMillis < v41;
            end;
            return v46;
        end;
    end);
end;
local function _(v48)
    local v49 = nil;
    local v50 = v48 and v48.getSelfViewVisibility;
    if not (not v17.AvatarChatEnabled or not v50) then
        v49 = v50();
    end;
    return v49;
end;
return v4.memo(function(v52)
    local v54 = l_useSelector_0(function(v53)
        return v53.Messages;
    end);
    local v56 = v4.useMemo(function()
        return l_List_0.map(v54.bubbleMessagesInOrderBySenderId[v52.userId] or {}, function(v55)
            return v54.byMessageId[v55];
        end);
    end, {
        v54,
        v52.userId
    });
    local v57 = v4.useMemo(function()
        return v56[#v56];
    end, {
        v56
    });
    local v59 = l_useSelector_0(function(v58)
        if not v52.isTextChatServiceOn then
            return v18(v58.LegacyBubbleChatSettings, v57);
        else
            return v58.BubbleChatSettings;
        end;
    end);
    local v61 = l_useSelector_0(function(v60)
        return v60.Adornees[v52.userId] or v52.partOrModel;
    end);
    local v63 = l_useSelector_0(function(v62)
        return v62.ClientSettings;
    end);
    local v65 = l_useSelector_0(function(v64)
        return v64.Voice.participantsMuted[v52.userId] or false;
    end);
    local v66, v67 = v4.useState(false);
    local v68, v69 = v4.useState(false);
    local v70, v71 = v4.useState(v59);
    local l_useState_0 = v4.useState;
    local l_selfViewListenerChanged_0 = v52.selfViewListenerChanged;
    local v74 = nil;
    local v75 = l_selfViewListenerChanged_0 and l_selfViewListenerChanged_0.getSelfViewVisibility;
    if not (not v17.AvatarChatEnabled or not v75) then
        v74 = v75();
    end;
    local v76;
    l_useState_0, v76 = l_useState_0(v74);
    l_selfViewListenerChanged_0, v74 = v4.useState(false);
    local v77;
    v75, v77 = v4.useState(0);
    local v78, v79 = v4.useState(nil);
    local v80, v81 = v4.useState({});
    local l_LocalPlayer_0 = l_Players_0.LocalPlayer;
    local v83 = not not l_LocalPlayer_0 and v52.userId == tostring(l_LocalPlayer_0.UserId);
    local v84 = nil;
    local v85 = nil;
    local v86 = nil;
    local v87 = nil;
    local v88 = nil;
    local v89 = nil;
    if v23 then
        local v90, v91 = v4.useState(false);
        v84 = v90;
        v85 = v91;
        v90, v91 = v4.useState(false);
        v86 = v90;
        v87 = v91;
        v90, v91 = v4.useState(false);
        v88 = v90;
        v89 = v91;
    end;
    local v93 = v4.useCallback(function()
        local l_v23_0 = v23;
        if l_v23_0 then
            l_v23_0 = v86;
            if l_v23_0 then
                l_v23_0 = false;
                if v52.voiceState == "LOCAL_MUTED" then
                    l_v23_0 = v84 and not (v25 and v65);
                end;
            end;
        end;
        return l_v23_0;
    end, {
        v86,
        v52.voiceState,
        v84,
        v65
    });
    local v95 = l_useSelector_0(function(v94)
        if not v23 then
            return nil;
        else
            return v94.Adornees[not l_LocalPlayer_0 and "" or tostring(l_LocalPlayer_0.UserId)];
        end;
    end);
    local v96 = v4.useRef(false);
    local v97, v98 = v4.useBinding(Vector3.zero);
    local v99 = v4.useRef(nil);
    local v100 = v4.useRef(0);
    local v101 = v4.useRef(0);
    local v102 = v4.useCallback(function()
        if not (not v52.onFadeOut or v96.current) then
            v96.current = true;
            v52.onFadeOut(v52.userId);
        end;
    end, {
        v52.onFadeOut,
        v52.userId,
        v96.current
    });
    local v105 = v4.useCallback(function(v103, v104)
        return v52.onClickedVoiceIndicator(v103, v104, not v93() and "bubblechat" or "easierunmuting");
    end, {
        v52.onClickedVoiceIndicator
    });
    local v109 = v4.useCallback(function()
        if not v61 or not v61:IsA("Model") then
            if not v61 or not v61:IsA("BasePart") then
                return 0;
            else
                return v61.Size.Y / 2;
            end;
        else
            local l_v61_BoundingBox_0, v107 = v61:GetBoundingBox();
            local v108 = getAdorneeInstance(v61, v70.AdorneeName);
            if v108 then
                if not v108:IsA("BasePart") then
                    return 0;
                else
                    return v107.Y / 2 - l_v61_BoundingBox_0:PointToObjectSpace(v108.Position).Y;
                end;
            else
                return v107.Y / 2;
            end;
        end;
    end, {
        v61,
        v70
    });
    local v111 = v4.useCallback(function()
        if not v31() or v52.voiceEnabled then
            if not v83 then
                local v110 = not v80 or #v80 == 0;
                if not (v52.voiceEnabled and not l_selfViewListenerChanged_0) or v52.isBubbleChatEnabled and not v110 then
                    return false;
                else
                    return true;
                end;
            elseif not (v19() and l_VRService_0.VREnabled) and not v17.ChromeEnabled then
                if l_useState_0 then
                    return false;
                else
                    return true;
                end;
            else
                return false;
            end;
        else
            return false;
        end;
    end, {
        v52.voiceEnabled,
        v52.userId,
        l_useState_0,
        v80,
        l_selfViewListenerChanged_0,
        v52.isBubbleChatEnabled,
        v70,
        v59,
        l_VRService_0.VREnabled
    });
    local v112 = v4.useCallback(function()
        return v70.TailVisible and not v111();
    end, {
        v70,
        v52.voiceEnabled,
        v52.userId,
        l_useState_0,
        v80,
        l_selfViewListenerChanged_0,
        v52.isBubbleChatEnabled,
        v59,
        l_VRService_0.VREnabled
    });
    local v114 = v4.useCallback(function()
        if not v83 and v78 ~= "Talking" then
            local l_v75_0 = v75;
            delay(1, function()
                if v75 == l_v75_0 then
                    v74(true);
                end;
            end);
        end;
    end, {
        v52.userId,
        v78,
        v75,
        v83
    });
    local v117 = v4.useCallback(function()
        if v23 and v86 then
            local v115 = false;
            if v78 ~= "Talking" then
                v115 = v78 ~= "LOCAL_MUTED";
            end;
            if not (v83 or not v115) then
                local l_v75_1 = v75;
                delay(1, function()
                    if v75 == l_v75_1 then
                        v74(true);
                    end;
                end);
            end;
            return ;
        else
            return v114();
        end;
    end, {
        v86,
        v52.userId,
        v78,
        v75,
        v83
    });
    local v118 = not l_LocalPlayer_0 and "SpeakerDark" or (v52.userId ~= tostring(l_LocalPlayer_0.UserId) and "SpeakerDark" or "MicDark");
    local function v119()
        return v4.createElement(v13, {
            userId = v52.userId,
            getIcon = v52.getIconVoiceIndicator,
            onClicked = v105,
            iconStyle = v118
        });
    end;
    v4.useEffect(function()
        if v78 ~= v52.voiceState then
            v77((v75 or 0) + 1);
            v74(false);
            v79(v52.voiceState);
        end;
    end, {
        v52.voiceState,
        v78
    });
    v4.useEffect(function()
        local v120 = v47(v56, v70.BubbleDuration * 1000, v70.MaxBubbles);
        if (v57 and v59) ~= nil then
            v71(v57 and v59);
        end;
        v81(v120);
    end, {
        v70,
        v56,
        v57,
        v59
    });
    v4.useEffect(function()
        local v121 = v6.createSingleMotor(0);
        v99.current = v121;
        v121:onStep(function(v122)
            v98((Vector3.new(0, v122, 0)));
        end);
        local v123 = v109();
        v100.current = v123;
        v99.current:setGoal(v6.instant(v123));
        local v124 = nil;
        if not (not v17.AvatarChatEnabled or not v52.selfViewListenerChanged) then
            local l_selfViewVisibilityUpdatedSignal_0 = v52.selfViewListenerChanged.selfViewVisibilityUpdatedSignal;
            local l_getSelfViewVisibility_0 = v52.selfViewListenerChanged.getSelfViewVisibility;
            local l_l_getSelfViewVisibility_0_0 = l_getSelfViewVisibility_0 --[[ copy: 4 -> 5 ]];
            v124 = l_selfViewVisibilityUpdatedSignal_0:connect(function()
                v76(l_l_getSelfViewVisibility_0_0());
            end);
        end;
        if v23 then
            local l_status_0, l_result_0 = pcall(function()
                return v22:GetLayerData(v27);
            end);
            if not ((not l_status_0 or not l_result_0) or not l_result_0[v28]) then
                v87(true);
            end;
        end;
        return function()
            if v124 then
                v124:disconnect();
                v124 = nil;
            end;
            if v99.current then
                v99.current:destroy();
            end;
        end;
    end, {
        v52.selfViewListenerChanged
    });
    v4.useEffect(function()
        local v146 = l_RunService_0.PostSimulation:Connect(function()
            if v101.current ~= nil then
                if v101.current < v30 then
                    local l_v101_0 = v101;
                    l_v101_0.current = l_v101_0.current + 1;
                    return ;
                else
                    v101.current = 0;
                end;
            end;
            local v131 = getAdorneeInstance(v61, v70.AdorneeName);
            if not (not l_Workspace_0.CurrentCamera or not v131) then
                local v132 = if not v131:IsA("Attachment") then v131.Position else v131.WorldPosition;
                local l_Magnitude_0 = (l_Workspace_0.CurrentCamera.CFrame.Position - v132).Magnitude;
                local v134 = l_Magnitude_0 < v70.MaxDistance;
                local v135 = l_Magnitude_0 < v70.MinimizeDistance;
                local v136 = false;
                if not (not v23 or not v86) then
                    local v137 = nil;
                    local v138 = getAdorneeInstance(v95, v70.AdorneeName);
                    if v138 then
                        v137 = if not v138:IsA("Attachment") then v138.Position else v138.WorldPosition;
                    end;
                    local v139 = getEasierUnmutingDistance(v132, v137);
                    if v139 ~= nil then
                        v136 = v139 < v26;
                    end;
                end;
                if not (v135 == v68 and v134 == v66) or not (not v23 or not v86) and v136 ~= v84 then
                    v67(v134);
                    v69(v135);
                    v85(v136);
                end;
            end;
            local v140 = v109();
            if math.abs(v140 - v100.current) > 0.5 then
                v100.current = v140;
                v99.current:setGoal(v6.spring(v140, v33));
            end;
            local v141 = not not v29 and l_Workspace_0:GetServerTimeNow() * 1000 or DateTime.now().UnixTimestampMillis;
            local v142 = v70.BubbleDuration * 1000;
            for _, v144 in ipairs(v80) do
                if v142 <= v141 - v144.timestamp.UnixTimestampMillis then
                    v81(function(v145)
                        return v47(v145, v142, v59.MaxBubbles);
                    end);
                    return ;
                end;
            end;
        end);
        if not v23 or not v86 then
            v114();
        else
            v117();
        end;
        return function()
            v1:trace("Unmounting billboards for {}", v52.userId);
            if not (not v146 or not v146.Connected) then
                v146:Disconnect();
            end;
        end;
    end, {
        v80,
        v61,
        v70,
        v86,
        v95,
        v59,
        v66,
        v68,
        v84
    });
    v4.useEffect(function()
        if not (not (not v80 or #v80 == 0) or v66) then
            v102();
        end;
        if v80 and #v80 > 0 then
            v96.current = false;
        end;
        if not ((not v23 or not v83) or v88) and (not (v52.voiceState ~= "Inactive" and v52.voiceState ~= "Talking") or v52.voiceState == "Muted") then
            v22:LogUserLayerExposure(v27);
            v89(true);
        end;
    end, {
        v80,
        v66,
        v52.userId,
        v52.voiceState,
        v88
    });
    v4.useEffect(function()
        if not v23 or not v86 then
            v114();
            return ;
        else
            v117();
            return ;
        end;
    end, {
        v75,
        v86
    });
    local v147 = getAdorneeInstance(v61, v70.AdorneeName);
    if v147 then
        if v66 then
            if not (not (not v23 or not v86) and v52.voiceState == "LOCAL_MUTED") or v84 and (not v25 or not v65) then
                local v148 = {};
                local v149 = v80 and #v80 > 0;
                local v150 = v52.voiceEnabled and not l_selfViewListenerChanged_0;
                if not (not v17.AvatarChatEnabled or not v83) then
                    v150 = v150 and not l_useState_0;
                end;
                if not (not v17.ChromeEnabled or not v83) then
                    v150 = false;
                end;
                local v151 = v150 and not v17.AvatarChatEnabled;
                local v152 = if not v150 then nil else v119;
                local l_v32_0 = v32;
                if not v17.AvatarChatEnabled and not v17.ChromeEnabled then
                    if v150 and v149 == false then
                        v148.VoiceBubble = v4.createElement(v14, {
                            chatSettings = v70,
                            userId = v52.userId,
                            renderInsert = v152,
                            insertSize = l_v32_0,
                            isDistant = not v68,
                            clientSettings = v63
                        });
                    end;
                elseif v111() then
                    v148.PlayerButtons = v4.createElement(v20, {
                        chatSettings = v59,
                        isInsideMaximizeDistance = v68,
                        LayoutOrder = 2,
                        isLocalPlayer = v83,
                        userId = v52.userId,
                        getIcon = v52.getIconVoiceIndicator,
                        hasCameraPermissions = v52.hasCameraPermissions,
                        hasMicPermissions = v52.hasMicPermissions,
                        onClickedVoiceIndicator = v105,
                        onClickedCameraIndicator = v52.onClickedCameraIndicator,
                        voiceEnabled = v52.voiceEnabled,
                        displayCameraDeniedToast = v52.displayCameraDeniedToast,
                        isCamEnabledForUserAndPlace = v52.isCamEnabledForUserAndPlace,
                        setCameraPermissionStateFromControl = v52.setCameraPermissionStateFromControl,
                        getPermissions = v52.getPermissions,
                        isCameraOnlyUser = v52.isCameraOnlyUser
                    });
                    v148.listLayout = v4.createElement("UIListLayout", {
                        SortOrder = Enum.SortOrder.LayoutOrder,
                        HorizontalAlignment = Enum.HorizontalAlignment.Center,
                        VerticalAlignment = Enum.VerticalAlignment.Bottom,
                        Padding = UDim.new(0, 8)
                    });
                    v148.padding = v4.createElement("UIPadding", {
                        PaddingBottom = UDim.new(0, 8)
                    });
                end;
                local v154 = if not v31() then nil else v112();
                if not v68 then
                    if v149 then
                        v148.DistantBubble = v4.createElement(v16, {
                            fadingOut = not v80 or #v80 == 0,
                            onFadeOut = v102,
                            chatSettings = v70,
                            renderInsert = if not v151 then nil else v152,
                            insertSize = l_v32_0,
                            clientSettings = v63,
                            showCaret = v154
                        });
                    end;
                else
                    v148.BubbleChatList = v4.createElement(v15, {
                        userId = v52.userId,
                        isVisible = v68,
                        onLastBubbleFadeOut = v102,
                        chatSettings = v70,
                        renderFirstInsert = if not v151 then nil else v152,
                        insertSize = l_v32_0,
                        messages = v80,
                        clientSettings = v63,
                        isTextChatServiceOn = v52.isTextChatServiceOn,
                        showCaret = v154
                    });
                end;
                return v4.createElement("BillboardGui", {
                    Adornee = v147,
                    Active = if not v17.AvatarChatEnabled then v150 else v111(),
                    Size = UDim2.fromOffset(500, 200),
                    SizeOffset = Vector2.new(0, 0.5),
                    StudsOffset = (not not v83 and v70.LocalPlayerStudsOffset or Vector3.new(0, 1, 0.1)) + Vector3.new(0, v70.VerticalStudsOffset, 0),
                    StudsOffsetWorldSpace = v97,
                    ResetOnSpawn = false
                }, v148);
            else
                v1:trace("Unmute toggle not applicable for {}", v52.userId);
                return ;
            end;
        else
            v1:trace("Not in range for {}", v52.userId);
            return ;
        end;
    else
        v1:trace("No adornee for {}", v52.userId);
        return ;
    end;
end);


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local l_Dictionary_0 = require(l_Parent_0.llama).Dictionary;
local v3 = require(l_Parent_0.Roact);
local v4 = require(l_Parent_0.Otter);
local v5 = require(l_script_FirstAncestor_0.Flags.getEnableChatInputBarConfigurationStyleCustomizations);
local v6 = require(l_script_FirstAncestor_0.Config);
local v7 = require(script:FindFirstAncestor("BubbleChat").Helpers.getSpringFromSettings);
local v8 = require(l_script_FirstAncestor_0.ClientSettings.ClientSettingsUtility);
local v9 = v3.PureComponent:extend("BlankBubble");
v9.init = function(v10, v11)
    v10.state = {};
    local v12, v13 = v3.createBinding(0);
    v10.width = v12;
    v10.updateWidth = v13;
    v10.widthMotor = v4.createSingleMotor(0);
    v10.widthMotor:onStep(function(v14)
        v10.updateWidth((math.round(v14)));
    end);
    v10.frameSize = v10.width:map(function(v15)
        if not v10.props.insertSize then
            return UDim2.fromOffset(v15, 0);
        else
            return UDim2.fromOffset(v15, v10.props.insertSize.Y + v10.props.chatSettings.Padding * 2);
        end;
    end);
    v12, v13 = v3.createBinding(1);
    v10.transparency = v12;
    v10.updateTransparency = v13;
    v10.transparencyMotor = v4.createSingleMotor(1);
    v10.transparencyMotor:onStep(v10.updateTransparency);
    if v5() then
        v12, v13 = v3.createBinding(1);
        v10.backgroundTransparency = v12;
        v10.updateBackgroundTransparency = v13;
        v10.backgroundTransparencyMotor = v4.createSingleMotor(1);
        v10.backgroundTransparencyMotor:onStep(v10.updateBackgroundTransparency);
    end;
    if v11.fadingOut then
        v10:fadeOut();
    end;
end;
v9.getDerivedStateFromProps = function(v16, v17)
    local v18 = 0;
    if v16.insertSize then
        v18 = v16.insertSize.X + v16.chatSettings.Padding * 2;
    end;
    if v18 ~= v17.fullWidth then
        return {
            fullWidth = v18
        };
    else
        return nil;
    end;
end;
v9.render = function(v19)
    local l_chatSettings_0 = v19.props.chatSettings;
    local l_ImageLabel_0 = l_chatSettings_0.ImageLabel;
    local l_UIGradient_0 = l_chatSettings_0.UIGradient;
    local l_UICorner_0 = l_chatSettings_0.UICorner;
    local l_CornerRadius_0 = v6.DefaultBubbleChatChildrenCustomizationProperties.UICorner.CornerRadius;
    local v25 = 0;
    if v19.props.insertSize then
        v25 = v19.props.insertSize.Y + v19.props.chatSettings.Padding * 2;
    end;
    local l_createElement_0 = v3.createElement;
    local v27 = "Frame";
    local v28 = {
        AnchorPoint = Vector2.new(0.5, 1),
        Size = UDim2.fromOffset(v19.state.fullWidth, v25),
        Position = UDim2.new(0.5, 0, 1, -8),
        Transparency = 1
    };
    local v29 = {
        Scale = v3.createElement("UIScale", {
            Scale = not v19.props.isDistant and 1 or 0.75
        })
    };
    local l_TailVisible_0 = v19.props.chatSettings.TailVisible;
    if l_TailVisible_0 then
        l_TailVisible_0 = v3.createElement;
        local v31 = "ImageLabel";
        local v32 = {
            AnchorPoint = Vector2.new(0.5, 0),
            BackgroundTransparency = 1,
            Position = UDim2.new(0.5, 0, 1, -1),
            Size = UDim2.fromOffset(12, 8),
            Image = "rbxasset://textures/ui/InGameChat/Caret.png",
            ImageColor3 = l_chatSettings_0.BackgroundColor3,
            ImageTransparency = not not v5() and v19.backgroundTransparency or v19.transparency
        };
        local v33 = {};
        local v34 = false;
        if l_UIGradient_0 ~= nil then
            v34 = v3.createElement("UIGradient", l_UIGradient_0);
        end;
        v33.Gradient = v34;
        l_TailVisible_0 = l_TailVisible_0(v31, v32, v33);
    end;
    v29.Caret = l_TailVisible_0;
    l_TailVisible_0 = v3.createElement;
    local v35 = "ImageLabel";
    local v36 = l_Dictionary_0.join(l_ImageLabel_0, {
        Size = v19.frameSize,
        BackgroundColor3 = l_chatSettings_0.BackgroundColor3,
        BackgroundTransparency = (not not l_ImageLabel_0 and l_ImageLabel_0.Image ~= "") and 1 or (v19.backgroundTransparency or v19.transparency),
        BorderSizePixel = 0,
        AnchorPoint = Vector2.new(0.5, 0),
        Position = UDim2.new(0.5, 0, 0, 0),
        ClipsDescendants = true,
        ImageTransparency = v19.backgroundTransparency or v19.transparency,
        Image = not not l_ImageLabel_0 and l_ImageLabel_0.Image or ""
    });
    local v37 = {
        UICorner = not not l_UICorner_0 and v3.createElement("UICorner", {
            CornerRadius = l_UICorner_0.CornerRadius
        }) or v3.createElement("UICorner", {
            CornerRadius = l_CornerRadius_0
        }),
        Contents = v3.createElement("Frame", {
            Size = UDim2.fromScale(1, 1),
            BackgroundTransparency = 1
        }, {
            Padding = v3.createElement("UIPadding", {
                PaddingTop = UDim.new(0, v19.props.chatSettings.Padding),
                PaddingRight = UDim.new(0, v19.props.chatSettings.Padding),
                PaddingBottom = UDim.new(0, v19.props.chatSettings.Padding),
                PaddingLeft = UDim.new(0, v19.props.chatSettings.Padding)
            }),
            Insert = v19.props.renderInsert and v19.props.renderInsert()
        })
    };
    local v38 = false;
    if l_UIGradient_0 ~= nil then
        v38 = v3.createElement("UIGradient", l_UIGradient_0);
    end;
    v37.Gradient = v38;
    v29.RoundedFrame = l_TailVisible_0(v35, v36, v37);
    return l_createElement_0(v27, v28, v29);
end;
v9.fadeIn = function(v39)
    local v40 = v7(v39.props.chatSettings, "transparency");
    v39.transparencyMotor:setGoal(v40(v39.props.chatSettings.Transparency));
    if v5() then
        v39.backgroundTransparencyMotor:setGoal(v40((v8.getBackgroundTransparency(v39.props.chatSettings, v39.props.clientSettings))));
    end;
    v39.widthMotor:setGoal(v7(v39.props.chatSettings, "size")(v39.state.fullWidth));
end;
v9.fadeOut = function(v41)
    v41.transparencyMotor:onComplete(function()
        if v41.props.onFadeOut then
            v41.props.onFadeOut();
        end;
    end);
    local v42 = v7(v41.props.chatSettings, "transparency");
    v41.transparencyMotor:setGoal(v42(1));
    if v5() then
        v41.backgroundTransparencyMotor:setGoal(v42(1));
    end;
end;
v9.didUpdate = function(v43, v44, v45)
    if v44.fadingOut ~= v43.props.fadingOut then
        if not v43.props.fadingOut then
            v43:fadeIn();
        else
            v43:fadeOut();
        end;
    end;
    if v43.state.fullWidth ~= v45.fullWidth then
        v43.widthMotor:setGoal(v7(v43.props.chatSettings, "size")(v43.state.fullWidth));
    end;
end;
v9.didMount = function(v46)
    if not v46.props.fadingOut then
        local v47 = v7(v46.props.chatSettings, "size");
        local v48 = v7(v46.props.chatSettings, "transparency");
        v46.transparencyMotor:setGoal(v48(v46.props.chatSettings.Transparency));
        if v5() then
            v46.backgroundTransparencyMotor:setGoal(v48((v8.getBackgroundTransparency(v46.props.chatSettings, v46.props.clientSettings))));
        end;
        v46.widthMotor:setGoal(v47(v46.state.fullWidth));
    end;
end;
v9.willUnmount = function(v49)
    v49.transparencyMotor:destroy();
    if v5() then
        v49.backgroundTransparencyMotor:destroy();
    end;
    v49.widthMotor:destroy();
end;
return v9;


local l_Players_0 = game:GetService("Players");
local l_VoiceChatService_0 = game:GetService("VoiceChatService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local v3 = require(l_script_FirstAncestor_0.Logger):new("ExpChat/" .. script.Name);
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v5 = require(l_script_FirstAncestor_0.IXPServiceWrapper);
local v6 = require(l_Parent_0.Roact);
local v7 = require(l_Parent_0.RoactRodux);
local l_Dictionary_0 = require(l_Parent_0.llama).Dictionary;
local l_None_0 = require(l_Parent_0.llama).None;
local l_script_FirstAncestor_1 = script:FindFirstAncestor("BubbleChat");
local v11 = require(l_script_FirstAncestor_1.BillboardGui);
local v12 = require(l_script_FirstAncestor_1.BillboardGuiV2);
local l_Permissions_0 = require(l_script_FirstAncestor_0.Config).Permissions;
local v14 = require(l_script_FirstAncestor_0.GlobalFlags);
local v15 = v6.Component:extend("BubbleChatApp");
local v16 = require(l_script_FirstAncestor_0.Flags.getFFlagEnableExperienceChatOptimizations);
local v17 = require(l_script_FirstAncestor_0.Flags.getFFlagEnableExpChatVoiceUIImprovements);
local v18 = require(l_script_FirstAncestor_0.Flags.GetFStringVoiceUIImprovementsIXPLayerName);
local v19 = game:DefineFastString("BillboardRefactorIXPLayerValue", "BillboardRefactorEnabled");
v15.getDerivedStateFromProps = function(v20, v21)
    return {
        userMessages = l_Dictionary_0.join(v21.userMessages or {}, v20.userMessages)
    };
end;
v15.init = function(v22)
    v3:debug("Initializing");
    v22:setState({
        userMessages = {},
        isInBillboardRefactorTreatment = false,
        localPlayerVoiceEnabled = false
    });
    v22.onBillboardFadeOut = function(v23)
        v22:setState({
            userMessages = l_Dictionary_0.join(v22.state.userMessages, {
                [v23] = l_None_0
            })
        });
    end;
    v22.setCameraPermissionStateFromControl = function(v24)
        if v14.DoNotPromptCameraPermissionsOnMount then
            v22:setState({
                hasCameraPermissions = v24
            });
        end;
    end;
    if v17() then
        local l_status_0, l_result_0 = pcall(function()
            return v5:GetLayerData(v18());
        end);
        if not ((not l_status_0 or not l_result_0) or not l_result_0[v19]) then
            v22:setState({
                isInBillboardRefactorTreatment = true
            });
        end;
    end;
end;
v15.getPermissions = function(v27)
    local function v30(v28, v29)
        v27:setState({
            hasCameraPermissions = v28,
            hasMicPermissions = v29
        });
    end;
    if v27.props.getPermissions then
        v27.props.getPermissions(v30);
    end;
end;
v15.getMicPermission = function(v31)
    local function v34(_, v33)
        v31:setState({
            hasMicPermissions = v33
        });
    end;
    if v31.props.getPermissions then
        v31.props.getPermissions(v34, l_Permissions_0.MICROPHONE_ACCESS);
    end;
end;
v15.getCameraPermissionWithoutRequest = function(v35)
    local function v38(v36, _)
        v35:setState({
            hasCameraPermissions = v36
        });
    end;
    if v35.props.getPermissions then
        v35.props.getPermissions(v38, l_Permissions_0.CAMERA_ACCESS, true);
    end;
end;
v15.didMount = function(v39)
    if not (not v14.AvatarChatEnabled and not v14.ChromeEnabled) then
        if not v14.DoNotPromptCameraPermissionsOnMount then
            v39:getPermissions();
        else
            if not v39.props.isVoiceServiceInitialized or not v14.RenderVoiceBubbleAfterAsyncInit then
                v39:getMicPermission();
            else
                v39.props.isVoiceServiceInitialized():andThen(function()
                    v39:getMicPermission();
                end):catch(function()
                    v3:debug("VoiceChatServiceManager failed to initialize inside TextChatService bubblechat");
                end);
            end;
            v39:getCameraPermissionWithoutRequest();
        end;
    end;
    if v17() then
        task.spawn(function()
            local l_status_1, l_result_1 = pcall(function()
                if not l_Players_0.LocalPlayer then
                    return false;
                else
                    return l_VoiceChatService_0:IsVoiceEnabledForUserIdAsync(l_Players_0.LocalPlayer.UserId);
                end;
            end);
            if l_status_1 then
                if l_result_1 then
                    v39:setState({
                        localPlayerVoiceEnabled = true
                    });
                    v5:LogUserLayerExposure(v18());
                end;
                return ;
            else
                v3:debug("Unable to get voice enabled status: ", l_result_1);
                return ;
            end;
        end);
    end;
end;
v15.render = function(v42)
    local v43 = {};
    if v42.props.characters then
        for v44, v45 in pairs(v42.props.characters) do
            if not v16() then
                v43[v44] = false;
            elseif not (not v45 or not v45:IsDescendantOf(workspace)) then
                v43[v44] = false;
            end;
        end;
    end;
    if v42.props.mockUserIdToPartOrModel then
        for v46, v47 in pairs(v42.props.mockUserIdToPartOrModel) do
            if not v16() then
                v43[v46] = false;
            elseif not (not v47 or not v47:IsDescendantOf(workspace)) then
                v43[v46] = false;
            end;
        end;
    end;
    if v42.props.voiceParticipants then
        for v48, v49 in pairs(v42.props.voiceParticipants) do
            if v49 ~= "Hidden" then
                v43[v48] = true;
            end;
        end;
    end;
    if not ((not v14.AvatarChatEnabled or not v42.state.hasCameraPermissions) or not l_Players_0.LocalPlayer) then
        v43[tostring(l_Players_0.LocalPlayer.UserId)] = true;
    end;
    return v6.createElement("ScreenGui", {
        ResetOnSpawn = false
    }, l_Dictionary_0.map(v43, function(v50, v51)
        if not v16() then
            v3:trace("Rendering billboard for ...{}", (string.sub(tostring(v51), -4)));
        end;
        return v6.createElement(not not ((v17() and v42.state.localPlayerVoiceEnabled) and v42.state.isInBillboardRefactorTreatment) and v12 or v11, {
            userId = v51,
            onFadeOut = v42.onBillboardFadeOut,
            voiceEnabled = v42.props.voiceEnabled and v50,
            getIconVoiceIndicator = v42.props.getIconVoiceIndicator,
            onClickedVoiceIndicator = v42.props.onClickedVoiceIndicator,
            onClickedCameraIndicator = v42.props.onClickedCameraIndicator,
            selfViewListenerChanged = v42.props.selfViewListenerChanged,
            hasCameraPermissions = v42.state.hasCameraPermissions,
            hasMicPermissions = v42.state.hasMicPermissions,
            displayCameraDeniedToast = v42.props.displayCameraDeniedToast,
            isCamEnabledForUserAndPlace = v42.props.isCamEnabledForUserAndPlace,
            isCameraOnlyUser = v42.props.isCameraOnlyUser,
            setCameraPermissionStateFromControl = v42.setCameraPermissionStateFromControl,
            getPermissions = v42.props.getPermissions,
            isBubbleChatEnabled = v42.props.isBubbleChatEnabled,
            voiceState = v42.props.voiceParticipants[v51],
            partOrModel = v42.props.mockUserIdToPartOrModel[v51],
            isTextChatServiceOn = v42.props.isTextChatServiceOn
        }), "BubbleChat_" .. v51;
    end));
end;
return v7.connect(function(v52, v53)
    local _ = nil;
    return {
        isBubbleChatEnabled = if not v53.isTextChatServiceOn then v52.LegacyBubbleChatSettings.Enabled else v52.BubbleChatSettings.Enabled,
        userMessages = v52.Messages.bubbleMessagesInOrderBySenderId,
        voiceEnabled = v52.Voice.isEnabled,
        characters = v52.Players.charactersByUserId,
        voiceParticipants = v52.Voice.participants,
        mockUserIdToPartOrModel = v52.Messages.mockUserIdToPartOrModel
    };
end)(v15);


local l_script_FirstAncestor_0 = script:FindFirstAncestor("ExpChat");
local l_Parent_0 = l_script_FirstAncestor_0.Parent;
local v2 = require(l_Parent_0.Roact);
local l_List_0 = require(l_Parent_0.llama).List;
local v4 = require(l_script_FirstAncestor_0.BubbleChat.ChatBubble);
local v5 = require(l_script_FirstAncestor_0.Flags.getFixBubblesOutofOrderWhenZoomedIn);
local v6 = require(l_script_FirstAncestor_0.GlobalFlags);
local v7 = v2.Component:extend("BubbleChatList");
local v8 = require(l_script_FirstAncestor_0.Flags.getFFlagChatTranslationUIEnabledBubbleChat);
v7.getDerivedStateFromProps = function(v9, v10)
    local v11 = {};
    if v10.bubbles then
        for _, v13 in ipairs(v10.bubbles) do
            if not l_List_0.findWhere(v9.messages, function(v14, _)
                return v14.messageId == v13.messageId;
            end) then
                table.insert(v11, {
                    messageId = v13.messageId,
                    fadingOut = true
                });
            end;
        end;
    end;
    for _, v17 in ipairs(v9.messages) do
        local v18 = nil;
        if v5() then
            v18 = tonumber(tostring(v17.timestamp):sub(-9));
        end;
        table.insert(v11, {
            messageId = v17.messageId,
            fadingOut = false,
            text = v17.text,
            translation = if not v8() then nil else v17.translation,
            useTranslation = if not v8() then nil else v17.useTranslation,
            timestamp = v18 or v17.timestamp,
            bubbleChatMessageProperties = v17.bubbleChatMessageProperties
        });
    end;
    return {
        bubbles = v11
    };
end;
v7.init = function(v19, v20)
    v19.state = {};
    if not (not (not v20.messages or #v20.messages == 0) or not v20.onLastBubbleFadeOut) then
        v20.onLastBubbleFadeOut();
    end;
    v19.onBubbleFadeOut = function(v21)
        local v23 = l_List_0.filter(v19.state.bubbles, function(v22)
            return v22.messageId ~= v21;
        end);
        if not (#v23 == 0) or not v19.props.onLastBubbleFadeOut then
            v19:setState({
                bubbles = v23
            });
            return ;
        else
            v19.props.onLastBubbleFadeOut();
            return ;
        end;
    end;
end;
v7.render = function(v24)
    local v25 = {};
    local l_chatSettings_0 = v24.props.chatSettings;
    v25.Layout = v2.createElement("UIListLayout", {
        SortOrder = Enum.SortOrder.LayoutOrder,
        HorizontalAlignment = Enum.HorizontalAlignment.Center,
        VerticalAlignment = Enum.VerticalAlignment.Bottom,
        Padding = UDim.new(0, l_chatSettings_0.BubblesSpacing)
    });
    v25.CaretPadding = (v24.props.chatSettings.TailVisible and (not v6.AvatarChatEnabled or v24.props.showCaret)) and v2.createElement("UIPadding", {
        PaddingBottom = UDim.new(0, 8)
    });
    for v27, v28 in ipairs(v24.state.bubbles) do
        local v29 = v27 == #v24.state.bubbles;
        local v30 = not not v29 and v24.props.renderFirstInsert or nil;
        local l_insertSize_0 = v24.props.insertSize;
        if not v5() then
            v25["Bubble" .. v28.messageId] = v2.createElement(v4, {
                messageId = v28.messageId,
                text = v28.text or "",
                translation = if not v8() then nil else v28.translation,
                useTranslation = if not v8() then nil else v28.useTranslation,
                timestamp = not not v28.timestamp and v28.timestamp.UnixTimestamp or 0,
                isMostRecent = v29,
                theme = v24.props.theme,
                fadingOut = v28.fadingOut,
                onFadeOut = v24.onBubbleFadeOut,
                chatSettings = l_chatSettings_0,
                renderInsert = v30,
                insertSize = l_insertSize_0,
                showCaret = v24.props.showCaret,
                clientSettings = v24.props.clientSettings,
                bubbleChatMessageProperties = v28.bubbleChatMessageProperties
            });
        else
            v25["Bubble" .. v28.messageId] = v2.createElement(v4, {
                messageId = v28.messageId,
                text = v28.text or "",
                translation = if not v8() then nil else v28.translation,
                useTranslation = if not v8() then nil else v28.useTranslation,
                timestamp = v28.timestamp or 0,
                isMostRecent = v29,
                theme = v24.props.theme,
                fadingOut = v28.fadingOut,
                onFadeOut = v24.onBubbleFadeOut,
                chatSettings = l_chatSettings_0,
                renderInsert = v30,
                insertSize = l_insertSize_0,
                showCaret = v24.props.showCaret,
                clientSettings = v24.props.clientSettings,
                bubbleChatMessageProperties = v28.bubbleChatMessageProperties,
                isTextChatServiceOn = v24.props.isTextChatServiceOn
            });
        end;
    end;
    return v2.createElement("Frame", {
        Visible = v24.props.isVisible,
        Size = UDim2.fromScale(1, 1),
        BackgroundTransparency = 1
    }, v25);
end;
return v7;