I have been tasked with rewiring several trailers at work...
The first problem is that no two are wired the same, the second problem is that the trucks are not wired the same either.
The best bet will be to figure out how your truck is wired. Then use a battery to energize the circuits on your trailer one at a time to figure out what is what, then wire your pigtail accordingly.
One thing I have learned is to use a junction box at the head of the trailer, that way when the pigtail gets damaged again, and it will, it is much easier to rewire. The other thing I do is take a picture of the correctly wired junction box, then laminate it and put it inside. Saves a lot of time.
As a general rule, the blue wire is brakes, the heavy red wire is power feed, white is almost always the ground. Other than that it is a crap shoot.
Aaron