Hydrangea

Got this potted plant as a gift a week ago, the petals / flowers are withering away or drying up , located in front of a big window.how do I keep it blooming and save the plant?…