local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local l_Pane_0 = v1.UI.Pane;
local l_Parent_1 = script.Parent;
local v9 = require(l_Parent_1.LabeledToggle);
local v10 = require(l_Parent_1.VectorTextInput);
local v11 = require(l_Parent_1.VolumeDragger);
local v12 = require(l_Parent_0.Src.Util.Constants);
local _ = function(v13, v14)
    if v14 then
        local _ = 1;
        return (v13.X * v13.Y) * v13.Z <= v14;
    else
        return true;
    end;
end;
local function v25(v17, v18, v19)
    for _, v21 in pairs(v19) do
        for _, v23 in pairs(v21) do
            if not v23 then
                return false;
            end;
        end;
    end;
    if v18 then
        local _ = 1;
        return (v17.X * v17.Y) * v17.Z <= v18;
    else
        return true;
    end;
end;
local function _(v26, v27, v28)
    if v27 == "X" then
        return (Vector3.new(v28, v26.Y, v26.Z));
    elseif v27 == "Y" then
        return (Vector3.new(v26.X, v28, v26.Z));
    elseif v27 == "Z" then
        return (Vector3.new(v26.X, v26.Y, v28));
    else
        return Vector3.zero;
    end;
end;
local v30 = v3.PureComponent:extend(script.Name);
v30.init = function(v31)
    v31.validFieldState = {
        Position = {
            X = true,
            Y = true,
            Z = true
        },
        Size = {
            X = true,
            Y = true,
            Z = true
        },
        Rotation = {
            X = true,
            Y = true,
            Z = true
        }
    };
    v31.warnings = {};
    local function _(v32, v33, v34)
        local l_props_0 = v31.props;
        local v36;
        if v32 == "Size" then
            local l_Size_0 = l_props_0.Size;
            v36 = if v33 == "X" then Vector3.new(v34, l_Size_0.Y, l_Size_0.Z) else if v33 == "Y" then Vector3.new(l_Size_0.X, v34, l_Size_0.Z) else if v33 == "Z" then Vector3.new(l_Size_0.X, l_Size_0.Y, v34) else Vector3.zero;
        else
            v36 = l_props_0.Size;
        end;
        local v38 = v25(v36, v31.props.MaxVolume, v31.validFieldState);
        if l_props_0.SetMapSettingsValid then
            l_props_0.SetMapSettingsValid(v38);
        end;
        return v38;
    end;
    local function v54(v40, v41, v42, v43, v44)
        local l_props_1 = v31.props;
        if v43 or not l_props_1.SetWarnings then
            local l_Position_0 = l_props_1.Transform.Position;
            local v47 = Vector3.new(l_props_1.Transform:ToEulerAnglesXYZ());
            local l_Size_1 = l_props_1.Size;
            if v40 == "Position" then
                local l_l_Position_0_0 = l_Position_0;
                l_Position_0 = if v41 == "X" then Vector3.new(v42, l_l_Position_0_0.Y, l_l_Position_0_0.Z) else if v41 == "Y" then Vector3.new(l_l_Position_0_0.X, v42, l_l_Position_0_0.Z) else if v41 == "Z" then Vector3.new(l_l_Position_0_0.X, l_l_Position_0_0.Y, v42) else Vector3.zero;
            elseif v40 == "Size" then
                local l_l_Size_1_0 = l_Size_1;
                l_Size_1 = if v41 == "X" then Vector3.new(v42, l_l_Size_1_0.Y, l_l_Size_1_0.Z) else if v41 == "Y" then Vector3.new(l_l_Size_1_0.X, v42, l_l_Size_1_0.Z) else if v41 == "Z" then Vector3.new(l_l_Size_1_0.X, l_l_Size_1_0.Y, v42) else Vector3.zero;
            elseif v40 == "Rotation" then
                local l_v47_0 = v47;
                local v52 = (v42 * 3.141592653589793) / 180;
                v47 = if v41 == "X" then Vector3.new(v52, l_v47_0.Y, l_v47_0.Z) else if v41 == "Y" then Vector3.new(l_v47_0.X, v52, l_v47_0.Z) else if v41 == "Z" then Vector3.new(l_v47_0.X, l_v47_0.Y, v52) else Vector3.zero;
            else
                warn("MapSettings dispatchVectorChanged unknown vector", v40);
            end;
            if v44 then
                local v53 = CFrame.Angles(v47.X, v47.Y, v47.Z) + l_Position_0;
                v31:setState({
                    Size = l_Size_1,
                    Transform = v53
                });
                l_props_1.SetRegion(v53, l_Size_1);
            end;
            return ;
        else
            if l_props_1.SetWarnings then
                v2.Dictionary.join(v31.warnings, {
                    [v40 .. v41] = not v43
                });
                l_props_1.SetWarnings(v31.warnings);
            end;
            return ;
        end;
    end;
    v31.onVectorFocusLost = function(v55, v56, _, v58, v59)
        if utf8.len(v58) > 0 then
            local l_props_2 = v31.props;
            local v61;
            if v55 == "Size" then
                local l_Size_2 = l_props_2.Size;
                v61 = if v56 == "X" then Vector3.new(v58, l_Size_2.Y, l_Size_2.Z) else if v56 == "Y" then Vector3.new(l_Size_2.X, v58, l_Size_2.Z) else if v56 == "Z" then Vector3.new(l_Size_2.X, l_Size_2.Y, v58) else Vector3.zero;
            else
                v61 = l_props_2.Size;
            end;
            local v63 = v25(v61, v31.props.MaxVolume, v31.validFieldState);
            if l_props_2.SetMapSettingsValid then
                l_props_2.SetMapSettingsValid(v63);
            end;
            if v63 then
                v54(v55, v56, v58, v59, true);
            end;
        end;
    end;
    v31.onVectorValueChanged = function(v64, v65, v66, v67)
        v31.validFieldState[v64][v65] = v67;
        local l_props_3 = v31.props;
        local v69;
        if v64 == "Size" then
            local l_Size_3 = l_props_3.Size;
            v69 = if v65 == "X" then Vector3.new(v66, l_Size_3.Y, l_Size_3.Z) else if v65 == "Y" then Vector3.new(l_Size_3.X, v66, l_Size_3.Z) else if v65 == "Z" then Vector3.new(l_Size_3.X, l_Size_3.Y, v66) else Vector3.zero;
        else
            v69 = l_props_3.Size;
        end;
        local v71 = v25(v69, v31.props.MaxVolume, v31.validFieldState);
        if l_props_3.SetMapSettingsValid then
            l_props_3.SetMapSettingsValid(v71);
        end;
        v54(v64, v65, v66, v67, false);
    end;
    v31.setRegion = function(v72)
        v31:setState({
            Size = v72.size,
            Transform = v72.transform
        });
    end;
end;
v30.render = function(v73)
    local l_props_4 = v73.props;
    local l_LayoutOrder_0 = l_props_4.LayoutOrder;
    local l_Localization_0 = l_props_4.Localization;
    local l_Region_0 = l_props_4.Region;
    local l_SetSnapToVoxels_0 = l_props_4.SetSnapToVoxels;
    local v79 = v73.state.Size or l_props_4.Size;
    local l_ShowRotation_0 = l_props_4.ShowRotation;
    local l_ShowTooltip_0 = l_props_4.ShowTooltip;
    local l_SnapToVoxels_0 = l_props_4.SnapToVoxels;
    local l_SourceTransform_0 = l_props_4.SourceTransform;
    local l_SourceSize_0 = l_props_4.SourceSize;
    local l_ToolName_0 = l_props_4.ToolName;
    local v86 = v73.state.Transform or l_props_4.Transform;
    local v87 = not l_props_4.HideWireframe;
    local v88 = if not v86 then nil else v86.Position;
    local v89 = if not not l_ShowRotation_0 and v86 then (Vector3.new(v86:ToEulerAnglesXYZ()) * 180) / 3.141592653589793 else nil;
    local v90 = l_LayoutOrderIterator_0.new();
    local l_MaxVolume_0 = v73.props.MaxVolume;
    local v92;
    if l_MaxVolume_0 then
        local _ = 1;
        v92 = (v79.X * v79.Y) * v79.Z <= l_MaxVolume_0;
    else
        v92 = true;
    end;
    local v94 = not v92;
    v92 = not l_SnapToVoxels_0 and 3 or 0;
    return v3.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        Layout = Enum.FillDirection.Vertical,
        LayoutOrder = l_LayoutOrder_0,
        Size = UDim2.fromScale(1, 0),
        Spacing = 12
    }, {
        PositionInput = if not v88 then nil else v3.createElement(v10, {
            LayoutOrder = v90:getNextOrder(),
            Text = l_Localization_0:getText("RegionSettings", "Position"),
            Key = "Position",
            Vector = v88,
            Precisions = {
                X = v92,
                Y = v92,
                Z = v92
            },
            OnFocusLost = v73.onVectorFocusLost,
            OnValueChanged = v73.onVectorValueChanged
        }),
        SizeInput = if not v79 then nil else v3.createElement(v10, {
            LayoutOrder = v90:getNextOrder(),
            Text = l_Localization_0:getText("RegionSettings", "Size"),
            Key = "Size",
            Vector = v79,
            MinValues = {
                X = v12.REGION_MIN_SIZE,
                Y = v12.REGION_MIN_SIZE,
                Z = v12.REGION_MIN_SIZE
            },
            MaxValues = {
                X = v12.REGION_MAX_SIZE,
                Y = v12.REGION_MAX_SIZE,
                Z = v12.REGION_MAX_SIZE
            },
            Precisions = {
                X = v92,
                Y = v92,
                Z = v92
            },
            OnFocusLost = v73.onVectorFocusLost,
            OnValueChanged = v73.onVectorValueChanged,
            ErrorMessage = v94 and l_Localization_0:getText("Warning", "VolumeTooLarge")
        }),
        Rotation = if not v89 then nil else v3.createElement(v10, {
            LayoutOrder = v90:getNextOrder(),
            Text = l_Localization_0:getText("RegionSettings", "Rotation"),
            Key = "Rotation",
            Vector = v89,
            Precisions = {
                X = 0,
                Y = 0,
                Z = 0
            },
            OnFocusLost = v73.onVectorFocusLost,
            OnValueChanged = v73.onVectorValueChanged
        }),
        SnapToVoxels = if not l_SetSnapToVoxels_0 then nil else v3.createElement(v9, {
            LayoutOrder = v90:getNextOrder(),
            Text = l_Localization_0:getText("RegionSettings", "SnapToVoxels"),
            IsOn = l_SnapToVoxels_0,
            SetIsOn = l_SetSnapToVoxels_0
        }),
        Dragger = if not not v86 and v79 then v3.createElement(v11, {
            TargetCFrame = v86,
            TargetSize = v79,
            Region = l_Region_0,
            SetRegion = function(v95, v96)
                if v96 then
                    l_props_4.SetRegion(v95.transform, v95.size);
                end;
                v73.setRegion(v95);
            end,
            ShowRotation = l_ShowRotation_0,
            SnapToVoxels = not l_SetSnapToVoxels_0 and true or l_SnapToVoxels_0,
            SourceCFrame = l_SourceTransform_0 or v86,
            SourceSize = l_SourceSize_0 or v79,
            ShowTooltip = l_ShowTooltip_0,
            Tool = l_ToolName_0,
            Wireframe = v87
        }) else nil
    });
end;
return (l_withContext_0({
    Localization = l_ContextServices_0.Localization
})(v30));


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_ToolId_0 = require(l_Parent_0.Src.Util.TerrainEnums).ToolId;
local l_Parent_1 = script.Parent;
local v7 = require(l_Parent_1.LabeledElementPair);
local v8 = require(l_Parent_1.SingleSelectButtonGroup);
local v9 = v2.PureComponent:extend("ReplaceModeSelector");
v9.render = function(v10)
    local l_props_0 = v10.props;
    local l_Localization_0 = l_props_0.Localization;
    return v2.createElement(v7, {
        Size = UDim2.new(1, 0, 0, 22),
        Text = l_Localization_0:getText("BrushSettings", "MaterialMode"),
        LayoutOrder = l_props_0.LayoutOrder
    }, {
        v2.createElement(v8, {
            Size = UDim2.new(1, 0, 0, 22),
            Selected = l_props_0.ReplaceMode,
            Select = l_props_0.SetReplaceMode,
            Options = {
                {
                    Text = if l_props_0.Tool == l_ToolId_0.Paint then l_Localization_0:getText("BrushSettings", "Paint") else l_Localization_0:getText("BrushSettings", "Fill"),
                    Data = false
                },
                {
                    Text = l_Localization_0:getText("BrushSettings", "Replace"),
                    Data = true
                }
            }
        })
    });
end;
return (l_withContext_0({
    Localization = l_ContextServices_0.Localization
})(v9));


local v0 = require(script.Parent.Parent.Parent.Parent.Parent.Packages.Roact);
local v1 = Color3.fromRGB(227, 227, 227);
local v2 = v0.PureComponent:extend("SelectableImageButton");
v2.init = function(v3)
    v3.selectItem = function()
        v3.props.SelectItem(v3.props.Item);
    end;
end;
v2.render = function(v4)
    local l_props_0 = v4.props;
    return v0.createElement("ImageButton", {
        LayoutOrder = l_props_0.LayoutOrder,
        Size = l_props_0.Size or UDim2.new(0, 32, 0, 32),
        BackgroundColor3 = l_props_0.BackgroundColor3,
        BackgroundTransparency = not not l_props_0.IsSelected and (l_props_0.SelectedTransparency or 0.5) or 1,
        BorderColor3 = v1,
        Image = l_props_0.Image,
        [v0.Event.Activated] = v4.selectItem
    });
end;
return v2;


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local l_withContext_0 = v1.ContextServices.withContext;
local v4 = require(l_Parent_0.Src.ContextItems);
local v5 = nil;
v5 = v2.PureComponent:extend("SingleSelectButton");
v5.init = function(v6)
    v6.state = {
        isHovered = false
    };
    v6.onMouseEnter = function()
        v6:setState({
            isHovered = true
        });
    end;
    v6.onMouseLeave = function()
        v6:setState({
            isHovered = false
        });
    end;
    v6.onActivated = function()
        if not v6.props.IsSelected then
            v6.props.Select(v6.props.Data);
        end;
    end;
end;
v5.render = function(v7)
    local l_LayoutOrder_0 = v7.props.LayoutOrder;
    local l_Width_0 = v7.props.Width;
    local l_IsLeftmost_0 = v7.props.IsLeftmost;
    local l_IsRightmost_0 = v7.props.IsRightmost;
    local l_IsSelected_0 = v7.props.IsSelected;
    local l_isHovered_0 = v7.state.isHovered;
    local v14 = v7.props.Theme:get();
    local l_buttonSelectedColor_0 = v14.singleSelectButtonGroupTheme.buttonSelectedColor;
    local l_buttonHoveredColor_0 = v14.singleSelectButtonGroupTheme.buttonHoveredColor;
    local v17 = l_IsSelected_0 or l_isHovered_0;
    local v18 = not not l_IsSelected_0 and l_buttonSelectedColor_0 or l_buttonHoveredColor_0;
    return v2.createElement("ImageButton", {
        Position = UDim2.new((l_LayoutOrder_0 - 1) * l_Width_0, 0, 0, 0),
        Size = UDim2.new(l_Width_0, 0, 1, 0),
        AutoButtonColor = false,
        BackgroundTransparency = 1,
        BorderSizePixel = 0,
        [v2.Event.Activated] = v7.onActivated,
        [v2.Event.MouseEnter] = v7.onMouseEnter,
        [v2.Event.MouseLeave] = v7.onMouseLeave
    }, {
        BackgroundContents = v17 and v2.createFragment({
            LeftBackground = l_IsLeftmost_0 and v2.createElement("ImageLabel", {
                Position = UDim2.new(0, 0, 0, 0),
                Size = UDim2.new(0, 8, 1, 0),
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                ImageTransparency = 0,
                Image = v14.singleSelectButtonGroupTheme.roundedBackgroundImage,
                ImageColor3 = v18,
                ScaleType = Enum.ScaleType.Slice,
                SliceCenter = v14.singleSelectButtonGroupTheme.roundedElementSlice
            }),
            RightBackground = l_IsRightmost_0 and v2.createElement("ImageLabel", {
                AnchorPoint = Vector2.new(1, 0),
                Position = UDim2.new(1, 0, 0, 0),
                Size = UDim2.new(0, 8, 1, 0),
                BackgroundTransparency = 1,
                BorderSizePixel = 0,
                ImageTransparency = 0,
                Image = v14.singleSelectButtonGroupTheme.roundedBackgroundImage,
                ImageColor3 = v18,
                ScaleType = Enum.ScaleType.Slice,
                SliceCenter = v14.singleSelectButtonGroupTheme.roundedElementSlice
            }),
            Background = v2.createElement("Frame", {
                Position = not not l_IsLeftmost_0 and UDim2.new(0, 4, 0, 0) or UDim2.new(0, 0, 0, 0),
                Size = ((not not l_IsLeftmost_0 and l_IsRightmost_0) and UDim2.new(1, -8, 1, 0) or (l_IsLeftmost_0 or l_IsRightmost_0) and UDim2.new(1, -4, 1, 0)) or UDim2.new(1, 0, 1, 0),
                BackgroundColor3 = v18,
                BorderSizePixel = 0
            })
        }),
        Label = v2.createElement("TextLabel", {
            Size = UDim2.new(1, 0, 1, 0),
            BackgroundTransparency = 1,
            BorderSizePixel = 0,
            Text = v7.props.Text,
            TextSize = v14.textSize,
            Font = v14.font,
            TextColor3 = v14.textColor,
            ZIndex = 3
        })
    });
end;
v5 = l_withContext_0({
    Theme = v4.DEPRECATED_Theme
})(v5);
local v19 = v2.PureComponent:extend("SingleSelectButtonGroup");
v19.render = function(v20)
    local l_props_0 = v20.props;
    local v22 = l_props_0.Theme:get();
    local l_Size_0 = l_props_0.Size;
    local v24 = l_props_0.Options or {};
    local v25 = #v24;
    local v26 = 1 / v25;
    local l_Selected_0 = v20.props.Selected;
    local _ = v22.singleSelectButtonGroupTheme.buttonSelectedColor;
    local v29 = {};
    for v30, v31 in ipairs(v24) do
        v29[tostring(v31.Data)] = v2.createElement(v5, {
            LayoutOrder = v30,
            Width = v26,
            IsSelected = v31.Data == l_Selected_0,
            IsLeftmost = v30 == 1,
            IsRightmost = v30 == v25,
            Data = v31.Data,
            Text = v31.Text,
            Select = v20.props.Select
        });
    end;
    for v32 = 1, v25 - 1 do
        v29["Divider" .. v32] = v2.createElement("Frame", {
            AnchorPoint = Vector2.new(0.5, 0),
            Position = UDim2.new(v32 * v26, 0, 0, 0),
            Size = UDim2.new(0, 1, 1, 0),
            BorderSizePixel = 0,
            BackgroundColor3 = v22.borderColor,
            ZIndex = 2
        });
    end;
    v29.Border = v2.createElement("ImageLabel", {
        Size = UDim2.new(1, 0, 1, 0),
        BackgroundTransparency = 1,
        Image = v22.singleSelectButtonGroupTheme.roundedBorderImage,
        ImageTransparency = 0,
        ImageColor3 = v22.borderColor,
        ScaleType = Enum.ScaleType.Slice,
        SliceCenter = v22.singleSelectButtonGroupTheme.roundedElementSlice,
        ZIndex = 3
    });
    return v2.createElement("Frame", {
        AnchorPoint = l_props_0.AnchorPoint,
        Position = l_props_0.Position,
        Size = l_Size_0,
        BackgroundTransparency = 1
    }, v29);
end;
return (l_withContext_0({
    Theme = v4.DEPRECATED_Theme
})(v19));


local v0 = require(script.Parent.Parent.Parent.Parent.Parent.Packages.Roact);
local v1 = require(script.Parent.LabeledTextInput);
local v2 = Rect.new(3, 0, 4, 6);
local v3 = UDim2.new(0, 140, 0, 22);
local v4 = UDim2.new(0, 94, 0, 4);
local v5 = UDim2.new(0, 13, 0, 13);
local v6 = UDim2.new(0, 34, 0, 22);
local v7 = Color3.fromRGB(151, 151, 151);
local v8 = v0.PureComponent:extend("Slider");
v8.init = function(v9)
    v9.state = {
        darkTheme = settings().Studio.Theme.Name == "Dark",
        pressed = false
    };
    v9.sliderFrameRef = v0.createRef();
    v9.getOffset = function()
        local v10 = v9.props.Min or 0;
        local v11 = v9.props.Max or 100;
        assert(v10 <= v11, "Expected min to be smaller or equal to max");
        local v12 = v9.props.Value or 0;
        local v13 = v11 - v10;
        if v13 == 0 then
            return 0;
        else
            return (v12 - v10) / v13;
        end;
    end;
    v9.getSnappedValue = function(v14)
        local v15 = v9.props.Min or 0;
        local v16 = v9.props.Max or 100;
        assert(v15 <= v16, "Expected min to be smaller or equal to max");
        local v17 = v9.props.SnapIncrement or 0;
        if v17 > 0.001 then
            local v18 = math.max(v17 * math.floor(v14 / v17), v15);
            local v19 = math.min(v18 + v17, v16);
            v14 = math.abs(v18 - v14) < math.abs(v19 - v14) and v18 or v19;
        end;
        return (math.min(v16, (math.max(v15, v14))));
    end;
    v9.getMouseClickValue = function(v20)
        local v21 = v9.props.Min or 0;
        local v22 = v9.props.Max or 100;
        assert(v21 <= v22, "Expected min to be smaller or equal to max");
        return v9.getSnappedValue(v21 + math.max(0, (math.min(1, (v20.Position.X - v9.sliderFrameRef.current.AbsolutePosition.X) / v9.sliderFrameRef.current.AbsoluteSize.X))) * (v22 - v21));
    end;
    v9.setValueFromInput = function(v23)
        v9.props.SetValue((v9.getMouseClickValue(v23)));
    end;
    v9.setValue = function(v24)
        v9.props.SetValue((v9.getSnappedValue(v24)));
    end;
    v9.isEnabled = function()
        if not v9.props.Enabled then
            if v9.props.Enabled == nil then
                return true;
            else
                return false;
            end;
        else
            return true;
        end;
    end;
    v9.onInputBegan = function(_, v26)
        if v9.isEnabled() and v26.UserInputType == Enum.UserInputType.MouseButton1 then
            v9:setState({
                pressed = true
            });
            v9.setValueFromInput(v26);
        end;
    end;
    v9.onInputChanged = function(_, v28)
        if not (not v9.isEnabled() or not v9.state.pressed) and v28.UserInputType == Enum.UserInputType.MouseMovement then
            v9.setValueFromInput(v28);
        end;
    end;
    v9.onInputEnded = function(_, v30)
        if v9.isEnabled() and v30.UserInputType == Enum.UserInputType.MouseButton1 then
            v9:setState({
                pressed = false
            });
        end;
    end;
    v9.onInputFocusLost = function(_, v32)
        local v33 = tonumber((string.reverse((string.match(string.reverse(v32), "[0-9]*[%.]?[0-9]*[%-]?")))));
        if not v33 then
            v9.props.SetValue(v9.props.Value or 0);
            return v9.props.Value or 0;
        else
            local v34 = v9.getSnappedValue(v33);
            v9.props.SetValue(v34);
            return v34;
        end;
    end;
    v9.validateInputText = function(v35)
        return (string.gsub(v35, "[^0-9%-%.%+]*", ""));
    end;
    v9.setValue(v9.props.Value or 0);
end;
v8.didMount = function(v36)
    v36.themeChanged = settings().Studio.ThemeChanged:Connect(function()
        v36:setState({
            darkTheme = settings().Studio.Theme.Name == "Dark"
        });
    end);
end;
v8.willUnmount = function(v37)
    if v37.themeChanged then
        v37.themeChanged:Disconnect();
        v37.themeChanged = nil;
    end;
end;
v8.render = function(v38)
    local v39 = v38.props.Value or 0;
    local _ = v38.props.Min or 0;
    local _ = v38.props.Max or 100;
    local v42 = v38.isEnabled();
    local l_ShowInput_0 = v38.props.ShowInput;
    if l_ShowInput_0 == nil then
        l_ShowInput_0 = true;
    end;
    local v44 = v38.props.Size or v3;
    local v45 = v38.props.SliderSize or v4;
    local v46 = v38.props.HandleSize or v5;
    local v47 = v38.props.InputSize or v6;
    if not v38.props.TextColor then
        local _ = v7;
    end;
    local _ = v38.props.TextSize or 15;
    local _ = v38.props.TextLabelHeight or 15;
    local v51 = (v44.Height.Offset - v46.Height.Offset) / 2;
    local v52 = v45.Width.Offset + 12;
    local _ = (v51 + v46.Height.Offset / 2) + 2;
    local v54 = v45.Height.Offset * 2;
    local l_darkTheme_0 = v38.state.darkTheme;
    return v0.createElement("Frame", {
        BackgroundTransparency = 1,
        BorderSizePixel = 0,
        Size = v44
    }, {
        SliderFrame = v0.createElement("Frame", {
            BackgroundTransparency = 1,
            BorderSizePixel = 0,
            Size = UDim2.new(0, v45.Width.Offset, 0, v46.Height.Offset),
            Position = UDim2.new(0, 0, 0, v51),
            [v0.Ref] = v38.sliderFrameRef
        }, {
            ClickHandler = v0.createElement("ImageButton", {
                Size = UDim2.new(1, v46.Width.Offset, 1, not not v38.state.pressed and v54 or 0),
                Position = UDim2.new(0.5, 0, 0.5, 0),
                AnchorPoint = Vector2.new(0.5, 0.5),
                BackgroundTransparency = 1,
                ZIndex = 4,
                [v0.Event.InputBegan] = v38.onInputBegan,
                [v0.Event.InputChanged] = v38.onInputChanged,
                [v0.Event.InputEnded] = v38.onInputEnded
            }),
            HoverHandler = v0.createElement("Frame", {
                Size = UDim2.new(1, v46.Width.Offset, 1, 0),
                Position = UDim2.new(0.5, 0, 0.5, 0),
                AnchorPoint = Vector2.new(0.5, 0.5),
                BackgroundTransparency = 1
            }),
            SliderHandle = v0.createElement("ImageLabel", {
                BackgroundTransparency = 1,
                Size = v46,
                AnchorPoint = Vector2.new(0.5, 0),
                Position = UDim2.new(v38.getOffset(), 0, 0, 0),
                Image = not l_darkTheme_0 and "rbxasset://textures/RoactStudioWidgets/slider_handle_light.png" or "rbxasset://textures/RoactStudioWidgets/slider_handle_dark.png",
                Visible = v42,
                ZIndex = 3
            }),
            BackgroundBar = v0.createElement("ImageLabel", {
                BackgroundTransparency = 1,
                Size = v45,
                Image = not l_darkTheme_0 and "rbxasset://textures/RoactStudioWidgets/slider_bar_background_light.png" or "rbxasset://textures/RoactStudioWidgets/slider_bar_background_dark.png",
                ScaleType = Enum.ScaleType.Slice,
                SliceCenter = v2,
                AnchorPoint = Vector2.new(0, 0.5),
                Position = UDim2.new(0, 0, 0.5, 0)
            }),
            ForegroundBar = v0.createElement("ImageLabel", {
                BackgroundTransparency = 1,
                Size = UDim2.new(v38.getOffset(), 0, 0, v45.Height.Offset),
                Image = not l_darkTheme_0 and "rbxasset://textures/RoactStudioWidgets/slider_bar_light.png" or "rbxasset://textures/RoactStudioWidgets/slider_bar_dark.png",
                ScaleType = Enum.ScaleType.Slice,
                SliceCenter = v2,
                AnchorPoint = Vector2.new(0, 0.5),
                Position = UDim2.new(0, 0, 0.5, 0),
                Visible = v42,
                ZIndex = 2
            })
        }),
        Input = l_ShowInput_0 and v0.createElement(v1, {
            Width = v47.Width,
            Position = UDim2.new(0, v52, 0, 0),
            Text = tostring(v39),
            OnFocusLost = v38.onInputFocusLost,
            ValidateText = v38.validateInputText
        })
    });
end;
return v8;


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Packages.Roact);
local l_withContext_0 = v1.ContextServices.withContext;
local v5 = require(l_Parent_0.Src.ContextItems);
local v6 = v3.PureComponent:extend("ToggleButton");
v6.init = function(v7, _)
    v7.toggle = function()
        if not v7.props.Disabled then
            v7.props.SetIsOn(not v7.props.IsOn);
        end;
    end;
end;
v6.render = function(v9)
    local v10 = v9.props.LayoutOrder or nil;
    local v11 = v9.props.Position or UDim2.new(0, 0, 0, 0);
    local l_Size_0 = v9.props.Size;
    local l_IsOn_0 = v9.props.IsOn;
    return v3.createElement("ImageButton", {
        Position = v11,
        LayoutOrder = v10,
        Size = l_Size_0,
        Image = (not not v9.props.Disabled and (l_IsOn_0 and v9.props.DisabledOnImage or v9.props.DisabledOffImage) or l_IsOn_0 and v9.props.OnImage) or v9.props.OffImage,
        BackgroundTransparency = 1,
        [v3.Event.Activated] = v9.toggle
    });
end;
local v14 = v3.PureComponent:extend("ToggleButton");
v14.render = function(v15)
    local v16 = v15.props.Theme:get();
    return v3.createElement(v6, (v2.Dictionary.join(v15.props, {
        OnImage = v16.toggleTheme.toggleOnImage,
        OffImage = v16.toggleTheme.toggleOffImage,
        DisabledOnImage = v16.toggleTheme.toggleLockModeOnImage,
        DisabledOffImage = v16.toggleTheme.toggleLockModeOffImage,
        Size = UDim2.new(0, 27, 0, 16)
    })));
end;
v14 = l_withContext_0({
    Theme = v5.DEPRECATED_Theme
})(v14);
local v17 = v3.PureComponent:extend("PickerButton");
v17.render = function(v18)
    local v19 = v18.props.Theme:get();
    return v3.createElement(v6, (v2.Dictionary.join(v18.props, {
        OnImage = v19.brushSettingsTheme.pickHeightEnableImage,
        OffImage = v19.brushSettingsTheme.pickHeightDisableImage,
        Size = UDim2.new(0, 18, 0, 18)
    })));
end;
return {
    ToggleButton = v14,
    PickerButton = l_withContext_0({
        Theme = v5.DEPRECATED_Theme
    })(v17)
};


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Pane_0 = v1.UI.Pane;
local v6 = require(l_Parent_0.Src.Util.TerrainEnums);
local v7 = require(script.Parent.SingleSelectButtonGroup);
local v8 = v2.PureComponent:extend("TransformMode");
v8.render = function(v9)
    local l_Localization_0 = v9.props.Localization;
    local _ = v9.props.LayoutOrder;
    return v2.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        HorizontalAlignment = Enum.HorizontalAlignment.Center,
        Size = UDim2.fromScale(1, 0)
    }, {
        ButtonGroup = v2.createElement(v7, {
            AnchorPoint = Vector2.new(0.5, 0),
            Position = UDim2.fromScale(0.5, 0),
            Size = UDim2.new(0, 141, 0, 22),
            Selected = v9.props.TransformMode,
            Select = v9.props.SetTransformMode,
            Options = {
                {
                    Text = l_Localization_0:getText("RegionSettings", "Select"),
                    Data = v6.TransformMode.Select
                },
                {
                    Text = l_Localization_0:getText("RegionSettings", "Transform"),
                    Data = v6.TransformMode.Transform
                }
            }
        })
    });
end;
return (l_withContext_0({
    Localization = l_ContextServices_0.Localization
})(v8));


local v0 = require(script.Parent.Parent.Parent.Parent.Parent.Packages.Roact);
local l_Parent_0 = script.Parent;
local v2 = require(l_Parent_0.LabeledElementPair);
local v3 = require(l_Parent_0.NumberTextInput);
local v4 = v0.PureComponent:extend("VectorTextInput");
v4.init = function(v5, _)
    v5.onAxisFocusLost = function(v7, v8, v9, v10)
        if v5.props.OnFocusLost then
            v5.props.OnFocusLost(v5.props.Key, v7, v8, v9, v10);
        end;
    end;
    v5.onAxisValueChanged = function(v11, v12, v13)
        if v5.props.OnValueChanged then
            v5.props.OnValueChanged(v5.props.Key, v11, v12, v13);
        end;
    end;
end;
v4.render = function(v14)
    local l_props_0 = v14.props;
    local v16 = l_props_0.LayoutOrder or 0;
    local l_Text_0 = l_props_0.Text;
    local v18 = l_props_0.MinValues or nil;
    local v19 = l_props_0.MaxValues or nil;
    local v20 = l_props_0.Precisions or nil;
    local l_Vector_0 = l_props_0.Vector;
    local v22 = l_props_0.Axes or {
        "X",
        "Y",
        "Z"
    };
    local v23 = {};
    for v24, v25 in ipairs(v22) do
        v23[v25] = v0.createElement(v3, {
            LayoutOrder = v24,
            Key = v25,
            Label = v25:upper(),
            Value = l_Vector_0[v25],
            Min = not not v18 and v18[v25] or nil,
            Max = not not v19 and v19[v25] or nil,
            Precision = not not v20 and v20[v25] or nil,
            OnFocusLost = v14.onAxisFocusLost,
            OnValueChanged = v14.onAxisValueChanged
        });
    end;
    return v0.createElement(v2, {
        LayoutOrder = v16,
        Size = UDim2.new(1, 0, 0, 60),
        Padding = UDim.new(0, 3),
        Text = l_Text_0,
        SizeToContent = true,
        ErrorMessage = v14.props.ErrorMessage
    }, v23);
end;
return v4;


local l_Parent_0 = script.Parent.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Roact);
local v2 = require(l_Parent_0.Packages.Framework);
local l_DraggerFramework_0 = l_Parent_0.Packages.DraggerFramework;
local l_ContextServices_0 = v2.ContextServices;
local l_Pane_0 = v2.UI.Pane;
local l_withContext_0 = v2.ContextServices.withContext;
local v7 = require(l_DraggerFramework_0.DraggerTools.DraggerToolComponent);
local v8 = require(l_Parent_0.Src.RegionDraggerSchema);
local v9 = require(l_DraggerFramework_0.Implementation.DraggerContext_PluginImpl);
local v10 = require(l_DraggerFramework_0.Handles.MoveHandles);
local v11 = require(l_DraggerFramework_0.Handles.RotateHandles);
local v12 = require(l_DraggerFramework_0.Handles.ExtrudeHandles);
local v13 = require(l_Parent_0.Src.Components.ApplyTransformNote);
local v14 = require(l_Parent_0.Src.Components.RegionVisual);
local v15 = require(l_Parent_0.Src.ContextItems);
local l_Terrain_0 = v15.Terrain;
local v17 = require(l_Parent_0.Src.Util.Constants);
local v18 = require(l_Parent_0.Src.Util.NormalizeSelection);
local v19 = require(l_Parent_0.Src.Util.getDraggedRegion);
local v20 = require(l_Parent_0.Src.Util.TerrainEnums);
local v21 = require(l_Parent_0.Src.Util.getVoxelAlignedRegion);
local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local l_TerrainEditorOverhaul_0 = game:GetFastFlag("TerrainEditorOverhaul");
local v24 = v1.PureComponent:extend(script.Name);
v24.init = function(v25)
    local l_props_0 = v25.props;
    v25.draggerSelection = v8.Selection.new(l_props_0.TargetCFrame, l_props_0.TargetSize);
    v25.draggerContext = v9.new(l_Parent_0.Parent, game, settings(), v25.draggerSelection);
    v25.draggerUndoStack = {};
    v25.draggerRedoStack = {};
    v25.draggerContext.snapToGridSize = function(v27, v28)
        local l_GridSize_0 = v27._studioService.GridSize;
        local v30 = math.floor(l_GridSize_0 / v17.GRID_SIZE + 0.5) * v17.GRID_SIZE;
        if v30 <= 0 then
            v30 = v17.GRID_SIZE;
        end;
        if math.abs(v30 - v17.DISABLED_GRID_SIZE) < 0.001 then
            return v28;
        elseif v25.props.SnapToVoxels then
            return math.floor(v28 / v30 + 0.5) * v30;
        else
            return math.floor(v28 / l_GridSize_0) * l_GridSize_0;
        end;
    end;
    v25.draggerContext.endSelectionOnDrag = function()
        v25.startPoint = nil;
    end;
    v25.draggerContext.updateRegion = function(v31, v32)
        local l_SetRegion_0 = v25.props.SetRegion;
        local v34 = {
            size = v32,
            transform = v31
        };
        v25.draggerSelection:SetRegion(v34);
        l_SetRegion_0(v34, true);
    end;
    v25.draggerContext.DEPRECATED_updateSelectionOnDrag = function(v35)
        local l_SetRegion_1 = v25.props.SetRegion;
        v25.draggerSelection:SetRegion(v35);
        l_SetRegion_1(v35, true);
    end;
    v25.draggerContext.updateSelectionOnDrag = function(v37, v38)
        local l_SetRegion_2 = v25.props.SetRegion;
        if not v25.startPoint then
            v25.startPoint = v37;
        end;
        local v40 = v19(v25.startPoint, v38);
        v25.draggerSelection:SetRegion(v40);
        l_SetRegion_2(v40, true);
    end;
    v25.draggerContext.addWaypoint = function(v41)
        if not v25.draggerUndoStack[v41] then
            v25.draggerUndoStack[v41] = {};
        end;
        l_ChangeHistoryService_0:SetWaypoint(v41);
        table.insert(v25.draggerUndoStack[v41], v25.lastRegion);
        v25.lastRegion = {
            size = v25.props.TargetSize,
            transform = v25.props.TargetCFrame
        };
    end;
    v25.draggerProps = {
        Mouse = l_Parent_0.Parent:GetMouse(),
        DraggerContext = v25.draggerContext,
        DraggerSchema = v8,
        DraggerSettings = {
            AnalyticsName = "DraggerFrameworkRegionSelect",
            AllowDragSelect = true,
            AllowFreeformDrag = false,
            ShowDragSelect = false,
            ShowLocalSpaceIndicator = true,
            ShowPivotIndicator = true,
            HandlesList = {
                v12.new(v25.draggerContext, {
                    ShowBoundingBox = false,
                    Summonable = false
                }, v8.ExtrudeHandlesImplementation.new(v25.draggerContext)),
                v10.new(v25.draggerContext, {
                    ShowBoundingBox = false,
                    Summonable = false,
                    Outset = 1
                }, v8.TransformHandlesImplementation.new(v25.draggerContext))
            }
        }
    };
    if l_props_0.ShowRotation then
        table.insert(v25.draggerProps.DraggerSettings.HandlesList, v11.new(v25.draggerContext, {
            ShowBoundingBox = false,
            Summonable = false,
            Outset = 1
        }, v8.TransformHandlesImplementation.new(v25.draggerContext)));
    end;
end;
v24.didUpdate = function(v42, v43)
    local l_props_1 = v42.props;
    local l_Region_0 = l_props_1.Region;
    local l_SourceCFrame_0 = l_props_1.SourceCFrame;
    local l_SourceSize_0 = l_props_1.SourceSize;
    local v48 = l_props_1.Terrain:get();
    if not (v42.draggerSelection:Get()[1].Region.transform == l_props_1.TargetCFrame) or v42.draggerSelection:Get()[1].Region.size ~= l_props_1.TargetSize then
        v42.draggerSelection:SetRegionWaypoint({
            transform = l_props_1.TargetCFrame,
            size = l_props_1.TargetSize
        });
    end;
    if v43.SnapToVoxels ~= l_props_1.SnapToVoxels then
        local v49 = math.floor(v42.draggerContext._studioService.GridSize / v17.GRID_SIZE + 0.5) * v17.GRID_SIZE;
        if v49 <= 0 then
            v49 = v17.GRID_SIZE;
        end;
        local v50, v51 = v21(l_props_1.TargetCFrame, l_props_1.TargetSize, v49);
        local v52 = {
            size = v51,
            transform = v50
        };
        v42.draggerSelection:SetRegion(v52);
        v42.props.SetRegion(v52, true);
    end;
    if not (v43.SourceCFrame == l_props_1.SourceCFrame) or v43.SourceSize ~= l_props_1.SourceSize then
        if not l_TerrainEditorOverhaul_0 or not l_Region_0 then
            v42:setState({
                lines = v48:GetTerrainWireframe(l_SourceCFrame_0, l_SourceSize_0)
            });
        else
            l_Region_0.Parent = game:GetService("CoreGui");
            v42:setState({
                lines = l_Region_0:GetRegionWireframe()
            });
            return ;
        end;
    end;
end;
v24.didMount = function(v53)
    local l_props_2 = v53.props;
    local l_Region_1 = l_props_2.Region;
    local l_SourceCFrame_1 = l_props_2.SourceCFrame;
    local l_SourceSize_1 = l_props_2.SourceSize;
    local v58 = l_props_2.Terrain:get();
    v53.activated = l_props_2.PluginActivationController:subscribeToToolActivated(function(v59)
        if v17.ToolUsesRegion[v59] then
            v53.enable();
        end;
    end);
    v53.deactivated = l_props_2.PluginActivationController:subscribeToToolDeactivated(function(v60)
        if v17.ToolUsesRegion[v60] then
            v53.disable();
        end;
    end);
    local v61 = {
        TerrainTransform = true,
        TerrainFill = true,
        TerrainCut = true,
        TerrainDelete = true
    };
    v53.onUndo = l_ChangeHistoryService_0.OnUndo:Connect(function(v62)
        if v53.draggerUndoStack[v62] and #v53.draggerUndoStack[v62] > 0 then
            if not v53.draggerRedoStack[v62] then
                v53.draggerRedoStack[v62] = {};
            end;
            local v63 = v53.draggerUndoStack[v62][#v53.draggerUndoStack[v62]];
            table.insert(v53.draggerRedoStack[v62], {
                transform = v53.props.TargetCFrame,
                size = v53.props.TargetSize
            });
            table.remove(v53.draggerUndoStack[v62], #v53.draggerUndoStack[v62]);
            v53.lastRegion = v63;
            v53.props.SetRegion(v63, false);
        end;
        if v61[v62] then
            if not v53.props.Region then
                if not (not v53.props.SourceCFrame or not v53.props.SourceSize) then
                    v53:setState({
                        lines = v58:GetTerrainWireframe(v53.props.SourceCFrame, v53.props.SourceSize)
                    });
                end;
            else
                v53:setState({
                    lines = v53.props.Region:GetRegionWireframe()
                });
                return ;
            end;
        end;
    end);
    v53.onRedo = l_ChangeHistoryService_0.OnRedo:Connect(function(v64)
        if v53.draggerRedoStack[v64] and #v53.draggerRedoStack[v64] > 0 then
            local v65 = v53.draggerRedoStack[v64][#v53.draggerRedoStack[v64]];
            table.insert(v53.draggerUndoStack[v64], {
                transform = v53.props.TargetCFrame,
                size = v53.props.TargetSize
            });
            table.remove(v53.draggerRedoStack[v64], #v53.draggerRedoStack[v64]);
            v53.lastRegion = v65;
            v53.props.SetRegion(v65, false);
        end;
        if v61[v64] then
            if not v53.props.Region then
                if not (not v53.props.SourceCFrame or not v53.props.SourceSize) then
                    v53:setState({
                        lines = v58:GetTerrainWireframe(v53.props.SourceCFrame, v53.props.SourceSize)
                    });
                end;
            else
                v53:setState({
                    lines = v53.props.Region:GetRegionWireframe()
                });
                return ;
            end;
        end;
    end);
    v53.enable = function()
        v53:setState({
            visual = true
        });
    end;
    v53.disable = function()
        v53:setState({
            visual = false
        });
    end;
    v53.draggerUndoStack = {};
    v53.draggerRedoStack = {};
    v53.lastRegion = {
        transform = l_props_2.SourceCFrame,
        size = l_props_2.SourceSize
    };
    l_ChangeHistoryService_0:SetWaypoint("Mounting");
    if not l_Region_1 then
        if not (not l_SourceCFrame_1 or not l_SourceSize_1) then
            v53:setState({
                lines = v58:GetTerrainWireframe(l_SourceCFrame_1, l_SourceSize_1),
                visual = true
            });
        end;
        return ;
    else
        l_Region_1.Parent = game:GetService("CoreGui");
        v53:setState({
            lines = l_Region_1:GetRegionWireframe(),
            visual = true
        });
        return ;
    end;
end;
v24.willUnmount = function(v66)
    if v66.activated then
        v66.activated:Disconnect();
    end;
    if v66.deactivated then
        v66.deactivated:Disconnect();
    end;
    if v66.onUndo then
        v66.onUndo:Disconnect();
    end;
    if v66.onRedo then
        v66.onRedo:Disconnect();
    end;
end;
v24.enable = function(_)
end;
v24.disable = function(_)
end;
v24.render = function(v69)
    local l_props_3 = v69.props;
    local v71 = l_props_3.Terrain:get();
    local l_VolumeDragger_0 = v69.props.Stylizer.VolumeDragger;
    local l_TargetCFrame_0 = l_props_3.TargetCFrame;
    local l_TargetSize_0 = l_props_3.TargetSize;
    local l_SourceCFrame_2 = l_props_3.SourceCFrame;
    local l_SourceSize_2 = l_props_3.SourceSize;
    local v77 = nil;
    if l_props_3.Tool == v20.ToolId.Select then
        local v78, v79 = v18(l_SourceCFrame_2, l_SourceSize_2);
        l_TargetCFrame_0 = v78;
        l_TargetSize_0 = v79;
    elseif l_props_3.Tool == v20.ToolId.Transform then
        v77 = Vector3.new(l_TargetSize_0.X / l_SourceSize_2.X, l_TargetSize_0.Y / l_SourceSize_2.Y, l_TargetSize_0.Z / l_SourceSize_2.Z);
    end;
    return v1.createElement(l_Pane_0, {
        Size = UDim2.fromOffset(0, 0)
    }, {
        Dragger = if not v69.state.visual then nil else v1.createElement(v7, v69.draggerProps),
        Visual = if not v69.state.visual then nil else v1.createElement(v14, {
            Adornee = v71,
            AlwaysOnTop = true,
            Color = if l_props_3.Tool == v20.ToolId.Transform then l_VolumeDragger_0.TransformColor else l_VolumeDragger_0.SelectColor,
            LineThickness = l_VolumeDragger_0.LineThickness,
            Lines = v69.state.lines,
            Scale = v77,
            Size = l_TargetSize_0,
            Transform = l_TargetCFrame_0,
            Transparency = l_VolumeDragger_0.Transparency,
            Wireframe = l_props_3.Wireframe
        }),
        Tooltip = if l_props_3.Tool == v20.ToolId.Transform and l_props_3.ShowTooltip then v1.createElement(v13) else nil
    });
end;
return l_withContext_0({
    PluginActivationController = v15.PluginActivationController,
    Terrain = l_Terrain_0,
    Stylizer = l_ContextServices_0.Stylizer
})(v24);


local l_Parent_0 = script.Parent.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Framework);
local v2 = require(l_Parent_0.Packages.Roact);
local v3 = require(l_Parent_0.Packages.RoactRodux);
local l_ContextServices_0 = v1.ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local v6 = require(l_Parent_0.Src.ContextItems);
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local l_ToolParts_0 = l_Parent_0.Src.Components.Tools.ToolParts;
local v9 = require(l_ToolParts_0.ButtonGroup);
local v10 = require(l_ToolParts_0.LabeledToggle);
local v11 = require(l_ToolParts_0.Panel);
local v12 = require(l_ToolParts_0.RegionFragment);
local _ = require(l_Parent_0.Src.Components.TeachingCallout);
local v14 = require(l_Parent_0.Src.Components.TransformDialog);
local l_Actions_0 = l_Parent_0.Src.Actions;
local v16 = require(l_Actions_0.ApplyToolAction);
local v17 = require(l_Actions_0.ChangeSource);
local v18 = require(l_Actions_0.ChangeTarget);
local v19 = require(l_Actions_0.ChangeTool);
local v20 = require(l_Actions_0.SetLiveEdit);
local v21 = require(l_Actions_0.SetMergeEmpty);
local l_Util_0 = l_Parent_0.Src.Util;
local v23 = require(l_Util_0.applyTransform);
local v24 = require(l_Util_0.ConvertTransformToRegion);
local v25 = require(l_Util_0.TerrainEnums);
local l_ToolId_0 = v25.ToolId;
local l_TransformMode_0 = v25.TransformMode;
local l_game_FastInt_0 = game:GetFastInt("SmoothTerrainMaxCppRegion");
local l_TerrainEditorOverhaul_0 = game:GetFastFlag("TerrainEditorOverhaul");
local v30 = v2.PureComponent:extend(script.Name);
v30.init = function(v31)
    v31.apply = function()
        local l_props_0 = v31.props;
        local l_Analytics_0 = l_props_0.Analytics;
        local v34 = l_props_0.LiveEdit and not v31.state.forcePreviewMode;
        local v35 = l_props_0.Terrain:get();
        local v36 = tick();
        local v37 = nil;
        local v38 = nil;
        local v39 = v24(l_props_0.TargetTransform, l_props_0.TargetSize, false);
        local v40 = v39.Max - v39.Min;
        if v34 and l_game_FastInt_0 < (v40.X * v40.Y) * v40.Z then
            v31:setState({
                forcePreviewMode = true
            });
            return ;
        else
            v31:setState({
                forcePreviewMode = false
            });
            if v34 then
                v35:PasteRegion(v31.state.terrainBackup, v24(v31.state.terrainTransform, v31.state.terrainSize, false).Min, true);
                v38 = v35:CopyRegion(v24(l_props_0.TargetTransform, l_props_0.TargetSize, false));
                if l_props_0.TransformMode == l_TransformMode_0.Move then
                    v37 = v31.state.terrainRegion:Clone();
                    if l_props_0.MergeEmpty then
                        v35:SetMaterialInTransform(l_props_0.TargetTransform, l_props_0.TargetSize, Enum.Material.Air);
                    end;
                    v35:SetMaterialInTransform(l_props_0.SourceTransform, l_props_0.SourceSize, Enum.Material.Air);
                elseif l_props_0.TransformMode == l_TransformMode_0.Paste then
                    v37 = l_props_0.TerrainRegionCopyBuffer:Clone();
                    if l_props_0.MergeEmpty then
                        v35:SetMaterialInTransform(l_props_0.TargetTransform, l_props_0.TargetSize, Enum.Material.Air);
                    end;
                elseif l_props_0.TransformMode == l_TransformMode_0.Duplicate then
                    v37 = l_props_0.TerrainRegion:Clone();
                    if l_props_0.MergeEmpty then
                        v35:SetMaterialInTransform(l_props_0.TargetTransform, l_props_0.TargetSize, Enum.Material.Air);
                    end;
                else
                    assert(("Unexpected value for TransformMode, received %s"):format(l_props_0.TransformMode));
                end;
                local l_v23_0 = v23;
                local l_v35_0 = v35;
                local l_v37_0 = v37;
                local l_TargetTransform_0 = l_props_0.TargetTransform;
                local l_TargetSize_0 = l_props_0.TargetSize;
                local v46 = false;
                if l_props_0.TargetTransform.Rotation == l_props_0.SourceTransform.Rotation then
                    v46 = l_props_0.TargetSize == l_props_0.SourceSize;
                end;
                l_v23_0(l_v35_0, l_v37_0, l_TargetTransform_0, l_TargetSize_0, v46);
                if tick() - v36 > 5 then
                    l_props_0.dispatchSetLiveEdit(false);
                end;
                v31:setState({
                    terrainBackup = v38,
                    terrainTransform = l_props_0.TargetTransform,
                    terrainSize = l_props_0.TargetSize
                });
                if v31.updateQueued then
                    v31.updateQueued = false;
                    v31.apply();
                end;
                v31.updating = false;
                return ;
            else
                v31:setState({
                    applying = true
                });
                l_Analytics_0:report("regionMode", "Preview");
                return ;
            end;
        end;
    end;
    v31.quit = function()
        v31.props.dispatchChangeTool(l_ToolId_0.Select);
    end;
    v31.connect = function()
        local l_props_1 = v31.props;
        v31.applyAction = l_props_1.PluginActionsController:Connect("Apply", v31.apply);
        l_props_1.PluginActionsController:Enable("Apply");
        v31.quitAction = l_props_1.PluginActionsController:Connect("Quit", v31.quit);
        l_props_1.PluginActionsController:Enable("Quit");
    end;
    v31.disconnect = function()
        local l_props_2 = v31.props;
        if v31.applyAction then
            l_props_2.PluginActionsController:Disable("Apply");
            v31.applyAction:Disconnect();
        end;
        if v31.quitAction then
            l_props_2.PluginActionsController:Disable("Quit");
            v31.quitAction:Disconnect();
        end;
    end;
    v31.live = function()
        v31.disconnect();
        if v31.updating then
            v31.updateQueued = true;
            return ;
        else
            v31.updating = true;
            v31.apply();
            return ;
        end;
    end;
    v31.preview = function()
        local l_props_3 = v31.props;
        local v50 = l_props_3.Terrain:get();
        v31.connect();
        v50:PasteRegion(v31.state.terrainBackup, v24(v31.state.terrainTransform, v31.state.terrainSize, false).Min, true);
        v50:PasteRegion(v31.state.terrainRegion, v24(l_props_3.SourceTransform, l_props_3.SourceSize, true).Min, true);
    end;
    v31.setLiveEdit = function(v51)
        local l_props_4 = v31.props;
        if not v31.state.applying then
            l_props_4.dispatchSetLiveEdit(v51);
            return ;
        else
            return ;
        end;
    end;
end;
v30.didMount = function(v53)
    local l_props_5 = v53.props;
    local l_Analytics_1 = l_props_5.Analytics;
    local v56 = l_props_5.LiveEdit and not v53.state.forcePreviewMode;
    local l_SourceTransform_0 = l_props_5.SourceTransform;
    local l_SourceSize_0 = l_props_5.SourceSize;
    local v59 = l_props_5.Terrain:get();
    local v60 = v24(l_SourceTransform_0, l_SourceSize_0, false);
    local v61 = v60.Max - v60.Min;
    local v62 = l_game_FastInt_0 < (v61.X * v61.Y) * v61.Z;
    if not v56 then
        v53.connect();
    end;
    if l_props_5.TransformMode == l_TransformMode_0.Move then
        l_Analytics_1:report("regionAction", "Move");
    end;
    v53:setState({
        forcePreviewMode = v62,
        terrainRegion = v59:CopyRegion(v24(l_SourceTransform_0, l_SourceSize_0, true)),
        terrainBackup = v59:CopyRegion(v24(l_SourceTransform_0, l_SourceSize_0, false)),
        terrainTransform = l_SourceTransform_0,
        terrainSize = l_SourceSize_0
    });
    l_props_5.dispatchChangeTarget(l_SourceTransform_0, l_SourceSize_0);
end;
v30.willUnmount = function(v63)
    local l_props_6 = v63.props;
    local l_Analytics_2 = l_props_6.Analytics;
    if l_props_6.LiveEdit and not v63.state.forcePreviewMode then
        l_Analytics_2:report("regionMode", "LiveEdit");
    end;
    v63.disconnect();
end;
v30.didUpdate = function(v66, v67)
    local l_props_7 = v66.props;
    local v69 = l_props_7.LiveEdit and not v66.state.forcePreviewMode;
    if v67.LiveEdit ~= v69 then
        if not v69 then
            v66.preview();
        else
            v66.live();
        end;
    end;
    if not (v67.TargetTransform == l_props_7.TargetTransform) or v67.TargetSize ~= l_props_7.TargetSize then
        if not v69 or v66.updating then
            if v66.updating then
                v66.needsToUpdate = true;
            end;
        else
            v66.apply();
        end;
        local v70 = v24(l_props_7.TargetTransform, l_props_7.TargetSize, false);
        local v71 = v70.Max - v70.Min;
        if l_game_FastInt_0 < (v71.X * v71.Y) * v71.Z then
            v66:setState({
                forcePreviewMode = true
            });
            return ;
        else
            v66:setState({
                forcePreviewMode = false
            });
        end;
    end;
end;
v30.render = function(v72)
    local l_props_8 = v72.props;
    local l_TerrainRegionCopySize_0 = l_props_8.TerrainRegionCopySize;
    local l_TerrainRegionCopyTransform_0 = l_props_8.TerrainRegionCopyTransform;
    local v76 = l_props_8.LiveEdit and not v72.state.forcePreviewMode;
    local l_MergeEmpty_0 = l_props_8.MergeEmpty;
    local l_SourceTransform_1 = l_props_8.SourceTransform;
    local l_SourceSize_1 = l_props_8.SourceSize;
    local l_TargetTransform_1 = l_props_8.TargetTransform;
    local l_TargetSize_1 = l_props_8.TargetSize;
    local l_Localization_0 = l_props_8.Localization;
    local v83 = nil;
    if l_TerrainEditorOverhaul_0 then
        if l_props_8.TransformMode == l_TransformMode_0.Move then
            v83 = v72.state.terrainRegion;
        elseif l_props_8.TransformMode == l_TransformMode_0.Paste then
            v83 = l_props_8.TerrainRegionCopyBuffer;
        elseif l_props_8.TransformMode == l_TransformMode_0.Duplicate then
            v83 = l_props_8.TerrainRegion;
        end;
    end;
    local v84 = l_LayoutOrderIterator_0.new();
    return v2.createFragment({
        SelectionSettings = v2.createElement(v11, {
            Padding = UDim.new(0, 12),
            LayoutOrder = 1,
            isSubsection = false,
            Title = l_Localization_0:getText("TransformSettings", "TransformSettings")
        }, {
            TransformRegionFragment = v2.createElement(v12, {
                HideBox = not l_MergeEmpty_0,
                LayoutOrder = v84:getNextOrder(),
                Region = v83,
                SetRegion = l_props_8.dispatchChangeTarget,
                SourceSize = if l_props_8.TransformMode == l_TransformMode_0.Paste then l_TerrainRegionCopySize_0 else l_SourceSize_1,
                SourceTransform = if l_props_8.TransformMode == l_TransformMode_0.Paste then l_TerrainRegionCopyTransform_0 else l_SourceTransform_1,
                ShowRotation = true,
                Size = l_TargetSize_1,
                ShowTooltip = not v76,
                Transform = l_TargetTransform_1,
                ToolName = v25.ToolId.Transform,
                Visual = v72.state.Visual
            }),
            MergeEmpty = v2.createElement(v10, {
                LayoutOrder = v84:getNextOrder(),
                Text = l_Localization_0:getText("RegionSettings", "MergeEmpty"),
                Tooltip = l_Localization_0:getText("RegionSettings", "MergeEmptyTooltip"),
                IsOn = l_MergeEmpty_0,
                SetIsOn = l_props_8.dispatchSetMergeEmpty
            }),
            LiveEdit = v2.createElement(v10, {
                LayoutOrder = v84:getNextOrder(),
                InfoMessage = if not v72.state.forcePreviewMode then nil else l_Localization_0:getText("RegionSettings", "ForcePreviewMode"),
                TeachingCallout = if not not l_TerrainEditorOverhaul_0 and v72.state.forcePreviewMode then {
                    DefinitionId = "TerrainToolsLiveEditCallout",
                    LocationId = "TerrainToolsLiveEditToggle"
                } else nil,
                Text = l_Localization_0:getText("RegionSettings", "LiveEdit"),
                Tooltip = l_Localization_0:getText("RegionSettings", "LiveEditTooltip"),
                IsOn = l_props_8.LiveEdit,
                SetIsOn = v72.setLiveEdit
            }),
            Action = if v76 then nil else v2.createElement(v9, {
                LayoutOrder = v84:getNextOrder(),
                Buttons = {
                    {
                        Active = not v72.state.applying,
                        Key = "Apply",
                        Name = l_Localization_0:getText("RegionSettings", "Apply"),
                        OnClicked = v72.apply
                    }
                },
                Style = "RoundPrimary"
            }),
            TransformDialog = if not v72.state.applying then nil else v2.createElement(v14, {
                OnFinish = function()
                    v72:setState({
                        applying = false
                    });
                end,
                MergeEmpty = l_MergeEmpty_0,
                Size = l_props_8.TargetSize,
                SourceSize = if l_props_8.TransformMode == l_TransformMode_0.Move then l_SourceSize_1 else nil,
                SourceTransform = if l_props_8.TransformMode == l_TransformMode_0.Move then l_SourceTransform_1 else nil,
                Transform = l_props_8.TargetTransform,
                Terrain = l_props_8.Terrain:get(),
                TerrainRegion = v83
            })
        })
    });
end;
return v3.connect(function(v85, _)
    return {
        LiveEdit = v85.RegionTool.LiveEdit,
        MergeEmpty = v85.RegionTool.mergeEmpty,
        SourceTransform = v85.Tools.SelectionTransform,
        SourceSize = v85.Tools.SelectionSize,
        TargetTransform = v85.RegionTool.TargetTransform,
        TargetSize = v85.RegionTool.TargetSize,
        TerrainRegion = v85.Tools.TerrainRegion,
        TerrainRegionCopyBuffer = v85.Tools.TerrainRegionCopyBuffer,
        TerrainRegionCopyTransform = v85.Tools.TerrainRegionCopyTransform,
        TerrainRegionCopySize = v85.Tools.TerrainRegionCopySize,
        TransformMode = v85.Tools.TransformMode
    };
end, function(v87)
    local function _(v88)
        v87(v16("RegionTool", v88));
    end;
    return {
        dispatchSetLiveEdit = function(v90)
            v87(v16("RegionTool", (v20(v90))));
        end,
        dispatchSetMergeEmpty = function(v91)
            v87(v16("RegionTool", (v21(v91))));
        end,
        dispatchChangeSource = function(v92, v93)
            v87(v16("RegionTool", (v17(v92, v93))));
        end,
        dispatchChangeTarget = function(v94, v95)
            v87(v16("RegionTool", (v18(v94, v95))));
        end,
        dispatchChangeTool = function(v96)
            v87(v19(v96));
        end
    };
end)((l_withContext_0({
    Analytics = l_ContextServices_0.Analytics,
    Localization = l_ContextServices_0.Localization,
    PluginActionsController = v6.PluginActionsController,
    Terrain = v6.Terrain
})(v30)));


local _ = game:GetService("LocalizationService");
local l_Parent_0 = script.Parent.Parent.Parent;
local v2 = require(l_Parent_0.Packages.Roact);
local l_ContextServices_0 = require(l_Parent_0.Packages.Framework).ContextServices;
local l_withContext_0 = l_ContextServices_0.withContext;
local l_Localization_0 = l_ContextServices_0.Localization;
local v6 = require(l_Parent_0.Src.Components.ProgressDialog);
local v7 = require(l_Parent_0.Src.Util.CreateSubRegions);
local v8 = require(l_Parent_0.Src.Util.LongOperation);
local v9 = require(l_Parent_0.Src.Util.ConvertTransformToRegion);
local l_ChangeHistoryService_0 = game:GetService("ChangeHistoryService");
local v11 = v2.Component:extend("TransformDialog");
v11.init = function(v12)
    v12.operation = v8.new({
        onStart = function(v13)
            local l_props_0 = v12.props;
            local l_Terrain_0 = l_props_0.Terrain;
            v13.time = tick();
            if not (not l_props_0.SourceTransform or not l_props_0.SourceSize) then
                v13.sourceRegions = v7(l_props_0.SourceTransform, l_props_0.SourceSize);
            end;
            v13.sourceCurrentIndex = 1;
            local v16, v17 = v7(l_props_0.Transform, l_props_0.Size);
            v13.regions = v16;
            v13.origins = v17;
            v13.currentIndex = 1;
            v16 = v9(l_props_0.Transform, l_props_0.Size);
            v13.backup = l_Terrain_0:CopyRegion(v16);
            v13.backupRegion = v16;
        end,
        onStep = function(v18)
            local l_props_1 = v12.props;
            local l_MergeEmpty_0 = l_props_1.MergeEmpty;
            local l_TerrainRegion_0 = l_props_1.TerrainRegion;
            local l_Terrain_1 = l_props_1.Terrain;
            local v23 = v18.regions[v18.currentIndex];
            local v24 = v18.origins[v18.currentIndex];
            if v18.sourceRegions then
                l_Terrain_1:SetMaterialInTransformSubregion(l_props_1.SourceTransform, l_props_1.SourceSize, Enum.Material.Air, v18.sourceRegions[v18.sourceCurrentIndex]);
                if v18.sourceCurrentIndex ~= #v18.sourceRegions then
                    v18.sourceCurrentIndex = v18.sourceCurrentIndex + 1;
                    return true, v18.sourceCurrentIndex / (#v18.sourceRegions + #v18.regions);
                end;
            end;
            if l_MergeEmpty_0 then
                l_Terrain_1:SetMaterialInTransformSubregion(l_props_1.Transform, l_props_1.Size, Enum.Material.Air, v23);
            end;
            l_Terrain_1:PasteRegion(l_TerrainRegion_0:ApplyTransformSubregion(l_props_1.Transform.Rotation, l_props_1.Size, v23), v24, false);
            if v18.currentIndex == #v18.regions then
                return false, 0;
            else
                v18.currentIndex = v18.currentIndex + 1;
                return true, (v18.currentIndex + (v18.sourceCurrentIndex or 0)) / (#v18.regions + (not v18.sourceRegions and 0 or #v18.sourceRegions));
            end;
        end,
        onCancel = function(v25)
            local l_props_2 = v12.props;
            l_props_2.Terrain:PasteRegion(v25.backup, v25.backupRegion.Min, true);
            l_props_2.OnFinish();
        end,
        onError = function(_)
            warn(v12.operation._errorMessage);
        end,
        onFinish = function(_)
            local l_props_3 = v12.props;
            l_ChangeHistoryService_0:SetWaypoint("TransformAction");
            l_props_3.OnFinish();
        end
    });
    v12.state = {
        paused = false,
        progress = 0,
        running = false
    };
end;
v11.didMount = function(v30)
    v30.pauseChangedConnection = v30.operation.PausedChanged:Connect(function(v31)
        v30:setState({
            paused = v31
        });
    end);
    v30.runningChangedConnection = v30.operation.RunningChanged:Connect(function(v32)
        v30:setState({
            running = v32
        });
    end);
    v30.progressChangedConnection = v30.operation.ProgressChanged:Connect(function(v33)
        v30:setState({
            progress = v33
        });
    end);
    v30.operation:start();
end;
v11.willUnmount = function(v34)
    if v34.pauseChangedConnection then
        v34.pauseChangedConnection:Disconnect();
    end;
    if v34.runningChangedConnection then
        v34.runningChangedConnection:Disconnect();
    end;
    if v34.progressChangedConnection then
        v34.progressChangedConnection:Disconnect();
    end;
    v34.operation:destroy();
end;
v11.render = function(v35)
    local l_Localization_1 = v35.props.Localization;
    return v2.createElement(v6, {
        Title = l_Localization_1:getText("TransformAction", "Title"),
        SubText = l_Localization_1:getText("TransformAction", "Description"),
        Progress = v35.state.progress,
        OnCancelButtonClicked = function()
            v35.operation:cancel();
        end
    });
end;
return l_withContext_0({
    Localization = l_Localization_0
})(v11);


local l_ContextItem_0 = require(script.Parent.Parent.Packages.Framework).ContextServices.ContextItem;
local l_TerrainInterfaces_0 = script.Parent.TerrainInterfaces;
return {
    DEPRECATED_Theme = l_ContextItem_0:createSimple("DEPRECATED_Theme", {
        getValues = function(v2)
            return v2.values;
        end,
        getChangedSignal = function(v3)
            return v3.valuesChanged;
        end,
        destroy = function(v4)
            v4:destroy();
        end
    }),
    Terrain = l_ContextItem_0:createSimple("Terrain"),
    PluginActivationController = require(script.Parent.Util.PluginActivationController),
    PluginActionsController = require(script.Parent.Util.PluginActionsController),
    TerrainGeneration = require(l_TerrainInterfaces_0.TerrainGenerationInstance),
    TerrainImporter = require(l_TerrainInterfaces_0.TerrainImporterInstance),
    SeaLevel = require(l_TerrainInterfaces_0.TerrainSeaLevel),
    ImageLoader = require(script.Parent.Util.ImageLoader),
    CalloutController = require(script.Parent.Util.CalloutController),
    ShorelineController = require(script.Parent.Util.ShorelineController),
    SmoothVoxelsController = require(script.Parent.Util.SmoothVoxelsController)
};


local v0 = {};
v0.__index = v0;
v0.new = function(v1, v2, v3)
    return {
        font = Enum.Font.SourceSans,
        backgroundColor = v1(v2.MainBackground),
        liveBackgroundColor = Color3.new(),
        textColor = v1(v2.MainText),
        subTextColor = v1(v2.SubText),
        dimmerTextColor = v1(v2.DimmedText),
        itemColor = v1(v2.Item),
        borderColor = v1(v2.Border),
        hoveredItemColor = v1(v2.Item, v3.Hover),
        hoveredTextColor = v1(v2.MainText, v3.Hover),
        primaryItemColor = v1(v2.DialogMainButton),
        primaryBorderColor = v1(v2.DialogMainButton),
        primaryTextColor = v1(v2.DialogMainButtonText),
        primaryHoveredItemColor = v1(v2.DialogMainButton, v3.Hover),
        primaryHoveredBorderColor = v1(v2.DialogMainButton, v3.Hover),
        primaryHoveredTextColor = v1(v2.DialogMainButtonText, v3.Hover),
        selectionColor = v1(v2.Item, v3.Selected),
        selectionBorderColor = v1(v2.Border, v3.Selected),
        selectedTextColor = v1(v2.MainText, v3.Selected),
        shadowColor = v1(v2.Shadow),
        shadowTransparency = v1(v2.Shadow, v3.Hover),
        separationLineColor = v1(v2.Separator),
        disabledColor = v1(v2.MainText, v3.Disabled),
        errorColor = v1(v2.ErrorText),
        hoverColor = v1(v2.MainBackground, v3.Hover),
        hyperlinkTextColor = v1(v2.LinkText)
    };
end;
return v0;


local v0 = require(script.Parent.Parent.Parent.Packages.Framework);
local v1 = require(script.Parent.join);
local l_Signal_0 = v0.Util.Signal;
local v3 = {};
v3.__index = v3;
v3.new = function(v4, v5)
    local v6 = {
        getTheme = function()
            return settings().Studio.Theme;
        end,
        createValues = function(...)
            return v4(...);
        end,
        valuesChanged = l_Signal_0.new(),
        values = {},
        themeChangedConnection = nil
    };
    setmetatable(v6, v3);
    if not v5 then
        v6.themeChangedConnection = settings().Studio.ThemeChanged:Connect(function()
            v6:recalculateTheme();
        end);
    else
        v6.themeChangedConnection = v5:Connect(function()
            v6:recalculateTheme();
        end);
    end;
    v6:recalculateTheme();
    return v6;
end;
v3.connect = function(v7, ...)
    return v7.valuesChanged:Connect(...);
end;
v3.destroy = function(v8)
    if v8.themeChangedConnection then
        v8.themeChangedConnection:Disconnect();
    end;
end;
v3.update = function(v9, v10)
    v9.values = v1(v9.values, v10);
    if v9.valuesChanged then
        v9.valuesChanged:Fire(v9.values);
    end;
end;
v3.recalculateTheme = function(v11)
    local v12 = v11.getTheme();
    v11:update((v11.createValues(function(...)
        return v12:GetColor(...);
    end, Enum.StudioStyleGuideColor, Enum.StudioStyleGuideModifier)));
end;
v3.newDummyTheme = function(v13)
    local v14 = {
        getTheme = function()
            return {
                GetColor = function()
                    return Color3.new();
                end
            };
        end,
        createValues = function(...)
            return v13(...);
        end,
        valuesChanged = l_Signal_0.new(),
        values = {}
    };
    setmetatable(v14, v3);
    v14:update((v14.createValues(function()
        return v14.getTheme():GetColor();
    end, {}, {})));
    return v14;
end;
return v3;


return function()
    return (game:GetFastFlag("TerrainEditorUseTerrainChannels") and game:GetFastFlag("TerrainVoxelChannel")) and game:GetFastFlag("TerrainSmoothToolFix");
end;


local v0 = {};
v0.__index = v0;
v0.new = function(_, _)
    return v0;
end;
v0.install = function(_)
end;
v0.uninstall = function(_)
end;
v0.setSelection = function(_, _)
end;
return v0;


local function v0()
end;
return {
    getMouseTarget = require(script.Parent.getMouseTarget),
    beginBoxSelect = require(script.Parent.beginBoxSelect),
    SelectionInfo = require(script.Parent.SelectionInfo),
    Selection = require(script.Parent.Selection),
    FreeformDragger = require(script.Parent.FreeformDragger),
    TransformHandlesImplementation = require(script.Parent.TransformHandlesImplementation),
    BoundsChangedTracker = require(script.Parent.BoundsChangedTracker),
    getSelectionBoxComponent = v0,
    isExclusiveSelectable = require(script.Parent.isExclusiveSelectable),
    endBoxSelect = v0,
    getNextSelectables = v0,
    getSelectableWithCache = v0,
    setActivePoint = v0,
    dispatchWorldClick = require(script.Parent.dispatchWorldClick),
    addUndoWaypoint = require(script.Parent.addUndoWaypoint),
    setHover = v0,
    HoverEscapeDetector = require(script.Parent.HoverEscapeDetector)
};


local v0 = {};
v0.__index = v0;
v0.new = function(v1)
    return (setmetatable({
        _draggerContext = v1
    }, v0));
end;
v0.getBoundingBox = function(_, _, v4)
    return v4:getBoundingBox();
end;
v0.shouldScaleFromCenter = function(v5, _, _, _)
    return v5._draggerContext:isCtrlKeyDown();
end;
v0.beginScale = function(v9, v10, v11, _)
    local v13, v14, v15 = v9:getBoundingBox(v10, v11);
    v9._originalBoundingBoxCFrame = v13 * CFrame.new(v14);
    v9._originalBoundingBoxSize = v15;
end;
v0.updateScale = function(v16, v17, v18)
    local _ = v16._originalBoundingBoxCFrame * CFrame.new(v18);
    local _ = (v16._originalBoundingBoxSize + v17) / v16._originalBoundingBoxSize;
    return v17, v18;
end;
v0.endScale = function(_)
end;
v0.render = function(_, _, _)
end;
return v0;


local v0 = {};
v0.__index = v0;
v0.new = function(v1, v2, v3)
    return (setmetatable({
        _draggerContext = v1,
        _draggerToolModel = v2,
        _dragInfo = v3
    }, v0));
end;
v0.render = function(_)
    return nil;
end;
v0.rotate = function(_, _)
end;
v0.update = function(_)
end;
v0.destroy = function(_)
end;
return v0;


local v0 = require(script.Parent.Parent.Parent.Packages.DraggerFramework.Utility.Signal);
local v1 = {};
v1.__index = v1;
v1.new = function(v2)
    local v3 = setmetatable({
        _CursorGrid = v2
    }, v1);
    v3.SelectionChanged = v0.new();
    return v3;
end;
v1.Set = function(_, _, _)
end;
v1.Get = function(v7)
    return {
        v7._CursorGrid
    };
end;
return v1;


local v0 = {};
v0.__index = v0;
v0.new = function(v1, v2)
    assert(#v2 == 1, "Expected selection to have length 1.");
    return (setmetatable({
        _planeCFrame = v2[1].planeCFrame,
        _draggerContext = v1
    }, v0));
end;
v0.isEmpty = function(_)
    return false;
end;
v0.getBoundingBox = function(v4)
    if not v4._draggerContext:shouldUseLocalSpace() then
        return CFrame.new(v4._planeCFrame.Position), Vector3.new(), (Vector3.new());
    else
        return v4._planeCFrame, Vector3.new(), (Vector3.new());
    end;
end;
v0.getLocalBoundingBox = function(v5)
    return v5._planeCFrame, Vector3.new(), (Vector3.new());
end;
v0.doesContainItem = function(_, _)
    return true;
end;
v0.isDynamic = function(_)
    return false;
end;
return v0;


local v0 = {};
v0.__index = v0;
v0.new = function(v1)
    return (setmetatable({
        _draggerContext = v1,
        _updatePlaneFn = v1.updatePlaneFn
    }, v0));
end;
v0.beginDrag = function(v2, v3, _)
    assert(#v3 == 1, "Expected selection to have length 1.");
    v2.initCFrame = v3[1].planeCFrame;
end;
v0.updateDrag = function(v5, v6)
    v5._updatePlaneFn(v6 * v5.initCFrame);
    return v6;
end;
v0.endDrag = function(_)
end;
v0.render = function(_, _)
    return nil;
end;
return v0;


return function(v0, _, _)
    assert(v0.getMouseTarget == nil, "You accidentally called schema:addUndoWaypoint intead of schema.addUndoWaypoint");
end;


local _ = function(_, _, _)
    return {};
end;
return function(_, _, _)
    return "Ready";
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Util.Constants);
local v4 = require(l_Parent_0.Src.Util.TerrainEnums);
return (v1.createReducer({
    brushShape = v4.BrushShape.Sphere,
    baseSize = v3.INITIAL_BRUSH_SIZE,
    height = v3.INITIAL_BRUSH_SIZE,
    baseSizeHeightLocked = true,
    pivot = v4.PivotType.Center,
    planeLock = v4.PlaneLockType.Auto,
    editPlaneMode = false,
    planeCFrame = nil,
    snapToVoxels = false,
    ignoreWater = false,
    ignoreParts = true,
    autoMaterial = false,
    material = Enum.Material.Grass
}, {
    ChooseBrushShape = function(v5, v6)
        return v2.Dictionary.join(v5, {
            brushShape = v6.brushShape
        });
    end,
    ChangeBaseSize = function(v7, v8)
        return v2.Dictionary.join(v7, {
            baseSize = v8.baseSize
        });
    end,
    ChangeHeight = function(v9, v10)
        return v2.Dictionary.join(v9, {
            height = v10.height
        });
    end,
    ChangePivot = function(v11, v12)
        return v2.Dictionary.join(v11, {
            pivot = v12.pivot
        });
    end,
    SetPlaneLock = function(v13, v14)
        return v2.Dictionary.join(v13, {
            planeLock = v14.planeLock
        });
    end,
    SetEditPlaneMode = function(v15, v16)
        return v2.Dictionary.join(v15, {
            editPlaneMode = v16.editPlaneMode
        });
    end,
    SetPlaneCFrame = function(v17, v18)
        return v2.Dictionary.join(v17, {
            planeCFrame = v18.planeCFrame
        });
    end,
    SetSnapToVoxels = function(v19, v20)
        return v2.Dictionary.join(v19, {
            snapToVoxels = v20.snapToVoxels
        });
    end,
    SetAutoMaterial = function(v21, v22)
        return v2.Dictionary.join(v21, {
            autoMaterial = v22.autoMaterial
        });
    end,
    SetIgnoreWater = function(v23, v24)
        return v2.Dictionary.join(v23, {
            ignoreWater = v24.ignoreWater
        });
    end,
    SetIgnoreParts = function(v25, v26)
        return v2.Dictionary.join(v25, {
            ignoreParts = v26.ignoreParts
        });
    end,
    SetMaterial = function(v27, v28)
        return v2.Dictionary.join(v27, {
            material = v28.material
        });
    end,
    SetBaseSizeHeightLocked = function(v29, v30)
        return v2.Dictionary.join(v29, {
            baseSizeHeightLocked = v30.locked
        });
    end
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Util.Constants);
local v4 = require(l_Parent_0.Src.Util.TerrainEnums);
return (v1.createReducer({
    autoMaterial = false,
    baseSize = v3.INITIAL_BRUSH_SIZE,
    baseSizeHeightLocked = true,
    brushShape = v4.BrushShape.Sphere,
    editPlaneMode = false,
    fixedPlane = false,
    flattenMode = v4.FlattenMode.Both,
    height = v3.INITIAL_BRUSH_SIZE,
    heightPicker = false,
    ignoreParts = true,
    ignoreWater = false,
    material = Enum.Material.Grass,
    pivot = v4.PivotType.Center,
    planeCFrame = nil,
    planeLock = v4.PlaneLockType.Off,
    planePositionY = v3.INITIAL_PLANE_POSITION_Y,
    planeLockActive = true,
    position = {
        X = 0,
        Y = 0,
        Z = 0
    },
    ReplaceMode = v4.ReplaceMode.Box,
    size = {
        X = 1024,
        Y = 512,
        Z = 1024
    },
    snapToVoxels = false,
    strength = v3.INITIAL_BRUSH_STRENGTH,
    SourceMaterial = Enum.Material.Brick,
    TargetMaterial = Enum.Material.CrackedLava
}, {
    ChangeBaseSize = function(v5, v6)
        return v2.Dictionary.join(v5, {
            baseSize = v6.baseSize
        });
    end,
    ChangeHeight = function(v7, v8)
        return v2.Dictionary.join(v7, {
            height = v8.height
        });
    end,
    ChangePivot = function(v9, v10)
        return v2.Dictionary.join(v9, {
            pivot = v10.pivot
        });
    end,
    ChangePlanePositionY = function(v11, v12)
        return v2.Dictionary.join(v11, {
            planePositionY = v12.planePositionY
        });
    end,
    ChangePosition = function(v13, v14)
        return v2.Dictionary.join(v13, {
            position = v14.position
        });
    end,
    ChangeSize = function(v15, v16)
        return v2.Dictionary.join(v15, {
            size = v16.size
        });
    end,
    ChangeStrength = function(v17, v18)
        return v2.Dictionary.join(v17, {
            strength = v18.strength
        });
    end,
    ChooseBrushShape = function(v19, v20)
        return v2.Dictionary.join(v19, {
            brushShape = v20.brushShape
        });
    end,
    ChooseFlattenMode = function(v21, v22)
        return v2.Dictionary.join(v21, {
            flattenMode = v22.flattenMode
        });
    end,
    SetAutoMaterial = function(v23, v24)
        return v2.Dictionary.join(v23, {
            autoMaterial = v24.autoMaterial
        });
    end,
    SetBaseSizeHeightLocked = function(v25, v26)
        return v2.Dictionary.join(v25, {
            baseSizeHeightLocked = v26.locked
        });
    end,
    SetEditPlaneMode = function(v27, v28)
        return v2.Dictionary.join(v27, {
            editPlaneMode = v28.editPlaneMode
        });
    end,
    SetFixedPlane = function(v29, v30)
        return v2.Dictionary.join(v29, {
            fixedPlane = v30.fixedPlane
        });
    end,
    SetHeightPicker = function(v31, v32)
        return v2.Dictionary.join(v31, {
            heightPicker = v32.heightPicker
        });
    end,
    SetIgnoreParts = function(v33, v34)
        return v2.Dictionary.join(v33, {
            ignoreParts = v34.ignoreParts
        });
    end,
    SetIgnoreWater = function(v35, v36)
        return v2.Dictionary.join(v35, {
            ignoreWater = v36.ignoreWater
        });
    end,
    SetMaterial = function(v37, v38)
        return v2.Dictionary.join(v37, {
            material = v38.material
        });
    end,
    SetPlaneCFrame = function(v39, v40)
        return v2.Dictionary.join(v39, {
            planeCFrame = v40.planeCFrame
        });
    end,
    SetPlaneLock = function(v41, v42)
        return v2.Dictionary.join(v41, {
            planeLock = v42.planeLock
        });
    end,
    SetPlaneLockActive = function(v43, v44)
        return v2.Dictionary.join(v43, {
            planeLockActive = v44.planeLockActive
        });
    end,
    SetReplaceMode = function(v45, v46)
        return v2.Dictionary.join(v45, {
            ReplaceMode = v46.ReplaceMode
        });
    end,
    SetSnapToVoxels = function(v47, v48)
        return v2.Dictionary.join(v47, {
            snapToVoxels = v48.snapToVoxels
        });
    end,
    SetSourceMaterial = function(v49, v50)
        return v2.Dictionary.join(v49, {
            SourceMaterial = v50.SourceMaterial
        });
    end,
    SetTargetMaterial = function(v51, v52)
        return v2.Dictionary.join(v51, {
            TargetMaterial = v52.TargetMaterial
        });
    end
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Util.Constants);
local v4 = require(l_Parent_0.Src.Util.TerrainEnums);
return (v1.createReducer({
    brushMode = v4.BrushMode.Add,
    brushShape = v4.BrushShape.Sphere,
    baseSize = v3.INITIAL_BRUSH_SIZE,
    height = v3.INITIAL_BRUSH_SIZE,
    baseSizeHeightLocked = true,
    pivot = v4.PivotType.Center,
    planeLock = v4.PlaneLockType.Auto,
    editPlaneMode = false,
    snapToVoxels = false,
    ignoreWater = false,
    ignoreParts = true,
    autoMaterial = false,
    material = Enum.Material.Grass
}, {
    ChooseBrushShape = function(v5, v6)
        return v2.Dictionary.join(v5, {
            brushShape = v6.brushShape
        });
    end,
    ChangeBaseSize = function(v7, v8)
        return v2.Dictionary.join(v7, {
            baseSize = v8.baseSize
        });
    end,
    ChangeHeight = function(v9, v10)
        return v2.Dictionary.join(v9, {
            height = v10.height
        });
    end,
    ChangePivot = function(v11, v12)
        return v2.Dictionary.join(v11, {
            pivot = v12.pivot
        });
    end,
    SetBrushMode = function(v13, v14)
        return v2.Dictionary.join(v13, {
            brushMode = v14.brushMode
        });
    end,
    SetPlaneLock = function(v15, v16)
        return v2.Dictionary.join(v15, {
            planeLock = v16.planeLock
        });
    end,
    SetEditPlaneMode = function(v17, v18)
        return v2.Dictionary.join(v17, {
            editPlaneMode = v18.editPlaneMode
        });
    end,
    SetPlaneCFrame = function(v19, v20)
        return v2.Dictionary.join(v19, {
            planeCFrame = v20.planeCFrame
        });
    end,
    SetSnapToVoxels = function(v21, v22)
        return v2.Dictionary.join(v21, {
            snapToVoxels = v22.snapToVoxels
        });
    end,
    SetAutoMaterial = function(v23, v24)
        return v2.Dictionary.join(v23, {
            autoMaterial = v24.autoMaterial
        });
    end,
    SetIgnoreWater = function(v25, v26)
        return v2.Dictionary.join(v25, {
            ignoreWater = v26.ignoreWater
        });
    end,
    SetIgnoreParts = function(v27, v28)
        return v2.Dictionary.join(v27, {
            ignoreParts = v28.ignoreParts
        });
    end,
    SetMaterial = function(v29, v30)
        return v2.Dictionary.join(v29, {
            material = v30.material
        });
    end,
    SetBaseSizeHeightLocked = function(v31, v32)
        return v2.Dictionary.join(v31, {
            baseSizeHeightLocked = v32.locked
        });
    end
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Util.Constants);
local v4 = require(l_Parent_0.Src.Util.TerrainEnums);
return (v1.createReducer({
    brushShape = v4.BrushShape.Sphere,
    baseSize = v3.INITIAL_BRUSH_SIZE,
    height = v3.INITIAL_BRUSH_SIZE,
    baseSizeHeightLocked = true,
    pivot = v4.PivotType.Center,
    strength = v3.INITIAL_BRUSH_STRENGTH,
    planeLock = v4.PlaneLockType.Off,
    editPlaneMode = false,
    snapToVoxels = false,
    ignoreWater = true,
    ignoreParts = true
}, {
    ChooseBrushShape = function(v5, v6)
        return v2.Dictionary.join(v5, {
            brushShape = v6.brushShape
        });
    end,
    ChangeBaseSize = function(v7, v8)
        return v2.Dictionary.join(v7, {
            baseSize = v8.baseSize
        });
    end,
    ChangeHeight = function(v9, v10)
        return v2.Dictionary.join(v9, {
            height = v10.height
        });
    end,
    ChangePivot = function(v11, v12)
        return v2.Dictionary.join(v11, {
            pivot = v12.pivot
        });
    end,
    ChangeStrength = function(v13, v14)
        return v2.Dictionary.join(v13, {
            strength = v14.strength
        });
    end,
    SetPlaneLock = function(v15, v16)
        return v2.Dictionary.join(v15, {
            planeLock = v16.planeLock
        });
    end,
    SetEditPlaneMode = function(v17, v18)
        return v2.Dictionary.join(v17, {
            editPlaneMode = v18.editPlaneMode
        });
    end,
    SetPlaneCFrame = function(v19, v20)
        return v2.Dictionary.join(v19, {
            planeCFrame = v20.planeCFrame
        });
    end,
    SetSnapToVoxels = function(v21, v22)
        return v2.Dictionary.join(v21, {
            snapToVoxels = v22.snapToVoxels
        });
    end,
    SetIgnoreWater = function(v23, v24)
        return v2.Dictionary.join(v23, {
            ignoreWater = v24.ignoreWater
        });
    end,
    SetIgnoreParts = function(v25, v26)
        return v2.Dictionary.join(v25, {
            ignoreParts = v26.ignoreParts
        });
    end,
    SetBaseSizeHeightLocked = function(v27, v28)
        return v2.Dictionary.join(v27, {
            baseSizeHeightLocked = v28.locked
        });
    end
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
return (v1.createReducer({
    mergeEmpty = false,
    material = Enum.Material.Grass
}, {
    SetMergeEmpty = function(v3, v4)
        return v2.Dictionary.join(v3, {
            mergeEmpty = v4.mergeEmpty
        });
    end,
    SetMaterial = function(v5, v6)
        return v2.Dictionary.join(v5, {
            material = v6.material
        });
    end
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Util.Constants);
local v4 = require(l_Parent_0.Src.Util.TerrainEnums);
return (v1.createReducer({
    brushShape = v4.BrushShape.Sphere,
    baseSize = v3.INITIAL_BRUSH_SIZE,
    height = v3.INITIAL_BRUSH_SIZE,
    baseSizeHeightLocked = true,
    pivot = v4.PivotType.Center,
    strength = v3.INITIAL_BRUSH_STRENGTH,
    flattenMode = v4.FlattenMode.Both,
    planePositionY = v3.INITIAL_PLANE_POSITION_Y,
    fixedPlane = false,
    heightPicker = false,
    snapToVoxels = false,
    ignoreWater = true,
    ignoreParts = true
}, {
    ChooseBrushShape = function(v5, v6)
        return v2.Dictionary.join(v5, {
            brushShape = v6.brushShape
        });
    end,
    ChangeBaseSize = function(v7, v8)
        return v2.Dictionary.join(v7, {
            baseSize = v8.baseSize
        });
    end,
    ChangeHeight = function(v9, v10)
        return v2.Dictionary.join(v9, {
            height = v10.height
        });
    end,
    ChangeStrength = function(v11, v12)
        return v2.Dictionary.join(v11, {
            strength = v12.strength
        });
    end,
    ChangePivot = function(v13, v14)
        return v2.Dictionary.join(v13, {
            pivot = v14.pivot
        });
    end,
    ChooseFlattenMode = function(v15, v16)
        return v2.Dictionary.join(v15, {
            flattenMode = v16.flattenMode
        });
    end,
    SetFixedPlane = function(v17, v18)
        return v2.Dictionary.join(v17, {
            fixedPlane = v18.fixedPlane
        });
    end,
    ChangePlanePositionY = function(v19, v20)
        return v2.Dictionary.join(v19, {
            planePositionY = v20.planePositionY
        });
    end,
    SetHeightPicker = function(v21, v22)
        return v2.Dictionary.join(v21, {
            heightPicker = v22.heightPicker
        });
    end,
    SetSnapToVoxels = function(v23, v24)
        return v2.Dictionary.join(v23, {
            snapToVoxels = v24.snapToVoxels
        });
    end,
    SetIgnoreWater = function(v25, v26)
        return v2.Dictionary.join(v25, {
            ignoreWater = v26.ignoreWater
        });
    end,
    SetIgnoreParts = function(v27, v28)
        return v2.Dictionary.join(v27, {
            ignoreParts = v28.ignoreParts
        });
    end,
    SetBaseSizeHeightLocked = function(v29, v30)
        return v2.Dictionary.join(v29, {
            baseSizeHeightLocked = v30.locked
        });
    end
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local l_Biome_0 = require(l_Parent_0.Src.Util.TerrainEnums).Biome;
return (v1.createReducer({
    position = {
        X = 0,
        Y = 0,
        Z = 0
    },
    size = {
        X = 1024,
        Y = 512,
        Z = 1024
    },
    biomeSelection = {
        [l_Biome_0.Plains] = true,
        [l_Biome_0.Mountains] = true,
        [l_Biome_0.Hills] = true,
        [l_Biome_0.Water] = false,
        [l_Biome_0.Dunes] = false,
        [l_Biome_0.Arctic] = false,
        [l_Biome_0.Marsh] = false,
        [l_Biome_0.Canyons] = false,
        [l_Biome_0.Lavascape] = false
    },
    biomeSize = 100,
    haveCaves = true,
    seed = "618033988"
}, {
    ChangePosition = function(v4, v5)
        return v2.Dictionary.join(v4, {
            position = v5.position
        });
    end,
    ChangeSize = function(v6, v7)
        return v2.Dictionary.join(v6, {
            size = v7.size
        });
    end,
    SetBiomeSelection = function(v8, v9)
        return v2.Dictionary.join(v8, {
            biomeSelection = v2.Dictionary.join(v8.biomeSelection, v9.newBiomeUpdate)
        });
    end,
    SetBiomeSize = function(v10, v11)
        return v2.Dictionary.join(v10, {
            biomeSize = v11.biomeSize
        });
    end,
    SetHaveCaves = function(v12, v13)
        return v2.Dictionary.join(v12, {
            haveCaves = v13.haveCaves
        });
    end,
    SetSeed = function(v14, v15)
        return v2.Dictionary.join(v14, {
            seed = v15.seed
        });
    end
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
local v3 = require(l_Parent_0.Src.Util.Constants);
local v4 = require(l_Parent_0.Src.Util.TerrainEnums);
return (v1.createReducer({
    brushShape = v4.BrushShape.Sphere,
    baseSize = v3.INITIAL_BRUSH_SIZE,
    height = v3.INITIAL_BRUSH_SIZE,
    baseSizeHeightLocked = true,
    strength = v3.INITIAL_BRUSH_STRENGTH,
    pivot = v4.PivotType.Center,
    planeLock = v4.PlaneLockType.Off,
    editPlaneMode = false,
    snapToVoxels = false,
    ignoreWater = true,
    ignoreParts = true,
    autoMaterial = false,
    material = Enum.Material.Grass
}, {
    ChooseBrushShape = function(v5, v6)
        return v2.Dictionary.join(v5, {
            brushShape = v6.brushShape
        });
    end,
    ChangeBaseSize = function(v7, v8)
        return v2.Dictionary.join(v7, {
            baseSize = v8.baseSize
        });
    end,
    ChangeHeight = function(v9, v10)
        return v2.Dictionary.join(v9, {
            height = v10.height
        });
    end,
    ChangePivot = function(v11, v12)
        return v2.Dictionary.join(v11, {
            pivot = v12.pivot
        });
    end,
    ChangeStrength = function(v13, v14)
        return v2.Dictionary.join(v13, {
            strength = v14.strength
        });
    end,
    SetPlaneLock = function(v15, v16)
        return v2.Dictionary.join(v15, {
            planeLock = v16.planeLock
        });
    end,
    SetEditPlaneMode = function(v17, v18)
        return v2.Dictionary.join(v17, {
            editPlaneMode = v18.editPlaneMode
        });
    end,
    SetPlaneCFrame = function(v19, v20)
        return v2.Dictionary.join(v19, {
            planeCFrame = v20.planeCFrame
        });
    end,
    SetSnapToVoxels = function(v21, v22)
        return v2.Dictionary.join(v21, {
            snapToVoxels = v22.snapToVoxels
        });
    end,
    SetIgnoreWater = function(v23, v24)
        return v2.Dictionary.join(v23, {
            ignoreWater = v24.ignoreWater
        });
    end,
    SetIgnoreParts = function(v25, v26)
        return v2.Dictionary.join(v25, {
            ignoreParts = v26.ignoreParts
        });
    end,
    SetAutoMaterial = function(v27, v28)
        return v2.Dictionary.join(v27, {
            autoMaterial = v28.autoMaterial
        });
    end,
    SetMaterial = function(v29, v30)
        return v2.Dictionary.join(v29, {
            material = v30.material
        });
    end,
    SetBaseSizeHeightLocked = function(v31, v32)
        return v2.Dictionary.join(v31, {
            baseSizeHeightLocked = v32.locked
        });
    end
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
return (v1.createReducer({
    position = {
        X = 0,
        Y = 0,
        Z = 0
    },
    size = {
        X = 1024,
        Y = 512,
        Z = 1024
    },
    heightmap = {},
    colormap = {},
    colormapWarningId = nil,
    defaultMaterial = Enum.Material.Asphalt,
    materialMode = require(l_Parent_0.Src.Util.TerrainEnums).ImportMaterialMode.DefaultMaterial,
    sizeChangedByUser = false
}, {
    ChangePosition = function(v3, v4)
        return v2.Dictionary.join(v3, {
            position = v4.position
        });
    end,
    ChangeSize = function(v5, v6)
        return v2.Dictionary.join(v5, {
            size = v6.size
        });
    end,
    SetImportMaterialMode = function(v7, v8)
        return v2.Dictionary.join(v7, {
            materialMode = v8.materialMode
        });
    end,
    SelectHeightmap = function(v9, v10)
        return v2.Dictionary.join(v9, {
            heightmap = v10.heightmap or {}
        });
    end,
    SelectColormap = function(v11, v12)
        return v2.Dictionary.join(v11, {
            colormap = v12.colormap or {}
        });
    end,
    SetColormapWarningId = function(v13, v14)
        return v2.Dictionary.join(v13, {
            colormapWarningId = v14.colormapWarningId or v2.None
        });
    end,
    SetDefaultMaterial = function(v15, v16)
        return v2.Dictionary.join(v15, {
            defaultMaterial = v16.defaultMaterial
        });
    end,
    SetSizeChangedByUser = function(v17, v18)
        return v2.Dictionary.join(v17, {
            sizeChangedByUser = v18.sizeChangedByUser
        });
    end
}));


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Cryo);
local l_Reducers_0 = l_Parent_0.Src.Reducers;
local v3 = require(l_Reducers_0.Tools);
local v4 = require(l_Reducers_0.AddTool);
local v5 = require(l_Reducers_0.BaseTool);
local v6 = require(l_Reducers_0.DrawTool);
local v7 = require(l_Reducers_0.ErodeTool);
local v8 = require(l_Reducers_0.FillTool);
local v9 = require(l_Reducers_0.FlattenTool);
local v10 = require(l_Reducers_0.GenerateTool);
local v11 = require(l_Reducers_0.GrowTool);
local v12 = require(l_Reducers_0.ImportLocalTool);
local v13 = require(l_Reducers_0.MaterialTool);
local v14 = require(l_Reducers_0.PaintTool);
local v15 = require(l_Reducers_0.RegionTool);
local v16 = require(l_Reducers_0.SeaLevelTool);
local v17 = require(l_Reducers_0.ReplaceTool);
local v18 = require(l_Reducers_0.SculptTool);
local v19 = require(l_Reducers_0.SmoothTool);
local v20 = require(l_Reducers_0.SubtractTool);
local v21 = {
    GenerateTool = v10,
    ImportLocalTool = v12,
    RegionTool = v15,
    FillTool = v8,
    AddTool = v4,
    SubtractTool = v20,
    GrowTool = v11,
    MaterialTool = v13,
    ErodeTool = v7,
    SmoothTool = v19,
    FlattenTool = v9,
    SeaLevelTool = v16,
    ReplaceTool = v17,
    PaintTool = v14,
    DrawTool = v6,
    SculptTool = v18,
    BaseTool = v5
};
local l_ApplyToolAction_0 = l_Parent_0.Src.Actions.ApplyToolAction;
return function(v23, v24)
    local v25 = v23 or {
        Tools = v3(v23, v24),
        GenerateTool = v10(v23, v24),
        ImportLocalTool = v12(v23, v24),
        RegionTool = v15(v23, v24),
        FillTool = v8(v23, v24),
        MaterialTool = v13(v23, v24),
        AddTool = v4(v23, v24),
        SubtractTool = v20(v23, v24),
        GrowTool = v11(v23, v24),
        ErodeTool = v7(v23, v24),
        SmoothTool = v19(v23, v24),
        FlattenTool = v9(v23, v24),
        SeaLevelTool = v16(v23, v24),
        ReplaceTool = v17(v23, v24),
        PaintTool = v14(v23, v24),
        DrawTool = v6(v23, v24),
        SculptTool = v18(v23, v24),
        BaseTool = v5(v23, v24)
    };
    if v24.type == l_ApplyToolAction_0.Name then
        local l_toolName_0 = v24.toolName;
        return (v1.Dictionary.join(v25, {
            [l_toolName_0] = v21[l_toolName_0](v25[l_toolName_0], v24.toolAction)
        }));
    else
        return (v1.Dictionary.join(v25, {
            Tools = v3(v25.Tools, v24)
        }));
    end;
end;


local l_Parent_0 = script.Parent.Parent.Parent;
local v1 = require(l_Parent_0.Packages.Rodux);
local v2 = require(l_Parent_0.Packages.Cryo);
return (v1.createReducer({
    Material = Enum.Material.Grass,
    ReplaceMaterial = false,
    SourceMaterial = Enum.Material.Grass,
    TargetMaterial = Enum.Material.Brick,
    TargetTransform = CFrame.new(),
    TargetSize = Vector3.one * require(l_Parent_0.Src.Util.Constants).VOXEL_RESOLUTION
}, {
    SetMaterial = function(v3, v4)
        return v2.Dictionary.join(v3, {
            Material = v4.material
        });
    end,
    SetReplaceMaterial = function(v5, v6)
        return v2.Dictionary.join(v5, {
            ReplaceMaterial = v6.replaceMaterial
        });
    end,
    SetSourceMaterial = function(v7, v8)
        return v2.Dictionary.join(v7, {
            SourceMaterial = v8.SourceMaterial
        });
    end,
    SetTargetMaterial = function(v9, v10)
        return v2.Dictionary.join(v9, {
            TargetMaterial = v10.TargetMaterial
        });
    end,
    ChangeTarget = function(v11, v12)
        return v2.Dictionary.join(v11, {
            TargetTransform = v12.targetTransform,
            TargetSize = v12.targetSize
        });
    end
}));