<?php
/**
 * Checkout — address add/edit editor.
 *
 * Rendered AFTER WooCommerce's checkout form (never inside it): it carries form
 * fields, and nesting them in the checkout form would both be invalid HTML and
 * post them along with the order.
 *
 * There is one editor for the whole page, not one per checkout form: an address
 * is not tied to a purpose, so a second copy would only duplicate every field id.
 * The script remembers which selector opened it.
 *
 * This template can be overridden by copying it to
 * yourtheme/vanquish-multiple-addresses/checkout/address-editor.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-editor 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>

		<div class="vanmuad-notice" data-vanmuad-notice hidden></div>

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