local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Packages.ReactRoblox);
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_Hooks_0 = l_script_FirstAncestor_0.Src.Hooks;
local v6 = require(l_Hooks_0.useRaycast);
local v7 = require(l_Hooks_0.useTerrain);
local v8 = require(l_script_FirstAncestor_0.Src.Resources.Constants);
local v9 = require(l_script_FirstAncestor_0.Src.Util.ConvertForPivot);
local v10 = require(script.Box);
local v11 = require(script.Cylinder);
local v12 = require(script.Sphere);
local v13 = require(l_script_FirstAncestor_0.Src.Components.Gizmos.Grid);
local v14 = require(l_script_FirstAncestor_0.Src.Types);
local l_BrushSettings_0 = v14.BrushSettings;
local l_BrushShape_0 = v14.BrushShape;
local l_Category_0 = v14.Category;
local l_FlattenPlane_0 = v14.FlattenPlane;
local l_PlaneLock_0 = v14.PlaneLock;
local l_Tool_0 = v14.Tool;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_CoreGui_0 = game:GetService("CoreGui");
return function(v23)
    local v24 = v7();
    local v25 = v23.Value[l_Category_0.BrushSettings];
    local v26 = v25[l_BrushSettings_0.BrushShape];
    local v27 = v25[l_BrushSettings_0.BrushSize];
    local v28 = v27.Size * v8.VoxelResolution;
    local v29 = if v26 == l_BrushShape_0.Sphere then v28 else v27.Height * v8.VoxelResolution;
    local v30 = v25[l_BrushSettings_0.PlaneLock];
    local v31 = v25[l_BrushSettings_0.PlaneTransform];
    local v32 = v25[l_BrushSettings_0.ManualPlaneLock];
    local v34, v35 = v6(v23.Tool, v23.Value, (not not v32 and v30 == l_PlaneLock_0.Manual) and function(_)
    end or v23.Save);
    local v36 = v9(v25[l_BrushSettings_0.PivotPosition], v34.Position, v29);
    local v37 = l_Stylizer_0:use("Brush");
    local v38 = v37.CenterRadiusMultiplier * v34.Distance;
    local l_CenterTransparency_0 = v37.CenterTransparency;
    local l_Color_0 = v37.Color;
    local l_MainTransparency_0 = v37.MainTransparency;
    local v42 = if v30 == l_PlaneLock_0.Manual then v31 else CFrame.lookAt(Vector3.new(), v35.Normal);
    local v43 = v9(v25[l_BrushSettings_0.PivotPosition], v35.Position, v29);
    local v44 = false;
    if v30 ~= l_PlaneLock_0.Off then
        v44 = not v32;
    end;
    local v45 = if v30 == l_PlaneLock_0.Manual then (v31 - v31.Position) + v43 else CFrame.lookAt(v43, v43 + v35.Normal);
    if v23.Tool == l_Tool_0.Flatten then
        v44 = true;
        if v25[l_BrushSettings_0.FlattenPlane] == l_FlattenPlane_0.Auto then
            v42 = CFrame.lookAt(Vector3.new(), Vector3.yAxis);
            v45 = CFrame.lookAt(v43, v43 + Vector3.yAxis);
        else
            v42 = CFrame.lookAt(Vector3.new(), Vector3.yAxis);
            v43 = Vector3.new(v43.X, 0, v43.Z) + Vector3.yAxis * v25[l_BrushSettings_0.FixedYPlane];
            v45 = CFrame.lookAt(v43, v43 + Vector3.yAxis);
        end;
    end;
    if v32 and v30 == l_PlaneLock_0.Manual then
        return nil;
    else
        return v3.createPortal({
            BrushVisual = v2.createElement("Folder", {}, {
                Cursor = if v26 == l_BrushShape_0.Sphere then v2.createElement(v12, {
                    Adornee = v24,
                    CFrame = CFrame.new(v36),
                    Color = l_Color_0,
                    Radius = v28 / 2,
                    Transparency = l_MainTransparency_0
                }) else if v26 == l_BrushShape_0.Cube then v2.createElement(v10, {
                    Adornee = v24,
                    CFrame = CFrame.new(v36),
                    Color = l_Color_0,
                    Size = Vector3.new(v28, v29, v28),
                    Transparency = l_MainTransparency_0
                }) else if v26 == l_BrushShape_0.Cylinder then v2.createElement(v11, {
                    Adornee = v24,
                    CFrame = CFrame.Angles(1.5707963267948966, 0, 0) + v36,
                    Color = l_Color_0,
                    Height = v29,
                    Radius = v28 / 2,
                    Transparency = l_MainTransparency_0
                }) else nil,
                Central = v2.createElement("SphereHandleAdornment", {
                    Adornee = v24,
                    AlwaysOnTop = true,
                    CFrame = CFrame.new(v36),
                    Color = l_Color_0,
                    Radius = v38,
                    Transparency = l_CenterTransparency_0,
                    ZIndex = 1
                })
            }),
            Grid = if not v44 then nil else v2.createElement(v13, {
                AlwaysOnTop = true,
                Center = v42,
                Size = v25[l_BrushSettings_0.BrushSize].Size,
                Transform = v45
            })
        }, l_CoreGui_0);
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local v4 = require(l_script_FirstAncestor_0.Src.Hooks.useMouseDown);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
return function(v6)
    local v7 = l_Stylizer_0:use("Line");
    local l_Color_0 = v7.Color;
    local v9 = if not v4() then v7.Transparency else v7.TransparencyActive;
    return v2.createElement("BoxHandleAdornment", {
        Adornee = v6.Adornee,
        AlwaysOnTop = v6.AlwaysOnTop,
        Archivable = false,
        CFrame = v6.CFrame,
        Color = l_Color_0,
        Size = v6.Size,
        Transparency = if not v6.AlwaysOnTop then v9 else 0.5 + 0.5 * v9,
        Visible = v6.Visible,
        ZIndex = not v6.AlwaysOnTop and -1 or 0
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.ReactRoblox);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local l_ContextServices_0 = v1.ContextServices;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = l_ContextServices_0.Stylizer;
local l_UI_0 = v1.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_CoreGui_0 = game:GetService("CoreGui");
return function(v11)
    local v12 = l_Localization_0:use();
    local v13 = l_Stylizer_0:use("Note");
    local l_Key_0 = v11.Key;
    return v2.createPortal({
        Note = v3.createElement("ScreenGui", {}, {
            Frame = v3.createElement(l_Pane_0, {
                AnchorPoint = Vector2.new(0.5, 0),
                AutomaticSize = Enum.AutomaticSize.X,
                BackgroundColor = v13.Background,
                Layout = Enum.FillDirection.Horizontal,
                Spacing = v13.FramePadding,
                Padding = v13.FramePadding,
                Position = UDim2.new(0.5, 0, 0, v13.EdgePadding),
                Size = UDim2.fromOffset(0, 25)
            }, {
                Key = v3.createElement(l_Pane_0, {
                    AutomaticSize = Enum.AutomaticSize.XY,
                    BackgroundColor = v13.KeyBackground,
                    Padding = v13.TextMargin,
                    LayoutOrder = 1
                }, {
                    Corner = v3.createElement("UICorner", {
                        CornerRadius = UDim.new(0, 4)
                    }),
                    Text = v3.createElement(l_TextLabel_0, {
                        Text = v12:getText("Note", (("%*Title"):format(l_Key_0)))
                    })
                }),
                Apply = v3.createElement(l_Pane_0, {
                    AutomaticSize = Enum.AutomaticSize.XY,
                    Padding = v13.TextMargin,
                    LayoutOrder = 2
                }, {
                    Text = v3.createElement(l_TextLabel_0, {
                        Text = v12:getText("Note", (("%*Description"):format(l_Key_0)))
                    })
                })
            })
        })
    }, l_CoreGui_0);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Dash);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v2.useCallback;
local l_useMemo_0 = v2.useMemo;
local v5 = require(l_script_FirstAncestor_0.Src.Hooks.useEventConnection);
local v6 = require(l_script_FirstAncestor_0.Src.Hooks.useRaycast);
local v7 = require(l_script_FirstAncestor_0.Src.Hooks.useTerrain);
local v8 = require(l_script_FirstAncestor_0.Src.Resources.Constants);
local v9 = require(l_script_FirstAncestor_0.Src.Controllers.ShortcutController);
local v10 = require(l_script_FirstAncestor_0.Src.Components.Gizmos.Box);
local v11 = require(l_script_FirstAncestor_0.Src.Types);
local l_BrushSettings_0 = v11.BrushSettings;
local l_BuildSettings_0 = v11.BuildSettings;
local l_Category_0 = v11.Category;
local l_TerrainType_0 = v11.TerrainType;
return function(v16)
    local v17 = v16.Value[l_Category_0.BuildSettings];
    if v17[l_BuildSettings_0.PlacementMode] then
        local v18 = v17[l_BuildSettings_0.Size];
        local v19 = l_useMemo_0(function()
            return v1.join({
                [l_Category_0.BrushSettings] = {}
            }, v16.Value);
        end, {
            v16.Value
        });
        local v20 = v7();
        local v24 = l_useCallback_0(function(v21)
            local l_Position_0 = v21[l_Category_0.BrushSettings][l_BrushSettings_0.State].Position;
            local v23 = v17[l_BuildSettings_0.TerrainType];
            if not (v23 ~= l_TerrainType_0.Volcano and v23 ~= l_TerrainType_0.Mountain) or v23 == l_TerrainType_0.Mesa then
                v16.Save({
                    [l_Category_0.BuildSettings] = {
                        [l_BuildSettings_0.Transform] = CFrame.new(l_Position_0 + Vector3.new(0, v18.Y / 2 - 2 * v8.VoxelResolution, 0))
                    }
                });
                return ;
            elseif v23 == l_TerrainType_0.Crater then
                v16.Save({
                    [l_Category_0.BuildSettings] = {
                        [l_BuildSettings_0.Transform] = CFrame.new(l_Position_0 - Vector3.new(0, v18.Y / 2 - 3 * v8.VoxelResolution, 0))
                    }
                });
                return ;
            elseif v23 == l_TerrainType_0.Lake then
                v16.Save({
                    [l_Category_0.BuildSettings] = {
                        [l_BuildSettings_0.Transform] = CFrame.new(l_Position_0 - Vector3.new(0, v18.Y / 2, 0))
                    }
                });
                return ;
            else
                v16.Save({
                    [l_Category_0.BuildSettings] = {
                        [l_BuildSettings_0.Transform] = CFrame.new(l_Position_0)
                    }
                });
                return ;
            end;
        end, {
            v16.Save,
            v17[l_BuildSettings_0.TerrainType],
            v18
        });
        v5(v9.use().MouseDownAction, function()
            v16.Save({
                [l_Category_0.BuildSettings] = {
                    [l_BuildSettings_0.PlacementMode] = false
                }
            });
        end, {
            v16.Save
        });
        local v25, _ = v6(v16.Tool, v19, v24);
        return v2.createElement(v10, {
            Adornee = v20,
            AlwaysOnTop = true,
            Color = v16.Schema.Color or Color3.new(1, 1, 1),
            LineThickness = 0.1,
            Size = Vector3.new(v18.X, 0, v18.Z),
            Transform = CFrame.new(v25.Position),
            Transparency = 0.9
        });
    else
        return nil;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local l_DraggerFramework_0 = l_script_FirstAncestor_0.Packages.DraggerFramework;
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local l_Pane_0 = v2.UI.Pane;
local v5 = require(l_DraggerFramework_0.DraggerTools.DraggerToolComponent);
local v6 = require(l_script_FirstAncestor_0.Src.Hooks.usePlane);
local v7 = require(l_script_FirstAncestor_0.Src.Components.Gizmos.Grid);
local v8 = require(l_script_FirstAncestor_0.Src.Types);
local l_BrushSettings_0 = v8.BrushSettings;
local l_Category_0 = v8.Category;
local l_PlaneLock_0 = v8.PlaneLock;
local _ = v8.Tool;
return function(v13)
    local v14, v15 = v6(v13.Tool, v13.Value, v13.Save, v13.FromSelf);
    local v16 = v13.Value[l_Category_0.BrushSettings];
    if not (v16[l_BrushSettings_0.PlaneLock] == l_PlaneLock_0.Manual) or not v16[l_BrushSettings_0.ManualPlaneLock] then
        return nil;
    else
        return (v3.createElement(l_Pane_0, {}, {
            Dragger = if v14.Mock then nil else v3.createElement(v5, v14),
            Grid = v3.createElement(v7, {
                AlwaysOnTop = v16[l_BrushSettings_0.ManualPlaneLock],
                Size = v16[l_BrushSettings_0.BrushSize].Size,
                Transform = v15
            })
        }));
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local l_DraggerFramework_0 = l_script_FirstAncestor_0.Packages.DraggerFramework;
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local l_useEffect_0 = v3.useEffect;
local l_Pane_0 = v2.UI.Pane;
local v6 = require(l_DraggerFramework_0.DraggerTools.DraggerToolComponent);
local v7 = require(l_script_FirstAncestor_0.Src.Components.Gizmos.Box);
local l_Hooks_0 = l_script_FirstAncestor_0.Src.Hooks;
local v9 = require(l_Hooks_0.useLines);
local v10 = require(l_Hooks_0.useRegion);
local v11 = require(l_Hooks_0.useTerrain);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local l_Selection_0 = game:GetService("Selection");
return function(v14)
    local v15, v16, v17 = v10(v14.Tool, v14.Value, v14.Save, v14.Schema.Rotation);
    local v18 = v9(v14.Tool, v14.Value, v16, v14.Schema.Wireframe);
    local v19 = v11();
    l_useEffect_0(function()
        l_Selection_0:SetTerrainSelectionHack(v16.Transform.Position, v16.Size);
        return function()
            l_Selection_0:ClearTerrainSelectionHack();
        end;
    end, {
        v14.Tool,
        v16.Size,
        v16.Transform.Position
    });
    return v3.createElement(l_Pane_0, {}, {
        Dragger = if v15.DraggerContext.Mock then nil else v3.createElement(v6, v15),
        Region = v3.createElement(v7, {
            Adornee = v19,
            AlwaysOnTop = true,
            Color = v14.Schema.Color or Color3.new(1, 1, 1),
            LineThickness = 0.1,
            Lines = v18,
            Scale = v17,
            Size = v16.Size,
            Transform = v16.Transform,
            Transparency = 0.9,
            Wireframe = v14.Schema.Wireframe
        })
    });
end;


local _ = game:GetService("UserInputService");
local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_Localization_0 = v3.ContextServices.Localization;
local l_Stylizer_0 = v3.ContextServices.Stylizer;
local l_UI_0 = v3.UI;
local l_Pane_0 = l_UI_0.Pane;
local l_LoadingBar_0 = l_UI_0.LoadingBar;
local l_StyledDialog_0 = l_UI_0.StyledDialog;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_LayoutOrderIterator_0 = v3.Util.LayoutOrderIterator;
local _ = require(l_script_FirstAncestor_0.Src.Hooks.useOperation);
local v13 = require(l_script_FirstAncestor_0.Src.Util.FormatTimeRemaining);
local l_DialogOption_0 = require(l_script_FirstAncestor_0.Src.Types).DialogOption;
return function(v15)
    local v16 = l_Stylizer_0:use("ProgressDialog");
    local v17 = l_Localization_0:use();
    local v18 = l_LayoutOrderIterator_0.new();
    local v19 = {};
    if not (not v15.OnPause or not v15.OnResume) then
        if not v15.Paused then
            table.insert(v19, {
                Key = l_DialogOption_0.Pause,
                Text = v17:getText("Dialog", l_DialogOption_0.Pause)
            });
        else
            table.insert(v19, {
                Key = l_DialogOption_0.Resume,
                Text = v17:getText("Dialog", l_DialogOption_0.Resume)
            });
        end;
    end;
    if v15.OnCancel then
        table.insert(v19, {
            Key = l_DialogOption_0.Cancel,
            Text = v17:getText("Dialog", l_DialogOption_0.Cancel)
        });
    end;
    return v2.createElement(l_StyledDialog_0, {
        Enabled = v15.Enabled,
        Modal = false,
        Title = v15.Title,
        MinContentSize = v16.MinContentSize,
        Buttons = v19,
        OnButtonPressed = function(v20)
            if not (v20 == l_DialogOption_0.Pause) or not v15.OnPause then
                if not (v20 == l_DialogOption_0.Resume) or not v15.OnResume then
                    if not (not (v20 == l_DialogOption_0.Cancel) or not v15.OnCancel) then
                        v15.OnCancel();
                    end;
                    return ;
                else
                    v15.OnResume();
                    return ;
                end;
            else
                v15.OnPause();
                return ;
            end;
        end,
        OnClose = v15.OnClose
    }, {
        Contents = v2.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Vertical,
            Padding = v16.Padding,
            Size = UDim2.fromScale(1, 1),
            Spacing = v16.Spacing
        }, {
            Description = v2.createElement(l_TextLabel_0, {
                LayoutOrder = v18:getNextOrder(),
                Size = UDim2.new(1, 0, 0, v16.DescriptionHeight),
                Text = v15.Description
            }),
            Progress = v2.createElement(l_LoadingBar_0, {
                LayoutOrder = v18:getNextOrder(),
                Progress = v15.Progress,
                Size = UDim2.new(1, 0, 0, v16.ProgressHeight)
            }),
            Time = if not v15.TimeRemaining then nil else v2.createElement(l_TextLabel_0, {
                LayoutOrder = v18:getNextOrder(),
                Size = UDim2.new(1, 0, 0, v16.DescriptionHeight),
                Text = v17:getText("Dialog", "TimeRemaining", {
                    Time = v13(v15.TimeRemaining, v17)
                })
            })
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v2.useCallback;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local l_UI_0 = v1.UI;
local l_Button_0 = l_UI_0.Button;
local l_Image_0 = l_UI_0.Image;
local l_Pane_0 = l_UI_0.Pane;
local l_Slider_0 = l_UI_0.Slider;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_BrushShape_0 = require(l_script_FirstAncestor_0.Src.Types).BrushShape;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local function v15(v14)
    return v2.createElement(l_Slider_0, {
        Max = 64,
        Min = 1,
        OnValueChanged = v14.OnChanged,
        ShowInput = true,
        Size = UDim2.new(1, 0, 0, v14.Height),
        SnapIncrement = 1,
        VerticalDragTolerance = 0,
        Value = v14.Value
    });
end;
return function(v16)
    local l_Schema_0 = v16.Schema;
    local v18 = l_Stylizer_0:use("BrushSizeRenderer");
    local l_Shape_0 = l_Schema_0.Shape;
    local v20 = l_LayoutOrderIterator_0.new();
    local v24 = l_useCallback_0(function(v21, v22)
        local v23 = table.clone(v16.Value);
        if not v16.Value.Locked then
            if not v21 then
                v23.Height = v22;
                v16.OnChanged(v23);
                return ;
            else
                v23.Size = v21;
                v16.OnChanged(v23);
                return ;
            end;
        else
            v23.Height = v21 or v22;
            v23.Size = v21 or v22;
            v16.OnChanged(v23);
            return ;
        end;
    end, {
        v16.Value.Size,
        v16.Value.Height,
        v16.Value.Locked
    });
    local v26 = l_useCallback_0(function(v25)
        v24(v25, nil);
    end, {
        v24
    });
    local v29 = v2.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        Layout = Enum.FillDirection.Horizontal,
        Size = UDim2.fromScale(1, 0),
        VerticalAlignment = Enum.VerticalAlignment.Top
    }, {
        Inputs = v2.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            Layout = Enum.FillDirection.Vertical,
            LayoutOrder = v20:getNextOrder(),
            Size = UDim2.new(1, -v18.LockButtonWidth, 0, 0),
            Spacing = 10,
            VerticalAlignment = Enum.VerticalAlignment.Top
        }, {
            Size = v2.createElement(l_Pane_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                Layout = Enum.FillDirection.Horizontal,
                LayoutOrder = v20:getNextOrder()
            }, {
                SizeLabel = v2.createElement(l_TextLabel_0, {
                    LayoutOrder = v20:getNextOrder(),
                    Size = UDim2.fromOffset(v18.LabelWidth, v18.RowHeight),
                    Text = l_Shape_0 == l_BrushShape_0.Cylinder and "R" or "W",
                    TextYAlignment = Enum.TextYAlignment.Center
                }),
                SizeSliderContainer = v2.createElement(l_Pane_0, {
                    LayoutOrder = v20:getNextOrder(),
                    Size = UDim2.new(1, -v18.LabelWidth, 0, v18.RowHeight)
                }, {
                    SizeSlider = v2.createElement(v15, {
                        Height = v18.RowHeight,
                        OnChanged = v26,
                        Value = v16.Value.Size
                    })
                })
            }),
            Height = v2.createElement(l_Pane_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                Layout = Enum.FillDirection.Horizontal,
                LayoutOrder = v20:getNextOrder()
            }, {
                HeightLabel = v2.createElement(l_TextLabel_0, {
                    LayoutOrder = v20:getNextOrder(),
                    Size = UDim2.fromOffset(v18.LabelWidth, v18.RowHeight),
                    Text = "H",
                    TextYAlignment = Enum.TextYAlignment.Center
                }),
                HeightSliderContainer = v2.createElement(l_Pane_0, {
                    LayoutOrder = v20:getNextOrder(),
                    Size = UDim2.new(1, -v18.LabelWidth, 0, v18.RowHeight)
                }, {
                    HeightSlider = v2.createElement(v15, {
                        Height = v18.RowHeight,
                        OnChanged = l_useCallback_0(function(v27)
                            v24(nil, v27);
                        end, {
                            v24
                        }),
                        Value = v16.Value.Height
                    })
                })
            })
        }),
        LockingContainer = v2.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.X,
            Layout = Enum.FillDirection.Horizontal,
            LayoutOrder = v20:getNextOrder(),
            Size = UDim2.fromOffset(0, v18.RowHeight * 2 + 10),
            VerticalAlignment = Enum.VerticalAlignment.Center
        }, {
            Locking = v2.createElement(l_Button_0, {
                LayoutOrder = v20:getNextOrder(),
                OnClick = l_useCallback_0(function()
                    local v28 = table.clone(v16.Value);
                    v28.Locked = not v28.Locked;
                    v16.OnChanged(v28);
                end, {
                    v16.Value.Size,
                    v16.Value.Height,
                    v16.Value.Locked,
                    v24
                }),
                Size = UDim2.fromOffset(v18.LockButtonWidth, v18.LockButtonWidth),
                Style = "RoundSubtle"
            }, {
                ImageContainer = v2.createElement(l_Pane_0, {
                    HorizontalAlignment = Enum.HorizontalAlignment.Center,
                    Layout = Enum.FillDirection.Vertical,
                    VerticalAlignment = Enum.VerticalAlignment.Center
                }, {
                    Icon = v2.createElement(l_Image_0, {
                        Image = if not v16.Value.Locked then v18.Unlocked else v18.Locked,
                        Size = UDim2.fromOffset(16, 16)
                    })
                })
            })
        })
    });
    local v30 = v2.createElement(v15, {
        Height = v18.RowHeight,
        OnChanged = v26,
        Value = v16.Value.Size
    });
    if l_Shape_0 == l_BrushShape_0.Sphere then
        return v30;
    else
        return v29;
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local _ = v1.UI.Button;
local l_IconButton_0 = v1.UI.IconButton;
local _ = v1.Util.StyleModifier;
return function(v6)
    local l_Schema_0 = v6.Schema;
    return v2.createElement(l_IconButton_0, {
        Disabled = v6.Disabled,
        OnClick = l_Schema_0.OnClick,
        Size = UDim2.new(1, 0, 0, 32),
        Style = not v6.Disabled and "PrimaryBrand" or nil,
        Text = l_Schema_0.Label,
        TextXAlignment = Enum.TextXAlignment.Center
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_Localization_0 = v1.ContextServices.Localization;
local v3 = require(l_script_FirstAncestor_0.Packages.ViewportToolingFramework);
local v4 = require(l_script_FirstAncestor_0.Packages.React);
local l_IconButton_0 = v1.UI.IconButton;
local l_Pane_0 = v1.UI.Pane;
local _ = v1.Util.StyleModifier;
local l_Toolbar_0 = v3.Toolbar;
return function(v9)
    local l_Schema_0 = v9.Schema;
    local v11 = l_Localization_0:use();
    local v12 = nil;
    if not l_Schema_0.CanConfirm then
        if l_Schema_0.CanRegenerate then
            v12 = {
                {
                    Type = "Label",
                    Text = v11:getText("Viewport", "RegenerateMessage")
                },
                {
                    OnClick = l_Schema_0.OnRegenerate,
                    Type = "TextButton",
                    Text = v11:getText("Viewport", "Regenerate")
                }
            };
        end;
    else
        v12 = {
            {
                Type = "Label",
                Text = v11:getText("Viewport", "ConfirmMessage")
            },
            {
                OnClick = l_Schema_0.OnClick,
                Type = "TextButton",
                Text = v11:getText("Viewport", "Confirm")
            }
        };
    end;
    return v4.createElement(l_Pane_0, {
        Size = UDim2.new(1, 0, 0, 32)
    }, {
        Button = if not l_Schema_0.CanConfirm then nil else v4.createElement(l_IconButton_0, {
            Disabled = v9.Disabled,
            OnClick = l_Schema_0.OnClick,
            Size = UDim2.new(1, 0, 0, 32),
            Style = not v9.Disabled and "PrimaryBrand" or nil,
            Text = l_Schema_0.Label,
            TextXAlignment = Enum.TextXAlignment.Center
        }),
        Toolbar = if not v12 then nil else v4.createElement(l_Toolbar_0, {
            HorizontalItems = v12
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useEffect_0 = v2.useEffect;
local l_useState_0 = v2.useState;
local l_StyleModifier_0 = v1.Util.StyleModifier;
local l_Slider_0 = v1.UI.Slider;
return function(v7)
    local l_Schema_0 = v7.Schema;
    local v9, v10 = l_useState_0(v7.Value);
    l_useEffect_0(function()
        if v7.Value ~= v9 then
            v10(v7.Value or l_Schema_0.Min);
        end;
    end, {
        v7.Value
    });
    local v11, v12 = l_useState_0(false);
    l_useEffect_0(function()
        if v11 then
            v7.OnChanged((math.clamp(v9, l_Schema_0.Min, l_Schema_0.Max)));
            v12(false);
        end;
    end, {
        v11,
        v9
    });
    return v2.createElement(l_Slider_0, {
        Disabled = v7.Disabled,
        Max = l_Schema_0.Max,
        Min = l_Schema_0.Min,
        OnInputEnded = function()
            v12(true);
        end,
        OnValueChanged = function(v13)
            v10(v13 or 0);
        end,
        Size = UDim2.new(1, 0, 0, 24),
        CustomValidation = v7.CustomValidation,
        ShowInput = l_Schema_0.ShowInput,
        SnapIncrement = l_Schema_0.SnapIncrement,
        StyleModifier = if not v7.HasError then nil else l_StyleModifier_0.Error,
        VerticalDragTolerance = 0,
        Value = v9
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_ContextServices_0 = v1.ContextServices;
local l_Localization_0 = l_ContextServices_0.Localization;
local l_Stylizer_0 = l_ContextServices_0.Stylizer;
local l_UI_0 = v1.UI;
local l_Dialog_0 = l_UI_0.Dialog;
local l_Image_0 = l_UI_0.Image;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v14 = require(l_script_FirstAncestor_0.Src.Util.getMetadata);
return function(v15)
    local v16 = l_Localization_0:use();
    local v17 = l_Stylizer_0:use("MetadataDialog");
    local l_Image_1 = v15.Image;
    local v19 = v14(l_Image_1);
    local l_MetadataLineHeight_0 = v17.MetadataLineHeight;
    local l_Padding_0 = v17.Padding;
    local l_Spacing_0 = v17.Spacing;
    local v23 = l_LayoutOrderIterator_0.new();
    local v24 = (#v19 * l_MetadataLineHeight_0 + (#v19 - 1) * l_Spacing_0) + l_Padding_0 * 2;
    local v25 = {};
    for v26, v27 in v19, nil, nil do
        v25[("Metadata%*"):format(v26)] = v2.createElement(l_TextLabel_0, {
            LayoutOrder = v23:getNextOrder(),
            Size = UDim2.new(1, 0, 0, l_MetadataLineHeight_0),
            Text = ("%*: %*"):format(v16:getText("Image", v27.Label), v27.Value),
            TextSize = l_MetadataLineHeight_0,
            TextXAlignment = Enum.TextXAlignment.Left
        });
    end;
    return v2.createElement(l_Dialog_0, {
        Title = v16:getText("Image", "ImagePreview"),
        Size = v17.Size,
        MinSize = v17.MinSize,
        Resizable = true,
        Enabled = true,
        Modal = false,
        ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
        OnClose = v15.OnClose
    }, {
        Content = v2.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Vertical
        }, {
            Wrapper = v2.createElement(l_Pane_0, {
                BackgroundColor = v17.ImageBackgroundColor,
                HorizontalAlignment = Enum.HorizontalAlignment.Center,
                LayoutOrder = v23:getNextOrder(),
                VerticalAlignment = Enum.VerticalAlignment.Center,
                Size = UDim2.new(1, 0, 1, -v24)
            }, {
                Image = v2.createElement(l_Image_0, {
                    Image = l_Image_1.Preview.Id or l_Image_1.File:GetTemporaryId(),
                    ScaleType = Enum.ScaleType.Fit
                })
            }),
            Metadata = v2.createElement(l_Pane_0, {
                Layout = Enum.FillDirection.Vertical,
                LayoutOrder = v23:getNextOrder(),
                Padding = l_Padding_0,
                Size = UDim2.new(1, 0, 0, v24),
                Spacing = l_Spacing_0
            }, v25)
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useState_0 = v2.useState;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_UI_0 = v1.UI;
local l_Button_0 = l_UI_0.Button;
local l_Image_0 = l_UI_0.Image;
local v8 = require(l_script_FirstAncestor_0.Src.Components.Renderers.Image.MetadataDialog);
local v9 = require(l_script_FirstAncestor_0.Src.Util.getImage);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
return function(v12)
    local v13 = l_Stylizer_0:use("ImageRenderer");
    local l_Schema_0 = v12.Schema;
    local v15, v16 = l_useState_0(false);
    local v17, v18 = l_useState_0(false);
    local v19 = nil;
    if v12.Value.Image then
        if not v12.Value.Image.Preview.Id then
            if v12.Value.Image.File then
                v19 = v12.Value.Image.File:GetTemporaryId();
            end;
        else
            v19 = v12.Value.Image.Preview.Id;
        end;
    end;
    if not v19 then
        return (v2.createElement(l_Button_0, {
            Icon = v13.ImportIcon,
            IconSize = UDim2.fromOffset(28, 28),
            OnClick = function()
                v9(function(v20, v21)
                    v12.OnChanged({
                        Error = v20,
                        Image = v21
                    });
                end, l_Schema_0.ImageType);
            end,
            Size = v13.PreviewSize
        }));
    else
        return (v2.createElement("ImageButton", {
            Image = "",
            Size = v13.PreviewSize,
            [v2.Event.MouseEnter] = function()
                v16(true);
            end,
            [v2.Event.MouseLeave] = function()
                v16(false);
            end
        }, {
            Image = v2.createElement(l_Image_0, {
                AnchorPoint = Vector2.new(0.5, 0.5),
                Image = v19,
                Position = UDim2.fromScale(0.5, 0.5),
                ScaleType = Enum.ScaleType.Fit,
                Size = UDim2.fromScale(1, 1)
            }),
            Toolbar = if not v15 then nil else v2.createElement("Frame", {
                ZIndex = 2,
                AnchorPoint = Vector2.new(0, 1),
                Position = UDim2.fromScale(0, 1),
                Size = UDim2.new(1, 0, 0, v13.ToolbarHeight),
                BackgroundTransparency = v13.ToolbarTransparency,
                BorderSizePixel = 0,
                BackgroundColor3 = v13.ToolbarBackgroundColor
            }, {
                ExpandPreview = v2.createElement(l_Button_0, {
                    Icon = v13.ExpandIcon,
                    IconPadding = v13.IconPadding,
                    Style = "RoundSubtle",
                    OnClick = function()
                        v18(not v17);
                    end,
                    Size = UDim2.fromOffset(v13.ToolbarHeight, v13.ToolbarHeight)
                }, {
                    v2.createElement("UIAspectRatioConstraint")
                }),
                ClearButton = v2.createElement(l_Button_0, {
                    AnchorPoint = Vector2.new(1, 0),
                    Position = UDim2.fromScale(1, 0),
                    Icon = v13.ClearIcon,
                    IconPadding = v13.IconPadding,
                    Style = "RoundSubtle",
                    OnClick = function()
                        v12.OnChanged({
                            Error = ""
                        });
                    end,
                    Size = UDim2.fromOffset(v13.ToolbarHeight, v13.ToolbarHeight)
                }, {
                    v2.createElement("UIAspectRatioConstraint", {
                        AspectRatio = 1
                    })
                })
            }),
            MetadataDialog = if not v17 then nil else v2.createElement(v8, {
                Image = v12.Value.Image,
                OnClose = function()
                    v18(false);
                end
            })
        }));
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_TextLabel_0 = v1.UI.TextLabel;
return function(v4)
    return v2.createElement(l_TextLabel_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        Size = UDim2.fromScale(1, 0),
        Text = v4.Schema.Text
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local _ = require(l_script_FirstAncestor_0.Packages.Dash);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.MaterialFramework);
local v4 = require(l_script_FirstAncestor_0.Packages.React);
local l_Localization_0 = v2.ContextServices.Localization;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local l_useCallback_0 = v4.useCallback;
local l_useMemo_0 = v4.useMemo;
local _ = v4.useState;
local l_Button_0 = v2.UI.Button;
local l_Image_0 = v2.UI.Image;
local l_Pane_0 = v2.UI.Pane;
local l_SelectInput_0 = v2.UI.SelectInput;
local l_TextLabel_0 = v2.UI.TextLabel;
local l_MaterialPreview_0 = v3.Components.MaterialPreview;
local l_MaterialGrid_0 = v3.Components.MaterialGrid;
local l_ViewType_0 = v3.Enums.ViewType;
local v18 = require(l_script_FirstAncestor_0.Src.Util.getMaterials);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local v20 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagTerrainEditorGenerationFeature);
local v21 = v20();
local function v23(v22)
    return v4.createElement(l_Pane_0, {
        Padding = 2,
        Size = v22.Size
    }, {
        Image = v4.createElement(l_Image_0, {
            Style = {
                Image = "rbxasset://studio_svg_textures/Lua/TerrainEditor/Dark/Large/Air.png"
            }
        })
    });
end;
local function v25(v24)
    return v4.createElement(l_Pane_0, {
        Padding = 2,
        Size = v24.Size
    }, {
        Image = v4.createElement(l_Image_0, {
            Style = {
                Image = "rbxasset://studio_svg_textures/Lua/TerrainEditor/Dark/Large/Water.png"
            }
        })
    });
end;
return function(v26)
    local v27 = l_Stylizer_0:use("MaterialRenderer");
    local l_Schema_0 = v26.Schema;
    local v29 = l_useMemo_0(function()
        return v18(l_Schema_0.AllowAir, l_Schema_0.AllowWater);
    end, {
        l_Schema_0.AllowAir,
        l_Schema_0.AllowWater
    });
    local v30 = nil;
    local v31 = nil;
    local v32 = nil;
    if v20() then
        v30 = l_Localization_0:use();
        v31 = l_useMemo_0(function()
            local v33 = {};
            for _, v35 in v29, nil, nil do
                table.insert(v33, {
                    Id = v35.Name,
                    Label = v30:getText("Materials", v35.Name),
                    Material = v35
                });
            end;
            return v33;
        end, {
            v29
        });
        v32 = l_useCallback_0(function(v36, v37, v38, _)
            return v4.createElement(l_Button_0, {
                LayoutOrder = v37,
                OnClick = v38,
                Size = UDim2.new(1, 0, 0, v27.DropdownItemHeight)
            }, {
                Contents = v4.createElement(l_Pane_0, {
                    Layout = Enum.FillDirection.Horizontal,
                    Size = UDim2.fromScale(1, 1),
                    Spacing = v27.Spacing
                }, {
                    PreviewContainer = v4.createElement(l_Pane_0, {
                        LayoutOrder = 1,
                        Size = UDim2.fromOffset(v27.DropdownItemHeight, v27.DropdownItemHeight)
                    }, {
                        PreviewCenter = v4.createElement(l_Pane_0, {
                            AnchorPoint = Vector2.new(0.5, 0.5),
                            Position = UDim2.fromScale(0.5, 0.5),
                            Size = UDim2.fromOffset(v27.PreviewSize, v27.PreviewSize)
                        }, {
                            Preview = v4.createElement(l_MaterialPreview_0, {
                                CornerRadius = UDim.new(0, 4),
                                InitialDistance = 4,
                                LayoutOrder = 1,
                                Material = v36.Material,
                                Size = UDim2.fromScale(1, 1)
                            })
                        })
                    }),
                    Label = v4.createElement(l_TextLabel_0, {
                        LayoutOrder = 2,
                        Size = UDim2.new(1, -v27.DropdownItemHeight, 1, 0),
                        Text = v36.Label,
                        TextTruncate = Enum.TextTruncate.AtEnd,
                        TextXAlignment = Enum.TextXAlignment.Left
                    })
                })
            });
        end, {
            v27
        });
    end;
    local function v41(v40)
        v26.OnChanged(v40.Material);
    end;
    if not v21 or not l_Schema_0.Dropdown then
        return v4.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            Layout = Enum.FillDirection.Horizontal,
            Size = UDim2.fromScale(1, 0),
            VerticalAlignment = Enum.VerticalAlignment.Top
        }, {
            Grid = v4.createElement(l_MaterialGrid_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                CustomPreviews = {
                    [Enum.Material.Air] = v23,
                    [Enum.Material.Water] = v25
                },
                GridItemSize = v27.GridItemSize,
                InitialDistance = v27.InitialDistance,
                OnClick = v41,
                Items = v29,
                ScrollingDirection = Enum.ScrollingDirection.Y,
                SelectedItem = v26.Value,
                ShowGridLabels = false,
                Size = UDim2.fromScale(1, 0),
                ViewType = l_ViewType_0.Grid
            })
        });
    else
        return v4.createElement(l_Pane_0, {
            Layout = Enum.FillDirection.Horizontal,
            Size = UDim2.fromScale(1, 1),
            Spacing = v27.Spacing
        }, {
            v4.createElement(l_MaterialPreview_0, {
                CornerRadius = UDim.new(0, 4),
                InitialDistance = 4,
                Material = v26.Value,
                Size = UDim2.fromOffset(v27.PreviewSize, v27.PreviewSize)
            }),
            v4.createElement(l_SelectInput_0, {
                Items = v31,
                OnItemActivated = function(v42)
                    v26.OnChanged(v42.Material);
                end,
                OnRenderItem = v32,
                SelectedId = v26.Value.Name,
                Size = UDim2.new(1, -v27.PreviewSize - v27.Spacing, 0, v27.PreviewSize)
            })
        });
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.MaterialFramework);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local _ = v3.useEffect;
local _ = v3.useState;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local l_Button_0 = v2.UI.Button;
local l_Image_0 = v2.UI.Image;
local l_Pane_0 = v2.UI.Pane;
local l_RangeSlider_0 = v2.UI.RangeSlider;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
local l_MaterialPreview_0 = v1.Components.MaterialPreview;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_Terrain_0 = game:GetService("Workspace").Terrain;
return function(v15)
    local v16 = l_Stylizer_0:use("ElevationRenderer");
    local v17 = l_LayoutOrderIterator_0.new();
    return v3.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.XY,
        HorizontalAlignment = Enum.HorizontalAlignment.Center,
        Layout = Enum.FillDirection.Vertical,
        LayoutOrder = v15.LayoutOrder,
        Size = UDim2.fromScale(0, 0),
        Spacing = v16.Spacing
    }, {
        Slider = v3.createElement(l_RangeSlider_0, {
            ImageColor3 = l_Terrain_0:GetMaterialColor(v15.Material),
            HideLowerKnob = not v15.Selected,
            HideUpperKnob = not v15.Selected,
            HorizontalDragTolerance = 20,
            Layout = Enum.FillDirection.Vertical,
            LayoutOrder = v17:getNextOrder(),
            LowerRangeValue = v15.MinHeight,
            Max = v15.Max,
            Min = v15.Min,
            OnInputEnded = v15.OnCommit,
            OnValuesChanged = function(v18, v19)
                v15.OnChanged({
                    MinHeight = v18,
                    MaxHeight = v19
                });
            end,
            Precision = true,
            Size = v16.SliderSize,
            UpperRangeValue = v15.MaxHeight
        }),
        Arrow = v3.createElement(l_Image_0, {
            ImageColor3 = if not v15.Selected then v16.ImageColor else v16.ImageColorSelected,
            LayoutOrder = v17:getNextOrder(),
            Size = v16.ArrowSize,
            Style = v16.ArrowStyle
        }),
        Preview = v3.createElement("ImageButton", {
            BackgroundColor = if not v15.Selected then nil else BrickColor.new(v16.PreviewBorder.Color),
            BackgroundTransparency = not v15.Selected and 1 or 0,
            Image = if not v15.Selected then nil else v16.PreviewBorder.Image,
            ImageColor3 = if not v15.Selected then nil else v16.PreviewBorder.Color,
            LayoutOrder = v17:getNextOrder(),
            ScaleType = Enum.ScaleType.Slice,
            Size = v16.MaterialPreviewSize,
            SliceCenter = v16.PreviewBorder.SliceCenter,
            [v3.Event.Activated] = function()
                v15.OnSelect();
            end
        }, {
            Container = v3.createElement(l_Pane_0, {
                AnchorPoint = Vector2.new(0.5, 0.5),
                Position = UDim2.fromScale(0.5, 0.5),
                Size = UDim2.new(1, -2, 1, -2)
            }, {
                MaterialPreview = v3.createElement(l_MaterialPreview_0, {
                    CornerRadius = v16.Corner,
                    InitialDistance = 4,
                    Material = v15.Material,
                    Size = UDim2.fromScale(1, 1)
                })
            }),
            UICorner = v3.createElement("UICorner", {
                CornerRadius = v16.Corner
            })
        }),
        Delete = if not not v15.Selected and v15.CanDelete then v3.createElement(l_Button_0, {
            LayoutOrder = v17:getNextOrder(),
            OnClick = v15.OnRemove,
            Size = v16.ButtonSize,
            Style = "RoundSubtle"
        }, {
            DeleteIcon = v3.createElement(l_Image_0, {
                ImageColor3 = v16.ImageColor,
                Size = UDim2.fromScale(1, 1),
                Style = v16.RemoveStyle
            })
        }) else nil
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useState_0 = v2.useState;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_Pane_0 = v1.UI.Pane;
local l_TextInput_0 = v1.UI.TextInput;
local l_TextLabel_0 = v1.UI.TextLabel;
local _ = v1.Util.LayoutOrderIterator;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_MaterialUnit_0 = require(l_script_FirstAncestor_0.Src.Types).MaterialUnit;
local function v17(v11)
    local v12, v13 = l_useState_0(false);
    local v14 = if v11.Unit == l_MaterialUnit_0.Percentage then v11.Value * 100 else v11.Value;
    if not v12 or not v11.Editable then
        return v2.createElement(l_Pane_0, {
            AnchorPoint = Vector2.new(0, 0.5),
            OnClick = function()
                if v11.Editable then
                    v13(true);
                end;
            end,
            Position = v11.Position,
            Size = v11.Size
        }, {
            Label = v2.createElement(l_TextLabel_0, {
                Text = tostring((math.floor(v14)))
            })
        });
    else
        return v2.createElement(l_TextInput_0, {
            AnchorPoint = Vector2.new(0, 0.5),
            OnFocusLost = function(v15)
                if v15 then
                    local v16 = tonumber(v15);
                    if v16 then
                        v11.OnChanged(if v11.Unit == l_MaterialUnit_0.Percentage then v16 / 100 else v16);
                        v13(false);
                    end;
                end;
            end,
            Position = v11.Position,
            Size = v11.Size,
            Text = tostring((math.floor(v14)))
        });
    end;
end;
return function(v18)
    local v19 = l_Stylizer_0:use("ElevationRenderer");
    local l_Max_0 = v18.Max;
    local l_Min_0 = v18.Min;
    local l_MaxHeight_0 = v18.MaxHeight;
    local l_MinHeight_0 = v18.MinHeight;
    local v24 = l_Max_0 - l_Min_0;
    local v25 = v19.SliderSize.Y.Offset - 20;
    local l_Offset_0 = v19.TextBoxSize.Y.Offset;
    local v27 = nil;
    local v28 = nil;
    if not (not l_MinHeight_0 or not l_MaxHeight_0) then
        v27 = (1 - l_MaxHeight_0 / v24) * v25;
        v28 = (1 - l_MinHeight_0 / v24) * v25;
        local v29 = v27 - 0 < l_Offset_0;
        local v30 = v25 - v28 < l_Offset_0;
        if v29 then
            v27 = 0 + l_Offset_0;
            if v28 - v27 < l_Offset_0 then
                v28 = v27 + l_Offset_0;
            end;
        end;
        if v30 then
            v28 = v25 - l_Offset_0;
            if v28 - v27 < l_Offset_0 then
                v27 = v28 - l_Offset_0;
            end;
        end;
    end;
    return v2.createElement("Frame", {
        BackgroundTransparency = 1,
        Size = UDim2.fromOffset(v19.TextBoxSize.X.Offset, v19.SliderSize.Y.Offset)
    }, {
        Min = v2.createElement(v17, {
            Editable = v18.Unit == l_MaterialUnit_0.Stud,
            OnChanged = function(v31)
                v18.OnChanged({
                    Min = v31
                });
            end,
            Position = UDim2.new(0, 0, 0, v25),
            Size = v19.TextBoxSize,
            Unit = v18.Unit,
            Value = l_Min_0
        }),
        MinHeight = if not not l_MaxHeight_0 and l_MinHeight_0 then v2.createElement(v17, {
            Editable = true,
            OnChanged = function(v32)
                v18.OnChanged({
                    MinHeight = math.clamp(v32, l_Min_0, l_MaxHeight_0)
                });
            end,
            Position = UDim2.new(0, 0, 0, v28),
            Size = v19.TextBoxSize,
            Unit = v18.Unit,
            Value = l_MinHeight_0
        }) else nil,
        MaxHeight = if not not l_MaxHeight_0 and l_MinHeight_0 then v2.createElement(v17, {
            Editable = true,
            OnChanged = function(v33)
                v18.OnChanged({
                    MaxHeight = math.clamp(v33, l_MinHeight_0, l_Max_0)
                });
            end,
            Position = UDim2.new(0, 0, 0, v27),
            Size = v19.TextBoxSize,
            Unit = v18.Unit,
            Value = l_MaxHeight_0
        }) else nil,
        Max = v2.createElement(v17, {
            Editable = v18.Unit == l_MaterialUnit_0.Stud,
            OnChanged = function(v34)
                v18.OnChanged({
                    Max = v34
                });
            end,
            Position = UDim2.new(0, 0, 0, 0),
            Size = v19.TextBoxSize,
            Unit = v18.Unit,
            Value = l_Max_0
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Dash);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local v3 = require(l_script_FirstAncestor_0.Packages.React);
local l_useCallback_0 = v3.useCallback;
local l_useEffect_0 = v3.useEffect;
local l_useState_0 = v3.useState;
local l_Button_0 = v2.UI.Button;
local l_Image_0 = v2.UI.Image;
local l_Pane_0 = v2.UI.Pane;
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v2.Util.LayoutOrderIterator;
local v12 = require(script.RangeInputs);
local v13 = require(script.MaterialSlider);
local v14 = require(l_script_FirstAncestor_0.Src.Resources.Constants);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local _ = require(l_script_FirstAncestor_0.Src.Types);
local v17 = require(l_script_FirstAncestor_0.Src.Util.CreateUniqueKey);
return function(v18)
    local v19 = l_Stylizer_0:use("ElevationRenderer");
    local v20, v21 = l_useState_0(v18.Value);
    local l_Min_0 = v20.Min;
    local l_Max_0 = v20.Max;
    local l_Unit_0 = v20.Unit;
    local l_MaterialIndex_0 = v20.MaterialIndex;
    local _ = v18.Schema;
    local v27 = l_LayoutOrderIterator_0.new();
    local v28 = v17();
    local v29 = {};
    local v30 = table.clone(v20.MaterialList);
    l_useEffect_0(function()
        v21(v18.Value);
    end, {
        v18.Value
    });
    local v31 = l_useCallback_0(function()
        v18.OnChanged(v20);
    end, {
        v20,
        v18.OnChanged
    });
    local v34 = l_useCallback_0(function(v32)
        local v33 = table.clone(v20);
        v33.MaterialIndex = v32;
        v18.OnChanged(v33);
    end, {
        v20,
        v30,
        l_MaterialIndex_0
    });
    local v37 = l_useCallback_0(function(v35)
        local v36 = table.clone(v20);
        v36.MaterialList = table.clone(v30);
        v36.MaterialList[l_MaterialIndex_0] = v1.join(v30[l_MaterialIndex_0], v35);
        v21(v36);
    end, {
        v20,
        v30,
        l_MaterialIndex_0
    });
    local v41 = l_useCallback_0(function(v38, v39)
        local v40 = table.clone(v20);
        if v38 then
            v40.Min = v38;
        end;
        if v39 then
            v40.Max = v39;
        end;
        v18.OnChanged(v40);
    end, {
        v20,
        v18.OnChanged
    });
    local v43 = l_useCallback_0(function()
        local v42 = table.clone(v20);
        v42.MaterialList = table.clone(v30);
        table.insert(v42.MaterialList, if not v42.MaterialList[l_MaterialIndex_0] then {
            Priority = #v42.MaterialList,
            Material = Enum.Material.Grass,
            MinHeight = 0,
            MaxHeight = 1,
            MinSlope = 0,
            MaxSlope = 20
        } else table.clone(v42.MaterialList[l_MaterialIndex_0]));
        v42.MaterialIndex = #v42.MaterialList;
        v18.OnChanged(v42);
    end, {
        v20,
        v30,
        l_MaterialIndex_0,
        v18.OnChanged
    });
    local v46 = l_useCallback_0(function()
        local v44 = table.clone(v20);
        v44.MaterialList = table.clone(v30);
        table.remove(v44.MaterialList, l_MaterialIndex_0);
        for v45 = l_MaterialIndex_0, #v44.MaterialList do
            v44.MaterialList[v45].Priority = v45 - 1;
        end;
        v44.MaterialIndex = if l_MaterialIndex_0 == 1 then l_MaterialIndex_0 else l_MaterialIndex_0 - 1;
        v18.OnChanged(v44);
    end, {
        v20,
        v30,
        l_MaterialIndex_0,
        v18.OnChanged
    });
    local v47 = v30[l_MaterialIndex_0];
    v29.RangeInputs = v3.createElement(v12, {
        LayoutOrder = v27:getNextOrder(),
        Max = l_Max_0,
        MaxHeight = if not v47 then nil else v47.MaxHeight,
        Min = l_Min_0,
        MinHeight = if not v47 then nil else v47.MinHeight,
        OnChanged = function(v48)
            if not v48.Min and not v48.Max then
                v37(v48);
                return ;
            else
                v41(v48.Min, v48.Max);
                return ;
            end;
        end,
        Unit = l_Unit_0
    });
    for v49, v50 in v30, nil, nil do
        v29[v28(v50.Material.Name)] = v3.createElement(v13, {
            CanDelete = #v30 > 1,
            LayoutOrder = v27:getNextOrder(),
            Material = v50.Material,
            Max = l_Max_0,
            MaxHeight = v50.MaxHeight,
            Min = l_Min_0,
            MinHeight = v50.MinHeight,
            OnChanged = v37,
            OnCommit = v31,
            OnRemove = v46,
            OnSelect = function()
                v34(v49);
            end,
            Selected = l_MaterialIndex_0 == v49
        });
    end;
    if #v30 < v14.MaxMaterialListSize then
        v29.AddMaterial = v3.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.XY,
            Layout = Enum.FillDirection.Vertical,
            LayoutOrder = v27:getNextOrder(),
            Spacing = v19.Spacing - 2,
            Size = UDim2.fromScale(0, 0)
        }, {
            MaterialSliderPlaceHolder = v3.createElement(l_Pane_0, {
                LayoutOrder = v27:getNextOrder(),
                Size = v19.SliderSize
            }),
            Add = v3.createElement(l_Button_0, {
                OnClick = v43,
                LayoutOrder = v27:getNextOrder(),
                Size = v19.MaterialPreviewSize,
                Style = "RoundSubtle"
            }, {
                v3.createElement(l_Image_0, {
                    AnchorPoint = Vector2.new(0.5, 0.5),
                    Position = UDim2.fromScale(0.5, 0.5),
                    Size = v19.ButtonSize,
                    Style = v19.AddStyle
                })
            })
        });
    end;
    return v3.createElement(l_Pane_0, {
        Layout = Enum.FillDirection.Horizontal,
        VerticalAlignment = Enum.VerticalAlignment.Top,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        Padding = {
            Top = v19.TextBoxSize.Y.Offset / 2,
            Bottom = v19.TextBoxSize.Y.Offset / 2
        },
        Spacing = v19.Spacing
    }, v29);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_useCallback_0 = v2.useCallback;
local l_Pane_0 = v1.UI.Pane;
local l_TextInput_0 = v1.UI.TextInput;
local l_TextLabel_0 = v1.UI.TextLabel;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
return function(v10)
    local v11 = l_Stylizer_0:use("SlopeRenderer");
    local v12 = l_LayoutOrderIterator_0.new();
    local l_Value_0 = v10.Value;
    local v20 = l_useCallback_0(function(v14, v15)
        local l_Min_0 = l_Value_0.Min;
        local l_Max_0 = l_Value_0.Max;
        if v14 then
            local v18 = tonumber(v14);
            if v18 then
                l_Min_0 = math.clamp(v18, 0, l_Max_0);
            end;
        end;
        if v15 then
            local v19 = tonumber(v15);
            if v19 then
                l_Max_0 = math.clamp(v19, l_Min_0, 90);
            end;
        end;
        v10.OnChanged({
            Min = l_Min_0,
            Max = l_Max_0
        });
    end, {
        l_Value_0
    });
    return v2.createElement(l_Pane_0, {
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        Layout = Enum.FillDirection.Horizontal,
        Size = UDim2.new(1, 0, 0, v11.Height),
        Spacing = v11.Spacing
    }, {
        MinSlope = v2.createElement(l_TextInput_0, {
            LayoutOrder = v12:getNextOrder(),
            OnFocusLost = function(v21)
                v20(v21, nil);
            end,
            Size = UDim2.new(0, v11.TextInputWidth, 1, 0),
            Text = tostring(l_Value_0.Min)
        }),
        Hyphen = v2.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.X,
            LayoutOrder = v12:getNextOrder(),
            Size = UDim2.fromScale(0, 1),
            Text = "-"
        }),
        MaxSlope = v2.createElement(l_TextInput_0, {
            LayoutOrder = v12:getNextOrder(),
            Size = UDim2.new(0, v11.TextInputWidth, 1, 0),
            OnFocusLost = function(v22)
                v20(nil, v22);
            end,
            Text = tostring(l_Value_0.Max)
        }),
        Degree = v2.createElement(l_TextLabel_0, {
            AutomaticSize = Enum.AutomaticSize.X,
            LayoutOrder = v12:getNextOrder(),
            Size = UDim2.fromScale(0, 1),
            Text = "\194\176"
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Packages.ReactRoblox);
local l_Localization_0 = v1.ContextServices.Localization;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_deepCopy_0 = v1.Util.deepCopy;
local l_useCallback_0 = v2.useCallback;
local l_useEffect_0 = v2.useEffect;
local l_useMemo_0 = v2.useMemo;
local l_useRef_0 = v2.useRef;
local l_useState_0 = v2.useState;
local l_Form_0 = v1.UI.Form;
local l_IconButton_0 = v1.UI.IconButton;
local l_Pane_0 = v1.UI.Pane;
local v15 = require(l_script_FirstAncestor_0.Src.Components.Renderers.Material);
local v16 = require(script.Elevation);
local v17 = require(script.Slope);
local v18 = require(l_script_FirstAncestor_0.Src.Controllers.PluginController);
local v19 = require(l_script_FirstAncestor_0.Src.Util.MaterialPresetSettingsHelper);
local l_Category_0 = require(l_script_FirstAncestor_0.Src.Types).Category;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local v22 = {
    MaterialIndex = "MaterialIndex",
    Multiple = "Multiple",
    None = "None"
};
return function(v23)
    local v24, v25 = l_useState_0(v23.Value);
    l_useEffect_0(function()
        local v26 = l_deepCopy_0(v23.Value);
        if v26.MaterialIndex ~= v24.MaterialIndex then
            v26.MaterialIndex = v24.MaterialIndex;
        end;
        table.sort(v26.MaterialList, function(v27, v28)
            return v27.Priority < v28.Priority;
        end);
        v25(v26);
    end, {
        v23.Value
    });
    local l_Schema_0 = v23.Schema;
    local l_Height_0 = l_Schema_0.Height;
    local v31 = v18:use():getRoot();
    local v32, v33 = l_useState_0(false);
    local v34 = l_Localization_0:use();
    local v35 = l_Stylizer_0:use("MaterialRangesRenderer");
    local v49 = l_useCallback_0(function(v36, v37)
        local function v38(v39, v40)
            local v41 = {};
            for v42, v43 in v40, nil, nil do
                if not v39[v42] or typeof(v39[v42]) ~= typeof(v43) then
                    v41[v42] = v43;
                elseif typeof(v43) == "table" then
                    v41[v42] = v38(v39[v42], v43);
                elseif v43 ~= v39[v42] then
                    v41[v42] = v43;
                end;
            end;
            for v44, _ in v39, nil, nil do
                if not v40[v44] then
                    v41[v44] = false;
                end;
            end;
            if next(v41) == nil then
                return nil;
            else
                return v41;
            end;
        end;
        local v46 = v38(v36, v37);
        if v46 then
            for v47, _ in v46, nil, nil do
                if v47 ~= "MaterialIndex" then
                    return v22.Multiple;
                end;
            end;
            if next(v46) ~= nil then
                return v22.MaterialIndex;
            else
                return v22.None;
            end;
        else
            return v22.None;
        end;
    end);
    local v50 = l_useMemo_0(function()
        return v19.Get(v24, v34);
    end, {
        v24
    });
    local v51, v52 = l_useState_0(false);
    local v53 = l_useRef_0();
    local v54 = l_useCallback_0(function()
        if v53.current then
            if v53.current.AbsoluteSize.Y < v35.MinHeight then
                v52(true);
                return ;
            else
                v52(false);
            end;
        end;
    end, {});
    local v55, v56 = l_useState_0({});
    return v2.createElement(l_Pane_0, {
        Size = UDim2.new(1, 0, 0, 32)
    }, {
        Button = v2.createElement(l_IconButton_0, {
            OnClick = function()
                v33(true);
            end,
            Size = UDim2.fromScale(1, 1),
            Text = v34:getText(l_Category_0.ElevationSettings, "Edit"),
            TextXAlignment = Enum.TextXAlignment.Center
        }),
        Portal = if not not v32 and v31 then v3.createPortal({
            Dismiss = v2.createElement("TextButton", {
                AutoButtonColor = false,
                BackgroundColor = v35.BackgroundColor,
                BackgroundTransparency = 0.2,
                Position = UDim2.fromOffset(0, 0),
                ref = v53,
                Size = UDim2.fromScale(1, 1),
                [v2.Event.Activated] = function()
                    v33(false);
                    local _, v58 = v49(v24, v23.Value);
                    if v58 ~= v22.None then
                        v23.OnChanged(v24);
                    end;
                end,
                [v2.Change.AbsoluteSize] = v54
            }),
            Image = v2.createElement("ImageLabel", v35.CloseButton),
            Edit = v2.createElement("TextButton", {
                AutomaticSize = if not v51 then Enum.AutomaticSize.Y else nil,
                AutoButtonColor = false,
                AnchorPoint = v35.Dialog.AnchorPoint,
                Position = v35.Dialog.Position,
                Size = if not v51 then v35.Dialog.Size else v35.Dialog.FillSize,
                [v2.Change.AbsoluteSize] = v54
            }, {
                Contents = v2.createElement(l_Pane_0, {
                    AutomaticSize = if not v51 then Enum.AutomaticSize.Y else nil,
                    BackgroundColor = v35.Dialog.BackgroundColor,
                    HorizontalAlignment = Enum.HorizontalAlignment.Left,
                    Layout = Enum.FillDirection.Vertical,
                    Padding = v35.Padding,
                    Size = if not v51 then UDim2.fromScale(1, 0) else UDim2.fromScale(1, 1),
                    Spacing = v35.Padding
                }, {
                    Form = v2.createElement(l_Form_0, {
                        Expansion = v55,
                        ExpandByDefault = true,
                        Items = v50,
                        LabelHeight = 20,
                        LabelWidth = UDim.new(0, 100),
                        LayoutOrder = 1,
                        OnChange = function(v59)
                            local v60 = v19.Set(v59, v24, l_Height_0);
                            table.sort(v60.MaterialList, function(v61, v62)
                                return v61.Priority < v62.Priority;
                            end);
                            v25(v60);
                            if v49(v24, v60) == v22.Multiple then
                                v23.OnChanged(v60);
                            end;
                        end,
                        OnExpansionChange = v56,
                        Renderers = {
                            Elevation = v16,
                            Material = v15,
                            Slope = v17
                        },
                        Size = if not v51 then UDim2.fromScale(1, 0) else UDim2.new(1, 0, 1, -v35.Reset.Size.Y.Offset),
                        UseScrollingFrame = v51
                    }),
                    Button = v2.createElement(l_IconButton_0, {
                        LayoutOrder = 2,
                        LeftIcon = v35.Reset.Icon,
                        OnClick = l_Schema_0.OnReset,
                        Size = v35.Reset.Size,
                        Text = "Reset"
                    })
                })
            })
        }, v31) else nil
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local l_UI_0 = v1.UI;
local l_Checkbox_0 = l_UI_0.Checkbox;
local l_Pane_0 = l_UI_0.Pane;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
return function(v9)
    local l_Schema_0 = v9.Schema;
    local v11 = l_Stylizer_0:use("MultiSelectionRenderer");
    local v12 = l_LayoutOrderIterator_0.new();
    local l_Items_0 = l_Schema_0.Items;
    local l_Labels_0 = l_Schema_0.Labels;
    local l_Value_0 = v9.Value;
    local v16 = {};
    for v17, v18 in l_Items_0, nil, nil do
        v16[v17] = v2.createElement(l_Checkbox_0, {
            Checked = l_Value_0[v18],
            Disabled = v9.Disabled,
            LayoutOrder = v12:getNextOrder(),
            OnClick = function()
                local v19 = table.clone(l_Value_0);
                v19[v18] = not l_Value_0[v18];
                v9.OnChanged(v19);
            end,
            Text = l_Labels_0[v17]
        });
    end;
    return v2.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        Layout = Enum.FillDirection.Vertical,
        Size = UDim2.fromScale(1, 0),
        Spacing = v11.Spacing
    }, v16);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local _ = v1.UI.Button;
local l_IconButton_0 = v1.UI.IconButton;
local l_Pane_0 = v1.UI.Pane;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
return function(v8)
    local v9 = l_Stylizer_0:use("PlaneLockRenderer");
    local l_Schema_0 = v8.Schema;
    return v2.createElement(l_Pane_0, {
        Layout = Enum.FillDirection.Horizontal,
        Size = UDim2.new(1, 0, 0, v9.Height),
        Spacing = v9.Spacing
    }, {
        Edit = v2.createElement(l_Pane_0, {
            LayoutOrder = 1,
            Size = UDim2.new(1, -v9.Height - v9.Spacing, 0, v9.Height)
        }, {
            Button = v2.createElement(l_IconButton_0, {
                OnClick = function()
                    v8.OnChanged(not v8.Value);
                end,
                Size = UDim2.fromScale(1, 1),
                Style = "PrimaryBrand",
                Text = if not v8.Value then l_Schema_0.EditLabel else l_Schema_0.ApplyLabel,
                TextXAlignment = Enum.TextXAlignment.Center
            })
        }),
        Reset = v2.createElement(l_IconButton_0, {
            LayoutOrder = 2,
            OnClick = l_Schema_0.OnReset,
            LeftIcon = v9.Icon,
            IconSize = v9.Height - 14,
            Size = UDim2.fromOffset(v9.Height, v9.Height)
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useMemo_0 = v2.useMemo;
local l_Localization_0 = v1.ContextServices.Localization;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_IconButton_0 = v1.UI.IconButton;
local _ = v1.UI.Image;
local l_Pane_0 = v1.UI.Pane;
local _ = v1.UI.TextLabel;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local v11 = require(l_script_FirstAncestor_0.Src.Util.getItems);
local v12 = require(l_script_FirstAncestor_0.Src.Types);
local l_EnumType_0 = v12.EnumType;
local l_TerrainType_0 = v12.TerrainType;
return function(v15)
    local v16 = l_Localization_0:use();
    local v17 = l_useMemo_0(function()
        return v11(v16, nil, l_EnumType_0.TerrainType);
    end);
    local v18 = l_Stylizer_0:use("TerrainTypeRenderer");
    local l_ItemsPerRow_0 = v18.ItemsPerRow;
    local v20 = {};
    local v21 = {};
    local v22 = 0;
    local v23 = 1;
    for _, v25 in v17, nil, nil do
        local l_Id_0 = v25.Id;
        if l_Id_0 ~= l_TerrainType_0.None then
            local l_Label_0 = v25.Label;
            v23 = math.floor(v22 / l_ItemsPerRow_0) + 1;
            local v28 = v22 % l_ItemsPerRow_0 + 1;
            v21[l_Id_0] = v2.createElement(l_Pane_0, {
                LayoutOrder = v28,
                Size = UDim2.new(1 / l_ItemsPerRow_0, -v18.Spacing * ((l_ItemsPerRow_0 - 1) / l_ItemsPerRow_0), 0, v18.Height)
            }, {
                Button = v2.createElement(l_IconButton_0, {
                    BorderColor = if l_Id_0 == v15.Value then v18.BorderColor else nil,
                    IconSize = v18.IconSize,
                    LeftIcon = ("rbxasset://textures/TerrainEditor/%*.png"):format((string.lower(l_Id_0))),
                    OnClick = function()
                        if v15.Value == l_Id_0 then
                            v15.OnChanged(l_TerrainType_0.None);
                            return ;
                        else
                            v15.OnChanged(l_Id_0);
                            return ;
                        end;
                    end,
                    Size = UDim2.fromScale(1, 1),
                    Text = l_Label_0
                })
            });
            if v28 == l_ItemsPerRow_0 then
                v20[("Row%*"):format(v23)] = v2.createElement(l_Pane_0, {
                    HorizontalAlignment = Enum.HorizontalAlignment.Left,
                    Layout = Enum.FillDirection.Horizontal,
                    LayoutOrder = v23,
                    Size = UDim2.new(1, 0, 0, v18.Height),
                    Spacing = v18.Spacing
                }, v21);
                v21 = {};
            end;
            v22 = v22 + 1;
        end;
    end;
    if next(v21) then
        v20.FinalRow = v2.createElement(l_Pane_0, {
            HorizontalAlignment = Enum.HorizontalAlignment.Left,
            Layout = Enum.FillDirection.Horizontal,
            LayoutOrder = v23,
            Size = UDim2.new(1, 0, 0, v18.Height),
            Spacing = v18.Spacing
        }, v21);
    end;
    return v2.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        Layout = Enum.FillDirection.Vertical,
        Size = UDim2.fromScale(1, 0),
        Spacing = v18.Spacing
    }, v20);
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_useState_0 = v2.useState;
local l_UI_0 = v1.UI;
local l_Button_0 = l_UI_0.Button;
local l_ExpandablePane_0 = l_UI_0.ExpandablePane;
local l_Pane_0 = l_UI_0.Pane;
local l_TextLabel_0 = l_UI_0.TextLabel;
local l_TextWithLinks_0 = l_UI_0.TextWithLinks;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local l_Localization_0 = v1.ContextServices.Localization;
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_BrowserService_0 = game:GetService("BrowserService");
return function(v15)
    local v16 = l_Stylizer_0:use("UpgradeRenderer");
    local v17 = l_LayoutOrderIterator_0.new();
    local v18 = l_Localization_0:use();
    local l_Schema_0 = v15.Schema;
    local v20 = v18:getText(l_Schema_0.Id, "Description");
    local v21 = v18:getText(l_Schema_0.Id, "Explanation");
    local v22 = v18:getText(l_Schema_0.Id, "Title");
    local v23 = v18:getText("UpgradeSettings", "ActionButton");
    local v24 = v18:getText("UpgradeSettings", "LearnMore");
    local v25 = v18:getText("UpgradeSettings", "LearnMoreLink");
    local v26, v27 = l_useState_0(true);
    return v2.createElement(l_ExpandablePane_0, {
        Expanded = v26,
        OnExpandedChanged = v27,
        Text = v22
    }, {
        Blurb = v2.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            Layout = Enum.FillDirection.Vertical,
            LayoutOrder = v17:getNextOrder(),
            Size = UDim2.fromScale(1, 0),
            Spacing = v16.Spacing
        }, {
            Explanation = v2.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                LayoutOrder = v17:getNextOrder(),
                Size = UDim2.fromScale(1, 0),
                Text = ("%*\n\n%*"):format(v20, v21),
                TextXAlignment = Enum.TextXAlignment.Left,
                TextWrapped = true
            }),
            LearnMoreLink = v2.createElement(l_TextWithLinks_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                HorizontalAlignment = Enum.HorizontalAlignment.Left,
                LayoutOrder = v17:getNextOrder(),
                LinkMap = {
                    ["[link]"] = {
                        LinkText = v25,
                        LinkCallback = function()
                            l_BrowserService_0:OpenBrowserWindow(l_Schema_0.URL);
                        end
                    }
                },
                MaxWidth = v16.MaxWidth,
                Size = UDim2.fromScale(1, 0),
                Text = v24,
                TextXAlignment = Enum.TextXAlignment.Left,
                TextProps = {
                    Font = v16.Font,
                    TextSize = v16.TextSize
                }
            })
        }),
        Upgrade = v2.createElement(l_Button_0, {
            LayoutOrder = v17:getNextOrder(),
            OnClick = l_Schema_0.OnClick,
            Size = UDim2.new(1, 0, 0, 32),
            Text = v23
        })
    });
end;


local v0 = require(script:FindFirstAncestor("TerrainEditor").Src.Flags.getFFlagTerrainEditorGenerationFeature);
return {
    BrushSize = require(script.BrushSize),
    Button = require(script.Button),
    ConfirmGeneration = if not v0() then nil else require(script.ConfirmGeneration),
    DelayedSlider = if not v0() then nil else require(script.DelayedSlider),
    Label = require(script.Label),
    Image = require(script.Image),
    Material = require(script.Material),
    MaterialRanges = if not v0() then nil else require(script.MaterialRanges),
    MultiSelection = require(script.MultiSelection),
    PlaneLock = require(script.PlaneLock),
    TerrainType = require(script.TerrainType),
    Upgrade = require(script.Upgrade)
};


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Dash);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local v3 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_useEffect_0 = v2.useEffect;
local l_useState_0 = v2.useState;
local v6 = require(l_script_FirstAncestor_0.Src.Hooks.useEventConnection);
local v7 = require(l_script_FirstAncestor_0.Src.Hooks.useGizmos);
local v8 = require(l_script_FirstAncestor_0.Src.Hooks.useNote);
local v9 = require(l_script_FirstAncestor_0.Src.Components.Gizmos.Brush);
local v10 = require(l_script_FirstAncestor_0.Src.Components.Gizmos.Placement);
local v11 = require(l_script_FirstAncestor_0.Src.Components.Gizmos.Plane);
local v12 = require(l_script_FirstAncestor_0.Src.Components.Gizmos.Region);
local v13 = require(l_script_FirstAncestor_0.Src.Components.Gizmos.Note);
local v14 = require(l_script_FirstAncestor_0.Src.Controllers.PluginController);
local v15 = require(l_script_FirstAncestor_0.Src.Controllers.ToolController);
local l_Pane_0 = v3.UI.Pane;
local l_Gizmo_0 = require(l_script_FirstAncestor_0.Src.Types).Gizmo;
local v18 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagTerrainEditorGenerationFeature);
local v19 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagTerrainEditorErrorHandling);
local v20 = {
    [l_Gizmo_0.Brush] = v9,
    [l_Gizmo_0.Placement] = if not v18() then nil else v10,
    [l_Gizmo_0.Plane] = v11,
    [l_Gizmo_0.Region] = v12
};
return function(v21)
    local v22 = v15:use();
    local v23 = v14:use();
    local v24, v25 = l_useState_0(true);
    local v26, v27, v28, v29 = v7(v22, v24);
    local v30 = v8(v22, v24);
    v6(v23.Activation, v25, {});
    l_useEffect_0(function()
        if not (v19() or #v26 ~= 0) or not v24 then
            v23:disable();
            return ;
        else
            v23:enable();
            v25(true);
            return ;
        end;
    end, {
        v28,
        v24,
        v26
    });
    if v24 then
        local v31 = {};
        for _, v33 in v26, nil, nil do
            local v34 = v20[v33.Schema.Type];
            if not v34 then
                error((("No renderer found for gizmo schema %*"):format(v33.Schema.Type)));
            end;
            v31[v33.Id] = v2.createElement(v34, v1.join(v33, {
                Tool = v28._name,
                FromSelf = v29,
                Save = function(v35)
                    local v36 = {};
                    local v37 = {};
                    for v38, v39 in v26, nil, nil do
                        v36[v38] = table.clone(v39);
                        for v40, v41 in v35, nil, nil do
                            v37[v40] = {};
                            for v42, v43 in v41, nil, nil do
                                if v39.Value[v40][v42] ~= v43 then
                                    v37[v40][v42] = v43;
                                end;
                                v36[v38].Value[v40][v42] = v43;
                            end;
                        end;
                    end;
                    v27(v36, v35);
                end
            }));
        end;
        if v30 then
            v31[l_Gizmo_0.Note] = v2.createElement(v13, {
                Key = v30
            });
        end;
        return v2.createElement(l_Pane_0, v21, v31);
    else
        return v2.createElement(l_Pane_0, v21, {});
    end;
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.React);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_useState_0 = v1.useState;
local v4 = require(l_script_FirstAncestor_0.Src.Hooks.useForm);
local v5 = require(l_script_FirstAncestor_0.Src.Hooks.useOperation);
local v6 = require(l_script_FirstAncestor_0.Src.Components.ProgressDialog);
local v7 = require(l_script_FirstAncestor_0.Src.Components.Renderers);
local v8 = require(l_script_FirstAncestor_0.Src.Controllers.ToolController);
local l_Stylizer_0 = v2.ContextServices.Stylizer;
local l_deepEqual_0 = v2.Util.deepEqual;
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local v12 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagTerrainEditorGenerationFeature);
local v13 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagFixTerrainEditorDETruncations);
local l_UI_0 = v2.UI;
local l_Form_0 = l_UI_0.Form;
local l_Pane_0 = l_UI_0.Pane;
return function(v17)
    local l_LayoutOrder_0 = v17.LayoutOrder;
    local l_Size_0 = v17.Size;
    local v20 = l_Stylizer_0:use("ToolSettings");
    local v21, v22 = l_useState_0({});
    local v23 = v8:use();
    local v24, v25 = v4(v23);
    local v26 = v5(v23);
    return v1.createElement(l_Pane_0, {
        BackgroundColor = v20.BackgroundColor,
        LayoutOrder = l_LayoutOrder_0,
        Size = l_Size_0
    }, {
        Form = v1.createElement(l_Form_0, {
            Expansion = v21,
            ExpandByDefault = true,
            Items = v24,
            LabelHeight = 20,
            LabelWidth = if not v13() then if v12() then UDim.new(0, 120) else UDim.new(0, 100) else UDim.new(0, 140),
            OnChange = function(v27)
                if not v12() then
                    local v28 = {};
                    for v29, v30 in v27, nil, nil do
                        v28[v30.Id] = {};
                        for v31, v32 in v30.Children, nil, nil do
                            if v32.Value ~= v24[v29].Children[v31].Value then
                                v28[v30.Id][v32.DataId or v32.Id] = v32.Value;
                            end;
                        end;
                    end;
                    v25(v28);
                    return ;
                else
                    local v33 = {};
                    local function v34(v35, v36)
                        local v37 = {};
                        for v38, v39 in v35, nil, nil do
                            if if typeof(v39.Value) == "table" then l_deepEqual_0(v39.Value, v36[v38].Value) else v39.Value == v36[v38].Value then
                                if not (not v39.Children or l_deepEqual_0(v39.Children, v36[v38].Children)) then
                                    v37[v39.DataId or v39.Id] = {
                                        Children = v34(v39.Children, v36[v38].Children)
                                    };
                                end;
                            elseif not v39.Children or l_deepEqual_0(v39.Children, v36[v38].Children) then
                                if not v39.Children then
                                    v37[v39.DataId or v39.Id] = v39.Value;
                                else
                                    v37[v39.DataId or v39.Id] = {
                                        Value = v39.Value
                                    };
                                end;
                            else
                                v37[v39.DataId or v39.Id] = {
                                    Children = v34(v39.Children, v36[v38].Children),
                                    Value = v39.Value
                                };
                            end;
                        end;
                        return v37;
                    end;
                    for v40, v41 in v27, nil, nil do
                        v33[v41.Id] = v34(v41.Children, v24[v40].Children);
                    end;
                    v25(v33);
                    return ;
                end;
            end,
            OnExpansionChange = v22,
            Renderers = v7,
            Size = UDim2.fromScale(1, 1)
        }),
        ProgressDialog = if not v26 then nil else v1.createElement(v6, v26)
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_StyleModifier_0 = v1.Util.StyleModifier;
local l_UI_0 = v1.UI;
local l_Button_0 = l_UI_0.Button;
local l_Pane_0 = l_UI_0.Pane;
local l_Image_0 = l_UI_0.Image;
local l_TextLabel_0 = l_UI_0.TextLabel;
local v9 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagFixTerrainEditorDETruncations);
return function(v10)
    local l_Icon_0 = v10.Icon;
    local l_Key_0 = v10.Key;
    local l_Name_0 = v10.Name;
    local l_OnClick_0 = v10.OnClick;
    return v2.createElement(l_Button_0, {
        OnClick = function()
            l_OnClick_0(l_Key_0);
        end,
        Position = v10.Position,
        Size = v10.Size,
        Style = "RoundSubtle",
        StyleModifier = if l_Key_0 == v10.Selected then l_StyleModifier_0.Selected else nil
    }, {
        Pane = v2.createElement(l_Pane_0, {
            HorizontalAlignment = Enum.HorizontalAlignment.Center,
            Layout = Enum.FillDirection.Vertical,
            Padding = 2,
            Spacing = 2
        }, {
            Icon = v2.createElement(l_Image_0, l_Icon_0),
            Text = v2.createElement(l_TextLabel_0, {
                AutomaticSize = Enum.AutomaticSize.XY,
                LayoutOrder = 2,
                Text = l_Name_0,
                TextSize = if not v9() then nil else v10.TextSize
            })
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Framework);
local v2 = require(l_script_FirstAncestor_0.Packages.React);
local l_Stylizer_0 = v1.ContextServices.Stylizer;
local l_LayoutOrderIterator_0 = v1.Util.LayoutOrderIterator;
local v5 = require(script.Tile);
local l_UI_0 = v1.UI;
local l_Grid_0 = l_UI_0.Grid;
local l_Pane_0 = l_UI_0.Pane;
local l_Tabs_0 = l_UI_0.Tabs;
local v10 = require(l_script_FirstAncestor_0.Src.Controllers.ToolController);
local v11 = require(l_script_FirstAncestor_0.Src.Hooks.useToolbar);
local _ = require(l_script_FirstAncestor_0.Src.Resources.Theme);
local l_TextService_0 = game:GetService("TextService");
local v14 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagFixTerrainEditorDETruncations);
return function(v15)
    local v16 = l_Stylizer_0:use("Toolbar");
    local v17 = l_LayoutOrderIterator_0.new();
    local v18 = v10.use();
    local v19 = v11(v18);
    local v20 = {};
    for v21, v22 in v19.Tools, nil, nil do
        v20[v21] = {
            icon = {
                Image = string.format(v22.icon.Image, v16.StudioTheme),
                Size = v16.IconSize
            },
            name = v22.name
        };
    end;
    return v2.createElement(l_Pane_0, {
        AutomaticSize = Enum.AutomaticSize.Y,
        HorizontalAlignment = Enum.HorizontalAlignment.Left,
        Layout = Enum.FillDirection.Vertical,
        LayoutOrder = v15.LayoutOrder,
        VerticalAlignment = Enum.VerticalAlignment.Top,
        [v2.Change.AbsoluteSize] = function(v23)
            v15.OnAbsoluteSizeChanged(v23.AbsoluteSize);
        end
    }, {
        Category = v2.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            BackgroundColor = v16.TabBackgroundColor,
            LayoutOrder = v17:getNextOrder(),
            Size = UDim2.fromScale(1, 0)
        }, {
            Tabs = v2.createElement(l_Tabs_0, {
                LayoutOrder = v17:getNextOrder(),
                OnTabSelected = function(v24)
                    v18:setTabIndex(v24.Key);
                end,
                SelectedTab = v19.TabIndex,
                Tabs = v19.Tabs
            })
        }),
        Tools = v2.createElement(l_Pane_0, {
            AutomaticSize = Enum.AutomaticSize.Y,
            LayoutOrder = v17:getNextOrder(),
            Size = UDim2.fromScale(1, 0)
        }, {
            Grid = v2.createElement(l_Grid_0, {
                AutomaticSize = Enum.AutomaticSize.Y,
                Cells = v20,
                CellComponent = v5,
                CellPadding = v16.CellPadding,
                CellSize = v16.CellSize,
                GetCellProps = function(v25, v26, v27, v28)
                    local v29 = nil;
                    if v14() then
                        v29 = if v16.OverflowThreshold < l_TextService_0:GetTextSize(v25.name, v16.TextSize, Enum.Font.SourceSans, (Vector2.new(v16.CellSize.X.Offset, v16.CellSize.Y.Offset))).X then v16.OverflowTextSize else v16.TextSize;
                    end;
                    return {
                        Icon = v25.icon,
                        Key = v26,
                        Name = v25.name,
                        OnClick = function(v30)
                            v18:setToolIndex(v30);
                        end,
                        Position = v27,
                        Selected = v19.ToolIndex,
                        Size = v28,
                        TextSize = if not v14() then nil else v29
                    };
                end,
                ScrollingDirection = Enum.ScrollingDirection.Y,
                Size = UDim2.fromScale(1, 0)
            })
        })
    });
end;


local l_script_FirstAncestor_0 = script:FindFirstAncestor("TerrainEditor");
local v1 = require(l_script_FirstAncestor_0.Packages.Dash);
local v2 = require(l_script_FirstAncestor_0.Packages.Framework);
local l_ContextItem_0 = v2.ContextServices.ContextItem;
local v4 = require(l_script_FirstAncestor_0.Src.Types);
local l_BrushSettings_0 = v4.BrushSettings;
local l_BuildSettings_0 = v4.BuildSettings;
local l_Category_0 = v4.Category;
local l_PlaneLock_0 = v4.PlaneLock;
local l_SelectionSettings_0 = v4.SelectionSettings;
local l_TerrainType_0 = v4.TerrainType;
local l_TransformMode_0 = v4.TransformMode;
local l_TransformSettings_0 = v4.TransformSettings;
local l_Signal_0 = v2.Util.Signal;
local l_Serialization_0 = l_script_FirstAncestor_0.Src.Util.Serialization;
local v15 = require(l_Serialization_0.Serialize);
local v16 = require(l_Serialization_0.Deserialize);
local v17 = require(l_script_FirstAncestor_0.Src.Resources.Constants);
local v18 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagTerrainEditorGenerationFeature);
local v19 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagTerrainEditorBrushPerformanceEnhancements);
local v20 = require(l_script_FirstAncestor_0.Src.Flags.getFFlagTerrainEditorManualPlaneLockRelative);
local v21 = l_ContextItem_0:extend("PluginController");
local l_Workspace_0 = game:GetService("Workspace");
v21.new = function(v23, v24)
    if not v24 then
        assert(v23, "PluginController.new() requires a plugin");
    end;
    local v25 = setmetatable({
        _mock = v24,
        _plugin = v23,
        _store = {
            [l_Category_0.SelectionSettings] = {
                [l_SelectionSettings_0.Size] = Vector3.new(64, 32, 64),
                [l_SelectionSettings_0.SnapToVoxels] = true,
                [l_SelectionSettings_0.Transform] = CFrame.new()
            },
            [l_Category_0.TransformSettings] = {
                [l_TransformSettings_0.Size] = Vector3.new(64, 32, 64),
                [l_TransformSettings_0.SnapToVoxels] = true,
                [l_TransformSettings_0.Transform] = CFrame.new(),
                [l_TransformSettings_0.TransformMode] = l_TransformMode_0.Move
            },
            [l_Category_0.BrushSettings] = {
                [l_BrushSettings_0.ManualPlaneLock] = false,
                [l_BrushSettings_0.PlaneLock] = l_PlaneLock_0.Off,
                [l_BrushSettings_0.PlaneTransform] = CFrame.Angles(1.5707963267948966, 0, 0)
            },
            [l_Category_0.BuildSettings] = if not v18() then nil else {
                [l_BuildSettings_0.TerrainType] = l_TerrainType_0.None
            }
        },
        Activation = l_Signal_0.new(),
        Compact = l_Signal_0.new(),
        Focused = l_Signal_0.new()
    }, v21);
    if not v19() then
        if v17.IsDebuggingSavedSettings then
            v25._store = v1.join(v25._store, (v16(v25._plugin:GetSetting("Global") or {})));
        end;
    elseif not v17.IsDebuggingSavedSettings then
        v25._store = v1.join(v25._store, (v16(v25._plugin:GetSetting("Global") or {})));
    end;
    v25._deactivationListener = v25._plugin.Deactivation:Connect(function()
        v25.Activation:Fire(false);
        v25._enabled = false;
    end);
    return v25;
end;
v21.mock = function(v26)
    return v21.new(v26, true);
end;
v21.isMocking = function(v27)
    return v27._mock;
end;
v21.getPlugin = function(v28)
    return v28._plugin;
end;
v21.getEnabled = function(v29)
    return v29._enabled;
end;
v21.setGlobal = function(v30, v31, v32, v33)
    local l__store_0 = v30._store;
    l__store_0[v31][v32] = v33;
    if (v20() and v32 == l_BrushSettings_0.PlaneLock) and v33 == l_PlaneLock_0.Manual then
        local l_CFrame_0 = l_Workspace_0.CurrentCamera.CFrame;
        l__store_0[v31][l_BrushSettings_0.PlaneTransform] = CFrame.Angles(1.5707963267948966, 0, 0) + (l_CFrame_0.Position + l_CFrame_0.LookVector * 64);
    end;
    if not v19() then
        v30._plugin:SetSetting("Global", v15(v30._store));
        return ;
    else
        if v30._saveSettingsTask then
            task.cancel(v30._saveSettingsTask);
            v30._saveSettingsTask = nil;
        end;
        v30._saveSettingsTask = task.delay(1, function()
            v30._plugin:SetSetting("Global", v15(v30._store));
            v30._saveSettingsTask = nil;
        end);
        return ;
    end;
end;
v21.getGlobal = function(v36, v37, v38)
    return v36._store[v37][v38];
end;
v21.setSetting = function(v39, v40, v41)
    v39._plugin:SetSetting(v40, v15(v41));
end;
v21.getSetting = function(v42, v43)
    return v16(v42._plugin:GetSetting(v43) or {});
end;
v21.toggle = function(v44)
    if not v44._enabled then
        v44:enable();
        return ;
    else
        v44:disable();
        return ;
    end;
end;
v21.enable = function(v45)
    if not v45._enabled then
        v45._enabled = true;
        v45._plugin:Activate(true);
        return ;
    else
        return ;
    end;
end;
v21.disable = function(v46)
    if v46._enabled then
        v46._enabled = false;
        v46._plugin:Deactivate();
        return ;
    else
        return ;
    end;
end;
v21.resume = function(v47)
    v47.Focused:Fire(true);
    v47.Activation:Fire(true);
end;
v21.pause = function(v48)
    v48.Focused:Fire(false);
end;
v21.destroy = function(v49)
    if v49._deactivationListener then
        v49._deactivationListener:Disconnect();
        v49._deactivationListener = nil;
    end;
    v49:disable();
end;
v21.setRoot = function(v50, v51)
    v50._root = v51;
end;
v21.getRoot = function(v52)
    return v52._root;
end;
v21.setPluginWidth = function(v53, v54)
    local v55 = v53:getShouldBeCompact();
    v53._pluginWidth = v54;
    if v55 ~= v53:getShouldBeCompact() then
        v53.Compact:Fire();
    end;
end;
v21.getShouldBeCompact = function(v56)
    if not v56._pluginWidth then
        return false;
    else
        return v56._pluginWidth < v17.MinWindowWidth;
    end;
end;
return v21;