local s=game:GetService("\067\111\108\108\101\099\116\105\111\110\083\101\114\118\105\099\101")return function(Q)local a=Q.create return Q.widget(function(i)local q=Q.useStyle()i=i or{}local U=i.left local z=i.right local u=i.isRight local N,b=Q.useState(false)local Y=Q.useInstance(function(q)q.corner=a("\085\073\067\111\114\110\101\114")local N=Q.useStyle()a("\084\101\120\116\066\117\116\116\111\110",{[q]="\098\117\116\116\111\110",BackgroundTransparency=1;Size=UDim2.new(1,0,0,25);Text="",a("\085\073\067\111\114\110\101\114"),a("\085\073\076\105\115\116\076\097\121\111\117\116",{FillDirection=Enum.FillDirection.Horizontal});a("\084\101\120\116\076\097\098\101\108",{[q]="\108\101\102\116";Text=U,Size=UDim2.new(.5,0,1,0),BackgroundColor3=N.primaryColor,BorderSizePixel=0;TextColor3=N.textColor,Font=Enum.Font.GothamMedium;TextSize=14});a("\084\101\120\116\076\097\098\101\108",{[q]="\114\105\103\104\116";Text=z;Size=UDim2.new(.5,0,1,0),BackgroundColor3=N.bg1,BorderSizePixel=0;TextColor3=N.textColor;Font=Enum.Font.GothamMedium,TextSize=14});MouseEnter=function()local s=u and q.left or q.right s.BackgroundTransparency=.5 end;MouseLeave=function()local s=u and q.left or q.right s.BackgroundTransparency=0 end;Activated=function()b(true)end})if i.tag then s:AddTag(q.button,i.tag)end return q.button end)Y.left.BackgroundColor3=u and q.bg1 or q.primaryColor Y.right.BackgroundColor3=u and q.primaryColor or q.bg1 Y.corner.Parent=u and Y.right or Y.left local c={clicked=function()if N then b(false)return true end return false end}return c end)end
local CollectionService = game:GetService("CollectionService")

return function(Plasma)
	local create = Plasma.create

	return Plasma.widget(function(options)
		local style = Plasma.useStyle()

		options = options or {}
		local left = options.left
		local right = options.right
		local isRight = options.isRight

		local clicked, setClicked = Plasma.useState(false)
		local refs = Plasma.useInstance(function(ref)
			ref.corner = create("UICorner")

			local style = Plasma.useStyle()

			create("TextButton", {
				[ref] = "button",
				BackgroundTransparency = 1,
				Size = UDim2.new(1, 0, 0, 25),
				Text = "",

				create("UICorner"),

				create("UIListLayout", {
					FillDirection = Enum.FillDirection.Horizontal,
				}),

				create("TextLabel", {
					[ref] = "left",
					Text = left,
					Size = UDim2.new(0.5, 0, 1, 0),
					BackgroundColor3 = style.primaryColor,
					BorderSizePixel = 0,
					TextColor3 = style.textColor,
					Font = Enum.Font.GothamMedium,
					TextSize = 14,
				}),

				create("TextLabel", {
					[ref] = "right",
					Text = right,
					Size = UDim2.new(0.5, 0, 1, 0),
					BackgroundColor3 = style.bg1,
					BorderSizePixel = 0,
					TextColor3 = style.textColor,
					Font = Enum.Font.GothamMedium,
					TextSize = 14,
				}),

				MouseEnter = function()
					local other = isRight and ref.left or ref.right
					other.BackgroundTransparency = 0.5
				end,

				MouseLeave = function()
					local other = isRight and ref.left or ref.right
					other.BackgroundTransparency = 0
				end,

				Activated = function()
					setClicked(true)
				end,
			})

			if options.tag then
				CollectionService:AddTag(ref.button, options.tag)
			end

			return ref.button
		end)

		refs.left.BackgroundColor3 = isRight and style.bg1 or style.primaryColor
		refs.right.BackgroundColor3 = isRight and style.primaryColor or style.bg1

		refs.corner.Parent = isRight and refs.right or refs.left

		local handle = {
			clicked = function()
				if clicked then
					setClicked(false)
					return true
				end

				return false
			end,
		}

		return handle
	end)
end
