ネズミだ、あれと出{で}くわすと厄介{やっかい}なんだ
I know that と could be used as a quotative particle or it could be used to make a conditional sentence. Particle と can also mean "and" or "with". In the sentence above, I think the first と means "with", but about the second と, I am not sure if it is conditional or quotative.
What are the meaning and grammatical role of particle と in this sentence?