-- Decompiled with the Synapse X Luau decompiler.


local function u1(p1, p2, p3)
	local v1 = p3.X * p3.Y;
	local l__ImageRectSize__2 = p1.ImageRectSize;
	p2 = math.clamp(p2, 1, v1);
	local v3 = math.ceil(p2 / v1 * p3.Y);
	p1.ImageRectOffset = Vector2.new(l__ImageRectSize__2.X * (-1 + (p2 - p3.X * (v3 - 1))), l__ImageRectSize__2.Y * (-1 + v3));
end;
local l__RunService__2 = game:GetService("RunService");
return function(p4, p5, p6, p7, p8, p9)
	local v4 = Vector2.new(p5, p6);
	local v5 = tick();
	u1(p4, p5 * p6, v4);
	p4.Visible = true;
	local u3 = v5;
	local u4 = p7 and 60;
	local u5 = 0;
	local u6 = v4.X * v4.Y;
	local u7 = p8;
	task.defer(function()
		while p4 and p4.Parent do
			if 1 / u4 <= tick() - u3 then
				u3 = tick();
				u5 = u5 + 1;
				if u6 < u5 then
					u5 = 0;
					if not u7 then
						if p9 then
							p9();
							return;
						else
							break;
						end;
					end;
				end;
				u1(p4, u5, v4);
			end;
			l__RunService__2.RenderStepped:Wait();		
		end;
	end);
	return function()
		u7 = false;
	end;
end;
