local z=(script:FindFirstAncestor("\067\109\100\114\065\100\100\105\116\105\111\110\115")).Packages local A=(script:FindFirstAncestor("\085\073")).Components local Y=require(z.Roact)local m=require(z.Util)local W=require(A.RoundedRectangle)local a=require(A.Dragger)local H={AdminLogs="\114\098\120\097\115\115\101\116\105\100\058\047\047",ChatLogs="\114\098\120\097\115\115\101\116\105\100\058\047\047"}local function X(z)return Y.createElement("\073\109\097\103\101\066\117\116\116\111\110",{Size=UDim2.new(0,18,1,0),LayoutOrder=-z.Index;BackgroundTransparency=1;[Y.Event.Activated]=z.Activated},{Circle=Y.createElement("\073\109\097\103\101\076\097\098\101\108",{Image="\114\098\120\097\115\115\101\116\105\100\058\047\047\051\048\056\056\055\049\051\051\052\049";ImageColor3=z.Color;ImageTransparency=z.Transparency,Size=UDim2.new(0,10,0,10),Position=UDim2.new(.5,0,.5,0),AnchorPoint=Vector2.new(.5,.5),BackgroundTransparency=1})})end local F=Y.PureComponent:extend("\087\105\110\100\111\119\078\097\118\098\097\114")function F.render(z)local A=z.props.Transparency return Y.createElement(W,{Radius=8;Mode="\083\105\110\103\108\101\069\100\103\101";Edge="\084\111\112",Color=Color3.new(0,0,0);Transparency=A:map(function(z)return m.Math.lerp(.5,1,z)end),Size=UDim2.new(1,0,0,34),ClipsDescendants=true},{Dragger=Y.createElement(a,{Size=UDim2.new(1,0,1,0),Move=z.props.Move});Title=Y.createElement("\084\101\120\116\076\097\098\101\108",{Text=z.props.Title,Font=Enum.Font.Gotham,TextSize=18;TextColor3=Color3.new(1,1,1);TextTransparency=A,TextXAlignment=Enum.TextXAlignment.Left,Size=UDim2.new(1,0,1,0),Position=UDim2.new(0,14,0,0);BackgroundTransparency=1}),Buttons=Y.createElement("\070\114\097\109\101",{Size=UDim2.new(1,0,1,0),BackgroundTransparency=1},{Close=Y.createElement(X,{Index=1;Color=Color3.fromRGB(223,54,83);Activated=z.props.Close,Transparency=A}),Toggle=Y.createElement(X,{Index=2,Color=Color3.fromRGB(223,150,54),Activated=z.props.Toggle;Transparency=A});Padding=Y.createElement("\085\073\080\097\100\100\105\110\103",{PaddingRight=UDim.new(0,10)}),Layout=Y.createElement("\085\073\076\105\115\116\076\097\121\111\117\116",{HorizontalAlignment=Enum.HorizontalAlignment.Right;FillDirection=Enum.FillDirection.Horizontal;SortOrder=Enum.SortOrder.LayoutOrder})}),Icon=Y.createElement("\073\109\097\103\101\076\097\098\101\108",{Image=H[z.props.Icon],ImageTransparency=A:map(function(z)return m.Math.lerp(.85,1,z)end),Size=UDim2.new(0,48,0,48);Position=UDim2.new(1,0,.5,0);AnchorPoint=Vector2.new(1,.5);ZIndex=0;BackgroundTransparency=1})})end return F
local Packages = script:FindFirstAncestor("CmdrAdditions").Packages
local Components = script:FindFirstAncestor("UI").Components

local Roact = require(Packages.Roact)
local Util = require(Packages.Util)

local RoundedRectangle = require(Components.RoundedRectangle)
local Dragger = require(Components.Dragger)

local ICONS = {
	AdminLogs = "rbxassetid://",
	ChatLogs = "rbxassetid://"
}

local function WindowNavbarButton(props)
	return Roact.createElement("ImageButton", {
		Size = UDim2.new(0, 18, 1, 0),

		LayoutOrder = -props.Index,
		BackgroundTransparency = 1,

		[Roact.Event.Activated] = props.Activated
	}, {
		Circle = Roact.createElement("ImageLabel", {
			Image = "rbxassetid://3088713341",
			ImageColor3 = props.Color,
			ImageTransparency = props.Transparency,

			Size = UDim2.new(0, 10, 0, 10),
			Position = UDim2.new(0.5, 0, 0.5, 0),
			AnchorPoint = Vector2.new(0.5, 0.5),

			BackgroundTransparency = 1
		})
	})
end

local WindowNavbar = Roact.PureComponent:extend("WindowNavbar")

function WindowNavbar:render()
	local transparency = self.props.Transparency

	return Roact.createElement(RoundedRectangle, {
		Radius = 8,
		Mode = "SingleEdge",
		Edge = "Top",
		Color = Color3.new(0, 0, 0),
		Transparency = transparency:map(function(value)
			return Util.Math.lerp(0.5, 1, value)
		end),

		Size = UDim2.new(1, 0, 0, 34),

		ClipsDescendants = true
	}, {
		Dragger = Roact.createElement(Dragger, {
			Size = UDim2.new(1, 0, 1, 0),
			Move = self.props.Move
		}),

		Title = Roact.createElement("TextLabel", {
			Text = self.props.Title,
			Font = Enum.Font.Gotham,
			TextSize = 18,
			TextColor3 = Color3.new(1, 1, 1),
			TextTransparency = transparency,
			TextXAlignment = Enum.TextXAlignment.Left,

			Size = UDim2.new(1, 0, 1, 0),
			Position = UDim2.new(0, 14, 0, 0),

			BackgroundTransparency = 1
		}),

		Buttons = Roact.createElement("Frame", {
			Size = UDim2.new(1, 0, 1, 0),
			BackgroundTransparency = 1
		}, {
			Close = Roact.createElement(WindowNavbarButton, {
				Index = 1,
				Color = Color3.fromRGB(0xDF, 0x36, 0x53),
				Activated = self.props.Close,
				Transparency = transparency
			}),

			Toggle = Roact.createElement(WindowNavbarButton, {
				Index = 2,
				Color = Color3.fromRGB(0xDF, 0x96, 0x36),
				Activated = self.props.Toggle,
				Transparency = transparency
			}),

			Padding = Roact.createElement("UIPadding", {
				PaddingRight = UDim.new(0, 10)
			}),

			Layout = Roact.createElement("UIListLayout", {
				HorizontalAlignment = Enum.HorizontalAlignment.Right,
				FillDirection = Enum.FillDirection.Horizontal,
				SortOrder = Enum.SortOrder.LayoutOrder
			})
		}),

		Icon = Roact.createElement("ImageLabel", {
			Image = ICONS[self.props.Icon],
			ImageTransparency = transparency:map(function(value)
				return Util.Math.lerp(0.85, 1, value)
			end),

			Size = UDim2.new(0, 48, 0, 48),
			Position = UDim2.new(1, 0, 0.5, 0),
			AnchorPoint = Vector2.new(1, 0.5),

			ZIndex = 0,
			BackgroundTransparency = 1
		})
	})
end

return WindowNavbar