<?php if ( $this->is_masked( $part ) ) : ?>
	<div class="happyforms-part--phone__country-select happyforms-country-select<?php if ( happyforms_phone_allow_multiple_conventions( $part ) ) { ?> happyforms-country-select--multiple<?php } ?>">
		<div class="happyforms-country-select__selected-country">
			<a href="#" class="happyforms-country-select-trigger"></a>
			<?php
			$countries = happyforms_get_phone_countries();
			$current_country = 0;

			foreach ( $countries as $code => $country ) {
				if ( strtolower( $country_value ) === strtolower( $code ) ) {
					$current_country = $country;
				}
			}
			?>
			<div class="happyforms-flag"><?php echo $current_country['flag']; ?> <span>+<?php echo $current_country['code']; ?></span></div>
		</div>
		<?php if ( happyforms_phone_allow_multiple_conventions( $part ) ) { ?>
			<ul class="happyforms-custom-select-dropdown phone">
				<?php foreach( $countries as $key => $country ) { ?>
				<li tabindex="0" class="happyforms-custom-select-dropdown__item happyforms-custom-select-dropdown-item" data-country="<?php echo strtolower( $key ); ?>" data-search-string="<?php echo strtolower( $country['name'] ); ?>" data-code="<?php echo $country['code']; ?>">
					<div class="happyforms-flag <?php echo strtolower( $key ); ?>"><?php echo $country['flag']; ?></div>
					<span class="happyforms-custom-select-dropdown-item__label happyforms-custom-select-dropdown-item__label--country"><?php echo ucwords( strtolower( $country['name'] ) ); ?></span>
					<span class="happyforms-custom-select-dropdown-item__label happyforms-custom-select-dropdown-item__label--country-code">+<?php echo $country['code']; ?></span>
				</li>
				<?php } ?>
			</ul>
		<?php } ?>
	</div>
<?php endif; ?>
