local z=script.Parent local y=z.Parent.Packages local C=require(y.t)local v=require(y.Roact)local x=v.createElement local W=v.PureComponent:extend(script.Name)W.validateProps=C.strictInterface({Image=C.optional(C.string),TitleText=C.optional(C.string),BodyText=C.optional(C.string)})function W.render(z)local y=z.props z.HasThumbnailAsImage=(y.Image and y.Image:find("\114\098\120\116\104\117\109\098"))and true or false z.HasAvatarThumbnailAsImage=(z.HasThumbnailAsImage and(y.Image:match("\116\121\112\101\061\065\118\097\116\097\114")or y.Image:match("\116\121\112\101\061\072\101\097\100\083\104\111\116")))and true or false return x("\070\114\097\109\101",{AnchorPoint=y.Condensed and Vector2.new(.5,0)or Vector2.new(0,.5);AutomaticSize=y.Condensed and Enum.AutomaticSize.XY or Enum.AutomaticSize.Y;BackgroundColor3=Color3.fromRGB(0,0,0),BackgroundTransparency=.2;BorderSizePixel=0,Position=y.Condensed and UDim2.new(.5,0,0,150)or UDim2.fromScale(0,.5);Size=y.Condensed and UDim2.fromScale(.5,.5)or UDim2.fromScale(1,0)},{Layout=x("\085\073\076\105\115\116\076\097\121\111\117\116",{Padding=UDim.new(0,15),FillDirection=Enum.FillDirection.Horizontal;HorizontalAlignment=Enum.HorizontalAlignment.Center;VerticalAlignment=Enum.VerticalAlignment.Center});Padding=x("\085\073\080\097\100\100\105\110\103",{PaddingBottom=UDim.new(0,15),PaddingTop=UDim.new(0,15);PaddingLeft=UDim.new(0,y.Condensed and 15 or 50),PaddingRight=UDim.new(0,y.Condensed and 15 or 50)}),Corners=y.Condensed and x("\085\073\067\111\114\110\101\114",{CornerRadius=UDim.new(0,8)})or nil,Text=x("\070\114\097\109\101",{AutomaticSize=Enum.AutomaticSize.XY;BackgroundTransparency=1;LayoutOrder=1},{Layout=x("\085\073\076\105\115\116\076\097\121\111\117\116",{Padding=UDim.new(0,5),FillDirection=Enum.FillDirection.Vertical,HorizontalAlignment=y.Image and Enum.HorizontalAlignment.Left or Enum.HorizontalAlignment.Center;SortOrder=Enum.SortOrder.LayoutOrder;VerticalAlignment=Enum.VerticalAlignment.Top}),SizeConstraint=x("\085\073\083\105\122\101\067\111\110\115\116\114\097\105\110\116",{MaxSize=Vector2.new(500,math.huge)}),Body=y.BodyText and x("\084\101\120\116\076\097\098\101\108",{AutomaticSize=Enum.AutomaticSize.XY,BackgroundTransparency=1;LayoutOrder=1,FontFace=Font.fromEnum(Enum.Font.SourceSans),RichText=true,Text=y.BodyText,TextColor3=Color3.fromRGB(255,255,255);TextSize=18;TextWrapped=true;TextXAlignment=Enum.TextXAlignment.Left;TextYAlignment=Enum.TextYAlignment.Top}),Title=y.TitleText and x("\084\101\120\116\076\097\098\101\108",{AutomaticSize=Enum.AutomaticSize.XY,BackgroundTransparency=1;LayoutOrder=0,FontFace=Font.fromEnum(Enum.Font.SourceSansBold),RichText=true,Text=y.TitleText;TextColor3=Color3.fromRGB(255,255,255);TextSize=18;TextXAlignment=Enum.TextXAlignment.Left,TextYAlignment=Enum.TextYAlignment.Top})});Image=y.Image and x("\073\109\097\103\101\076\097\098\101\108",{BackgroundColor3=Color3.fromRGB(45,45,45);BackgroundTransparency=z.HasThumbnailAsImage and 0 or 1;Size=UDim2.fromOffset(48,48),Image=y.Image},{Corner=z.HasThumbnailAsImage and x("\085\073\067\111\114\110\101\114",{CornerRadius=UDim.new(z.HasAvatarThumbnailAsImage and.5 or 0,not z.HasAvatarThumbnailAsImage and 4 or 0)})or nil})})end return W
-- Message: Attention grabbing on screen message

local Components = script.Parent
local Packages = Components.Parent.Packages

local t = require(Packages.t)
local Roact = require(Packages.Roact)
local new = Roact.createElement

local Message = Roact.PureComponent:extend(script.Name)

Message.validateProps = t.strictInterface({

	--- @prop @optional Image string Image
	Image = t.optional(t.string),

	--- @prop @optional TitleText string Title text
	TitleText = t.optional(t.string),

	--- @prop @optional BodyText string Message content
	BodyText = t.optional(t.string),
})

function Message:render()
	local props = self.props

	self.HasThumbnailAsImage = (props.Image and props.Image:find('rbxthumb')) and true or false
	self.HasAvatarThumbnailAsImage = (self.HasThumbnailAsImage and (
		props.Image:match('type=Avatar') or
		props.Image:match('type=HeadShot')
	)) and true or false

	return new('Frame', {
		AnchorPoint = props.Condensed and Vector2.new(0.5, 0) or Vector2.new(0, 0.5),
		AutomaticSize = props.Condensed and Enum.AutomaticSize.XY or Enum.AutomaticSize.Y,
		BackgroundColor3 = Color3.fromRGB(0, 0, 0),
		BackgroundTransparency = 0.2,
		BorderSizePixel = 0,
		Position = props.Condensed and UDim2.new(0.5, 0, 0, 150) or UDim2.fromScale(0, 0.5),
		Size = props.Condensed and UDim2.fromScale(0.5, 0.5) or UDim2.fromScale(1, 0),
	}, {

		Layout = new('UIListLayout', {
			Padding = UDim.new(0, 15),
			FillDirection = Enum.FillDirection.Horizontal,
			HorizontalAlignment = Enum.HorizontalAlignment.Center,
			VerticalAlignment = Enum.VerticalAlignment.Center,
		}),

		Padding = new('UIPadding', {
			PaddingBottom = UDim.new(0, 15),
			PaddingTop = UDim.new(0, 15),
			PaddingLeft = UDim.new(0, props.Condensed and 15 or 50),
			PaddingRight = UDim.new(0, props.Condensed and 15 or 50),
		}),

		Corners = props.Condensed and new('UICorner', {
			CornerRadius = UDim.new(0, 8),
		}) or nil,

		Text = new('Frame', {
			AutomaticSize = Enum.AutomaticSize.XY,
			BackgroundTransparency = 1,
			LayoutOrder = 1,
		}, {

			Layout = new('UIListLayout', {
				Padding = UDim.new(0, 5),
				FillDirection = Enum.FillDirection.Vertical,
				HorizontalAlignment = props.Image and Enum.HorizontalAlignment.Left or Enum.HorizontalAlignment.Center,
				SortOrder = Enum.SortOrder.LayoutOrder,
				VerticalAlignment = Enum.VerticalAlignment.Top,
			}),

			SizeConstraint = new('UISizeConstraint', {
				MaxSize = Vector2.new(500, math.huge),
			}),

			Body = props.BodyText and new('TextLabel', {
				AutomaticSize = Enum.AutomaticSize.XY,
				BackgroundTransparency = 1,
				LayoutOrder = 1,
				FontFace = Font.fromEnum(Enum.Font.SourceSans),
				RichText = true,
				Text = props.BodyText,
				TextColor3 = Color3.fromRGB(255, 255, 255),
				TextSize = 18,
				TextWrapped = true,
				TextXAlignment = Enum.TextXAlignment.Left,
				TextYAlignment = Enum.TextYAlignment.Top,
			}),

			Title = props.TitleText and new('TextLabel', {
				AutomaticSize = Enum.AutomaticSize.XY,
				BackgroundTransparency = 1,
				LayoutOrder = 0,
				FontFace = Font.fromEnum(Enum.Font.SourceSansBold),
				RichText = true,
				Text = props.TitleText,
				TextColor3 = Color3.fromRGB(255, 255, 255),
				TextSize = 18,
				TextXAlignment = Enum.TextXAlignment.Left,
				TextYAlignment = Enum.TextYAlignment.Top,
			}),
		}),

		Image = props.Image and new('ImageLabel', {
			BackgroundColor3 = Color3.fromRGB(45, 45, 45),
			BackgroundTransparency = self.HasThumbnailAsImage and 0 or 1,
			Size = UDim2.fromOffset(48, 48),
			Image = props.Image,
		}, {

			Corner = self.HasThumbnailAsImage and new('UICorner', {
				CornerRadius = UDim.new(self.HasAvatarThumbnailAsImage and 0.5 or 0, (not self.HasAvatarThumbnailAsImage) and 4 or 0),
			}) or nil,
		}),
	})
end

return Message
