local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_UI_0 = v2.UI;
local l_TableRow_0 = l_UI_0.TableRow;
local l_Dash_0 = v2.Dash;
local l_map_0 = l_Dash_0.map;
local l_collect_0 = l_Dash_0.collect;
local l_reduce_0 = l_Dash_0.reduce;
local l_some_0 = l_Dash_0.some;
local l_Pane_0 = l_UI_0.Pane;
local l_ScrollingFrame_0 = l_UI_0.ScrollingFrame;
local l_SplitPane_0 = l_UI_0.SplitPane;
local v15 = require(script.TableHeaderCell);
local v16 = v1.PureComponent:extend("AudioTable");
local v17 = UDim.new(0, 50);
v16.init = function(v18)
    v18:calculateRowIndices(v18.props.Rows);
    v18.onHoverRow = function(v19)
        if v18.props.OnHoverRow then
            v18.props.OnHoverRow(v19.Row, v19.RowIndex);
        end;
    end;
    v18.onHoverRowEnd = function(v20)
        if v18.props.OnHoverRowEnd then
            v18.props.OnHoverRowEnd(v20.Row, v20.RowIndex);
        end;
    end;
    v18.onSelectRow = function(v21)
        if v18.props.OnSelectRow then
            v18.props.OnSelectRow(v21.Row, v21.RowIndex);
        end;
    end;
    v18.onDoubleClick = function(v22)
        if v18.props.OnDoubleClick then
            v18.props.OnDoubleClick(v22.Row, v22.RowIndex);
        end;
    end;
    v18.onRightClickRow = function(v23)
        if v18.props.OnRightClickRow then
            v18.props.OnRightClickRow(v23);
        end;
    end;
    v18:_flushRenderRow();
    v18.getDefaultRowKey = function(v24)
        return "Row " .. (v18.rowToIndex[v24] or tostring(v24));
    end;
    v18.onSizeChange = function(v25)
        local l_props_0 = v18.props;
        local l_Stylizer_0 = l_props_0.Stylizer;
        v18.props.OnSizeChange((v25.AbsoluteSize.Y - (l_Stylizer_0.HeaderHeight + (not not l_props_0.Footer and l_Stylizer_0.FooterHeight or 0))) - 5);
    end;
end;
v16._flushRenderRow = function(v28)
    v28.onRenderRow = function(v29)
        local v30 = v28.rowToIndex[v29];
        return v1.createElement(v28.props.RowComponent or l_TableRow_0, {
            CellProps = v28.props.CellProps,
            CellComponent = v28.props.CellComponent,
            Columns = v28.props.Columns,
            Rows = v28.props.Rows,
            Row = v29,
            RowIndex = v30,
            Selected = v30 == v28.props.SelectedRow,
            OnHover = v28.props.OnHoverRow and v28.onHoverRow,
            OnHoverEnd = v28.props.OnHoverRowEnd and v28.onHoverRowEnd,
            OnPress = v28.props.OnSelectRow and v28.onSelectRow,
            OnDoubleClick = v28.props.OnDoubleClick and v28.onDoubleClick,
            OnRightClick = v28.onRightClickRow
        });
    end;
end;
v16.willUpdate = function(v31, v32)
    local l_props_1 = v31.props;
    if l_props_1.Rows ~= v32.Rows then
        v31:calculateRowIndices(v32.Rows);
    end;
    if l_props_1.Columns ~= v32.Columns then
        local v34 = #l_props_1.Columns ~= #v32.Columns;
        local v37 = l_some_0(l_props_1.Columns, function(v35, v36)
            return v32.Columns[v36].Width ~= v35.Width;
        end);
        if not (not v34 and not v37) then
            v31:_flushRenderRow();
        end;
    end;
end;
v16.calculateRowIndices = function(v38, v39)
    v38.rowToIndex = l_collect_0(v39, function(v40, v41)
        return v41, v40;
    end);
end;
v16.renderResizableHeadings = function(v42)
    local l_props_2 = v42.props;
    local l_Stylizer_1 = l_props_2.Stylizer;
    return v1.createElement(l_SplitPane_0, {
        UseScale = l_props_2.UseScale,
        ClampSize = l_props_2.ClampSize,
        Sizes = l_map_0(l_props_2.Columns, function(v45)
            return v45.Width or UDim.new(1 / #l_props_2.Columns, 0);
        end),
        MinSizes = l_map_0(l_props_2.Columns, function(v46)
            return v46.MinWidth or v17;
        end),
        OnSizesChange = l_props_2.OnColumnSizesChange
    }, l_map_0(l_props_2.Columns, function(v47, v48)
        local v49 = l_props_2.SortIndex == v48 and l_props_2.SortOrder or nil;
        return v1.createElement(v15, {
            Name = v47.Name,
            Order = v49,
            Width = UDim.new(1, 0),
            ColumnIndex = v48,
            Style = l_Stylizer_1,
            OnPress = not not v42.props.OnSortChange and function()
                v42.props.OnSortChange(v48, if v49 == Enum.SortDirection.Descending then Enum.SortDirection.Ascending else Enum.SortDirection.Descending);
            end or nil
        });
    end));
end;
v16.renderFixedHeadings = function(v50)
    local l_props_3 = v50.props;
    local l_Stylizer_2 = l_props_3.Stylizer;
    return l_map_0(l_props_3.Columns, function(v53, v54)
        local v55 = v53.Width or UDim.new(1 / #l_props_3.Columns, 0);
        local v56 = l_props_3.SortIndex == v54 and l_props_3.SortOrder or nil;
        return v1.createElement(v15, {
            Name = v53.Name,
            Order = v56,
            Width = v55,
            ColumnIndex = v54,
            Style = l_Stylizer_2,
            OnPress = not not v50.props.OnSortChange and function()
                v50.props.OnSortChange(v54, v56 == Enum.SortDirection.Descending and Enum.SortDirection.Ascending or Enum.SortDirection.Descending);
            end or nil
        });
    end);
end;
v16.renderHeadings = function(v57)
    if not v57.props.OnColumnSizesChange then
        return v57:renderFixedHeadings();
    else
        return v57:renderResizableHeadings();
    end;
end;
v16.renderScroll = function(v58)
    return v1.createElement(l_ScrollingFrame_0, {
        AutomaticCanvasSize = Enum.AutomaticSize.Y,
        CanvasSize = UDim2.fromOffset(0, 0)
    }, {
        Group = v1.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            Size = UDim2.fromScale(1, 0),
            Layout = Enum.FillDirection.Vertical,
            HorizontalAlignment = Enum.HorizontalAlignment.Left
        }, {
            Children = v58:renderRows()
        })
    });
end;
v16.renderRows = function(v59)
    return v1.createFragment((l_map_0(v59.props.Rows, function(v60, v61)
        return v1.createElement(l_Pane_0, {
            LayoutOrder = v61,
            AutomaticSize = Enum.AutomaticSize.XY
        }, {
            Row = v59.onRenderRow(v60)
        });
    end)));
end;
v16.render = function(v62)
    local l_props_4 = v62.props;
    local l_Stylizer_3 = l_props_4.Stylizer;
    local v65 = v62:renderHeadings();
    local l_ShowFooter_0 = l_props_4.ShowFooter;
    local l_ShowHeader_0 = l_props_4.ShowHeader;
    if l_ShowHeader_0 == nil then
        l_ShowHeader_0 = true;
    end;
    if l_ShowFooter_0 == nil then
        l_ShowFooter_0 = l_props_4.Footer ~= nil;
    end;
    local v68 = not not l_ShowHeader_0 and l_Stylizer_3.HeaderHeight or 0;
    local v69 = not not l_ShowFooter_0 and l_Stylizer_3.FooterHeight or 0;
    local v70 = not not l_props_4.Scroll and v62:renderScroll() or v62:renderRows();
    local v71 = l_ShowHeader_0 and v1.createElement(l_Pane_0, {
        Layout = Enum.FillDirection.Horizontal,
        LayoutOrder = 1,
        Size = UDim2.new(1, -8, 0, v68),
        Style = "SubtleBox",
        BorderColor3 = l_Stylizer_3.Border,
        BorderSizePixel = 1
    }, v65);
    local v72 = (l_props_4.OnColumnSizesChange and not l_props_4.UseScale) and not l_props_4.ClampSize;
    local v73 = 0;
    local v74 = UDim2.new(1, 0, 1, -(v68 + v69));
    if v72 then
        v73 = l_reduce_0(l_props_4.Columns, function(v75, v76)
            return v75 + (not v76.Width and 0 or v76.Width.Offset);
        end, 0);
        if v73 > 0 then
            v74 = UDim2.new(0, v73, 1, -(v68 + v69));
        end;
    end;
    local v77 = v1.createElement(l_Pane_0, {
        VerticalAlignment = Enum.VerticalAlignment.Top,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        Layout = Enum.FillDirection.Vertical,
        Padding = 2,
        LayoutOrder = 2,
        Size = v74,
        [v1.Event.MouseLeave] = l_props_4.OnMouseLeave
    }, {
        Child = v70
    });
    local _ = nil;
    return v1.createElement(l_Pane_0, {
        Size = l_props_4.Size,
        Layout = Enum.FillDirection.Vertical,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        Style = "BorderBox",
        Padding = 1,
        [v1.Change.AbsoluteSize] = not not l_props_4.OnSizeChange and v62.onSizeChange or nil
    }, {
        Top = if not v72 then v1.createFragment({
            Header = v71,
            List = v77
        }) else v1.createElement(l_ScrollingFrame_0, {
            CanvasSize = UDim2.fromOffset(v73, 0),
            ScrollingDirection = Enum.ScrollingDirection.X
        }, {
            Child = v1.createElement(l_Pane_0, {
                Layout = Enum.FillDirection.Vertical,
                HorizontalAlignment = Enum.HorizontalAlignment.Left
            }, {
                Header = v71,
                List = v77
            })
        }),
        Footer = l_ShowFooter_0 and v1.createElement(l_Pane_0, {
            LayoutOrder = 3,
            Style = "SubtleBox",
            BorderColor3 = l_Stylizer_3.Border,
            BorderSizePixel = 1,
            Size = UDim2.new(1, 0, 0, v69)
        }, {
            Content = l_props_4.Footer
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v16));


local l_StyleKey_0 = require(script.Parent.Parent.Parent.Parent.Packages.Framework).Style.StyleKey;
return {
    Border = l_StyleKey_0.Border,
    ScrollHeaderPadding = {
        Right = 8
    },
    RowHeight = 24,
    HeaderCellPadding = 5,
    HeaderHeight = 32,
    FooterHeight = 36,
    IconColor = l_StyleKey_0.Icon
};


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local l_mapOne_0 = v2.Dash.mapOne;
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_Tooltip_0 = l_UI_0.Tooltip;
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Image_0 = l_UI_0.Image;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_game_FastInt_0 = game:GetFastInt("SoundEffectMaxDuration");
local v13 = v1.PureComponent:extend("LeftCell");
v13.getContent = function(v14)
    local l_props_0 = v14.props;
    local v16 = l_props_0.CellProps.Locations[l_props_0.Row.Id] or {};
    if l_props_0.ColumnIndex > 1 then
        local l_Value_0 = l_props_0.Value;
        if typeof(l_props_0.Value) == "number" then
            l_Value_0 = tostring(l_Value_0);
            local v19 = if not v16 then nil else l_mapOne_0(v16, function(v18)
                if v18.Instance.ClassName == "Sound" then
                    return v18.Instance;
                else
                    return nil;
                end;
            end);
            if v19 then
                l_Value_0 = tostring(v19.TimeLength);
            end;
            l_Value_0 = l_Value_0 .. "s";
        end;
        return v1.createElement(l_TextLabel_0, {
            TextColor = l_props_0.Style.Text,
            TextTruncate = Enum.TextTruncate.AtEnd,
            Size = UDim2.fromScale(1, 1),
            TextXAlignment = Enum.TextXAlignment.Left,
            LayoutOrder = l_props_0.ColumnIndex,
            Text = l_Value_0
        });
    else
        local l_Value_1 = l_props_0.Value;
        if l_Value_1 == "" then
            return ;
        else
            if l_Value_1 == "error" and #v16 == 0 then
                l_Value_1 = "done";
            end;
            return v1.createElement(l_Image_0, {
                Size = UDim2.fromOffset(24, 24),
                Image = ("rbxasset://textures/AudioDiscovery/%s.png"):format(l_Value_1)
            });
        end;
    end;
end;
v13.render = function(v21)
    local l_props_1 = v21.props;
    local l_Localization_1 = l_props_1.Localization;
    local l_Style_0 = l_props_1.Style;
    local v25 = if l_props_1.RowIndex % 2 == 1 then l_Style_0.BackgroundOdd else l_Style_0.BackgroundEven;
    local v26 = l_props_1.Width or UDim.new(1 / #l_props_1.Columns, 0);
    local v27 = if not l_props_1.Value then nil else tostring(l_props_1.Value);
    local v28 = l_props_1.CellProps.Locations[l_props_1.Row.Id] or {};
    if l_props_1.ColumnIndex == 1 then
        v27 = if #v28 == 0 then l_Localization_1:getText("Reason", "Done") else if l_props_1.Value == "ok" then if l_props_1.Row.Creator == "Roblox" then l_Localization_1:getText("Reason", "Roblox") else if l_props_1.Row.Creator == "Monstercat" then l_Localization_1:getText("Reason", "Monstercat") else if l_props_1.Row.Time < l_game_FastInt_0 then l_Localization_1:getText("Reason", "Effect") else l_Localization_1:getText("Reason", "OK") else l_Localization_1:getText("Reason", "Error");
    elseif l_props_1.ColumnIndex == 5 then
        v27 = ("%s %s"):format(l_props_1.Row.CreatorType, l_props_1.Row.CreatorId);
    end;
    return v1.createElement(l_Pane_0, {
        LayoutOrder = l_props_1.ColumnIndex,
        Padding = {
            Top = 1,
            Bottom = 1,
            Left = 5,
            Right = 5
        },
        Style = "Box",
        BackgroundColor3 = v25,
        BorderSizePixel = 1,
        BorderColor3 = l_Style_0.Border,
        Size = UDim2.new(v26.Scale, v26.Offset, 1, 0)
    }, {
        Child = v21:getContent(),
        Tooltip = v27 and v1.createElement(l_Tooltip_0, {
            MaxWidth = l_Style_0.Tooltip.MaxWidth,
            Text = v27,
            TextXAlignment = Enum.TextXAlignment.Left
        })
    });
end;
return l_withContext_0({
    Localization = l_Localization_0
})(v13);


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.RoactRodux);
local v3 = require(l_Parent_0.Packages.Framework);
local l_Dash_0 = v3.Dash;
local l_map_0 = l_Dash_0.map;
local l_join_0 = l_Dash_0.join;
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local v10 = require(l_Parent_0.Src.Util.Analytics);
local v11 = require(l_Parent_0.Src.Actions.SelectRow);
local v12 = require(l_Parent_0.Src.Actions.SortTable);
local l_Stylizer_0 = v3.Style.Stylizer;
local l_Selection_0 = game:GetService("Selection");
local v15 = require(l_Parent_0.Src.Components.AudioTable);
local v16 = require(script.LeftCell);
local v17 = v1.PureComponent:extend("LeftPanel");
v17.init = function(v18)
    v18.state = {
        sizes = {
            UDim.new(0.1, 0),
            UDim.new(0.2, 0),
            UDim.new(0.3, 0),
            UDim.new(0.1, 0),
            UDim.new(0.3, 0)
        }
    };
    v18.onSizesChange = function(v19)
        v18:setState({
            sizes = v19
        });
    end;
    v18.onSelectRow = function(v20, v21)
        local v22 = v18.props.Locations[v20.Id];
        if v22 and #v22 > 0 then
            l_Selection_0:Set({
                v22[1].Instance
            });
        end;
        v18.props.OnSelectRow(v21);
        v10:reportSelect();
    end;
end;
v17.render = function(v23)
    local l_props_0 = v23.props;
    local l_state_0 = v23.state;
    local l_Localization_1 = l_props_0.Localization;
    return v1.createElement(v15, {
        Scroll = true,
        UseScale = true,
        ClampSize = true,
        OnColumnSizesChange = v23.onSizesChange,
        SortIndex = l_props_0.SortIndex,
        SortOrder = l_props_0.SortOrder,
        OnSortChange = l_props_0.Sort,
        CellComponent = v16,
        Columns = l_map_0({
            {
                Name = l_Localization_1:getText("Table", "OK")
            },
            {
                Name = l_Localization_1:getText("Table", "Id")
            },
            {
                Name = l_Localization_1:getText("Table", "Name")
            },
            {
                Name = l_Localization_1:getText("Table", "Time")
            },
            {
                Name = l_Localization_1:getText("Table", "Creator")
            }
        }, function(v27, v28)
            return l_join_0(v27, {
                Width = l_state_0.sizes[v28]
            });
        end),
        Rows = l_props_0.Rows,
        SelectedRow = l_props_0.SelectedRow,
        OnSelectRow = v23.onSelectRow,
        CellProps = {
            Locations = l_props_0.Locations
        }
    });
end;
return v2.connect(function(v29, _)
    return {
        Locations = v29.Audio.Locations,
        Rows = v29.Audio.Rows,
        SelectedRow = v29.Audio.SelectedRow,
        SortIndex = v29.Audio.Left.SortIndex,
        SortOrder = v29.Audio.Left.SortOrder
    };
end, function(v31)
    return {
        OnSelectRow = function(v32)
            v31(v11(v32));
        end,
        Sort = function(v33, v34)
            v31(v12("Left", v33, v34));
        end
    };
end)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v17)));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local l_TextLabel_0 = v2.UI.TextLabel;
local l_join_0 = v2.Dash.join;
local l_TextService_0 = game:GetService("TextService");
local v6 = utf8.char(8230);
local v7 = v1.PureComponent:extend("FooLabel");
v7.init = function(v8)
    v8.textRef = v1.createRef();
    v8.getTextWidth = function(v9)
        local l_current_0 = v8.textRef.current;
        if l_current_0 then
            return l_TextService_0:GetTextSize(v9, l_current_0.TextSize, l_current_0.Font, Vector2.new(math.huge, math.huge)).x;
        else
            return 0;
        end;
    end;
    v8.updateText = function()
        local l_Text_0 = v8.props.Text;
        local l_current_1 = v8.textRef.current;
        if l_current_1 then
            local l_X_0 = l_current_1.AbsoluteSize.X;
            if v8.getTextWidth(l_Text_0) <= l_X_0 then
                l_current_1.Text = l_Text_0;
                l_current_1.TextXAlignment = Enum.TextXAlignment.Left;
                return ;
            else
                l_current_1.TextXAlignment = Enum.TextXAlignment.Right;
                local v14 = 0;
                for v15 = -1, -#l_Text_0, -1 do
                    if not (l_X_0 < v8.getTextWidth(l_Text_0:sub(v15))) then
                        v14 = v15;
                    else
                        break;
                    end;
                end;
                if v14 >= -2 then
                    l_current_1.Text = v6;
                    return ;
                else
                    l_current_1.Text = v6 .. l_Text_0:sub(v14 + 2);
                    return ;
                end;
            end;
        else
            return ;
        end;
    end;
    v8.onAbsoluteSizeChange = function()
        if v8.props[v1.Change.AbsoluteSize] then
            v8.props[v1.Change.AbsoluteSize]();
        end;
        v8.updateText();
    end;
end;
v7.didMount = function(v16)
    v16.updateText();
end;
v7.didUpdate = function(v17, v18, _)
    if v18.Text ~= v17.props.Text then
        v17.updateText();
    end;
end;
v7.render = function(v20)
    return v1.createElement(l_TextLabel_0, l_join_0(v20.props, {
        [v1.Ref] = v20.textRef,
        [v1.Change.AbsoluteSize] = v20.onAbsoluteSizeChange
    }));
end;
return v7;


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local l_UI_0 = require(l_Parent_0.Packages.Framework).UI;
local l_Pane_0 = l_UI_0.Pane;
local l_Tooltip_0 = l_UI_0.Tooltip;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v6 = require(l_Parent_0.Src.Components.LeftTruncateTextLabel);
local l_StudioService_0 = game:GetService("StudioService");
local v8 = v1.PureComponent:extend("RightCell");
v8.getIcon = function(v9)
    local l_props_0 = v9.props;
    if type(l_props_0.Value) ~= "userdata" then
        return ;
    else
        local l_l_StudioService_0_ClassIcon_0 = l_StudioService_0:GetClassIcon(l_props_0.Value.ClassName);
        local v12 = l_l_StudioService_0_ClassIcon_0.ImageRectSize or Vector2.new();
        return v1.createElement("ImageLabel", {
            Size = UDim2.fromOffset(v12.X, v12.Y),
            BackgroundTransparency = 1,
            Image = l_l_StudioService_0_ClassIcon_0.Image,
            ImageRectSize = v12,
            ImageRectOffset = l_l_StudioService_0_ClassIcon_0.ImageRectOffset,
            Position = UDim2.new(0, 2, 0.5, 0),
            AnchorPoint = Vector2.new(0, 0.5)
        });
    end;
end;
v8.render = function(v13)
    local l_props_1 = v13.props;
    local l_Style_0 = l_props_1.Style;
    local v16 = if l_props_1.RowIndex % 2 == 1 then l_Style_0.BackgroundOdd else l_Style_0.BackgroundEven;
    local v17 = l_props_1.Width or UDim.new(1 / #l_props_1.Columns, 0);
    local v18 = if not l_props_1.Value then nil else tostring(l_props_1.Value);
    local v19 = v13:getIcon();
    local _ = nil;
    return v1.createElement(l_Pane_0, {
        LayoutOrder = l_props_1.ColumnIndex,
        Padding = {
            Top = 1,
            Bottom = 1,
            Left = 5,
            Right = 5
        },
        Style = "Box",
        BackgroundColor3 = v16,
        BorderSizePixel = 1,
        BorderColor3 = l_Style_0.Border,
        Size = UDim2.new(v17.Scale, v17.Offset, 1, 0)
    }, {
        Icon = v19,
        Label = if not v19 then v1.createElement(v6, {
            TextColor = l_props_1.Style.Text,
            Size = UDim2.fromScale(1, 1),
            TextXAlignment = Enum.TextXAlignment.Left,
            LayoutOrder = l_props_1.ColumnIndex,
            Text = tostring(l_props_1.Value)
        }) else v1.createElement(l_TextLabel_0, {
            TextColor = l_props_1.Style.Text,
            TextTruncate = Enum.TextTruncate.AtEnd,
            Position = UDim2.fromOffset(24, 0),
            Size = UDim2.new(1, -24, 1, 0),
            TextXAlignment = Enum.TextXAlignment.Left,
            LayoutOrder = l_props_1.ColumnIndex,
            Text = tostring(l_props_1.Value)
        }),
        Tooltip = v18 and v1.createElement(l_Tooltip_0, {
            MaxWidth = l_Style_0.Tooltip.MaxWidth,
            Text = v18,
            TextXAlignment = Enum.TextXAlignment.Left
        })
    });
end;
return v8;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.RoactRodux);
local v3 = require(l_Parent_0.Packages.Framework);
local l_Dash_0 = v3.Dash;
local l_map_0 = l_Dash_0.map;
local l_join_0 = l_Dash_0.join;
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local v10 = require(l_Parent_0.Src.Actions.SortTable);
local l_Selection_0 = game:GetService("Selection");
local l_Stylizer_0 = v3.Style.Stylizer;
local l_UI_0 = v3.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v16 = require(l_Parent_0.Src.Components.AudioTable);
local v17 = require(script.RightCell);
local v18 = v1.PureComponent:extend("RightPanel");
v18.init = function(v19)
    v19.state = {
        sizes = {
            UDim.new(0.3333333333333333, 0),
            UDim.new(0.6666666666666666, 0)
        }
    };
    v19.onSizesChange = function(v20)
        v19:setState({
            sizes = v20
        });
    end;
end;
v18.render = function(v21)
    local l_props_0 = v21.props;
    local l_state_0 = v21.state;
    local l_Localization_1 = l_props_0.Localization;
    local v27 = l_map_0({
        {
            Name = l_Localization_1:getText("Table", "Instance")
        },
        {
            Name = l_Localization_1:getText("Table", "Path")
        }
    }, function(v25, v26)
        return l_join_0(v25, {
            Width = l_state_0.sizes[v26]
        });
    end);
    if l_props_0.Rows and #l_props_0.Rows > 0 then
        return v1.createElement(v16, {
            Scroll = true,
            UseScale = true,
            ClampSize = true,
            OnColumnSizesChange = v21.onSizesChange,
            SortIndex = l_props_0.SortIndex,
            SortOrder = l_props_0.SortOrder,
            OnSortChange = l_props_0.Sort,
            Columns = v27,
            Rows = l_props_0.Rows,
            CellComponent = v17,
            OnSelectRow = function(v28)
                l_Selection_0:Set({
                    v28.Instance
                });
            end
        });
    else
        return v1.createElement(l_Pane_0, {
            Padding = 5
        }, {
            Child = v1.createElement(l_TextLabel_0, {
                TextXAlignment = Enum.TextXAlignment.Left,
                TextYAlignment = Enum.TextYAlignment.Top,
                TextWrapped = true,
                Size = UDim2.fromScale(1, 1),
                RichText = true,
                Text = l_Localization_1:getText("Plugin", "Info")
            })
        });
    end;
end;
return v2.connect(function(v29, _)
    local v31 = if not v29.Audio.SelectedRow then nil else v29.Audio.Rows[v29.Audio.SelectedRow];
    return {
        Rows = if not v31 then {} else v29.Audio.Locations[v31.Id],
        SortOrder = v29.Audio.Right.SortOrder,
        SortIndex = v29.Audio.Right.SortIndex
    };
end, function(v32)
    return {
        Sort = function(v33, v34)
            v32(v10("Right", v33, v34));
        end
    };
end)((l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_Stylizer_0
})(v18)));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.RoactRodux);
local v3 = require(l_Parent_0.Src.Thunks.DiscoverAudio);
local v4 = require(l_Parent_0.Src.Actions.SetDialog);
local v5 = require(l_Parent_0.Src.Actions.Unpause);
local v6 = require(l_Parent_0.Packages.Framework);
local l_UI_0 = v6.UI;
local l_DropShadow_0 = l_UI_0.DropShadow;
local l_Button_0 = l_UI_0.Button;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_ContextServices_0 = v6.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local v15 = require(l_Parent_0.Src.Components.LeftPanel);
local v16 = require(l_Parent_0.Src.Components.RightPanel);
local v17 = v1.PureComponent:extend("Window");
v17.render = function(v18)
    local l_props_0 = v18.props;
    local l_Localization_1 = l_props_0.Localization;
    local v21 = v1.createElement(l_Pane_0, {
        LayoutOrder = 2,
        Size = UDim2.new(1, 0, 1, 0),
        Layout = Enum.FillDirection.Horizontal
    }, {
        Left = v1.createElement(l_Pane_0, {
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            Layout = Enum.FillDirection.Vertical,
            Size = UDim2.new(0.65, 0, 1, 0),
            Style = "Box",
            LayoutOrder = 1
        }, {
            Top = v1.createElement(l_Pane_0, {
                Size = UDim2.new(1, 0, 0, 34),
                HorizontalAlignment = Enum.HorizontalAlignment.Left,
                Padding = 5,
                LayoutOrder = 1
            }, {
                Info = v1.createElement(l_TextLabel_0, {
                    AutomaticSize = Enum.AutomaticSize.XY,
                    LayoutOrder = 1,
                    Text = l_Localization_1:getText("Plugin", "LeftPaneInfo") .. (" (%d)"):format(#l_props_0.Rows),
                    TextXAlignment = Enum.TextXAlignment.Left,
                    Font = Enum.Font.SourceSansBold
                }),
                Refresh = v1.createElement(l_Button_0, {
                    Text = l_Localization_1:getText("Plugin", "Refresh"),
                    OnClick = l_props_0.Refresh,
                    Size = UDim2.fromOffset(80, 24),
                    Position = UDim2.fromScale(1, 0),
                    AnchorPoint = Vector2.new(1, 0),
                    Style = "Round"
                })
            }),
            Main = v1.createElement(l_Pane_0, {
                Size = UDim2.new(1, 0, 1, -34),
                ClipsDescendants = true,
                LayoutOrder = 2
            }, {
                Child = v1.createElement(v15)
            })
        }),
        Right = v1.createElement(l_Pane_0, {
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            Layout = Enum.FillDirection.Vertical,
            Size = UDim2.new(0.35, 0, 1, 0),
            Style = "Box",
            LayoutOrder = 2
        }, {
            Top = v1.createElement(l_Pane_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                HorizontalAlignment = Enum.HorizontalAlignment.Left,
                Padding = 5,
                LayoutOrder = 1
            }, {
                Info = v1.createElement(l_TextLabel_0, {
                    AutomaticSize = Enum.AutomaticSize.XY,
                    Text = l_Localization_1:getText("Plugin", "RightPaneInfo"),
                    TextXAlignment = Enum.TextXAlignment.Left,
                    Font = Enum.Font.SourceSansBold
                })
            }),
            Main = v1.createElement(l_Pane_0, {
                Size = UDim2.new(1, 0, 1, -34),
                ClipsDescendants = true,
                LayoutOrder = 2
            }, {
                Child = v1.createElement(v16)
            })
        })
    });
    if not l_props_0.Paused then
        if not l_props_0.Dialog then
            return v21;
        else
            return v1.createElement(l_Pane_0, {
                Style = "Box"
            }, {
                Pane = v21,
                Overlay = v1.createElement(l_Pane_0, {
                    Active = true,
                    Style = "Box",
                    BackgroundTransparency = 0.2,
                    ZIndex = 2
                }, {
                    Dialog = v1.createElement(l_Pane_0, {
                        Position = UDim2.fromScale(0.5, 0.5),
                        AnchorPoint = Vector2.new(0.5, 0.5),
                        Size = UDim2.fromOffset(400, 250)
                    }, {
                        DropShadow = v1.createElement(l_DropShadow_0, {}, {
                            Child = v1.createElement(l_Pane_0, {
                                Style = "Box",
                                Layout = Enum.FillDirection.Vertical,
                                HorizontalAlignment = Enum.HorizontalAlignment.Right,
                                Padding = 20,
                                Spacing = 5
                            }, {
                                Title = v1.createElement(l_TextLabel_0, {
                                    TextSize = 24,
                                    TextXAlignment = Enum.TextXAlignment.Left,
                                    Text = l_Localization_1:getText("Dialog", "Title"),
                                    AutomaticSize = Enum.AutomaticSize.Y,
                                    Size = UDim2.fromScale(1, 0),
                                    LayoutOrder = 1
                                }),
                                Text = v1.createElement(l_TextLabel_0, {
                                    TextSize = 17,
                                    TextXAlignment = Enum.TextXAlignment.Left,
                                    Text = l_Localization_1:getText("Dialog", "Text"),
                                    RichText = true,
                                    AutomaticSize = Enum.AutomaticSize.Y,
                                    Size = UDim2.fromScale(1, 0),
                                    TextWrapped = true,
                                    LayoutOrder = 2
                                }),
                                Close = v1.createElement(l_Button_0, {
                                    Text = l_Localization_1:getText("Dialog", "Close"),
                                    OnClick = l_props_0.CloseDialog,
                                    Size = UDim2.fromOffset(120, 32),
                                    LayoutOrder = 3,
                                    Style = "Round"
                                })
                            })
                        })
                    })
                })
            });
        end;
    else
        return v1.createElement(l_Pane_0, {
            Style = "Box"
        }, {
            Pane = v21,
            Overlay = v1.createElement(l_Pane_0, {
                Active = true,
                Style = "Box",
                BackgroundTransparency = 0.2,
                ZIndex = 2
            }, {
                Dialog = v1.createElement(l_Pane_0, {
                    Position = UDim2.fromScale(0.5, 0.5),
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    Size = UDim2.fromOffset(400, 150)
                }, {
                    DropShadow = v1.createElement(l_DropShadow_0, {}, {
                        Child = v1.createElement(l_Pane_0, {
                            Style = "Box",
                            Layout = Enum.FillDirection.Vertical,
                            HorizontalAlignment = Enum.HorizontalAlignment.Right,
                            Padding = 20,
                            Spacing = 5
                        }, {
                            Title = v1.createElement(l_TextLabel_0, {
                                TextSize = 24,
                                TextXAlignment = Enum.TextXAlignment.Left,
                                Text = l_Localization_1:getText("PausedDialog", "Title"),
                                AutomaticSize = Enum.AutomaticSize.Y,
                                Size = UDim2.fromScale(1, 0),
                                LayoutOrder = 1
                            }),
                            Text = v1.createElement(l_TextLabel_0, {
                                TextSize = 17,
                                TextXAlignment = Enum.TextXAlignment.Left,
                                Text = l_Localization_1:getText("PausedDialog", "Text"),
                                RichText = true,
                                AutomaticSize = Enum.AutomaticSize.Y,
                                Size = UDim2.fromScale(1, 0),
                                TextWrapped = true,
                                LayoutOrder = 2
                            }),
                            Close = v1.createElement(l_Button_0, {
                                Text = l_Localization_1:getText("PausedDialog", "Close"),
                                OnClick = v18.props.Unpause,
                                Size = UDim2.fromOffset(120, 32),
                                LayoutOrder = 3,
                                Style = "Round"
                            })
                        })
                    })
                })
            })
        });
    end;
end;
return v2.connect(function(v22, _)
    return {
        Paused = v22.Audio.Paused,
        Dialog = v22.Audio.Dialog,
        Rows = v22.Audio.Rows
    };
end, function(v24)
    return {
        Refresh = function()
            v24(v3());
        end,
        CloseDialog = function()
            v24(v4(false));
        end,
        Unpause = function()
            v24(v5());
            v24(v3());
        end
    };
end)((l_withContext_0({
    Localization = l_Localization_0
})(v17)));


local l_StudioFixPluginWidgetLocalizedIds_0 = game:GetFastFlag("StudioFixPluginWidgetLocalizedIds");
local l_AudioDiscoveryLoader_0 = game:GetFastFlag("AudioDiscoveryLoader");
local l_Parent_0 = script.Parent.Parent;
local v3 = require(l_Parent_0.Packages.Roact);
local v4 = require(l_Parent_0.Packages.Rodux);
local v5 = require(l_Parent_0.Packages.Framework);
local v6 = require(l_Parent_0.Src.Actions.UpdateRows);
local l_ThunkWithArgsMiddleware_0 = v5.Util.ThunkWithArgsMiddleware;
local l_UI_0 = v5.UI;
local l_DockWidget_0 = l_UI_0.DockWidget;
local l_PluginButton_0 = l_UI_0.PluginButton;
local l_PluginToolbar_0 = l_UI_0.PluginToolbar;
local l_ContextServices_0 = v5.ContextServices;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_Mouse_0 = l_ContextServices_0.Mouse;
local l_Store_0 = l_ContextServices_0.Store;
local v16 = require(l_Parent_0.Src.Reducers.MainReducer);
local l_makeTheme_0 = v5.Style.makeTheme;
local l_SourceStrings_0 = l_Parent_0.Src.Resources.Localization.SourceStrings;
local l_LocalizedStrings_0 = l_Parent_0.Src.Resources.Localization.LocalizedStrings;
local v20 = require(l_Parent_0.Src.Components.Window);
local v21 = require(l_Parent_0.Src.Actions.SetDialog);
local v22 = require(l_Parent_0.Src.Actions.Unpause);
local v23 = require(l_Parent_0.Src.Thunks.DiscoverAudio);
local v24 = require(l_Parent_0.Src.Util.Analytics);
local v25 = v3.PureComponent:extend("MainPlugin");
v25.init = function(v26, v27)
    v26.state = {
        enabled = false
    };
    v26.toggleEnabled = function()
        local v28 = not v26.state.enabled;
        v26.setEnabled(v28);
        if v28 then
            v26.store:dispatch(v22());
            v26.store:dispatch(v23());
        end;
    end;
    v26.onClose = function()
        v26.setEnabled(false);
    end;
    v26.onRestore = function(v29)
        v26.setEnabled(v29);
    end;
    v26.onWidgetEnabledChanged = function(v30)
        v26.setEnabled(v30.Enabled);
    end;
    v26.setEnabled = function(v31)
        v26:setState({
            enabled = v31
        });
    end;
    v26.onDockWidgetCreated = function()
        v26.props.pluginLoaderContext.mainButtonClickedSignal:Connect(v26.toggleEnabled);
    end;
    v26.store = v4.Store.new(v16, nil, {
        l_ThunkWithArgsMiddleware_0({
            SoundAssetChecker = v27.SoundAssetChecker
        })
    }, nil);
    v26.localization = l_ContextServices_0.Localization.new({
        stringResourceTable = l_SourceStrings_0,
        translationResourceTable = l_LocalizedStrings_0,
        pluginName = "AudioDiscovery"
    });
    v26.analytics = l_ContextServices_0.Analytics.new(function()
        return {};
    end, {});
end;
v25.didUpdate = function(v32)
    if v32.state.enabled and game.CreatorId == 0 then
        v32.store:dispatch(v21(true));
    end;
    if v32.props.pluginLoaderContext then
        v32.props.pluginLoaderContext.mainButton:SetActive(v32.state.enabled);
    end;
end;
v25.didMount = function(v33)
    v24:reportOpen();
    v33.connection = v33.props.SoundAssetChecker.soundsFound:Connect(function(v34)
        v33.store:dispatch(v6(v34));
    end);
end;
v25.willUnmount = function(v35)
    v35.connection:Disconnect();
end;
v25.renderButtons = function(v36, v37)
    return {
        Toggle = v3.createElement(l_PluginButton_0, {
            Id = "ViewSounds",
            Toolbar = v37,
            Active = v36.state.enabled,
            Title = v36.localization:getText("Plugin", "Button"),
            Tooltip = v36.localization:getText("Plugin", "Description"),
            Icon = "rbxasset://textures/AudioDiscovery/icon.png",
            OnClick = v36.toggleEnabled,
            ClickableWhenViewportHidden = true
        })
    };
end;
v25.render = function(v38)
    local l_props_0 = v38.props;
    local l_state_0 = v38.state;
    local l_Plugin_1 = l_props_0.Plugin;
    return l_ContextServices_0.provide({
        l_Plugin_0.new(l_Plugin_1),
        l_Store_0.new(v38.store),
        l_Mouse_0.new(l_Plugin_1:getMouse()),
        l_makeTheme_0(l_Parent_0.Src.Components)(),
        v38.localization,
        v38.analytics
    }, {
        Toolbar = if not l_AudioDiscoveryLoader_0 then v3.createElement(l_PluginToolbar_0, {
            Title = v38.localization:getText("Plugin", "Toolbar"),
            RenderButtons = function(v42)
                return v38:renderButtons(v42);
            end
        }) else nil,
        MainWidget = v3.createElement(l_DockWidget_0, {
            Id = if not l_StudioFixPluginWidgetLocalizedIds_0 then nil else "AudioDiscovery",
            Widget = if not l_AudioDiscoveryLoader_0 then nil else l_props_0.pluginLoaderContext.mainDockWidget,
            OnWidgetCreated = if not l_AudioDiscoveryLoader_0 then nil else v38.onDockWidgetCreated,
            Enabled = l_state_0.enabled,
            Title = v38.localization:getText("Plugin", "Name"),
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
            InitialDockState = Enum.InitialDockState.Bottom,
            Size = Vector2.new(640, 480),
            MinSize = Vector2.new(250, 200),
            OnClose = v38.onClose,
            ShouldRestore = true,
            OnWidgetRestored = v38.onRestore,
            [v3.Change.Enabled] = v38.onWidgetEnabledChanged
        }, {
            Window = v3.createElement(v20)
        })
    });
end;
return v25;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local l_Dash_0 = require(l_Parent_0.Packages.Framework).Dash;
local l_append_0 = l_Dash_0.append;
local l_join_0 = l_Dash_0.join;
local l_findIndex_0 = l_Dash_0.findIndex;
local l_None_0 = l_Dash_0.None;
local l_sort_0 = table.sort;
local l_Actions_0 = l_Parent_0.Src.Actions;
local v9 = require(l_Actions_0.SetDialog);
local v10 = require(l_Actions_0.SelectRow);
local v11 = require(l_Actions_0.Unpause);
local v12 = require(l_Actions_0.UpdateRows);
local v13 = require(l_Actions_0.UpdateLocations);
local v14 = require(l_Actions_0.SortTable);
local v15 = {
    Left = {
        "OK",
        "Id",
        "Name",
        "Time",
        "Creator"
    },
    Right = {
        "Instance",
        "Path"
    }
};
local function _(v16, v17, v18)
    local v19 = v17[v16];
    if v16 == "Id" then
        return (tonumber(v19));
    elseif v18 and v16 == "OK" then
        if v18[v17.Id] and #v18[v17.Id] == 0 then
            return "fixed";
        else
            return v19;
        end;
    elseif type(v19) == "userdata" then
        return (tostring(v19));
    else
        return v19;
    end;
end;
local function v38(v21, v22, v23, v24)
    local v25 = l_join_0({}, v21);
    l_sort_0(v25, function(v26, v27)
        if v23 == Enum.SortDirection.Descending then
            local l_v22_0 = v22;
            local l_v24_0 = v24;
            local v30 = v26[l_v22_0];
            local v31 = if l_v22_0 == "Id" then tonumber(v30) else if l_v24_0 and l_v22_0 == "OK" then (l_v24_0[v26.Id] and #l_v24_0[v26.Id] == 0) and "fixed" or v30 else if type(v30) == "userdata" then tostring(v30) else v30;
            l_v24_0 = v22;
            v30 = v24;
            local v32 = v27[l_v24_0];
            return v31 < if l_v24_0 == "Id" then tonumber(v32) else if v30 and l_v24_0 == "OK" then (v30[v27.Id] and #v30[v27.Id] == 0) and "fixed" or v32 else if type(v32) == "userdata" then tostring(v32) else v32;
        else
            local l_v22_1 = v22;
            local l_v24_1 = v24;
            local v35 = v26[l_v22_1];
            local v36 = if l_v22_1 == "Id" then tonumber(v35) else if l_v24_1 and l_v22_1 == "OK" then (l_v24_1[v26.Id] and #l_v24_1[v26.Id] == 0) and "fixed" or v35 else if type(v35) == "userdata" then tostring(v35) else v35;
            l_v24_1 = v22;
            v35 = v24;
            local v37 = v27[l_v24_1];
            return if l_v24_1 == "Id" then tonumber(v37) else if v35 and l_v24_1 == "OK" then (v35[v27.Id] and #v35[v27.Id] == 0) and "fixed" or v37 else if type(v37) == "userdata" then tostring(v37) else v37 < v36;
        end;
    end);
    return v25;
end;
return v1.createReducer({
    Dialog = false,
    Paused = true,
    Rows = {},
    SelectedRow = nil,
    Left = {
        SortIndex = 1,
        SortOrder = Enum.SortDirection.Descending
    },
    Right = {}
}, {
    [v9.name] = function(v39, v40)
        return l_join_0(v39, {
            Dialog = v40.Open
        });
    end,
    [v12.name] = function(v41, v42)
        local v43 = v15.Left[v41.Left.SortIndex];
        local v44 = l_append_0({}, v41.Rows, v42.Rows);
        local v45 = nil;
        local v46 = v38(v44, v43, v41.Left.SortOrder, v41.Locations);
        if v41.SelectedRow then
            local l_Id_0 = v41.Rows[v41.SelectedRow].Id;
            v45 = l_findIndex_0(v46, function(v48)
                return v48.Id == l_Id_0;
            end) or l_None_0;
        end;
        return l_join_0(v41, {
            SelectedRow = v45,
            Rows = v46
        });
    end,
    [v11.name] = function(v49)
        return l_join_0(v49, {
            Paused = false
        });
    end,
    [v10.name] = function(v50, v51)
        local l_locations_0 = v50.locations;
        if not (not v50.Right.SortIndex or not v50.SelectedRow) then
            local l_Id_1 = v50.Rows[v50.SelectedRow].Id;
            l_locations_0 = l_join_0({}, v50.Locations, {
                [l_Id_1] = v38(v50.Locations[l_Id_1], v15.Right[v50.Right.SortIndex], v50.Right.SortOrder)
            });
        end;
        return l_join_0(v50, {
            Locations = l_locations_0,
            SelectedRow = v51.SelectedRow
        });
    end,
    [v13.name] = function(v54, v55)
        local _ = nil;
        local v57 = l_join_0({}, v54.Locations, v55.Locations);
        return l_join_0(v54, {
            Rows = v38(v54.Rows, v15.Left[v54.Left.SortIndex], v54.Left.SortOrder, v57),
            Locations = v57
        });
    end,
    [v14.name] = function(v58, v59)
        local v60 = v15[v59.TableName][v59.SortIndex];
        local l_SelectedRow_0 = v58.SelectedRow;
        local l_Rows_0 = v58.Rows;
        local l_Locations_0 = v58.Locations;
        local v64 = if not v58.SelectedRow then nil else v58.Rows[v58.SelectedRow].Id;
        if v59.TableName == "Left" then
            l_Rows_0 = v38(v58.Rows, v60, v59.SortOrder, l_Locations_0);
            if v58.SelectedRow then
                l_SelectedRow_0 = l_findIndex_0(l_Rows_0, function(v65)
                    return v65.Id == v64;
                end) or l_None_0;
            end;
        end;
        if not (not (v59.TableName == "Right") or not v64) then
            l_Locations_0 = l_join_0({}, v58.Locations, {
                [v64] = v38(v58.Locations[v64], v60, v59.SortOrder)
            });
        end;
        return l_join_0(v58, {
            SelectedRow = l_SelectedRow_0,
            Rows = l_Rows_0,
            Locations = l_Locations_0,
            [v59.TableName] = {
                SortIndex = v59.SortIndex,
                SortOrder = v59.SortOrder
            }
        });
    end
});


return (require(script.Parent.Parent.Parent.Packages.Rodux).combineReducers({
    Audio = require(script.Parent.AudioReducer)
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Actions.UpdateLocations);
local v2 = require(l_Parent_0.Packages.Framework);
local v3 = require(l_Parent_0.Src.Util.findAllAssetIds);
local l_Dash_0 = v2.Dash;
local l_map_0 = l_Dash_0.map;
local l_forEach_0 = l_Dash_0.forEach;
return function()
    return function(v7, v8)
        local v9 = {};
        for v10, v11 in pairs(v3()) do
            v8.SoundAssetChecker:addAssetId(v10);
            v9[v10] = l_map_0(v11, function(v12)
                return {
                    Instance = v12,
                    Path = v12:GetFullName()
                };
            end);
        end;
        l_forEach_0(v7:getState().Audio.Rows, function(v13)
            if not v9[v13.Id] then
                v9[v13.Id] = {};
                v8.SoundAssetChecker:resolved(v13.Id);
            end;
        end);
        v8.SoundAssetChecker:flush();
        v7:dispatch(v1(v9));
    end;
end;


local l_Workspace_0 = game:GetService("Workspace");
local l_status_0, l_result_0 = pcall(function()
    return game:GetService("StudioService"):HasInternalPermission();
end);
local function _(v3, v4)
    v4 = v4 or false;
    return function()
        local l_AudioDiscoveryFlags_0 = l_Workspace_0:FindFirstChild("AudioDiscoveryFlags");
        if l_AudioDiscoveryFlags_0 and l_AudioDiscoveryFlags_0:FindFirstChild(v3) then
            return l_AudioDiscoveryFlags_0[v3].Value;
        else
            return v4;
        end;
    end;
end;
local v7 = {};
local v8 = nil or false;
local v9 = "RunningUnderCLI";
local l_v9_0 = v9 --[[ copy: 7 -> 8 ]];
local v11;
do
    local l_v8_0 = v8;
    v11 = function()
        local l_AudioDiscoveryFlags_1 = l_Workspace_0:FindFirstChild("AudioDiscoveryFlags");
        if l_AudioDiscoveryFlags_1 and l_AudioDiscoveryFlags_1:FindFirstChild(l_v9_0) then
            return l_AudioDiscoveryFlags_1[l_v9_0].Value;
        else
            return l_v8_0;
        end;
    end;
end;
v7.RunningUnderCLI = v11;
v8 = false or false;
v9 = "RunTests";
local l_v9_1 = v9 --[[ copy: 7 -> 9 ]];
do
    local l_v8_1 = v8;
    v11 = function()
        local l_AudioDiscoveryFlags_2 = l_Workspace_0:FindFirstChild("AudioDiscoveryFlags");
        if l_AudioDiscoveryFlags_2 and l_AudioDiscoveryFlags_2:FindFirstChild(l_v9_1) then
            return l_AudioDiscoveryFlags_2[l_v9_1].Value;
        else
            return l_v8_1;
        end;
    end;
end;
v7.RunTests = v11;
v8 = nil or false;
v9 = "LogTestsQuiet";
local l_v9_2 = v9 --[[ copy: 7 -> 10 ]];
do
    local l_v8_2 = v8;
    v11 = function()
        local l_AudioDiscoveryFlags_3 = l_Workspace_0:FindFirstChild("AudioDiscoveryFlags");
        if l_AudioDiscoveryFlags_3 and l_AudioDiscoveryFlags_3:FindFirstChild(l_v9_2) then
            return l_AudioDiscoveryFlags_3[l_v9_2].Value;
        else
            return l_v8_2;
        end;
    end;
end;
v7.LogTestsQuiet = v11;
v8 = nil or false;
v9 = "LogAnalytics";
local l_v9_3 = v9 --[[ copy: 7 -> 11 ]];
do
    local l_v8_3 = v8;
    v11 = function()
        local l_AudioDiscoveryFlags_4 = l_Workspace_0:FindFirstChild("AudioDiscoveryFlags");
        if l_AudioDiscoveryFlags_4 and l_AudioDiscoveryFlags_4:FindFirstChild(l_v9_3) then
            return l_AudioDiscoveryFlags_4[l_v9_3].Value;
        else
            return l_v8_3;
        end;
    end;
end;
v7.LogAnalytics = v11;
v8 = nil or false;
v9 = "RunDeveloperFrameworkTests";
local l_v9_4 = v9 --[[ copy: 7 -> 12 ]];
do
    local l_v8_4 = v8;
    v11 = function()
        local l_AudioDiscoveryFlags_5 = l_Workspace_0:FindFirstChild("AudioDiscoveryFlags");
        if l_AudioDiscoveryFlags_5 and l_AudioDiscoveryFlags_5:FindFirstChild(l_v9_4) then
            return l_AudioDiscoveryFlags_5[l_v9_4].Value;
        else
            return l_v8_4;
        end;
    end;
end;
v7.RunDeveloperFrameworkTests = v11;
v8 = l_status_0 and l_result_0 or false;
v9 = "EnableRoactConfigs";
do
    local l_v8_5 = v8;
    v11 = function()
        local l_AudioDiscoveryFlags_6 = l_Workspace_0:FindFirstChild("AudioDiscoveryFlags");
        if l_AudioDiscoveryFlags_6 and l_AudioDiscoveryFlags_6:FindFirstChild(v9) then
            return l_AudioDiscoveryFlags_6[v9].Value;
        else
            return l_v8_5;
        end;
    end;
end;
v7.EnableRoactConfigs = v11;
return v7;


local v0 = require(script.Parent.isAssetIdLike);
local v1 = require(script.Parent.normalizeAssetId);
local v2 = require(script.Parent.findAssetIdsInSource);
local v3 = {
    game:GetService("Workspace"),
    game:GetService("ReplicatedFirst"),
    game:GetService("ReplicatedStorage"),
    game:GetService("ServerStorage"),
    game:GetService("ServerScriptService"),
    game:GetService("Lighting"),
    game:GetService("StarterGui"),
    game:GetService("StarterPack"),
    game:GetService("StarterPlayer"),
    game:GetService("SoundService"),
    game:GetService("Teams")
};
local _ = require(script.Parent.Parent.Types);
local v13 = {
    Sound = function(v5)
        local l_SoundId_0 = v5.SoundId;
        if not (l_SoundId_0 ~= "" and l_SoundId_0 ~= "0") or l_SoundId_0 == " " then
            return nil;
        else
            local v7 = v1(l_SoundId_0);
            if not v7 then
                return nil;
            else
                return {
                    v7
                };
            end;
        end;
    end,
    LuaSourceContainer = function(v8)
        if v8.Parent.Name:lower() == "boombox" then
            return nil;
        else
            return v2(v8.Source);
        end;
    end,
    StringValue = function(v9)
        local v10 = v1(v9.Value);
        if not v10 or not v0(v10) then
            return nil;
        else
            return {
                v10
            };
        end;
    end,
    IntValue = function(v11)
        local v12 = tostring(v11.Value);
        if not v0(v12) then
            return nil;
        else
            return {
                v12
            };
        end;
    end
};
local v14 = {};
local function v19(v15)
    local v16 = v14[v15.ClassName];
    if not v16 then
        for v17, _ in pairs(v13) do
            if v15:IsA(v17) then
                v16 = v17;
            end;
        end;
        if not v16 then
            v16 = "Instance";
        end;
        v14[v15.ClassName] = v16;
    end;
    return v13[v16];
end;
return function()
    local v20 = {};
    local v21 = 0;
    for _, v23 in ipairs(v3) do
        for _, v25 in ipairs(v23:GetDescendants()) do
            local v26 = v19(v25);
            if v26 then
                local v27 = v26(v25);
                if v27 then
                    for _, v29 in ipairs(v27) do
                        local v30 = v20[v29];
                        if not v30 then
                            v20[v29] = {
                                v25
                            };
                            v21 = v21 + 1;
                        else
                            table.insert(v30, v25);
                        end;
                    end;
                end;
            end;
        end;
    end;
    return v20;
end;


local v0 = require(script.Parent.isAssetIdLike);
return function(v1)
    local v2 = {};
    local v3 = {};
    local v4 = 1;
    while true do
        local v5, v6 = string.find(v1, "%d+", v4);
        if v5 then
            if (v6 - v5) + 1 > 4 then
                local v7 = string.sub(v1, v5, v6);
                if not ((not (string.sub(v1, v5 - 1, v5 - 1) ~= ".") or string.sub(v1, v5 - 13, v5 - 1) ~= "rbxassetid://" and not v0(v7)) or v3[v7]) then
                    v3[v7] = true;
                    table.insert(v2, v7);
                end;
            end;
            v4 = v6 + 1;
        else
            break;
        end;
    end;
    return v2;
end;


return function(v0)
    local v1 = #v0;
    if v1 < 9 then
        return false;
    elseif v1 > 12 then
        return false;
    elseif string.find(v0, "[^" .. string.sub(v0, 1, 1) .. "]") then
        local v2 = 0;
        local v3 = 1;
        while true do
            v3 = string.find(v0, "0", v3, true);
            if v3 then
                v2 = v2 + 1;
                v3 = v3 + 1;
            else
                break;
            end;
        end;
        return v2 / v1 <= 0.5;
    else
        return false;
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Framework);
local l_TestHelpers_0 = v2.TestHelpers;
local l_ContextServices_0 = v2.ContextServices;
local v5 = {
    l_ContextServices_0.Analytics.mock(),
    l_ContextServices_0.Localization.mock(),
    l_ContextServices_0.Store.new(v1.Store.new(require(l_Parent_0.Src.Reducers.MainReducer), nil, nil, nil)),
    v2.Style.makeTheme(l_Parent_0.Src.Components)()
};
return function(v6)
    assert(type(v6) == "table", "Expected story to be a table");
    return l_TestHelpers_0.provideMockContext(v5, v6);
end;


return function(v0)
    local v1, v2 = string.find(v0, "rbxassetid://", 1, true);
    if not v1 then
        local v3, v4 = string.find(v0, "http[s]?://www.roblox.com/asset/%?id=");
        v1 = v3;
        v2 = v4;
        if not v1 then
            v3, v4 = string.find(v0, "rbxgameasset://Audio/", 1, true);
            v1 = v3;
            v2 = v4;
            if not v1 then
                return nil;
            else
                return nil;
            end;
        else
            return v0:sub(v2 + 1);
        end;
    else
        return v0:sub(v2 + 1);
    end;
end;


local l_CoreGui_0 = game:GetService("CoreGui");
local l_RunService_0 = game:GetService("RunService");
local l_TestService_0 = game:GetService("TestService");
local l_Workspace_0 = game:GetService("Workspace");
if plugin then
    local l_Parent_0 = script.Parent.Parent;
    local l_status_0, l_result_0 = pcall(function()
        return game:GetService("ProcessService");
    end);
    if not l_status_0 then
        local v7 = require(l_Parent_0.Packages.React);
        local v8 = require(l_Parent_0.Packages.ReactRoblox);
        local v9 = require(l_Parent_0.Src.Util.Constants);
        local v10 = require(l_Parent_0.Src.MainPlugin);
        local v11 = require(l_Parent_0.Src.Util.TestInExperienceUtil);
        local v12 = require(l_Parent_0.Src.Flags.getFFlagAvatarPreviewerEditingTools);
        local function v17()
            for _, v14 in v9.EDITING_TOOLS_GUI_NAMES, nil, nil do
                local l_l_CoreGui_0_FirstChild_0 = l_CoreGui_0:FindFirstChild(v14);
                if l_l_CoreGui_0_FirstChild_0 ~= nil then
                    l_l_CoreGui_0_FirstChild_0:Destroy();
                end;
            end;
            local l_l_Workspace_0_FirstChild_0 = l_Workspace_0:FindFirstChild(v9.CLONED_DUMMY_NAME);
            if l_l_Workspace_0_FirstChild_0 ~= nil then
                l_l_Workspace_0_FirstChild_0:Destroy();
            end;
        end;
        local v18 = nil;
        local function v20()
            plugin.Name = l_Parent_0.Name;
            if v12() then
                v17();
            end;
            local v19 = v7.createElement(v10, {
                Plugin = plugin
            });
            v18 = v8.createRoot(Instance.new("Frame"));
            v18:render(v19);
            if not l_RunService_0:IsRunning() then
                v11.reset();
            end;
        end;
        plugin.Unloading:Connect(function()
            if v18 then
                v18:render(nil);
                v18 = nil;
            end;
            if v12() then
                v17();
            end;
        end);
        v20();
        return ;
    else
        local l_runCLI_0 = require(l_Parent_0.Packages.Dev.Jest).runCLI;
        _G.__ROACT_17_MOCK_SCHEDULER__ = true;
        _G.__ROACT_17_INLINE_ACT__ = true;
        local v22 = game:DefineFastFlag("DebugAvatarPreviewerUpdateSnapshots", false);
        local v23 = game:DefineFastString("DebugAvatarPreviewerTestPathPattern", "");
        local v24, v25 = l_runCLI_0(l_Parent_0.Src, {
            verbose = true,
            ci = true,
            updateSnapshot = v22,
            testPathPattern = if v23 == "" then nil else v23
        }, {
            l_Parent_0.Src,
            l_Parent_0.RhodiumTests
        }):awaitStatus();
        if not (v24 == "Resolved" and v25.results.numFailedTestSuites <= 0) or v25.results.numFailedTests > 0 then
            if v24 == "Rejected" then
                print(v25);
            end;
            l_TestService_0:Error("Jest 3 test run failed");
            l_result_0:ExitAsync(1);
            return ;
        else
            l_result_0:ExitAsync(0);
            return ;
        end;
    end;
else
    return ;
end;


local v0 = require(script:FindFirstAncestor("AvatarCompatibilityPreviewer").Packages.Promise);
return function(v1, v2, v3)
    task.defer(v2);
    return v0.try(function()
        local v4 = {};
        for _ = 1, v3 or 1 do
            table.insert(v4, v1.ChildAdded:Wait());
        end;
        return unpack(v4);
    end):timeout(3):expect();
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.ReactRoblox);
local v2 = require(l_script_FirstAncestor_0.Packages.Dev.Rhodium);
return function(v3)
    local v4 = {
        isOpen = function()
            return v3.subWindows()[1];
        end,
        getSubWindow = function()
            return v3.getSubWindow(1);
        end
    };
    v4.getEntry = function(v5)
        return v4.getSubWindow().SolidBackground.Contents.Contents.Contents.Scroller[v5];
    end;
    v4.getWarningText = function(v6)
        local l_Warning_0 = v4.getEntry(v6).ItemNames:FindFirstChild("Warning");
        return l_Warning_0 and l_Warning_0.Text;
    end;
    v4.openDropdown = function(v8)
        local l_SelectInput_0 = v8.SelectInput;
        v1.act(function()
            v2.Element.new(l_SelectInput_0):click();
        end);
        local l_Container_0 = v4.getSubWindow().TopLevelDetector.ScrollBlocker.Menu.Contents.Container;
        local v11 = {};
        for _, v13 in l_Container_0:GetChildren() do
            if v13:IsA("Frame") then
                local l_TextButton_0 = v13.Contents.TextButton;
                v11[tonumber(v13.Name)] = {
                    label = l_TextButton_0.Label.Text,
                    click = function()
                        for _, v16 in l_Container_0:GetChildren() do
                            if not (not (v16 ~= v13) or not v16:IsA("Frame")) then
                                v16.Visible = false;
                            end;
                        end;
                        v1.act(function()
                            v2.Element.new(l_TextButton_0):click();
                        end);
                    end
                };
            end;
        end;
        return v11;
    end;
    v4.clickMatchingDropdownEntry = function(v17, v18)
        for _, v20 in v17, nil, nil do
            if v20.label:match(v18) then
                v20.click();
                return ;
            end;
        end;
        local v21 = {
            ("Couldn't find dropdown entry that matched pattern \"%*\""):format(v18),
            "Found the following labels:"
        };
        for _, v23 in v17, nil, nil do
            table.insert(v21, (("- %*"):format(v23.label)));
        end;
        error(table.concat(v21, "\n"));
    end;
    v4.openAmbiguousAssetTypeDropdown = function(v24)
        return v4.openDropdown(v24.Children.Dropdown.DropdownMenu);
    end;
    v4.openLoneMeshPartAssetTypeDropdown = function(v25)
        return v4.openDropdown(v25.Children.Children.AssetTypeDropdown);
    end;
    v4.attachmentDropdownExists = function(v26)
        return v26.Children.Children:FindFirstChild("AttachmentDropdown") ~= nil;
    end;
    v4.openAttachmentDropdown = function(v27)
        return v4.openDropdown(v27.Children.Children.AttachmentDropdown);
    end;
    v4.clickOk = function()
        v1.act(function()
            v3.clickStyledDialogButton(v4.getSubWindow(), 1);
        end);
    end;
    return v4;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.AvatarToolsShared);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.Dev.JestGlobals);
local v4 = require(l_script_FirstAncestor_0.Src.Resources.MakeTheme);
local v5 = require(l_script_FirstAncestor_0.Src.Util.SelectionWrapper);
local _ = require(l_script_FirstAncestor_0.Src.Components.PlacesServiceContext);
local v7 = require(l_script_FirstAncestor_0.Src.Resources.createAnalyticsHandlers);
local v8 = require(l_script_FirstAncestor_0.Src.Util.makePluginActions);
local v9 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerCageEditingTools);
local l_ContextServices_0 = v2.ContextServices;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_MockAnalyticsService_0 = v2.TestHelpers.Instances.MockAnalyticsService;
local l_MockSelectionService_0 = v2.TestHelpers.Instances.MockSelectionService;
local l_MockPlugin_0 = v2.TestHelpers.Instances.MockPlugin;
local l_jest_0 = v3.jest;
return function()
    local v16 = l_MockPlugin_0.new();
    local v17 = l_MockAnalyticsService_0.new();
    local v18 = l_MockSelectionService_0.new();
    local v19, v20 = l_jest_0.fn();
    local v21, v22 = l_jest_0.fn();
    local v23 = {
        v2.ContextServices.Plugin.new(v16),
        v4(true),
        v2.ContextServices.Analytics.new(v7, v17),
        v1.Contexts.PreviewContext.new(),
        v5.new(v18)
    };
    if v9() then
        table.insert(v23, (l_ContextServices_0.PluginActions.new(v16, v8(v16, l_Localization_0.mock()))));
    end;
    return {
        context = v23,
        plugin = v16,
        analyticsService = v17,
        selectionService = v18,
        placesService = {
            startPlaySolo = v19,
            stopPlaySolo = v21
        }
    }, {
        placesService = {
            startPlaySolo = v20,
            stopPlaySolo = v22
        }
    };
end;


return {
    testMatch = {
        "**/*.spec"
    },
    testTimeout = 30000
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local v2 = require(l_script_FirstAncestor_0.Src.Components.AnimationControllerDisplay);
local v3 = require(l_script_FirstAncestor_0.Src.Hooks.useAnimationOnAnimateTarget);
local _ = require(l_script_FirstAncestor_0.Src.Types);
return function(v5)
    local v6, v7 = v1.useState(0);
    local v8, v9 = v1.useState(nil);
    local v10 = v3(v5.Dummy, v5.AnimationId, v7, v8);
    v1.useEffect(function()
        v7(0);
    end, {
        v10
    });
    if v10 == nil then
        return nil;
    else
        return v1.createElement(v2, {
            AnimationPositionAlpha = v6,
            Length = v10.Length,
            ForcedPositionAlpha = v8,
            SetForcedPositionAlpha = v9
        });
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.AvatarToolsShared);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_Pane_0 = v2.UI.Pane;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local l_AnimationPlaybackSlider_0 = v1.Components.AnimationPlaybackSlider;
return function(v8)
    local v9 = l_Stylizer_0:use("AnimationControllerDisplay");
    return v3.createElement(l_Pane_0, {
        AnchorPoint = Vector2.new(0, 1),
        Position = v9.Position,
        Padding = v9.Padding,
        Size = v9.Size
    }, {
        Slider = v3.createElement(l_AnimationPlaybackSlider_0, {
            Size = UDim2.fromScale(1, 1),
            IsPlaying = v8.ForcedPositionAlpha == nil,
            Playhead = (v8.ForcedPositionAlpha or v8.AnimationPositionAlpha) * v8.Length,
            OnSliderPlayheadChanged = function(v10)
                v8.SetForcedPositionAlpha(v10 / v8.Length);
            end,
            OnPlayPauseClicked = function()
                v8.SetForcedPositionAlpha(if v8.ForcedPositionAlpha == nil then v8.AnimationPositionAlpha else nil);
            end,
            ShowTime = false,
            TrackLength = v8.Length
        })
    });
end;


local l_InsertService_0 = game:GetService("InsertService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v6 = require(l_script_FirstAncestor_0.Src.Hooks.useAnimationOnAnimateTarget);
local v7 = require(l_script_FirstAncestor_0.Src.Hooks.useToggleState);
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local l_UI_0 = v2.UI;
local l_AssetRenderModel_0 = l_UI_0.AssetRenderModel;
local l_Pane_0 = l_UI_0.Pane;
return function(v12)
    local v13 = l_Stylizer_0:use("AnimationPreview", v12);
    local v14 = v3.useState(Instance.new("WorldModel"));
    local v16 = v3.useState(function()
        local l_Camera_0 = Instance.new("Camera");
        if v13.FieldOfView ~= nil then
            l_Camera_0.FieldOfView = v13.FieldOfView;
        end;
        return l_Camera_0;
    end);
    local v17, v18 = v3.useState(nil);
    v3.useEffect(function()
        local v19 = l_InsertService_0:LoadLocalAsset(v12.AnimateTargetAsset):Clone();
        v19.Parent = v14;
        v14.PrimaryPart = v19.PrimaryPart;
        v18(v19);
        return function()
            v19:Destroy();
        end;
    end, {});
    local v20 = v7(false);
    v6(v17, v12.AnimationId, nil, if not v20.enabled then v13.PausedAnimationAlpha else nil);
    if not v17 then
        return nil;
    else
        return (v3.createElement(l_Pane_0, {
            Active = true,
            [v3.Event.MouseEnter] = v20.enable,
            [v3.Event.MouseLeave] = v20.enable
        }, {
            Model = v3.createElement(l_AssetRenderModel_0, {
                Ambient = Color3.new(1, 1, 1),
                Camera = v16,
                FocusDirection = v17.PrimaryPart.CFrame.LookVector:Lerp(v17.PrimaryPart.CFrame.RightVector, v13.FrontRightAngleLerp),
                InitialDistance = v13.InitialDistance,
                Model = v14,
                ShouldClone = false,
                Static = true,
                ImageTransparency = v12.Transparency
            })
        }));
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local v4 = require(l_script_FirstAncestor_0.Src.Components.Screens.AvatarScreen);
local v5 = require(l_script_FirstAncestor_0.Src.Components.Screens.AutoSetupScreen);
local v6 = require(l_script_FirstAncestor_0.Src.Components.Screens.SelectScreen);
local v7 = require(l_script_FirstAncestor_0.Src.Components.Screens.TestingScreen);
local v8 = require(l_script_FirstAncestor_0.Src.Components.EquipmentStateProvider);
local v9 = require(l_script_FirstAncestor_0.Src.Components.OriginalLimbProvider);
local v10 = require(l_script_FirstAncestor_0.Src.Components.RunServiceContext);
local v11 = require(l_script_FirstAncestor_0.Src.Components.SimpleSerializedStateProvider);
local v12 = require(l_script_FirstAncestor_0.Src.Components.UGCValidationContext);
local v13 = require(l_script_FirstAncestor_0.Src.Components.UserCatalogProvider);
local v14 = require(l_script_FirstAncestor_0.Src.Components.ContextStack);
local v15 = require(l_script_FirstAncestor_0.Src.Hooks.useAutoSetupState);
local v16 = require(l_script_FirstAncestor_0.Src.Hooks.useMostRecentSelected);
local v17 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerAutoSetup)();
local l_Analytics_0 = v2.ContextServices.Analytics;
return function(v19)
    local v20 = v3.useContext(v10);
    local v21 = v16();
    local v22 = if not v17 then nil else v15(v21 and v21.autoSetupTarget);
    local v23 = l_Analytics_0:use();
    v3.useEffect(function()
        v23:report("openPlugin");
    end, {});
    local v24 = nil;
    if not v20.isRunning() then
        if v21 == nil then
            return (v3.createElement(v6));
        elseif v17 and v22.state.type ~= "none" then
            return (v3.createElement(v5, {
                autoSetupState = v22.state,
                cancelAutoSetup = v22.cancelAutoSetup,
                startAutoSetup = v22.startAutoSetup
            }));
        else
            if v21.avatar then
                v24 = v3.createElement(v14, {
                    providers = v1.List.join({
                        v3.createElement(v11, {
                            root = v21.avatar.WorldModel
                        }),
                        v3.createElement(v8, {
                            root = v21.avatar.WorldModel
                        }),
                        v3.createElement(v13),
                        v3.createElement(v9),
                        v3.createElement(v12.Provider)
                    }, v19.additionalAvatarContext or {})
                }, v3.createElement(v4, {
                    Avatar = v21.avatar
                }));
            end;
            return v24;
        end;
    else
        return (v3.createElement(v7));
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Cryo);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local v4 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerPickTabsMenu);
local l_SimpleTab_0 = v2.UI.SimpleTab;
local l_withForwardRef_0 = v2.Wrappers.withForwardRef;
local function v8(v7)
    return v3.createElement(l_SimpleTab_0, v1.Dictionary.join(v7, {
        Style = "AssetPaletteTab",
        WrapperProps = {
            BackgroundTransparency = 1
        }
    }));
end;
if not v4() then
    return v8;
else
    return (l_withForwardRef_0(v8));
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Dash);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local v4 = require(l_script_FirstAncestor_0.Src.Components.ForceRerender);
local v5 = require(l_script_FirstAncestor_0.Src.Components.PickTabMenu);
local v6 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagAvatarPreviewerPickTabsMenu);
local v7 = v6();
local v8 = require(l_script_FirstAncestor_0.Src.Resources.CatalogItems);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v11 = require(script.AssetPaletteTab);
local l_UI_0 = v2.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_ScrollingFrame_0 = l_UI_0.ScrollingFrame;
local l_Tabs_0 = l_UI_0.Tabs;
local l_Analytics_0 = v2.ContextServices.Analytics;
local l_Localization_0 = v2.ContextServices.Localization;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
return function(v19)
    local v20 = l_Analytics_0:use();
    local v21 = l_Localization_0:use();
    local v22 = l_Stylizer_0:use("AssetPalettes");
    local v23 = v3.useRef(nil);
    local v24 = v3.useRef(nil);
    local v25 = v3.useRef({});
    local v26, v27 = v3.useState(100);
    local v28, v29 = v3.useState(100);
    local v30, v31 = v3.useState(Vector2.new());
    local v32 = v8[v19.SelectedTab];
    local v35 = v3.useMemo(function()
        if v32 == nil then
            return nil;
        else
            return v1.collectArray(v32, function(_, v34)
                return {
                    Key = v34.Key,
                    Label = v21:getText("AssetPalettes", v34.Key)
                };
            end);
        end;
    end, {
        v32
    });
    local v38 = if not v7 then nil else v3.useMemo(function()
        return v1.collectArray(v32, function(_, v37)
            return {
                Text = v21:getText("AssetPalettes", v37.Key),
                OnItemClicked = function()
                    if v19.SelectedPalette == v37.Key then
                        v19.SetSelectedPalette(nil);
                        return ;
                    else
                        v19.SetSelectedPalette(v37.Key);
                        assert(v24.current ~= nil, "Ref to palette tabs is nil");
                        assert(v25.current ~= nil, "Ref to palette tabs list is nil");
                        v31(Vector2.new(v25.current[v37.Key].current.AbsolutePosition.X - v24.current.AbsolutePosition.X, 0));
                        return ;
                    end;
                end,
                Checked = v37.Key == v19.SelectedPalette
            };
        end);
    end, {
        v21,
        v32,
        v19.SelectedPalette,
        v19.SetSelectedPalette
    });
    local v39 = v26 < v28;
    if v7 then
        v3.useEffect(function()
            assert(v23.current ~= nil, "Ref to palette tabs frame is nil");
            v27(v23.current.AbsoluteSize.X);
            assert(v24.current ~= nil, "Ref to palette tabs is nil");
            v29(v24.current.AbsoluteSize.X);
        end, {});
    end;
    if v32 == nil then
        return nil;
    elseif not v6() then
        return (v3.createElement(l_ScrollingFrame_0, v1.join({
            AutomaticCanvasSize = Enum.AutomaticSize.X,
            AutomaticSize = Enum.AutomaticSize.Y,
            Layout = Enum.FillDirection.Horizontal,
            ScrollingDirection = Enum.ScrollingDirection.X,
            Spacing = v22.ScrollingFrame.Spacing,
            Size = v22.Size,
            Style = v22.ScrollingFrame
        }, v19.ScrollingFrameProps), {
            Tabs = v3.createElement(v4, {
                component = l_Tabs_0,
                innerProps = {
                    SelectedTab = v19.SelectedPalette,
                    OnTabSelected = function(v40)
                        v20:report("openPalette", v40.Key);
                        v19.SetSelectedPalette(function(v41)
                            if v41 == v40.Key then
                                return nil;
                            else
                                return v40.Key;
                            end;
                        end);
                    end,
                    Tabs = v35,
                    TabComponent = v11
                },
                dependencies = {
                    v35
                }
            })
        }));
    else
        return (v3.createElement(l_Pane_0, {
            LayoutOrder = v19.LayoutOrder,
            Size = v22.Size,
            ref = v23,
            [v3.Change.AbsoluteSize] = function(v42)
                v27(v42.AbsoluteSize.X);
            end
        }, {
            ScrollingFrame = v3.createElement(l_ScrollingFrame_0, {
                AutomaticCanvasSize = Enum.AutomaticSize.X,
                AutomaticSize = Enum.AutomaticSize.Y,
                CanvasPosition = v30,
                Layout = Enum.FillDirection.Horizontal,
                OnScrollUpdate = v31,
                ScrollingDirection = Enum.ScrollingDirection.X,
                Spacing = v22.ScrollingFrame.Spacing,
                Size = UDim2.new(1, not v39 and 0 or -32, 1, 0),
                Style = v22.ScrollingFrame
            }, {
                Tabs = v3.createElement(v4, {
                    component = l_Tabs_0,
                    innerProps = {
                        SelectedTab = v19.SelectedPalette,
                        OnTabSelected = function(v43)
                            v20:report("openPalette", v43.Key);
                            v19.SetSelectedPalette(function(v44)
                                if v44 == v43.Key then
                                    return nil;
                                else
                                    return v43.Key;
                                end;
                            end);
                        end,
                        Tabs = v35,
                        TabComponent = v11,
                        ref = v24,
                        TabsListRef = v25,
                        OnAbsoluteSizeChanged = function(v45)
                            v29(v45.AbsoluteSize.X);
                        end
                    },
                    dependencies = {
                        v35
                    }
                })
            }),
            PickTabMenu = if not v39 then nil else v3.createElement(v5, {
                MenuTabs = v38,
                BackgroundColor = v22.BackgroundColor,
                BackgroundColorHover = v22.BackgroundColorHover
            })
        }));
    end;
end;


local l_Players_0 = game:GetService("Players");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Src.Util.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v5 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagDebugAvatarPreviewerMockAutoSetup);
local v6 = game:DefineFastFlag("AvatarAutosetupUseSurfaceAppearance", false);
local function v10(v7)
    v7(2);
    task.wait(1);
    v7(1);
    task.wait(1);
    local l_l_Players_0_HumanoidModelFromUserId_0 = l_Players_0:CreateHumanoidModelFromUserId(24941);
    while true do
        local l_Accessory_0 = l_l_Players_0_HumanoidModelFromUserId_0:FindFirstChildWhichIsA("Accessory");
        if l_Accessory_0 ~= nil then
            assert(l_Accessory_0 ~= nil, v3.LUAU_ANALYZE_ERROR);
            l_Accessory_0:Destroy();
        else
            break;
        end;
    end;
    return l_l_Players_0_HumanoidModelFromUserId_0;
end;
local function v14(v11, v12)
    local l_SurfaceAppearance_0 = v12:FindFirstChildWhichIsA("SurfaceAppearance");
    if l_SurfaceAppearance_0 == nil then
        v11:Clone().Parent = v12;
        return ;
    else
        if l_SurfaceAppearance_0.ColorMap == "" then
            l_SurfaceAppearance_0.ColorMap = v11.ColorMap;
        end;
        if l_SurfaceAppearance_0.NormalMap == "" then
            l_SurfaceAppearance_0.NormalMap = v11.NormalMap;
        end;
        if l_SurfaceAppearance_0.MetalnessMap == "" then
            l_SurfaceAppearance_0.MetalnessMap = v11.MetalnessMap;
        end;
        if l_SurfaceAppearance_0.RoughnessMap == "" then
            l_SurfaceAppearance_0.RoughnessMap = v11.RoughnessMap;
        end;
        return ;
    end;
end;
local function v19(v15, v16)
    for _, v18 in v16:GetDescendants() do
        if v18:IsA("MeshPart") then
            v14(v15, v18);
        end;
    end;
end;
local v25 = v2.createContext({
    startAutoSetupAsync = function(v20, v21)
        if not v5() then
            local l_StudioAssetService_0 = game:GetService("StudioAssetService");
            if not v6 then
                return l_StudioAssetService_0:RequestAvatarAutosetupAsync(v20.MeshId, v20.TextureID, v21);
            else
                local l_SurfaceAppearance_1 = v20:FindFirstChildWhichIsA("SurfaceAppearance");
                local v24 = l_StudioAssetService_0:RequestAvatarAutosetupAsync(v20.MeshId, if not not l_SurfaceAppearance_1 and l_SurfaceAppearance_1.ColorMap ~= "" then l_SurfaceAppearance_1.ColorMap else v20.TextureID, v21);
                if l_SurfaceAppearance_1 ~= nil then
                    v19(l_SurfaceAppearance_1, v24);
                end;
                return v24;
            end;
        else
            return (v10(v21));
        end;
    end,
    autoSetupClickedSignal = nil
});
return {
    Context = v25,
    MockProviders = {
        Success = function(v26)
            return v2.createElement(v25.Provider, {
                value = {
                    startAutoSetupAsync = v2.useCallback(function(_, v28)
                        local v29 = v26.updateEtaSignal and v26.updateEtaSignal:Connect(v28);
                        if v26.signal ~= nil then
                            v26.signal:Wait();
                        end;
                        if v29 ~= nil then
                            v29:Disconnect();
                        end;
                        return v26.result;
                    end, {
                        v26.signal,
                        v26.result,
                        v26.updateEtaSignal
                    }),
                    autoSetupClickedSignal = v26.autoSetupClickedSignal
                }
            }, v26.children);
        end,
        FailsOnce = function(v30)
            local v31 = v2.useRef(false);
            return v2.createElement(v25.Provider, {
                value = {
                    startAutoSetupAsync = v2.useCallback(function()
                        v30.signal:Wait();
                        if not v31.current then
                            v31.current = true;
                            return error("Mock error");
                        else
                            return v30.result;
                        end;
                    end, {
                        v30.signal
                    }),
                    autoSetupClickedSignal = v30.autoSetupClickedSignal
                }
            }, v30.children);
        end
    }
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Components.Screens.AvatarScreen.Stages.StageType);
local v3 = require(l_script_FirstAncestor_0.Src.Components.TestingInterfaceContext);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v5 = require(l_script_FirstAncestor_0.Src.Util.createUnimplemented);
local v6 = require(l_script_FirstAncestor_0.Src.Util.skinToneAvailableAsync);
local v7 = require(l_script_FirstAncestor_0.Src.Hooks.useAsync);
local v8 = require(l_script_FirstAncestor_0.Src.Hooks.useIncrementedState);
local v9 = v1.createContext({
    openPalette = v5("openPalette"),
    focusedAttachments = {},
    setFocusedAttachments = v5("setFocusedAttachments"),
    dummyPreviewLocked = false,
    incrementDummyPreviewLock = v5("incrementDummyPreviewLock"),
    decrementDummyPreviewLock = v5("decrementDummyPreviewLock"),
    resetCamera = function()
    end,
    stage = {},
    isColorable = true
});
return {
    Context = v9,
    Provider = function(v10)
        local v11 = v1.useContext(v3.Context);
        local v12, v13 = v1.useState({});
        local v14 = v8();
        local v16 = v7(function()
            local v15 = v6(v10.selectedAvatar);
            if v11.onIsColorableAcquired ~= nil then
                task.defer(function()
                    v11.onIsColorableAcquired:Fire();
                end);
            end;
            return v15;
        end, {
            v10.selectedAvatar,
            v11.onIsColorableAcquired
        });
        return v1.createElement(v9.Provider, {
            value = {
                openPalette = v10.openPalette,
                focusedAttachments = v12,
                setFocusedAttachments = v13,
                dummyPreviewLocked = v14.amount > 0,
                incrementDummyPreviewLock = v14.increment,
                decrementDummyPreviewLock = v14.decrement,
                resetCamera = v10.resetCamera,
                stage = v10.stage,
                isColorable = not (v16.state == "ok") or v16.value
            }
        }, v10.children);
    end
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v4 = require(l_script_FirstAncestor_0.Src.Util.AvatarScalingTypes);
local l_UI_0 = v1.UI;
local l_CaptureFocus_0 = l_UI_0.CaptureFocus;
local l_SelectInput_0 = l_UI_0.SelectInput;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_Pane_0 = l_UI_0.Pane;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local l_Localization_0 = v1.ContextServices.Localization;
local v12 = {
    "Classic",
    "ProportionsNormal",
    "ProportionsSlender"
};
return function(v13)
    local v14 = l_LayoutOrderIterator_0.new();
    local v15 = l_Localization_0:use();
    local v16, v17 = v2.useState("Mixed");
    v2.useEffect(function()
        local v18 = nil;
        for _, v20 in v4.allAvatarPartScaleTypeValueObjects(v13.worldModel) do
            if v18 == nil then
                v18 = v20.Value;
            elseif v18 ~= v20.Value then
                v18 = "Mixed";
                break;
            end;
        end;
        v17(v18 == nil and "Classic" or v18);
    end, {
        v13.worldModel
    });
    return v2.createElement(l_CaptureFocus_0, {
        OnFocusLost = v13.close
    }, v2.createElement(l_Pane_0, {
        AnchorPoint = Vector2.new(0, 1),
        AutomaticSize = Enum.AutomaticSize.XY,
        Layout = Enum.FillDirection.Vertical,
        Padding = {
            Top = 4,
            Bottom = 4,
            Left = 8,
            Right = 8
        },
        Position = UDim2.new(0, 0, 1, -32),
        Style = "SubtleBox"
    }, {
        Proportions = v2.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.X,
            Layout = Enum.FillDirection.Horizontal,
            LayoutOrder = v14:getNextOrder(),
            Spacing = 8,
            Size = UDim2.fromOffset(0, 32)
        }, {
            Label = v2.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.X,
                LayoutOrder = v14:getNextOrder(),
                Text = v15:getText("AvatarSettings", "Proportions"),
                TextXAlignment = Enum.TextXAlignment.Left
            }),
            Selection = v2.createElement(l_SelectInput_0, {
                LayoutOrder = v14:getNextOrder(),
                OnItemActivated = v2.useCallback(function(_, v22)
                    local l_worldModel_0 = v13.worldModel;
                    local v24 = v12[v22];
                    v17(v24);
                    v4.setAvatarPartScaleTypeValueObjects(l_worldModel_0, v24);
                    local v25 = v4.types[v24];
                    assert(v25 ~= nil, "Picked scaling type that has no values");
                    local function _(v26, v27)
                        local l_FirstChild_0 = l_worldModel_0.Humanoid:FindFirstChild(v26);
                        if not (l_FirstChild_0 ~= nil) or not l_FirstChild_0:IsA("NumberValue") then
                            if l_FirstChild_0 == nil then
                                local l_NumberValue_0 = Instance.new("NumberValue");
                                l_NumberValue_0.Name = v26;
                                l_NumberValue_0.Value = v27;
                                l_NumberValue_0.Parent = l_worldModel_0.Humanoid;
                            end;
                            return ;
                        else
                            l_FirstChild_0.Value = v27;
                            return ;
                        end;
                    end;
                    local l_BodyTypeScale_0 = v25.BodyTypeScale;
                    local l_BodyTypeScale_1 = l_worldModel_0.Humanoid:FindFirstChild("BodyTypeScale");
                    if not (l_BodyTypeScale_1 ~= nil) or not l_BodyTypeScale_1:IsA("NumberValue") then
                        if l_BodyTypeScale_1 == nil then
                            local l_NumberValue_1 = Instance.new("NumberValue");
                            l_NumberValue_1.Name = "BodyTypeScale";
                            l_NumberValue_1.Value = l_BodyTypeScale_0;
                            l_NumberValue_1.Parent = l_worldModel_0.Humanoid;
                        end;
                    else
                        l_BodyTypeScale_1.Value = l_BodyTypeScale_0;
                    end;
                    l_BodyTypeScale_0 = v25.BodyProportionScale;
                    l_BodyTypeScale_1 = l_worldModel_0.Humanoid:FindFirstChild("BodyProportionScale");
                    if not (l_BodyTypeScale_1 ~= nil) or not l_BodyTypeScale_1:IsA("NumberValue") then
                        if l_BodyTypeScale_1 == nil then
                            local l_NumberValue_2 = Instance.new("NumberValue");
                            l_NumberValue_2.Name = "BodyProportionScale";
                            l_NumberValue_2.Value = l_BodyTypeScale_0;
                            l_NumberValue_2.Parent = l_worldModel_0.Humanoid;
                        end;
                        return ;
                    else
                        l_BodyTypeScale_1.Value = l_BodyTypeScale_0;
                        return ;
                    end;
                end, {
                    v13.worldModel
                }),
                SelectedIndex = if v16 == nil then nil else table.find(v12, v16),
                PlaceholderText = v15:getText("AvatarSettings", "Mixed"),
                Items = v12
            })
        })
    }));
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("AvatarCompatibilityPreviewer");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_Stylizer_0 = v1.ContextServices.Stylizer;
return function()
    return v2.createElement("ImageLabel", {
        BackgroundTransparency = 1,
        Image = l_Stylizer_0:use("Background").Image,
        Size = UDim2.fromScale(1, 1),
        ZIndex = -1
    });
end;