--!strict
local _Package = script.Parent.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))

-- Modules
local Style = require(_Package:WaitForChild("Style"))
local Enums = require(_Package:WaitForChild("Enums"))

-- Types
-- Constants
-- Variables
-- References

-- Class
return function(frame: Frame)
	local maid = Maid.new()
	task.spawn(function()
		local function makeHalfFrame(isDarkMode: boolean, color: Color3): Frame
			local style = Style.new(
				1,
				Enum.Font.SourceSans,
				if isDarkMode then Enums.SchemeType.Dark else Enums.SchemeType.Light,
				color
			)

			local halfFrame = maid:GiveTask(Instance.new("Frame"))
			halfFrame.BackgroundColor3 = style:GetColor(Enums.ColorRoleType.Surface)
			halfFrame.BorderSizePixel = 0
			halfFrame.BackgroundTransparency = 0.5

			local listLayout = maid:GiveTask(Instance.new("UIListLayout"))
			listLayout.FillDirection = Enum.FillDirection.Vertical
			listLayout.Padding = UDim.new(0, 10)
			listLayout.VerticalAlignment = Enum.VerticalAlignment.Center
			listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
			listLayout.Parent = halfFrame

			local Module = require(script.Parent:WaitForChild("ColdFusion"))

			do
				local snackbar = maid:GiveTask(
					Module.surfaceContainer(
						style,
						"Wow what cool text abc 123 abc 123 abc 123 abc 123 uhhh well ya know need to get the full lines lorem ipsum or something",
						"Button",
						function()
							print("button click")
						end,
						function()
							print("close click")
						end,
						0
					)
				)
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end

			do
				local snackbar = maid:GiveTask(
					Module.surfaceContainer(
						style,
						"Wow what cool text abc 123 abc 123 abc 123 abc 123 uhhh well ya know need to get the full lines lorem ipsum or something",
						nil,
						nil,
						function()
							print("close click")
						end,
						0
					)
				)
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end
			-- do
			-- 	local snackbar = maid:GiveTask(
			-- 		Module.surfaceContainer(
			-- 			style,
			-- 			"Wow what cool text abc 123 abc 123 abc 123 abc 123 uhhh well ya know need to get the full lines lorem ipsum or something",
			-- 			"Button",
			-- 			function()
			-- 				print("button click")
			-- 			end,
			-- 			nil,
			-- 			0
			-- 		)
			-- 	)
			-- 	snackbar.AutomaticSize = Enum.AutomaticSize.Y
			-- 	snackbar.Size = UDim2.fromScale(0.9, 0)
			-- 	snackbar.Parent = halfFrame
			-- end
			return halfFrame
		end

		local COLORS: { [number]: Color3 } = {
			Color3.fromHSV(0, 0.9, 0.8),
			-- Color3.fromHSV(0, 0.25, 0.8),
			-- Color3.fromHSV(0, 0.9, 0.5),
			Color3.fromHSV(0.6, 0.9, 0.7),
			Color3.fromHSV(0.35, 0.9, 0.7),
			-- Color3.fromHSV(0.1, 0.9, 0.7),
		}

		for i, color in ipairs(COLORS) do
			local x = (i - 1) / #COLORS
			local width = 1 / #COLORS
			local dark = makeHalfFrame(true, color)

			dark.Size = UDim2.fromScale(width, 0.5)
			dark.Position = UDim2.fromScale(x, 0.5)
			dark.Parent = frame

			local bright = makeHalfFrame(false, color)
			bright.Size = UDim2.fromScale(width, 0.5)
			bright.Position = UDim2.fromScale(x, 0)
			bright.Parent = frame
		end
	end)
	return function()
		maid:Destroy()
	end
end


--!strict
local _Package = script.Parent.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))

-- Modules
local Style = require(_Package:WaitForChild("Style"))
local Enums = require(_Package:WaitForChild("Enums"))

-- Types
-- Constants
-- Variables
-- References

-- Class
return function(frame: Frame)
	local maid = Maid.new()
	task.spawn(function()
		local function makeHalfFrame(isDarkMode: boolean, color: Color3): Frame
			local style = Style.new(
				1,
				Enum.Font.SourceSans,
				if isDarkMode then Enums.SchemeType.Dark else Enums.SchemeType.Light,
				color
			)

			local halfFrame = maid:GiveTask(Instance.new("Frame"))
			halfFrame.BackgroundColor3 = style:GetColor(Enums.ColorRoleType.Surface)
			halfFrame.BorderSizePixel = 0
			halfFrame.BackgroundTransparency = 0.5
			local listLayout = maid:GiveTask(Instance.new("UIListLayout"))
			listLayout.FillDirection = Enum.FillDirection.Vertical
			listLayout.Padding = UDim.new(0, 10)
			listLayout.VerticalAlignment = Enum.VerticalAlignment.Center
			listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
			listLayout.Parent = halfFrame

			local Module = require(script.Parent:WaitForChild("ColdFusion"))

			do
				local snackbar = maid:GiveTask(
					Module.surfaceContainer(
						style,
						"Wow what cool text abc 123 abc 123 abc 123 abc 123 uhhh well ya know need to get the full lines lorem ipsum or something",
						"Button",
						function()
							print("button click")
						end,
						function()
							print("close click")
						end,
						1
					)
				)
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end
			do
				local snackbar = maid:GiveTask(
					Module.primaryContainer(
						style,
						"Wow what cool text abc 123 abc 123 abc 123 abc 123 uhhh well ya know need to get the full lines lorem ipsum or something",
						"Button",
						function()
							print("button click")
						end,
						function()
							print("close click")
						end,
						1
					)
				)
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end
			do
				local snackbar = maid:GiveTask(
					Module.secondaryContainer(
						style,
						"Wow what cool text abc 123 abc 123 abc 123 abc 123 uhhh well ya know need to get the full lines lorem ipsum or something",
						"Button",
						function()
							print("button click")
						end,
						function()
							print("close click")
						end,
						1
					)
				)
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end
			do
				local snackbar = maid:GiveTask(
					Module.tertiaryContainer(
						style,
						"Wow what cool text abc 123 abc 123 abc 123 abc 123 uhhh well ya know need to get the full lines lorem ipsum or something",
						"Button",
						function()
							print("button click")
						end,
						function()
							print("close click")
						end,
						1
					)
				)
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end
			return halfFrame
		end

		local COLORS: { [number]: Color3 } = {
			Color3.fromHSV(0, 0.9, 0.8),
			-- Color3.fromHSV(0, 0.25, 0.8),
			-- Color3.fromHSV(0, 0.9, 0.5),
			Color3.fromHSV(0.6, 0.9, 0.7),
			Color3.fromHSV(0.35, 0.9, 0.7),
			Color3.fromHSV(0.1, 0.9, 0.7),
		}

		for i, color in ipairs(COLORS) do
			local x = (i - 1) / #COLORS
			local width = 1 / #COLORS
			local dark = makeHalfFrame(true, color)

			dark.Size = UDim2.fromScale(width, 0.5)
			dark.Position = UDim2.fromScale(x, 0.5)
			dark.Parent = frame

			local bright = makeHalfFrame(false, color)
			bright.Size = UDim2.fromScale(width, 0.5)
			bright.Position = UDim2.fromScale(x, 0)
			bright.Parent = frame
		end
	end)
	return function()
		maid:Destroy()
	end
end


--!strict
local _Package = script.Parent.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))
local ColdFusion = require(_Packages:WaitForChild("ColdFusion"))
local Icons = require(_Packages:WaitForChild("MaterialIcons"))

-- Modules
local IconButton = require(
	_Package
		:WaitForChild("Component")
		:WaitForChild("Button")
		:WaitForChild("IconButton")
		:WaitForChild("ColdFusion")
)
local TextButton = require(
	_Package
		:WaitForChild("Component")
		:WaitForChild("Button")
		:WaitForChild("TextButton")
		:WaitForChild("ColdFusion")
)
local Util = require(_Package:WaitForChild("Util"))
local Types = require(_Package:WaitForChild("Types"))
local Style = require(_Package:WaitForChild("Style"))
local Enums = require(_Package:WaitForChild("Enums"))
local Typography = require(_Package:WaitForChild("Typography"))

-- Types
type Maid = Maid.Maid
type State<V> = ColdFusion.State<V>
type ValueState<V> = ColdFusion.ValueState<V>
type CanBeState<V> = ColdFusion.CanBeState<V>
type RenderData = Types.RenderData
type ImageData = Types.ImageData
type OptionData = Types.OptionData
type ButtonData = Types.ButtonData
type Style = Style.Style
type Method = () -> ()
type FontData = Types.FontData

-- Constants
local DEFAULTS = require(script.Parent:WaitForChild("Defaults"))
local PADDING_DP = 8
local CORNER_DP = 4

-- Variables
-- References

-- Private Functions

-- Class
local Interface = {}

Interface = {}

function Interface.surfaceContainer(
	style: CanBeState<Style>,
	text: CanBeState<string>,
	buttonText: CanBeState<string?>,
	onButtonClick: CanBeState<Method?>,
	onCloseClick: CanBeState<Method?>,
	elevation: CanBeState<number?>
)
	local maid = Maid.new()

	local _fuse = ColdFusion.fuse(maid)

	local _new = _fuse.new
	local _bind = _fuse.bind
	local _clone = _fuse.clone
	local _import = _fuse.import

	local _Value = _fuse.Value
	local _Computed = _fuse.Computed

	local styleState: State<Style> = _import(style, DEFAULTS.SURFACE_CONTAINER.STYLE)
	local elevationState: State<number> = _import(elevation, DEFAULTS.SURFACE_CONTAINER.ELEVATION or 0)

	local inst = Interface.new(
		_import(text, DEFAULTS.SURFACE_CONTAINER.TEXT or ""),
		_import(buttonText, DEFAULTS.SURFACE_CONTAINER.BUTTON_TEXT or ""),
		_import(onButtonClick, DEFAULTS.SURFACE_CONTAINER.ON_BUTTON_CLICK),
		_import(onCloseClick, DEFAULTS.SURFACE_CONTAINER.ON_CLOSE_CLICK),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.OnSurface, e)
		end, styleState, elevationState),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.Primary, e)
		end, styleState, elevationState),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.SurfaceContainer, e)
		end, styleState, elevationState),
		elevationState,
		_Computed(function(s: Style): any
			return s.SchemeType
		end, styleState),
		_Computed(function(s: Style): FontData
			return s:GetFontData(Enums.FontType.LabelLarge)
		end, styleState),
		_Computed(function(s: Style): number
			return s.Scale
		end, styleState)
	)

	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))

	return inst
end

function Interface.primaryContainer(
	style: CanBeState<Style>,
	text: CanBeState<string>,
	buttonText: CanBeState<string?>,
	onButtonClick: CanBeState<Method?>,
	onCloseClick: CanBeState<Method?>,
	elevation: CanBeState<number?>
)
	local maid = Maid.new()

	local _fuse = ColdFusion.fuse(maid)

	local _new = _fuse.new
	local _bind = _fuse.bind
	local _clone = _fuse.clone
	local _import = _fuse.import

	local _Value = _fuse.Value
	local _Computed = _fuse.Computed

	local styleState: State<Style> = _import(style, DEFAULTS.PRIMARY_CONTAINER.STYLE)
	local elevationState: State<number> = _import(elevation, DEFAULTS.PRIMARY_CONTAINER.ELEVATION or 0)

	local inst = Interface.new(
		_import(text, DEFAULTS.PRIMARY_CONTAINER.TEXT or ""),
		_import(buttonText, DEFAULTS.PRIMARY_CONTAINER.BUTTON_TEXT or ""),
		_import(onButtonClick, DEFAULTS.PRIMARY_CONTAINER.ON_BUTTON_CLICK),
		_import(onCloseClick, DEFAULTS.PRIMARY_CONTAINER.ON_CLOSE_CLICK),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.OnPrimaryContainer, e)
		end, styleState, elevationState),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.Primary, e)
		end, styleState, elevationState),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.PrimaryContainer, e)
		end, styleState, elevationState),
		elevationState,
		_Computed(function(s: Style): any
			return s.SchemeType
		end, styleState),
		_Computed(function(s: Style): FontData
			return s:GetFontData(Enums.FontType.LabelLarge)
		end, styleState),
		_Computed(function(s: Style): number
			return s.Scale
		end, styleState)
	)

	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))

	return inst
end

function Interface.secondaryContainer(
	style: CanBeState<Style>,
	text: CanBeState<string>,
	buttonText: CanBeState<string?>,
	onButtonClick: CanBeState<Method?>,
	onCloseClick: CanBeState<Method?>,
	elevation: CanBeState<number?>
)
	local maid = Maid.new()

	local _fuse = ColdFusion.fuse(maid)

	local _new = _fuse.new
	local _bind = _fuse.bind
	local _clone = _fuse.clone
	local _import = _fuse.import

	local _Value = _fuse.Value
	local _Computed = _fuse.Computed

	local styleState: State<Style> = _import(style, DEFAULTS.SECONDARY_CONTAINER.STYLE)
	local elevationState: State<number> = _import(elevation, DEFAULTS.SECONDARY_CONTAINER.ELEVATION or 0)

	local inst = Interface.new(
		_import(text, DEFAULTS.SECONDARY_CONTAINER.TEXT or ""),
		_import(buttonText, DEFAULTS.SECONDARY_CONTAINER.BUTTON_TEXT or ""),
		_import(onButtonClick, DEFAULTS.SECONDARY_CONTAINER.ON_BUTTON_CLICK),
		_import(onCloseClick, DEFAULTS.SECONDARY_CONTAINER.ON_CLOSE_CLICK),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.OnSecondaryContainer, e)
		end, styleState, elevationState),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.Secondary, e)
		end, styleState, elevationState),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.SecondaryContainer, e)
		end, styleState, elevationState),
		elevationState,
		_Computed(function(s: Style): any
			return s.SchemeType
		end, styleState),
		_Computed(function(s: Style): FontData
			return s:GetFontData(Enums.FontType.LabelLarge)
		end, styleState),
		_Computed(function(s: Style): number
			return s.Scale
		end, styleState)
	)

	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))

	return inst
end

function Interface.tertiaryContainer(
	style: CanBeState<Style>,
	text: CanBeState<string>,
	buttonText: CanBeState<string?>,
	onButtonClick: CanBeState<Method?>,
	onCloseClick: CanBeState<Method?>,
	elevation: CanBeState<number?>
)
	local maid = Maid.new()

	local _fuse = ColdFusion.fuse(maid)

	local _new = _fuse.new
	local _bind = _fuse.bind
	local _clone = _fuse.clone
	local _import = _fuse.import

	local _Value = _fuse.Value
	local _Computed = _fuse.Computed

	local styleState: State<Style> = _import(style, DEFAULTS.TERTIARY_CONTAINER.STYLE)
	local elevationState: State<number> = _import(elevation, DEFAULTS.TERTIARY_CONTAINER.ELEVATION or 0)

	local inst = Interface.new(
		_import(text, DEFAULTS.TERTIARY_CONTAINER.TEXT or ""),
		_import(buttonText, DEFAULTS.TERTIARY_CONTAINER.BUTTON_TEXT or ""),
		_import(onButtonClick, DEFAULTS.TERTIARY_CONTAINER.ON_BUTTON_CLICK),
		_import(onCloseClick, DEFAULTS.TERTIARY_CONTAINER.ON_CLOSE_CLICK),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.OnTertiaryContainer, e)
		end, styleState, elevationState),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.Tertiary, e)
		end, styleState, elevationState),
		_Computed(function(s: Style, e: number?): Color3
			return s:GetColor(Enums.ColorRoleType.TertiaryContainer, e)
		end, styleState, elevationState),
		elevationState,
		_Computed(function(s: Style): any
			return s.SchemeType
		end, styleState),
		_Computed(function(s: Style): FontData
			return s:GetFontData(Enums.FontType.LabelLarge)
		end, styleState),
		_Computed(function(s: Style): number
			return s.Scale
		end, styleState)
	)

	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))

	return inst
end

function Interface.new(
	text: CanBeState<string>,
	buttonText: CanBeState<string?>,
	onButtonClick: CanBeState<Method?>,
	onCloseClick: CanBeState<Method?>,
	textColor: CanBeState<Color3>,
	buttonTextColor: CanBeState<Color3>,
	backgroundColor: CanBeState<Color3>,
	elevation: CanBeState<number>,
	schemeType: CanBeState<Enums.SchemeType>,
	fontData: CanBeState<FontData>,
	scale: CanBeState<number>
): GuiObject
	local maid = Maid.new()

	local _fuse = ColdFusion.fuse(maid)

	local _new = _fuse.new
	local _bind = _fuse.bind
	local _clone = _fuse.clone
	local _import = _fuse.import

	local _Value = _fuse.Value
	local _Computed = _fuse.Computed

	local scaleState: State<number> = _import(scale, DEFAULTS.NEW.SCALE or 1)
	local schemeTypeState: State<Enums.SchemeType> = _import(schemeType, DEFAULTS.NEW.SCHEME_TYPE)
	local fontDataState: State<FontData> = _import(fontData, DEFAULTS.NEW.FONT_DATA)

	local buttonTextState: State<string> = _import(buttonText, DEFAULTS.NEW.BUTTON_TEXT or "")

	local textState: State<string> = _import(text, DEFAULTS.NEW.TEXT or "")
	local elevationState: State<number> = _import(elevation, DEFAULTS.NEW.ELEVATION or 0)

	local onButtonClickState = _import(onButtonClick, DEFAULTS.NEW.ON_BUTTON_CLICK)
	local onCloseClickState = _import(onCloseClick, DEFAULTS.NEW.ON_CLOSE_CLICK)

	local backgroundColorState = _import(backgroundColor, DEFAULTS.NEW.BACKGROUND_COLOR)
	local textColorState = _import(textColor, DEFAULTS.NEW.TEXT_COLOR)
	local buttonTextColorState = _import(buttonTextColor, DEFAULTS.NEW.BUTTON_TEXT_COLOR)

	local inst: Frame = _new("Frame")({
		Name = "Snackbar",
		AutomaticSize = Enum.AutomaticSize.XY,
		BackgroundColor3 = backgroundColorState,
		Children = {
			maid:GiveTask(Util.Padding.ColdFusion.new(
				_Computed(function(sc: number): UDim
					return UDim.new(0, sc * PADDING_DP)
				end, scaleState),
				_Computed(function(sc: number): UDim
					return UDim.new(0, sc * PADDING_DP)
				end, scaleState)
			)) :: Instance,
			maid:GiveTask(_new("UICorner")({
				CornerRadius = _Computed(function(sc: number): UDim
					return UDim.new(0, sc * CORNER_DP)
				end, scaleState),
			})),
			maid:GiveTask(
				Util.List.ColdFusion.new(
					Enum.VerticalAlignment.Center,
					Enum.HorizontalAlignment.Right,
					Enum.FillDirection.Horizontal,
					_Computed(function(sc: number): UDim
						return UDim.new(0, sc * PADDING_DP)
					end, scaleState),
					Enum.UIFlexAlignment.None,
					Enum.UIFlexAlignment.SpaceBetween,
					Enum.ItemLineAlignment.Stretch,
					false
				)
			),
			_new("TextLabel")({
				Name = "Text",
				Text = textState,
				RichText = true,
				TextWrapped = true,
				TextYAlignment = Enum.TextYAlignment.Top,
				TextXAlignment = Enum.TextXAlignment.Left,
				LayoutOrder = 1,
				Visible = _Computed(function(h: string): boolean
					return h:len() > 0
				end, textState),
				TextColor3 = textColorState,
				TextTransparency = 0,
				BackgroundTransparency = 1,
				AutomaticSize = Enum.AutomaticSize.XY,
				TextSize = _Computed(function(f: FontData, sc: number): number
					return Typography.getTextSize(f.Size, sc)
				end, fontDataState, scaleState),
				LineHeight = _Computed(function(f: FontData, sc: number): number
					return Typography.getGuiLineHeight(f.LineHeight, f.Size)
				end, fontDataState, scaleState),
				FontFace = _Computed(function(f: FontData): Font
					return f.Font
				end, fontDataState),
				Size = UDim2.fromOffset(0, 0),
				Children = {
					_new("UIFlexItem")({
						FlexMode = Enum.UIFlexMode.Shrink,
						ItemLineAlignment = Enum.ItemLineAlignment.Center,
					}),
				},
			}) :: Instance,
			_bind(maid:GiveTask(Util.Container.ColdFusion.new()))({
				LayoutOrder = 3,
				Name = "Buttons",
				Children = {
					maid:GiveTask(
						Util.List.ColdFusion.new(
							Enum.VerticalAlignment.Center,
							Enum.HorizontalAlignment.Right,
							Enum.FillDirection.Horizontal,
							UDim.new(0, 0),
							Enum.UIFlexAlignment.None,
							Enum.UIFlexAlignment.None,
							Enum.ItemLineAlignment.Stretch,
							false
						)
					) :: Instance,
					_bind(maid:GiveTask(Util.Container.ColdFusion.new()))({
						LayoutOrder = 2,
						Name = "Button",
						Visible = _Computed(function(onClick: Method?): boolean
							return onClick ~= nil
						end, onButtonClickState),
						Children = {
							maid:GiveTask(Util.List.ColdFusion.center()) :: Instance,
							maid:GiveTask(
								TextButton.new(
									_Computed(function(onClick: Method?): Method
										return onClick or function() end
									end, onButtonClickState),
									buttonTextState,
									nil,
									buttonTextColorState,
									textColorState,
									_Computed(function(onClick: Method?): boolean
										return onClick ~= nil
									end, onButtonClickState),
									elevationState,
									schemeTypeState,
									fontDataState,
									scaleState
								)
							) :: Instance,
						},
					}),
					_bind(maid:GiveTask(Util.Container.ColdFusion.new()))({
						LayoutOrder = 3,
						Name = "ExitButton",
						Visible = _Computed(function(onClick: Method?): boolean
							return onClick ~= nil
						end, onCloseClickState),
						Children = {
							maid:GiveTask(Util.List.ColdFusion.center()) :: Instance,
							maid:GiveTask(
								IconButton.new(
									_Computed(function(onClick: Method?): Method
										return onClick or function() end
									end, onCloseClickState),
									Icons.close,
									textColorState,
									textColorState,
									_Computed(function(onClick: Method?): boolean
										return onClick ~= nil
									end, onCloseClickState),
									elevationState,
									schemeTypeState,
									fontDataState,
									scaleState
								)
							) :: Instance,
						},
					}),
				},
			}),
		},
	}) :: Frame

	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))

	return inst
end

return Interface


--!strict
-- this script was generated by the build system, please do not make manual edits
local _Package = script.Parent.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))
local ColdFusion = require(_Packages:WaitForChild("ColdFusion"))

local React = require(_Packages:WaitForChild("React"))
local ReactRoblox = require(_Packages:WaitForChild("ReactRoblox"))

-- Modules
local Types = require(_Package:WaitForChild("Types"))
local Style = require(_Package:WaitForChild("Style"))

local Source = require(script.Parent:WaitForChild("ColdFusion"))

-- Types
type Maid = Maid.Maid
type Style = Style.Style
type FontData = Types.FontData
type OptionData = Types.OptionData
type ButtonData = Types.ButtonData
type ImageData = Types.ImageData
type CanBeState<V> = ColdFusion.CanBeState<V>
-- Constants
local DEFAULTS = require(script.Parent:WaitForChild("Defaults"))
-- Variables
-- References
-- Private Functions
-- Class
local Interface = {}

do
	local NewSnackbarSmall = React.Component:extend("NewSnackbarSmall")
	NewSnackbarSmall.defaultProps = {
		text = DEFAULTS.NEW.TEXT,
		buttonText = DEFAULTS.NEW.BUTTON_TEXT,
		onButtonClick = DEFAULTS.NEW.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.NEW.ON_CLOSE_CLICK,
		textColor = DEFAULTS.NEW.TEXT_COLOR,
		buttonTextColor = DEFAULTS.NEW.BUTTON_TEXT_COLOR,
		backgroundColor = DEFAULTS.NEW.BACKGROUND_COLOR,
		elevation = DEFAULTS.NEW.ELEVATION,
		schemeType = DEFAULTS.NEW.SCHEME_TYPE,
		fontData = DEFAULTS.NEW.FONT_DATA,
		scale = DEFAULTS.NEW.SCALE,
	}
	function NewSnackbarSmall:init(initialProps: { [string]: unknown })
		self._maid = Maid.new()
		local _fuse = ColdFusion.fuse(self._maid)
		local _Value = _fuse.Value
		self._internalStates = {
			text = _Value(self.defaultProps.text),
			buttonText = _Value(self.defaultProps.buttonText),
			onButtonClick = _Value(self.defaultProps.onButtonClick),
			onCloseClick = _Value(self.defaultProps.onCloseClick),
			textColor = _Value(self.defaultProps.textColor),
			buttonTextColor = _Value(self.defaultProps.buttonTextColor),
			backgroundColor = _Value(self.defaultProps.backgroundColor),
			elevation = _Value(self.defaultProps.elevation),
			schemeType = _Value(self.defaultProps.schemeType),
			fontData = _Value(self.defaultProps.fontData),
			scale = _Value(self.defaultProps.scale),
		}
		table.freeze(self._internalStates)
		for k, v in pairs(initialProps) do
			if self._internalStates[k] then
				self._internalStates[k]:Set(v)
			end
		end
		self._instance = Source.new(
			self._internalStates.text,
			self._internalStates.buttonText,
			self._internalStates.onButtonClick,
			self._internalStates.onCloseClick,
			self._internalStates.textColor,
			self._internalStates.buttonTextColor,
			self._internalStates.backgroundColor,
			self._internalStates.elevation,
			self._internalStates.schemeType,
			self._internalStates.fontData,
			self._internalStates.scale
		)
	end

	function NewSnackbarSmall:render()
		local props = {
			target = self._instance,
		}
		for k, v in pairs(self.props) do
			if self.props[k] ~= v then
				if self._internalStates[k] then
					if v == nil then
						v = self.defaultProps[k]
					end
					self._internalStates[k]:Set(v)
				else
					props[k] = v
				end
			end
		end
		return React.createElement(ReactRoblox.createPortal, props)
	end
	function NewSnackbarSmall:componentDidMount()
		for k, v in pairs(self) do
			if typeof(v) == "table" then
				if v["virtualNode"] then
					if self._instance.Parent ~= v["virtualNode"]["hostParent"] then
						self._instance.Parent = v["virtualNode"]["hostParent"]
					end
					break
				end
			end
		end
	end
	function NewSnackbarSmall:willUnmount()
		self._maid:Destroy()
		self._instance:Destroy()
	end
	Interface.New = NewSnackbarSmall
end

do
	local SurfaceContainerSnackbarSmall = React.Component:extend("SurfaceContainerSnackbarSmall")
	SurfaceContainerSnackbarSmall.defaultProps = {
		style = DEFAULTS.SURFACE_CONTAINER.STYLE,
		text = DEFAULTS.SURFACE_CONTAINER.TEXT,
		buttonText = DEFAULTS.SURFACE_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.SURFACE_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.SURFACE_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.SURFACE_CONTAINER.ELEVATION,
	}
	function SurfaceContainerSnackbarSmall:init(initialProps: { [string]: unknown })
		self._maid = Maid.new()
		local _fuse = ColdFusion.fuse(self._maid)
		local _Value = _fuse.Value
		self._internalStates = {
			style = _Value(self.defaultProps.style),
			text = _Value(self.defaultProps.text),
			buttonText = _Value(self.defaultProps.buttonText),
			onButtonClick = _Value(self.defaultProps.onButtonClick),
			onCloseClick = _Value(self.defaultProps.onCloseClick),
			elevation = _Value(self.defaultProps.elevation),
		}
		table.freeze(self._internalStates)
		for k, v in pairs(initialProps) do
			if self._internalStates[k] then
				self._internalStates[k]:Set(v)
			end
		end
		self._instance = Source.surfaceContainer(
			self._internalStates.style,
			self._internalStates.text,
			self._internalStates.buttonText,
			self._internalStates.onButtonClick,
			self._internalStates.onCloseClick,
			self._internalStates.elevation
		)
	end

	function SurfaceContainerSnackbarSmall:render()
		local props = {
			target = self._instance,
		}
		for k, v in pairs(self.props) do
			if self.props[k] ~= v then
				if self._internalStates[k] then
					if v == nil then
						v = self.defaultProps[k]
					end
					self._internalStates[k]:Set(v)
				else
					props[k] = v
				end
			end
		end
		return React.createElement(ReactRoblox.createPortal, props)
	end
	function SurfaceContainerSnackbarSmall:componentDidMount()
		for k, v in pairs(self) do
			if typeof(v) == "table" then
				if v["virtualNode"] then
					if self._instance.Parent ~= v["virtualNode"]["hostParent"] then
						self._instance.Parent = v["virtualNode"]["hostParent"]
					end
					break
				end
			end
		end
	end
	function SurfaceContainerSnackbarSmall:willUnmount()
		self._maid:Destroy()
		self._instance:Destroy()
	end
	Interface.SurfaceContainer = SurfaceContainerSnackbarSmall
end

do
	local PrimaryContainerSnackbarSmall = React.Component:extend("PrimaryContainerSnackbarSmall")
	PrimaryContainerSnackbarSmall.defaultProps = {
		style = DEFAULTS.PRIMARY_CONTAINER.STYLE,
		text = DEFAULTS.PRIMARY_CONTAINER.TEXT,
		buttonText = DEFAULTS.PRIMARY_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.PRIMARY_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.PRIMARY_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.PRIMARY_CONTAINER.ELEVATION,
	}
	function PrimaryContainerSnackbarSmall:init(initialProps: { [string]: unknown })
		self._maid = Maid.new()
		local _fuse = ColdFusion.fuse(self._maid)
		local _Value = _fuse.Value
		self._internalStates = {
			style = _Value(self.defaultProps.style),
			text = _Value(self.defaultProps.text),
			buttonText = _Value(self.defaultProps.buttonText),
			onButtonClick = _Value(self.defaultProps.onButtonClick),
			onCloseClick = _Value(self.defaultProps.onCloseClick),
			elevation = _Value(self.defaultProps.elevation),
		}
		table.freeze(self._internalStates)
		for k, v in pairs(initialProps) do
			if self._internalStates[k] then
				self._internalStates[k]:Set(v)
			end
		end
		self._instance = Source.primaryContainer(
			self._internalStates.style,
			self._internalStates.text,
			self._internalStates.buttonText,
			self._internalStates.onButtonClick,
			self._internalStates.onCloseClick,
			self._internalStates.elevation
		)
	end

	function PrimaryContainerSnackbarSmall:render()
		local props = {
			target = self._instance,
		}
		for k, v in pairs(self.props) do
			if self.props[k] ~= v then
				if self._internalStates[k] then
					if v == nil then
						v = self.defaultProps[k]
					end
					self._internalStates[k]:Set(v)
				else
					props[k] = v
				end
			end
		end
		return React.createElement(ReactRoblox.createPortal, props)
	end
	function PrimaryContainerSnackbarSmall:componentDidMount()
		for k, v in pairs(self) do
			if typeof(v) == "table" then
				if v["virtualNode"] then
					if self._instance.Parent ~= v["virtualNode"]["hostParent"] then
						self._instance.Parent = v["virtualNode"]["hostParent"]
					end
					break
				end
			end
		end
	end
	function PrimaryContainerSnackbarSmall:willUnmount()
		self._maid:Destroy()
		self._instance:Destroy()
	end
	Interface.PrimaryContainer = PrimaryContainerSnackbarSmall
end

do
	local SecondaryContainerSnackbarSmall = React.Component:extend("SecondaryContainerSnackbarSmall")
	SecondaryContainerSnackbarSmall.defaultProps = {
		style = DEFAULTS.SECONDARY_CONTAINER.STYLE,
		text = DEFAULTS.SECONDARY_CONTAINER.TEXT,
		buttonText = DEFAULTS.SECONDARY_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.SECONDARY_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.SECONDARY_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.SECONDARY_CONTAINER.ELEVATION,
	}
	function SecondaryContainerSnackbarSmall:init(initialProps: { [string]: unknown })
		self._maid = Maid.new()
		local _fuse = ColdFusion.fuse(self._maid)
		local _Value = _fuse.Value
		self._internalStates = {
			style = _Value(self.defaultProps.style),
			text = _Value(self.defaultProps.text),
			buttonText = _Value(self.defaultProps.buttonText),
			onButtonClick = _Value(self.defaultProps.onButtonClick),
			onCloseClick = _Value(self.defaultProps.onCloseClick),
			elevation = _Value(self.defaultProps.elevation),
		}
		table.freeze(self._internalStates)
		for k, v in pairs(initialProps) do
			if self._internalStates[k] then
				self._internalStates[k]:Set(v)
			end
		end
		self._instance = Source.secondaryContainer(
			self._internalStates.style,
			self._internalStates.text,
			self._internalStates.buttonText,
			self._internalStates.onButtonClick,
			self._internalStates.onCloseClick,
			self._internalStates.elevation
		)
	end

	function SecondaryContainerSnackbarSmall:render()
		local props = {
			target = self._instance,
		}
		for k, v in pairs(self.props) do
			if self.props[k] ~= v then
				if self._internalStates[k] then
					if v == nil then
						v = self.defaultProps[k]
					end
					self._internalStates[k]:Set(v)
				else
					props[k] = v
				end
			end
		end
		return React.createElement(ReactRoblox.createPortal, props)
	end
	function SecondaryContainerSnackbarSmall:componentDidMount()
		for k, v in pairs(self) do
			if typeof(v) == "table" then
				if v["virtualNode"] then
					if self._instance.Parent ~= v["virtualNode"]["hostParent"] then
						self._instance.Parent = v["virtualNode"]["hostParent"]
					end
					break
				end
			end
		end
	end
	function SecondaryContainerSnackbarSmall:willUnmount()
		self._maid:Destroy()
		self._instance:Destroy()
	end
	Interface.SecondaryContainer = SecondaryContainerSnackbarSmall
end

do
	local TertiaryContainerSnackbarSmall = React.Component:extend("TertiaryContainerSnackbarSmall")
	TertiaryContainerSnackbarSmall.defaultProps = {
		style = DEFAULTS.TERTIARY_CONTAINER.STYLE,
		text = DEFAULTS.TERTIARY_CONTAINER.TEXT,
		buttonText = DEFAULTS.TERTIARY_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.TERTIARY_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.TERTIARY_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.TERTIARY_CONTAINER.ELEVATION,
	}
	function TertiaryContainerSnackbarSmall:init(initialProps: { [string]: unknown })
		self._maid = Maid.new()
		local _fuse = ColdFusion.fuse(self._maid)
		local _Value = _fuse.Value
		self._internalStates = {
			style = _Value(self.defaultProps.style),
			text = _Value(self.defaultProps.text),
			buttonText = _Value(self.defaultProps.buttonText),
			onButtonClick = _Value(self.defaultProps.onButtonClick),
			onCloseClick = _Value(self.defaultProps.onCloseClick),
			elevation = _Value(self.defaultProps.elevation),
		}
		table.freeze(self._internalStates)
		for k, v in pairs(initialProps) do
			if self._internalStates[k] then
				self._internalStates[k]:Set(v)
			end
		end
		self._instance = Source.tertiaryContainer(
			self._internalStates.style,
			self._internalStates.text,
			self._internalStates.buttonText,
			self._internalStates.onButtonClick,
			self._internalStates.onCloseClick,
			self._internalStates.elevation
		)
	end

	function TertiaryContainerSnackbarSmall:render()
		local props = {
			target = self._instance,
		}
		for k, v in pairs(self.props) do
			if self.props[k] ~= v then
				if self._internalStates[k] then
					if v == nil then
						v = self.defaultProps[k]
					end
					self._internalStates[k]:Set(v)
				else
					props[k] = v
				end
			end
		end
		return React.createElement(ReactRoblox.createPortal, props)
	end
	function TertiaryContainerSnackbarSmall:componentDidMount()
		for k, v in pairs(self) do
			if typeof(v) == "table" then
				if v["virtualNode"] then
					if self._instance.Parent ~= v["virtualNode"]["hostParent"] then
						self._instance.Parent = v["virtualNode"]["hostParent"]
					end
					break
				end
			end
		end
	end
	function TertiaryContainerSnackbarSmall:willUnmount()
		self._maid:Destroy()
		self._instance:Destroy()
	end
	Interface.TertiaryContainer = TertiaryContainerSnackbarSmall
end

return Interface


--!strict
-- this script was generated by the build system, please do not make manual edits
local _Package = script.Parent.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))
local ColdFusion = require(_Packages:WaitForChild("ColdFusion"))
local Roact = require(_Packages:WaitForChild("Roact"))

-- Modules
local Types = require(_Package:WaitForChild("Types"))
local Style = require(_Package:WaitForChild("Style"))

local Source = require(script.Parent:WaitForChild("ColdFusion"))

-- Types
type Maid = Maid.Maid
type Style = Style.Style
type FontData = Types.FontData
type OptionData = Types.OptionData
type ButtonData = Types.ButtonData
type ImageData = Types.ImageData
type CanBeState<V> = ColdFusion.CanBeState<V>
-- Constants
local DEFAULTS = require(script.Parent:WaitForChild("Defaults"))
-- Variables
-- References
-- Private Functions
-- Class
local Interface = {}

do
	local NewSnackbarSmall = Roact.Component:extend("NewSnackbarSmall")
	NewSnackbarSmall.defaultProps = {
		text = DEFAULTS.NEW.TEXT,
		buttonText = DEFAULTS.NEW.BUTTON_TEXT,
		onButtonClick = DEFAULTS.NEW.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.NEW.ON_CLOSE_CLICK,
		textColor = DEFAULTS.NEW.TEXT_COLOR,
		buttonTextColor = DEFAULTS.NEW.BUTTON_TEXT_COLOR,
		backgroundColor = DEFAULTS.NEW.BACKGROUND_COLOR,
		elevation = DEFAULTS.NEW.ELEVATION,
		schemeType = DEFAULTS.NEW.SCHEME_TYPE,
		fontData = DEFAULTS.NEW.FONT_DATA,
		scale = DEFAULTS.NEW.SCALE,
	}
	function NewSnackbarSmall:init(initialProps: { [string]: unknown })
		self._maid = Maid.new()
		local _fuse = ColdFusion.fuse(self._maid)
		local _Value = _fuse.Value
		self._internalStates = {
			text = _Value(self.defaultProps.text),
			buttonText = _Value(self.defaultProps.buttonText),
			onButtonClick = _Value(self.defaultProps.onButtonClick),
			onCloseClick = _Value(self.defaultProps.onCloseClick),
			textColor = _Value(self.defaultProps.textColor),
			buttonTextColor = _Value(self.defaultProps.buttonTextColor),
			backgroundColor = _Value(self.defaultProps.backgroundColor),
			elevation = _Value(self.defaultProps.elevation),
			schemeType = _Value(self.defaultProps.schemeType),
			fontData = _Value(self.defaultProps.fontData),
			scale = _Value(self.defaultProps.scale),
		}
		table.freeze(self._internalStates)
		for k, v in pairs(initialProps) do
			if self._internalStates[k] then
				self._internalStates[k]:Set(v)
			end
		end
		self._instance = Source.new(
			self._internalStates.text,
			self._internalStates.buttonText,
			self._internalStates.onButtonClick,
			self._internalStates.onCloseClick,
			self._internalStates.textColor,
			self._internalStates.buttonTextColor,
			self._internalStates.backgroundColor,
			self._internalStates.elevation,
			self._internalStates.schemeType,
			self._internalStates.fontData,
			self._internalStates.scale
		)
	end

	function NewSnackbarSmall:render()
		local props = {
			target = self._instance,
		}
		for k, v in pairs(self.props) do
			if self.props[k] ~= v then
				if self._internalStates[k] then
					if v == nil then
						v = self.defaultProps[k]
					end
					self._internalStates[k]:Set(v)
				else
					props[k] = v
				end
			end
		end
		return Roact.createElement(Roact.Portal, props)
	end
	function NewSnackbarSmall:didMount()
		for k, v in pairs(self) do
			if typeof(v) == "table" then
				if v["virtualNode"] then
					if self._instance.Parent ~= v["virtualNode"]["hostParent"] then
						self._instance.Parent = v["virtualNode"]["hostParent"]
					end
					break
				end
			end
		end
	end
	function NewSnackbarSmall:willUnmount()
		self._maid:Destroy()
		self._instance:Destroy()
	end
	Interface.New = NewSnackbarSmall
end

do
	local SurfaceContainerSnackbarSmall = Roact.Component:extend("SurfaceContainerSnackbarSmall")
	SurfaceContainerSnackbarSmall.defaultProps = {
		style = DEFAULTS.SURFACE_CONTAINER.STYLE,
		text = DEFAULTS.SURFACE_CONTAINER.TEXT,
		buttonText = DEFAULTS.SURFACE_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.SURFACE_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.SURFACE_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.SURFACE_CONTAINER.ELEVATION,
	}
	function SurfaceContainerSnackbarSmall:init(initialProps: { [string]: unknown })
		self._maid = Maid.new()
		local _fuse = ColdFusion.fuse(self._maid)
		local _Value = _fuse.Value
		self._internalStates = {
			style = _Value(self.defaultProps.style),
			text = _Value(self.defaultProps.text),
			buttonText = _Value(self.defaultProps.buttonText),
			onButtonClick = _Value(self.defaultProps.onButtonClick),
			onCloseClick = _Value(self.defaultProps.onCloseClick),
			elevation = _Value(self.defaultProps.elevation),
		}
		table.freeze(self._internalStates)
		for k, v in pairs(initialProps) do
			if self._internalStates[k] then
				self._internalStates[k]:Set(v)
			end
		end
		self._instance = Source.surfaceContainer(
			self._internalStates.style,
			self._internalStates.text,
			self._internalStates.buttonText,
			self._internalStates.onButtonClick,
			self._internalStates.onCloseClick,
			self._internalStates.elevation
		)
	end

	function SurfaceContainerSnackbarSmall:render()
		local props = {
			target = self._instance,
		}
		for k, v in pairs(self.props) do
			if self.props[k] ~= v then
				if self._internalStates[k] then
					if v == nil then
						v = self.defaultProps[k]
					end
					self._internalStates[k]:Set(v)
				else
					props[k] = v
				end
			end
		end
		return Roact.createElement(Roact.Portal, props)
	end
	function SurfaceContainerSnackbarSmall:didMount()
		for k, v in pairs(self) do
			if typeof(v) == "table" then
				if v["virtualNode"] then
					if self._instance.Parent ~= v["virtualNode"]["hostParent"] then
						self._instance.Parent = v["virtualNode"]["hostParent"]
					end
					break
				end
			end
		end
	end
	function SurfaceContainerSnackbarSmall:willUnmount()
		self._maid:Destroy()
		self._instance:Destroy()
	end
	Interface.SurfaceContainer = SurfaceContainerSnackbarSmall
end

do
	local PrimaryContainerSnackbarSmall = Roact.Component:extend("PrimaryContainerSnackbarSmall")
	PrimaryContainerSnackbarSmall.defaultProps = {
		style = DEFAULTS.PRIMARY_CONTAINER.STYLE,
		text = DEFAULTS.PRIMARY_CONTAINER.TEXT,
		buttonText = DEFAULTS.PRIMARY_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.PRIMARY_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.PRIMARY_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.PRIMARY_CONTAINER.ELEVATION,
	}
	function PrimaryContainerSnackbarSmall:init(initialProps: { [string]: unknown })
		self._maid = Maid.new()
		local _fuse = ColdFusion.fuse(self._maid)
		local _Value = _fuse.Value
		self._internalStates = {
			style = _Value(self.defaultProps.style),
			text = _Value(self.defaultProps.text),
			buttonText = _Value(self.defaultProps.buttonText),
			onButtonClick = _Value(self.defaultProps.onButtonClick),
			onCloseClick = _Value(self.defaultProps.onCloseClick),
			elevation = _Value(self.defaultProps.elevation),
		}
		table.freeze(self._internalStates)
		for k, v in pairs(initialProps) do
			if self._internalStates[k] then
				self._internalStates[k]:Set(v)
			end
		end
		self._instance = Source.primaryContainer(
			self._internalStates.style,
			self._internalStates.text,
			self._internalStates.buttonText,
			self._internalStates.onButtonClick,
			self._internalStates.onCloseClick,
			self._internalStates.elevation
		)
	end

	function PrimaryContainerSnackbarSmall:render()
		local props = {
			target = self._instance,
		}
		for k, v in pairs(self.props) do
			if self.props[k] ~= v then
				if self._internalStates[k] then
					if v == nil then
						v = self.defaultProps[k]
					end
					self._internalStates[k]:Set(v)
				else
					props[k] = v
				end
			end
		end
		return Roact.createElement(Roact.Portal, props)
	end
	function PrimaryContainerSnackbarSmall:didMount()
		for k, v in pairs(self) do
			if typeof(v) == "table" then
				if v["virtualNode"] then
					if self._instance.Parent ~= v["virtualNode"]["hostParent"] then
						self._instance.Parent = v["virtualNode"]["hostParent"]
					end
					break
				end
			end
		end
	end
	function PrimaryContainerSnackbarSmall:willUnmount()
		self._maid:Destroy()
		self._instance:Destroy()
	end
	Interface.PrimaryContainer = PrimaryContainerSnackbarSmall
end

do
	local SecondaryContainerSnackbarSmall = Roact.Component:extend("SecondaryContainerSnackbarSmall")
	SecondaryContainerSnackbarSmall.defaultProps = {
		style = DEFAULTS.SECONDARY_CONTAINER.STYLE,
		text = DEFAULTS.SECONDARY_CONTAINER.TEXT,
		buttonText = DEFAULTS.SECONDARY_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.SECONDARY_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.SECONDARY_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.SECONDARY_CONTAINER.ELEVATION,
	}
	function SecondaryContainerSnackbarSmall:init(initialProps: { [string]: unknown })
		self._maid = Maid.new()
		local _fuse = ColdFusion.fuse(self._maid)
		local _Value = _fuse.Value
		self._internalStates = {
			style = _Value(self.defaultProps.style),
			text = _Value(self.defaultProps.text),
			buttonText = _Value(self.defaultProps.buttonText),
			onButtonClick = _Value(self.defaultProps.onButtonClick),
			onCloseClick = _Value(self.defaultProps.onCloseClick),
			elevation = _Value(self.defaultProps.elevation),
		}
		table.freeze(self._internalStates)
		for k, v in pairs(initialProps) do
			if self._internalStates[k] then
				self._internalStates[k]:Set(v)
			end
		end
		self._instance = Source.secondaryContainer(
			self._internalStates.style,
			self._internalStates.text,
			self._internalStates.buttonText,
			self._internalStates.onButtonClick,
			self._internalStates.onCloseClick,
			self._internalStates.elevation
		)
	end

	function SecondaryContainerSnackbarSmall:render()
		local props = {
			target = self._instance,
		}
		for k, v in pairs(self.props) do
			if self.props[k] ~= v then
				if self._internalStates[k] then
					if v == nil then
						v = self.defaultProps[k]
					end
					self._internalStates[k]:Set(v)
				else
					props[k] = v
				end
			end
		end
		return Roact.createElement(Roact.Portal, props)
	end
	function SecondaryContainerSnackbarSmall:didMount()
		for k, v in pairs(self) do
			if typeof(v) == "table" then
				if v["virtualNode"] then
					if self._instance.Parent ~= v["virtualNode"]["hostParent"] then
						self._instance.Parent = v["virtualNode"]["hostParent"]
					end
					break
				end
			end
		end
	end
	function SecondaryContainerSnackbarSmall:willUnmount()
		self._maid:Destroy()
		self._instance:Destroy()
	end
	Interface.SecondaryContainer = SecondaryContainerSnackbarSmall
end

do
	local TertiaryContainerSnackbarSmall = Roact.Component:extend("TertiaryContainerSnackbarSmall")
	TertiaryContainerSnackbarSmall.defaultProps = {
		style = DEFAULTS.TERTIARY_CONTAINER.STYLE,
		text = DEFAULTS.TERTIARY_CONTAINER.TEXT,
		buttonText = DEFAULTS.TERTIARY_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.TERTIARY_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.TERTIARY_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.TERTIARY_CONTAINER.ELEVATION,
	}
	function TertiaryContainerSnackbarSmall:init(initialProps: { [string]: unknown })
		self._maid = Maid.new()
		local _fuse = ColdFusion.fuse(self._maid)
		local _Value = _fuse.Value
		self._internalStates = {
			style = _Value(self.defaultProps.style),
			text = _Value(self.defaultProps.text),
			buttonText = _Value(self.defaultProps.buttonText),
			onButtonClick = _Value(self.defaultProps.onButtonClick),
			onCloseClick = _Value(self.defaultProps.onCloseClick),
			elevation = _Value(self.defaultProps.elevation),
		}
		table.freeze(self._internalStates)
		for k, v in pairs(initialProps) do
			if self._internalStates[k] then
				self._internalStates[k]:Set(v)
			end
		end
		self._instance = Source.tertiaryContainer(
			self._internalStates.style,
			self._internalStates.text,
			self._internalStates.buttonText,
			self._internalStates.onButtonClick,
			self._internalStates.onCloseClick,
			self._internalStates.elevation
		)
	end

	function TertiaryContainerSnackbarSmall:render()
		local props = {
			target = self._instance,
		}
		for k, v in pairs(self.props) do
			if self.props[k] ~= v then
				if self._internalStates[k] then
					if v == nil then
						v = self.defaultProps[k]
					end
					self._internalStates[k]:Set(v)
				else
					props[k] = v
				end
			end
		end
		return Roact.createElement(Roact.Portal, props)
	end
	function TertiaryContainerSnackbarSmall:didMount()
		for k, v in pairs(self) do
			if typeof(v) == "table" then
				if v["virtualNode"] then
					if self._instance.Parent ~= v["virtualNode"]["hostParent"] then
						self._instance.Parent = v["virtualNode"]["hostParent"]
					end
					break
				end
			end
		end
	end
	function TertiaryContainerSnackbarSmall:willUnmount()
		self._maid:Destroy()
		self._instance:Destroy()
	end
	Interface.TertiaryContainer = TertiaryContainerSnackbarSmall
end

return Interface


--!strict
-- this script was generated by the build system, please do not make manual edits
local _Package = script.Parent.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))
local ColdFusion = require(_Packages:WaitForChild("ColdFusion"))

-- Modules
local Types = require(_Package:WaitForChild("Types"))
local Style = require(_Package:WaitForChild("Style"))
local Enums = require(_Package:WaitForChild("Enums"))

local Translators = require(_Package:WaitForChild("Translators"))

local Source = require(script.Parent:WaitForChild("ColdFusion"))

-- Types
type Maid = Maid.Maid
type Style = Style.Style
type FontData = Types.FontData
type OptionData = Types.OptionData
type ButtonData = Types.ButtonData
type ImageData = Types.ImageData
type CanBeState<V> = ColdFusion.CanBeState<V>
type Wrapper<BaseInstance, Definition, ClassName> = Translators.Wrapper<BaseInstance, Definition, ClassName>

export type SmallWrapperDefinition = {
	Text: string,
	ButtonText: string?,
	OnButtonClick: (() -> ())?,
	OnCloseClick: (() -> ())?,
	TextColor: Color3,
	ButtonTextColor: Color3,
	BackgroundColor: Color3,
	Elevation: number,
	SchemeType: Enums.SchemeType,
	FontData: FontData,
	Scale: number,
}
export type SmallWrapper = Wrapper<GuiObject, SmallWrapperDefinition, "Small">

export type StyledSmallWrapperDefinition = {
	Style: Style,
	Text: string,
	ButtonText: string?,
	OnButtonClick: (() -> ())?,
	OnCloseClick: (() -> ())?,
	Elevation: number?,
}
export type StyledSmallWrapper = Wrapper<GuiObject, StyledSmallWrapperDefinition, "StyledSmall">
-- Constants
local DEFAULTS = require(script.Parent:WaitForChild("Defaults"))
-- Variables
-- References
-- Private Functions
-- Interface
local Interface = {}

function Interface.new(): StyledSmallWrapper
	local maid = Maid.new()
	local _fuse = ColdFusion.fuse(maid)
	local _Value = _fuse.Value
	local definition = {
		Text = _Value(""),
		ButtonText = _Value("Action"),
		OnButtonClick = _Value(function() end),
		OnCloseClick = _Value(function() end),
		TextColor = _Value(Color3.new()),
		ButtonTextColor = _Value(Color3.new()),
		BackgroundColor = _Value(Color3.new()),
		Elevation = _Value(0),
		SchemeType = _Value(Enums.SchemeType.Light),
		FontData = _Value(Types.FontData.new(Font.fromEnum(Enum.Font.SourceSans), 14)),
		Scale = _Value(1),
	}
	local defaults: { [string]: unknown? } = {
		text = DEFAULTS.NEW.TEXT,
		buttonText = DEFAULTS.NEW.BUTTON_TEXT,
		onButtonClick = DEFAULTS.NEW.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.NEW.ON_CLOSE_CLICK,
		textColor = DEFAULTS.NEW.TEXT_COLOR,
		buttonTextColor = DEFAULTS.NEW.BUTTON_TEXT_COLOR,
		backgroundColor = DEFAULTS.NEW.BACKGROUND_COLOR,
		elevation = DEFAULTS.NEW.ELEVATION,
		schemeType = DEFAULTS.NEW.SCHEME_TYPE,
		fontData = DEFAULTS.NEW.FONT_DATA,
		scale = DEFAULTS.NEW.SCALE,
	}
	local inst: GuiObject = Source.new(
		definition.Text,
		definition.ButtonText,
		definition.OnButtonClick,
		definition.OnCloseClick,
		definition.TextColor,
		definition.ButtonTextColor,
		definition.BackgroundColor,
		definition.Elevation,
		definition.SchemeType,
		definition.FontData,
		definition.Scale
	)
	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))
	local wrapper, cleanUp = Translators.ColdFusion.toWrapper("StyledSmall", inst, definition, defaults)
	maid:GiveTask(cleanUp)
	return wrapper
end

function Interface.surfaceContainer(): StyledSmallWrapper
	local maid = Maid.new()
	local _fuse = ColdFusion.fuse(maid)
	local _Value = _fuse.Value
	local definition = {
		Style = _Value(Style.new(1, Enum.Font.SourceSans, "Light", Color3.new(0, 0.4, 0.7))),
		Text = _Value(""),
		ButtonText = _Value("Action"),
		OnButtonClick = _Value(function() end),
		OnCloseClick = _Value(function() end),
		Elevation = _Value(0),
	}
	local defaults: { [string]: unknown? } = {
		style = DEFAULTS.SURFACE_CONTAINER.STYLE,
		text = DEFAULTS.SURFACE_CONTAINER.TEXT,
		buttonText = DEFAULTS.SURFACE_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.SURFACE_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.SURFACE_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.SURFACE_CONTAINER.ELEVATION,
	}
	local inst: GuiObject = Source.surfaceContainer(
		definition.Style,
		definition.Text,
		definition.ButtonText,
		definition.OnButtonClick,
		definition.OnCloseClick,
		definition.Elevation
	)
	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))
	local wrapper, cleanUp = Translators.ColdFusion.toWrapper("StyledSmall", inst, definition, defaults)
	maid:GiveTask(cleanUp)
	return wrapper
end

function Interface.primaryContainer(): StyledSmallWrapper
	local maid = Maid.new()
	local _fuse = ColdFusion.fuse(maid)
	local _Value = _fuse.Value
	local definition = {
		Style = _Value(Style.new(1, Enum.Font.SourceSans, "Light", Color3.new(0, 0.4, 0.7))),
		Text = _Value(""),
		ButtonText = _Value("Action"),
		OnButtonClick = _Value(function() end),
		OnCloseClick = _Value(function() end),
		Elevation = _Value(0),
	}
	local defaults: { [string]: unknown? } = {
		style = DEFAULTS.PRIMARY_CONTAINER.STYLE,
		text = DEFAULTS.PRIMARY_CONTAINER.TEXT,
		buttonText = DEFAULTS.PRIMARY_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.PRIMARY_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.PRIMARY_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.PRIMARY_CONTAINER.ELEVATION,
	}
	local inst: GuiObject = Source.primaryContainer(
		definition.Style,
		definition.Text,
		definition.ButtonText,
		definition.OnButtonClick,
		definition.OnCloseClick,
		definition.Elevation
	)
	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))
	local wrapper, cleanUp = Translators.ColdFusion.toWrapper("StyledSmall", inst, definition, defaults)
	maid:GiveTask(cleanUp)
	return wrapper
end

function Interface.secondaryContainer(): StyledSmallWrapper
	local maid = Maid.new()
	local _fuse = ColdFusion.fuse(maid)
	local _Value = _fuse.Value
	local definition = {
		Style = _Value(Style.new(1, Enum.Font.SourceSans, "Light", Color3.new(0, 0.4, 0.7))),
		Text = _Value(""),
		ButtonText = _Value("Action"),
		OnButtonClick = _Value(function() end),
		OnCloseClick = _Value(function() end),
		Elevation = _Value(0),
	}
	local defaults: { [string]: unknown? } = {
		style = DEFAULTS.SECONDARY_CONTAINER.STYLE,
		text = DEFAULTS.SECONDARY_CONTAINER.TEXT,
		buttonText = DEFAULTS.SECONDARY_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.SECONDARY_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.SECONDARY_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.SECONDARY_CONTAINER.ELEVATION,
	}
	local inst: GuiObject = Source.secondaryContainer(
		definition.Style,
		definition.Text,
		definition.ButtonText,
		definition.OnButtonClick,
		definition.OnCloseClick,
		definition.Elevation
	)
	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))
	local wrapper, cleanUp = Translators.ColdFusion.toWrapper("StyledSmall", inst, definition, defaults)
	maid:GiveTask(cleanUp)
	return wrapper
end

function Interface.tertiaryContainer(): StyledSmallWrapper
	local maid = Maid.new()
	local _fuse = ColdFusion.fuse(maid)
	local _Value = _fuse.Value
	local definition = {
		Style = _Value(Style.new(1, Enum.Font.SourceSans, "Light", Color3.new(0, 0.4, 0.7))),
		Text = _Value(""),
		ButtonText = _Value("Action"),
		OnButtonClick = _Value(function() end),
		OnCloseClick = _Value(function() end),
		Elevation = _Value(0),
	}
	local defaults: { [string]: unknown? } = {
		style = DEFAULTS.TERTIARY_CONTAINER.STYLE,
		text = DEFAULTS.TERTIARY_CONTAINER.TEXT,
		buttonText = DEFAULTS.TERTIARY_CONTAINER.BUTTON_TEXT,
		onButtonClick = DEFAULTS.TERTIARY_CONTAINER.ON_BUTTON_CLICK,
		onCloseClick = DEFAULTS.TERTIARY_CONTAINER.ON_CLOSE_CLICK,
		elevation = DEFAULTS.TERTIARY_CONTAINER.ELEVATION,
	}
	local inst: GuiObject = Source.tertiaryContainer(
		definition.Style,
		definition.Text,
		definition.ButtonText,
		definition.OnButtonClick,
		definition.OnCloseClick,
		definition.Elevation
	)
	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))
	local wrapper, cleanUp = Translators.ColdFusion.toWrapper("StyledSmall", inst, definition, defaults)
	maid:GiveTask(cleanUp)
	return wrapper
end

return Interface


--!strict
local _Package = script.Parent.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))

-- Modules
local Style = require(_Package:WaitForChild("Style"))
local Enums = require(_Package:WaitForChild("Enums"))

-- Types
-- Constants
-- Variables
-- References

-- Class
return function(frame: Frame)
	local maid = Maid.new()
	task.spawn(function()
		local function makeHalfFrame(isDarkMode: boolean, color: Color3): Frame
			local style = Style.new(
				1.5,
				Enum.Font.SourceSans,
				if isDarkMode then Enums.SchemeType.Dark else Enums.SchemeType.Light,
				color
			)

			local halfFrame = maid:GiveTask(Instance.new("Frame"))
			halfFrame.BackgroundColor3 = style:GetColor(Enums.ColorRoleType.Surface)
			halfFrame.BorderSizePixel = 0
			halfFrame.BackgroundTransparency = 0.5

			local listLayout = maid:GiveTask(Instance.new("UIListLayout"))
			listLayout.FillDirection = Enum.FillDirection.Vertical
			listLayout.Padding = UDim.new(0, 10)
			listLayout.VerticalAlignment = Enum.VerticalAlignment.Center
			listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
			listLayout.Parent = halfFrame

			local Module = require(script.Parent:WaitForChild("ColdFusion"))

			do
				local snackbar =
					maid:GiveTask(Module.surfaceContainer(style, "Wow what cool text", "Button", function()
						print("button click")
					end, function()
						print("close click")
					end, 0))
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end

			do
				local snackbar =
					maid:GiveTask(Module.surfaceContainer(style, "Wow what cool text", nil, nil, function()
						print("close click")
					end, 0))
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end
			-- do
			-- 	local snackbar = maid:GiveTask(
			-- 		Module.surfaceContainer(style, "Wow what cool text", "Button", function()
			-- 			print("button click")
			-- 		end, nil, 0)
			-- 	)
			-- 	snackbar.AutomaticSize = Enum.AutomaticSize.Y
			-- 	snackbar.Size = UDim2.fromScale(0.9, 0)
			-- 	snackbar.Parent = halfFrame
			-- end
			return halfFrame
		end

		local COLORS: { [number]: Color3 } = {
			Color3.fromHSV(0, 0.9, 0.8),
			-- Color3.fromHSV(0, 0.25, 0.8),
			-- Color3.fromHSV(0, 0.9, 0.5),
			-- Color3.fromHSV(0.6, 0.9, 0.7),
			-- Color3.fromHSV(0.35, 0.9, 0.7),
			-- Color3.fromHSV(0.1, 0.9, 0.7),
		}

		for i, color in ipairs(COLORS) do
			local x = (i - 1) / #COLORS
			local width = 1 / #COLORS
			local dark = makeHalfFrame(true, color)

			dark.Size = UDim2.fromScale(width, 0.5)
			dark.Position = UDim2.fromScale(x, 0.5)
			dark.Parent = frame

			local bright = makeHalfFrame(false, color)
			bright.Size = UDim2.fromScale(width, 0.5)
			bright.Position = UDim2.fromScale(x, 0)
			bright.Parent = frame
		end
	end)
	return function()
		maid:Destroy()
	end
end


--!strict
local _Package = script.Parent.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))

-- Modules
local Style = require(_Package:WaitForChild("Style"))
local Enums = require(_Package:WaitForChild("Enums"))

-- Types
-- Constants
-- Variables
-- References

-- Class
return function(frame: Frame)
	local maid = Maid.new()
	task.spawn(function()
		local function makeHalfFrame(isDarkMode: boolean, color: Color3): Frame
			local style = Style.new(
				1,
				Enum.Font.SourceSans,
				if isDarkMode then Enums.SchemeType.Dark else Enums.SchemeType.Light,
				color
			)

			local halfFrame = maid:GiveTask(Instance.new("Frame"))
			halfFrame.BackgroundColor3 = style:GetColor(Enums.ColorRoleType.Surface)
			halfFrame.BorderSizePixel = 0
			halfFrame.BackgroundTransparency = 0.5
			local listLayout = maid:GiveTask(Instance.new("UIListLayout"))
			listLayout.FillDirection = Enum.FillDirection.Vertical
			listLayout.Padding = UDim.new(0, 10)
			listLayout.VerticalAlignment = Enum.VerticalAlignment.Center
			listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center
			listLayout.Parent = halfFrame

			local Module = require(script.Parent:WaitForChild("ColdFusion"))

			do
				local snackbar =
					maid:GiveTask(Module.surfaceContainer(style, "Wow what cool text", "Button", function()
						print("button click")
					end, function()
						print("close click")
					end, 1))
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end
			do
				local snackbar =
					maid:GiveTask(Module.primaryContainer(style, "Wow what cool text", "Button", function()
						print("button click")
					end, function()
						print("close click")
					end, 1))
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end
			do
				local snackbar =
					maid:GiveTask(Module.secondaryContainer(style, "Wow what cool text", "Button", function()
						print("button click")
					end, function()
						print("close click")
					end, 1))
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end
			do
				local snackbar =
					maid:GiveTask(Module.tertiaryContainer(style, "Wow what cool text", "Button", function()
						print("button click")
					end, function()
						print("close click")
					end, 1))
				snackbar.AutomaticSize = Enum.AutomaticSize.Y
				snackbar.Size = UDim2.fromScale(0.9, 0)
				snackbar.Parent = halfFrame
			end
			return halfFrame
		end

		local COLORS: { [number]: Color3 } = {
			Color3.fromHSV(0, 0.9, 0.8),
			-- Color3.fromHSV(0, 0.25, 0.8),
			-- Color3.fromHSV(0, 0.9, 0.5),
			Color3.fromHSV(0.6, 0.9, 0.7),
			Color3.fromHSV(0.35, 0.9, 0.7),
			Color3.fromHSV(0.1, 0.9, 0.7),
		}

		for i, color in ipairs(COLORS) do
			local x = (i - 1) / #COLORS
			local width = 1 / #COLORS
			local dark = makeHalfFrame(true, color)

			dark.Size = UDim2.fromScale(width, 0.5)
			dark.Position = UDim2.fromScale(x, 0.5)
			dark.Parent = frame

			local bright = makeHalfFrame(false, color)
			bright.Size = UDim2.fromScale(width, 0.5)
			bright.Position = UDim2.fromScale(x, 0)
			bright.Parent = frame
		end
	end)
	return function()
		maid:Destroy()
	end
end


--!strict
local _Package = script.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
local SoundService = game:GetService("SoundService")
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))
local ColdFusion = require(_Packages:WaitForChild("ColdFusion"))
local Icons = require(_Packages:WaitForChild("MaterialIcons"))

-- Modules
local Types = require(_Package:WaitForChild("Types"))
local Style = require(_Package:WaitForChild("Style"))
local Enums = require(_Package:WaitForChild("Enums"))
local Sounds = require(_Package:WaitForChild("Sounds"))
local Theme = require(_Package:WaitForChild("Theme"))

-- Types
type Maid = Maid.Maid
type State<V> = ColdFusion.State<V>
type ValueState<V> = ColdFusion.ValueState<V>
type CanBeState<V> = ColdFusion.CanBeState<V>
type AppearanceData = Types.AppearanceData
type ImageData = Types.ImageData
type OptionData = Types.OptionData
type ButtonData = Types.ButtonData
type Style = Style.Style
type SwitchRenderData = {
	Text: AppearanceData,
	Button: AppearanceData,
	Background: AppearanceData,
	Outline: AppearanceData,
}
type FontData = Types.FontData

-- Constants
local DEFAULTS = require(script.Parent:WaitForChild("Defaults"))
local SWITCH_HEIGHT_DP = 32
local SWITCH_WIDTH_DP = 52
local KNOB_YES_ICON_SIZE_DP = 28
local KNOB_NO_ICON_SELECTED_SIZE_DP = 24
local KNOB_NO_ICON_UNSELECTED_SIZE_DP = 16
local ICON_SIZE_DP = 16
local OUTLINE_THICKNESS_DP = 2
-- Variables
-- References
-- Private Functions
function newSwitchRenderData(
	text: AppearanceData,
	button: AppearanceData,
	background: AppearanceData,
	outline: AppearanceData
): SwitchRenderData
	return {
		Text = text,
		Button = button,
		Background = background,
		Outline = outline,
	}
end

-- Class
local Interface = {}

function newThemedComponent(
	themeDefaults: typeof(DEFAULTS.PRIMARY),
	style: CanBeState<Style>,
	backgroundColor: Enums.ColorRoleType,
	onBackgroundColor: Enums.ColorRoleType,
	fillColor: Enums.ColorRoleType,
	buttonColor: Enums.ColorRoleType,
	onButtonColor: Enums.ColorRoleType,
	disabledColor: Enums.ColorRoleType,
	onDisabledColor: Enums.ColorRoleType,
	onSelect: CanBeState<(isSelected: boolean) -> ()>,
	initialSelection: CanBeState<boolean>,
	includeIconOnSelected: CanBeState<boolean?>,
	includeIconOnDeselected: CanBeState<boolean?>,
	elevation: CanBeState<number?>,
	isEnabled: CanBeState<boolean?>
): GuiObject
	local maid = Maid.new()

	local _fuse = ColdFusion.fuse(maid)

	local _new = _fuse.new
	local _bind = _fuse.bind
	local _clone = _fuse.clone
	local _import = _fuse.import

	local _Value = _fuse.Value
	local _Computed = _fuse.Computed

	local styleState: State<Style> = _import(style, themeDefaults.STYLE)

	local out = Interface.new(
		onSelect,
		initialSelection,
		_import(isEnabled, themeDefaults.IS_ENABLED),
		_import(includeIconOnSelected, themeDefaults.INCLUDE_ICON_ON_SELECTED),
		_import(includeIconOnDeselected, themeDefaults.INCLUDE_ICON_ON_DESELECTED),
		_Computed(function(s: Style): Color3
			return s:GetColor(backgroundColor)
		end, styleState),
		_Computed(function(s: Style): Color3
			return s:GetColor(onBackgroundColor)
		end, styleState),
		_Computed(function(s: Style): Color3
			return s:GetColor(fillColor)
		end, styleState),
		_Computed(function(s: Style): Color3
			return s:GetColor(buttonColor)
		end, styleState),
		_Computed(function(s: Style): Color3
			return s:GetColor(onButtonColor)
		end, styleState),
		_Computed(function(s: Style): Color3
			return s:GetColor(disabledColor)
		end, styleState),
		_Computed(function(s: Style): Color3
			return s:GetColor(onDisabledColor)
		end, styleState),
		_import(elevation, themeDefaults.ELEVATION),
		_Computed(function(s: Style): any
			return s.SchemeType
		end, styleState),
		_Computed(function(s: Style): FontData
			return s:GetFontData(Enums.FontType.LabelLarge)
		end, styleState),
		_Computed(function(s: Style): number
			return s.Scale
		end, styleState)
	)

	maid:GiveTask(out.Destroying:Connect(function()
		maid:Destroy()
	end))

	return out
end

function Interface.primary(
	style: CanBeState<Style>,
	onSelect: CanBeState<(isSelected: boolean) -> ()>,
	initialSelection: CanBeState<boolean>,
	includeIconOnSelected: CanBeState<boolean?>,
	includeIconOnDeselected: CanBeState<boolean?>,
	elevation: CanBeState<number?>,
	isEnabled: CanBeState<boolean?>
): GuiObject
	return newThemedComponent(
		DEFAULTS.PRIMARY,
		style,
		Enums.ColorRoleType.SurfaceContainerHighest,
		Enums.ColorRoleType.Outline,
		Enums.ColorRoleType.Primary,
		Enums.ColorRoleType.PrimaryContainer,
		Enums.ColorRoleType.OnPrimaryContainer,
		Enums.ColorRoleType.Surface,
		Enums.ColorRoleType.OnSurface,
		onSelect,
		initialSelection,
		includeIconOnSelected,
		includeIconOnDeselected,
		elevation,
		isEnabled
	)
end

function Interface.secondary(
	style: CanBeState<Style>,
	onSelect: CanBeState<(isSelected: boolean) -> ()>,
	initialSelection: CanBeState<boolean>,
	includeIconOnSelected: CanBeState<boolean?>,
	includeIconOnDeselected: CanBeState<boolean?>,
	elevation: CanBeState<number?>,
	isEnabled: CanBeState<boolean?>
): GuiObject
	return newThemedComponent(
		DEFAULTS.SECONDARY,
		style,
		Enums.ColorRoleType.SurfaceContainerHighest,
		Enums.ColorRoleType.Outline,
		Enums.ColorRoleType.Secondary,
		Enums.ColorRoleType.SecondaryContainer,
		Enums.ColorRoleType.OnSecondaryContainer,
		Enums.ColorRoleType.Surface,
		Enums.ColorRoleType.OnSurface,
		onSelect,
		initialSelection,
		includeIconOnSelected,
		includeIconOnDeselected,
		elevation,
		isEnabled
	)
end

function Interface.tertiary(
	style: CanBeState<Style>,
	onSelect: CanBeState<(isSelected: boolean) -> ()>,
	initialSelection: CanBeState<boolean>,
	includeIconOnSelected: CanBeState<boolean?>,
	includeIconOnDeselected: CanBeState<boolean?>,
	elevation: CanBeState<number?>,
	isEnabled: CanBeState<boolean?>
): GuiObject
	return newThemedComponent(
		DEFAULTS.TERTIARY,
		style,
		Enums.ColorRoleType.SurfaceContainerHighest,
		Enums.ColorRoleType.Outline,
		Enums.ColorRoleType.Tertiary,
		Enums.ColorRoleType.TertiaryContainer,
		Enums.ColorRoleType.OnTertiaryContainer,
		Enums.ColorRoleType.Surface,
		Enums.ColorRoleType.OnSurface,
		onSelect,
		initialSelection,
		includeIconOnSelected,
		includeIconOnDeselected,
		elevation,
		isEnabled
	)
end

function Interface.new(
	onSelect: CanBeState<(isSelected: boolean) -> ()>,
	initialSelection: CanBeState<boolean>,
	isEnabled: CanBeState<boolean>,
	includeIconOnSelected: CanBeState<boolean>,
	includeIconOnDeselected: CanBeState<boolean>,
	backgroundColor: CanBeState<Color3>,
	onBackgroundColor: CanBeState<Color3>,
	fillColor: CanBeState<Color3>,
	buttonColor: CanBeState<Color3>,
	onButtonColor: CanBeState<Color3>,
	disabledColor: CanBeState<Color3>,
	onDisabledColor: CanBeState<Color3>,
	elevation: CanBeState<number>,
	schemeType: CanBeState<Enums.SchemeType>,
	fontData: CanBeState<FontData>,
	scale: CanBeState<number>
): GuiObject
	local maid = Maid.new()

	local _fuse = ColdFusion.fuse(maid)

	local _new = _fuse.new
	local _bind = _fuse.bind
	local _clone = _fuse.clone
	local _import = _fuse.import

	local _Value = _fuse.Value
	local _Computed = _fuse.Computed

	local scaleState: State<number> = _import(scale, DEFAULTS.NEW.SCALE or 1)
	local schemeTypeState: State<Enums.SchemeType> = _import(schemeType, DEFAULTS.NEW.SCHEME_TYPE)
	local fontDataState: State<FontData> = _import(fontData, DEFAULTS.NEW.FONT_DATA)

	local disabledColorState = _import(disabledColor, DEFAULTS.NEW.DISABLED_COLOR)
	local onDisabledColorState = _import(onDisabledColor, DEFAULTS.NEW.DISABLED_COLOR)

	local initialSelectionState = _import(initialSelection, DEFAULTS.NEW.INITIAL_SELECTION)
	local fillColorState = _import(fillColor, DEFAULTS.NEW.FILL_COLOR)

	local backgroundColorState = _import(backgroundColor, DEFAULTS.NEW.BACKGROUND_COLOR)
	local onBackgroundColorState = _import(onBackgroundColor, DEFAULTS.NEW.ON_BACKGROUND_COLOR)

	local buttonColorState = _import(buttonColor, DEFAULTS.NEW.BUTTON_COLOR)
	local onButtonColorState = _import(onButtonColor, DEFAULTS.NEW.ON_BUTTON_COLOR)

	local elevationState = _import(elevation, DEFAULTS.NEW.ELEVATION)
	local isEnabledState = _import(isEnabled, DEFAULTS.NEW.IS_ENABLED)
	local includeSelectedIconState = _import(includeIconOnSelected, DEFAULTS.NEW.INCLUDE_ICON_ON_SELECTED)
	local includeDeselectedIconState =
		_import(includeIconOnDeselected, DEFAULTS.NEW.INCLUDE_ICON_ON_DESELECTED)

	local onSelectState = _import(onSelect, DEFAULTS.NEW.ON_SELECT)

	local clickCountState = _Value(0)

	local valueState = _Computed(function(initial: boolean, count: number): boolean
		if count % 2 == 0 then
			return initial
		else
			return not initial
		end
	end, initialSelectionState, clickCountState)

	local iconState = _Computed(
		function(includeSel: boolean, includeDes: boolean, isSelected: boolean?): ImageData?
			if isSelected == true then
				if includeSel then
					return Icons.check
				end
			elseif isSelected == false then
				if includeDes then
					return Icons.close
				end
			end
			return nil
		end,
		includeSelectedIconState,
		includeDeselectedIconState,
		valueState
	)

	local unselectedRenderDatasState = _Computed(
		function(
			st: Enums.SchemeType,
			sc: number,
			f: FontData,
			fC: Color3,
			oC: Color3,
			oOC: Color3,
			bC: Color3,
			oBC: Color3,
			dC: Color3,
			oDC: Color3,
			e: number
		): { [Enums.ButtonStateType]: SwitchRenderData }
			return {
				[Enums.ButtonStateType.Enabled] = newSwitchRenderData(
					Types._AppearanceData.new(Theme.getElevatedColor(oC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(oC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 0)
				),
				[Enums.ButtonStateType.Disabled] = newSwitchRenderData(
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 1 - 0.38),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 1 - 0.38),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 1),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 1 - 0.38)
				),
				[Enums.ButtonStateType.Hovered] = newSwitchRenderData(
					Types._AppearanceData.new(Theme.getElevatedColor(oC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(oC, e, st), 1 - 0.08),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 0)
				),
				[Enums.ButtonStateType.Focused] = newSwitchRenderData(
					Types._AppearanceData.new(Theme.getElevatedColor(oC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(oC, e, st), 1 - 0.1),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 0)
				),
				[Enums.ButtonStateType.Pressed] = newSwitchRenderData(
					Types._AppearanceData.new(Theme.getElevatedColor(oC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(oC, e, st), 1 - 0.1),
					Types._AppearanceData.new(Theme.getElevatedColor(oOC, e, st), 0)
				),
			}
		end,
		schemeTypeState,
		scaleState,
		fontDataState,
		fillColorState,
		backgroundColorState,
		onBackgroundColorState,
		buttonColorState,
		onButtonColorState,
		disabledColorState,
		onDisabledColorState,
		elevationState
	)

	local selectedRenderDatasState = _Computed(
		function(
			st: Enums.SchemeType,
			sc: number,
			f: FontData,
			fC: Color3,
			oC: Color3,
			oOC: Color3,
			bC: Color3,
			oBC: Color3,
			dC: Color3,
			oDC: Color3,
			e: number
		): { [Enums.ButtonStateType]: SwitchRenderData }
			return {
				[Enums.ButtonStateType.Enabled] = newSwitchRenderData(
					Types._AppearanceData.new(Theme.getElevatedColor(oBC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(bC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(fC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(fC, e, st), 0)
				),
				[Enums.ButtonStateType.Disabled] = newSwitchRenderData(
					Types._AppearanceData.new(Theme.getElevatedColor(oDC, e, st), 1 - 0.38),
					Types._AppearanceData.new(Theme.getElevatedColor(dC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(oDC, e, st), 1 - 0.38),
					Types._AppearanceData.new(Theme.getElevatedColor(oDC, e, st), 1 - 0.38)
				),
				[Enums.ButtonStateType.Hovered] = newSwitchRenderData(
					Types._AppearanceData.new(Theme.getElevatedColor(oBC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(bC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(fC, e, st), 0.08),
					Types._AppearanceData.new(Theme.getElevatedColor(fC, e, st), 0)
				),
				[Enums.ButtonStateType.Focused] = newSwitchRenderData(
					Types._AppearanceData.new(Theme.getElevatedColor(oBC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(bC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(fC, e, st), 0.1),
					Types._AppearanceData.new(Theme.getElevatedColor(fC, e, st), 0)
				),
				[Enums.ButtonStateType.Pressed] = newSwitchRenderData(
					Types._AppearanceData.new(Theme.getElevatedColor(oBC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(bC, e, st), 0),
					Types._AppearanceData.new(Theme.getElevatedColor(fC, e, st), 0.1),
					Types._AppearanceData.new(Theme.getElevatedColor(fC, e, st), 0)
				),
			}
		end,
		schemeTypeState,
		scaleState,
		fontDataState,
		fillColorState,
		backgroundColorState,
		onBackgroundColorState,
		buttonColorState,
		onButtonColorState,
		disabledColorState,
		onDisabledColorState,
		elevationState
	)

	local isFocusedState = _Value(false)
	local isPressedState = _Value(false)
	local isHoveredState = _Value(false)

	local currentStateState = _Computed(
		function(
			isEnab: boolean,
			isFocused: boolean,
			isPressed: boolean,
			isHovered: boolean
		): Enums.ButtonStateType
			if isEnab then
				if isPressed then
					return Enums.ButtonStateType.Pressed
				else
					if isHovered then
						return Enums.ButtonStateType.Hovered
					else
						if isFocused then
							return Enums.ButtonStateType.Focused
						else
							return Enums.ButtonStateType.Enabled
						end
					end
				end
			else
				return Enums.ButtonStateType.Disabled
			end
		end,
		isEnabledState,
		isFocusedState,
		isPressedState,
		isHoveredState
	) :: State<any>

	local renderDataState = _Computed(
		function(
			selRenderDatas: { [Enums.ButtonStateType]: SwitchRenderData },
			unselRenderDatas: { [Enums.ButtonStateType]: SwitchRenderData },
			v: boolean?,
			bState: Enums.ButtonStateType
		): SwitchRenderData
			if v then
				return selRenderDatas[bState]
			else
				return unselRenderDatas[bState]
			end
		end,
		selectedRenderDatasState,
		unselectedRenderDatasState,
		valueState,
		currentStateState
	)

	local buttonSizeState = _Computed(function(i: ImageData?, v: boolean): number
		local size = if i
			then KNOB_YES_ICON_SIZE_DP
			else if v then KNOB_NO_ICON_SELECTED_SIZE_DP else KNOB_NO_ICON_UNSELECTED_SIZE_DP
		return size
	end, iconState, valueState)

	local switchSizeState = _Computed(function(sc: number): UDim2
		return UDim2.fromOffset(
			math.round(sc * SWITCH_WIDTH_DP - (OUTLINE_THICKNESS_DP * 2)),
			math.round(sc * SWITCH_HEIGHT_DP - (OUTLINE_THICKNESS_DP * 2))
		)
	end, scaleState)

	local outlineThicknessState = _Computed(function(sc: number): number
		return math.round(sc * OUTLINE_THICKNESS_DP)
	end, scaleState)

	local useStrokeState = _Computed(function(data: SwitchRenderData): boolean
		return data.Background.Color3 ~= data.Outline.Color3
			or data.Background.Transparency ~= data.Background.Transparency
	end, renderDataState)

	local inst = _new("ImageButton")({
		Name = "Switch",
		Size = _Computed(function(size: UDim2, thickness: number, useStroke: boolean): UDim2
			return UDim2.fromOffset(size.X.Offset + thickness * 2, size.Y.Offset + thickness * 2)
		end, switchSizeState, outlineThicknessState, useStrokeState),
		BackgroundColor3 = _Computed(function(data: SwitchRenderData): Color3
			return data.Background.Color3
		end, renderDataState),
		BackgroundTransparency = _Computed(function(useStroke: boolean, data: SwitchRenderData): number
			return if useStroke then 1 else data.Background.Transparency
		end, useStrokeState, renderDataState),
		Children = {
			_new("UICorner")({
				CornerRadius = _Computed(function(sc: number): UDim
					return UDim.new(0, math.round(sc * SWITCH_HEIGHT_DP / 2))
				end, scaleState),
			}),
			_new("ImageButton")({
				Name = "InnerSwitch",
				Size = switchSizeState,
				Position = _Computed(function(outlineThickness: number): UDim2
					return UDim2.fromOffset(outlineThickness, outlineThickness)
				end, outlineThicknessState),
				BackgroundColor3 = _Computed(function(data: SwitchRenderData): Color3
					return data.Background.Color3
				end, renderDataState),
				BackgroundTransparency = _Computed(
					function(data: SwitchRenderData, useStroke: boolean): number
						return if useStroke then data.Background.Transparency else 1
					end,
					renderDataState,
					useStrokeState
				),
				Events = {
					Activated = function()
						if isEnabledState:Get() == false then
							return
						end
						local onClick = onSelectState:Get()

						local count = clickCountState:Get() + 1
						clickCountState:Set(count)

						do
							local sound = Instance.new("Sound")
							sound.Volume = 1
							if valueState:Get() == true then
								sound.SoundId =
									Sounds.Library[Enums.SoundType.navigation_forward_selection_minimal]
							else
								sound.SoundId =
									Sounds.Library[Enums.SoundType.navigation_backward_selection_minimal]
							end
							SoundService:PlayLocalSound(sound)
							sound:Destroy()
						end

						onClick(valueState:Get())
					end,
					MouseButton1Down = function()
						if isEnabledState:Get() == false then
							return
						end
						isPressedState:Set(true)
					end,
					MouseButton1Up = function()
						if isEnabledState:Get() == false then
							return
						end
						isPressedState:Set(false)
					end,
					MouseEnter = function()
						isHoveredState:Set(true)
					end,
					MouseLeave = function()
						isHoveredState:Set(false)
					end,
					SelectionGained = function()
						isFocusedState:Set(true)
					end,
					SelectionLost = function()
						isFocusedState:Set(false)
					end,
				},
				Children = {
					_new("UIStroke")({
						ApplyStrokeMode = Enum.ApplyStrokeMode.Border,
						Color = _Computed(function(renderData: SwitchRenderData): Color3
							return renderData.Outline.Color3
						end, renderDataState),
						LineJoinMode = Enum.LineJoinMode.Round,
						Thickness = outlineThicknessState,
						Enabled = useStrokeState,
						Transparency = _Computed(function(renderData: SwitchRenderData): number
							return renderData.Outline.Transparency
						end, renderDataState),
					}),
					_new("UICorner")({
						CornerRadius = _Computed(function(sc: number): UDim
							return UDim.new(
								0,
								math.round(sc * (SWITCH_HEIGHT_DP - OUTLINE_THICKNESS_DP * 2) / 2)
							)
						end, scaleState),
					}),
					(function(): Instance
						local widthPaddingState = _Computed(
							function(
								sc: number,
								buttonSize: number,
								switchSize: UDim2,
								icon: ImageData?
							): UDim
								local size = sc * (SWITCH_HEIGHT_DP - (OUTLINE_THICKNESS_DP * 2) - buttonSize)
								if icon then
									size += math.max(0, math.round((switchSize.Y.Offset - buttonSize * sc)))
								end
								return UDim.new(0, math.round(size / 2))
							end,
							scaleState,
							buttonSizeState,
							switchSizeState,
							iconState
						)
						local heightPaddingState = _Computed(function(sc: number, buttonSize: number): UDim
							local size = SWITCH_HEIGHT_DP - (OUTLINE_THICKNESS_DP * 2) - buttonSize
							return UDim.new(0, math.round(sc * size / 2))
						end, scaleState, buttonSizeState)
						return _new("UIPadding")({
							PaddingTop = heightPaddingState,
							PaddingBottom = heightPaddingState,
							PaddingLeft = widthPaddingState,
							PaddingRight = widthPaddingState,
						})
					end)(),
					_new("Frame")({
						Name = "Knob",
						Size = _Computed(function(sc: number, size: number): UDim2
							return UDim2.fromOffset(math.round(sc * size), math.round(sc * size))
						end, scaleState, buttonSizeState),
						Position = _Computed(function(v: boolean): UDim2
							return if v then UDim2.fromScale(1, 0.5) else UDim2.fromScale(0, 0.5)
						end, valueState),
						AnchorPoint = _Computed(function(v: boolean): Vector2
							return if v then Vector2.new(1, 0.5) else Vector2.new(0, 0.5)
						end, valueState),
						BackgroundTransparency = _Computed(
							function(renderData: SwitchRenderData, v: boolean?): number
								return renderData.Button.Transparency
							end,
							renderDataState,
							valueState
						),
						BorderSizePixel = 0,
						BackgroundColor3 = _Computed(
							function(renderData: SwitchRenderData, v: boolean?): Color3
								return renderData.Button.Color3
							end,
							renderDataState,
							valueState
						),
						Children = {
							_new("UIListLayout")({
								Padding = UDim.new(0, 0),
								SortOrder = Enum.SortOrder.LayoutOrder,
								FillDirection = Enum.FillDirection.Horizontal,
								ItemLineAlignment = Enum.ItemLineAlignment.Center,
								VerticalAlignment = Enum.VerticalAlignment.Center,
								HorizontalAlignment = Enum.HorizontalAlignment.Center,
							}),
							_new("UICorner")({
								CornerRadius = _Computed(function(sc: number, size: number): UDim
									return UDim.new(0, math.round(sc * size / 2))
								end, scaleState, buttonSizeState),
							}),
							_new("ImageLabel")({
								Name = "Icon",
								Size = _Computed(function(sc: number, i: ImageData?): UDim2
									return UDim2.fromOffset(
										math.round(sc * ICON_SIZE_DP),
										math.round(sc * ICON_SIZE_DP)
									)
								end, scaleState, iconState),
								BackgroundTransparency = 1,
								ImageTransparency = _Computed(function(renderData: SwitchRenderData): number
									return renderData.Text.Transparency
								end, renderDataState),
								Visible = _Computed(function(i: ImageData?): boolean
									return i ~= nil
								end, iconState),
								ImageColor3 = _Computed(function(renderData: SwitchRenderData): Color3
									return renderData.Text.Color3
								end, renderDataState),
								Image = _Computed(function(i: ImageData?): string
									if i then
										return i.Image
									else
										return ""
									end
								end, iconState),
								ImageRectOffset = _Computed(function(i: ImageData?): Vector2
									return if i then i.ImageRectOffset else Vector2.zero
								end, iconState),
								ImageRectSize = _Computed(function(i: ImageData?): Vector2
									return if i then i.ImageRectSize else Vector2.zero
								end, iconState),
								Children = {
									_new("UICorner")({
										CornerRadius = UDim.new(0.5, 0),
									}),
								},
							}),
						},
					}),
				},
			}),
		},
	}) :: GuiObject

	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))

	return inst
end

return Interface


--!strict
-- this script was generated by the build system, please do not make manual edits
local _Package = script.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))
local ColdFusion = require(_Packages:WaitForChild("ColdFusion"))

-- Modules
local Types = require(_Package:WaitForChild("Types"))
local Style = require(_Package:WaitForChild("Style"))
local Enums = require(_Package:WaitForChild("Enums"))

-- Types
type Maid = Maid.Maid
type Style = Style.Style
type FontData = Types.FontData
type OptionData = Types.OptionData
type ButtonData = Types.ButtonData
type ImageData = Types.ImageData
type CanBeState<V> = ColdFusion.CanBeState<V>

return {
	NEW = {
		ON_SELECT = function(isSelected: boolean) end,
		INITIAL_SELECTION = false,
		IS_ENABLED = true,
		INCLUDE_ICON_ON_SELECTED = true,
		INCLUDE_ICON_ON_DESELECTED = true,
		BACKGROUND_COLOR = Color3.new(),
		ON_BACKGROUND_COLOR = Color3.new(),
		FILL_COLOR = Color3.new(),
		BUTTON_COLOR = Color3.new(),
		ON_BUTTON_COLOR = Color3.new(),
		DISABLED_COLOR = Color3.new(),
		ON_DISABLED_COLOR = Color3.new(),
		ELEVATION = 0,
		SCHEME_TYPE = Enums.SchemeType.Light,
		FONT_DATA = Types.FontData.new(Font.fromEnum(Enum.Font.SourceSans), 14),
		SCALE = 1,
	},
	PRIMARY = {
		STYLE = Style.new(1, Enum.Font.SourceSans, "Light", Color3.new(0, 0.4, 0.7)),
		ON_SELECT = function(isSelected: boolean) end,
		INITIAL_SELECTION = false,
		INCLUDE_ICON_ON_SELECTED = true,
		INCLUDE_ICON_ON_DESELECTED = true,
		ELEVATION = 0,
		IS_ENABLED = true,
	},
	SECONDARY = {
		STYLE = Style.new(1, Enum.Font.SourceSans, "Light", Color3.new(0, 0.4, 0.7)),
		ON_SELECT = function(isSelected: boolean) end,
		INITIAL_SELECTION = false,
		INCLUDE_ICON_ON_SELECTED = true,
		INCLUDE_ICON_ON_DESELECTED = true,
		ELEVATION = 0,
		IS_ENABLED = true,
	},
	TERTIARY = {
		STYLE = Style.new(1, Enum.Font.SourceSans, "Light", Color3.new(0, 0.4, 0.7)),
		ON_SELECT = function(isSelected: boolean) end,
		INITIAL_SELECTION = false,
		INCLUDE_ICON_ON_SELECTED = true,
		INCLUDE_ICON_ON_DESELECTED = true,
		ELEVATION = 0,
		IS_ENABLED = true,
	},
}


--!strict
-- this script was generated by the build system, please do not make manual edits
local _Package = script.Parent.Parent.Parent
local _Packages = _Package.Parent
-- Services
-- Packages
local Maid = require(_Packages:WaitForChild("Maid"))
local ColdFusion = require(_Packages:WaitForChild("ColdFusion"))

-- Modules
local Types = require(_Package:WaitForChild("Types"))
local Style = require(_Package:WaitForChild("Style"))
local Enums = require(_Package:WaitForChild("Enums"))

local Translators = require(_Package:WaitForChild("Translators"))

local Source = require(script.Parent:WaitForChild("ColdFusion"))

-- Types
type Maid = Maid.Maid
type Style = Style.Style
type FontData = Types.FontData
type OptionData = Types.OptionData
type ButtonData = Types.ButtonData
type ImageData = Types.ImageData
type CanBeState<V> = ColdFusion.CanBeState<V>
type FusionCanBeState<V> = Translators.FusionCanBeState<V>

-- Constants
local DEFAULTS = require(script.Parent:WaitForChild("Defaults"))
-- Variables
-- References
-- Private Functions
-- Class
local Interface = {}

function Interface.new(
	onSelect: FusionCanBeState<(isSelected: boolean) -> ()>,
	initialSelection: FusionCanBeState<boolean>,
	isEnabled: FusionCanBeState<boolean>,
	includeIconOnSelected: FusionCanBeState<boolean>,
	includeIconOnDeselected: FusionCanBeState<boolean>,
	backgroundColor: FusionCanBeState<Color3>,
	onBackgroundColor: FusionCanBeState<Color3>,
	fillColor: FusionCanBeState<Color3>,
	buttonColor: FusionCanBeState<Color3>,
	onButtonColor: FusionCanBeState<Color3>,
	disabledColor: FusionCanBeState<Color3>,
	onDisabledColor: FusionCanBeState<Color3>,
	elevation: FusionCanBeState<number>,
	schemeType: FusionCanBeState<Enums.SchemeType>,
	fontData: FusionCanBeState<FontData>,
	scale: FusionCanBeState<number>
): GuiObject
	local maid = Maid.new()
	local _fuse = ColdFusion.fuse(maid)
	local function convert<V>(value: FusionCanBeState<V>, default: V): CanBeState<V>
		return Translators.Fusion.toColdFusion(maid, _fuse, value, default)
	end
	local inst = Source.new(
		convert(onSelect, DEFAULTS.NEW.ON_SELECT),
		convert(initialSelection, DEFAULTS.NEW.INITIAL_SELECTION),
		convert(isEnabled, DEFAULTS.NEW.IS_ENABLED),
		convert(includeIconOnSelected, DEFAULTS.NEW.INCLUDE_ICON_ON_SELECTED),
		convert(includeIconOnDeselected, DEFAULTS.NEW.INCLUDE_ICON_ON_DESELECTED),
		convert(backgroundColor, DEFAULTS.NEW.BACKGROUND_COLOR),
		convert(onBackgroundColor, DEFAULTS.NEW.ON_BACKGROUND_COLOR),
		convert(fillColor, DEFAULTS.NEW.FILL_COLOR),
		convert(buttonColor, DEFAULTS.NEW.BUTTON_COLOR),
		convert(onButtonColor, DEFAULTS.NEW.ON_BUTTON_COLOR),
		convert(disabledColor, DEFAULTS.NEW.DISABLED_COLOR),
		convert(onDisabledColor, DEFAULTS.NEW.ON_DISABLED_COLOR),
		convert(elevation, DEFAULTS.NEW.ELEVATION),
		convert(schemeType, DEFAULTS.NEW.SCHEME_TYPE),
		convert(fontData, DEFAULTS.NEW.FONT_DATA),
		convert(scale, DEFAULTS.NEW.SCALE)
	)
	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))
	return inst
end

function Interface.primary(
	style: FusionCanBeState<Style>,
	onSelect: FusionCanBeState<(isSelected: boolean) -> ()>,
	initialSelection: FusionCanBeState<boolean>,
	includeIconOnSelected: FusionCanBeState<boolean?>,
	includeIconOnDeselected: FusionCanBeState<boolean?>,
	elevation: FusionCanBeState<number?>,
	isEnabled: FusionCanBeState<boolean?>
): GuiObject
	local maid = Maid.new()
	local _fuse = ColdFusion.fuse(maid)
	local function convert<V>(value: FusionCanBeState<V>, default: V): CanBeState<V>
		return Translators.Fusion.toColdFusion(maid, _fuse, value, default)
	end
	local inst = Source.primary(
		convert(style, DEFAULTS.PRIMARY.STYLE),
		convert(onSelect, DEFAULTS.PRIMARY.ON_SELECT),
		convert(initialSelection, DEFAULTS.PRIMARY.INITIAL_SELECTION),
		convert(includeIconOnSelected, DEFAULTS.PRIMARY.INCLUDE_ICON_ON_SELECTED),
		convert(includeIconOnDeselected, DEFAULTS.PRIMARY.INCLUDE_ICON_ON_DESELECTED),
		convert(elevation, DEFAULTS.PRIMARY.ELEVATION),
		convert(isEnabled, DEFAULTS.PRIMARY.IS_ENABLED)
	)
	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))
	return inst
end

function Interface.secondary(
	style: FusionCanBeState<Style>,
	onSelect: FusionCanBeState<(isSelected: boolean) -> ()>,
	initialSelection: FusionCanBeState<boolean>,
	includeIconOnSelected: FusionCanBeState<boolean?>,
	includeIconOnDeselected: FusionCanBeState<boolean?>,
	elevation: FusionCanBeState<number?>,
	isEnabled: FusionCanBeState<boolean?>
): GuiObject
	local maid = Maid.new()
	local _fuse = ColdFusion.fuse(maid)
	local function convert<V>(value: FusionCanBeState<V>, default: V): CanBeState<V>
		return Translators.Fusion.toColdFusion(maid, _fuse, value, default)
	end
	local inst = Source.secondary(
		convert(style, DEFAULTS.SECONDARY.STYLE),
		convert(onSelect, DEFAULTS.SECONDARY.ON_SELECT),
		convert(initialSelection, DEFAULTS.SECONDARY.INITIAL_SELECTION),
		convert(includeIconOnSelected, DEFAULTS.SECONDARY.INCLUDE_ICON_ON_SELECTED),
		convert(includeIconOnDeselected, DEFAULTS.SECONDARY.INCLUDE_ICON_ON_DESELECTED),
		convert(elevation, DEFAULTS.SECONDARY.ELEVATION),
		convert(isEnabled, DEFAULTS.SECONDARY.IS_ENABLED)
	)
	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))
	return inst
end

function Interface.tertiary(
	style: FusionCanBeState<Style>,
	onSelect: FusionCanBeState<(isSelected: boolean) -> ()>,
	initialSelection: FusionCanBeState<boolean>,
	includeIconOnSelected: FusionCanBeState<boolean?>,
	includeIconOnDeselected: FusionCanBeState<boolean?>,
	elevation: FusionCanBeState<number?>,
	isEnabled: FusionCanBeState<boolean?>
): GuiObject
	local maid = Maid.new()
	local _fuse = ColdFusion.fuse(maid)
	local function convert<V>(value: FusionCanBeState<V>, default: V): CanBeState<V>
		return Translators.Fusion.toColdFusion(maid, _fuse, value, default)
	end
	local inst = Source.tertiary(
		convert(style, DEFAULTS.TERTIARY.STYLE),
		convert(onSelect, DEFAULTS.TERTIARY.ON_SELECT),
		convert(initialSelection, DEFAULTS.TERTIARY.INITIAL_SELECTION),
		convert(includeIconOnSelected, DEFAULTS.TERTIARY.INCLUDE_ICON_ON_SELECTED),
		convert(includeIconOnDeselected, DEFAULTS.TERTIARY.INCLUDE_ICON_ON_DESELECTED),
		convert(elevation, DEFAULTS.TERTIARY.ELEVATION),
		convert(isEnabled, DEFAULTS.TERTIARY.IS_ENABLED)
	)
	maid:GiveTask(inst.Destroying:Connect(function()
		maid:Destroy()
	end))
	return inst
end

return Interface