local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Promise);
local v3 = require(l_CorePackages_0.Workspace.Packages.ArgCheck);
local v4 = require(l_Modules_0.AvatarExperience.Catalog.CatalogConstants);
local l_PerformFetch_0 = require(l_CorePackages_0.Workspace.Packages.Http).PerformFetch;
local v6 = require(l_Modules_0.LuaApp.Thunks.SetNetworkingErrorToast);
local v7 = require(l_Modules_0.AvatarExperience.Common.RoduxUtils);
local v8 = require(l_Modules_0.AvatarExperience.Catalog.Actions.SetBundleFavorite);
local v9 = require(l_Modules_0.AvatarExperience.Common.Analytics.reportAvatarEventCounterNoAnalyticsArgument);
local v10 = require(l_Modules_0.AvatarExperience.Common.Constants);
local v11 = require(l_Modules_0.AvatarExperience.Flags.GetFFlagEnableAvatarEditorServiceAPIErrorLogging);
local function _(v12)
    return v4.SetFavoriteBundleKey .. v12;
end;
return function(v14, v15)
    v3.isType(v14, "string", "SetBundleFavorite thunk expects assetId");
    v3.isType(v15, "boolean", "SetBundleFavorite thunk expects isFavorited");
    return v7.convertAvatarEditorServiceThunk("SetBundleFavorite", function(v16, v17)
        return l_PerformFetch_0.Single(v4.SetFavoriteBundleKey .. v14, function(v18)
            return v2.new(function(v19, v20)
                local v21 = v17:NoPromptSetFavorite(v14, Enum.AvatarItemType.Bundle, v15);
                while not v21 do
                    v17.PromptSetFavoriteCompleted:Wait();
                    v21 = v17:NoPromptSetFavorite(v14, Enum.AvatarItemType.Bundle, v15);
                end;
                if v17.PromptSetFavoriteCompleted:Wait() == Enum.AvatarPromptResult.Success then
                    v18:dispatch(v8(v14, v15));
                    v19();
                    return ;
                else
                    if v11() then
                        v9(v10.Counter.AvatarEditorServiceErrors.SetBundleFavorite);
                    end;
                    v18:dispatch(v6({
                        HttpError = Enum.HttpError.OK
                    }));
                    v20();
                    return ;
                end;
            end);
        end)(v16);
    end);
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Workspace.Packages.ArgCheck);
local v3 = require(l_Modules_0.AvatarExperience.Catalog.Actions.SetCategoryAndSubcategory);
return function(v4, v5, v6)
    return function(v7)
        v2.isTypeOrNil(v4, "number", "SetCategoryAndSubcategory thunk expects category");
        v2.isTypeOrNil(v5, "number", "SetCategoryAndSubcategory thunk expects subcategory");
        v2.isType(v6, "table", "SetCategory thunk expects analytics");
        v7:dispatch(v3(v4, v5));
        v6.clickNavigationTab(v7:getState().AvatarExperience.Catalog.Categories.category, v7:getState().AvatarExperience.Catalog.Categories.subcategory);
    end;
end;


local v0 = require(game:GetService("CoreGui").RobloxGui.Modules.AvatarExperience.Catalog.Actions.SetPriceRange);
return function(v1, v2, v3)
    return function(v4)
        v4:dispatch(v0(v1, v2));
        v3.applyPriceFilter(v1, v2);
    end;
end;


local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v1 = require(l_Modules_0.AvatarExperience.Common.Constants);
local v2 = require(l_Modules_0.AvatarExperience.Common.Actions.AddSelectedBundleInfo);
local v3 = require(l_Modules_0.AvatarExperience.Common.Selectors.SelectOrderedToggledOnItemsList);
local v4 = require(l_Modules_0.AvatarExperience.Common.Selectors.SelectUpdatedSortOrderForToggledOnItems);
local v5 = require(l_Modules_0.AvatarExperience.Common.Actions.SetOrderForTryOns);
local v6 = require(l_Modules_0.AvatarExperience.LayeredClothingSort.Actions.SetOrder);
return function(v7)
    return function(v8)
        local v9 = v8:getState();
        local v10, v11 = v3(v9);
        local v12 = v4(v9, v7, v1.ItemType.Bundle, nil, v10, v11);
        if v12.equippedAssetsToSetOrder then
            v8:dispatch(v6(v12.equippedAssetsToSetOrder));
        end;
        if v12.itemIdToOrderMap then
            v8:dispatch(v5(v12.itemIdToOrderMap));
        end;
        v8:dispatch(v2(v7, v12.bundleInfoMapping));
    end;
end;


local v0 = require(game:GetService("CorePackages").Cryo);
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_Modules_0.AvatarExperience.Common.Utils);
local v3 = require(l_Modules_0.AvatarExperience.Common.Constants);
local v4 = require(l_Modules_0.AvatarExperience.AvatarEditor.Thunks.EquipOutfit);
local v5 = require(l_Modules_0.AvatarExperience.AvatarEditor.Thunks.ToggleEquipAsset);
local _ = require(l_Modules_0.AvatarExperience.Common.Types);
local _ = require(l_Modules_0.AvatarExperience.Common.AvatarExperienceState);
local v8 = require(l_Modules_0.AvatarExperience.Common.Actions.AddSaveDelay);
local v9 = require(l_Modules_0.AvatarExperience.Flags.GetFFlagUnequipAccessoriesBeforeLookTryOn);
local v10 = {
    v3.AssetTypeIdStrings.Torso,
    v3.AssetTypeIdStrings.RightArm,
    v3.AssetTypeIdStrings.LeftArm,
    v3.AssetTypeIdStrings.LeftLeg,
    v3.AssetTypeIdStrings.RightLeg
};
local _ = function(v11)
    for _, v13 in v10, nil, nil do
        if not v11[v13] then
            return false;
        end;
    end;
    return true;
end;
return function(v15, v16, v17)
    return function(v18)
        local v19 = v18:getState();
        local l_AssetInfos_0 = v19.AvatarExperience.Common.AssetInfos;
        if v9() then
            local l_EquippedAssets_0 = v19.AvatarExperience.AvatarEditor.Character.EquippedAssets;
            local l_LookId_0 = v19.AvatarExperience.AvatarScene.OutfitTryOn.LookId;
            if not (not l_EquippedAssets_0 or not l_LookId_0) then
                for v23, v24 in l_EquippedAssets_0, nil, nil do
                    local v25 = v3.AssetTypeIdToCategory[v23];
                    if not (v25 ~= v3.AssetCategories.Accessory) or v25 == v3.AssetCategories.Clothing then
                        for v26, _ in v24, nil, nil do
                            v18:dispatch(v5(v23, v26, v16, true));
                        end;
                    end;
                end;
            end;
        end;
        local v28 = {};
        if not (v0.isEmpty(v15) or v19.AvatarExperience.AvatarScene.Character.ShouldDelaySaveManager) then
            v18:dispatch(v8());
        end;
        for _, v30 in v15, nil, nil do
            if not ((not v30.purchased and not v30.owned or v30.assetIsWearable) or not v30.bundleId) then
                local v31 = v2.getOutfitInfoFromBundleId(v19, v30.bundleId);
                if v31 then
                    local l_assets_0 = v31.assets;
                    local v33;
                    for _, v35 in v10, nil, nil do
                        if not l_assets_0[v35] then
                            v33 = false;
                            goto label0 --[[  true, false  ]];
                        end;
                    end;
                    v33 = true;
                    ::label0::;
                    if v33 then
                        v18:dispatch(v4({
                            outfitInfo = v31,
                            analytics = v17,
                            navigation = v16,
                            isSelected = false,
                            fromOutfitPurchase = true,
                            tryOnBundleInfo = v30.tryOnBundleInfo,
                            blockFullReset = true
                        }));
                        v28[v30.bundleId] = true;
                    end;
                end;
            end;
        end;
        for _, v37 in v15, nil, nil do
            local v38 = if not v37.assetIsWearable then v37.bundleId else v37.assetId;
            if not (not v37.purchased and not v37.owned or not v38) then
                if v37.assetType == v3.ItemType.Bundle then
                    if v28[v38] == nil then
                        local v39 = v2.getOutfitInfoFromBundleId(v19, v38);
                        local v40 = v2.getBundleInfoFromState(v19, v38);
                        if not v39 then
                            if v40 then
                                assert(v40, "");
                                for _, v42 in v40.items, nil, nil do
                                    local v43 = l_AssetInfos_0[v42.id];
                                    if not (not v43 or not v43.assetType) then
                                        v18:dispatch(v5(v43.assetType, v42.id, v16, true, (v37.tryOnBundleInfo and v37.tryOnBundleInfo[v42.id]) and v37.tryOnBundleInfo[v42.id].order));
                                    end;
                                end;
                            end;
                        else
                            v18:dispatch(v4({
                                outfitInfo = v39,
                                analytics = v17,
                                navigation = v16,
                                isSelected = false,
                                fromOutfitPurchase = true,
                                tryOnBundleInfo = v37.tryOnBundleInfo
                            }));
                        end;
                    end;
                elseif v37.itemSubType and tostring(v37.itemSubType) ~= v3.AssetTypeIdStrings.EmoteAnimation then
                    v18:dispatch(v5(tostring(v37.itemSubType), tostring(v38), v16, true, v37.overrideOrder));
                end;
            end;
        end;
    end;
end;


return {
    clampBetween0And1 = function(v0)
        if math.abs(v0) < 0.001 then
            return 0, false;
        elseif math.abs(v0 - 1) < 0.001 then
            return 1, false;
        elseif v0 >= 0 and v0 <= 1 then
            return v0, false;
        else
            return math.clamp(v0, 0, 1), true;
        end;
    end
};


local l_CorePackages_0 = game:GetService("CorePackages");
local l_CoreGui_0 = game:GetService("CoreGui");
local v2 = require(l_CorePackages_0.Rodux);
local l_Modules_0 = l_CoreGui_0.RobloxGui.Modules;
local _ = require(l_Modules_0.AvatarExperience.Common.Types);
local v5 = require(l_Modules_0.AvatarExperience.Flags.FFlagAXAvatarWidgetData);
return v2.makeActionCreator(script.Name, function(v6, v7, v8, v9, v10, v11, v12)
    return {
        lookAssetInfos = v9,
        lookBundleInfos = if not v5() then nil else v10,
        lookId = v6,
        lookType = if not v5() then nil else v11,
        totalValue = if not v5() then nil else v12,
        totalPrice = v7,
        totalPremiumPrice = v8
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0)
    return {
        assetTypeId = v0
    };
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local l_CoreGui_0 = game:GetService("CoreGui");
local v2 = require(l_CorePackages_0.Rodux);
local _ = require(l_CoreGui_0.RobloxGui.Modules.AvatarExperience.Common.Types);
return v2.makeActionCreator(script.Name, function(v4)
    return {
        outfitType = v4
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0, v1)
    return {
        bundleId = v0,
        bundleInfo = v1
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0, v1)
    return {
        screen = v0,
        params = v1
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(_)
    return {};
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0)
    return {
        requestId = v0
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0)
    return {
        playingSwimAnimation = v0
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0)
    return {
        itemId = v0
    };
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Rodux);
local v3 = require(l_Modules_0.AvatarExperience.Flags.FFlagAXAvatarWidgetData);
return v2.makeActionCreator(script.Name, function(v4, v5, v6)
    return {
        lookId = v4,
        assetIds = v5,
        bundleIds = if not v3() then nil else v6
    };
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local v1 = require(l_CorePackages_0.Rodux);
local v2 = require(l_CorePackages_0.Workspace.Packages.ArgCheck);
return v1.makeActionCreator(script.Name, function(v3, v4)
    v2.isType(v3, "string", "SetAnimationPreview: assetId");
    v2.isType(v4, "string", "SetAnimationPreview: assetTypeIdString");
    return {
        assetId = v3,
        assetTypeIdString = v4
    };
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local _ = require(game:GetService("CoreGui").RobloxGui.Modules.AvatarExperience.Common.Types);
return require(l_CorePackages_0.Rodux).makeActionCreator(script.Name, function(v2, v3)
    return {
        assetId = v2,
        isOwned = v3
    };
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Rodux);
local v3 = require(l_CorePackages_0.Workspace.Packages.ArgCheck);
local _ = require(l_Modules_0.AvatarExperience.Common.Types);
return v2.makeActionCreator(script.Name, function(v5)
    v3.isType(v5, "table", "avatarRoute");
    return {
        avatarRoute = v5
    };
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local _ = require(game:GetService("CoreGui").RobloxGui.Modules.AvatarExperience.Common.Types);
return require(l_CorePackages_0.Rodux).makeActionCreator(script.Name, function(v2, v3)
    return {
        bundleId = v2,
        isOwned = v3
    };
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local v1 = require(l_CorePackages_0.Workspace.Packages.ArgCheck);
return require(l_CorePackages_0.Rodux).makeActionCreator(script.Name, function(v2)
    v1.isType(v2, "boolean", "Actions.SetCameraButton.errorOccurred");
    return {
        errorOccurred = v2
    };
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local v1 = require(l_CorePackages_0.Workspace.Packages.ArgCheck);
return require(l_CorePackages_0.Rodux).makeActionCreator(script.Name, function(v2)
    v1.isType(v2, "boolean", "Actions.SetCameraButton.status");
    return {
        status = v2
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0)
    return {
        currentCharacter = v0
    };
end);


local v0 = require(game:GetService("CorePackages").Rodux);
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local _ = require(l_Modules_0.AvatarExperience.Common.Types);
local v3 = require(l_Modules_0.AvatarExperience.Flags.FFlagAXAvatarWidgetData);
return v0.makeActionCreator(script.Name, function(v4, v5, v6)
    return {
        itemId = v4,
        selectedInTryOnManager = v5,
        itemType = if not v3() then nil else v6
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0, v1)
    return {
        avatarScreen = v0,
        fullViewStatus = v1
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0)
    return {
        itemDetailsExpanded = v0
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0)
    return {
        briefViewHeight = v0
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator("SetItemDetailsPeekViewState", function(v0)
    return {
        viewState = v0
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0)
    return {
        savedOutfit = v0
    };
end);


local v0 = require(game:GetService("CorePackages").Rodux);
local _ = require(game:GetService("CoreGui").RobloxGui.Modules.AvatarExperience.Common.Types);
return v0.makeActionCreator(script.Name, function(v2)
    return {
        itemIdToOrderMap = v2
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0)
    return {
        outfitTryOns = v0
    };
end);


return require(game:GetService("CorePackages").Rodux).makeActionCreator(script.Name, function(v0)
    return {
        shouldPlayEmoteInBackground = v0
    };
end);


local v0 = require(game:GetService("CorePackages").Rodux);
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local _ = require(l_Modules_0.AvatarExperience.Common.Types);
local _ = require(l_Modules_0.AvatarExperience.Common.Context.WidgetInfoContext);
return v0.makeActionCreator(script.Name, function(v4, v5, v6, v7, v8, v9, v10, v11)
    return {
        itemType = v4,
        itemSubType = v5,
        itemId = v6,
        selectedInTryOnManager = v7,
        overrideOrder = v8,
        bundleInfo = v9,
        widgetInfo = v10,
        receivedBundleInfo = v11
    };
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Rodux);
local _ = require(l_Modules_0.AvatarExperience.Common.Types);
return v2.makeActionCreator(script.Name, function(v4)
    return v4;
end);


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Rodux);
local v3 = require(l_Modules_0.AvatarExperience.Flags.GetFFlagAXRefactorTryOnItems);
return v2.makeActionCreator(script.Name, function(v4, v5, v6)
    return {
        lookId = v4,
        purchasedAssetIds = v5,
        purchasedBundleIds = if not v3() then nil else v6
    };
end);


return function(v0, v1)
    v0:setRBXEventStream(v1, "close3DFullView");
end;


return function(v0, v1)
    v0:setRBXEventStream(v1, "closeUIFullView");
end;


local l_UserInputService_0 = game:GetService("UserInputService");
return function(v1)
    local l_l_UserInputService_0_Platform_0 = l_UserInputService_0:GetPlatform();
    if l_l_UserInputService_0_Platform_0 == Enum.Platform.Android then
        return "Android" .. v1;
    elseif l_l_UserInputService_0_Platform_0 == Enum.Platform.IOS then
        return "IOS" .. v1;
    elseif l_l_UserInputService_0_Platform_0 == Enum.Platform.Windows then
        return "Windows" .. v1;
    elseif l_l_UserInputService_0_Platform_0 == Enum.Platform.OSX then
        return "OSX" .. v1;
    else
        if not (l_l_UserInputService_0_Platform_0 ~= Enum.Platform.PS4) or l_l_UserInputService_0_Platform_0 == Enum.Platform.PS5 then
            v1 = "PlayStation" .. v1;
        end;
        return v1;
    end;
end;


return function(v0, v1)
    v0:setRBXEventStream(v1, "open3DFullView");
end;


return function(v0, v1)
    v0:setRBXEventStream(v1, "openUIFullView");
end;


local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local l_UserInputService_0 = game:GetService("UserInputService");
local v2 = require(l_Modules_0.AvatarExperience.Flags.GetFFlagEnableAvatarEditorServiceAPIErrorLogging);
local v3 = require(script.Parent.getAvatarEventCounterNameWithPlatform);
return function(v4, v5)
    if not v2() then
        local l_l_UserInputService_0_Platform_0 = l_UserInputService_0:GetPlatform();
        if l_l_UserInputService_0_Platform_0 == Enum.Platform.Android then
            v5 = "Android" .. v5;
        elseif l_l_UserInputService_0_Platform_0 == Enum.Platform.IOS then
            v5 = "IOS" .. v5;
        elseif l_l_UserInputService_0_Platform_0 == Enum.Platform.Windows then
            v5 = "Windows" .. v5;
        elseif l_l_UserInputService_0_Platform_0 == Enum.Platform.OSX then
            v5 = "OSX" .. v5;
        elseif not (l_l_UserInputService_0_Platform_0 ~= Enum.Platform.PS4) or l_l_UserInputService_0_Platform_0 == Enum.Platform.PS5 then
            v5 = "PlayStation" .. v5;
        end;
    else
        v5 = v3(v5);
    end;
    v4.Diag:reportCounter(v5, 1);
end;


local l_RbxAnalyticsService_0 = game:GetService("RbxAnalyticsService");
local v1 = require(script.Parent.getAvatarEventCounterNameWithPlatform);
return function(v2)
    if v2 then
        l_RbxAnalyticsService_0:ReportCounter(v1(v2), 1);
        return ;
    else
        l_RbxAnalyticsService_0:ReportCounter("AvatarExperienceCounterMiss", 1);
        return ;
    end;
end;


local l_UserInputService_0 = game:GetService("UserInputService");
return function(v1, v2, v3)
    local l_l_UserInputService_0_Platform_0 = l_UserInputService_0:GetPlatform();
    if l_l_UserInputService_0_Platform_0 == Enum.Platform.Android then
        v2 = "Android" .. v2;
    elseif l_l_UserInputService_0_Platform_0 == Enum.Platform.IOS then
        v2 = "IOS" .. v2;
    elseif l_l_UserInputService_0_Platform_0 == Enum.Platform.Windows then
        v2 = "Windows" .. v2;
    elseif l_l_UserInputService_0_Platform_0 == Enum.Platform.OSX then
        v2 = "OSX" .. v2;
    elseif l_l_UserInputService_0_Platform_0 == Enum.Platform.XBoxOne then
        v2 = "Xbox" .. v2;
    end;
    v1.Diag:reportStats(v2, v3);
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_Modules_0.AvatarExperience.Common.Reducers.AvatarExperience);
local v3 = require(l_Modules_0.LuaApp.Reducers.Navigation);
local v4 = require(l_CorePackages_0.Cryo);
return {
    mockAvatarExperienceState = function(v5)
        return (v4.Dictionary.join({
            AvatarExperience = v2(nil, {}),
            TopBar = {
                topBarHeight = 0,
                statusBarHeight = 0
            },
            TabBarVisible = false,
            Navigation = v3(nil, {}),
            GlobalGuiInset = {
                left = 0,
                top = 0,
                right = 0,
                bottom = 0
            },
            ScreenSize = Vector2.new(1000, 1000),
            FetchingStatus = {}
        }, v5 or {}));
    end
};


local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local _ = require(l_Modules_0.AvatarExperience.Common.Enum.CatalogCategories);
local _ = require(l_Modules_0.AvatarExperience.Common.Enum.CatalogSubcategories);
local _ = require(l_Modules_0.AvatarExperience.Common.Types);
return {};


local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local l_CorePackages_0 = game:GetService("CorePackages");
local v2 = require(l_CorePackages_0.Packages.React);
local v3 = require(l_CorePackages_0.Packages.RoactGamepad);
local l_useSelector_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.RoactRodux.useSelector;
local l_useNavigation_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.useNavigation;
local v6 = require(l_CorePackages_0.Packages.UIBlox);
local l_useStyle_0 = v6.Core.Style.useStyle;
local l_useSelectionCursor_0 = v6.App.SelectionImage.useSelectionCursor;
local l_CursorKind_0 = v6.App.SelectionImage.CursorKind;
local l_ImageSetButton_0 = v6.Core.ImageSet.ImageSetButton;
local l_IconSize_0 = v6.App.Constant.IconSize;
local v12 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.AvatarScreen);
local v13 = require(l_Modules_0.AvatarExperience.Common.Hooks.useAvatarRoute);
local _ = require(l_Modules_0.AvatarExperience.Common.Types);
local v15 = require(l_CorePackages_0.Workspace.Packages.UserLib);
local l_Constants_0 = v15.Utils.Constants;
local l_getRbxthumbWithTypeSizeAndOptions_0 = v15.Utils.getRbxthumbWithTypeSizeAndOptions;
local v18 = UDim.new(0, 8);
local v19 = UDim.new(0, v18.Offset - (44 - l_IconSize_0.Regular) / 2);
local l_AvatarHeadShot_0 = l_Constants_0.RbxthumbTypes.AvatarHeadShot;
local v21 = {
    [v12.AvatarEditor] = true,
    [v12.Catalog] = true
};
local function _(v22, v23)
    return (v21[v23.opaque.name] ~= nil and not v22.isUIFullView) and not v22.isSceneFullView;
end;
return (v2.forwardRef(function(v25, v26)
    local l_Theme_0 = l_useStyle_0().Theme;
    local v28 = v13();
    local v29 = l_useNavigation_0();
    local v31 = l_useSelector_0(function(v30)
        return v30.Navigation.history;
    end);
    return v2.createElement(v3.Focusable.Frame, {
        Size = UDim2.fromOffset(44, 44),
        BackgroundColor3 = l_Theme_0.BackgroundMuted.Color,
        BackgroundTransparency = l_Theme_0.BackgroundMuted.Transparency,
        Visible = (v21[v28.opaque.name] ~= nil and not v25.isUIFullView) and not v25.isSceneFullView,
        LayoutOrder = v25.layoutOrder,
        NextSelectionUp = v25.NextSelectionUp,
        NextSelectionDown = v25.NextSelectionDown,
        NextSelectionLeft = v25.NextSelectionLeft,
        NextSelectionRight = v25.NextSelectionRight,
        ref = v26
    }, {
        Corner = v2.createElement("UICorner", {
            CornerRadius = v18
        }),
        Button = v2.createElement(v3.Focusable[l_ImageSetButton_0], {
            Position = UDim2.new(0.5, 0, 0.5, 0),
            AnchorPoint = Vector2.new(0.5, 0.5),
            Size = UDim2.fromOffset(l_IconSize_0.Regular, l_IconSize_0.Regular),
            BackgroundTransparency = 1,
            Image = l_getRbxthumbWithTypeSizeAndOptions_0(l_useSelector_0(function(v32)
                return v32.LocalUserId;
            end), l_AvatarHeadShot_0, 150),
            ZIndex = 2,
            SelectionImageObject = l_useSelectionCursor_0(l_CursorKind_0.RoundedRect),
            [v2.Event.Activated] = v2.useCallback(function()
                v29.navigate(v12.ProfilePictureEditorEmotes, {
                    prevNavPage = v28.opaque.name,
                    prevNavHistory = v31
                });
            end, {
                v29,
                v28,
                v31
            })
        }, {
            Corner = v2.createElement("UICorner", {
                CornerRadius = v19
            })
        })
    });
end));


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_CorePackages_0.RoactRodux);
local v4 = require(l_CorePackages_0.Packages.t);
local v5 = require(l_CorePackages_0.UIBlox);
local v6 = require(l_CorePackages_0.Packages.RoactGamepad);
local l_withLocalization_0 = require(l_CorePackages_0.Workspace.Packages.Localization).withLocalization;
local l_Focusable_0 = v6.Focusable;
local l_BaseMenu_0 = v5.App.Menu.BaseMenu;
local l_withStyle_0 = v5.Style.withStyle;
local l_Images_0 = v5.App.ImageSet.Images;
local l_RoactServices_0 = require(l_CorePackages_0.Workspace.Packages.RoactServices).RoactServices;
local v13 = require(l_Modules_0.AvatarExperience.AvatarEditor.Services.Analytics);
local v14 = require(l_Modules_0.AvatarExperience.Catalog.Services.Analytics);
local v15 = require(l_Modules_0.AvatarExperience.ProfilePictureEditor.Services.Analytics);
local v16 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.AvatarScreen);
local v17 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.withMappedNavigationParams);
local v18 = require(l_Modules_0.AvatarExperience.Common.Components.withOverlayFocusHandling);
local v19 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.withAvatarRoute);
local v20 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.NavigationUtils);
local v21 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.AvatarRoute);
local v22 = require(l_Modules_0.AvatarExperience.Common.Components.NavOverlayContainer);
local v23 = l_Images_0["icons/menu/customize"];
local v24 = l_Images_0["icons/menu/shop"];
local v25 = l_Images_0["icons/menu/profilepicture"];
local v26 = v2.PureComponent:extend("AXTransitionContextualMenu");
v26.validateProps = v4.strictInterface({
    defaultChildRef = v4.optional(v4.table),
    onOverlayClosed = v4.optional(v4.callback),
    focusController = v4.optional(v4.table),
    navigation = v4.table,
    avatarRoute = v21.Interface,
    screenSize = v4.Vector2,
    globalGuiInset = v4.strictInterface({
        left = v4.integer,
        top = v4.integer,
        right = v4.integer,
        bottom = v4.integer
    }),
    topBarHeight = v4.number,
    avatarAnalytics = v4.table,
    catalogAnalytics = v4.table,
    profilePictureEditorAnalytics = v4.table,
    NextSelectionUp = v4.optional(v4.table),
    NextSelectionDown = v4.optional(v4.table),
    [v2.Ref] = v4.optional(v4.table),
    inputBindings = v4.optional(v4.table)
});
v26.getOpaquePage = function(v27)
    return v27.props.avatarRoute.opaque.name;
end;
v26.init = function(v28)
    local v29, v30 = v2.createBinding(UDim2.fromScale(1, 1));
    v28.contextMenuSize = v29;
    v28.updateContextMenuSize = v30;
    v28.onAbsoluteSizeChanged = function(v31)
        if v31.AbsoluteSize.X > 640 then
            v28.updateContextMenuSize((UDim2.new(0, 300, 1, 0)));
            return ;
        else
            v28.updateContextMenuSize(UDim2.fromScale(1, 1));
            return ;
        end;
    end;
    v28.goToAvatarEditorPage = function()
        if v28:getOpaquePage() ~= v16.AvatarEditor then
            v20.navigateFromOverlay(v28.props.navigation, v16.AvatarEditor);
            v28.props.avatarAnalytics.catalogToAvatarButton();
        end;
    end;
    v28.goToCatalogPage = function()
        if v28:getOpaquePage() ~= v16.Catalog then
            v20.navigateFromOverlay(v28.props.navigation, v16.Catalog);
            v28.props.catalogAnalytics.avatarToCatalogButton();
        end;
    end;
    v28.goToProfilePictureEditorPage = function()
        if v28:getOpaquePage() ~= v16.ProfilePictureEditorEmotes then
            v20.navigateFromOverlay(v28.props.navigation, v16.ProfilePictureEditorEmotes);
        end;
        v28.props.profilePictureEditorAnalytics.profilePictureEditorButton();
    end;
    v28.onDismiss = function()
        v20.closeOverlay(v28.props.navigation);
    end;
end;
v26.render = function(v32)
    return l_withStyle_0(function(v33)
        return l_withLocalization_0({
            customizeText = "Feature.Catalog.Action.Customize",
            shopText = "Feature.Avatar.Action.Marketplace",
            profilePictureEditorText = "Feature.Avatar.Action.EditProfilePicture"
        })(function(v34)
            return v32:renderWithProviders(v33, v34);
        end);
    end);
end;
v26.renderWithProviders = function(v35, v36, v37)
    local l_Theme_0 = v36.Theme;
    return v2.createElement("Frame", {
        Size = UDim2.fromScale(1, 1),
        BackgroundTransparency = 1
    }, {
        Background = v2.createElement("TextButton", {
            ZIndex = 1,
            Text = "",
            BorderSizePixel = 0,
            BackgroundColor3 = l_Theme_0.Overlay.Color,
            BackgroundTransparency = l_Theme_0.Overlay.Transparency,
            AutoButtonColor = false,
            Position = UDim2.fromOffset(-v35.props.globalGuiInset.left, -v35.props.globalGuiInset.top),
            Size = UDim2.fromOffset(v35.props.screenSize.X, v35.props.screenSize.Y),
            [v2.Event.Activated] = v35.onDismiss
        }),
        Container = v2.createElement(v22, {
            ZIndex = 2,
            onAbsoluteSizeChanged = v35.onAbsoluteSizeChanged
        }, {
            SizeFrame = v2.createElement(l_Focusable_0.Frame, {
                BackgroundTransparency = 1,
                Size = v35.contextMenuSize,
                AnchorPoint = Vector2.new(0.5, 0),
                Position = UDim2.fromScale(0.5, 0),
                [v2.Ref] = v35.props.defaultChildRef
            }, {
                Menu = v2.createElement(l_BaseMenu_0, {
                    width = UDim.new(1, -24),
                    anchorPoint = Vector2.new(0.5, 0),
                    position = UDim2.new(0.5, 0, 0, v35.props.topBarHeight),
                    buttonProps = {
                        {
                            icon = v23,
                            text = v37.customizeText,
                            onActivated = v35.goToAvatarEditorPage,
                            selected = v35:getOpaquePage() == v16.AvatarEditor
                        },
                        {
                            icon = v24,
                            text = v37.shopText,
                            onActivated = v35.goToCatalogPage,
                            selected = v35:getOpaquePage() == v16.Catalog
                        },
                        {
                            icon = v25,
                            text = v37.profilePictureEditorText,
                            onActivated = v35.goToProfilePictureEditorPage,
                            selected = v35:getOpaquePage() == v16.ProfilePictureEditorEmotes
                        }
                    }
                })
            })
        })
    });
end;
return (v17((v19((v18((l_RoactServices_0.connect({
    avatarAnalytics = v13,
    catalogAnalytics = v14,
    profilePictureEditorAnalytics = v15
})((v3.connect(function(v39, _)
    return {
        screenSize = v39.ScreenSize,
        topBarHeight = v39.TopBar.topBarHeight,
        globalGuiInset = v39.GlobalGuiInset
    };
end, nil)(v26))))))))));


local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_CorePackages_0.RoactRodux);
local v4 = require(l_CorePackages_0.RoactNavigation);
local v5 = require(l_CorePackages_0.Packages.RoactGamepad);
local v6 = require(l_CorePackages_0.Packages.t);
local v7 = require(l_CorePackages_0.Packages.Dash);
local v8 = require(l_CorePackages_0.UIBlox);
local l_withLocalization_0 = require(l_CorePackages_0.Workspace.Packages.Localization).withLocalization;
local l_SegmentedControl_0 = v8.App.Control.SegmentedControl;
local l_RoactServices_0 = require(l_CorePackages_0.Workspace.Packages.RoactServices).RoactServices;
local v12 = require(l_Modules_0.AvatarExperience.AvatarEditor.Services.Analytics);
local v13 = require(l_Modules_0.AvatarExperience.Catalog.Services.Analytics);
local v14 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.AvatarScreen);
local v15 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.withAvatarRoute);
local v16 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.AvatarRoute);
local v17 = v2.PureComponent:extend("AXTransitionSegmentedMenu");
v17.validateProps = v6.strictInterface({
    formFactor = v6.string,
    isCompactView = v6.boolean,
    isUnderTitleSearchBarEnabled = v6.boolean,
    isSearching = v6.boolean,
    setVisible = v7.isCallable,
    cancelSearch = v7.isCallable,
    activateSearch = v7.isCallable,
    buttonRef = v6.optional(v6.table),
    navigation = v6.table,
    avatarRoute = v16.Interface,
    topBarHeight = v6.number,
    avatarAnalytics = v6.table,
    catalogAnalytics = v6.table,
    [v2.Ref] = v6.optional(v6.table)
});
v17.getOpaquePage = function(v18)
    return v18.props.avatarRoute.opaque.name;
end;
v17.init = function(v19)
    v19:setState({
        segmentedControlWidth = 234
    });
    v19.goToAvatarEditorPage = function()
        if v19:getOpaquePage() ~= v14.AvatarEditor then
            v19.props.navigation.navigate(v14.AvatarEditor);
            v19.props.avatarAnalytics.catalogToAvatarButton();
        end;
    end;
    v19.goToCatalogPage = function()
        if v19:getOpaquePage() ~= v14.Catalog then
            v19.props.navigation.navigate(v14.Catalog);
            v19.props.catalogAnalytics.avatarToCatalogButton();
        end;
    end;
    v19.onTabActivated = function(v20)
        if v20 == 1 then
            v19.goToCatalogPage();
            return ;
        else
            if v20 == 2 then
                v19.goToAvatarEditorPage();
            end;
            return ;
        end;
    end;
end;
v17.render = function(v21)
    return l_withLocalization_0({
        customizeText = "Feature.Catalog.Action.Customize",
        shopText = "Feature.Avatar.Action.Marketplace"
    })(function(v22)
        return v21:renderWithProviders(v22);
    end);
end;
v17.renderWithProviders = function(v23, v24)
    return v2.createElement(v5.Focusable.Frame, {
        Size = UDim2.fromScale(1, 1),
        BackgroundTransparency = 1,
        [v2.Change.AbsoluteSize] = function(v25)
            v23:absoluteSizeChanged(v25);
        end
    }, {
        UIListLayout = v2.createElement("UIListLayout", {
            FillDirection = Enum.FillDirection.Vertical,
            HorizontalAlignment = Enum.HorizontalAlignment.Center,
            SortOrder = Enum.SortOrder.LayoutOrder,
            VerticalAlignment = Enum.VerticalAlignment.Center
        }),
        SegmentedControl = v2.createElement(l_SegmentedControl_0, {
            width = UDim.new(0, v23.state.segmentedControlWidth),
            selectedTabIndex = v23:getOpaquePage() == v14.Catalog and 1 or 2,
            onTabActivated = v23.onTabActivated,
            tabs = {
                {
                    tabName = v24.shopText
                },
                {
                    tabName = v24.customizeText
                }
            }
        })
    });
end;
v17.absoluteSizeChanged = function(v26, v27)
    v26:setState({
        segmentedControlWidth = v27.AbsoluteSize.X >= 234 and 234 or 224
    });
end;
return (v15((v4.withNavigation((l_RoactServices_0.connect({
    avatarAnalytics = v12,
    catalogAnalytics = v13
})((v3.connect(function(v28, _)
    return {
        topBarHeight = v28.TopBar.topBarHeight
    };
end, nil)(v17))))))));


local l_CoreGui_0 = game:GetService("CoreGui");
local l_CorePackages_0 = game:GetService("CorePackages");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_Modules_0 = l_CoreGui_0.RobloxGui.Modules;
local v4 = require(l_Modules_0.AvatarExperience.Common.Constants);
local v5 = require(l_CorePackages_0.Packages.React);
local v6 = require(l_CorePackages_0.Packages.UIBlox);
local l_ImageSetLabel_0 = v6.Core.ImageSet.ImageSetLabel;
local l_Images_0 = v6.App.ImageSet.Images;
local l_useInitializedValue_0 = v6.Core.Hooks.useInitializedValue;
local l_useStyle_0 = v6.Core.Style.useStyle;
local l_Signal_0 = require(l_CorePackages_0.Workspace.Packages.AppCommonLib).Signal;
local l_useSignal_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.useSignal;
local v13 = require(l_Modules_0.AvatarExperience.Common.Context.AdaptiveScrollingContext);
local v14 = require(l_Modules_0.AvatarExperience.Common.Enum.FullView);
local v15 = require(l_Modules_0.AvatarExperience.Common.Hooks.useFullView);
local l_ExternalEventConnection_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).ExternalEventConnection;
local v17 = require(l_CorePackages_0.Otter);
local v18 = require(l_Modules_0.AvatarExperience.Common.Util.IXPUtils);
local v19 = require(l_Modules_0.AvatarExperience.Flags.AXAdaptiveScrollingImprovementIXPTest);
local v20 = require(l_Modules_0.AvatarExperience.Flags.GetFFlagAXPortraitSplitAdaptiveScrollingFix);
local v21 = require(l_Modules_0.AvatarExperience.Flags.GetFFlagAXAdaptiveScrollingItemResetFix);
local v22 = {
    dampingRatio = 1,
    frequency = 5
};
local v23 = game:DefineFastInt("AXAdaptiveScrollingJustSelectedMillis", 500) / 1000;
local v24 = l_Images_0["icons/navigation/swipe"];
local l_SceneFullView_0 = v14.SceneFullView;
local l_None_0 = v14.None;
local l_UIFullView_0 = v14.UIFullView;
local function _(v28, v29)
    return math.abs(v28 - v29) < 1.0E-4;
end;
local function v137(v31)
    local v32 = v5.useRef(nil);
    local l_fullHeight_0 = v31.fullHeight;
    local l_midHeight_0 = v31.midHeight;
    local l_alwaysShowingHeight_0 = v31.alwaysShowingHeight;
    local v36 = v5.useRef(nil);
    local v37 = l_fullHeight_0 - l_alwaysShowingHeight_0;
    local v38 = v5.useRef(false);
    local v39 = not not v20() and v31.enableMidViewScrolling;
    local v40 = 20;
    if not (not v20() or not v39) then
        v40 = 0;
    end;
    local v41 = v5.useRef(nil);
    local v42 = if not v20() then nil else v5.useRef(nil);
    local v43, v44 = v5.useState({
        instance = nil,
        time = 0
    });
    local v45, v46 = v5.useState(0);
    local v47, v48 = v5.useState(0);
    local function v49()
        if v41.current then
            v41.current:destroy();
            v41.current = nil;
        end;
    end;
    local v50 = nil;
    if not (not v20() or not v39) then
        v50 = function()
            if not (not v42 or not v42.current) then
                v42.current:destroy();
                v42.current = nil;
            end;
        end;
    end;
    v5.useEffect(function()
        if not v20() or not v39 then
            return v49;
        else
            return function()
                if v41.current then
                    v41.current:destroy();
                    v41.current = nil;
                end;
                v50();
            end;
        end;
    end, {});
    local v51 = l_useStyle_0();
    local l_Theme_0 = v51.Theme;
    local function _(v53)
        if v53 == l_UIFullView_0 then
            return l_fullHeight_0;
        elseif v53 == l_SceneFullView_0 then
            return l_alwaysShowingHeight_0;
        else
            return l_midHeight_0;
        end;
    end;
    local v55, v56 = v5.useBinding(0);
    local v57, v58 = v15();
    local v59 = v5.useRef(v57);
    v59.current = v57;
    local l_useState_0 = v5.useState;
    local v61 = true;
    if v57 ~= l_UIFullView_0 then
        v61 = (v20() and v39) and v57 == l_None_0;
    end;
    l_useState_0, v61 = l_useState_0(v61);
    local v62 = v5.useCallback(function()
        v61(false);
    end);
    local function _()
        return v41.current ~= nil;
    end;
    local function v74()
        if v21() and v57 ~= l_None_0 then
            return ;
        else
            if not v20() or not v39 then
                if v23 < v43.time - tick() then
                    return ;
                end;
            elseif v23 < tick() - v43.time then
                return ;
            end;
            local l_instance_0 = v43.instance;
            if l_instance_0 then
                assert(l_instance_0, "");
                local l_l_instance_0_FirstAncestorWhichIsA_0 = l_instance_0:FindFirstAncestorWhichIsA("ScrollingFrame");
                if not l_l_instance_0_FirstAncestorWhichIsA_0 or l_l_instance_0_FirstAncestorWhichIsA_0 == v36.current then
                    return ;
                else
                    assert(l_l_instance_0_FirstAncestorWhichIsA_0, "");
                    if not v21() and v57 ~= l_None_0 then
                        return ;
                    else
                        local l_Y_0 = l_instance_0.AbsolutePosition.Y;
                        local l_Y_1 = l_l_instance_0_FirstAncestorWhichIsA_0.CanvasPosition.Y;
                        if not v20() or not v39 then
                            local v68 = l_Y_0 + l_instance_0.AbsoluteSize.Y;
                            local v69 = l_l_instance_0_FirstAncestorWhichIsA_0.AbsolutePosition.Y + v45;
                            local v70 = ((l_l_instance_0_FirstAncestorWhichIsA_0.AbsolutePosition.Y + l_midHeight_0) - v4.PeekHeaderHeight) - v47;
                            if l_Y_0 < v69 then
                                l_Y_1 = l_Y_1 - (v69 - l_Y_0);
                            elseif v70 < v68 then
                                l_Y_1 = l_Y_1 + (v68 - v70);
                            end;
                        else
                            local v71 = l_Y_0 - l_l_instance_0_FirstAncestorWhichIsA_0.AbsolutePosition.Y;
                            if math.abs(v71) > 5 then
                                l_Y_1 = l_Y_1 + v71;
                            end;
                        end;
                        l_Y_1 = math.clamp(l_Y_1, 0, l_l_instance_0_FirstAncestorWhichIsA_0.AbsoluteCanvasSize.Y - l_l_instance_0_FirstAncestorWhichIsA_0.AbsoluteWindowSize.Y);
                        if not v20() or not v39 then
                            l_l_instance_0_FirstAncestorWhichIsA_0.CanvasPosition = Vector2.new(l_l_instance_0_FirstAncestorWhichIsA_0.CanvasPosition.X, l_Y_1);
                        elseif v42 then
                            local v72 = v17.createSingleMotor(l_l_instance_0_FirstAncestorWhichIsA_0.CanvasPosition.Y);
                            v42.current = v72;
                            v72:onStep(function(v73)
                                l_l_instance_0_FirstAncestorWhichIsA_0.ScrollVelocity = Vector2.new(0, 0);
                                l_l_instance_0_FirstAncestorWhichIsA_0.CanvasPosition = Vector2.new(0, v73);
                            end);
                            v72:onComplete(function()
                                v50();
                            end);
                            v72:setGoal(v17.spring(l_Y_1, v22));
                            return ;
                        end;
                        return ;
                    end;
                end;
            else
                return ;
            end;
        end;
    end;
    local v85 = v5.useCallback(function(v75, v76)
        local l_current_0 = v36.current;
        if l_current_0 then
            assert(l_current_0, "");
            local l_Y_2 = l_current_0.CanvasPosition.Y;
            local v79 = if v75 == l_UIFullView_0 then l_fullHeight_0 else if v75 == l_SceneFullView_0 then l_alwaysShowingHeight_0 else l_midHeight_0 - l_alwaysShowingHeight_0;
            if not (v41.current ~= nil) then
                if not v20() or not v39 then
                    v61(v75 == l_UIFullView_0);
                else
                    local l_v61_0 = v61;
                    local v81 = true;
                    if v75 ~= l_UIFullView_0 then
                        v81 = v75 == l_None_0;
                    end;
                    l_v61_0(v81);
                end;
                if not (v75 == v57) or not (math.abs(v79 - l_Y_2) < 1.0E-4) then
                    v58(v75);
                    local v82 = v17.createSingleMotor(l_Y_2);
                    v41.current = v82;
                    v82:onStep(function(v83)
                        l_current_0.ScrollVelocity = Vector2.new(0, 0);
                        l_current_0.CanvasPosition = Vector2.new(0, v83);
                    end);
                    v82:onComplete(function(_)
                        if v41.current then
                            v41.current:destroy();
                            v41.current = nil;
                        end;
                        v74();
                    end);
                    if not v76 then
                        v82:setGoal(v17.instant(v79));
                        return ;
                    else
                        v82:setGoal(v17.spring(v79, v22));
                        return ;
                    end;
                else
                    return ;
                end;
            else
                return ;
            end;
        else
            return ;
        end;
    end, {
        v57,
        v58,
        l_alwaysShowingHeight_0,
        l_midHeight_0,
        l_fullHeight_0
    });
    v5.useEffect(function()
        v85(v59.current, false);
    end, {
        l_alwaysShowingHeight_0,
        l_midHeight_0,
        l_fullHeight_0
    });
    v5.useEffect(function()
        v85(v57, true);
    end, {
        v57
    });
    v5.useEffect(function()
        if not (not (not ((not v20() or not v39) or not v43.instance) and v57 == l_None_0) or v41.current ~= nil) then
            v74();
        end;
    end, {
        v43.instance,
        v57,
        v39
    });
    local v86 = l_useInitializedValue_0(l_Signal_0.new);
    l_useSignal_0(v86, v62);
    local v95 = v5.useMemo(function()
        local function _(v87)
            if not (not (v86 and v87 < -v40) or not v38.current) then
                v86:fire();
            end;
        end;
        return {
            scrollingEnabled = l_useState_0,
            overscrollSignal = v86,
            onCanvasYChanged = function(v89)
                if not (not (v86 and v89 < -v40) or not v38.current) then
                    v86:fire();
                end;
            end,
            onCanvasPositionChanged = function(v90)
                local l_Y_3 = v90.CanvasPosition.Y;
                if not (not (v86 and l_Y_3 < -v40) or not v38.current) then
                    v86:fire();
                end;
            end,
            setSelectedItemInstance = function(v92)
                if not v21() or v92 then
                    v44({
                        instance = v92,
                        time = tick()
                    });
                    return ;
                else
                    v44({
                        instance = nil,
                        time = 0
                    });
                    return ;
                end;
            end,
            setTopAndBottomPanelHeights = function(v93, v94)
                if v93 ~= v45 then
                    v46(v93);
                end;
                if v94 ~= v47 then
                    v48(v94);
                end;
            end
        };
    end, {
        l_useState_0,
        v86
    });
    local function v97(v96)
        v56(v96.CanvasPosition.Y);
    end;
    local function _(v98, v99, v100, v101)
        local v102 = if v100 == l_UIFullView_0 then l_fullHeight_0 else if v100 == l_SceneFullView_0 then l_alwaysShowingHeight_0 else l_midHeight_0;
        local v103 = if v99 == l_UIFullView_0 then l_fullHeight_0 else if v99 == l_SceneFullView_0 then l_alwaysShowingHeight_0 else l_midHeight_0;
        local v104 = v102 - v103;
        local v105 = v101 < 0;
        local v106 = v101 > 0;
        if v57 == v100 then
            if v106 or v98 < v103 + v104 * 0.8 then
                return v99;
            else
                return v100;
            end;
        elseif v105 or v103 + v104 * 0.2 < v98 then
            return v100;
        else
            return v99;
        end;
    end;
    local v128 = v5.useCallback(function()
        local l_current_1 = v36.current;
        if l_current_1 then
            assert(l_current_1, "");
            local v109 = l_alwaysShowingHeight_0 + l_current_1.CanvasPosition.Y;
            local l_Y_4 = l_current_1.ScrollVelocity.Y;
            local v111 = false;
            if v57 == l_SceneFullView_0 then
                v111 = v109 == l_alwaysShowingHeight_0;
            end;
            local v112 = false;
            if v57 == l_UIFullView_0 then
                v112 = v109 == l_fullHeight_0;
            end;
            local v113;
            if not v20() or not v39 then
                v113 = false;
            else
                v113 = false;
                if v57 == l_None_0 then
                    v113 = v109 == l_midHeight_0;
                end;
            end;
            if not (not (v111 or v112) and not v113) and l_Y_4 == 0 then
                return nil;
            elseif l_midHeight_0 < v109 then
                local l_l_None_0_0 = l_None_0;
                local l_l_UIFullView_0_0 = l_UIFullView_0;
                local v116 = if l_l_UIFullView_0_0 == l_UIFullView_0 then l_fullHeight_0 else if l_l_UIFullView_0_0 == l_SceneFullView_0 then l_alwaysShowingHeight_0 else l_midHeight_0;
                local v117 = if l_l_None_0_0 == l_UIFullView_0 then l_fullHeight_0 else if l_l_None_0_0 == l_SceneFullView_0 then l_alwaysShowingHeight_0 else l_midHeight_0;
                local v118 = v116 - v117;
                local v119 = l_Y_4 < 0;
                local v120 = l_Y_4 > 0;
                if v57 == l_l_UIFullView_0_0 then
                    if v120 or v109 < v117 + v118 * 0.8 then
                        return l_l_None_0_0;
                    else
                        return l_l_UIFullView_0_0;
                    end;
                elseif v119 or v117 + v118 * 0.2 < v109 then
                    return l_l_UIFullView_0_0;
                else
                    return l_l_None_0_0;
                end;
            else
                local l_l_SceneFullView_0_0 = l_SceneFullView_0;
                local l_l_None_0_1 = l_None_0;
                local v123 = if l_l_None_0_1 == l_UIFullView_0 then l_fullHeight_0 else if l_l_None_0_1 == l_SceneFullView_0 then l_alwaysShowingHeight_0 else l_midHeight_0;
                local v124 = if l_l_SceneFullView_0_0 == l_UIFullView_0 then l_fullHeight_0 else if l_l_SceneFullView_0_0 == l_SceneFullView_0 then l_alwaysShowingHeight_0 else l_midHeight_0;
                local v125 = v123 - v124;
                local v126 = l_Y_4 < 0;
                local v127 = l_Y_4 > 0;
                if v57 == l_l_None_0_1 then
                    if v127 or v109 < v124 + v125 * 0.8 then
                        return l_l_SceneFullView_0_0;
                    else
                        return l_l_None_0_1;
                    end;
                elseif v126 or v124 + v125 * 0.2 < v109 then
                    return l_l_None_0_1;
                else
                    return l_l_SceneFullView_0_0;
                end;
            end;
        else
            return nil;
        end;
    end, {
        v57,
        l_fullHeight_0,
        l_midHeight_0,
        l_alwaysShowingHeight_0
    });
    return v5.createElement("Frame", {
        BackgroundTransparency = 1,
        Size = if not not v20() and v39 then UDim2.new(1, 1, 1, 0) else UDim2.fromScale(1, 1),
        ref = v32
    }, {
        DropShadowBackground = v5.createElement("Frame", {
            ZIndex = 0,
            Size = UDim2.new(1, 0, 0, 36),
            Position = v55:map(function(v129)
                return UDim2.new(0, 0, 1, (-v129 - l_alwaysShowingHeight_0) - 30);
            end)
        }, {
            UIGradient = v5.createElement("UIGradient", {
                Rotation = 90,
                Color = ColorSequence.new({
                    ColorSequenceKeypoint.new(0, v51.Theme.DropShadow.Color),
                    ColorSequenceKeypoint.new(1, v51.Theme.DropShadow.Color)
                }),
                Transparency = NumberSequence.new({
                    NumberSequenceKeypoint.new(0, 1),
                    NumberSequenceKeypoint.new(1, 0.7)
                })
            })
        }),
        ClipFrame = v5.createElement("Frame", {
            BackgroundTransparency = 1,
            ClipsDescendants = true,
            AnchorPoint = Vector2.new(0.5, 1),
            Position = UDim2.fromScale(0.5, 1),
            Size = v55:map(function(v130)
                return UDim2.new(1, 0, 0, v130 + l_alwaysShowingHeight_0);
            end)
        }, {
            ScrollingFrame = v5.createElement("ScrollingFrame", {
                ref = v36,
                AnchorPoint = Vector2.new(0.5, 1),
                Position = UDim2.fromScale(0.5, 1),
                Size = UDim2.new(1, 0, 0, l_fullHeight_0),
                CanvasSize = UDim2.new(1, 0, 0, l_fullHeight_0 + v37),
                BackgroundTransparency = 1,
                ScrollingDirection = Enum.ScrollingDirection.Y,
                ScrollBarThickness = 0,
                ElasticBehavior = Enum.ElasticBehavior.Never,
                [v5.Change.CanvasPosition] = v97
            }, {
                VerticalLayout = v5.createElement("UIListLayout", {
                    SortOrder = Enum.SortOrder.LayoutOrder,
                    FillDirection = Enum.FillDirection.Vertical,
                    HorizontalAlignment = Enum.HorizontalAlignment.Center
                }),
                Spacer = v5.createElement("Frame", {
                    BackgroundTransparency = 1,
                    Active = false,
                    Size = UDim2.new(1, 0, 0, v37),
                    LayoutOrder = 1
                }),
                PeekHeader = v5.createElement("TextButton", {
                    Text = "",
                    LayoutOrder = 2,
                    ZIndex = 2,
                    BackgroundTransparency = 1,
                    Size = UDim2.new(1, 0, 0, v4.PeekHeaderHeight),
                    BorderSizePixel = 0,
                    [v5.Event.Activated] = v5.useCallback(function()
                        if not (v57 ~= l_UIFullView_0) or v57 == l_SceneFullView_0 then
                            v85(l_None_0, true);
                            return ;
                        else
                            v85(l_UIFullView_0, true);
                            return ;
                        end;
                    end, {
                        v57,
                        v85
                    })
                }, {
                    PeekHeaderBackground = v5.createElement("Frame", {
                        LayoutOrder = 2,
                        ZIndex = 1,
                        Size = UDim2.new(1, 0, 0, v4.PeekHeaderHeight + 12),
                        BackgroundTransparency = l_Theme_0.BackgroundDefault.Transparency,
                        BackgroundColor3 = l_Theme_0.BackgroundDefault.Color,
                        BorderSizePixel = 0,
                        Active = false
                    }, {
                        UICorner = v5.createElement("UICorner", {
                            CornerRadius = UDim.new(0, 12)
                        })
                    }),
                    Dragger = v5.createElement(l_ImageSetLabel_0, {
                        ZIndex = 2,
                        BackgroundTransparency = 1,
                        Size = UDim2.new(0, 36, 1, 0),
                        AnchorPoint = Vector2.new(0.5, 0.5),
                        Position = UDim2.fromScale(0.5, 0.5),
                        Image = v24,
                        ImageColor3 = v51.Theme.UIEmphasis.Color,
                        ImageTransparency = v51.Theme.UIEmphasis.Transparency,
                        Active = false
                    })
                }),
                ExpandingContent = v5.createElement("Frame", {
                    BackgroundTransparency = 1,
                    Size = if not not v20() and v39 then v55:map(function(v131)
                        return UDim2.new(1, 0, 0, v131 + l_alwaysShowingHeight_0);
                    end) else UDim2.new(1, 0, 0, l_fullHeight_0 - v4.PeekHeaderHeight),
                    LayoutOrder = 3,
                    ZIndex = 3
                }, {
                    AdaptiveScrollingProvider = v5.createElement(v13.Provider, {
                        value = v95
                    }, v31.children)
                }),
                OnInputBegan = v5.createElement(l_ExternalEventConnection_0, {
                    event = l_UserInputService_0.InputBegan,
                    callback = v5.useCallback(function(v132)
                        if v132.UserInputType ~= Enum.UserInputType.Touch then
                            return ;
                        else
                            v38.current = true;
                            if v41.current then
                                v41.current:destroy();
                                v41.current = nil;
                            end;
                            return ;
                        end;
                    end)
                }),
                OnInputEnded = v5.createElement(l_ExternalEventConnection_0, {
                    event = l_UserInputService_0.InputEnded,
                    callback = v5.useCallback(function(v133)
                        if v133.UserInputType ~= Enum.UserInputType.Touch then
                            return ;
                        else
                            v38.current = false;
                            local v134 = v128();
                            if not v134 then
                                if not v20() or not v39 then
                                    v61(v59.current == l_UIFullView_0);
                                    return ;
                                else
                                    local l_v61_1 = v61;
                                    local v136 = true;
                                    if v59.current ~= l_UIFullView_0 then
                                        v136 = v59.current == l_None_0;
                                    end;
                                    l_v61_1(v136);
                                    return ;
                                end;
                            else
                                v85(v134, true);
                                return ;
                            end;
                        end;
                    end, {
                        v85,
                        v128
                    })
                })
            })
        })
    });
end;
if v20() then
    v137 = v18.connectTestVariables({
        enableMidViewScrolling = v19.EnableMidViewScrolling
    })(v137);
end;
return v137;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_CoreGui_0 = game:GetService("CoreGui");
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_CorePackages_0.RoactRodux);
local v4 = require(l_CorePackages_0.Packages.t);
local v5 = require(l_CorePackages_0.UIBlox);
local l_RetrievalStatus_0 = v5.App.Loading.Enum.RetrievalStatus;
local l_LoadingStateContainer_0 = v5.App.Container.LoadingStateContainer;
local v8 = v2.PureComponent:extend("AvatarExperienceLoaded");
local _ = require(l_CoreGui_0.RobloxGui.Modules.AvatarExperience.Common.AvatarExperienceState);
v8.validateProps = v4.strictInterface({
    showLoadingBar = v4.boolean,
    [v2.Children] = v4.optional(v4.table),
    avatarExperienceLoaded = v4.boolean
});
v8.init = function(v10)
    v10.emptyRenderFunction = function()
        return nil;
    end;
end;
v8.getLoadingStatus = function(v11)
    if v11.props.avatarExperienceLoaded then
        return l_RetrievalStatus_0.Done;
    else
        return l_RetrievalStatus_0.Fetching;
    end;
end;
v8.render = function(v12)
    local v13 = nil;
    if not v12.props.showLoadingBar then
        v13 = v12.emptyRenderFunction;
    end;
    return v2.createElement(l_LoadingStateContainer_0, {
        dataStatus = v12:getLoadingStatus(),
        renderOnLoaded = function()
            return v2.oneChild(v12.props[v2.Children]);
        end,
        renderOnLoading = v13
    });
end;
v8 = v3.connect(function(v14, _)
    return {
        avatarExperienceLoaded = v14.AvatarExperience.Common.AvatarExperienceLoaded
    };
end, nil)(v8);
return function(v16, v17)
    if v17 == nil then
        v17 = true;
    end;
    return function(v18)
        return v2.createElement(v8, {
            showLoadingBar = v17
        }, {
            Child = v2.createElement(v16, v18)
        });
    end;
end;


local l_CorePackages_0 = game:GetService("CorePackages");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_GuiService_0 = game:GetService("GuiService");
local l_Modules_0 = l_CoreGui_0.RobloxGui.Modules;
local v4 = require(l_CorePackages_0.Roact);
local v5 = require(l_CorePackages_0.Packages.RoactGamepad);
local l_Focusable_0 = v5.Focusable;
local v7 = require(l_CorePackages_0.RoactRodux);
local v8 = require(l_CorePackages_0.Packages.t);
local l_withLocalization_0 = require(l_CorePackages_0.Workspace.Packages.Localization).withLocalization;
local l_ExternalEventConnection_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).ExternalEventConnection;
local v11 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.withMappedNavigationParams);
local l_DeviceOrientationMode_0 = require(l_CorePackages_0.Workspace.Packages.RobloxAppEnums).DeviceOrientationMode;
local v13 = require(l_Modules_0.AvatarExperience.Common.Components.AfterAvatarExperienceLoaded);
local v14 = require(l_Modules_0.AvatarExperience.Common.Components.GamepadFocusHandlerForPage);
local v15 = require(l_Modules_0.AvatarExperience.Common.Components.AvatarExperienceView);
local v16 = require(l_Modules_0.LuaApp.Components.TopBar.TopBar);
local v17 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.Debug.NavigationEventsLogger);
local v18 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.ExternalNavigationHandler);
local v19 = require(l_Modules_0.AvatarExperience.Common.Actions.SetPlayEmoteInBackground);
local v20 = require(l_Modules_0.LuaApp.Thunks.NavigateBack);
local _ = require(l_Modules_0.AvatarExperience.Common.AvatarExperienceState);
local v22 = v4.PureComponent:extend("AvatarBackground");
v22.defaultProps = {
    playEmote = true,
    isVisible = true,
    isTopBarVisible = true
};
v22.validateProps = v8.strictInterface({
    focusController = v8.optional(v8.table),
    title = v8.optional(v8.string),
    playEmote = v8.optional(v8.boolean),
    isVisible = v8.optional(v8.boolean),
    renderContent = v8.optional(v8.callback),
    isTopBarSecondary = v8.optional(v8.boolean),
    isTopBarVisible = v8.optional(v8.boolean),
    deviceOrientation = v8.string,
    currentCharacter = v8.Instance,
    setPlayEmoteInBackground = v8.callback,
    navigateBackInAppRoute = v8.callback,
    avatarRoute = v8.optional(v8.table),
    detail = v8.optional(v8.string),
    navigation = v8.table
});
v22.init = function(v23)
    v23.focusController = v23.props.focusController or v5.createFocusController();
    v23.backButtonPressed = function()
        v23.props.navigateBackInAppRoute(true);
    end;
    v23.backButton = v16.makeBackButton(v23.backButtonPressed);
    v23.renderContent = function()
        if not v23.props.renderContent then
            return nil;
        else
            return v23.props.renderContent({
                character = v23.props.currentCharacter
            });
        end;
    end;
end;
v22.renderTopBarWithLocalized = function(v24)
    if not v24.props.title then
        return v24:renderTopBar("");
    else
        return l_withLocalization_0({
            title = v24.props.title
        })(function(v25)
            return v24:renderTopBar(v25.title);
        end);
    end;
end;
v22.renderTopBar = function(v26, v27)
    return v4.createElement(v16.Container, {
        isSecondary = v26.props.isTopBarSecondary,
        titleText = v27,
        transparentBackground = true,
        leftItem = v26.backButton
    });
end;
v22.renderAvatarExperienceView = function(v28, v29)
    return v4.createElement(v15, {
        topBar = not not v29 and v28:renderTopBarWithLocalized() or nil,
        bottomBarEnabled = false,
        isSceneFullView = true,
        isUIFullView = false
    }, {
        ExternalNavigationHandler = v4.createElement(v18, {
            navigation = v28.props.navigation
        }),
        GamepadFocusHandlerForPage = v4.createElement(v14, {
            focusController = v28.focusController
        })
    });
end;
v22.renderMainView = function(v30)
    if v30.props.deviceOrientation == l_DeviceOrientationMode_0.Portrait then
        return v30:renderAvatarExperienceView(v30.props.isTopBarVisible);
    else
        return v4.createElement("Frame", {
            BackgroundTransparency = 1,
            Size = UDim2.fromScale(1, 1)
        }, {
            TopBar = if v30.props.isTopBarVisible then v30:renderTopBarWithLocalized() else nil,
            AEView = v30:renderAvatarExperienceView(false)
        });
    end;
end;
v22.render = function(v31)
    return v4.createElement(l_Focusable_0.Frame, {
        BackgroundTransparency = 1,
        Size = UDim2.fromScale(1, 1),
        focusController = v31.focusController
    }, {
        BackButtonConnection = v4.createElement(l_ExternalEventConnection_0, {
            event = l_GuiService_0.ShowLeaveConfirmation,
            callback = v31.backButtonPressed
        }),
        NavigationEventsLogger = v4.createElement(v17, {
            pageName = "AvatarBackground"
        }),
        Mainview = v31:renderMainView(),
        Content = v31.renderContent()
    });
end;
v22.didUpdate = function(v32, v33)
    if v32.props.playEmote ~= v33.playEmote then
        v32.props.setPlayEmoteInBackground(v32.props.playEmote);
    end;
end;
v22.didMount = function(v34)
    v34.props.setPlayEmoteInBackground(v34.props.playEmote);
end;
return v13((v11((v7.connect(function(v35)
    return {
        deviceOrientation = v35.DeviceOrientation,
        currentCharacter = v35.AvatarExperience.AvatarScene.Character.CurrentCharacter
    };
end, function(v36)
    return {
        setPlayEmoteInBackground = function(v37)
            v36(v19(v37));
        end,
        navigateBackInAppRoute = function(v38)
            v36(v20(v38));
        end
    };
end)(v22)))));


local l_CoreGui_0 = game:GetService("CoreGui");
local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = l_CoreGui_0.RobloxGui.Modules;
local v3 = require(l_CorePackages_0.Roact);
local v4 = require(l_CorePackages_0.Packages.React);
local l_useRoactService_0 = require(l_CorePackages_0.Workspace.Packages.RobloxAppHooks).useRoactService;
local v6 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.BackButtonHandler);
local v7 = require(l_Modules_0.AvatarExperience.Common.Components.AvatarRouteUpdater);
local v8 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.ExternalNavigationHandler);
local v9 = require(l_Modules_0.AvatarExperience.Common.Components.AvatarExperienceTransitionManager);
local v10 = require(l_Modules_0.AvatarExperience.LayeredClothingSort.Components.LayeredClothingSortHandler);
local v11 = require(l_Modules_0.AvatarExperience.Common.Constants);
local v12 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.AvatarScreen);
local _ = require(l_Modules_0.AvatarExperience.Common.Types);
local v14 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.NavigationUtils);
local v15 = require(l_Modules_0.AvatarExperience.Catalog.Services.Analytics);
local v16 = require(l_Modules_0.AvatarExperience.Flags.GetFFlagEnableAXTopLevelCounters);
local v17 = game:DefineFastFlag("AXEnableOverCountingFixCounters", false);
local v18 = game:DefineFastInt("AXTopLevelCountersThrottleInterval", 800);
local function v24(v19, v20)
    local l_name_0 = v19.current.name;
    local l_Counter_0 = v11.Counter;
    local v23 = ({
        [v12.Catalog] = l_Counter_0.CatalogView,
        [v12.CatalogSearch] = l_Counter_0.SearchView,
        [v12.AvatarEditor] = l_Counter_0.EditorView,
        [v12.ItemDetails] = function()
            return not not v14.isWithinViewContext(v19, v12.CatalogSearch) and l_Counter_0.SearchItemDetailsView or l_Counter_0.CatalogItemDetailsView;
        end,
        [v12.SortAndFilters] = function()
            return not not v14.isWithinViewContext(v19, v12.CatalogSearch) and l_Counter_0.SearchFiltersView or l_Counter_0.CatalogFiltersView;
        end
    })[l_name_0] or l_Counter_0.OthersView;
    if type(v23) == "function" then
        v23 = v23();
    end;
    v20.sendAXCounter(v23);
end;
return function(v25)
    local l_avatarRoute_0 = v25.avatarRoute;
    local l_navigation_0 = v25.navigation;
    if v16() then
        local v28 = l_useRoactService_0(v15);
        local v29 = if not v17 then nil else v4.useRef(0);
        v4.useEffect(function()
            if not v17 then
                v24(l_avatarRoute_0, v28);
            else
                local v30 = os.clock() * 1000;
                if not ((not v30 or not v29) or not v29.current) and v18 <= v30 - v29.current then
                    v24(l_avatarRoute_0, v28);
                    v29.current = v30;
                    return ;
                end;
            end;
        end, {
            l_avatarRoute_0,
            v28
        });
    end;
    return v3.createFragment({
        BackButtonHandler = v3.createElement(v6, {
            navigation = l_navigation_0
        }),
        ExternalNavigationHandler = v3.createElement(v8, {
            navigation = l_navigation_0
        }),
        AvatarExperienceTransitionManager = v3.createElement(v9, {
            navigation = l_navigation_0
        }),
        AvatarRouteUpdater = v3.createElement(v7, {
            avatarRoute = l_avatarRoute_0
        }),
        LayeredClothingSortHandler = v3.createElement(v10, {
            avatarRoute = l_avatarRoute_0
        })
    });
end;


local l_CoreGui_0 = game:GetService("CoreGui");
local l_CorePackages_0 = game:GetService("CorePackages");
local l_Modules_0 = l_CoreGui_0.RobloxGui.Modules;
local v3 = require(l_CorePackages_0.RoactRodux);
local v4 = require(l_CorePackages_0.Packages.React);
local v5 = require(l_Modules_0.AvatarExperience.Common.Components.AvatarExperienceInitialization);
local v6 = require(l_Modules_0.AvatarExperience.Common.Managers.AvatarSceneManager);
local v7 = require(l_Modules_0.AvatarExperience.Common.Components.ItemSelectionManager);
local v8 = require(l_Modules_0.LuaApp.Enum.LoginStatus);
local v9 = require(l_Modules_0.AvatarExperience.Common.Debug.AvatarExperienceIXPDiagnostics);
return (v3.connect(function(v10, _)
    return {
        authStatus = v10.AuthenticationStatus.status
    };
end, nil)(function(v12)
    local l_shouldStart_0 = v12.shouldStart;
    local l_shouldManageBackground_0 = v12.shouldManageBackground;
    local l_store_0 = v12.store;
    local v16 = v12.authStatus == v8.LOGGED_IN or l_shouldStart_0;
    return v4.createElement(v4.Fragment, {}, {
        ItemSelectionManager = v4.createElement(v7),
        AvatarSceneManager = if not v16 then nil else v4.createElement(v6, {
            store = l_store_0,
            shouldStart = l_shouldStart_0,
            shouldManageBackground = l_shouldManageBackground_0,
            renderSky = l_shouldStart_0
        }),
        AvatarExperienceInitialization = if not v16 then nil else v4.createElement(v5),
        AvatarExperienceIXPDiagnostics = v4.createElement(v9)
    });
end));


local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local l_CorePackages_0 = game:GetService("CorePackages");
local v2 = require(l_CorePackages_0.Roact);
local v3 = require(l_CorePackages_0.RoactRodux);
local l_Focusable_0 = require(l_CorePackages_0.Packages.RoactGamepad).Focusable;
local v5 = require(l_CorePackages_0.UIBlox);
local v6 = require(l_CorePackages_0.Packages.t);
local l_withLocalization_0 = require(l_CorePackages_0.Workspace.Packages.Localization).withLocalization;
local v8 = require(l_CorePackages_0.AvatarExperienceDeps);
local v9 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.AvatarRoute);
local v10 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.AvatarScreen);
local v11 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.withAvatarRoute);
local v12 = require(l_Modules_0.AvatarExperience.Common.Components.withOverlayFocusHandling);
local v13 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.NavigationUtils);
local v14 = require(l_Modules_0.AvatarExperience.Common.Utils);
local l_RoactFitComponents_0 = v8.RoactFitComponents;
local l_FitFrameOnAxis_0 = l_RoactFitComponents_0.FitFrameOnAxis;
local l_FitTextLabel_0 = l_RoactFitComponents_0.FitTextLabel;
local l_Images_0 = v5.App.ImageSet.Images;
local l_BaseMenu_0 = v5.App.Menu.BaseMenu;
local l_ImageSetLabel_0 = v5.Core.ImageSet.ImageSetLabel;
local l_withStyle_0 = v5.Style.withStyle;
local l_RoactServices_0 = require(l_CorePackages_0.Workspace.Packages.RoactServices).RoactServices;
local v23 = require(l_Modules_0.LuaApp.Context.withTopBarSearchSignal);
local v24 = require(l_Modules_0.AvatarExperience.Common.Enum.FullView);
local v25 = require(l_Modules_0.AvatarExperience.Common.Services.Analytics);
local v26 = require(l_Modules_0.AvatarExperience.LayeredClothingSort.Actions.SetEntryPage);
local v27 = require(l_Modules_0.LuaApp.AppPage);
local v28 = require(l_Modules_0.LuaApp.Thunks.NavigateDown);
local v29 = game:DefineFastFlag("FixManageOutfitsEnabledForConsole", false);
local v30 = l_Images_0["component_assets/circle_17"];
local v31 = l_Images_0["icons/menu/customize"];
local v32 = l_Images_0["icons/menu/shop"];
local v33 = l_Images_0["icons/menu/profilepicture"];
local v34 = l_Images_0["icons/common/settings"];
local v35 = l_Images_0["icons/common/search"];
local v36 = l_Images_0["icons/actions/adjust"];
local v37 = l_Images_0["icons/common/goldrobux"];
local v38 = l_Images_0["icons/navigation/close"];
local v39 = v2.PureComponent:extend("AvatarExperienceQuickMenu");
v39.validateProps = v6.strictInterface({
    onOverlayClosed = v6.optional(v6.callback),
    defaultChildRef = v6.optional(v6.table),
    focusController = v6.optional(v6.table),
    ManageOutfitsEnabled = if not v29 then v6.boolean else nil,
    manageOutfitsEnabled = if not v29 then nil else v6.boolean,
    isAvatarEditorSceneFullView = v6.boolean,
    isCatalogSceneFullView = v6.boolean,
    isProfilePictureEditorEmotesSceneFullView = v6.boolean,
    purchaseRobux = v6.callback,
    setEntryPage = v6.callback,
    avatarExperienceAnalytics = v6.table,
    navigation = v6.table,
    avatarRoute = v9.Interface
});
v39.init = function(v40)
    v40.onActivatedShop = function()
        v13.navigateFromOverlay(v40.props.navigation, v10.Catalog);
    end;
    v40.onActivatedEditProfilePicture = function()
        v13.navigateFromOverlay(v40.props.navigation, v10.ProfilePictureEditorEmotes);
    end;
    v40.onActivatedManage = function()
        v13.navigateFromOverlay(v40.props.navigation, v10.ManageOutfitPage);
    end;
    v40.onActivatedCustomizeAvatar = function()
        v13.navigateFromOverlay(v40.props.navigation, v10.AvatarEditor);
    end;
    v40.onActivatedRefinement = function()
        v40.props.setEntryPage(v40.props.avatarRoute.opaque.name);
        v13.navigateFromOverlay(v40.props.navigation, v10.LayeredClothingSort);
    end;
    v40.onActivatedBuyRobux = function()
        v40.closePrompt();
        v40.props.purchaseRobux();
    end;
    v40.closePrompt = function()
        v13.closeOverlay(v40.props.navigation);
    end;
    local v41, v42 = v2.createBinding(UDim2.fromScale(0.35, 0.5));
    v40.sizeBinding = v41;
    v40.updateSizeBinding = v42;
    v40.onContentSizeChanged = function(v43)
        v40.updateSizeBinding(UDim2.new(0.35, 0, 0, v43.AbsoluteContentSize.Y));
    end;
end;
v39.gatherElements = function(v44, v45, v46)
    local v47 = {};
    local l_name_0 = v44.props.avatarRoute.opaque.name;
    if not (l_name_0 ~= v10.AvatarExperienceLandingPage and l_name_0 ~= v10.Catalog) or l_name_0 == v10.ProfilePictureEditorEmotes then
        table.insert(v47, {
            icon = v31,
            text = v45.customizeAvatar,
            onActivated = v44.onActivatedCustomizeAvatar
        });
    end;
    if not (l_name_0 ~= v10.AvatarExperienceLandingPage and l_name_0 ~= v10.AvatarEditor) or l_name_0 == v10.ProfilePictureEditorEmotes then
        table.insert(v47, {
            icon = v32,
            text = v45.shop,
            onActivated = v44.onActivatedShop
        });
    end;
    if not (l_name_0 ~= v10.AvatarExperienceLandingPage and l_name_0 ~= v10.AvatarEditor) or l_name_0 == v10.Catalog then
        table.insert(v47, {
            icon = v33,
            text = v45.editProfilePicture,
            onActivated = v44.onActivatedEditProfilePicture
        });
    end;
    if v44.props.manageOutfitsEnabled and l_name_0 == v10.AvatarEditor then
        table.insert(v47, {
            icon = v34,
            text = v45.manage,
            onActivated = v44.onActivatedManage
        });
    end;
    local v49 = (v44.props.isAvatarEditorSceneFullView or v44.props.isCatalogSceneFullView) or v44.props.isProfilePictureEditorEmotesSceneFullView;
    if not (not (l_name_0 == v10.Catalog) or v49) then
        table.insert(v47, {
            icon = v35,
            text = v45.search,
            onActivated = function()
                v44.closePrompt();
                v46:fire(l_name_0);
            end
        });
    end;
    table.insert(v47, {
        icon = v36,
        text = v45.avatarAdjustment,
        onActivated = v44.onActivatedRefinement
    });
    table.insert(v47, {
        icon = v37,
        text = v45.buyRobux,
        onActivated = v44.onActivatedBuyRobux
    });
    table.insert(v47, {
        icon = v38,
        text = v45.cancel,
        onActivated = v44.closePrompt
    });
    return v47;
end;
v39.renderWithProviders = function(v50, v51, v52, v53)
    local l_Font_0 = v52.Font;
    local l_Theme_0 = v52.Theme;
    local l_Font_1 = l_Font_0.Header1.Font;
    local v57 = l_Font_0.BaseSize * l_Font_0.Header1.RelativeSize;
    local v58 = v50:gatherElements(v51, v53);
    local l_name_1 = v50.props.avatarRoute.current.name;
    local _ = nil;
    return v2.createElement(l_Focusable_0[l_ImageSetLabel_0], {
        AnchorPoint = Vector2.new(0.5, 0.5),
        Size = v50.sizeBinding,
        Position = UDim2.fromScale(0.5, 0.5),
        BackgroundTransparency = 1,
        Image = v30,
        ImageColor3 = l_Theme_0.BackgroundUIDefault.Color,
        ImageTransparency = l_Theme_0.BackgroundUIDefault.Transparency,
        ScaleType = Enum.ScaleType.Slice,
        SliceCenter = Rect.new(8, 8, 9, 9),
        [v2.Ref] = v50.props.defaultChildRef
    }, {
        UIListLayout = v2.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder,
            Padding = UDim.new(0, 20),
            [v2.Change.AbsoluteContentSize] = v50.onContentSizeChanged
        }),
        UIPadding = v2.createElement("UIPadding", {
            PaddingTop = UDim.new(0, 20)
        }),
        TextContainer = v2.createElement(l_FitFrameOnAxis_0, {
            axis = l_FitFrameOnAxis_0.Axis.Both,
            margin = {
                top = 0,
                bottom = 0,
                left = 20,
                right = 0
            },
            BackgroundTransparency = 1,
            LayoutOrder = 1
        }, {
            TitleText = v2.createElement(l_FitTextLabel_0, {
                width = l_FitTextLabel_0.Width.FitToText,
                Text = if l_name_1 == v10.AvatarExperienceLandingPage then v51.avatarOptions else if l_name_1 == v10.AvatarEditor then v51.customizeOptions else v51.shopOptions,
                Font = l_Font_1,
                TextSize = v57,
                BackgroundTransparency = 1,
                TextColor3 = l_Theme_0.TextEmphasis.Color,
                TextTransparency = l_Theme_0.TextEmphasis.Transparency
            })
        }),
        BaseMenu = v2.createElement(l_BaseMenu_0, {
            buttonProps = v58,
            layoutOrder = 2,
            topElementRounded = false
        })
    });
end;
v39.render = function(v61)
    return l_withLocalization_0({
        avatarOptions = "Feature.Avatar.Label.QuickMenuLandingPageTitle",
        shopOptions = "Feature.Catalog.Label.QuickMenuMarketplaceTitle",
        customizeOptions = "Feature.Avatar.Label.QuickMenuCustomizeTitle",
        shop = "Feature.Avatar.Action.Marketplace",
        manage = "Feature.Avatar.Label.ManageItems",
        customizeAvatar = "Feature.Catalog.Label.CustomizeAvatar",
        editProfilePicture = "Feature.Avatar.Action.EditProfilePicture",
        search = "Feature.Catalog.Label.Search",
        buyRobux = "Feature.Catalog.Label.BuyRobux",
        cancel = "Feature.Catalog.Action.Cancel",
        avatarAdjustment = "Feature.Avatar.Label.AvatarAdjustment"
    })(function(v62)
        return l_withStyle_0(function(v63)
            return v23(function(v64)
                return v61:renderWithProviders(v62, v63, v64);
            end);
        end);
    end);
end;
return (v11((v12((l_RoactServices_0.connect({
    avatarExperienceAnalytics = v25
})((v3.connect(function(v65, _)
    return {
        manageOutfitsEnabled = v14.getAvatarEditorCategoryInfoFromState(v65).ManageOutfitsEnabled == true,
        isAvatarEditorSceneFullView = v65.AvatarExperience.Common.FullView[v10.AvatarEditor] == v24.SceneFullView,
        isCatalogSceneFullView = v65.AvatarExperience.Common.FullView[v10.Catalog] == v24.SceneFullView,
        isProfilePictureEditorEmotesSceneFullView = v65.AvatarExperience.Common.FullView[v10.ProfilePictureEditorEmotes] == v24.SceneFullView
    };
end, function(v67)
    return {
        purchaseRobux = function()
            v67(v28({
                name = v27.PurchaseRobux
            }));
        end,
        setEntryPage = function(v68)
            v67(v26(v68));
        end
    };
end)(v39))))))));


local l_Modules_0 = game:GetService("CoreGui").RobloxGui.Modules;
local l_CorePackages_0 = game:GetService("CorePackages");
local l_FaceAnimatorService_0 = game:GetService("FaceAnimatorService");
local v3 = require(l_CorePackages_0.Packages.React);
local l_useDispatch_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.RoactRodux.useDispatch;
local l_useSelector_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.RoactRodux.useSelector;
local l_usePrevious_0 = require(l_CorePackages_0.Workspace.Packages.RoactUtils).Hooks.usePrevious;
local v7 = require(l_Modules_0.AvatarExperience.Common.Hooks.useAvatarRoute);
local v8 = require(l_Modules_0.LuaApp.Hooks.useRoactService);
local v9 = require(l_Modules_0.AvatarExperience.Common.Utils);
local v10 = require(l_Modules_0.AvatarExperience.Common.Components.RoactNavigation.AvatarScreenProperties);
local v11 = require(l_Modules_0.AvatarExperience.Catalog.Actions.ResetSortAndFilters);
local v12 = require(l_Modules_0.AvatarExperience.Common.Thunks.StoreAndClearTryOns);
local v13 = require(l_Modules_0.AvatarExperience.Common.Actions.SetCameraButtonStatus);
local v14 = require(l_Modules_0.AvatarExperience.Common.Actions.SetCameraButtonErrorOccurred);
local _ = require(l_Modules_0.AvatarExperience.Common.Types);
local v16 = require(l_Modules_0.LuaApp.mutedError);
local v17 = require(l_Modules_0.LuaApp.Enum.ToastType);
local v18 = require(l_Modules_0.LuaApp.Actions.SetCurrentToastMessage);
local v19 = require(l_Modules_0.LuaApp.Services.RoactNetworking);
local l_getCameraOptIn_0 = require(l_CorePackages_0.Workspace.Packages.CameraOptIn).getCameraOptIn;
local v21 = require(l_Modules_0.AvatarExperience.Common.Util.IXPUtils);
local v22 = require(l_Modules_0.AvatarExperience.Flags.UniversalAppCameraIXPTest);
local v23 = require(l_Modules_0.AvatarExperience.Flags.FFlagUniversalAppCameraWindowsPermsFix);
local v24 = require(l_Modules_0.AvatarExperience.Common.Debug.LogTree).logger("ax.transition");
local v25 = {
    toastMessage = "Feature.FaceChat.Subtitle.FeatureDisabled",
    isLocalized = false,
    toastType = v17.InformationMessage
};
local v26 = nil;
return function(_)
    local v28 = l_useDispatch_0();
    local v29 = l_useSelector_0(v9.isAvatarExperienceRoute);
    local v30 = l_usePrevious_0(v29);
    local v31 = l_usePrevious_0((v7()));
    local v32 = v8(v19);
    local v33 = v21.useTestVariables(v22.EnabledForUser);
    local function _()
        v24:debug("Leaving AvatarExperience");
        local v34 = if not v31 then nil else v31.opaque.name;
        if (v34 and v10[v34]) and v10[v34].isMultiTryOn then
            v28(v12());
        end;
        v28(v11());
    end;
    local function _()
        v24:debug("Entering AvatarExperience");
    end;
    v3.useEffect(function()
        if not v30 or v29 then
            if not (not v29 or v30) then
                if not (not v33 or not v9.isUserCameraEligible()) then
                    l_getCameraOptIn_0(v32, true):andThen(function(v37)
                        if v26 ~= v37 then
                            l_FaceAnimatorService_0:Init(v37, false);
                            l_FaceAnimatorService_0.TrackerError:Connect(function(v38)
                                v28(v13(false));
                                if v23 then
                                    v28(v14(true));
                                end;
                                v28(v18(v25));
                                v16(string.format("Universal App Camera FaceAnimatorService TrackerError: %s", (tostring(v38))));
                            end);
                            v26 = v37;
                        end;
                    end);
                end;
                v24:debug("Entering AvatarExperience");
            end;
            return ;
        else
            v24:debug("Leaving AvatarExperience");
            local v39 = if not v31 then nil else v31.opaque.name;
            if (v39 and v10[v39]) and v10[v39].isMultiTryOn then
                v28(v12());
            end;
            v28(v11());
            return ;
        end;
    end, {
        v29,
        v30,
        v31
    });
    return nil;
end;