local _ = script.Parent.Parent.Parent;
local l_PathEditorHierarchyValidCheckFixes_0 = game:GetFastFlag("PathEditorHierarchyValidCheckFixes");
local v2 = game:DefineFastFlag("PathEditorPathEditorHierarchyFolderValid", false);
return function(v3)
    if v3 == nil then
        return false;
    else
        local l_Parent_1 = v3.Parent;
        local v5 = true;
        while true do
            if (not (l_Parent_1 ~= nil) or l_Parent_1:IsA("ScreenGui")) or l_Parent_1:IsA("SurfaceGui") then
                if l_Parent_1 == nil then
                    return false;
                else
                    if not l_Parent_1:IsA("ScreenGui") then
                        if not (not (not (not l_PathEditorHierarchyValidCheckFixes_0 or not l_Parent_1:IsA("SurfaceGui")) and l_Parent_1.Adornee == nil) or l_Parent_1.Parent:IsA("BasePart")) then
                            return false;
                        end;
                    else
                        while l_Parent_1 ~= nil do
                            if l_Parent_1 == game.Workspace then
                                return false;
                            else
                                l_Parent_1 = l_Parent_1.Parent;
                            end;
                        end;
                    end;
                    return true;
                end;
            else
                if not v2 or v5 then
                    if not l_Parent_1:IsA("GuiBase2d") then
                        return false;
                    end;
                elseif not (l_Parent_1:IsA("GuiBase2d") or l_Parent_1:IsA("Folder")) then
                    return false;
                end;
                v5 = false;
                l_Parent_1 = l_Parent_1.Parent;
            end;
        end;
    end;
end;


return function(v0, v1, v2)
    if game:GetFastFlag("Path2DControlPointAtomicClass4") then
        if v0 then
            if v2 then
                return Path2DControlPoint.new(v0, v1, v2);
            else
                return Path2DControlPoint.new(v0);
            end;
        else
            return Path2DControlPoint.new();
        end;
    else
        return {};
    end;
end;


rotatePoint = function(v0, v1, v2)
    if not (v0.Magnitude ~= 0) or v2 == 0 then
        return v0;
    else
        local v3 = math.rad(v2);
        local v4 = math.sin(v3);
        local v5 = math.cos(v3);
        local v6 = v0 - v1;
        return v1 + Vector2.new(v6.X * v5 - v6.Y * v4, v6.Y * v5 + v6.X * v4);
    end;
end;
return rotatePoint;


local v0 = require(script.Parent.getVector2FromUDim2Scale);
local v1 = require(script.Parent.getUDim2FromVector2);
local v2 = require(script.Parent.rotatePoint);
rotateUDim2Point = function(v3, v4, v5, v6)
    if v5 == 0 then
        return v3;
    else
        return v1(v2(v0(v3, v6), v4, v5), v6);
    end;
end;
return rotateUDim2Point;


local l_RunService_0 = game:GetService("RunService");
return function()
    if not require(script.Parent.DebugFlags).RunningUnderCLI() then
        if not l_RunService_0:IsRunning() then
            if game:GetEngineFeature("EnablePathEditor") then
                if game:GetFastFlag("Path2DControlPointAtomicClass4") then
                    return true;
                else
                    return false;
                end;
            else
                return false;
            end;
        else
            return false;
        end;
    else
        return false;
    end;
end;


local l_Parent_0 = script.Parent.Parent;
require(script.Parent.defineLuaFlags);
if not require(l_Parent_0.Src.Flags.getFFlagImprovePluginSpeedPivotEditor)() then
    require(script.Parent.main)(plugin);
    return ;
else
    return ;
end;


return function(v0, v1)
    require(script.Parent.defineLuaFlags);
    local l_Parent_0 = script.Parent.Parent;
    local v3 = require(l_Parent_0.Src.Flags.getFFlagImprovePluginSpeedPivotEditor);
    if not require(l_Parent_0.Src.Utility.DebugFlags).RunningUnderCLI() then
        local v4 = require(l_Parent_0.Packages.Roact);
        local v5 = require(l_Parent_0.Packages.Rodux);
        local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
        local v7 = require(l_Parent_0.Src.Reducers.MainReducer);
        local v8 = require(l_Parent_0.Src.RoduxComponents.EditPivotPlugin);
        local l_SourceStrings_0 = l_Parent_0.Src.Resources.Localization.SourceStrings;
        local l_LocalizedStrings_0 = l_Parent_0.Src.Resources.Localization.LocalizedStrings;
        local v11 = require(l_Parent_0.Src.Utility.ToastNotification);
        local v12 = {
            pluginName = "PivotEditor",
            stringResourceTable = l_SourceStrings_0,
            translationResourceTable = l_LocalizedStrings_0
        };
        (function()
            local v13 = v4.mount(l_ContextServices_0.provide({
                l_ContextServices_0.Plugin.new(v0),
                l_ContextServices_0.Mouse.new(v0:GetMouse()),
                l_ContextServices_0.Store.new(v5.Store.new(v7, nil, {
                    v5.thunkMiddleware
                })),
                l_ContextServices_0.Localization.new(v12),
                v11.new()
            }, {
                Plugin = if not v3() then v4.createElement(v8) else v4.createElement(v8, {
                    Plugin = v0,
                    pluginLoaderContext = v1
                })
            }));
            v0.Unloading:Connect(function()
                v4.unmount(v13);
            end);
        end)();
        return ;
    else
        return ;
    end;
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Src.Flags.getFFlagImprovePluginSpeedPivotEditor);
local v2 = require(l_Parent_0.Src.Utility.DebugFlags);
local v3 = nil;
if not v1() then
    v3 = require(l_Parent_0.Packages.Framework);
end;
if not (not v2.RunningUnderCLI() and not v2.RunTests()) then
    if v1() then
        v3 = require(l_Parent_0.Packages.Framework);
    end;
    local v4 = require(l_Parent_0.Packages.Dev.TestEZ);
    local l_TestBootstrap_0 = v4.TestBootstrap;
    local v6 = not not _G.TEAMCITY and v4.Reporters.TeamCityReporter or v4.Reporters.TextReporter;
    local l_Src_0 = l_Parent_0.Src;
    print("----- All " .. l_Parent_0.Name .. " Tests ------");
    require(script.Parent.defineLuaFlags);
    l_TestBootstrap_0:run({
        l_Src_0
    }, v6);
    print("----------------------------------");
    if v2.RunDeveloperFrameworkTests() then
        print("");
        print("----- All DeveloperFramework Tests ------");
        v3.TestHelpers.runFrameworkTests(v4, v6);
        print("----------------------------------");
    end;
end;
if v2.RunningUnderCLI() then
    pcall(function()
        game:GetService("ProcessService"):ExitAsync(0);
    end);
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Src.Utility.EditingMode);
local l_Action_0 = require(l_Parent_0.Packages.Framework).Util.Action;
local v3 = {
    [v1.SelectGeometry] = true,
    [v1.SelectSurface] = true,
    [v1.SelectPart] = true
};
return l_Action_0(script.Name, function(v4, v5)
    assert(v1.isEnumValue(v4));
    assert(v3[v4]);
    assert(type(v5) == "string");
    return {
        editingMode = v4,
        statusMessage = v5
    };
end);


local l_Parent_0 = script.Parent.Parent.Parent;
local l_Action_0 = require(l_Parent_0.Packages.Framework).Util.Action;
local v2 = require(l_Parent_0.Src.Utility.EditingMode);
return l_Action_0(script.Name, function(v3)
    assert(type(v3) == "string");
    return {
        statusMessage = v3,
        editingMode = v2.None
    };
end);


return require(script.Parent.Parent.Parent.Packages.Framework).Util.Action(script.Name, function(v0)
    assert(typeof(v0) == "Instance");
    return {
        targetObject = v0
    };
end);


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.DraggerFramework.Utility.Colors);
local v3 = v1.Component:extend("PivotRing");
v3.HitTestRadius = 15;
v3.render = function(v4)
    local l_props_0 = v4.props;
    local l_DraggerContext_0 = l_props_0.DraggerContext;
    local v7 = nil;
    local v8 = nil;
    if not l_props_0.Hovered then
        v7 = "rbxasset://Textures/PivotEditor/SelectedPivot.png";
        v8 = v2.WHITE;
    else
        v7 = "rbxasset://Textures/PivotEditor/HoveredPivot.png";
        v8 = l_DraggerContext_0:getSelectionBoxColor(l_props_0.IsActive);
    end;
    local v9, v10 = l_DraggerContext_0:worldToViewportPoint(l_props_0.Pivot.Position);
    if not v10 then
        return nil;
    else
        return v1.createElement(v1.Portal, {
            target = l_DraggerContext_0:getGuiParent()
        }, {
            PivotHoverHighlight = v1.createElement("ScreenGui", {}, {
                PivotHoverImage = v1.createElement("ImageLabel", {
                    Image = v7,
                    ImageColor3 = v8,
                    Size = UDim2.new(0, 32, 0, 32),
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    Position = UDim2.new(0, v9.X + 0.5, 0, v9.Y + 0.5),
                    BackgroundTransparency = 1
                })
            })
        });
    end;
end;
return v3;


local l_Parent_0 = script.Parent.Parent.Parent;
local l_Selection_0 = game:GetService("Selection");
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Src.Utility.StatusMessage);
local function _(v4)
    local l_v4_0 = v4;
    if l_v4_0 then
        l_v4_0 = v4:IsA("PVInstance");
        if l_v4_0 then
            l_v4_0 = false;
            if v4 ~= workspace then
                l_v4_0 = v4 ~= workspace.Terrain;
            end;
        end;
    end;
    return l_v4_0;
end;
local v7 = v2.PureComponent:extend("SelectionUpdater");
v7.init = function(v8)
    assert(v8.props.selectObjectForEditing, "selectObjectForEditing is required");
    assert(v8.props.selectInvalidSelection, "selectInvalidSelection is required");
end;
v7.didMount = function(v9)
    v9._connection = l_Selection_0.SelectionChanged:Connect(function()
        v9:_update();
    end);
    v9:_update();
end;
v7.willUnmount = function(v10)
    v10._connection:Disconnect();
end;
v7.render = function(_)
end;
v7._update = function(v12)
    local v13 = l_Selection_0:Get();
    if #v13 == 1 then
        local v14 = v13[1];
        if v12.props.targetObject ~= v14 then
            local l_v14_0 = v14;
            if l_v14_0 then
                l_v14_0 = v14:IsA("PVInstance");
                if l_v14_0 then
                    l_v14_0 = false;
                    if v14 ~= workspace then
                        l_v14_0 = v14 ~= workspace.Terrain;
                    end;
                end;
            end;
            if not l_v14_0 then
                v12.props.selectInvalidSelection(v3.InvalidTarget);
                return ;
            else
                v12.props.selectObjectForEditing(v14);
                return ;
            end;
        end;
    elseif #v13 > 1 then
        v12.props.selectInvalidSelection(v3.MultipleSelection);
        return ;
    else
        v12.props.selectInvalidSelection(v3.NoSelection);
    end;
end;
return v7;


local l_Workspace_0 = game:GetService("Workspace");
local v1 = require(script.Parent.Parent.Parent.Packages.Roact);
local v2 = Color3.new(1, 0, 1);
local v3 = Vector3.new(0.2, 0.2, 0.2);
return function(v4)
    local v5 = {};
    local v6 = Vector3.new(math.huge, math.huge, math.huge);
    local v7 = Vector3.new(-math.huge, -math.huge, -math.huge);
    for _, v9 in ipairs(v4.SnapPoints) do
        v6 = v6:Min(v9.Position);
        v7 = v7:Max(v9.Position);
    end;
    local l_Magnitude_0 = (v7 - v6).Magnitude;
    for v11, v12 in ipairs(v4.SnapPoints) do
        local l_Position_0 = v12.Position;
        local v14 = v4.DraggerContext:getHandleScale(l_Position_0);
        local l_Magnitude_1 = (l_Position_0 - v4.Focus).Magnitude;
        if l_Magnitude_0 >= l_Magnitude_1 and l_Magnitude_1 >= 0.001 then
            v14 = v14 * (1.8 - 1.6 * (l_Magnitude_1 / l_Magnitude_0) ^ 0.5);
            v5[v11 * 2 - 1] = v1.createElement("BoxHandleAdornment", {
                ZIndex = 0,
                Adornee = l_Workspace_0.Terrain,
                CFrame = v12,
                Color3 = v2,
                Size = v3 * v14
            });
            v5[v11 * 2] = v1.createElement("BoxHandleAdornment", {
                ZIndex = 0,
                Adornee = l_Workspace_0.Terrain,
                CFrame = v12,
                Color3 = v2,
                AlwaysOnTop = true,
                Transparency = 0.7,
                Size = v3 * v14
            });
        end;
    end;
    return v1.createElement("Folder", {}, v5);
end;


local v0 = {};
v0.__index = v0;
v0.new = function(_, v2)
    return (setmetatable({
        _handler = v2,
        _installed = false
    }, v0));
end;
v0.install = function(v3)
    v3:_connect();
    v3._installed = true;
end;
v0.uninstall = function(v4)
    v4:_disconnect();
    v4._installed = false;
end;
v0.setSelection = function(v5, v6)
    if v5._installed then
        v5:_disconnect();
        v5._instance = v6:getPrimaryObject();
        v5:_connect();
    end;
end;
v0._connect = function(v7)
    if v7._instance then
        if not v7._instance:IsA("Model") then
            if not v7._instance:IsA("BasePart") then
                v7:_setPart(nil);
                return ;
            else
                v7:_setPart(v7._instance);
                return ;
            end;
        else
            v7._primaryConnection = v7._instance:GetPropertyChangedSignal("PrimaryPart"):Connect(function()
                v7:_setPart(v7._instance.PrimaryPart);
            end);
            v7._pivotChangedConnection = v7._instance:GetPropertyChangedSignal("WorldPivot"):Connect(function()
                v7._handler();
            end);
            v7:_setPart(v7._instance.PrimaryPart);
            return ;
        end;
    else
        v7:_setPart(nil);
        return ;
    end;
end;
v0._disconnect = function(v8)
    if v8._primaryConnection then
        v8._primaryConnection:Disconnect();
        v8._primaryConnection = nil;
    end;
    if v8._pivotChangedConnection then
        v8._pivotChangedConnection:Disconnect();
        v8._pivotChangedConnection = nil;
    end;
    v8:_setPart(nil);
end;
v0._setPart = function(v9, v10)
    if v9._movedConnection then
        v9._movedConnection:Disconnect();
        v9._movedConnection = nil;
    end;
    if v9._partPivotChangedConnection then
        v9._partPivotChangedConnection:Disconnect();
        v9._partPivotChangedConnection = nil;
    end;
    if v10 then
        local function v11()
            v9._handler();
        end;
        v9._partPivotChangedConnection = v10:GetPropertyChangedSignal("PivotOffset"):Connect(v11);
        v9._movedConnection = (v10 or v10:GetRootPart()):GetPropertyChangedSignal("CFrame"):Connect(v11);
    end;
end;
return v0;


local l_StudioService_0 = game:GetService("StudioService");
local v1 = require(script.Parent.Parent.Parent.Packages.DraggerFramework.Implementation.DraggerContext_PluginImpl);
return {
    new = function(...)
        local v2 = v1.new(...);
        v2.shouldSnapPivotToGeometry = function(_)
            return l_StudioService_0.PivotSnapToGeometry;
        end;
        return v2;
    end
};


local v0 = require(script.Parent.Parent.Parent.Packages.DraggerSchemaCore.DraggerSchema);
return {
    SelectionInfo = require(script.Parent.SelectionInfo),
    BoundsChangedTracker = require(script.Parent.BoundsChangedTracker),
    dispatchWorldClick = require(script.Parent.dispatchWorldClick),
    MoveHandlesImplementation = require(script.Parent.MoveHandlesImplementation),
    RotateHandlesImplementation = require(script.Parent.RotateHandlesImplementation),
    FreeformDragger = require(script.Parent.FreeformDragger),
    isExclusiveSelectable = v0.isExclusiveSelectable,
    getMouseTarget = v0.getMouseTarget,
    getNextSelectables = v0.getNextSelectables,
    getSelectableWithCache = v0.getSelectableWithCache,
    Selection = v0.Selection,
    getSelectionBoxComponent = v0.getSelectionBoxComponent,
    HoverEscapeDetector = v0.HoverEscapeDetector,
    setHover = v0.setHover,
    setActivePoint = v0.setActivePoint,
    beginBoxSelect = v0.beginBoxSelect,
    endBoxSelect = v0.endBoxSelect,
    addUndoWaypoint = v0.addUndoWaypoint
};


local l_Workspace_0 = game:GetService("Workspace");
local l_Parent_0 = script.Parent.Parent.Parent;
local l_Packages_0 = l_Parent_0.Packages;
local l_DraggerFramework_0 = l_Packages_0.DraggerFramework;
local v4 = require(l_Packages_0.Roact);
local v5 = require(l_DraggerFramework_0.Utility.DragHelper);
local v6 = require(l_DraggerFramework_0.Utility.Colors);
local v7 = require(l_DraggerFramework_0.Components.MoveHandleView);
local v8 = require(l_DraggerFramework_0.Components.TargetGridView);
local v9 = require(l_DraggerFramework_0.Components.TargetSoftSnapView);
local v10 = require(l_Parent_0.Src.Utility.setWorldPivot);
local v11 = require(l_Parent_0.Src.Utility.computeSnapPointsForInstance);
local v12 = require(l_Parent_0.Src.Components.SnapPoints);
local v13 = require(l_DraggerFramework_0.Components.DraggedPivot);
local v14 = require(l_Parent_0.Src.Utility.classifyInstancePivot);
local v15 = require(l_DraggerFramework_0.Flags.getFFlagDraggerImprovements);
local v16 = require(l_DraggerFramework_0.Flags.getFFlagDraggerSnapToPartsLua);
local v17 = Vector3.new();
local v18 = {
    MinusZ = {
        Offset = CFrame.fromMatrix(v17, Vector3.new(1, 0, 0), (Vector3.new(0, 1, 0))),
        Color = v6.Z_AXIS
    },
    PlusZ = {
        Offset = CFrame.fromMatrix(v17, Vector3.new(1, 0, 0), (Vector3.new(0, -1, 0))),
        Color = v6.Z_AXIS
    },
    MinusY = {
        Offset = CFrame.fromMatrix(v17, Vector3.new(0, 0, 1), (Vector3.new(1, 0, 0))),
        Color = v6.Y_AXIS
    },
    PlusY = {
        Offset = CFrame.fromMatrix(v17, Vector3.new(0, 0, 1), (Vector3.new(-1, 0, 0))),
        Color = v6.Y_AXIS
    },
    MinusX = {
        Offset = CFrame.fromMatrix(v17, Vector3.new(0, 1, 0), (Vector3.new(0, 0, 1))),
        Color = v6.X_AXIS
    },
    PlusX = {
        Offset = CFrame.fromMatrix(v17, Vector3.new(0, 1, 0), (Vector3.new(0, 0, -1))),
        Color = v6.X_AXIS
    }
};
local v19 = {};
v19.__index = v19;
v19.new = function(v20, v21, v22)
    local v23 = setmetatable({
        _draggerContext = v20,
        _draggerToolModel = v21,
        _dragInfo = v22,
        _snapPoints = {},
        _originalPivot = v22.ClickedSelectable:GetPivot(),
        _tiltRotate = CFrame.new()
    }, v19);
    v23._snapPoints = v11(v22.ClickedSelectable);
    v23._pivotOwner = v22.ClickedSelectable;
    v23._originalPivotSnapPoints = v23._snapPoints;
    v23:update();
    return v23;
end;
v19._selectedIsActive = function(v24)
    if not v24._draggerContext:shouldShowActiveInstanceHighlight() then
        return false;
    else
        return v24._pivotOwner == v24._draggerToolModel:getSelectionWrapper():getActiveSelectable();
    end;
end;
v19.render = function(v25)
    if v25._lastDragTarget == nil then
        return ;
    else
        local v26 = {};
        for v27, v28 in pairs(v18) do
            local v29 = v25._lastDragTarget.mainCFrame * v28.Offset;
            v26[v27] = v4.createElement(v7, {
                Axis = v29,
                Color = v28.Color,
                Outset = 0.5,
                Scale = v25._draggerContext:getHandleScale(v29.Position),
                AlwaysOnTop = true,
                Thin = true
            });
        end;
        v26.DraggedPivot = v4.createElement(v13, {
            DraggerContext = v25._draggerContext,
            CFrame = v25._lastDragTarget.mainCFrame,
            IsActive = v25:_selectedIsActive()
        });
        if not (not v25._draggerContext:shouldSnapPivotToGeometry() or not v25._snapPoints) then
            v26.SnapPoints = v4.createElement(v12, {
                Focus = v25._lastDragTarget.mainCFrame.Position,
                SnapPoints = v25._snapPoints,
                DraggerContext = v25._draggerContext
            });
        end;
        if not (not v15() or v25._draggerContext:shouldSnapPivotToGeometry()) then
            local v30 = v25._draggerContext:getHandleScale(v25._lastDragTarget.targetMatrix.Position);
            if not v16() then
                v26.TargetGrid = v4.createElement(v8, {
                    DragTarget = v25._lastDragTarget,
                    SourceSize = Vector3.one * 4,
                    Scale = v30,
                    GridSize = if not v25._draggerContext:getGridSnapEnabled() then nil else v25._draggerContext:getGridSize(),
                    MajorStep = v25._draggerContext:getMajorGridIncrement(),
                    Color = v25._draggerContext:getGridColor(),
                    PrimaryColor = v25._draggerContext:getChosenColor()
                });
                v26.TargetSoftSnapView = v4.createElement(v9, {
                    DragTarget = v25._lastDragTarget,
                    DraggerContext = v25._draggerContext
                });
            elseif #v25._lastDragTarget.softSnaps == 0 then
                v26.TargetGrid = v4.createElement(v8, {
                    DragTarget = v25._lastDragTarget,
                    SourceSize = Vector3.one * 4,
                    Scale = v30,
                    GridSize = if not v25._draggerContext:getGridSnapEnabled() then nil else v25._draggerContext:getGridSize(),
                    MajorStep = v25._draggerContext:getMajorGridIncrement(),
                    Color = v25._draggerContext:getGridColor(),
                    PrimaryColor = v25._draggerContext:getChosenColor()
                });
            else
                v26.TargetSoftSnapView = v4.createElement(v9, {
                    DragTarget = v25._lastDragTarget,
                    DraggerContext = v25._draggerContext
                });
            end;
        end;
        return v4.createFragment(v26);
    end;
end;
v19.rotate = function(v31, v32)
    local l__originalPivot_0 = v31._originalPivot;
    local v34 = nil;
    if v31._lastDragTarget then
        v34 = v31._lastDragTarget.targetMatrix;
    end;
    v31._tiltRotate = v5.updateTiltRotate(v31._draggerToolModel._draggerContext:getCameraCFrame(), v31._draggerToolModel._draggerContext:getMouseRay(), {}, l__originalPivot_0, v34, v31._tiltRotate, v32, true);
end;
v19._updateNoSnap = function(v35)
    local v36 = nil;
    if v35._lastDragTarget then
        v36 = v35._lastDragTarget.targetMatrix;
    end;
    if not v15() then
        local v38 = v5.getDragTarget(v35._draggerToolModel._draggerContext:getMouseRay(), function(v37)
            return v35._draggerContext:snapToGridSize(v37);
        end, v17, {}, v35._originalPivot, v17, v17, v17, v35._tiltRotate, v36, true);
        if v38 then
            v35._lastDragTarget = v38;
            v10(v35._dragInfo.ClickedSelectable, v38.mainCFrame);
        end;
    else
        local v39 = v5.getDragTarget({}, v35._originalPivot, v17, v17, v17, v35._draggerToolModel._draggerContext:getMouseRay(), if not v35._draggerContext:shouldGridSnap() then nil else v35._draggerContext:getGridSize(), v35._tiltRotate, v36, true, false, v35._draggerContext:getSoftSnapMarginFactor(), if not v16() then nil else v35._draggerContext:shouldPartSnap());
        if v39 then
            v35._lastDragTarget = v39;
            v10(v35._dragInfo.ClickedSelectable, v39.mainCFrame);
            return ;
        end;
    end;
end;
v19._recomputeSnapPoints = function(v40)
    local v41 = v40._draggerContext:getMouseRay();
    local v42 = v40._draggerToolModel:getSchema();
    local v43 = v40._draggerToolModel:getSelectionWrapper():get();
    if not v15() then
        local v44 = v42.getMouseTarget(v40._draggerContext, v41, v43, true);
        if v44 then
            if v44 == v40._pivotOwner then
                v40._snapPoints = v40._originalPivotSnapPoints;
                return ;
            elseif v44 ~= l_Workspace_0.Terrain then
                v40._snapPoints = v11(v44);
            end;
        end;
    else
        local v45, v46, _, _ = v42.getMouseTarget(v40._draggerContext, v41, v43, true, false);
        if v45 then
            if not (v45 ~= v40._pivotOwner) or v46 == v40._pivotOwner then
                v40._snapPoints = v40._originalPivotSnapPoints;
                return ;
            elseif v45 ~= l_Workspace_0.Terrain then
                v40._snapPoints = v11(v45);
                return ;
            end;
        end;
    end;
end;
v19._snapToSnapPoints = function(v49)
    if v49._snapPoints then
        local v50 = v49._draggerContext:getMouseLocation();
        local v51 = nil;
        local l_huge_0 = math.huge;
        for _, v54 in ipairs(v49._snapPoints) do
            local v55, v56 = v49._draggerContext:worldToViewportPoint(v54.Position);
            if v56 then
                local l_Magnitude_0 = (Vector2.new(v55.X, v55.Y) - v50).Magnitude;
                if l_Magnitude_0 < l_huge_0 then
                    l_huge_0 = l_Magnitude_0;
                    v51 = v54;
                end;
            end;
        end;
        local v58 = v51 or v49._originalPivot;
        v49._lastDragTarget = {
            mainCFrame = v58
        };
        v10(v49._dragInfo.ClickedSelectable, v58);
        return ;
    else
        return ;
    end;
end;
v19._updateSnap = function(v59)
    v59:_recomputeSnapPoints();
    v59:_snapToSnapPoints();
end;
v19.update = function(v60)
    if not v60._draggerContext:shouldSnapPivotToGeometry() then
        v60:_updateNoSnap();
        return ;
    else
        v60:_updateSnap();
        return ;
    end;
end;
v19.destroy = function(v61)
    v61._draggerContext:getAnalytics():sendEvent("setPivot", {
        gridSize = v61._draggerContext:getGridSize(),
        rotateIncrement = v61._draggerContext:getRotateIncrement(),
        handleId = v61._dragInfo.HandleId,
        pivotType = v14(v61._dragInfo.ClickedSelectable)
    });
end;
return v19;


local l_Parent_0 = script.Parent.Parent.Parent;
local l_DraggerFramework_0 = l_Parent_0.Packages.DraggerFramework;
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.DraggerSchemaCore.getSelectableWithCache);
local v4 = require(l_Parent_0.Src.Utility.setWorldPivot);
local v5 = require(l_Parent_0.Src.Utility.computeSnapPointsForInstance);
local v6 = require(l_Parent_0.Src.Components.SnapPoints);
local v7 = require(l_DraggerFramework_0.Components.DraggedPivot);
local v8 = require(l_Parent_0.Src.Utility.classifyInstancePivot);
local v9 = require(l_DraggerFramework_0.Utility.getSoftSnaps);
local v10 = require(l_DraggerFramework_0.Flags.getFFlagDraggerImprovements);
local v11 = {};
v11.__index = v11;
v11.new = function(v12, v13)
    return (setmetatable({
        _draggerContext = v12,
        _analyticsName = v13
    }, v11));
end;
v11.getSoftSnaps = function(v14, v15, v16)
    if not v14._draggerContext:shouldSnapPivotToGeometry() then
        local v17 = v14._initialPivot * (v16 or CFrame.identity);
        local v18 = Vector3.one * 0.01;
        local v19 = v14._draggerContext:getMaxSoftSnaps();
        local v20 = {
            -1,
            1
        };
        return v9(v17, v18, v15, {}, v20, v20, v19);
    else
        return {};
    end;
end;
v11._selectedIsActive = function(v21)
    if not v21._draggerContext:shouldShowActiveInstanceHighlight() then
        return false;
    else
        return v21._selection[#v21._selection] == v21._primaryObject;
    end;
end;
v11._setCurrentSnap = function(v22, v23)
    v22._snapPoints = v5(v23);
    v22._snapPointsAreFor = v23;
end;
v11.beginDrag = function(v24, v25, v26)
    v24._selection = v25;
    v24._initialPivot = v26:getBoundingBox();
    v24._primaryObject = v26:getPrimaryObject();
    v24:_setCurrentSnap(v24._primaryObject);
end;
local function v31(v27)
    for _, v29 in ipairs(v27) do
        local v30 = v3(v29, false, {});
        if v30 then
            return v30;
        end;
    end;
    return nil;
end;
v11._findNewSnapTargetImpl = function(v32, v33)
    local l_v33_TouchingParts_0 = v33:GetTouchingParts();
    if not v10() then
        for _, v36 in ipairs(l_v33_TouchingParts_0) do
            if v36:IsDescendantOf(v32._snapPointsAreFor) then
                return ;
            end;
        end;
    else
        for _, v38 in l_v33_TouchingParts_0, nil, nil do
            if not (v38 ~= v32._snapPointsAreFor and not v38:IsDescendantOf(v32._snapPointsAreFor)) then
                return ;
            end;
        end;
    end;
    if v10() then
        for _, v40 in l_v33_TouchingParts_0, nil, nil do
            if not (v40 ~= v32._primaryObject and not v40:IsDescendantOf(v32._primaryObject)) then
                v32:_setCurrentSnap(v32._primaryObject);
                return ;
            end;
        end;
    end;
    local v41 = v31(l_v33_TouchingParts_0);
    if v41 then
        v32:_setCurrentSnap(v41);
    end;
end;
v11._findNewSnapTargetViaCollision = function(v42, v43)
    local l_Part_0 = Instance.new("Part");
    l_Part_0.Size = Vector3.new(0.01, 0.01, 0.01);
    l_Part_0.Position = v43.Position;
    l_Part_0.Archivable = false;
    l_Part_0.Parent = workspace.Terrain;
    v42:_findNewSnapTargetImpl(l_Part_0);
    l_Part_0:Destroy();
end;
v11.updateDrag = function(v45, v46)
    if v45._primaryObject then
        local v47 = v46 * v45._initialPivot;
        v4(v45._primaryObject, v47);
        v45:_findNewSnapTargetViaCollision(v47);
    end;
    return v46;
end;
v11.endDrag = function(v48)
    if v48._primaryObject then
        v48._draggerContext:getAnalytics():sendEvent("setPivot", {
            gridSize = v48._draggerContext:getGridSize(),
            rotateIncrement = v48._draggerContext:getRotateIncrement(),
            toolName = v48._analyticsName,
            handleId = "Move",
            pivotType = v8(v48._primaryObject)
        });
    end;
end;
v11.getSnapPoints = function(v49)
    if not v49._draggerContext:shouldSnapPivotToGeometry() then
        return nil;
    else
        return v49._snapPoints;
    end;
end;
v11.render = function(v50, v51)
    local v52 = v51 * v50._initialPivot;
    local v53 = {
        DraggedPivot = v2.createElement(v7, {
            DraggerContext = v50._draggerContext,
            CFrame = v52,
            IsActive = v50:_selectedIsActive()
        })
    };
    if v50._draggerContext:shouldSnapPivotToGeometry() then
        v53.SnapPoints = v2.createElement(v6, {
            Focus = v52.Position,
            SnapPoints = v50._snapPoints,
            DraggerContext = v50._draggerContext
        });
    end;
    return v2.createFragment(v53);
end;
return v11;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(script.Parent.FreeformDragger);
local v3 = require(l_Parent_0.Src.Components.PivotRing);
local v4 = {};
v4.__index = v4;
v4.new = function(v5)
    return (setmetatable({
        _dragging = false,
        _draggerContext = v5
    }, v4));
end;
v4.update = function(v6, v7, v8)
    if not v6._dragging then
        v6._originalPivot = v8:getBoundingBox();
        v6._pivotOwner = v8:getPrimaryObject();
        v6._draggerToolModel = v7;
        v6._schema = v7:getSchema();
    end;
end;
v4.shouldBiasTowardsObjects = function(_)
    return false;
end;
v4.hitTest = function(v10, _, _)
    local v13, v14 = v10._draggerContext:worldToViewportPoint(v10._originalPivot.Position);
    if v14 and (Vector2.new(v13.X, v13.Y) - v10._draggerContext:getMouseLocation()).Magnitude < v3.HitTestRadius then
        return "Pivot", 0, true;
    else
        return nil;
    end;
end;
v4._selectedIsActive = function(v15)
    if not v15._draggerContext:shouldShowActiveInstanceHighlight() then
        return false;
    else
        return v15._pivotOwner == v15._draggerToolModel:getSelectionWrapper():getActiveSelectable();
    end;
end;
v4._renderPivotAdorn = function(v16, v17)
    if v16._pivotOwner then
        return v1.createElement(v3, {
            DraggerContext = v16._draggerContext,
            Hovered = v17,
            Pivot = v16._originalPivot,
            IsActive = v16:_selectedIsActive()
        });
    else
        return ;
    end;
end;
v4.render = function(v18, v19)
    local v20 = {};
    if not v18._freeformDrag then
        if not v19 then
            v20.PivotAdorn = v18:_renderPivotAdorn(false);
        else
            v20.PivotAdorn = v18:_renderPivotAdorn(true);
        end;
    else
        v20.DragUI = v18._freeformDrag:render();
    end;
    return v1.createFragment(v20);
end;
v4.mouseDown = function(v21, _, _)
    if v21._pivotOwner then
        v21._freeformDrag = v2.new(v21._draggerContext, v21._draggerToolModel, {
            ClickedSelectable = v21._pivotOwner,
            HandleId = "Pivot"
        });
        v21._freeformDrag:update();
    end;
end;
local function _(v24)
    local v25 = true;
    if v24 ~= Enum.KeyCode.LeftAlt then
        v25 = v24 == Enum.KeyCode.RightAlt;
    end;
    return v25;
end;
v4.keyDown = function(v27, v28)
    if v27._freeformDrag then
        if v28 == Enum.KeyCode.R then
            v27._freeformDrag:rotate((Vector3.new(0, 1, 0)));
            return true;
        elseif v28 == Enum.KeyCode.T then
            v27._freeformDrag:rotate((Vector3.new(1, 0, 0)));
            return true;
        else
            local v29 = true;
            if v28 ~= Enum.KeyCode.LeftAlt then
                v29 = v28 == Enum.KeyCode.RightAlt;
            end;
            if v29 then
                v27._freeformDrag:update();
                return true;
            end;
        end;
    end;
    return false;
end;
v4.keyUp = function(v30, _)
    if not v30._freeformDrag then
        return false;
    else
        v30._freeformDrag:update();
        return true;
    end;
end;
v4.mouseDrag = function(v32, _)
    if v32._freeformDrag then
        v32._freeformDrag:update();
    end;
end;
v4.mouseUp = function(v34, _)
    if v34._freeformDrag then
        v34._freeformDrag:destroy();
        v34._freeformDrag = nil;
        v34._schema.addUndoWaypoint(v34._draggerContext, "Modify Pivot");
    end;
end;
return v4;


local l_Parent_0 = script.Parent.Parent.Parent;
local l_DraggerFramework_0 = l_Parent_0.Packages.DraggerFramework;
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.DraggerFramework.Utility.Colors);
local v4 = require(l_Parent_0.Packages.DraggerFramework.Components.MoveHandleView);
local v5 = require(l_Parent_0.Src.Utility.setWorldPivot);
local v6 = require(l_Parent_0.Src.Utility.computeSnapPointsForInstance);
local v7 = require(l_Parent_0.Src.Components.SnapPoints);
local v8 = require(l_DraggerFramework_0.Components.DraggedPivot);
local v9 = require(l_Parent_0.Src.Utility.classifyInstancePivot);
local v10 = table.freeze({
    MinusZ = {
        Offset = CFrame.fromMatrix(Vector3.new(), Vector3.new(1, 0, 0), (Vector3.new(0, 1, 0))),
        Color = v3.Z_AXIS
    },
    PlusZ = {
        Offset = CFrame.fromMatrix(Vector3.new(), Vector3.new(1, 0, 0), (Vector3.new(0, -1, 0))),
        Color = v3.Z_AXIS
    },
    MinusY = {
        Offset = CFrame.fromMatrix(Vector3.new(), Vector3.new(0, 0, 1), (Vector3.new(1, 0, 0))),
        Color = v3.Y_AXIS
    },
    PlusY = {
        Offset = CFrame.fromMatrix(Vector3.new(), Vector3.new(0, 0, 1), (Vector3.new(-1, 0, 0))),
        Color = v3.Y_AXIS
    },
    MinusX = {
        Offset = CFrame.fromMatrix(Vector3.new(), Vector3.new(0, 1, 0), (Vector3.new(0, 0, 1))),
        Color = v3.X_AXIS
    },
    PlusX = {
        Offset = CFrame.fromMatrix(Vector3.new(), Vector3.new(0, 1, 0), (Vector3.new(0, 0, -1))),
        Color = v3.X_AXIS
    }
});
local v11 = {};
v11.__index = v11;
v11.new = function(v12, v13)
    return (setmetatable({
        _draggerContext = v12,
        _analyticsName = v13
    }, v11));
end;
local function _(v14, v15)
    if v15 == 0 then
        return 0;
    else
        return v14 / v15;
    end;
end;
local function _(v17, v18)
    local l_X_0 = v17.X;
    local l_X_1 = v18.X;
    local v21 = l_X_1 == 0 and 0 or l_X_0 / l_X_1;
    l_X_1 = v17.Y;
    local l_Y_0 = v18.Y;
    l_X_0 = l_Y_0 == 0 and 0 or l_X_1 / l_Y_0;
    l_Y_0 = v17.Z;
    local l_Z_0 = v18.Z;
    return (Vector3.new(v21, l_X_0, l_Z_0 == 0 and 0 or l_Y_0 / l_Z_0));
end;
v11._getRelativeLocationInBoundingBox = function(v25)
    local v26 = nil;
    local v27 = nil;
    if not v25._primaryObject:IsA("BasePart") then
        if not v25._primaryObject:IsA("Model") then
            error("Bad primary object type `" .. v25._primaryObject.ClassName .. "`");
        else
            local l_BoundingBox_0, v29 = v25._primaryObject:GetBoundingBox();
            v26 = l_BoundingBox_0;
            v27 = v29;
        end;
    else
        v26 = v25._primaryObject.CFrame;
        v27 = v25._primaryObject.Size;
    end;
    local v30 = v26:ToObjectSpace(v25._initialPivot);
    local l_Position_0 = v30.Position;
    local v32 = v30 - l_Position_0;
    local l_v27_0 = v27;
    local l_X_2 = l_Position_0.X;
    local l_X_3 = l_v27_0.X;
    local v36 = l_X_3 == 0 and 0 or l_X_2 / l_X_3;
    l_X_3 = l_Position_0.Y;
    local l_Y_1 = l_v27_0.Y;
    l_X_2 = l_Y_1 == 0 and 0 or l_X_3 / l_Y_1;
    l_Y_1 = l_Position_0.Z;
    local l_Z_1 = l_v27_0.Z;
    return Vector3.new(v36, l_X_2, l_Z_1 == 0 and 0 or l_Y_1 / l_Z_1), v32;
end;
v11._selectedIsActive = function(v39)
    if not v39._draggerContext:shouldShowActiveInstanceHighlight() then
        return false;
    else
        return v39._selection[#v39._selection] == v39._primaryObject;
    end;
end;
v11.beginDrag = function(v40, v41, v42)
    v40._selection = v41;
    v40._initialPivot = v42:getBoundingBox();
    v40._lastPivot = v40._initialPivot;
    v40._primaryObject = v42:getPrimaryObject();
    v40._snapPoints = v6(v40._primaryObject);
    local v43, v44 = v40:_getRelativeLocationInBoundingBox();
    v40._initialRelativePosition = v43;
    v40._initialRelativeRotation = v44;
end;
v11.updateDrag = function(v45, v46)
    if v45._primaryObject then
        local v47 = (v46 * v45._initialPivot):Orthonormalize();
        v5(v45._primaryObject, v47);
        v45._lastPivot = v47;
        v45._snapPoints = v6(v45._primaryObject);
        return v46;
    else
        return v46;
    end;
end;
v11.endDrag = function(v48)
    if v48._primaryObject then
        v48._draggerContext:getAnalytics():sendEvent("setPivot", {
            gridSize = v48._draggerContext:getGridSize(),
            rotateIncrement = v48._draggerContext:getRotateIncrement(),
            toolName = v48._analyticsName,
            handleId = "Rotate",
            pivotType = v9(v48._primaryObject)
        });
    end;
end;
v11.getSnapPoints = function(v49)
    if not v49._draggerContext:shouldSnapPivotToGeometry() then
        return nil;
    else
        return v49._snapPoints;
    end;
end;
v11.render = function(v50, _)
    local v52 = {};
    local l__lastPivot_0 = v50._lastPivot;
    local v54 = v50._draggerContext:getHandleScale(l__lastPivot_0.Position);
    for v55, v56 in pairs(v10) do
        v52[v55] = v2.createElement(v4, {
            Axis = l__lastPivot_0 * v56.Offset,
            Color = v56.Color,
            Outset = 0.5,
            Thin = true,
            Scale = v54,
            AlwaysOnTop = true
        });
    end;
    if v50._draggerContext:shouldSnapPivotToGeometry() then
        v52.SnapPoints = v2.createElement(v7, {
            Focus = l__lastPivot_0.Position,
            SnapPoints = v50._snapPoints,
            DraggerContext = v50._draggerContext
        });
        v52.DraggedPivot = v2.createElement(v8, {
            DraggerContext = v50._draggerContext,
            CFrame = v50._lastPivot,
            IsActive = v50:_selectedIsActive()
        });
    end;
    return v2.createFragment(v52);
end;
return v11;


local _ = script.Parent.Parent.Parent;
local function v4(_, v2)
    local v3 = v2[1];
    if not v3 or not v3:IsA("PVInstance") then
        return {
            _primaryObject = nil,
            _isEmpty = true,
            _basisCFrame = CFrame.new()
        };
    else
        return {
            _primaryObject = v3,
            _isEmpty = false,
            _basisCFrame = v3:GetPivot()
        };
    end;
end;
local v5 = {};
v5.__index = v5;
v5.new = function(v6, v7)
    return (setmetatable(v4(v6, v7), v5));
end;
v5.isEmpty = function(v8)
    return v8._isEmpty;
end;
v5.getBoundingBox = function(v9)
    return v9._basisCFrame, Vector3.new(), (Vector3.new());
end;
v5.doesContainItem = function(v10, v11)
    local l__primaryObject_0 = v10._primaryObject;
    local v13 = not v10._isEmpty;
    if v13 then
        v13 = true;
        if v11 ~= l__primaryObject_0 then
            v13 = v11:IsDescendantOf(v10._primaryObject);
        end;
    end;
    return v13;
end;
v5.getPrimaryObject = function(v14)
    return v14._primaryObject;
end;
v5.isDynamic = function(_)
    return false;
end;
return v5;


local _ = function(_, _, v2)
    return {
        ClickedSelectable = v2.ClickedSelectable,
        HandleId = "Part"
    };
end;
return function(_, v5, v6)
    if (not v5:doesAllowFreeformDrag() or not v6.SelectionNowContainsSelectable) or not v6.ClickedSelectable:IsA("PVInstance") then
        return "Ready";
    else
        return "FreeformSelectionDrag", {
            ClickedSelectable = v6.ClickedSelectable,
            HandleId = "Part"
        };
    end;
end;


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


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Dash);
local v2 = require(l_Parent_0.Packages.Rodux);
local v3 = require(l_Parent_0.Src.Utility.EditingMode);
local v4 = require(l_Parent_0.Src.Utility.StatusMessage);
local v5 = require(l_Parent_0.Src.Actions.BeginSelectingPivot);
local v6 = require(l_Parent_0.Src.Actions.DoneSelectingPivot);
local v7 = require(l_Parent_0.Src.Actions.SelectObjectForEditing);
local v8 = require(l_Parent_0.Src.Actions.SelectInvalidSelection);
local l_join_0 = v1.join;
return v2.createReducer({
    targetObject = nil,
    editingMode = v3.None,
    statusMessage = v4.None
}, {
    [v5.name] = function(v10, v11)
        return l_join_0(v10, {
            editingMode = v11.editingMode,
            statusMessage = v11.statusMessage
        });
    end,
    [v6.name] = function(v12, _)
        return l_join_0(v12, {
            editingMode = v3.Transform,
            statusMessage = v4.None
        });
    end,
    [v7.name] = function(v14, v15)
        return l_join_0(v14, {
            targetObject = v15.targetObject,
            editingMode = v3.Transform,
            statusMessage = v4.None
        });
    end,
    [v8.name] = function(v16, v17)
        return l_join_0(v16, {
            targetObject = v1.None,
            editingMode = v3.None,
            statusMessage = v17.statusMessage
        });
    end
});


local l_Selection_0 = game:GetService("Selection");
local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v3 = require(l_Parent_0.Packages.Framework);
local v4 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_UI_0 = v3.UI;
local l_PluginButton_0 = l_UI_0.PluginButton;
local l_PluginToolbar_0 = l_UI_0.PluginToolbar;
local v10 = require(l_Parent_0.Packages.DraggerFramework.Utility.Analytics);
local v11 = require(l_Parent_0.Src.RoduxComponents.EditPivotSession);
local v12 = require(l_Parent_0.Src.Utility.setWorldPivot);
local v13 = require(l_Parent_0.Src.Utility.getDefaultModelPivot);
local v14 = v4.PureComponent:extend("EditPivotPlugin");
local v15 = require(l_Parent_0.Src.Flags.getFFlagImprovePluginSpeedPivotEditor);
v14.init = function(v16)
    v16:setState({
        active = false
    });
    v16.toggleActive = function()
        v16:setState({
            active = not v16.state.active
        });
    end;
    if v15() then
        v16.props.pluginLoaderContext.mainButtonClickedSignal:Connect(v16.toggleActive);
    end;
end;
v14.didMount = function(v17)
    v17._deactivatedConnection = v17.props.Plugin:get().Deactivation:Connect(function()
        v17:setState({
            active = false
        });
    end);
    if v17.state.active then
        v17.props.Plugin:get():Activate(true);
    end;
end;
v14.willUnmount = function(v18)
    v18._deactivatedConnection:Disconnect();
end;
v14.willUpdate = function(v19, _, v21)
    if not (not v21.active or v19.state.active) then
        v19.props.Plugin:get():Activate(true);
    end;
end;
if v15() then
    v14.didUpdate = function(v22)
        v22.props.pluginLoaderContext.mainButton:SetActive(v22.state.active);
    end;
end;
v14._onClearPivot = function(_)
    local v24 = false;
    local v25 = 0;
    for _, v27 in ipairs(l_Selection_0:Get()) do
        if not v27:IsA("BasePart") then
            if v27:IsA("Model") then
                v25 = v25 + 1;
                if not v27.PrimaryPart then
                    local v28 = v13(v27);
                    if v28 ~= v27.WorldPivot then
                        v12(v27, v28);
                        v24 = true;
                    end;
                elseif v27.PrimaryPart.PivotOffset ~= CFrame.identity then
                    v27.PrimaryPart.PivotOffset = CFrame.identity;
                    v27.WorldPivot = v27:GetPivot();
                    v24 = true;
                end;
            end;
        else
            v25 = v25 + 1;
            if v27.PivotOffset ~= CFrame.new() then
                v27.PivotOffset = CFrame.new();
                v24 = true;
            end;
        end;
    end;
    if v24 then
        l_ChangeHistoryService_0:SetWaypoint("Clear Pivot");
    end;
    v10:sendEvent("clearPivot", {
        objectCount = v25
    });
end;
v14.render = function(v29)
    return v4.createFragment({
        Toolbar = v4.createElement(l_PluginToolbar_0, {
            Title = "Pivot",
            RenderButtons = function(v30)
                return {
                    EditPivot = if v15() then nil else v4.createElement(l_PluginButton_0, {
                        Toolbar = v30,
                        Title = "EditPivot",
                        Tooltip = "",
                        Icon = "",
                        Active = v29.state.active,
                        OnClick = v29.toggleActive
                    }),
                    ClearPivot = v4.createElement(l_PluginButton_0, {
                        Toolbar = v30,
                        Title = "ClearPivot",
                        Tooltip = "",
                        Icon = "",
                        Active = false,
                        Enabled = true,
                        OnClick = function()
                            v29:_onClearPivot();
                        end
                    })
                };
            end
        }),
        Session = v29.state.active and v4.createElement(v11)
    });
end;
return (l_withContext_0({
    Plugin = l_ContextServices_0.Plugin
})(v14));


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 l_DraggerFramework_0 = l_Parent_0.Packages.DraggerFramework;
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v6 = require(l_DraggerFramework_0.DraggerTools.DraggerToolComponent);
local v7 = require(l_DraggerFramework_0.Handles.MoveHandles);
local v8 = require(l_DraggerFramework_0.Handles.RotateHandles);
local v9 = require(l_Parent_0.Src.DraggerSchemaPivot.PivotHandle);
local v10 = require(l_Parent_0.Src.DraggerSchemaPivot.DraggerSchema);
local v11 = require(l_Parent_0.Src.DraggerSchemaPivot.DraggerContext_Pivot);
local v12 = require(l_Parent_0.Src.RoduxComponents.SelectionUpdaterBound);
local v13 = require(l_Parent_0.Src.Actions.BeginSelectingPivot);
local v14 = require(l_Parent_0.Src.Actions.DoneSelectingPivot);
local v15 = require(l_Parent_0.Src.Utility.EditingMode);
local v16 = require(l_Parent_0.Src.Utility.StatusMessage);
local v17 = require(l_Parent_0.Src.Utility.ToastNotification);
local v18 = v1.PureComponent:extend("EditPivotSession");
local function _(v19)
    if not (v19 ~= v16.None) or v19 == v16.NoSelection then
        return false;
    else
        return true;
    end;
end;
v18.didMount = function(v21)
    v21._oldShowPivot = v21._draggerContext:setPivotIndicator(v21.props.statusMessage == v16.None);
end;
v18._getCurrentDraggerHandles = function(v22)
    if v22.props.editingMode == v15.Transform then
        return {
            v7.new(v22._draggerContext, {
                Outset = 0.5,
                ShowBoundingBox = false,
                Summonable = false,
                MustPositionAtPivot = true
            }, v10.MoveHandlesImplementation.new(v22._draggerContext, "EditPivot")),
            v8.new(v22._draggerContext, {
                ShowBoundingBox = false,
                Summonable = false
            }, v10.RotateHandlesImplementation.new(v22._draggerContext, "EditPivot")),
            v9.new(v22._draggerContext)
        };
    else
        return {};
    end;
end;
v18.render = function(v23)
    local l_editingMode_0 = v23.props.editingMode;
    local v25 = {};
    local v26 = v23.props.Plugin:get();
    local l_v26_Mouse_0 = v26:GetMouse();
    v23._draggerContext = v23.props.DraggerContext;
    if not v23._draggerContext then
        v23._draggerContext = v11.new(v26, game, settings(), v10.Selection.new());
    end;
    if not (l_editingMode_0 ~= v15.Transform) or l_editingMode_0 == v15.None then
        v25.DraggerToolComponent = v1.createElement(v6, {
            Mouse = l_v26_Mouse_0,
            DraggerContext = v23._draggerContext,
            DraggerSchema = v10,
            DraggerSettings = {
                AnalyticsName = "EditPivot",
                AllowDragSelect = false,
                AllowFreeformDrag = l_editingMode_0 == v15.Transform,
                ShowLocalSpaceIndicator = false,
                HandlesList = v23:_getCurrentDraggerHandles()
            }
        });
    end;
    v25.SelectionUpdaterBound = v1.createElement(v12);
    return v1.createFragment(v25);
end;
v18.willUpdate = function(v28, v29, _)
    local l_statusMessage_0 = v29.statusMessage;
    v28._draggerContext:setPivotIndicator(l_statusMessage_0 == v16.None);
    local l_statusMessage_1 = v28.props.statusMessage;
    if l_statusMessage_1 ~= l_statusMessage_0 then
        if l_statusMessage_1 ~= v16.None then
            v28.props.ToastNotification:hideNotification(l_statusMessage_1);
        end;
        if l_statusMessage_0 ~= v16.None and l_statusMessage_0 ~= v16.NoSelection then
            v28.props.ToastNotification:showNotification(v28.props.Localization:getText("Notification", l_statusMessage_0), l_statusMessage_0);
        end;
    end;
end;
v18.willUnmount = function(v33)
    v33._draggerContext:setPivotIndicator(v33._oldShowPivot);
end;
return v2.connect(function(v34, _)
    return {
        editingMode = v34.editingMode,
        statusMessage = v34.statusMessage,
        targetObject = v34.targetObject
    };
end, function(v36)
    return {
        beginSelectingPivot = function(v37, v38)
            v36(v13(v37, v38));
        end,
        doneSelectingPivot = function()
            v36(v14());
        end
    };
end)((l_withContext_0({
    Localization = l_ContextServices_0.Localization,
    Plugin = l_ContextServices_0.Plugin,
    ToastNotification = v17
})(v18)));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.RoactRodux);
local v2 = require(l_Parent_0.Src.Actions.SelectObjectForEditing);
local v3 = require(l_Parent_0.Src.Actions.SelectInvalidSelection);
return v1.connect(function(v4, _)
    return {
        targetObject = v4.targetObject
    };
end, function(v6)
    return {
        selectObjectForEditing = function(v7)
            v6(v2(v7));
        end,
        selectInvalidSelection = function(v8)
            v6(v3(v8));
        end
    };
end)((require(l_Parent_0.Src.Components.SelectionUpdater)));


local l_Workspace_0 = game:GetService("Workspace");
local function _(v1, v2)
    v2 = v2 or false;
    return function()
        local l_PivotEditorFlags_0 = l_Workspace_0:FindFirstChild("PivotEditorFlags");
        if l_PivotEditorFlags_0 and l_PivotEditorFlags_0:FindFirstChild(v1) then
            return l_PivotEditorFlags_0[v1].Value;
        else
            return v2;
        end;
    end;
end;
local v5 = {};
local v6 = nil or false;
local v7 = "RunDeveloperFrameworkTests";
local l_v7_0 = v7 --[[ copy: 5 -> 6 ]];
local v9;
do
    local l_v6_0 = v6;
    v9 = function()
        local l_PivotEditorFlags_1 = l_Workspace_0:FindFirstChild("PivotEditorFlags");
        if l_PivotEditorFlags_1 and l_PivotEditorFlags_1:FindFirstChild(l_v7_0) then
            return l_PivotEditorFlags_1[l_v7_0].Value;
        else
            return l_v6_0;
        end;
    end;
end;
v5.RunDeveloperFrameworkTests = v9;
v6 = nil or false;
v7 = "RunningUnderCLI";
local l_v7_1 = v7 --[[ copy: 5 -> 7 ]];
do
    local l_v6_1 = v6;
    v9 = function()
        local l_PivotEditorFlags_2 = l_Workspace_0:FindFirstChild("PivotEditorFlags");
        if l_PivotEditorFlags_2 and l_PivotEditorFlags_2:FindFirstChild(l_v7_1) then
            return l_PivotEditorFlags_2[l_v7_1].Value;
        else
            return l_v6_1;
        end;
    end;
end;
v5.RunningUnderCLI = v9;
v6 = nil or false;
v7 = "RunTests";
do
    local l_v6_2 = v6;
    v9 = function()
        local l_PivotEditorFlags_3 = l_Workspace_0:FindFirstChild("PivotEditorFlags");
        if l_PivotEditorFlags_3 and l_PivotEditorFlags_3:FindFirstChild(v7) then
            return l_PivotEditorFlags_3[v7].Value;
        else
            return l_v6_2;
        end;
    end;
end;
v5.RunTests = v9;
return v5;


return require(script.Parent.Parent.Parent.Packages.enumerate)("EditingMode", {
    "None",
    "Transform",
    "SelectGeometry",
    "SelectSurface",
    "SelectPart"
});


local v0 = require(script.Parent.Parent.Parent.Packages.DraggerFramework.Implementation.DraggerContext_FixtureImpl);
return {
    new = function(...)
        local v1 = v0.new(...);
        v1.shouldSnapPivotToGeometry = function(_)
            return true;
        end;
        return v1;
    end
};


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local v3 = require(l_Parent_0.Src.Reducers.MainReducer);
return function(v4, v5)
    return l_ContextServices_0.provide({
        l_ContextServices_0.Plugin.new(v4.Plugin or {}),
        l_ContextServices_0.Mouse.new(v4.Mouse or {}),
        l_ContextServices_0.Store.new(v4.Store or v1.Store.new(v3, nil, {
            v1.thunkMiddleware
        }))
    }, v5);
end;


return (require(script.Parent.Parent.Parent.Packages.Framework).Util.strict({
    None = "",
    NoSelection = "NoSelection",
    MultipleSelection = "MultipleSelection",
    InvalidTarget = "InvalidTarget"
}, "StatusMessage"));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.DraggerSchemaCore.DraggerSchema);
local v3 = require(l_Parent_0.Src.Reducers.MainReducer);
local v4 = require(l_Parent_0.Src.Utility.MockDraggerContext_Pivot);
local function _()
    return workspace:FindFirstChild("TempInstancesFolder");
end;
local function _()
    return game.CoreGui:FindFirstChild("TempScreenGui");
end;
local v11 = {
    cleanTempInstances = function()
        local l_TempInstancesFolder_0 = workspace:FindFirstChild("TempInstancesFolder");
        if l_TempInstancesFolder_0 then
            l_TempInstancesFolder_0:Destroy();
        end;
        local l_TempScreenGui_0 = game.CoreGui:FindFirstChild("TempScreenGui");
        if l_TempScreenGui_0 then
            l_TempScreenGui_0:Destroy();
        end;
    end,
    getTempInstancesFolder = function()
        local l_TempInstancesFolder_1 = workspace:FindFirstChild("TempInstancesFolder");
        if not l_TempInstancesFolder_1 then
            l_TempInstancesFolder_1 = Instance.new("Folder");
            l_TempInstancesFolder_1.Name = "TempInstancesFolder";
            l_TempInstancesFolder_1.Parent = workspace;
            return l_TempInstancesFolder_1;
        else
            return l_TempInstancesFolder_1;
        end;
    end,
    getTempScreenGui = function()
        local l_TempScreenGui_1 = game.CoreGui:FindFirstChild("TempScreenGui");
        if not l_TempScreenGui_1 then
            l_TempScreenGui_1 = Instance.new("ScreenGui", game.CoreGui);
            l_TempScreenGui_1.Name = "TempScreenGui";
            l_TempScreenGui_1.ZIndexBehavior = Enum.ZIndexBehavior.Sibling;
            return l_TempScreenGui_1;
        else
            return l_TempScreenGui_1;
        end;
    end
};
v11.createInstance = function(v12)
    local v13 = v11.getTempInstancesFolder();
    local v14 = Instance.new(v12);
    v14.Parent = v13;
    return v14;
end;
v11.createTestDraggerContext = function(v15)
    return v4.new(v15 or v11.getTempScreenGui(), v2.Selection.new());
end;
v11.createTestStore = function()
    return v1.Store.new(v3, nil, {
        v1.thunkMiddleware
    });
end;
return v11;


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_TestHelpers_0 = v2.TestHelpers;
local l_MockToastNotificationService_0 = l_TestHelpers_0.Instances.MockToastNotificationService;
local l_provideMockContext_0 = l_TestHelpers_0.provideMockContext;
local v7 = require(l_Parent_0.Src.Utility.TestHelper);
local v8 = require(l_Parent_0.Src.Utility.ToastNotification);
local v9 = {};
local function v11(v10)
    v10 = v10 or v7.createTestStore();
    return {
        l_ContextServices_0.Store.new(v10),
        v8.new(l_MockToastNotificationService_0.new())
    }, v10;
end;
v9.runComponentTest = function(v12, v13, v14)
    local v15 = v7.getTempScreenGui();
    local v16, v17 = v11(v14);
    local v18 = v1.mount(l_provideMockContext_0(v16, {
        test = v12
    }), v15);
    local l_status_0, l_result_0 = pcall(function()
        if v13 then
            v13(v15, v17);
        end;
    end);
    v1.unmount(v18);
    if not v14 then
        v17:destruct();
    end;
    for _, v22 in ipairs(v16) do
        v22:destroy();
    end;
    if not l_status_0 then
        error(l_result_0);
    end;
end;
return v9;


local v0 = require(script.Parent.Parent.Parent.Packages.Framework).ContextServices.ContextItem:extend("ToastNotification");
v0.new = function(v1)
    if not v1 then
        v1 = game:GetService("ToastNotificationService");
    end;
    return (setmetatable({
        _notificationService = v1
    }, v0));
end;
v0.destroy = function(v2)
    v2._notificationService = nil;
end;
v0.showNotification = function(v3, v4, v5)
    if v3._notificationService then
        v3._notificationService:ShowNotification(v4, v5);
    end;
end;
v0.hideNotification = function(v6, v7)
    if v6._notificationService then
        v6._notificationService:HideNotification(v7);
    end;
end;
return v0;


local v0 = require(script.Parent.Parent.Parent.Packages.DraggerFramework.Utility.classifyPivot);
return function(v1)
    if not v1:IsA("BasePart") then
        if not v1:IsA("Model") then
            return "None";
        else
            local l_v1_BoundingBox_0, v3 = v1:GetBoundingBox();
            local l_v1_Pivot_0 = v1:GetPivot();
            return v0(l_v1_Pivot_0, l_v1_Pivot_0:ToObjectSpace(l_v1_BoundingBox_0).Position, v3);
        end;
    else
        return v0(v1.CFrame, v1.PivotOffset.Position, v1.Size);
    end;
end;


local v0 = {
    Vector3.new(0, 0, 0),
    Vector3.new(-1, -1, -1),
    Vector3.new(1, -1, -1),
    Vector3.new(-1, 1, -1),
    Vector3.new(1, 1, -1),
    Vector3.new(-1, -1, 1),
    Vector3.new(1, -1, 1),
    Vector3.new(-1, 1, 1),
    Vector3.new(1, 1, 1),
    Vector3.new(-1, 0, 0),
    Vector3.new(1, 0, 0),
    Vector3.new(0, -1, 0),
    Vector3.new(0, 1, 0),
    Vector3.new(0, 0, -1),
    Vector3.new(0, 0, 1),
    Vector3.new(1, 1, 0),
    Vector3.new(-1, 1, 0),
    Vector3.new(-1, -1, 0),
    Vector3.new(1, -1, 0),
    Vector3.new(0, 1, 1),
    Vector3.new(0, -1, 1),
    Vector3.new(0, -1, -1),
    Vector3.new(0, 1, -1),
    Vector3.new(1, 0, 1),
    Vector3.new(-1, 0, 1),
    Vector3.new(-1, 0, -1),
    (Vector3.new(1, 0, -1))
};
local function v7(v1, v2)
    local v3 = v2 / 2;
    local v4 = {};
    for _, v6 in ipairs(v0) do
        table.insert(v4, v1 * CFrame.new(v6 * v3));
    end;
    return v4;
end;
return function(v8)
    if v8 then
        if not v8:IsA("BasePart") then
            if not v8:IsA("Model") then
                return {};
            else
                return (v7(v8:GetBoundingBox()));
            end;
        else
            return (v7(v8.CFrame, v8.Size));
        end;
    else
        return {};
    end;
end;


local v0 = require(script.Parent.Parent.Parent.Packages.DraggerFramework.Utility.snapRotationToPrimaryDirection);
local function _(v1)
    return (math.max(v1.X, v1.Y, v1.Z));
end;
local function _(v3, v4)
    local v5, v6 = v3:ToAxisAngle();
    local v7, v8 = v4:ToAxisAngle();
    return v5:FuzzyEq(v7, 0.001) and math.abs(v6 - v8) < 0.001;
end;
local function v25(v10)
    local v11 = {};
    for _, v13 in v10, nil, nil do
        local v14 = false;
        for v15, v16 in v11, nil, nil do
            local v17, v18 = v13:ToAxisAngle();
            local v19, v20 = v15:ToAxisAngle();
            if v17:FuzzyEq(v19, 0.001) and math.abs(v18 - v20) < 0.001 then
                v11[v15] = v16 + 1;
                v14 = true;
                break;
            end;
        end;
        if not v14 then
            v11[v13] = 1;
        end;
    end;
    local v21 = 0;
    local v22 = nil;
    for v23, v24 in v11, nil, nil do
        if v21 < v24 then
            v21 = v24;
            v22 = v23;
        end;
    end;
    return v22;
end;
return function(v26)
    local v27 = {};
    local function v36(v28)
        for v29, v30 in v27, nil, nil do
            local v31, v32 = v28:ToAxisAngle();
            local v33, v34 = v29:ToAxisAngle();
            if v31:FuzzyEq(v33, 0.001) and math.abs(v32 - v34) < 0.001 then
                return v30;
            end;
        end;
        local v35 = {
            RotationList = {},
            TotalSize = 0,
            Count = 0
        };
        v27[v28] = v35;
        return v35;
    end;
    for _, v38 in v26:GetDescendants() do
        if v38:IsA("PVInstance") then
            local l_Rotation_0 = v38:GetPivot().Rotation;
            local v40 = v36(v0(l_Rotation_0):Inverse() * l_Rotation_0);
            table.insert(v40.RotationList, l_Rotation_0);
            v40.Count = v40.Count + 1;
            if v38:IsA("BasePart") then
                local l_TotalSize_0 = v40.TotalSize;
                local l_ExtentsSize_0 = v38.ExtentsSize;
                v40.TotalSize = l_TotalSize_0 + math.max(l_ExtentsSize_0.X, l_ExtentsSize_0.Y, l_ExtentsSize_0.Z);
            end;
        end;
    end;
    local v43 = 0;
    local v44 = 0;
    local v45 = nil;
    local v46 = 0;
    local v47 = nil;
    for _, v49 in v27, nil, nil do
        if v43 < v49.Count then
            v43 = v49.Count;
            v45 = v49.RotationList;
            v44 = v49.TotalSize;
        end;
        if v46 < v49.TotalSize then
            v46 = v49.TotalSize;
            v47 = v49.RotationList;
        end;
    end;
    if not v45 or not v47 then
        return v26.WorldPivot;
    else
        v26.WorldPivot = v25(if not (v44 >= v46) or #v45 == 1 then v47 else v45);
        return v26:GetBoundingBox();
    end;
end;


return function(v0, v1)
    if not v0:IsA("BasePart") then
        if not v0:IsA("Model") then
            error("Unexpected instance type: " .. v0.ClassName);
            return ;
        else
            if v0.PrimaryPart then
                v0.PrimaryPart.PivotOffset = v0.PrimaryPart.CFrame:ToObjectSpace(v1);
            end;
            v0.WorldPivot = v1;
            return ;
        end;
    else
        v0.PivotOffset = v0.CFrame:ToObjectSpace(v1);
        return ;
    end;
end;


game:DefineFastFlag("PlayerEmulatorDropdownOpenedStateTrackingEnabled", false);
game:DefineFastFlag("EnablePseudolocalizationInPlayerEmulator", false);
return nil;


return function(v0, v1)
    if v0 then
        local l_Parent_0 = script.Parent.Parent;
        local v3 = require(l_Parent_0.Packages.Roact);
        local v4 = require(l_Parent_0.Src.Components.PlayerEmulatorPlugin);
        (function()
            local v5 = nil;
            v5 = v3.mount((v3.createElement(v4, {
                plugin = v0,
                onPluginWillDestroy = function()
                    if v5 then
                        v3.unmount(v5);
                    end;
                end,
                pluginLoaderContext = v1
            })));
        end)();
        return ;
    else
        return ;
    end;
end;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Src.Util.DebugFlags);
if not (not v1.RunningUnderCLI() and not v1.RunTests()) then
    local v2 = require(l_Parent_0.Packages.Dev.TestEZ);
    local l_TestBootstrap_0 = v2.TestBootstrap;
    local l_TeamCityReporter_0 = v2.Reporters.TeamCityReporter;
    local l_TextReporter_0 = v2.Reporters.TextReporter;
    if v1.LogTestsQuiet() then
        l_TextReporter_0 = v2.Reporters.TextReporterQuiet;
    end;
    l_TextReporter_0 = not not _G.TEAMCITY and l_TeamCityReporter_0 or l_TextReporter_0;
    print("----- All " .. script.Parent.Parent.Name .. " Tests ------");
    require(script.Parent.defineLuaFlags);
    l_TestBootstrap_0:run({
        l_Parent_0.Src
    }, l_TextReporter_0);
    print("----------------------------------");
    if v1.RunDeveloperFrameworkTests() then
        print("");
        print("----- All Developer Framework Tests ------");
        l_TestBootstrap_0:run({
            l_Parent_0.Packages._Index.DeveloperFramework.DeveloperFramework
        }, l_TextReporter_0);
        print("----------------------------------");
    end;
end;
if v1.RunningUnderCLI() then
    pcall(function()
        game:GetService("ProcessService"):ExitAsync(0);
    end);
end;


local l_Http_0 = script.Parent._Legacy.Http.Packages.Http;
if l_Http_0.ClassName == "ModuleScript" then
    return require(l_Http_0);
else
    return l_Http_0;
end;


local l_Promise_0 = script.Parent._Legacy.Promise.Packages.Promise;
if l_Promise_0.ClassName == "ModuleScript" then
    return require(l_Promise_0);
else
    return l_Promise_0;
end;


return require(script.Parent.Action)(script.Name, function(v0, v1)
    assert(type(v0) == "table", "Expected allPolicies to be a table");
    assert(type(v1) == "table", "Expected allPolicySortedKeys to be a table");
    return {
        allPolicies = v0,
        allPolicySortedKeys = v1
    };
end);


return require(script.Parent.Action)(script.Name, function(v0)
    assert(type(v0) == "table", "Expected data to be a table");
    return {
        data = v0
    };
end);


return require(script.Parent.Action)(script.Name, function(v0)
    assert(type(v0) == "boolean", "Expected enabled to be a boolean");
    return {
        enabled = v0
    };
end);


return require(script.Parent.Action)(script.Name, function(v0)
    assert(type(v0) == "string", "Expected country region code to be a string");
    return {
        countryRegionCode = v0
    };
end);


return require(script.Parent.Action)(script.Name, function(v0)
    assert(type(v0) == "boolean", "Expected policyListItemsModuleExpanded to be a bool");
    return {
        policyListItemsModuleExpanded = v0
    };
end);


return require(script.Parent.Action)(script.Name, function(v0)
    assert(type(v0) == "table", "Expected policySettingStatus to be a table");
    return {
        policySettingStatus = v0
    };
end);


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_Checkbox_0 = v2.UI.Checkbox;
local v6 = v1.PureComponent:extend("CheckBoxModule");
v6.init = function(v7, v8)
    v7.onActivated = function()
        v8.CheckBoxCallback(v8.ItemKey);
    end;
end;
v6.render = function(v9)
    local l_props_0 = v9.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    local l_Enabled_0 = l_props_0.Enabled;
    local l_ItemKey_0 = l_props_0.ItemKey;
    return v1.createElement("Frame", {
        Size = l_Stylizer_0.CHECKBOX_FRAME_SIZE,
        BackgroundTransparency = 1
    }, {
        Padding = v1.createElement("UIPadding", {
            PaddingLeft = l_Stylizer_0.LISTITEM_INDENT_LEFT
        }),
        CheckBox = v1.createElement(l_Checkbox_0, {
            Checked = l_props_0.Selected,
            Disabled = not l_Enabled_0,
            Key = l_ItemKey_0,
            OnClick = v9.onActivated,
            Text = l_ItemKey_0
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v6));


local l_PlayerEmulatorService_0 = game:GetService("PlayerEmulatorService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local v4 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v7 = require(l_Parent_0.Src.ContextServices.NetworkingContext);
local v8 = require(l_Parent_0.Src.Networking.Requests.GetCountryRegion);
local v9 = require(l_Parent_0.Src.Util.Constants);
local v10 = require(l_Parent_0.Src.Actions.OnEmulatedCountryRegionChanged);
local l_UI_0 = v4.UI;
local l_SelectInput_0 = l_UI_0.SelectInput;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_map_0 = v4.Dash.map;
local l_StyleModifier_0 = v4.Util.StyleModifier;
local v16 = v2.PureComponent:extend("CountryRegionSection");
local function _()
    return l_PlayerEmulatorService_0.EmulatedCountryCode;
end;
local function _(v18)
    l_PlayerEmulatorService_0.EmulatedCountryCode = v18;
end;
v16.getCurrentCountryRegionText = function(v20, v21)
    local l_countryRegionTable_0 = v20.props.countryRegionTable;
    if not l_countryRegionTable_0 or not l_countryRegionTable_0[v21] then
        return "";
    else
        return l_countryRegionTable_0[v21].displayText;
    end;
end;
v16.updateCountryRegionSetting = function(v23, v24)
    local v25 = v23.props.Plugin:get();
    if v25:GetSetting(v9.COUNTRY_REGION_SETTING_KEY) ~= v24 then
        v25:SetSetting(v9.COUNTRY_REGION_SETTING_KEY, v24);
    end;
    v23.props.onEmulatedCountryRegionChanged(v24);
end;
v16.init = function(v26)
    v26.signalTokens = {};
    v26.createCountryRegionListForSelectInput = function(v27)
        return {
            Id = v27.displayText,
            Label = v27.displayText,
            code = v27.code
        };
    end;
    v26.onItemClicked = function(v28)
        l_PlayerEmulatorService_0.EmulatedCountryCode = v28.code;
    end;
end;
v16.didMount = function(v29)
    local v30 = v29.props.Plugin:get();
    local v31 = v29.props.Networking:get();
    table.insert(v29.signalTokens, (l_PlayerEmulatorService_0:GetPropertyChangedSignal("EmulatedCountryCode"):Connect(function()
        v29:updateCountryRegionSetting(l_PlayerEmulatorService_0.EmulatedCountryCode);
    end)));
    v29.props.loadCountryRegion(v31, v30);
end;
v16.willUnmount = function(v32)
    for _, v34 in pairs(v32.signalTokens) do
        v34:Disconnect();
    end;
    v32.signalTokens = nil;
end;
v16.render = function(v35)
    local l_props_0 = v35.props;
    local l_mainSwitchEnabled_0 = l_props_0.mainSwitchEnabled;
    local l_countryRegionList_0 = l_props_0.countryRegionList;
    local l_userCountryRegionCode_0 = l_props_0.userCountryRegionCode;
    local l_Stylizer_0 = l_props_0.Stylizer;
    return v2.createElement("Frame", {
        Size = l_Stylizer_0.SELECTOR_SIZE,
        BackgroundTransparency = 1,
        LayoutOrder = l_props_0.LayoutOrder
    }, {
        Layout = v2.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder,
            FillDirection = Enum.FillDirection.Horizontal,
            Padding = l_Stylizer_0.HORIZONTAL_LISTLAYOUT_PADDING
        }),
        Label = v2.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.XY,
            StyleModifier = if not l_mainSwitchEnabled_0 then l_StyleModifier_0.Disabled else nil,
            Text = l_props_0.Localization:getText("CountryRegionSection", "LabelText"),
            LayoutOrder = 1
        }),
        CountryRegionDropdown = v2.createElement(l_SelectInput_0, {
            Items = l_map_0(l_countryRegionList_0, v35.createCountryRegionListForSelectInput),
            LayoutOrder = 2,
            OnItemActivated = v35.onItemClicked,
            SelectedId = v35:getCurrentCountryRegionText(l_userCountryRegionCode_0),
            Enabled = l_mainSwitchEnabled_0
        })
    });
end;
return v3.connect(function(v41, _)
    return {
        mainSwitchEnabled = v41.MainSwitch.mainSwitchEnabled,
        countryRegionTable = v41.CountryRegion.countryRegionTable,
        countryRegionList = v41.CountryRegion.countryRegionList,
        userCountryRegionCode = v41.CountryRegion.userCountryRegionCode
    };
end, function(v43)
    return {
        loadCountryRegion = function(v44, v45)
            v43(v8(v44, v45));
        end,
        onEmulatedCountryRegionChanged = function(v46)
            v43(v10(v46));
        end
    };
end)((l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization,
    Networking = v7,
    Plugin = l_ContextServices_0.Plugin
})(v16)));


local l_PlayerEmulatorService_0 = game:GetService("PlayerEmulatorService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v6 = require(l_Parent_0.Src.Components.ToggleItemModule);
local v7 = require(l_Parent_0.Src.Util.Constants);
local v8 = require(l_Parent_0.Src.Actions.OnCustomPolicyEnabledChanged);
local v9 = require(l_Parent_0.Src.Actions.OnCustomPolicySwitchEnabledChanged);
local function _()
    return l_PlayerEmulatorService_0.CustomPoliciesEnabled;
end;
local function _(v11)
    l_PlayerEmulatorService_0.CustomPoliciesEnabled = v11;
end;
local v13 = v2.PureComponent:extend("CustomPolicySwitchSection");
v13.updateCustomPoliciesEnabled = function(v14)
    v14.props.onCustomPolicyEnabledChanged(l_PlayerEmulatorService_0.CustomPoliciesEnabled);
end;
v13.updateCustomPoliciesSwitchEnabled = function(v15, v16)
    v15.props.Plugin:get():SetSetting(v7.CUSTOM_POLICIES_SWITCH_KEY, v16);
    v15.props.onCustomPolicySwitchEnabledChanged(v16);
end;
v13.init = function(v17)
    v17.signalTokens = {};
end;
v13.didMount = function(v18)
    table.insert(v18.signalTokens, (l_PlayerEmulatorService_0:GetPropertyChangedSignal("CustomPoliciesEnabled"):Connect(function()
        v18:updateCustomPoliciesEnabled();
    end)));
    local l_Setting_0 = v18.props.Plugin:get():GetSetting(v7.CUSTOM_POLICIES_SWITCH_KEY);
    if l_Setting_0 == true then
        v18:updateCustomPoliciesSwitchEnabled(l_Setting_0);
    end;
    v18:updateCustomPoliciesEnabled();
end;
v13.willUnmount = function(v20)
    for _, v22 in pairs(v20.signalTokens) do
        v22:Disconnect();
    end;
    v20.signalTokens = nil;
end;
v13.render = function(v23)
    local l_props_0 = v23.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    local l_Localization_0 = l_props_0.Localization;
    local l_LayoutOrder_0 = l_props_0.LayoutOrder;
    local l_customPolicySwitchEnabled_0 = l_props_0.customPolicySwitchEnabled;
    local l_mainSwitchEnabled_0 = l_props_0.mainSwitchEnabled;
    if l_props_0.customPolicySwitchActive then
        l_PlayerEmulatorService_0.CustomPoliciesEnabled = l_customPolicySwitchEnabled_0;
        return v2.createElement("Frame", {
            Size = l_Stylizer_0.TOGGLE_ITEM_FRAME_SIZE,
            BackgroundTransparency = 1,
            LayoutOrder = l_LayoutOrder_0
        }, {
            Toggle = v2.createElement(v6, {
                Key = l_Localization_0:getText("CustomPolicySwitchSection", "LabelText"),
                IsOn = l_customPolicySwitchEnabled_0,
                Enabled = l_mainSwitchEnabled_0,
                ToggleCallback = function(_, v31, _)
                    v23:updateCustomPoliciesSwitchEnabled(v31);
                end
            })
        });
    else
        l_PlayerEmulatorService_0.CustomPoliciesEnabled = true;
        return nil;
    end;
end;
return v3.connect(function(v33, _)
    return {
        mainSwitchEnabled = v33.MainSwitch.mainSwitchEnabled,
        customPolicySwitchEnabled = v33.CustomPolicySwitch.customPolicySwitchEnabled,
        customPolicySwitchActive = v33.CustomPolicySwitch.customPolicySwitchActive
    };
end, function(v35)
    return {
        onCustomPolicyEnabledChanged = function(v36)
            v35(v8(v36));
        end,
        onCustomPolicySwitchEnabledChanged = function(v37)
            v35(v9(v37));
        end
    };
end)((l_withContext_0({
    Plugin = l_ContextServices_0.Plugin,
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization
})(v13)));


local l_EnablePseudolocalizationInPlayerEmulator_0 = game:GetFastFlag("EnablePseudolocalizationInPlayerEmulator");
local l_LocalizationService_0 = game:GetService("LocalizationService");
local l_PlayerEmulatorService_0 = game:GetService("PlayerEmulatorService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v4 = require(l_Parent_0.Packages.Roact);
local v5 = require(l_Parent_0.Packages.RoactRodux);
local v6 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v6.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v9 = require(l_Parent_0.Src.ContextServices.NetworkingContext);
local v10 = require(l_Parent_0.Src.Util.Constants);
local l_getStudioLocaleId_0 = require(l_Parent_0.Src.Util.PlayerEmulatorUtilities).getStudioLocaleId;
local l_UI_0 = v6.UI;
local l_SelectInput_0 = l_UI_0.SelectInput;
local l_DEPRECATED_TextInput_0 = l_UI_0.DEPRECATED_TextInput;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_map_0 = v6.Dash.map;
local l_StyleModifier_0 = v6.Util.StyleModifier;
local v18 = require(l_Parent_0.Src.Networking.Requests.GetLanguages);
local function _()
    return l_PlayerEmulatorService_0.EmulatedGameLocale;
end;
local function _(v20)
    l_PlayerEmulatorService_0.EmulatedGameLocale = v20;
end;
local function _()
    if not l_EnablePseudolocalizationInPlayerEmulator_0 then
        return l_PlayerEmulatorService_0.PlayerEmulationEnabled_deprecated;
    else
        return l_PlayerEmulatorService_0.PlayerEmulationEnabled;
    end;
end;
l_LocalizationService_0.RobloxForcePlayModeRobloxLocaleId = l_getStudioLocaleId_0();
local v23 = v4.PureComponent:extend("LanguageSection");
v23.getCurrentLanguageName = function(v24)
    local v25 = string.gsub(v24.state.localeId, "-", "_");
    local l_languagesTable_0 = v24.props.languagesTable;
    if not (v25 ~= "") or not l_languagesTable_0[v25] then
        return ;
    else
        return l_languagesTable_0[v25].displayText;
    end;
end;
v23.getTestLangInstructionText = function(v27)
    local l_Localization_0 = v27.props.Localization;
    local v29 = string.gsub(v27.state.localeId, "-", "_");
    local l_languagesTable_1 = v27.props.languagesTable;
    if not (v29 ~= "") or not l_languagesTable_1[v29] then
        return "";
    else
        return string.format(l_Localization_0:getText("LanguageSection", "InstructionText"), l_languagesTable_1[v29].displayText, l_languagesTable_1[v29].languageCode);
    end;
end;
v23.initLocaleId = function(v31)
    local l_Setting_0 = v31.props.Plugin:get():GetSetting(v10.LOCALEID_SETTING_KEY);
    if l_Setting_0 then
        l_PlayerEmulatorService_0.EmulatedGameLocale = l_Setting_0;
    end;
end;
v23.onPlayerEmulationEnabledChanged = function(v33)
    local l_localeId_0 = v33.state.localeId;
    if not if not l_EnablePseudolocalizationInPlayerEmulator_0 then l_PlayerEmulatorService_0.PlayerEmulationEnabled_deprecated else l_PlayerEmulatorService_0.PlayerEmulationEnabled then
        l_PlayerEmulatorService_0.EmulatedGameLocale = l_getStudioLocaleId_0();
        return ;
    else
        l_PlayerEmulatorService_0.EmulatedGameLocale = l_localeId_0;
        return ;
    end;
end;
v23.onRobloxForcePlayModeRobloxLocaleIdChanged = function(v35)
    local l_EmulatedGameLocale_0 = l_PlayerEmulatorService_0.EmulatedGameLocale;
    v35:setState({
        localeId = l_EmulatedGameLocale_0
    });
    v35.props.Plugin:get():SetSetting(v10.LOCALEID_SETTING_KEY, l_EmulatedGameLocale_0);
end;
v23.init = function(v37)
    v37.state = {
        localeId = l_PlayerEmulatorService_0.EmulatedGameLocale
    };
    v37.textBoxRef = v4.createRef();
    v37.signalTokens = {};
    v37.onItemClicked = function(v38)
        if v38.localeId then
            l_PlayerEmulatorService_0.EmulatedGameLocale = v38.localeId;
            return ;
        else
            l_PlayerEmulatorService_0.EmulatedGameLocale = "";
            v37.textBoxRef.current:CaptureFocus();
            return ;
        end;
    end;
    v37.createLanguageListForSelectInput = function(v39)
        local v40 = {};
        if v39.displayText ~= nil then
            v40.Id = v39.displayText;
            v40.Label = v39.displayText;
            v40.localeId = v39.localeId;
            return v40;
        else
            if v39.displayTextStringKey ~= nil then
                v40.Id = v37.props.Localization:getText(v39.displayTextSectionKey, v39.displayTextStringKey);
                v40.Label = v37.props.Localization:getText(v39.displayTextSectionKey, v39.displayTextStringKey);
            end;
            return v40;
        end;
    end;
end;
v23.didMount = function(v41)
    v41.props.loadLanguages((v41.props.Networking:get()));
    table.insert(v41.signalTokens, (l_PlayerEmulatorService_0:GetPropertyChangedSignal("EmulatedGameLocale"):Connect(function()
        v41:onRobloxForcePlayModeRobloxLocaleIdChanged();
    end)));
    v41:initLocaleId();
end;
v23.willUnmount = function(v42)
    for _, v44 in pairs(v42.signalTokens) do
        v44:Disconnect();
    end;
    v42.signalTokens = nil;
end;
v23.render = function(v45)
    local l_state_0 = v45.state;
    local l_props_0 = v45.props;
    local l_mainSwitchEnabled_0 = l_props_0.mainSwitchEnabled;
    local l_localeId_1 = l_state_0.localeId;
    local l_languagesList_0 = l_props_0.languagesList;
    local l_Stylizer_0 = l_props_0.Stylizer;
    local l_Localization_1 = l_props_0.Localization;
    return v4.createElement("Frame", {
        Size = l_Stylizer_0.LANGUAGE_SECTION_SIZE,
        BackgroundTransparency = 1,
        LayoutOrder = l_props_0.LayoutOrder
    }, {
        Layout = v4.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder,
            FillDirection = Enum.FillDirection.Vertical
        }),
        SelectorModule = v4.createElement("Frame", {
            Size = l_Stylizer_0.SELECTOR_SIZE,
            BackgroundTransparency = 1,
            LayoutOrder = 1
        }, {
            Layout = v4.createElement("UIListLayout", {
                SortOrder = Enum.SortOrder.LayoutOrder,
                FillDirection = Enum.FillDirection.Horizontal,
                Padding = l_Stylizer_0.HORIZONTAL_LISTLAYOUT_PADDING
            }),
            Label = v4.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                LayoutOrder = 1,
                StyleModifier = if not l_mainSwitchEnabled_0 then l_StyleModifier_0.Disabled else nil,
                Text = l_Localization_1:getText("LanguageSection", "LabelText")
            }),
            LanguageDropdown = v4.createElement(l_SelectInput_0, {
                Items = l_map_0(l_languagesList_0, v45.createLanguageListForSelectInput),
                LayoutOrder = 2,
                OnItemActivated = v45.onItemClicked,
                SelectedId = v45:getCurrentLanguageName() or l_Localization_1:getText("LanguageSection", "CustomLanguageDisplayText"),
                Enabled = l_mainSwitchEnabled_0
            }),
            LocaleIdTextBox = v4.createElement("Frame", {
                Size = l_Stylizer_0.LOCALEID_TEXTBOX_SIZE,
                BorderColor3 = l_Stylizer_0.BorderColor,
                BorderSizePixel = 0,
                BackgroundColor3 = l_Stylizer_0.BackgroundColor,
                LayoutOrder = 3
            }, {
                Padding = v4.createElement("UIPadding", {
                    PaddingLeft = l_Stylizer_0.TEXT_INDENT_PADDING
                }),
                TextBox = v4.createElement(l_DEPRECATED_TextInput_0, {
                    OnFocusLost = function()
                        if v45.textBoxRef.current then
                            l_PlayerEmulatorService_0.EmulatedGameLocale = v45.textBoxRef.current.Text;
                        end;
                    end,
                    Disabled = not l_mainSwitchEnabled_0,
                    Text = l_localeId_1,
                    [v4.Ref] = v45.textBoxRef
                })
            })
        }),
        TextModule = v4.createElement("Frame", {
            AutomaticSize = if not l_EnablePseudolocalizationInPlayerEmulator_0 then nil else Enum.AutomaticSize.XY,
            BackgroundTransparency = 1,
            BorderSizePixel = 0,
            LayoutOrder = 2
        }, {
            Padding = v4.createElement("UIPadding", {
                PaddingLeft = l_Stylizer_0.TEXT_INDENT_PADDING,
                PaddingBottom = if not l_EnablePseudolocalizationInPlayerEmulator_0 then nil else l_Stylizer_0.HORIZONTAL_LISTLAYOUT_PADDING
            }),
            TextLabel = v4.createElement(l_TextLabel_0, {
                Size = l_Stylizer_0.LANGUAGE_INSTRUCTION_SIZE,
                StyleModifier = if not l_mainSwitchEnabled_0 then l_StyleModifier_0.Disabled else nil,
                TextSize = if not l_EnablePseudolocalizationInPlayerEmulator_0 then nil else l_Stylizer_0.LANGUAGE_INSTRUCTION_TEXT_SIZE,
                Text = v45:getTestLangInstructionText(),
                TextXAlignment = Enum.TextXAlignment.Left
            })
        })
    });
end;
return v5.connect(function(v53, _)
    return {
        mainSwitchEnabled = v53.MainSwitch.mainSwitchEnabled,
        languagesTable = v53.Languages.languagesTable,
        languagesList = v53.Languages.languagesList
    };
end, function(v55)
    return {
        loadLanguages = function(v56)
            v55(v18(v56));
        end
    };
end)((l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization,
    Networking = v9,
    Plugin = l_ContextServices_0.Plugin
})(v23)));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Cryo);
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v3.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_ExpandablePane_0 = v3.UI.ExpandablePane;
local v7 = require(l_Parent_0.Src.Components.CheckBoxModule);
local l_getSocialMediaReferencesAllowed_0 = require(l_Parent_0.Src.Util.PlayerEmulatorUtilities).getSocialMediaReferencesAllowed;
local v9 = v2.PureComponent:extend("ListItemsModule");
v9.init = function(v10, v11)
    v10.state = {
        expanded = v11.Expanded
    };
    v10.onExpandedStateChanged = function()
        v11.ListItemsModuleExpansionCallback(not v10.state.expanded);
        v10:setState({
            expanded = not v10.state.expanded
        });
    end;
    v10.checkBoxCallback = function(v12)
        v11.ListItemsCheckBoxCallback(v11.LabelText, v12, v11.Plugin:get());
    end;
end;
v9.render = function(v13)
    local l_state_0 = v13.state;
    local l_props_0 = v13.props;
    local l_Enabled_0 = l_props_0.Enabled;
    local l_expanded_0 = l_state_0.expanded;
    local l_LabelText_0 = l_props_0.LabelText;
    local v19 = l_props_0.Items or {};
    local l_ListStatus_0 = l_props_0.ListStatus;
    local v21 = {};
    for _, v23 in pairs(v19) do
        v21["Item" .. v23] = v2.createElement(v7, {
            Enabled = l_Enabled_0,
            ItemKey = v23,
            Selected = v1.List.find(l_ListStatus_0, v23) ~= nil,
            CheckBoxCallback = v13.checkBoxCallback
        });
    end;
    return not not l_getSocialMediaReferencesAllowed_0() and v2.createElement(l_ExpandablePane_0, {
        Expanded = l_expanded_0,
        OnExpandedChanged = v13.onExpandedStateChanged,
        Text = l_LabelText_0
    }, v21) or nil;
end;
return (l_withContext_0({
    Plugin = l_ContextServices_0.Plugin,
    Stylizer = l_ContextServices_0.Stylizer
})(v9));


local l_PlayerEmulatorService_0 = game:GetService("PlayerEmulatorService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local v4 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v4.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_UI_0 = v4.UI;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_ToggleButton_0 = l_UI_0.ToggleButton;
local v10 = require(l_Parent_0.Src.Util.Constants);
local v11 = require(l_Parent_0.Src.Actions.OnPlayerEmulationEnabledChanged);
local function _()
    return l_PlayerEmulatorService_0.PlayerEmulationEnabled;
end;
local function v14(v13)
    l_PlayerEmulatorService_0.PlayerEmulationEnabled = v13;
end;
local v15 = v2.PureComponent:extend("MainSwitchSection");
v15.initEnabledStatus = function(v16)
    if v16.props.Plugin:get():GetSetting(v10.MAIN_SWITCH_KEY) == true then
        l_PlayerEmulatorService_0.PlayerEmulationEnabled = true;
    end;
end;
v15.updatePlayerEmulationEnabled = function(v17, v18)
    v17.props.Plugin:get():SetSetting(v10.MAIN_SWITCH_KEY, v18);
    v17.props.onPlayerEmulationEnabledChanged(v18);
end;
v15.init = function(v19)
    v19.signalTokens = {};
end;
v15.didMount = function(v20)
    table.insert(v20.signalTokens, (l_PlayerEmulatorService_0:GetPropertyChangedSignal("PlayerEmulationEnabled"):Connect(function()
        v20:updatePlayerEmulationEnabled(l_PlayerEmulatorService_0.PlayerEmulationEnabled);
    end)));
    v20:initEnabledStatus();
end;
v15.willUnmount = function(v21)
    for _, v23 in pairs(v21.signalTokens) do
        v23:Disconnect();
    end;
    v21.signalTokens = nil;
end;
v15.render = function(v24)
    local l_props_0 = v24.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    return v2.createElement("Frame", {
        Size = l_Stylizer_0.TOGGLE_ITEM_FRAME_SIZE,
        BackgroundTransparency = 1,
        LayoutOrder = l_props_0.LayoutOrder
    }, {
        Label = v2.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.XY,
            Text = l_props_0.Localization:getText("MainSwitchSection", "LabelText"),
            LayoutOrder = 1
        }),
        Toggle = v2.createElement(l_ToggleButton_0, {
            AnchorPoint = Vector2.new(0, 0.5),
            LayoutOrder = 2,
            OnClick = v14,
            Position = UDim2.new(0, l_Stylizer_0.TOGGLE_BUTTON_OFFSET, 0.5, -l_Stylizer_0.TOGGLE_BUTTON_HEIGHT / 2),
            Selected = l_props_0.mainSwitchEnabled
        })
    });
end;
return v3.connect(function(v27, _)
    return {
        mainSwitchEnabled = v27.MainSwitch.mainSwitchEnabled
    };
end, function(v29)
    return {
        onPlayerEmulationEnabledChanged = function(v30)
            v29(v11(v30));
        end
    };
end)((l_withContext_0({
    Plugin = l_ContextServices_0.Plugin,
    Stylizer = l_ContextServices_0.Stylizer,
    Localization = l_ContextServices_0.Localization
})(v15)));


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_Separator_0 = v2.UI.Separator;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
local v7 = require(l_Parent_0.Src.Components.MainSwitchSection);
local v8 = require(l_Parent_0.Src.Components.CustomPolicySwitchSection);
local v9 = require(l_Parent_0.Src.Components.LanguageSection);
local v10 = require(l_Parent_0.Src.Components.PseudolocalizationSection);
local v11 = require(l_Parent_0.Src.Components.CountryRegionSection);
local v12 = require(l_Parent_0.Src.Components.PolicySection);
local l_EnablePseudolocalizationInPlayerEmulator_0 = game:GetFastFlag("EnablePseudolocalizationInPlayerEmulator");
local v14 = v1.PureComponent:extend("MainView");
v14.render = function(v15)
    local v16 = l_LayoutOrderIterator_0.new();
    local l_Stylizer_0 = v15.props.Stylizer;
    return v1.createElement("Frame", {
        Size = UDim2.new(1, 0, 1, 0),
        BackgroundColor3 = l_Stylizer_0.BackgroundColor,
        Position = UDim2.new(0, 0, 0, 0)
    }, {
        Padding = v1.createElement("UIPadding", {
            PaddingTop = l_Stylizer_0.MAINVIEW_PADDING_TOP,
            PaddingLeft = l_Stylizer_0.MAINVIEW_PADDING_LEFT,
            PaddingRight = l_Stylizer_0.MAINVIEW_PADDING_LEFT
        }),
        Layout = v1.createElement("UIListLayout", {
            SortOrder = Enum.SortOrder.LayoutOrder,
            FillDirection = Enum.FillDirection.Vertical,
            Padding = l_Stylizer_0.HORIZONTAL_LISTLAYOUT_PADDING
        }),
        MainSwitchSection = v1.createElement(v7, {
            LayoutOrder = v16:getNextOrder()
        }),
        Separator = v1.createElement(l_Separator_0, {
            LayoutOrder = v16:getNextOrder()
        }),
        LanguageSection = v1.createElement(v9, {
            LayoutOrder = v16:getNextOrder()
        }),
        PseudolocalizationSection = if not l_EnablePseudolocalizationInPlayerEmulator_0 then nil else v1.createElement(v10, {
            LayoutOrder = v16:getNextOrder()
        }),
        CountryRegionSection = v1.createElement(v11, {
            LayoutOrder = v16:getNextOrder()
        }),
        CustomPolicySwitchSection = v1.createElement(v8, {
            LayoutOrder = v16:getNextOrder()
        }),
        PolicySection = v1.createElement(v12, {
            LayoutOrder = v16:getNextOrder()
        })
    });
end;
return (l_withContext_0({
    Stylizer = l_ContextServices_0.Stylizer
})(v14));


local l_StudioFixPluginWidgetLocalizedIds_0 = game:GetFastFlag("StudioFixPluginWidgetLocalizedIds");
local l_RunService_0 = game:GetService("RunService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v3 = require(l_Parent_0.Packages.Roact);
local v4 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v4.ContextServices;
local l_DockWidget_0 = v4.UI.DockWidget;
local v7 = require(l_Parent_0.Src.Components.MainView);
local v8 = require(l_Parent_0.Src.Util.CreatePluginGlobals);
local v9 = require(l_Parent_0.Src.Util.Constants);
local v10 = v3.PureComponent:extend("PlayerEmulatorPlugin");
local v11 = Vector2.new(320, 330);
v10.updateToolbarButtonActiveState = function(v12)
    local l_active_0 = v12.state.active;
    if v12.button then
        v12.button:SetActive(l_active_0);
    end;
end;
v10.initPluginWidgetStatus = function(v14)
    local l_Setting_0 = v14.props.plugin:GetSetting(v9.PLUGIN_WIDGET_STATE);
    if l_Setting_0 ~= v14.state.active then
        v14:setState({
            active = l_Setting_0
        });
    end;
end;
v10.init = function(v16)
    v16.state = {
        active = false
    };
    v16.contextItems = {
        l_ContextServices_0.Plugin.new(v16.props.plugin),
        v8.localization,
        v8.theme,
        v8.networking,
        v8.store,
        l_ContextServices_0.Mouse.new(v16.props.plugin:GetMouse())
    };
    v16.toggleActive = function()
        local l_plugin_0 = v16.props.plugin;
        local v18 = not v16.state.active;
        v16:setState({
            active = v18
        });
        l_plugin_0:SetSetting(v9.PLUGIN_WIDGET_STATE, v18);
    end;
    v16.onClose = function()
        v16:setState({
            active = false
        });
        v16.props.plugin:SetSetting(v9.PLUGIN_WIDGET_STATE, false);
    end;
    v16.onWidgetEnabledChanged = function(v19)
        v16:setState({
            active = v19.Enabled
        });
    end;
    v16.onAncestryChanged = function(_, _, v22)
        if not (v22 or not v16.props.onPluginWillDestroy) then
            v16.props.onPluginWillDestroy();
        end;
    end;
    v16.button = v16.props.pluginLoaderContext.mainButton;
    v16.props.pluginLoaderContext.mainButtonClickedSignal:Connect(v16.toggleActive);
end;
v10.didMount = function(v23)
    v23:initPluginWidgetStatus();
    v23:updateToolbarButtonActiveState();
end;
v10.didUpdate = function(v24)
    v24:updateToolbarButtonActiveState();
end;
v10.render = function(v25)
    local l_active_1 = v25.state.active;
    return l_ContextServices_0.provide(v25.contextItems, {
        MainWidget = l_RunService_0:IsEdit() and v3.createElement(l_DockWidget_0, {
            Id = if not l_StudioFixPluginWidgetLocalizedIds_0 then nil else "PlayerEmulator",
            Enabled = l_active_1,
            Title = v8.localization:getText("Meta", "PluginTitle"),
            ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
            InitialDockState = Enum.InitialDockState.Left,
            Size = v11,
            MinSize = v11,
            OnClose = v25.onClose,
            ShouldRestore = false,
            [v3.Change.Enabled] = v25.onWidgetEnabledChanged
        }, {
            MainView = l_active_1 and v3.createElement(v7)
        })
    });
end;
return v10;