<?php
/**
 * My Account — address add/edit editor.
 *
 * Rendered once and reused for both creating and editing: the script fills it
 * from the card's data and posts it over AJAX.
 *
 * It is the same overlay used at checkout, on purpose. Opening the editor inline
 * below the list gave no feedback at all: on anything but a short page the panel
 * appeared off-screen and the button looked broken. An overlay is unmistakable,
 * and it keeps the two contexts behaving identically.
 *
 * The `woocommerce-address-fields` class is not cosmetic: WooCommerce's own
 * address styling hangs off it, and themes target it too.
 *
 * This template can be overridden by copying it to
 * yourtheme/vanquish-multiple-addresses/my-account/address-form.php
 *
 * @package Vanquish\MultipleAddresses
 * @var array $fields WooCommerce address fields keyed by plain name.
 */

use Vanquish\MultipleAddresses\Com\Template;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>

<div class="vanmuad-modal" data-vanmuad-modal hidden>
	<div class="vanmuad-modal__backdrop" data-vanmuad-cancel></div>

	<div class="vanmuad-modal__panel woocommerce-address-fields"
		role="dialog"
		aria-modal="true"
		data-vanmuad-form>

		<?php
		Template::render(
			'address-fields.php',
			array(
				'fields' => $fields,
			)
		);
		?>
	</div>
</div>
