<?php
/**
 * Hyvä Themes - https://hyva.io
 * Copyright © Hyvä Themes. All rights reserved.
 * See COPYING.txt for license details.
 */

declare(strict_types=1);

use Hyva\Theme\Model\ViewModelRegistry;
use Hyva\Theme\ViewModel\HyvaCsp;
use Magento\Framework\Escaper;
use Magento\Framework\View\Element\Template;

/** @var Template $block */
/** @var Escaper $escaper */
/** @var HyvaCsp $hyvaCsp */
/** @var ViewModelRegistry $viewModels */

/*
 * The dummy touchstart event listener prevents mobile safari from requiring a double tap to select swatches, buttons and links.
 *
 * The safari bug is triggered by the window.touchstart listener declared in Hyva_Theme::page/js/init-external-scripts.phtml.
 * an alternative to this workaround is removing the touchstart from the events there, but that may inhibit the intended
 * functionality of the init-external-scripts event.
 */

?>
<script>
    document.body.addEventListener('touchstart', () => {}, {passive: true})
</script>
<?php $hyvaCsp->registerInlineScript() ?>
