Not long ago, Angela Merkel's dominant position in Germany and her status as the most influential leader in Europe seemed secure.