function init(z)local c=z.Button local I=z.ListFrame local function u()local z=c.AbsoluteSize local I=z.y/z.x c.Arrow.Size=UDim2.new(I,0,1,0)c.Option.Size=UDim2.new(1-I,-12,1,0)end u()z._Maid:Mark((c:GetPropertyChangedSignal("\065\098\115\111\108\117\116\101\083\105\122\101")):Connect(u))for c,I in next,I.ScrollFrame:GetChildren()do z._Options[c]=I I.Activated:Connect(function()z:Set(I)end)end z._Maid:Mark(c.Activated:Connect(function()z:Show(not I.Visible)end))z._Maid:Mark(UIS.InputBegan:Connect(function(u)if VALID_PRESS[u.UserInputType]then local F=u.Position local P=Vector2.new(F.x,F.y)if I.Visible and not(isInFrame(I,P)or isInFrame(c,P))then z:Show(false)end end end))end function isInFrame(z,c)local I=z.AbsolutePosition local u=z.AbsoluteSize local F=c-I return F.x>=0 and(F.x<=u.x and(F.y>=0 and F.y<=u.y))end
-- Private Methods

function init(self)
	local button = self.Button
	local listFrame = self.ListFrame

	local function contentSizeUpdate()
		local absSize = button.AbsoluteSize
		local ratio = absSize.y / absSize.x

		button.Arrow.Size = UDim2.new(ratio, 0, 1, 0)
		button.Option.Size = UDim2.new(1 - ratio, -12, 1, 0)
	end

	contentSizeUpdate()
	self._Maid:Mark(button:GetPropertyChangedSignal("AbsoluteSize"):Connect(contentSizeUpdate))

	for i, optionButton in next, listFrame.ScrollFrame:GetChildren() do
		self._Options[i] = optionButton
		optionButton.Activated:Connect(function()
			self:Set(optionButton)
		end)
	end

	self._Maid:Mark(button.Activated:Connect(function()
		self:Show(not listFrame.Visible)
	end))

	self._Maid:Mark(UIS.InputBegan:Connect(function(input)
		if VALID_PRESS[input.UserInputType] then
			local p = input.Position
			local p2 = Vector2.new(p.x, p.y)

			if listFrame.Visible and not (isInFrame(listFrame, p2) or isInFrame(button, p2)) then
				self:Show(false)
			end
		end
	end))
end

function isInFrame(frame, pos)
	local fPos = frame.AbsolutePosition
	local fSize = frame.AbsoluteSize
	local d = pos - fPos
	return (d.x >= 0 and d.x <= fSize.x and d.y >= 0 and d.y <= fSize.y)
end
