local v0 = {};
local v1 = require(script.Parent.CoreGuiManager);
local v2 = require(script.Parent.Enum.Direction);
local v3 = require(script.Parent.MouseIconManager);
local v4 = require(script.Parent.SelectionManager);
local v5 = require(script.Parent.Utility);
local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local v7 = nil;
local v8 = nil;
local _ = {};
local v10 = {};
local v11 = false;
local v12 = 0;
local v13 = 0;
local v14 = 0;
local v15 = nil;
local v16 = nil;
local v17 = nil;
local v18 = {};
local function v19()
    v17 = Instance.new("Frame");
    v17.Name = "UIEditorRotationHandleParent";
    v17.BackgroundTransparency = 1;
    v17.BackgroundColor3 = Color3.new(0, 0, 255);
    v17.BorderSizePixel = 0;
    v17.Parent = v1:findOrCreateScreenGui("RotationHandles");
end;
local function _()
    if v17 then
        v17:Destroy();
    end;
end;
local function _(v21)
    v10[v21] = true;
end;
local function _(v23)
    v10[v23] = false;
end;
local function _()
    local l_NOT_SET_0 = v2.NOT_SET;
    for v26 = v2.FIRST, v2.LAST do
        if v10[v26] then
            return v26;
        end;
    end;
    return l_NOT_SET_0;
end;
local function _()
    for v28 = v2.FIRST, v2.LAST do
        v10[v28] = false;
    end;
end;
local function v38()
    if not v17 then
        error("Could not create the rotation handles because the parent was nil.");
    end;
    local v30 = {
        [v2.E] = Vector2.new(0, 0.5),
        [v2.SE] = Vector2.new(0, 0),
        [v2.S] = Vector2.new(0.5, 0),
        [v2.SW] = Vector2.new(1, 0),
        [v2.W] = Vector2.new(1, 0.5),
        [v2.NW] = Vector2.new(1, 1),
        [v2.N] = Vector2.new(0.5, 1),
        [v2.NE] = Vector2.new(0, 1)
    };
    local v31 = {
        [v2.E] = UDim2.new(1, 0, 0.5, 0),
        [v2.SE] = UDim2.new(1, 0, 1, 0),
        [v2.S] = UDim2.new(0.5, 0, 1, 0),
        [v2.SW] = UDim2.new(0, 0, 1, 0),
        [v2.W] = UDim2.new(0, 0, 0.5, 0),
        [v2.NW] = UDim2.new(0, 0, 0, 0),
        [v2.N] = UDim2.new(0.5, 0, 0, 0),
        [v2.NE] = UDim2.new(1, 0, 0, 0)
    };
    for v32 = v2.FIRST, v2.LAST do
        local l_Frame_0 = Instance.new("Frame");
        l_Frame_0.Name = "RotationHandle_" .. v2:toShortName(v32);
        l_Frame_0.AnchorPoint = v30[v32];
        l_Frame_0.Size = UDim2.new(0, 20, 0, 20);
        l_Frame_0.Position = v31[v32];
        l_Frame_0.BackgroundColor3 = Color3.new(0, 255, 0);
        l_Frame_0.BackgroundTransparency = 1;
        l_Frame_0.BorderSizePixel = 0;
        l_Frame_0.MouseEnter:connect(function(_, _)
            v10[v32] = true;
        end);
        l_Frame_0.MouseLeave:connect(function(_, _)
            v10[v32] = false;
        end);
        l_Frame_0.Parent = v17;
        v18[v32] = l_Frame_0;
    end;
end;
local function _()
    v19();
    v38();
end;
v0.getRotation = function(_)
    if v8 then
        return v8.AbsoluteRotation;
    else
        return 0;
    end;
end;
v0.updateMouseIcon = function(_)
    if not v11 then
        local l_NOT_SET_1 = v2.NOT_SET;
        for v43 = v2.FIRST, v2.LAST do
            if v10[v43] then
                l_NOT_SET_1 = v43;
                break;
            end;
        end;
        local l_l_NOT_SET_1_0 = l_NOT_SET_1;
        if l_l_NOT_SET_1_0 ~= v2.NOT_SET then
            v3:setToRotateIcon((v3:calcMouseIconDirection(l_l_NOT_SET_1_0, v8.AbsoluteRotation)));
        end;
        return ;
    else
        return ;
    end;
end;
v0.isOverAHandle = function(_)
    local l_NOT_SET_2 = v2.NOT_SET;
    for v47 = v2.FIRST, v2.LAST do
        if v10[v47] then
            l_NOT_SET_2 = v47;
            break;
        end;
    end;
    return l_NOT_SET_2 ~= v2.NOT_SET;
end;
local function _(v48)
    return Vector2.new(v48.AbsolutePosition.X + math.floor(v48.AbsoluteSize.X / 2), v48.AbsolutePosition.Y + math.floor(v48.AbsoluteSize.Y / 2));
end;
v0.onMouseDown = function(_, v51)
    if v8 then
        local l_NOT_SET_3 = v2.NOT_SET;
        for v53 = v2.FIRST, v2.LAST do
            if v10[v53] then
                l_NOT_SET_3 = v53;
                break;
            end;
        end;
        if v2:isValid(l_NOT_SET_3) then
            v11 = true;
            v12 = v8.Rotation;
            v13 = v8.Rotation;
            local l_v8_0 = v8;
            v15 = Vector2.new(l_v8_0.AbsolutePosition.X + math.floor(l_v8_0.AbsoluteSize.X / 2), l_v8_0.AbsolutePosition.Y + math.floor(l_v8_0.AbsoluteSize.Y / 2));
            v14 = 0;
            v16 = v51 - v15;
            v7:onRotateBegan(v51);
            return ;
        else
            return ;
        end;
    else
        return ;
    end;
end;
local function _(v55)
    return (math.floor(v55 + 0.5));
end;
local function _(v57)
    if v57 >= 0 then
        return v57 % 360;
    else
        return -(-v57 % 360);
    end;
end;
v0.onMouseMove = function(_, v60)
    if v11 then
        local v61 = v60 - v15;
        v14 = v14 + math.deg((v5:angleVector2(v16, v61)));
        local v62 = math.floor((v13 + v14) + 0.5);
        v8.Rotation = if v62 >= 0 then v62 % 360 else -(-v62 % 360);
        v16 = v61;
        if math.abs(v14) > 90 then
            v13 = v8.Rotation;
            v14 = 0;
        end;
        v0:update();
        v7:onRotateChanged(v60);
        return ;
    else
        return ;
    end;
end;
v0.onMouseUp = function(_, v64)
    if v11 then
        if v8.Rotation ~= v12 then
            l_ChangeHistoryService_0:SetWaypoint("Rotate object");
        end;
        v11 = false;
        v15 = nil;
        v16 = nil;
        v0:update();
        v7:onRotateEnded(v64);
        return ;
    else
        return ;
    end;
end;
v0.isRotating = function(_)
    return v11;
end;
v0.update = function(_)
    if v8 then
        v17.AnchorPoint = v8.AnchorPoint;
        local l_AbsolutePosition_0 = v8.AbsolutePosition;
        v17.Position = UDim2.new(0, l_AbsolutePosition_0.X, 0, l_AbsolutePosition_0.Y);
        local l_AbsoluteSize_0 = v8.AbsoluteSize;
        v17.Size = UDim2.new(0, l_AbsoluteSize_0.X, 0, l_AbsoluteSize_0.Y);
        v17.Rotation = v8.AbsoluteRotation;
        return ;
    else
        return ;
    end;
end;
v0.onSelectionChanged = function(_)
    local v70 = v4:getFilteredSelection();
    if #v70 == 1 then
        v8 = v70[1];
        v0:update();
        v17.Visible = true;
        return ;
    else
        v8 = nil;
        v17.Visible = false;
        return ;
    end;
end;
v0.On = function(_)
    v19();
    v38();
    for v72 = v2.FIRST, v2.LAST do
        v10[v72] = false;
    end;
    v11 = false;
    v0:update();
end;
v0.Off = function(_)
    if v17 then
        v17:Destroy();
    end;
    v11 = false;
end;
v0.setActionMediator = function(_, v75)
    v7 = v75;
end;
return v0;


return {
    rotateVector = function(_, v1, v2)
        local v3 = math.rad(v1);
        local v4 = math.cos(v3);
        local v5 = math.sin(v3);
        return (Vector2.new(v2.X * v4 - v2.Y * v5, v2.Y * v4 + v2.X * v5));
    end
};


local v0 = {};
local v1 = require(script.Parent.ValueBox);
local v2 = Vector2.new(4, 20);
local v3 = nil;
v0.update = function(_, v5, v6)
    local v7 = v5 + v2;
    v3:setPosition(UDim2.new(0, v7.X, 0, v7.Y));
    v3:setText((string.format("%d\194\176", v6)));
end;
v0.setVisible = function(_, v9)
    v3:setVisible(v9);
end;
v0.On = function(_)
    v3 = v1.new();
end;
v0.Off = function(_)
    v3:Destroy();
    v3 = nil;
end;
return v0;


local _ = require(script.Parent.FFlag);
local v1 = require(script.Parent.CoreGuiManager);
local v2 = nil;
local v3 = false;
local v4 = nil;
local v5 = nil;
local v6 = nil;
local v7 = {};
local v8 = Color3.new(0.7019, 0.7019, 0.7019);
local function _(v9, v10, v11)
    local v12 = Instance.new("Frame", v9);
    v12.BorderSizePixel = v10;
    v12.BackgroundColor3 = v11;
    return v12;
end;
local function v18()
    v6 = Instance.new("ScreenGui", v1:findOrCreateFolder("Rubberband"));
    local l_v7_0 = v7;
    local l_v6_0 = v6;
    local l_v8_0 = v8;
    local v17 = Instance.new("Frame", l_v6_0);
    v17.BorderSizePixel = 0;
    v17.BackgroundColor3 = l_v8_0;
    l_v7_0[1] = v17;
    l_v7_0 = v7;
    l_v6_0 = v6;
    l_v8_0 = v8;
    v17 = Instance.new("Frame", l_v6_0);
    v17.BorderSizePixel = 0;
    v17.BackgroundColor3 = l_v8_0;
    l_v7_0[2] = v17;
    l_v7_0 = v7;
    l_v6_0 = v6;
    l_v8_0 = v8;
    v17 = Instance.new("Frame", l_v6_0);
    v17.BorderSizePixel = 0;
    v17.BackgroundColor3 = l_v8_0;
    l_v7_0[3] = v17;
    l_v7_0 = v7;
    l_v6_0 = v6;
    l_v8_0 = v8;
    v17 = Instance.new("Frame", l_v6_0);
    v17.BorderSizePixel = 0;
    v17.BackgroundColor3 = l_v8_0;
    l_v7_0[4] = v17;
end;
return {
    startRubberbandDrag = function(_, v20)
        v3 = true;
        v4 = v20;
        v5 = v20;
        if not v6 then
            v18();
        end;
        v2:onRubberbandBegan(v20);
    end,
    updateRubberband = function(_, v22)
        if v3 then
            v5 = v22;
            local v23 = v5 - v4;
            v7[1].Size = UDim2.new(0, 1, 0, v23.Y + 1);
            v7[2].Size = UDim2.new(0, 1, 0, v23.Y + 1);
            v7[3].Size = UDim2.new(0, v23.X + 1, 0, 1);
            v7[4].Size = UDim2.new(0, v23.X + 1, 0, 1);
            v7[1].Position = UDim2.new(0, v4.X, 0, v4.Y);
            v7[2].Position = UDim2.new(0, v4.X + v23.X, 0, v4.Y);
            v7[3].Position = UDim2.new(0, v4.X, 0, v4.Y);
            v7[4].Position = UDim2.new(0, v4.X, 0, v4.Y + v23.Y);
            return ;
        else
            return ;
        end;
    end,
    finishRubberbandDrag = function(_)
        if v3 then
            v3 = false;
            v4 = nil;
            if v6 then
                v6:Destroy();
                v6 = nil;
                v7 = {};
            end;
            v2:onRubberbandEnded();
            return ;
        else
            return ;
        end;
    end,
    isDragInProgress = function(_)
        return v3;
    end,
    getBounds = function(_)
        return v4, v5;
    end,
    setActionMediator = function(_, v28)
        v2 = v28;
    end
};


local v0 = require(script.Parent.Utility);
local v1 = require(script.Parent.SelectionManager);
local v2 = require(script.Parent.InstanceInfo);
local v3 = require(script.Parent.Analytics);
local l_StarterGui_0 = game:GetService("StarterGui");
local l_UserInputService_0 = game:GetService("UserInputService");
local v6 = game:DefineFastFlag("SelectRotatedGuiObjects", false);
local v7 = game:DefineFastFlag("UIEditorFixSelectionZIndexOrdering", false);
local v8 = game:DefineFastFlag("UIEditorFixDisplayOrderAndTransparencySelection", false);
local v9 = {};
local v10 = {};
local v11 = nil;
local function v18(v12)
    if v12.AbsoluteRotation ~= 0 then
        return v12.AbsolutePosition, v12.AbsoluteSize;
    else
        local l_AbsolutePosition_0 = v12.AbsolutePosition;
        local v14 = v12.AbsoluteSize + l_AbsolutePosition_0;
        local l_v12_FirstAncestorWhichIsA_0 = v12:FindFirstAncestorWhichIsA("GuiObject");
        while l_v12_FirstAncestorWhichIsA_0 do
            if l_v12_FirstAncestorWhichIsA_0.ClipsDescendants then
                local l_AbsolutePosition_1 = l_v12_FirstAncestorWhichIsA_0.AbsolutePosition;
                local v17 = l_v12_FirstAncestorWhichIsA_0.AbsoluteSize + l_AbsolutePosition_1;
                l_AbsolutePosition_0 = Vector2.new(math.max(l_AbsolutePosition_0.X, l_AbsolutePosition_1.X), (math.max(l_AbsolutePosition_0.Y, l_AbsolutePosition_1.Y)));
                v14 = Vector2.new(math.min(v14.X, v17.X), (math.min(v14.Y, v17.Y)));
            end;
            l_v12_FirstAncestorWhichIsA_0 = l_v12_FirstAncestorWhichIsA_0:FindFirstAncestorWhichIsA("GuiObject");
        end;
        return l_AbsolutePosition_0, v14 - l_AbsolutePosition_0;
    end;
end;
local function v26(v19, v20)
    if v20 and v20:IsA("GuiBase2d") then
        local v21, v22 = v18(v20);
        local l_v22_0 = v22;
        l_v22_0 = Vector2.new(math.max(5, l_v22_0.X), (math.max(5, l_v22_0.Y)));
        local v24 = (v21 + v22 * 0.5) - l_v22_0 * 0.5;
        local v25 = false;
        if v24.x <= v19.x then
            v25 = false;
            if v19.x <= v24.x + l_v22_0.x then
                v25 = false;
                if v24.y <= v19.y then
                    v25 = v19.y <= v24.y + l_v22_0.y;
                end;
            end;
        end;
        return v25;
    else
        return false;
    end;
end;
local function v27(v28)
    local v29 = {};
    if not v6 then
        local l_v28_Children_0 = v28:GetChildren();
        for v31 = 1, #l_v28_Children_0 do
            if not (not l_v28_Children_0[v31]:IsA("GuiBase2d") and not l_v28_Children_0[v31]:IsA("Folder")) then
                local v32 = v27(l_v28_Children_0[v31]);
                if v2:isVisible(l_v28_Children_0[v31]) then
                    table.insert(v29, l_v28_Children_0[v31]);
                end;
                for v33 = 1, #v32 do
                    table.insert(v29, v32[v33]);
                end;
            end;
        end;
        return v29;
    else
        for _, v35 in (v28:GetDescendants()), nil, nil do
            if not (not v35:IsA("GuiBase2d") and not v35:IsA("Folder") or not v2:isVisible(v35)) then
                table.insert(v29, v35);
            end;
        end;
        return v29;
    end;
end;
local function v42(v36)
    local v37 = v27(v36);
    local v38 = {};
    for v39 = 1, #v37 do
        v38[v37[v39]] = v39;
    end;
    table.sort(v37, function(v40, v41)
        if v40.ZIndex == v41.ZIndex then
            return v38[v40] < v38[v41];
        else
            return v40.ZIndex < v41.ZIndex;
        end;
    end);
    return v37;
end;
local function v47()
    local l_Children_0 = game:GetService("StarterGui"):GetChildren();
    v9 = {};
    for v44 = 1, #l_Children_0 do
        if not (not l_Children_0[v44]:IsA("ScreenGui") and not l_Children_0[v44]:IsA("Folder")) then
            local v45 = v42(l_Children_0[v44]);
            for v46 = 1, #v45 do
                table.insert(v9, v45[v46]);
                v10[v45[v46]] = #v9;
            end;
        end;
    end;
end;
local function v55(v48)
    local v49 = {};
    if not v6 then
        for v50 = #v9, 1, -1 do
            if v26(v48, v9[v50]) then
                table.insert(v49, v9[v50]);
            end;
        end;
    else
        if not v8 then
            v49 = l_StarterGui_0:GetGuiObjectsAtPosition(v48.X, v48.Y);
        else
            local l_l_StarterGui_0_GuiObjectsAtPosition_0 = l_StarterGui_0:GetGuiObjectsAtPosition(v48.X, v48.Y);
            for v52 = 1, #l_l_StarterGui_0_GuiObjectsAtPosition_0 do
                if v2:isVisible(l_l_StarterGui_0_GuiObjectsAtPosition_0[v52]) then
                    table.insert(v49, l_l_StarterGui_0_GuiObjectsAtPosition_0[v52]);
                end;
            end;
        end;
        if not v7 then
            table.sort(v49, function(v53, v54)
                return v53.ZIndex < v54.ZIndex;
            end);
            return v49;
        end;
    end;
    return v49;
end;
local function v60(v56)
    v47();
    local v57 = v55(v56);
    local v58 = v57[1];
    if not (not l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftAlt) and not l_UserInputService_0:IsKeyDown(Enum.KeyCode.RightAlt)) then
        local v59 = v0:findItemInTable(v11, v57);
        if v59 ~= 0 and v59 ~= #v57 then
            v58 = v57[v59 + 1];
        end;
    end;
    return v58;
end;
local function _(v61, v62)
    local v63 = v0:findItemInTable(v61, v62);
    if v63 > 0 then
        table.remove(v62, v63);
        return false;
    else
        table.insert(v62, v61);
        return true;
    end;
end;
return {
    getGuiObjects = function(_)
        local v66 = {};
        for v67, v68 in ipairs(v9) do
            v66[v67] = v68;
        end;
        return v66;
    end,
    getGuiObjectsAtPoint = function(_, v70)
        return (v55(v70));
    end,
    refreshPaintOrder = function(_)
        v47();
    end,
    selectTopLevelItemAtPoint = function(_, v73)
        local v74 = v60(v73);
        local v75 = {
            unpack((v1:getRawSelection()))
        };
        local v76 = false;
        if not v74 then
            if not l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftShift) and not l_UserInputService_0:IsKeyDown(Enum.KeyCode.RightShift) then
                if v0:findItemInTable(v74, v75) == 0 then
                    v75 = {
                        v74
                    };
                end;
            else
                return nil;
            end;
        elseif not ((l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftControl) or l_UserInputService_0:IsKeyDown(Enum.KeyCode.RightControl)) or l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftShift)) and not l_UserInputService_0:IsKeyDown(Enum.KeyCode.RightShift) then
            if v0:findItemInTable(v74, v75) == 0 then
                v75 = {
                    v74
                };
            end;
        else
            local l_v75_0 = v75;
            local v78 = v0:findItemInTable(v74, l_v75_0);
            local v79;
            if v78 > 0 then
                table.remove(l_v75_0, v78);
                v79 = false;
            else
                table.insert(l_v75_0, v74);
                v79 = true;
            end;
            if not v79 then
                v3:reportEvent("RemoveFromSelection");
            else
                v3:reportEvent("AddToSelection");
            end;
            v76 = true;
        end;
        v11 = v74;
        if not (not v1:setSelection(v75) or v76) then
            if not v1:hasFilteredSelection() then
                v3:reportEvent("Deselect");
            else
                v3:reportEvent("Select");
            end;
        end;
        return v11;
    end,
    selectAllObjectsInBounds = function(_, v81, v82)
        local v83 = Vector2.new(math.min(v81.X, v82.X), (math.min(v81.Y, v82.Y)));
        local v84 = Vector2.new(math.max(v81.X, v82.X), (math.max(v81.Y, v82.Y)));
        local v85 = {};
        for v86 = 1, #v9 do
            if ((v83.X <= v9[v86].AbsolutePosition.X and v83.Y <= v9[v86].AbsolutePosition.Y) and v9[v86].AbsolutePosition.X + v9[v86].AbsoluteSize.X <= v84.X) and v9[v86].AbsolutePosition.Y + v9[v86].AbsoluteSize.Y <= v84.Y then
                table.insert(v85, v9[v86]);
            end;
        end;
        v1:setSelection(v85);
    end,
    toggleSelectionOfAllObjectsInBounds = function(_, v88, v89, v90)
        local v91 = Vector2.new(math.min(v89.X, v90.X), (math.min(v89.Y, v90.Y)));
        local v92 = Vector2.new(math.max(v89.X, v90.X), (math.max(v89.Y, v90.Y)));
        local v93 = {};
        for v94 = 1, #v9 do
            if ((v91.X <= v9[v94].AbsolutePosition.X and v91.Y <= v9[v94].AbsolutePosition.Y) and v9[v94].AbsolutePosition.X + v9[v94].AbsoluteSize.X <= v92.X) and v9[v94].AbsolutePosition.Y + v9[v94].AbsoluteSize.Y <= v92.Y then
                table.insert(v93, v9[v94]);
            end;
        end;
        for v95 = 1, #v88 do
            local v96 = v0:findItemInTable(v88[v95], v93);
            if v96 ~= 0 then
                table.remove(v93, v96);
            else
                table.insert(v93, v88[v95]);
            end;
        end;
        v1:setSelection(v93);
    end
};


local _ = require(script.Parent.FFlag);
local v1 = require(script.Parent.Utility);
local l_Selection_0 = game:GetService("Selection");
local v3 = {};
local v4 = {};
local v5 = {};
local v6 = {};
local v7 = {};
local v8 = 0;
local v9 = {};
local v10 = false;
local _ = function(v11, v12)
    for _, v14 in pairs(v7) do
        v14(v11, v12);
    end;
end;
local function _()
    for v16 = 1, #v4 do
        v6[v4[v16]]:disconnect();
    end;
end;
local function v23()
    for v18 = 1, #v4 do
        v6[v4[v18]] = v4[v18].Changed:connect(function(v19)
            local v20 = v4[v18];
            for _, v22 in pairs(v7) do
                v22(v20, v19);
            end;
        end);
    end;
end;
local function v24(v25, v26)
    if v25 and v25:IsA("GuiBase2d") then
        if v1:findItemInTable(v25, v26) ~= 0 then
            return true;
        else
            return v24(v25.Parent, v26);
        end;
    else
        return false;
    end;
end;
local v35 = {
    connectSelectionInstancesChanged = function(_, v28)
        v8 = v8 + 1;
        v7[v8] = v28;
        return v8;
    end,
    disconnectSelectionInstancesChanged = function(_, v30)
        if v30 then
            v7[v30] = nil;
            return nil;
        else
            return nil;
        end;
    end,
    connectFilteredSelectionChanged = function(_, v32)
        table.insert(v9, v32);
    end,
    disconnectFilteredSelectionChanged = function(_, v34)
        assert(v1:removeItemFromTable(v34, v9), "Could not remove listener from listeners");
    end
};
local _ = function()
    for _, v37 in ipairs(v9) do
        v37:onSelectionChanged();
    end;
end;
local function v40(v39)
    if not game:GetEngineFeature("UIDragDetector") then
        if not game:GetFastFlag("UIEditorAvoidEditingPath2D") then
            return v39:isA("GuiObject") or v39:isA("UIComponent");
        else
            return (v39:isA("GuiObject") or v39:isA("UIComponent")) and not v39:isA("Path2D");
        end;
    elseif not game:GetFastFlag("UIEditorAvoidEditingPath2D") then
        return (v39:IsA("GuiObject") or v39:IsA("UIComponent")) and not v39:IsA("UIDragDetector");
    else
        return ((v39:IsA("GuiObject") or v39:IsA("UIComponent")) and not v39:IsA("Path2D")) and not v39:IsA("UIDragDetector");
    end;
end;
local function v44(v41)
    if v40(v41) then
        local v42 = false;
        local l_Parent_0 = v41.Parent;
        while l_Parent_0 ~= nil do
            if l_Parent_0 == game:GetService("StarterGui") then
                return true;
            elseif not l_Parent_0:isA("GuiBase2d") and not l_Parent_0:isA("Folder") then
                break;
            else
                l_Parent_0 = l_Parent_0.Parent;
            end;
        end;
        return v42;
    else
        return false;
    end;
end;
local function _(v45)
    return v45:FindFirstAncestorOfClass("ScreenGui") ~= nil;
end;
v35.passesGuiFilter = function(_, v48)
    return v44(v48) and v48:FindFirstAncestorOfClass("ScreenGui") ~= nil;
end;
v35.onDescendantAddedToStarterGui = function(_, v50)
    if not (not v35:passesGuiFilter(v50) or not v50:isA("GuiObject")) then
        v35:onSelectionChanged();
    end;
end;
v35.onParentChanged = function(_, _)
    v35:onSelectionChanged();
end;
v35.onSelectionChanged = function(_)
    for v54 = 1, #v4 do
        v6[v4[v54]]:disconnect();
    end;
    local v55 = l_Selection_0:Get();
    v3 = v55;
    v4 = {};
    v5 = {};
    for v56 = 1, #v3 do
        local v57 = v3[v56];
        if not (not v35:passesGuiFilter(v57) or not v57:isA("GuiObject")) then
            table.insert(v4, v57);
        end;
    end;
    for v58 = 1, #v4 do
        local l_Parent_1 = v55[v58].Parent;
        if not (not not l_Parent_1 and if l_Parent_1:IsA("GuiBase2d") then v1:findItemInTable(l_Parent_1, v55) ~= 0 and true or v24(l_Parent_1.Parent, v55) else false) then
            table.insert(v5, v4[v58]);
        end;
    end;
    v23();
    if not v10 then
        for _, v61 in ipairs(v9) do
            v61:onSelectionChanged();
        end;
    end;
end;
v35.getRawSelection = function(_)
    return {
        unpack(v3)
    };
end;
v35.getFilteredSelection = function(_)
    return {
        unpack(v4)
    };
end;
v35.getFilteredSelectionCommonAncestors = function(_)
    return {
        unpack(v5)
    };
end;
v35.hasSelection = function(_)
    return #v3 ~= 0;
end;
v35.hasFilteredSelection = function(_)
    return #v4 ~= 0;
end;
v35.setSelection = function(_, v68)
    if not v1:tablesAreEquivalent(v3, v68) then
        l_Selection_0:Set(v68);
        return true;
    else
        return false;
    end;
end;
v35.setSuppressFilteredSelectionChanged = function(_, v70)
    if v10 == v70 then
        return ;
    else
        v10 = v70;
        if not v70 then
            for _, v72 in ipairs(v9) do
                v72:onSelectionChanged();
            end;
        end;
        return ;
    end;
end;
return v35;


local l_HttpService_0 = game:GetService("HttpService");
local function _(v1)
    return l_HttpService_0:JSONEncode(v1);
end;
return {
    new = function()
        local v3 = {
            map = {},
            mt = {}
        };
        v3.mt.__index = function(v4, v5)
            if v5 == "insert" then
                return function(v6)
                    local l_v6_0 = v6;
                    if type(l_v6_0) == "table" then
                        l_v6_0 = l_HttpService_0:JSONEncode(l_v6_0);
                    end;
                    if not v4.map[l_v6_0] then
                        table.insert(v4, v6);
                        v4.map[l_v6_0] = #v4;
                    end;
                end;
            elseif v5 == "remove" then
                return function(v8)
                    local l_v8_0 = v8;
                    if type(l_v8_0) == "table" then
                        l_v8_0 = l_HttpService_0:JSONEncode(l_v8_0);
                    end;
                    if v4.map[l_v8_0] then
                        local v10 = v4.map[l_v8_0];
                        table.remove(v3, v10);
                        for v11 = v10, #v4 do
                            l_v8_0 = v4[v11];
                            if type(l_v8_0) == "table" then
                                l_v8_0 = l_HttpService_0:JSONEncode(l_v8_0);
                            end;
                            v4.map[l_v8_0] = v11;
                        end;
                    end;
                end;
            elseif v5 == "exists" then
                return function(v12)
                    local l_v12_0 = v12;
                    if type(l_v12_0) == "table" then
                        l_v12_0 = l_HttpService_0:JSONEncode(l_v12_0);
                    end;
                    return v4.map[l_v12_0] ~= nil;
                end;
            elseif v5 == "clear" then
                return function()
                    while #v4 > 0 do
                        local v14 = v4[1];
                        if type(v14) == "table" then
                            v14 = l_HttpService_0:JSONEncode(v14);
                        end;
                        v4.map[v14] = nil;
                        table.remove(v4, 1);
                    end;
                end;
            else
                return ;
            end;
        end;
        setmetatable(v3, v3.mt);
        return v3;
    end
};


local v0 = {};
local v1 = require(script.Parent.SelectionManager);
local v2 = require(script.Parent.ValueBox);
local v3 = nil;
local v4 = nil;
local v5 = Vector2.new(2, 6);
local function v9(v6)
    local l_AbsoluteSize_0 = v6.AbsoluteSize;
    local l_AbsolutePosition_0 = v6.AbsolutePosition;
    return UDim2.new(0, math.max(((l_AbsolutePosition_0.X + l_AbsoluteSize_0.X) - v4:getSize().X.Offset) - v5.X, l_AbsolutePosition_0.X + v5.X), 0, (l_AbsolutePosition_0.Y + l_AbsoluteSize_0.Y) + v5.Y);
end;
v0.update = function(_)
    if v3 then
        local l_AbsoluteSize_1 = v3.AbsoluteSize;
        v4:setText((("%d x %d"):format(l_AbsoluteSize_1.X, l_AbsoluteSize_1.Y)));
        v0:updatePosition();
        return ;
    else
        return ;
    end;
end;
v0.setVisible = function(_, v13)
    if v3 then
        v4:setVisible(v13);
        return ;
    else
        return ;
    end;
end;
v0.onSelectionChanged = function(_)
    local v15 = v1:getFilteredSelection();
    if #v15 == 1 then
        v3 = v15[1];
        v0:update();
        v0:setVisible(true);
        return ;
    else
        v0:setVisible(false);
        v3 = nil;
        return ;
    end;
end;
v0.updatePosition = function(_)
    if v3 then
        v4:setPosition((v9(v3)));
        return ;
    else
        return ;
    end;
end;
v0.On = function(_)
    v4 = v2.new();
end;
v0.Off = function(_)
    v3 = nil;
    v4:Destroy();
    v4 = nil;
end;
return v0;


local v0 = require(script.Parent.Extents2D);
local _ = require(script.Parent.FFlag);
local v2 = require(script.Parent.GlobalValues);
local v3 = require(script.Parent.InstanceInfo);
local v4 = require(script.Parent.Select);
local v5 = require(script.Parent.SelectionManager);
local _ = require(script.Parent.Set);
local v7 = require(script.Parent.Utility);
local v8 = require(script.Parent.Enum.SnappingType);
local v9 = {};
local v10 = {};
local v11 = 1;
local function _(v12, v13, v14)
    local v15 = nil;
    local v16 = 9000000000;
    for v17 = 1, #v14 do
        if v14[v17][2] == v13 then
            local v18 = math.abs(v12 - v14[v17][1]);
            if v18 < v16 then
                v16 = v18;
                v15 = v14[v17][1];
            else
                break;
            end;
        end;
    end;
    return v15;
end;
local function v20(v21, v22, v23)
    if v23[v21] ~= nil then
        return ;
    else
        v23[v21] = true;
        while not not v7:removeItemFromTable(v21, v22) do
        end;
        local l_v21_Children_0 = v21:GetChildren();
        for v25 = 1, #l_v21_Children_0 do
            v20(l_v21_Children_0[v25], v22, v23);
        end;
        return ;
    end;
end;
local v33 = {
    generateSnappingLines = function(_)
        v9 = {};
        v10 = {};
        local v27 = v5:getFilteredSelection();
        if #v27 == 0 then
            return ;
        else
            local v28 = v4:getGuiObjects();
            if #v28 > 0 then
                local v29 = {};
                for v30 = 1, #v27 do
                    v20(v27[v30], v28, v29);
                end;
                for v31 = 1, #v28 do
                    local v32 = v0:getExtentsFromGui(v28[v31]);
                    table.insert(v9, v32);
                    v10[v32] = v28[v31];
                end;
            end;
            table.insert(v9, v0.new(Vector2.new(0, 0), v2:getScreenSize()));
            return ;
        end;
    end
};
local v34 = Color3.new(1, 0.03137254901960784, 0.403921568627451);
local v35 = Color3.new(0, 1, 0);
v33.snapExtents = function(_, v37, v38)
    v37 = v7:cloneTable(v37);
    local v39 = {};
    local v40 = false;
    local v41 = false;
    local v42 = nil;
    local v43 = nil;
    local v44 = {};
    local function _()
        v42 = v11 + 1;
        v43 = 0;
        v44 = {};
    end;
    local function v53(v46, v47, v48, v49, v50)
        local v51 = v7:distance(v46, v47);
        local v52 = v47 - v46;
        if v51 < v42 then
            v44 = {};
            v42 = v51;
            v43 = v52;
            table.insert(v44, {
                v48,
                v49,
                v50
            });
            return ;
        else
            if v51 == v42 and v52 == v43 then
                table.insert(v44, {
                    v48,
                    v49,
                    v50
                });
            end;
            return ;
        end;
    end;
    if #v10 > 0 then
        local v54 = v5:getFilteredSelection();
        local function v57(v55)
            if not v3:canSeeThrough(v55) then
                for v56 = 1, #v54 do
                    if v55 == v54[v56] then
                        return true;
                    end;
                end;
                return false;
            else
                return true;
            end;
        end;
        for v58 = 1, #v9 do
            local v59 = v10[v9[v58]];
            if v59 ~= nil then
                v9[v58]:refreshVisibility(v59, v57);
            end;
        end;
        v10 = {};
    end;
    if v8:containsType(v38, v8.MoveX) then
        v42 = v11 + 1;
        v43 = 0;
        v44 = {};
        for v60 = 1, #v9 do
            if v9[v60].LeftVisible then
                v53(v37.Left, v9[v60].Left, Vector2.new(v9[v60].Left, math.min(v37.Top, v9[v60].Top) - 10), Vector2.new(v9[v60].Left, math.max(v37.Bottom, v9[v60].Bottom) + 10), v34);
                v53(v37.Right, v9[v60].Left, Vector2.new(v9[v60].Left, math.min(v37.Top, v9[v60].Top) - 10), Vector2.new(v9[v60].Left, math.max(v37.Bottom, v9[v60].Bottom) + 10), v34);
            end;
            if v9[v60].RightVisible then
                v53(v37.Left, v9[v60].Right, Vector2.new(v9[v60].Right, math.min(v37.Top, v9[v60].Top) - 10), Vector2.new(v9[v60].Right, math.max(v37.Bottom, v9[v60].Bottom) + 10), v34);
                v53(v37.Right, v9[v60].Right, Vector2.new(v9[v60].Right, math.min(v37.Top, v9[v60].Top) - 10), Vector2.new(v9[v60].Right, math.max(v37.Bottom, v9[v60].Bottom) + 10), v34);
            end;
            if v9[v60].CenterVisible then
                v53(v37.Center.X, v9[v60].Center.X, Vector2.new(v9[v60].Center.X, math.min(v37.Top, v9[v60].Top) - 10), Vector2.new(v9[v60].Center.X, math.max(v37.Bottom, v9[v60].Bottom) + 10), v35);
            end;
        end;
        v40 = v43 ~= 0;
        v37 = v0:translate(v37, Vector2.new(v43, 0));
        v39 = v7:joinTables(v39, v44);
    end;
    if v8:containsType(v38, v8.MoveY) then
        v42 = v11 + 1;
        v43 = 0;
        v44 = {};
        for v61 = 1, #v9 do
            if v9[v61].TopVisible then
                v53(v37.Top, v9[v61].Top, Vector2.new(math.min(v37.Left, v9[v61].Left) - 10, v9[v61].Top), Vector2.new(math.max(v37.Right, v9[v61].Right) + 10, v9[v61].Top), v34);
                v53(v37.Bottom, v9[v61].Top, Vector2.new(math.min(v37.Left, v9[v61].Left) - 10, v9[v61].Top), Vector2.new(math.max(v37.Right, v9[v61].Right) + 10, v9[v61].Top), v34);
            end;
            if v9[v61].BottomVisible then
                v53(v37.Top, v9[v61].Bottom, Vector2.new(math.min(v37.Left, v9[v61].Left) - 10, v9[v61].Bottom), Vector2.new(math.max(v37.Right, v9[v61].Right) + 10, v9[v61].Bottom), v34);
                v53(v37.Bottom, v9[v61].Bottom, Vector2.new(math.min(v37.Left, v9[v61].Left) - 10, v9[v61].Bottom), Vector2.new(math.max(v37.Right, v9[v61].Right) + 10, v9[v61].Bottom), v34);
            end;
            if v9[v61].CenterVisible then
                v53(v37.Center.Y, v9[v61].Center.Y, Vector2.new(math.min(v37.Left, v9[v61].Left) - 10, v9[v61].Center.Y), Vector2.new(math.max(v37.Right, v9[v61].Right) + 10, v9[v61].Center.Y), v35);
            end;
        end;
        v41 = v43 ~= 0;
        v37 = v0:translate(v37, Vector2.new(0, v43));
        v39 = v7:joinTables(v39, v44);
    end;
    if v8:containsType(v38, v8.ResizeXp) then
        v42 = v11 + 1;
        v43 = 0;
        v44 = {};
        for v62 = 1, #v9 do
            if v9[v62].LeftVisible then
                v53(v37.Right, v9[v62].Left, Vector2.new(v9[v62].Left, math.min(v37.Top, v9[v62].Top) - 10), Vector2.new(v9[v62].Left, math.max(v37.Bottom, v9[v62].Bottom) + 10), v34);
            end;
            if v9[v62].RightVisible then
                v53(v37.Right, v9[v62].Right, Vector2.new(v9[v62].Right, math.min(v37.Top, v9[v62].Top) - 10), Vector2.new(v9[v62].Right, math.max(v37.Bottom, v9[v62].Bottom) + 10), v34);
            end;
        end;
        v40 = v43 ~= 0;
        v37.Right = v37.Right + v43;
        v39 = v7:joinTables(v39, v44);
    end;
    if v8:containsType(v38, v8.ResizeXn) then
        v42 = v11 + 1;
        v43 = 0;
        v44 = {};
        for v63 = 1, #v9 do
            if v9[v63].LeftVisible then
                v53(v37.Left, v9[v63].Left, Vector2.new(v9[v63].Left, math.min(v37.Top, v9[v63].Top) - 10), Vector2.new(v9[v63].Left, math.max(v37.Bottom, v9[v63].Bottom) + 10), v34);
            end;
            if v9[v63].RightVisible then
                v53(v37.Left, v9[v63].Right, Vector2.new(v9[v63].Right, math.min(v37.Top, v9[v63].Top) - 10), Vector2.new(v9[v63].Right, math.max(v37.Bottom, v9[v63].Bottom) + 10), v34);
            end;
        end;
        v40 = v43 ~= 0;
        v37.Left = v37.Left + v43;
        v39 = v7:joinTables(v39, v44);
    end;
    if v8:containsType(v38, v8.ResizeYp) then
        v42 = v11 + 1;
        v43 = 0;
        v44 = {};
        for v64 = 1, #v9 do
            if v9[v64].TopVisible then
                v53(v37.Bottom, v9[v64].Top, Vector2.new(math.min(v37.Left, v9[v64].Left) - 10, v9[v64].Top), Vector2.new(math.max(v37.Right, v9[v64].Right) + 10, v9[v64].Top), v34);
            end;
            if v9[v64].BottomVisible then
                v53(v37.Bottom, v9[v64].Bottom, Vector2.new(math.min(v37.Left, v9[v64].Left) - 10, v9[v64].Bottom), Vector2.new(math.max(v37.Right, v9[v64].Right) + 10, v9[v64].Bottom), v34);
            end;
        end;
        v41 = v43 ~= 0;
        v37.Bottom = v37.Bottom + v43;
        v39 = v7:joinTables(v39, v44);
    end;
    if v8:containsType(v38, v8.ResizeYn) then
        v42 = v11 + 1;
        v43 = 0;
        v44 = {};
        for v65 = 1, #v9 do
            if v9[v65].TopVisible then
                v53(v37.Top, v9[v65].Top, Vector2.new(math.min(v37.Left, v9[v65].Left) - 10, v9[v65].Top), Vector2.new(math.max(v37.Right, v9[v65].Right) + 10, v9[v65].Top), v34);
            end;
            if v9[v65].BottomVisible then
                v53(v37.Top, v9[v65].Bottom, Vector2.new(math.min(v37.Left, v9[v65].Left) - 10, v9[v65].Bottom), Vector2.new(math.max(v37.Right, v9[v65].Right) + 10, v9[v65].Bottom), v34);
            end;
        end;
        v41 = v43 ~= 0;
        v37.Top = v37.Top + v43;
        v39 = v7:joinTables(v39, v44);
    end;
    return v37, v39, v40, v41;
end;
v33.setThreshold = function(_, v67)
    v11 = v67;
end;
return v33;


local v0 = require(script.Parent.Parent.Log);
local v1 = require(script.Parent.Parent.RectUtility);
local function v2()
    assert(v1:containsPoint(Rect.new(Vector2.new(1, 1), Vector2.new(3, 3)), (Vector2.new(2, 2))) == true, "Point was not inside rectangle");
end;
local function v3()
    assert(v1:containsPoint(Rect.new(Vector2.new(1, 1), Vector2.new(3, 3)), (Vector2.new(2, 1))) == true, "Point was not inside rectangle");
end;
local function v4()
    assert(v1:containsPoint(Rect.new(Vector2.new(1, 1), Vector2.new(3, 3)), (Vector2.new(0, 0))) == false, "Point was not outside rectangle");
end;
local function v5()
    assert(v1:containsPoint(Rect.new(Vector2.new(1, 1), Vector2.new(3, 3)), (Vector2.new(2, 0.5))) == false, "Point was not outside rectangle");
end;
local function v6()
    assert(v1:containsPoint(Rect.new(Vector2.new(1, 1), Vector2.new(3, 3)), (Vector2.new(2, 3.5))) == false, "Point was not outside rectangle");
end;
local function v7()
    assert(v1:containsPoint(Rect.new(Vector2.new(1, 1), Vector2.new(3, 3)), (Vector2.new(0.5, 2))) == false, "Point was not outside rectangle");
end;
local function v8()
    assert(v1:containsPoint(Rect.new(Vector2.new(1, 1), Vector2.new(3, 3)), (Vector2.new(0.5, 2))) == false, "Point was not outside rectangle");
end;
local function _()
    v0:log("Running RectUtilityTest");
    v2();
    v3();
    v4();
    v5();
    v6();
    v7();
    v8();
end;
v0:log("Running RectUtilityTest");
v2();
v3();
v4();
v5();
v6();
v7();
v8();


local v0 = require(script.Parent.CoreGuiManager);
local _ = require(script.Parent.FFlag);
local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local v3 = nil;
local v4 = nil;
local v5 = nil;
local v6 = nil;
local v7 = "";
local v8 = nil;
local v15 = {
    updateInstance = function(_, v10)
        if v4 then
            if v10.UserInputType == Enum.UserInputType.MouseButton1 and v10.UserInputState == Enum.UserInputState.Begin then
                local _ = Vector2.new(v10.Position.x, v10.Position.y);
            end;
            return ;
        else
            return false;
        end;
    end,
    finishEditingInstance = function(_)
        v4 = nil;
        if v5 then
            v5:Destroy();
            v5 = nil;
            v6:Destroy();
            v6 = nil;
            v8:disconnect();
            v8 = nil;
        end;
        l_ChangeHistoryService_0:SetWaypoint("Text Changed");
        v3:onTextEditorEnded();
    end,
    isCurrentlyEditing = function(_)
        return v4 ~= nil;
    end,
    getCurrentInstance = function(_)
        return v4;
    end
};
local function v18(_, _)
    if v4 then
        v4.Text = v6.Text;
    end;
    v15:finishEditingInstance();
end;
v15.startEditingInstance = function(_, v20)
    v4 = v20;
    local l_AbsolutePosition_0 = v20.AbsolutePosition;
    local l_AbsoluteSize_0 = v20.AbsoluteSize;
    v7 = v20.Text;
    v20.Text = "";
    if not v5 then
        v5 = Instance.new("ScreenGui", v0:findOrCreateFolder("TextEditor"));
        v6 = Instance.new("TextBox");
        v6.Position = UDim2.new(0, l_AbsolutePosition_0.X, 0, l_AbsolutePosition_0.Y);
        v6.Size = UDim2.new(0, l_AbsoluteSize_0.X, 0, l_AbsoluteSize_0.Y);
        v6.BackgroundTransparency = 1;
        v6.BorderSizePixel = 0;
        v6.Font = v4.Font;
        v6.TextColor3 = v4.TextColor3;
        v6.Text = v7;
        v6.TextSize = v4.TextSize;
        v6.TextScaled = v4.TextScaled;
        v6.TextWrapped = v4.TextWrapped;
        v6.TextXAlignment = v4.TextXAlignment;
        v6.TextYAlignment = v4.TextYAlignment;
        v6.Parent = v5;
        v8 = v6.FocusLost:connect(v18);
        v6.ClearTextOnFocus = false;
        v6:CaptureFocus();
    end;
    v3:onTextEditorBegan();
end;
v15.setActionMediator = function(_, v24)
    v3 = v24;
end;
return v15;


return {
    new = function()
        local v0 = {
            map = {},
            mt = {}
        };
        v0.mt.__index = function(v1, v2)
            if v2 == "insert" then
                return function(v3, v4)
                    if not v1.map[v3] then
                        table.insert(v1, {
                            v3,
                            v4
                        });
                        v1.map[v3] = #v1;
                    end;
                end;
            elseif v2 == "remove" then
                return function(v5, _)
                    if v1.map[v5] then
                        local v7 = v1.map[v5];
                        table.remove(v0, v7);
                        for v8 = v7, #v1 do
                            v1.map[v1[v8][1]] = v8;
                        end;
                    end;
                end;
            elseif v2 == "exists" then
                return function(v9)
                    return v1.map[v9] ~= nil;
                end;
            elseif v2 == "clear" then
                return function()
                    while #v1 > 0 do
                        v1.map[v1[1][1]] = nil;
                        table.remove(v1, 1);
                    end;
                end;
            else
                return ;
            end;
        end;
        setmetatable(v0, v0.mt);
        return v0;
    end
};


local v0 = require(script.Parent.Error);
local v9 = {
    tablesAreEquivalent = function(_, v2, v3)
        if #v2 ~= #v3 then
            return false;
        else
            for v4 = 1, #v2 do
                if v2[v4] ~= v3[v4] then
                    return false;
                end;
            end;
            return true;
        end;
    end,
    findItemInTable = function(_, v6, v7)
        if v6 then
            for v8 = 1, #v7 do
                if v7[v8] == v6 then
                    return v8;
                end;
            end;
            return 0;
        else
            return 0;
        end;
    end
};
v9.removeItemFromTable = function(_, v11, v12)
    local v13 = v9:findItemInTable(v11, v12);
    if v13 > 0 then
        table.remove(v12, v13);
        return true;
    else
        return false;
    end;
end;
v9.manhattanDistance = function(_, v15)
    return math.abs(v15.X) + math.abs(v15.Y);
end;
v9.crossVector2 = function(_, v17, v18)
    return v17.X * v18.Y - v17.Y * v18.X;
end;
v9.angleVector2 = function(_, v20, v21)
    return (math.atan2(v9:crossVector2(v20, v21), (v20:Dot(v21))));
end;
v9.floorVector2 = function(_, v23)
    return Vector2.new(math.floor(v23.X), (math.floor(v23.Y)));
end;
v9.minVector2 = function(_, v25, v26)
    return Vector2.new(math.min(v25.X, v26.X), (math.min(v25.Y, v26.Y)));
end;
v9.maxVector2 = function(_, v28, v29)
    return Vector2.new(math.max(v28.X, v29.X), (math.max(v28.Y, v29.Y)));
end;
v9.vector2ToUDim2Offset = function(_, v31)
    return UDim2.new(0, v31.X, 0, v31.Y);
end;
v9.minOrNil = function(_, v33, v34)
    if v33 then
        if v34 then
            return (math.min(v33, v34));
        else
            return v33;
        end;
    else
        return v34;
    end;
end;
v9.maxOrNil = function(_, v36, v37)
    if v36 then
        if v37 then
            return (math.max(v36, v37));
        else
            return v36;
        end;
    else
        return v37;
    end;
end;
v9.isOnlyScaleUDim2 = function(_, v39)
    local v40 = false;
    if v39.X.Offset == 0 then
        v40 = false;
        if v39.Y.Offset == 0 then
            v40 = true;
            if v39.X.Scale == 0 then
                v40 = v39.Y.Scale ~= 0;
            end;
        end;
    end;
    return v40;
end;
v9.isOnlyOffsetUDim2 = function(_, v42)
    local v43 = false;
    if v42.X.Scale == 0 then
        v43 = false;
        if v42.Y.Scale == 0 then
            v43 = true;
            if v42.X.Offset == 0 then
                v43 = v42.Y.Offset ~= 0;
            end;
        end;
    end;
    return v43;
end;
v9.distance = function(_, v45, v46)
    local v47 = type(v45) == "number";
    local v48 = type(v46) == "number";
    if not v47 or not v48 then
        if not v47 and not v48 then
            return (v46 - v45).magnitude;
        else
            v0("passed in one number and one non number");
            return ;
        end;
    else
        return (math.abs(v46 - v45));
    end;
end;
v9.cloneTable = function(_, v50)
    local v51 = {};
    local v52 = getmetatable(v50);
    local v53 = nil;
    for v54, v55 in pairs(v50) do
        if type(v55) == "table" then
            if v55 == v52 then
                v55 = v9:cloneTable(v55);
                v53 = v55;
            else
                v55 = v9:cloneTable(v55);
            end;
        end;
        v51[v54] = v55;
    end;
    if v52 ~= nil and v53 == nil then
        v53 = v9:cloneTable(v52);
    end;
    if v53 then
        setmetatable(v51, v53);
    end;
    return v51;
end;
v9.joinTables = function(_, v57, v58)
    local v59 = v9:cloneTable(v57);
    for v60 = 1, #v58 do
        table.insert(v59, v58[v60]);
    end;
    return v59;
end;
v9.rotate = function(_, v62, v63, v64)
    if v64 == 0 then
        return v62;
    else
        local v65 = math.rad(v64);
        return Vector2.new(((v62.X - v63.X) * math.cos(v65) - (v62.Y - v63.Y) * math.sin(v65)) + v63.X, ((v62.X - v63.X) * math.sin(v65) + (v62.Y - v63.Y) * math.cos(v65)) + v63.Y);
    end;
end;
v9.multUDimWithVector = function(_, v67, v68)
    return Vector2.new(v67.X.Offset, v67.Y.Offset) + Vector2.new(v67.X.Scale, v67.Y.Scale) * v68;
end;
return v9;


local v0 = {};
local v1 = require(script.Parent.CoreGuiManager);
local l_TextService_0 = game:GetService("TextService");
local v3 = Vector2.new(12, 4);
v0.getSize = function(v4)
    return v4.m_imageLabel.Size;
end;
v0.setPosition = function(v5, v6)
    v5.m_imageLabel.Position = v6;
end;
v0.setAnchorPoint = function(v7, v8)
    v7.m_imageLabel.AnchorPoint = v8;
end;
local function _(v9)
    return l_TextService_0:GetTextSize(v9.Text, v9.TextSize, v9.Font, Vector2.new(0, 0));
end;
v0.setText = function(v11, v12)
    local v13 = v1:findOrCreateScreenGui("ValueBoxes");
    v11.m_textLabel.Text = v12;
    v11.m_textLabel.TextSize = math.clamp(0.025 * v13.AbsoluteSize.Y, 12, 15);
    local l_m_textLabel_0 = v11.m_textLabel;
    local l_l_TextService_0_TextSize_0 = l_TextService_0:GetTextSize(l_m_textLabel_0.Text, l_m_textLabel_0.TextSize, l_m_textLabel_0.Font, Vector2.new(0, 0));
    l_m_textLabel_0 = math.clamp(0.008571428571428572 * v13.AbsoluteSize.X, 0, v3.X);
    local v16 = (l_m_textLabel_0 / v3.X) * v3.Y;
    v11.m_textLabel.Size = UDim2.new(0, l_l_TextService_0_TextSize_0.X, 0, l_l_TextService_0_TextSize_0.Y);
    v11.m_imageLabel.Size = UDim2.new(0, l_l_TextService_0_TextSize_0.X + 2 * l_m_textLabel_0, 0, l_l_TextService_0_TextSize_0.Y + 2 * v16);
end;
v0.setVisible = function(v17, v18)
    v17.m_imageLabel.Visible = v18;
    v17.m_textLabel.Visible = v18;
end;
local function v21()
    local l_ImageLabel_0 = Instance.new("ImageLabel");
    l_ImageLabel_0.Name = "UIEditorValueBoxImageLabel";
    local v20 = v1:findOrCreateScreenGui("ValueBoxes");
    v20.DisplayOrder = 1;
    l_ImageLabel_0.Parent = v20;
    l_ImageLabel_0.BackgroundTransparency = 1;
    l_ImageLabel_0.Image = "rbxasset://textures/StudioUIEditor/valueBoxRoundedRectangle.png";
    l_ImageLabel_0.ImageColor3 = Color3.fromRGB(255, 205, 0);
    l_ImageLabel_0.ScaleType = Enum.ScaleType.Slice;
    l_ImageLabel_0.SliceCenter = Rect.new(3, 3, 13, 13);
    return l_ImageLabel_0;
end;
local function v23()
    local l_TextLabel_0 = Instance.new("TextLabel");
    l_TextLabel_0.Name = "UIEditorValueBoxTexLabel";
    l_TextLabel_0.TextColor3 = Color3.new(0, 0, 0);
    l_TextLabel_0.BackgroundColor3 = Color3.fromRGB(118, 118, 118);
    l_TextLabel_0.BackgroundTransparency = 1;
    l_TextLabel_0.BorderSizePixel = 0;
    l_TextLabel_0.Font = Enum.Font.SourceSans;
    l_TextLabel_0.TextXAlignment = Enum.TextXAlignment.Center;
    l_TextLabel_0.TextYAlignment = Enum.TextYAlignment.Center;
    l_TextLabel_0.TextSize = 15;
    l_TextLabel_0.AnchorPoint = Vector2.new(0.5, 0.5);
    l_TextLabel_0.Position = UDim2.new(0.5, 0, 0.5, -2);
    return l_TextLabel_0;
end;
v0.new = function(v24)
    local v25 = {
        m_imageLabel = v21()
    };
    if v24 ~= nil then
        v25.m_imageLabel.Parent = v24;
    end;
    v25.m_textLabel = v23();
    v25.m_textLabel.Parent = v25.m_imageLabel;
    return (setmetatable(v25, v0));
end;
v0.__index = v0;
v0.Destroy = function(v26)
    v26.m_imageLabel:Destroy();
end;
return v0;


local l_plugin_0 = plugin;
local _ = settings;
local v2 = require(script.Parent.ActionMediator);
local _ = require(script.Parent.CoreGuiManager);
local v4 = require(script.Parent.DoubleClickDetector);
local _ = require(script.Parent.FFlag);
local _ = require(script.Parent.RotationBox);
local v7 = require(script.Parent.Rubberband);
local v8 = require(script.Parent.SizeBox);
local v9 = require(script.Parent.DistanceLinesManager);
local v10 = require(script.Parent.TextEditor);
local _ = require(script.Parent.Utility);
local v12 = require(script.Parent.GlobalValues);
local v13 = require(script.Parent.InstanceInfo);
local v14 = require(script.Parent.Select);
local v15 = require(script.Parent.Resize);
local _ = require(script.Parent.Rotate);
local v17 = require(script.Parent.Move);
local v18 = require(script.Parent.MouseIconManager);
local v19 = require(script.Parent.SelectionManager);
local v20 = require(script.Parent.SnappingPointManager);
local v21 = require(script.Parent.Analytics);
local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_Selection_0 = game:GetService("Selection");
local l_StarterGui_0 = game:GetService("StarterGui");
local l_RunService_0 = game:GetService("RunService");
game:DefineFastFlag("StopUIEditorFocusOnPluginActivation", false);
game:DefineFastFlag("UIEditorAvoidEditingPath2D", false);
local v27 = nil;
local v28 = nil;
local v29 = nil;
local v30 = nil;
local v31 = nil;
local v32 = nil;
local v33 = nil;
local v34 = nil;
local v35 = nil;
local v36 = nil;
local v37 = nil;
local v38 = false;
local v39 = {};
local l_CurrentCamera_0 = workspace.CurrentCamera;
local function v41()
    v17:setActionMediator(v2);
    v15:setActionMediator(v2);
    v7:setActionMediator(v2);
    v10:setActionMediator(v2);
    v2:setMove(v17);
    v2:setResize(v15);
    v2:setRubberband(v7);
    v2:setTextEditor(v10);
    v2:setDistanceLinesManager(v9);
    v2:setSizeBox(v8);
    v2:setSelectionManager(v19);
end;
local function v44(v42)
    local v43 = v14:getGuiObjectsAtPoint((Vector2.new(v42.Position.x, v42.Position.y)));
    if not (#v43 > 0) or not (v43[1]:IsA("TextLabel") or v43[1]:IsA("TextButton")) and not v43[1]:IsA("TextBox") then
        return false;
    else
        v10:startEditingInstance(v43[1]);
        v15:hide();
        return true;
    end;
end;
local function v47(_, v46)
    if v46 == "Parent" then
        v19:onParentChanged();
        return ;
    else
        v15:updatePosition();
        v15:updateSize();
        v9:update();
        v9:setVisible(true);
        v8:update();
        return ;
    end;
end;
local function v49(v48)
    v19:onDescendantAddedToStarterGui(v48);
end;
local function v51()
    v19:onSelectionChanged();
    v20:generateSnappingLines();
    local v50 = l_Selection_0:Get();
    if not (not v50[1] or not v50[1]:FindFirstAncestor("BillboardGui") and not v50[1]:FindFirstAncestor("SurfaceGui")) then
        v15:hide();
        v8:setVisible(false);
        v9:setVisible(false);
    end;
end;
local function v58(v52)
    if not v10:isCurrentlyEditing() then
        if v52.UserInputType == Enum.UserInputType.MouseButton1 then
            if not (not l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftShift) and not l_UserInputService_0:IsKeyDown(Enum.KeyCode.RightShift)) then
                v39 = v19:getRawSelection();
            end;
            v37 = v19:disconnectSelectionInstancesChanged(v37);
            v38 = true;
            local v53 = Vector2.new(v52.Position.X, v52.Position.Y);
            if not v15:isOverAHandle() then
                local v54 = v14:selectTopLevelItemAtPoint(v53);
                v51();
                v17:startDrag(v53);
                if v54 then
                    v13:isVisible(v54, true);
                    return ;
                else
                    local v55 = l_CurrentCamera_0:ScreenPointToRay(v52.Position.X, v52.Position.Y);
                    local v56 = RaycastParams.new();
                    v56.BruteForceAllSlow = true;
                    local v57 = workspace:Raycast(v55.Origin, v55.Direction * 5000, v56);
                    if not v57 or v57.Instance.Locked then
                        Off();
                        return ;
                    else
                        l_Selection_0:Set({
                            v57.Instance
                        });
                        Off();
                        return ;
                    end;
                end;
            else
                v15:startDrag(v53);
                return ;
            end;
        else
            if v52.UserInputType == Enum.UserInputType.Keyboard then
                if not (v52.KeyCode == Enum.KeyCode.U) or not l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftShift) and not l_UserInputService_0:IsKeyDown(Enum.KeyCode.RightShift) then
                    if not (not (v52.KeyCode == Enum.KeyCode.A) or not l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftControl)) then
                        v19:setSelection(v14:getGuiObjects());
                    end;
                else
                    v12:toggleGridType();
                    return ;
                end;
            end;
            return ;
        end;
    else
        return ;
    end;
end;
local function v61(v59)
    if v59.UserInputType == Enum.UserInputType.MouseButton1 then
        v38 = false;
        local v60 = Vector2.new(v59.Position.X, v59.Position.Y);
        if v15:isDragInProgress() then
            v15:finishDrag();
        end;
        if v7:isDragInProgress() then
            if not l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftShift) and not l_UserInputService_0:IsKeyDown(Enum.KeyCode.RightShift) then
                v14:selectAllObjectsInBounds(v7:getBounds());
            else
                v14:toggleSelectionOfAllObjectsInBounds(v39, v7:getBounds());
            end;
            if #v19:getRawSelection() > 0 then
                v21:reportEvent("DragSelect");
            end;
            v7:finishRubberbandDrag();
            v39 = {};
        end;
        if v17:isDragInProgress() then
            v17:finishDrag(v60);
        end;
        if ((not v4:isDoubleClick() or l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftAlt)) or l_UserInputService_0:IsKeyDown(Enum.KeyCode.RightAlt)) or not v44(v59) then
            if not v37 then
                v37 = v19:connectSelectionInstancesChanged(v47);
            end;
            if not v15:isOverAHandle() then
                v18:setToDefaultIcon();
            else
                v15:updateMouseIcon();
            end;
            v15:updateHandleHighlight();
        else
            return ;
        end;
    end;
end;
local function v64(v62)
    if not v10:isCurrentlyEditing() then
        if v62.UserInputType == Enum.UserInputType.MouseMovement then
            local v63 = Vector2.new(v62.Position.x, v62.Position.y);
            if not v15:isDragInProgress() then
                if not v7:isDragInProgress() then
                    if not v17:isDragInProgress() then
                        if not v15:isOverAHandle() then
                            v18:setToDefaultIcon();
                        else
                            v15:updateMouseIcon();
                        end;
                        v15:updateHandleHighlight(false);
                    else
                        v17:updateDrag(v63);
                        return ;
                    end;
                else
                    v7:updateRubberband(v63);
                    if not l_UserInputService_0:IsKeyDown(Enum.KeyCode.LeftShift) and not l_UserInputService_0:IsKeyDown(Enum.KeyCode.RightShift) then
                        v14:selectAllObjectsInBounds(v7:getBounds());
                        return ;
                    else
                        v14:toggleSelectionOfAllObjectsInBounds(v39, v7:getBounds());
                        return ;
                    end;
                end;
            else
                v15:updateDrag(v63);
                return ;
            end;
        end;
        return ;
    else
        return ;
    end;
end;
local function v67(v65)
    if #v65 == 0 then
        return ;
    elseif v65[1]:IsA("GuiBase2d") then
        v38 = true;
        local v66 = Vector2.new(l_plugin_0:GetMouse().X, l_plugin_0:GetMouse().Y);
        l_Selection_0:Set(v65);
        v19:onSelectionChanged();
        v17:startDrag(v66);
        return ;
    else
        return ;
    end;
end;
local function v69(_)
    if l_StarterGui_0.ShowDevelopmentGui and not l_RunService_0:IsRunning() then
        return ;
    else
        return ;
    end;
end;
local function _(v70)
    if not ((v70 ~= "Translate Objects (better tt needed)" and v70 ~= "Resize") and v70 ~= "Text Changed") or v70 == "Rotate object" then
        return true;
    else
        return false;
    end;
end;
local function v73(v72)
    if ((v72 == "Translate Objects (better tt needed)" or v72 == "Resize") or v72 == "Text Changed") or v72 == "Rotate object" then
        v15:updatePosition();
    end;
end;
local function v75(v74)
    if ((v74 == "Translate Objects (better tt needed)" or v74 == "Resize") or v74 == "Text Changed") or v74 == "Rotate object" then
        v15:updatePosition();
    end;
end;
local v76 = false;
local v77 = false;
local v78 = nil;
local v79 = nil;
v78 = l_plugin_0 and l_plugin_0:CreateToolbar("RobloxUIEditor");
v79 = v78 and v78:CreateButton("RobloxUIEditor", "RobloxUIEditor", "");
Off = function()
    if v77 then
        v77 = false;
        v21:reportEvent("Disabled");
        v28:disconnect();
        v27:disconnect();
        v36 = l_UserInputService_0.InputBegan:connect(v69);
        v14:refreshPaintOrder();
        v29:disconnect();
        v30:disconnect();
        v31:disconnect();
        v32:disconnect();
        v33:disconnect();
        v37 = v19:disconnectSelectionInstancesChanged(v37);
        v19:disconnectFilteredSelectionChanged(v9);
        v19:disconnectFilteredSelectionChanged(v15);
        v19:disconnectFilteredSelectionChanged(v8);
        v19:disconnectFilteredSelectionChanged(v17);
        v8:Off();
        v9:Off();
        v18:Off();
        v15:Off();
        v79:SetActive(false);
        l_plugin_0:Deactivate();
        return ;
    else
        return ;
    end;
end;
On = function()
    if not v77 then
        v21:reportEvent("Enabled");
        if not game:GetFastFlag("StopUIEditorFocusOnPluginActivation") then
            l_plugin_0:Activate(true);
        else
            l_plugin_0:Activate(false);
        end;
        v79:SetActive(true);
        v20:setThreshold(5);
        v8:On();
        v9:On();
        v18:On(l_plugin_0:GetMouse());
        v15:On();
        v27 = l_StarterGui_0.DescendantAdded:connect(v49);
        v36:disconnect();
        v28 = l_UserInputService_0.InputBegan:connect(v58);
        v29 = l_UserInputService_0.InputChanged:connect(v64);
        v30 = l_UserInputService_0.InputEnded:connect(v61);
        v31 = l_Selection_0.SelectionChanged:connect(v51);
        v33 = l_plugin_0:GetMouse().DragEnter:connect(v67);
        v32 = l_plugin_0.Deactivation:connect(Off);
        v37 = v19:connectSelectionInstancesChanged(v47);
        v34 = l_ChangeHistoryService_0.OnUndo:connect(v73);
        v35 = l_ChangeHistoryService_0.OnRedo:connect(v75);
        v19:connectFilteredSelectionChanged(v9);
        v19:connectFilteredSelectionChanged(v15);
        v19:connectFilteredSelectionChanged(v8);
        v19:connectFilteredSelectionChanged(v17);
        v51();
        v41();
        v77 = true;
        return ;
    else
        return ;
    end;
end;
if v79 then
    l_StarterGui_0.ProcessUserInput = true;
    v79.Click:connect(function()
        if not v77 then
            On();
            return ;
        else
            Off();
            return ;
        end;
    end);
    local function v82(v80)
        local _ = v80.Name;
    end;
    local function v86()
        local v83 = l_Selection_0:Get();
        for v84 = 1, #v83 do
            local v85 = v83[v84];
            if not (not pcall(v82, v85) or not v19:passesGuiFilter(v85)) then
                On();
                return ;
            end;
        end;
        Off();
    end;
    l_Selection_0.SelectionChanged:connect(function()
        spawn(v86);
    end);
end;
v36 = l_UserInputService_0.InputBegan:connect(v69);
v14:refreshPaintOrder();
v76 = true;


require(script.Parent.defineLuaFlags);
if plugin then
    local l_Parent_0 = script.Parent.Parent;
    local v1 = require(l_Parent_0.Packages.TestLoader);
    v1.launch("VRStatus", l_Parent_0.Src);
    if not v1.isCli() then
        if game:GetFastFlag("EnableVRStatus") then
            local v2 = require(l_Parent_0.Packages.React);
            local v3 = require(l_Parent_0.Packages.ReactRoblox);
            local v4 = require(l_Parent_0.Src.MainPlugin);
            local v5 = nil;
            local function v7()
                plugin.Name = l_Parent_0.Name;
                local v6 = v2.createElement(v4, {
                    Plugin = plugin
                });
                v5 = v3.createRoot(Instance.new("Frame"));
                v5:render(v6);
            end;
            plugin.Unloading:Connect(function()
                if v5 then
                    v5:render(nil);
                    v5 = nil;
                end;
            end);
            v7();
            return ;
        else
            return ;
        end;
    else
        return ;
    end;
else
    return ;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.React);
local v2 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_UI_0 = v2.UI;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v9 = v1.PureComponent:extend("AlertDialog");
v9.render = function(v10)
    local l_props_0 = v10.props;
    local l_Stylizer_0 = l_props_0.Stylizer;
    local l_Localization_1 = l_props_0.Localization;
    local v14 = l_Localization_1:getText("AlertDialog", "NoDeviceDetected");
    if v10.props.deviceName ~= "" then
        v14 = v10.props.deviceName .. " " .. l_Localization_1:getText("AlertDialog", "Detected") .. ". " .. if not v10.props.vrEnabled then l_Localization_1:getText("AlertDialog", "ModeOff") else l_Localization_1:getText("AlertDialog", "ModeOn");
    end;
    return v1.createElement(l_StyledDialog_0, {
        Style = "Alert",
        Enabled = v10.props.enabled,
        Title = "VR Status Information",
        Buttons = {
            {
                Key = "ok",
                Text = l_Localization_1:getText("AlertDialog", "OkButtonText")
            }
        },
        OnButtonPressed = l_props_0.OnClose,
        OnClose = l_props_0.OnClose,
        MinContentSize = l_Stylizer_0.PopupMessageSize,
        Modal = true
    }, {
        Label = v1.createElement(l_TextLabel_0, {
            Size = UDim2.fromScale(0.95, 1),
            AnchorPoint = Vector2.new(0.5, 0),
            Position = UDim2.fromScale(0.5, 0),
            Text = v14,
            TextColor = l_Stylizer_0.TextColor,
            TextWrapped = true,
            TextSize = l_Stylizer_0.TextSize,
            TextXAlignment = Enum.TextXAlignment.Left
        })
    });
end;
return (l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_ContextServices_0.Stylizer
})(v9));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.React);
local v2 = require(l_Parent_0.Packages.Framework);
local l_ContextServices_0 = v2.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local v6 = require(l_Parent_0.Src.Controllers.ServiceController);
local l_PluginButton_0 = v2.UI.PluginButton;
local v8 = v1.PureComponent:extend("StatusButton");
v8.render = function(v9)
    local l_props_0 = v9.props;
    local l_Localization_1 = l_props_0.Localization;
    local v12 = "rbxasset://textures/VRStatus/error.png";
    if v9.props.deviceName ~= "" then
        v12 = not v9.props.vrEnabled and "rbxasset://textures/VRStatus/warning.png" or "rbxasset://textures/VRStatus/ok.png";
    end;
    return {
        Toggle = v1.createElement(l_PluginButton_0, {
            Toolbar = l_props_0.toolbar,
            Active = l_props_0.enabled,
            Id = "status_button",
            Title = l_Localization_1:getText("StatusButton", "Title"),
            Tooltip = l_Localization_1:getText("StatusButton", "Tooltip"),
            Icon = v12,
            OnClick = v9.props.showAlert,
            ClickableWhenViewportHidden = true
        })
    };
end;
return (l_withContext_0({
    Localization = l_Localization_0,
    Stylizer = l_ContextServices_0.Stylizer,
    ServiceController = v6
})(v8));


local l_script_FirstAncestor_0 = script:FindFirstAncestor("VRStatus");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework).ContextServices.ContextItem:extend("ServiceController");
local l_Mocks_0 = l_script_FirstAncestor_0.Src.Mocks;
local v3 = require(l_Mocks_0.MockUserSettingService);
local v4 = require(l_Mocks_0.MockVRService);
v1.new = function(v5)
    return (setmetatable({
        _services = {
            VRService = if not v5 then game:GetService("VRService") else v4.new(),
            UserGameSettings = if not v5 then UserSettings():GetService("UserGameSettings") else v3.new()
        }
    }, v1));
end;
v1.mock = function()
    v1.new(true);
end;
v1.getService = function(v6, v7)
    return v6._services[v7];
end;
return v1;


local l_Parent_0 = script.Parent.Parent;
local v1 = require(l_Parent_0.Packages.React);
local v2 = require(l_Parent_0.Packages.Framework);
local l_PluginToolbar_0 = v2.UI.PluginToolbar;
local l_ContextServices_0 = v2.ContextServices;
local l_Plugin_0 = l_ContextServices_0.Plugin;
local l_Mouse_0 = l_ContextServices_0.Mouse;
local v7 = require(l_Parent_0.Src.Resources.MakeTheme);
local l_SourceStrings_0 = l_Parent_0.Src.Resources.Localization.SourceStrings;
local l_LocalizedStrings_0 = l_Parent_0.Src.Resources.Localization.LocalizedStrings;
local l_Components_0 = l_Parent_0.Src.Components;
local v11 = require(l_Components_0.AlertDialog);
local v12 = require(l_Components_0.StatusButton);
local v13 = require(l_Parent_0.Src.Controllers.ServiceController);
local v14 = v1.PureComponent:extend("MainPlugin");
v14.init = function(v15)
    v15.serviceController = v13.new();
    v15:setState({
        alertEnabled = false,
        deviceName = "",
        vrEnabled = false
    });
    v15.localization = l_ContextServices_0.Localization.new({
        stringResourceTable = l_SourceStrings_0,
        translationResourceTable = l_LocalizedStrings_0,
        pluginName = "VRStatus"
    });
    v15.analytics = l_ContextServices_0.Analytics.new(function()
        return {};
    end, {});
end;
v14.didMount = function(v16)
    local l_serviceController_0 = v16.serviceController;
    local v18 = l_serviceController_0:getService("UserGameSettings");
    local v19 = l_serviceController_0:getService("VRService");
    v16:setState({
        deviceName = v19.VRDeviceName,
        vrEnabled = v18.VREnabled
    });
    v16._deviceNameConnection = v19:GetPropertyChangedSignal("VRDeviceName"):Connect(function()
        v16:setState({
            deviceName = v19.VRDeviceName
        });
    end);
    v16._vrEnabledConnection = v18:GetPropertyChangedSignal("VREnabled"):Connect(function()
        v16:setState({
            vrEnabled = v18.VREnabled
        });
    end);
end;
v14.willUnmount = function(v20)
    if v20._deviceNameConnection then
        v20._deviceNameConnection:Disconnect();
        v20._deviceNameConnection = nil;
    end;
    if v20._vrEnabledConnection then
        v20._vrEnabledConnection:Disconnect();
        v20._vrEnabledConnection = nil;
    end;
end;
v14.renderButtons = function(v21, v22)
    local l_state_0 = v21.state;
    return {
        Toggle = v1.createElement(v12, {
            toolbar = v22,
            enabled = l_state_0.alertEnabled,
            showAlert = function()
                v21:setState({
                    alertEnabled = true
                });
            end,
            deviceName = l_state_0.deviceName,
            vrEnabled = l_state_0.vrEnabled
        })
    };
end;
v14.render = function(v24)
    local l_props_0 = v24.props;
    local l_state_1 = v24.state;
    local l_Plugin_1 = l_props_0.Plugin;
    return l_ContextServices_0.provide({
        l_Plugin_0.new(l_Plugin_1),
        l_Mouse_0.new(l_Plugin_1:getMouse()),
        v7(),
        v24.localization,
        v24.analytics,
        v24.serviceController
    }, {
        Toolbar = v1.createElement(l_PluginToolbar_0, {
            Title = v24.localization:getText("Plugin", "Name"),
            RenderButtons = function(v28)
                return v24:renderButtons(v28);
            end
        });
        v1.createElement(v11, {
            OnClose = function()
                v24:setState({
                    alertEnabled = false
                });
            end,
            enabled = l_state_1.alertEnabled,
            deviceName = l_state_1.deviceName,
            vrEnabled = l_state_1.vrEnabled
        })
    });
end;
return v14;


local l_Signal_0 = require(script.Parent.Parent.Parent.Packages.Framework).Util.Signal;
local v1 = {};
v1.__index = v1;
v1.new = function()
    local v2 = {
        VREnabledSignal = l_Signal_0.new(),
        VREnabled = false
    };
    setmetatable(v2, v1);
    return v2;
end;
v1.GetPropertyChangedSignal = function(v3, v4)
    if v4 == "VREnabled" then
        return v3.VREnabledSignal;
    else
        return nil;
    end;
end;
return v1;


local l_Signal_0 = require(script.Parent.Parent.Parent.Packages.Framework).Util.Signal;
local v1 = {};
v1.__index = v1;
v1.new = function()
    local v2 = {
        VRDeviceNameSignal = l_Signal_0.new(),
        VRDeviceName = "abc"
    };
    setmetatable(v2, v1);
    return v2;
end;
v1.GetPropertyChangedSignal = function(v3, v4)
    if v4 == "VRDeviceName" then
        return v3.VRDeviceNameSignal;
    else
        return nil;
    end;
end;
return v1;


local l_Style_0 = require(script.Parent.Parent.Parent.Packages.Framework).Style;
local l_StudioTheme_0 = l_Style_0.Themes.StudioTheme;
local l_ComponentSymbols_0 = l_Style_0.ComponentSymbols;
l_ComponentSymbols_0:add("AlertDialog");
local v3 = {
    [l_ComponentSymbols_0.AlertDialog] = {
        PopupMessageSize = Vector2.new(400, 60),
        TextSize = 18
    }
};
return function(v4)
    local _ = nil;
    return (if not v4 then l_StudioTheme_0.new() else l_StudioTheme_0.mock()):extend(v3);
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local l_TestHelpers_0 = v1.TestHelpers;
local l_ContextServices_0 = v1.ContextServices;
local v4 = require(l_Parent_0.Src.Resources.MakeTheme);
local _ = require(l_Parent_0.Src.Controllers.ServiceController);
local v6 = {
    l_ContextServices_0.Analytics.mock(),
    l_ContextServices_0.Localization.mock(),
    v4(true)
};
return function(v7, v8)
    assert(type(v7) == "table", "Expected story to be a table");
    local v9 = table.clone(v6);
    for _, v11 in v8, nil, nil do
        table.insert(v9, v11);
    end;
    return l_TestHelpers_0.provideMockContext(v9, v7);
end;


local l_RunService_0 = game:GetService("RunService");
local l_GuiService_0 = game:GetService("GuiService");
local l_CoreGui_0 = game:GetService("CoreGui");
local l_ContentProvider_0 = game:GetService("ContentProvider");
local l_UserInputService_0 = game:GetService("UserInputService");
local l_InsertService_0 = game:GetService("InsertService");
local l_StudioService_0 = game:GetService("StudioService");
local l_TweenService_0 = game:GetService("TweenService");
local l_Button_0 = plugin:CreateToolbar("ViewSelector"):CreateButton("ViewSelector", "Show View Selector", "");
l_Button_0.ClickableWhenViewportHidden = false;
local v9 = nil;
local v10 = nil;
local v11 = nil;
local v12 = nil;
local v13 = nil;
local v14 = nil;
local v15 = nil;
local v16 = nil;
local v17 = nil;
local v18 = nil;
local v19 = nil;
local v20 = nil;
local v21 = nil;
local v22 = nil;
local v23 = nil;
local v24 = nil;
local v25 = nil;
local v26 = nil;
local v27 = nil;
local v28 = nil;
local v29 = nil;
local v30 = nil;
local v31 = nil;
local v32 = nil;
local v33 = {};
local v34 = {
    Normal = {},
    Hover = {}
};
local function v47()
    v15 = l_CoreGui_0:FindFirstChild("ViewSelectorScreenGui");
    if v15 then
        v15:Destroy();
        l_RunService_0:UnbindFromRenderStep("ViewSelectorAfterCamera");
    end;
    v15 = l_InsertService_0:LoadLocalAsset("rbxasset://models/ViewSelector/ViewSelector.rbxm");
    v15.Parent = l_CoreGui_0;
    v15.Enabled = false;
    v16 = v15:WaitForChild("Panel");
    v17 = v16:WaitForChild("Viewport");
    v18 = v17.AbsoluteSize.x;
    v28 = v17:WaitForChild("EventReceiver");
    v19 = v17:WaitForChild("Model");
    v20 = v16:WaitForChild("X");
    v21 = v16:WaitForChild("Y");
    v22 = v16:WaitForChild("Z");
    v26 = v16:WaitForChild("ArrowButtons");
    v26.Visible = false;
    v27 = false;
    v14 = Instance.new("Camera");
    v14.Parent = v17;
    v14.CFrame = CFrame.new(Vector3.new(0, 0, 0), (Vector3.new(0, 0, -1)));
    v14.FieldOfView = 70;
    v17.CurrentCamera = v14;
    local l_LocalizedStrings_0 = script.Parent.LocalizedStrings;
    local l_l_LocalizedStrings_0_Translator_0 = l_LocalizedStrings_0:GetTranslator(l_StudioService_0.StudioLocaleId);
    local l_l_LocalizedStrings_0_Translator_1 = l_LocalizedStrings_0:GetTranslator("en-us");
    local l_v19_Children_0 = v19:GetChildren();
    for v39 = 1, #l_v19_Children_0 do
        local v40 = l_v19_Children_0[v39];
        if not (v40.ClassName ~= "Part") or v40.ClassName == "MeshPart" then
            v40.CFrame = v19.CFrame:ToObjectSpace(v40.CFrame);
        elseif v40.ClassName == "Decal" then
            local l_Name_0 = v40.Name;
            local v42 = v40.Name .. "_hover";
            if not pcall(function()
                v34.Normal[v40.Name] = l_l_LocalizedStrings_0_Translator_0:FormatByKey(l_Name_0);
                v34.Hover[v40.Name] = l_l_LocalizedStrings_0_Translator_0:FormatByKey(v42);
            end) then
                v34.Normal[v40.Name] = l_l_LocalizedStrings_0_Translator_1:FormatByKey(l_Name_0);
                v34.Hover[v40.Name] = l_l_LocalizedStrings_0_Translator_1:FormatByKey(v42);
            end;
            v40.Texture = v34.Normal[v40.Name];
        end;
    end;
    v19.CFrame = CFrame.new();
    local v43 = {
        "n",
        "0",
        "p"
    };
    for v44 = -1, 1 do
        for v45 = -1, 1 do
            for v46 = -1, 1 do
                v33[v43[v44 + 2] .. v43[v45 + 2] .. v43[v46 + 2]] = CFrame.new(Vector3.new(), Vector3.new(-v44, -v45, -v46).Unit);
            end;
        end;
    end;
    v33["0p0"] = CFrame.fromEulerAnglesYXZ(-1.5707963267948966, 3.141592653589793, 0);
    v33["0n0"] = CFrame.fromEulerAnglesXYZ(-1.5707963267948966, 3.141592653589793, 0);
    v23 = Vector3.new(0.576, -0.48, -0.48);
    v24 = Vector3.new(-0.48, 0.576, -0.48);
    v25 = Vector3.new(-0.48, -0.48, 0.576);
    v9 = plugin:GetSetting("ViewSelector_Active");
    if v9 == nil then
        v9 = true;
    end;
    l_Button_0:SetActive(v9);
end;
local function _()
    local l_CameraType_0 = game.Workspace.CurrentCamera.CameraType;
    if not (l_CameraType_0 ~= Enum.CameraType.Attach) or l_CameraType_0 == Enum.CameraType.Scriptable then
        return true;
    else
        return false;
    end;
end;
local function v61(v50, v51)
    local v52 = -100;
    local v53 = 100;
    local v54 = -v50;
    local function v60(v55, v56)
        if math.abs(v56) > 0.001 then
            local v57 = (v55 + 0.48) / v56;
            local v58 = (v55 - 0.48) / v56;
            if v58 < v57 then
                local l_v58_0 = v58;
                v58 = v57;
                v57 = l_v58_0;
            end;
            if v52 < v57 then
                v52 = v57;
            end;
            if v58 < v53 then
                v53 = v58;
            end;
            if v53 < v52 then
                return 0;
            elseif v53 < 0 then
                return 0;
            end;
        elseif not (-v55 - 0.48 <= 0) or -v55 + 0.48 < 0 then
            return 0;
        end;
    end;
    if v60(v54.X, v51.X) == 0 then
        return ;
    elseif v60(v54.Y, v51.Y) == 0 then
        return ;
    elseif v60(v54.Z, v51.Z) == 0 then
        return ;
    elseif v52 > 0 then
        return v50 + v51 * v52;
    else
        return v50 + v51 * v53;
    end;
end;
local function _(v62)
    if v62 then
        if v62.ClassName == "Decal" then
            v62.Texture = v34.Hover[v62.Name];
            return ;
        else
            v62.Transparency = 0.3;
            return ;
        end;
    else
        return ;
    end;
end;
local function _(v64)
    if v64 then
        if v64.ClassName == "Decal" then
            v64.Texture = v34.Normal[v64.Name];
            return ;
        else
            v64.Transparency = 1;
            return ;
        end;
    else
        return ;
    end;
end;
local function v72(v66)
    local v67 = math.abs(v66.x);
    local v68 = math.abs(v66.y);
    local v69 = math.abs(v66.z);
    local function _(v70)
        if v70 >= 0 then
            return "p";
        else
            return "n";
        end;
    end;
    if (v67 + v68) + v69 > 1.056 then
        return (v66.x >= 0 and "p" or "n") .. (v66.y >= 0 and "p" or "n") .. (v66.z >= 0 and "p" or "n");
    elseif v68 < v67 and v69 < v67 then
        return (v66.x >= 0 and "p" or "n") .. "00";
    elseif v67 < v68 and v69 < v68 then
        return "0" .. (v66.y >= 0 and "p" or "n") .. "0";
    else
        return "00" .. (v66.z >= 0 and "p" or "n");
    end;
end;
local function _(v73, v74)
    local l_l_GuiService_0_GuiInset_0 = l_GuiService_0:GetGuiInset();
    return (v73 - v17.AbsolutePosition.X) - l_l_GuiService_0_GuiInset_0.x, (v74 - v17.AbsolutePosition.Y) - l_l_GuiService_0_GuiInset_0.y;
end;
local function v85(v77, v78)
    local l_CameraType_1 = game.Workspace.CurrentCamera.CameraType;
    if not (l_CameraType_1 == Enum.CameraType.Attach or l_CameraType_1 == Enum.CameraType.Scriptable) then
        local l_l_GuiService_0_GuiInset_1 = l_GuiService_0:GetGuiInset();
        l_l_GuiService_0_GuiInset_1 = v14:ViewportPointToRay(((v77 - v17.AbsolutePosition.X) - l_l_GuiService_0_GuiInset_1.x) / v18, ((v78 - v17.AbsolutePosition.Y) - l_l_GuiService_0_GuiInset_1.y) / v18, 0);
        local v81 = v61(l_l_GuiService_0_GuiInset_1.Origin, l_l_GuiService_0_GuiInset_1.Direction);
        if not v81 then
            local l_v13_0 = v13;
            if l_v13_0 then
                if l_v13_0.ClassName == "Decal" then
                    l_v13_0.Texture = v34.Normal[l_v13_0.Name];
                else
                    l_v13_0.Transparency = 1;
                end;
            end;
            v13 = nil;
        else
            local v83 = v19[v72(v81)];
            if v13 ~= v83 then
                local l_v13_1 = v13;
                if l_v13_1 then
                    if l_v13_1.ClassName == "Decal" then
                        l_v13_1.Texture = v34.Normal[l_v13_1.Name];
                    else
                        l_v13_1.Transparency = 1;
                    end;
                end;
                if v83 then
                    if v83.ClassName == "Decal" then
                        v83.Texture = v34.Hover[v83.Name];
                    else
                        v83.Transparency = 0.3;
                    end;
                end;
                v13 = v83;
                return ;
            end;
        end;
        return ;
    else
        return ;
    end;
end;
local function v89()
    if v27 then
        local l_LookVector_0 = v10.LookVector;
        local function _(v87)
            return math.abs(math.abs((l_LookVector_0:Dot(v87))) - 1) < 0.001;
        end;
        v26.Visible = (math.abs(math.abs((l_LookVector_0:Dot((Vector3.new(1, 0, 0))))) - 1) < 0.001 or math.abs(math.abs((l_LookVector_0:Dot((Vector3.new(0, 1, 0))))) - 1) < 0.001) or math.abs(math.abs((l_LookVector_0:Dot((Vector3.new(0, 0, 1))))) - 1) < 0.001;
        return ;
    else
        return ;
    end;
end;
local function v90()
    v27 = true;
    v89();
end;
local function v92()
    local l_v13_2 = v13;
    if l_v13_2 then
        if l_v13_2.ClassName == "Decal" then
            l_v13_2.Texture = v34.Normal[l_v13_2.Name];
        else
            l_v13_2.Transparency = 1;
        end;
    end;
    v13 = nil;
    v26.Visible = false;
    v27 = false;
end;
local function v96(v93)
    if v11 then
        if v93.UserInputType == Enum.UserInputType.MouseMovement then
            local l_x_0 = v93.Position.x;
            local l_y_0 = v93.Position.y;
            if math.abs(v11.x - l_x_0) + math.abs(v11.y - l_y_0) > 5 then
                v16.Position = UDim2.new(v12.X.Scale, (v12.X.Offset + l_x_0) - v11.x, v12.Y.Scale, (v12.Y.Offset + l_y_0) - v11.y);
            end;
        end;
        return ;
    else
        return ;
    end;
end;
local function v110()
    local function _(v97, v98)
        local v99 = game.Workspace.CurrentCamera.ViewportSize[v97];
        local v100 = 0.5;
        local v101 = 0.5;
        if v18 < v99 then
            v100 = plugin:GetSetting("ViewSelector_Position" .. v97) or v98;
            v101 = (v100 * (v99 - v18) + v100 * v18) / v99;
        end;
        return v100, v101;
    end;
    local l_X_0 = game.Workspace.CurrentCamera.ViewportSize.X;
    local v104 = 0.5;
    local v105 = 0.5;
    if v18 < l_X_0 then
        v104 = plugin:GetSetting("ViewSelector_Position" .. "X") or 1;
        v105 = (v104 * (l_X_0 - v18) + v104 * v18) / l_X_0;
    end;
    local l_v104_0 = v104;
    local l_v105_0 = v105;
    v105 = game.Workspace.CurrentCamera.ViewportSize.Y;
    local v108 = 0.5;
    local v109 = 0.5;
    if v18 < v105 then
        v108 = plugin:GetSetting("ViewSelector_Position" .. "Y") or 0;
        v109 = (v108 * (v105 - v18) + v108 * v18) / v105;
    end;
    l_X_0 = v108;
    v104 = v109;
    v16.AnchorPoint = Vector2.new(l_v104_0, l_X_0);
    v16.Position = UDim2.new(l_v105_0, 0, v104, 0);
end;
local function v126()
    local function _(v111)
        local v112 = game.Workspace.CurrentCamera.ViewportSize[v111];
        local v113 = 0.5;
        local v114 = 0.5;
        if v18 < v112 then
            local v115 = math.clamp(v16.AbsolutePosition[v111], 0, v112 - v18);
            v113 = v115 / (v112 - v18);
            v114 = (v115 + v113 * v18) / v112;
        end;
        plugin:SetSetting("ViewSelector_Position" .. v111, v113);
        return v113, v114;
    end;
    local l_X_1 = game.Workspace.CurrentCamera.ViewportSize.X;
    local v118 = 0.5;
    local v119 = 0.5;
    if v18 < l_X_1 then
        local v120 = math.clamp(v16.AbsolutePosition.X, 0, l_X_1 - v18);
        v118 = v120 / (l_X_1 - v18);
        v119 = (v120 + v118 * v18) / l_X_1;
    end;
    plugin:SetSetting("ViewSelector_Position" .. "X", v118);
    local l_v118_0 = v118;
    local l_v119_0 = v119;
    v119 = game.Workspace.CurrentCamera.ViewportSize.Y;
    local v123 = 0.5;
    local v124 = 0.5;
    if v18 < v119 then
        local v125 = math.clamp(v16.AbsolutePosition.Y, 0, v119 - v18);
        v123 = v125 / (v119 - v18);
        v124 = (v125 + v123 * v18) / v119;
    end;
    plugin:SetSetting("ViewSelector_Position" .. "Y", v123);
    l_X_1 = v123;
    v118 = v124;
    v16.AnchorPoint = Vector2.new(l_v118_0, l_X_1);
    v16.Position = UDim2.new(l_v119_0, 0, v118, 0);
end;
local function v128(v127)
    if not (not (v127.UserInputType == Enum.UserInputType.MouseButton1) or not v11) then
        v11 = nil;
        v126();
    end;
end;
local function v131(v129, v130)
    v11 = Vector2.new(v129, v130);
    v12 = v16.Position;
end;
local function _(v132)
    local l_CurrentCamera_0 = game.Workspace.CurrentCamera;
    local l_Position_0 = l_CurrentCamera_0.Focus.Position;
    local v135 = l_Position_0 - v132.LookVector * (l_Position_0 - l_CurrentCamera_0.CFrame.Position).Magnitude;
    v32 = l_Position_0;
    v31 = v132 + v135;
    v30 = l_CurrentCamera_0.CFrame;
    v29 = 0;
end;
local function v144(v137, v138)
    if v11 then
        local v139 = math.abs(v11.x - v137) + math.abs(v11.y - v138);
        v11 = nil;
        if v139 <= 5 then
            if v13 then
                local v140 = v33[v13.Name];
                local l_CurrentCamera_1 = game.Workspace.CurrentCamera;
                local l_Position_1 = l_CurrentCamera_1.Focus.Position;
                local v143 = l_Position_1 - v140.LookVector * (l_Position_1 - l_CurrentCamera_1.CFrame.Position).Magnitude;
                v32 = l_Position_1;
                v31 = v140 + v143;
                v30 = l_CurrentCamera_1.CFrame;
                v29 = 0;
                return ;
            end;
        else
            v126();
        end;
        return ;
    else
        return ;
    end;
end;
local function _()
    local function v150(v145, v146)
        local v147 = v19.CFrame * v146;
        if v146:Dot(v10.LookVector) < 0 then
            v145.ZIndex = v17.ZIndex + 1;
        else
            v145.ZIndex = v17.ZIndex - 1;
        end;
        local v148, v149 = v14:WorldToViewportPoint(v147);
        if not v149 then
            v145.Visible = false;
            return ;
        else
            v145.Visible = true;
            v145.Position = UDim2.new(0, v148.x * v18, 0, v148.y * v18);
            return ;
        end;
    end;
    v150(v20, v23);
    v150(v21, v24);
    v150(v22, v25);
end;
local function v161(v152)
    local l_CurrentCamera_2 = game.Workspace.CurrentCamera;
    if v29 then
        v29 = v29 + v152;
        if v29 > 0.2 then
            l_CurrentCamera_2.CFrame = v31;
            l_CurrentCamera_2.Focus = CFrame.new(v32);
            v29 = nil;
        else
            l_CurrentCamera_2.CFrame = v30:Lerp(v31, v29 / 0.2);
        end;
    end;
    local l_CFrame_0 = l_CurrentCamera_2.CFrame;
    v14.CFrame = CFrame.fromMatrix(-l_CFrame_0.LookVector * 1.9, l_CFrame_0.RightVector, l_CFrame_0.UpVector, -l_CFrame_0.LookVector);
    if v14.CFrame ~= v10 then
        v10 = v14.CFrame;
        v17.LightDirection = (v10 - v10.Position):ToWorldSpace(CFrame.new(-1, -1, -1)).Position;
        local function v160(v155, v156)
            local v157 = v19.CFrame * v156;
            if v156:Dot(v10.LookVector) < 0 then
                v155.ZIndex = v17.ZIndex + 1;
            else
                v155.ZIndex = v17.ZIndex - 1;
            end;
            local v158, v159 = v14:WorldToViewportPoint(v157);
            if not v159 then
                v155.Visible = false;
                return ;
            else
                v155.Visible = true;
                v155.Position = UDim2.new(0, v158.x * v18, 0, v158.y * v18);
                return ;
            end;
        end;
        v160(v20, v23);
        v160(v21, v24);
        v160(v22, v25);
        v89();
    end;
end;
local function v163(v162)
    if v15.Enabled == v162 then
        return ;
    else
        plugin:SetSetting("ViewSelector_Active", v162);
        if not v162 then
            l_RunService_0:UnbindFromRenderStep("ViewSelectorAfterCamera");
        else
            pcall(function()
                l_ContentProvider_0:PreloadAsync({
                    v15
                });
            end);
            v161(0);
            l_RunService_0:BindToRenderStep("ViewSelectorAfterCamera", Enum.RenderPriority.Camera.Value + 1, v161);
            v110();
        end;
        l_Button_0:SetActive(v162);
        v15.Enabled = v162;
        return ;
    end;
end;
local function v164()
    v9 = not v9;
    v163(v9);
end;
local function v173(v165, v166)
    v165.MouseButton1Click:connect(function()
        local v167 = CFrame.fromAxisAngle(-v10.RightVector * v166.y + v10.UpVector * v166.x, 1.5707963267948966) * v10.LookVector;
        local v168 = v61(-v167 * 2, v167);
        if v168 then
            local v169 = v33[v72(v168)];
            local l_CurrentCamera_3 = game.Workspace.CurrentCamera;
            local l_Position_2 = l_CurrentCamera_3.Focus.Position;
            local v172 = l_Position_2 - v169.LookVector * (l_Position_2 - l_CurrentCamera_3.CFrame.Position).Magnitude;
            v32 = l_Position_2;
            v31 = v169 + v172;
            v30 = l_CurrentCamera_3.CFrame;
            v29 = 0;
        end;
    end);
    v165.MouseButton1Up:connect(v144);
    v165.MouseEnter:Connect(function()
        v165.ImageColor3 = Color3.fromRGB(79, 178, 229);
        v165.ImageTransparency = 0;
    end);
    v165.MouseLeave:Connect(function()
        v165.ImageColor3 = Color3.fromRGB(247, 249, 255);
        v165.ImageTransparency = 0.6;
    end);
end;
if l_RunService_0:IsEdit() or l_RunService_0:IsServer() then
    v47();
    v163(v9);
    l_Button_0.Click:connect(v164);
    v28.MouseMoved:connect(v85);
    v28.MouseEnter:connect(v90);
    v28.MouseLeave:connect(v92);
    v28.MouseButton1Down:connect(v131);
    v28.MouseButton1Up:connect(v144);
    l_UserInputService_0.InputChanged:connect(v96);
    l_UserInputService_0.InputEnded:connect(v128);
    v173(v26.RightArrow, Vector2.new(1, 0));
    v173(v26.LeftArrow, Vector2.new(-1, 0));
    v173(v26.UpArrow, Vector2.new(0, 1));
    v173(v26.DownArrow, Vector2.new(0, -1));
    if not game:GetEngineFeature("NewCameraControls") then
        v16:WaitForChild("CamSpeed"):Destroy();
    else
        local v174 = TweenInfo.new(0.2, Enum.EasingStyle.Linear);
        local l_CamSpeed_0 = v16:WaitForChild("CamSpeed");
        local l_Slider_0 = l_CamSpeed_0:WaitForChild("Slider");
        local l_X_2 = l_CamSpeed_0.AbsoluteSize.X;
        local v178 = l_TweenService_0:Create(l_CamSpeed_0, v174, {
            TextTransparency = 1,
            BackgroundTransparency = 1
        });
        local v179 = l_TweenService_0:Create(l_Slider_0, v174, {
            BackgroundTransparency = 1
        });
        local v180 = nil;
        local v181 = {
            mouseOverViewSelector = false,
            mouseOverSlider = false,
            isDraggingSlider = false
        };
        do
            local l_v180_0 = v180;
            local function v183()
                v178:Cancel();
                v179:Cancel();
                if l_v180_0 then
                    task.cancel(l_v180_0);
                end;
                l_CamSpeed_0.TextTransparency = 0.1;
                l_Slider_0.BackgroundTransparency = 0.1;
                if not v181.isDraggingSlider then
                    l_CamSpeed_0.BackgroundTransparency = 0.6;
                else
                    l_CamSpeed_0.BackgroundTransparency = 0.4;
                end;
                if not v181.mouseOverSlider and not v181.isDraggingSlider then
                    l_CamSpeed_0.UIStroke.Transparency = 1;
                else
                    l_CamSpeed_0.UIStroke.Transparency = 0.1;
                end;
                if not ((v181.mouseOverViewSelector or v181.mouseOverSlider) or v181.isDraggingSlider) then
                    l_v180_0 = task.delay(3.5, function()
                        v178:Play();
                        v179:Play();
                    end);
                end;
            end;
            local function v185()
                local v184 = settings().Studio["Camera Speed"];
                l_CamSpeed_0.Text = string.format("%.1f", v184);
                l_Slider_0.Size = UDim2.new(0, math.max(10, (math.min((v184 / 20) * l_X_2, l_X_2))), 1, 0);
            end;
            settings().Studio:GetPropertyChangedSignal("Camera Speed"):Connect(function()
                v185();
                v183();
            end);
            v28.MouseEnter:Connect(function()
                v181.mouseOverViewSelector = true;
                v183();
            end);
            v28.MouseLeave:Connect(function()
                v181.mouseOverViewSelector = false;
                v183();
            end);
            l_CamSpeed_0.MouseEnter:Connect(function()
                v181.mouseOverSlider = true;
                v183();
            end);
            l_CamSpeed_0.MouseLeave:Connect(function()
                v181.mouseOverSlider = false;
                v183();
            end);
            l_CamSpeed_0.MouseButton1Down:Connect(function()
                v181.isDraggingSlider = true;
                v183();
                while true do
                    settings().Studio["Camera Speed"] = math.min(20, (math.max(0.1, ((l_UserInputService_0:GetMouseLocation().X - l_CamSpeed_0.AbsolutePosition.X) / l_X_2) * 20)));
                    l_RunService_0.RenderStepped:Wait();
                    if not l_UserInputService_0:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
                        break;
                    end;
                end;
                v181.isDraggingSlider = false;
                v183();
            end);
            v185();
            l_CamSpeed_0.BackgroundTransparency = 1;
            l_CamSpeed_0.TextTransparency = 1;
            l_CamSpeed_0.UIStroke.Transparency = 1;
            l_Slider_0.BackgroundTransparency = 1;
        end;
    end;
    return ;
else
    l_Button_0.Enabled = false;
    return ;
end;


game:DefineFastFlag("EnableWindControlPlugin3", false);
game:DefineFastFlag("DisableWindControlAnimation", false);
game:DefineFastFlag("EnableWindControlPluginPropertyButton", false);
game:DefineFastFlag("EnableWindControlPluginRibbonButton", false);
game:DefineFastFlag("EnableWindControlRBXTelemetry", false);
return nil;


if plugin then
    require(script.Parent.defineLuaFlags);
    require(script.Parent.commonInit)();
    local l_Parent_0 = script.Parent.Parent;
    local v1 = require(l_Parent_0.Packages.TestLoader);
    v1.launch("WindControl", l_Parent_0.Src);
    if not v1.isCli() then
        if game:GetFastFlag("EnableWindControlPlugin3") then
            local v2 = require(l_Parent_0.Packages.React);
            local v3 = require(l_Parent_0.Packages.ReactRoblox);
            local v4 = require(l_Parent_0.Packages.Framework);
            local v5 = require(l_Parent_0.Src.MainPlugin);
            local v6 = nil;
            local v7 = nil;
            if v1.hasInternalPermission() then
                v7 = v4.DeveloperTools.forPlugin(l_Parent_0.Name, plugin);
            end;
            local function v9()
                plugin.Name = l_Parent_0.Name;
                local v8 = v2.createElement(v5, {
                    Plugin = plugin
                });
                v6 = v3.createRoot(Instance.new("Frame"));
                v6:render(v8);
                if v7 then
                    v7:addRoactTree("Roact tree", v6);
                end;
            end;
            plugin.Unloading:Connect(function()
                if v7 then
                    v7:destroy();
                end;
                if v6 then
                    v6:render(nil);
                end;
            end);
            v9();
            return ;
        else
            return ;
        end;
    else
        return ;
    end;
else
    return ;
end;