BERLIN — After 18 years under the leadership of Chancellor Angela Merkel, delegates of Germany’s conservative party, the Christian Democratic Union, plan to gather in Hamburg on Friday to elect a new leader who will shape the future of the party and the country, where it remains the strongest political force.

Over the past month, the three main candidates have crisscrossed Germany, presenting themselves and their visions for the party to eight lively regional conferences so crowded that they often had to be moved to larger venues. Some 14,000 members attended, while the events were streamed live to an additional 200,000 people.

[No one has shaped Europe more than Ms. Merkel, but her legacy is fragile.]

It was an unusually transparent and democratic process for a party that has historically chosen its leaders in back-room deals, with the delegates’ vote rendered little more than a formality by one-candidate ballots. And it comes at a time when the Christian Democrats are struggling to retain their status as Germany’s main big-tent party.

Who is running?

Three leading candidates made the rounds at the regional conferences, but recent polling has showed a close contest between two of them, Annegret Kramp-Karrenbauer and Friedrich Merz. Each represents a different vision for a party seeking to reaffirm its conservative credentials and win back voters who defected to the left and the far-right in last year’s inconclusive parliamentary elections.