<script>
    document.addEventListener('DOMContentLoaded', function() {
        const form = document.getElementById('hmb-hero-newsletter');
        const msg = document.getElementById('hmb-hero-msg');

        if (form) {
            form.addEventListener('submit', function(e) {
                e.preventDefault();
                const email = form.querySelector('input[name="email"]').value;
                const btn = form.querySelector('button');

                btn.disabled = true;
                btn.innerText = 'Subscribing...';
                msg.innerText = '';
                msg.className = 'hmb-hero__message';

                const formData = new FormData();
                formData.append('action', 'hmb_newsletter_signup');
                formData.append('email', email);

                fetch(hmb_ajax_url, {
                    method: 'POST',
                    body: formData
                })
                .then(res => res.json())
                .then(data => {
                    if (data.success) {
                        msg.innerText = data.data;
                        msg.classList.add('is-success');
                        form.reset();
                    } else {
                        msg.innerText = data.data;
                        msg.classList.add('is-error');
                    }
                })
                .catch(err => {
                    msg.innerText = 'Something went wrong. Please try again.';
                    msg.classList.add('is-error');
                })
                .finally(() => {
                    btn.disabled = false;
                    btn.innerText = 'Join the Newsletter';
                });
            });
        }
    });
    </script>
    <?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="https://travelwithhamid.com/wp-sitemap-index.xsl" ?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>https://travelwithhamid.com/wp-sitemap-posts-post-1.xml</loc></sitemap><sitemap><loc>https://travelwithhamid.com/wp-sitemap-posts-page-1.xml</loc></sitemap><sitemap><loc>https://travelwithhamid.com/wp-sitemap-posts-article-1.xml</loc></sitemap><sitemap><loc>https://travelwithhamid.com/wp-sitemap-posts-hamid_question-1.xml</loc></sitemap><sitemap><loc>https://travelwithhamid.com/wp-sitemap-posts-hamid_scam_report-1.xml</loc></sitemap><sitemap><loc>https://travelwithhamid.com/wp-sitemap-taxonomies-category-1.xml</loc></sitemap><sitemap><loc>https://travelwithhamid.com/wp-sitemap-users-1.xml</loc></sitemap></sitemapindex>
