local k=game:GetService("\082\101\112\108\105\099\097\116\101\100\083\116\111\114\097\103\101")local c=require(k.Packages.Fusion)local O=c.New local M=c.Tween local t=c.Children local S=c.Computed local w=c.Value local E=c.OnEvent return function(k)local N=w(false)local A=w(true)task.delay(.1,function()A:set(false)end)return(O("\070\114\097\109\101"))({BackgroundTransparency=1;LayoutOrder=k.Order:get();Size=M(S(function()if A:get()or not k.Visible:get()then return UDim2.fromScale(1,0)else return UDim2.new(1,0,0,42)end end),TweenInfo.new(.3,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false,.3)),ClipsDescendants=true,[t]={(O("\070\114\097\109\101"))({BackgroundTransparency=1,Position=M(S(function()if A:get()or not k.Visible:get()then return UDim2.fromScale(1,0)else return UDim2.fromScale(0,0)end end),TweenInfo.new(.3,Enum.EasingStyle.Quint,Enum.EasingDirection.Out,0,false));Size=UDim2.fromScale(1,1);[t]={(O("\070\114\097\109\101"))({BackgroundTransparency=.5,BackgroundColor3=Color3.fromHex("\035\048\048\048\048\048\048"),Size=UDim2.fromScale(1,1)}),(O("\073\109\097\103\101\076\097\098\101\108"))({Size=UDim2.fromOffset(60,42),Position=UDim2.fromOffset(0,0),BackgroundTransparency=1,Image=("\114\098\120\116\104\117\109\098\058\047\047\116\121\112\101\061\065\118\097\116\097\114\072\101\097\100\083\104\111\116\038\105\100\061\037\115\038\119\061\054\048\038\104\061\054\048"):format(k.UserId),ImageTransparency=.6,ScaleType=Enum.ScaleType.Crop,ZIndex=2,[t]={(O("\085\073\071\114\097\100\105\101\110\116"))({Transparency=NumberSequence.new({NumberSequenceKeypoint.new(0,0);NumberSequenceKeypoint.new(1,1)})})}}),(O("\084\101\120\116\076\097\098\101\108"))({Font=Enum.Font.GothamSemibold;Text=k.DisplayName,TextColor3=Color3.fromHex("\035\070\070\070\070\070\070");TextSize=14,TextXAlignment=Enum.TextXAlignment.Left,BackgroundTransparency=1,TextTransparency=c.Tween(S(function()return N:get()and 1 or 0 end),TweenInfo.new(.15));Position=c.Tween(S(function()return N:get()and UDim2.fromScale(0,0)or UDim2.fromOffset(16,0)end),TweenInfo.new(.2,Enum.EasingStyle.Back));Size=UDim2.fromScale(0,1);ZIndex=3});(O("\070\114\097\109\101"))({AnchorPoint=Vector2.new(1,1),BackgroundColor3=Color3.fromHex("\035\070\070\070\070\070\070"),BackgroundTransparency=.9,BorderSizePixel=0;Position=UDim2.fromScale(1,1);Size=UDim2.new(1,-16,0,1);Visible=S(function()return not k.AtBottom:get()end),ZIndex=3});(O("\084\101\120\116\076\097\098\101\108"))({Font=Enum.Font.Gotham;Text="\064"..k.Name,TextColor3=Color3.fromHex("\035\070\070\070\070\070\070"),TextSize=14;TextTransparency=c.Tween(S(function()return N:get()and.5 or 1 end),TweenInfo.new(.15));TextXAlignment=Enum.TextXAlignment.Left,BackgroundTransparency=1,Position=c.Tween(S(function()return N:get()and UDim2.fromOffset(16,0)or UDim2.fromOffset(32,0)end),TweenInfo.new(.2,Enum.EasingStyle.Back));Size=UDim2.fromScale(0,1);ZIndex=3});(O("\073\109\097\103\101\076\097\098\101\108"))({BackgroundTransparency=1;Image=k.Icon;AnchorPoint=Vector2.new(1,.5),Size=UDim2.fromOffset(16,16),Position=UDim2.new(1,-16,.5,0),ZIndex=3})},[E("\073\110\112\117\116\066\101\103\097\110")]=function()N:set(true)end;[E("\073\110\112\117\116\069\110\100\101\100")]=function()N:set(false)end})}})end
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Fusion = require(ReplicatedStorage.Packages.Fusion)

local New = Fusion.New
local Tween = Fusion.Tween
local Children = Fusion.Children
local Computed = Fusion.Computed
local Value = Fusion.Value
local OnEvent = Fusion.OnEvent

return function(props)
    local isHovering = Value(false)
    local forceDisabled = Value(true)

    -- im so sorry for this horrible code solution
    task.delay(0.1, function()
        forceDisabled:set(false)
    end)

    return New "Frame" {
        BackgroundTransparency = 1,
        LayoutOrder = props.Order:get(),
        Size = Tween(Computed(function()
            if forceDisabled:get() or not props.Visible:get() then
                return UDim2.fromScale(1, 0)
            else
                return UDim2.new(1, 0, 0, 42)
            end
        end), TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false, 0.3)),
        ClipsDescendants = true,

        [Children] = {
            New "Frame" {
                BackgroundTransparency = 1,
                Position = Tween(Computed(function()
                    if forceDisabled:get() or not props.Visible:get() then
                        return UDim2.fromScale(1, 0)
                    else
                        return UDim2.fromScale(0, 0)
                    end
                end), TweenInfo.new(0.3, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false)),
                Size = UDim2.fromScale(1, 1),

                [Children] = {
                    New "Frame" {
                        BackgroundTransparency = 0.5,
                        BackgroundColor3 = Color3.fromHex("#000000"),
                        Size = UDim2.fromScale(1, 1),
                    },

                    New "ImageLabel" {
                        Size = UDim2.fromOffset(60, 42),
                        Position = UDim2.fromOffset(0, 0),
                        BackgroundTransparency = 1,
                        Image = ("rbxthumb://type=AvatarHeadShot&id=%s&w=60&h=60"):format(props.UserId),
                        ImageTransparency = 0.6,
                        ScaleType = Enum.ScaleType.Crop,
                        ZIndex = 2,

                        [Children] = {
                            New "UIGradient" {
                                Transparency = NumberSequence.new({
                                    NumberSequenceKeypoint.new(0, 0),
                                    NumberSequenceKeypoint.new(1, 1)
                                }),
                            }
                        }
                    },

                    New "TextLabel" {
                        Font = Enum.Font.GothamSemibold,
                        Text = props.DisplayName,
                        TextColor3 = Color3.fromHex("#FFFFFF"),
                        TextSize = 14,
                        TextXAlignment = Enum.TextXAlignment.Left,
                        BackgroundTransparency = 1,
                        TextTransparency = Fusion.Tween(Computed(function()
                            return isHovering:get() and 1 or 0
                        end), TweenInfo.new(0.15)),
                        Position = Fusion.Tween(Computed(function()
                            return isHovering:get() and UDim2.fromScale(0, 0) or UDim2.fromOffset(16, 0)
                        end), TweenInfo.new(0.2, Enum.EasingStyle.Back)),
                        Size = UDim2.fromScale(0, 1),
                        ZIndex = 3,
                    },

                    New "Frame" {
                        AnchorPoint = Vector2.new(1, 1),
                        BackgroundColor3 = Color3.fromHex("#FFFFFF"),
                        BackgroundTransparency = 0.9,
                        BorderSizePixel = 0,
                        Position = UDim2.fromScale(1, 1),
                        Size = UDim2.new(1, -16, 0, 1),
                        Visible = Computed(function()
                            return not props.AtBottom:get()
                        end),
                        ZIndex = 3,
                    },

                    New "TextLabel" {
                        Font = Enum.Font.Gotham,
                        Text = "@" .. props.Name,
                        TextColor3 = Color3.fromHex("#FFFFFF"),
                        TextSize = 14,
                        TextTransparency = Fusion.Tween(Computed(function()
                            return isHovering:get() and 0.5 or 1
                        end), TweenInfo.new(0.15)),
                        TextXAlignment = Enum.TextXAlignment.Left,
                        BackgroundTransparency = 1,
                        Position = Fusion.Tween(Computed(function()
                            return isHovering:get() and UDim2.fromOffset(16, 0) or UDim2.fromOffset(32, 0)
                        end), TweenInfo.new(0.2, Enum.EasingStyle.Back)),
                        Size = UDim2.fromScale(0, 1),
                        ZIndex = 3,
                    },

                    New "ImageLabel" {
                        BackgroundTransparency = 1,
                        Image = props.Icon,
                        AnchorPoint = Vector2.new(1, 0.5),
                        Size = UDim2.fromOffset(16, 16),
                        Position = UDim2.new(1, -16, 0.5, 0),
                        ZIndex = 3,
                    }
                },

                [OnEvent "InputBegan"] = function()
                    isHovering:set(true)
                end,

                [OnEvent "InputEnded"] = function()
                    isHovering:set(false)
                end,
            },
        }
    }
end
