You tell her that you love her. NO matter what. You reassure her that you will not abandon her and that she has choices. That she can be honest with you and that you will get through this together. Let her know that this does not change you wanting the best possible life for her, and then you help her achieve that.
you ask her how did this happen you tell her about how protecting yourself is important and once she has her baby you should make her a doctors appointment for birth control and have someone talk to her about the safety and stuff she can do to protect herself and you just be supportive of her and tell her that as i am your mother you half to be the same to your daughter and take all responsibilites as a parent and grow from this and learn from this .