local X=game:GetService("\084\101\120\116\083\101\114\118\105\099\101")local b=require(script.Parent.Parent.Configuration)local d=require(script.Parent.Parent.Utility.ThemeAccessor)local p=b.Roact local o={Display4Font=Enum.Font.SourceSansLight;Display4Size=96;Display3Font=Enum.Font.SourceSans,Display3Size=72,Display2Font=Enum.Font.SourceSans,Display2Size=56;Display1Font=Enum.Font.SourceSans,Display1Size=48;Body2Font=Enum.Font.SourceSansSemibold,Body2Size=18,Body1Font=Enum.Font.SourceSans,Body1Size=18,TitleFont=Enum.Font.SourceSansSemibold;TitleSize=24,HeadlineFont=Enum.Font.SourceSans,HeadlineSize=32;SubheadingFont=Enum.Font.SourceSans;SubheadingSize=20,ButtonFont=Enum.Font.SourceSansSemibold,ButtonSize=18,CaptionFont=Enum.Font.SourceSans,CaptionSize=14}local A=p.Component:extend("\077\097\116\101\114\105\097\108\084\101\120\116\086\105\101\119")function A.getTextBounds(b,d,p)p=p or Vector2.new(10000,10000)local A=o[d.."\070\111\110\116"]local z=o[d.."\083\105\122\101"]return X:GetTextSize(b,z,A,p)end function A.render(X)local b=X.props.Class local A=o[b.."\070\111\110\116"]local z=o[b.."\083\105\122\101"]return p.createElement("\084\101\120\116\076\097\098\101\108",{AnchorPoint=X.props.AnchorPoint,BackgroundTransparency=1;Font=A;LayoutOrder=X.props.LayoutOrder,LineHeight=X.props.LineHeight,Position=X.props.Position,Size=X.props.Size;Text=X.props.Text,TextColor3=X.props.TextColor3 or d.Get(X,"\084\101\120\116\067\111\108\111\114");TextSize=z,TextStrokeColor3=X.props.TextStrokeColor3,TextStrokeTransparency=X.props.TextStrokeTransparency;TextTransparency=X.props.TextTransparency,TextXAlignment=X.props.TextXAlignment,TextYAlignment=X.props.TextYAlignment;ZIndex=X.props.ZIndex},X.props[p.Children])end return A
local TextService = game:GetService("TextService")
local Configuration = require(script.Parent.Parent.Configuration)
local ThemeAccessor = require(script.Parent.Parent.Utility.ThemeAccessor)

local Roact = Configuration.Roact

local TEXT_CLASSES = {
	Display4Font = Enum.Font.SourceSansLight,
	Display4Size = 96,
	Display3Font = Enum.Font.SourceSans,
	Display3Size = 72,
	Display2Font = Enum.Font.SourceSans,
	Display2Size = 56,
	Display1Font = Enum.Font.SourceSans,
	Display1Size = 48,

	Body2Font = Enum.Font.SourceSansSemibold,
	Body2Size = 18,
	Body1Font = Enum.Font.SourceSans,
	Body1Size = 18,

	TitleFont = Enum.Font.SourceSansSemibold,
	TitleSize = 24,
	HeadlineFont = Enum.Font.SourceSans,
	HeadlineSize = 32,
	SubheadingFont = Enum.Font.SourceSans,
	SubheadingSize = 20,

	ButtonFont = Enum.Font.SourceSansSemibold,
	ButtonSize = 18,
	CaptionFont = Enum.Font.SourceSans,
	CaptionSize = 14,
}

local TextView = Roact.Component:extend("MaterialTextView")

function TextView.getTextBounds(text, textClass, boundingRect)
	boundingRect = boundingRect or Vector2.new(10000, 10000)
	local font = TEXT_CLASSES[textClass .. "Font"]
	local size = TEXT_CLASSES[textClass .. "Size"]

	return TextService:GetTextSize(text, size, font, boundingRect)
end

function TextView:render()
	local textClass = self.props.Class
	local font = TEXT_CLASSES[textClass .. "Font"]
	local size = TEXT_CLASSES[textClass .. "Size"]

	return Roact.createElement("TextLabel", {
		AnchorPoint = self.props.AnchorPoint,
		BackgroundTransparency = 1,
		Font = font,
		LayoutOrder = self.props.LayoutOrder,
		LineHeight = self.props.LineHeight,
		Position = self.props.Position,
		Size = self.props.Size,
		Text = self.props.Text,
		TextColor3 = self.props.TextColor3 or ThemeAccessor.Get(self, "TextColor"),
		TextSize = size,
		TextStrokeColor3 = self.props.TextStrokeColor3,
		TextStrokeTransparency = self.props.TextStrokeTransparency,
		TextTransparency = self.props.TextTransparency,
		TextXAlignment = self.props.TextXAlignment,
		TextYAlignment = self.props.TextYAlignment,
		ZIndex = self.props.ZIndex,
	}, self.props[Roact.Children])
end

return TextView
