(function() {
                    var form = document.querySelector('.nexdirectory-demo-import-form');
                    var overlay = document.getElementById('nexdirectory-demo-import-loading');
                    if (!form || !overlay) {
                        return;
                    }
                    form.addEventListener('submit', function(event) {
                        var confirmedInput = form.querySelector('input[name="nexdirectory_demo_import_confirmed"]');
                        if (!confirmedInput || confirmedInput.value !== '1') {
                            event.preventDefault();
                            if (!window.confirm('This will import sample listings, images, taxonomy terms, and optional demo settings into this WordPress site. Continue with the demo import?')) {
                                if (confirmedInput) {
                                    confirmedInput.value = '0';
                                }
                                overlay.classList.remove('is-visible');
                                overlay.setAttribute('aria-hidden', 'true');
                                return;
                            }
                            if (confirmedInput) {
                                confirmedInput.value = '1';
                            }
                            overlay.classList.add('is-visible');
                            overlay.setAttribute('aria-hidden', 'false');
                            HTMLFormElement.prototype.submit.call(form);
                            return;
                        }
                        overlay.classList.add('is-visible');
                        overlay.setAttribute('aria-hidden', 'false');
                    });
                })();
