“Betrayal. That’s the first thing I feel, which is ludicrous. For there to be betrayal, there would have had to been trust first.”, The Hunger Games
I'm confused about "... would have had to been trust first." What kind of structure is this? Why is there a third form of a verb in a to-infinitive?