} document.addEventListener('click', function (event) { var link = event.target.closest('a'); if (!link) return; var href = (link.getAttribute('href') || '').trim(); var text = (link.textContent || '').trim().replace(/\s+/g, ' ').slice(0, 120); if (/^mailto:/i.test(href)) { dataEvent('qunyi_email_click', { link_url: href, link_text: text }); return; } if (/wa\.me|api\.whatsapp\.com|whatsapp:/i.test(href)) { dataEvent('qunyi_whatsapp_click', { link_url: href, link_text: text }); return; } if (/\/contact-us\/?(?:[?#].*)?$/i.test(href) || /request a quote|contact us|get a quote|send inquiry/i.test(text)) { dataEvent('qunyi_contact_click', { link_url: href, link_text: text }); } }, true); if (window.jQuery) { window.jQuery(document).on('submit_success', function (event) { var form = event && event.target; fireLeadConversion(form && form.getAttribute ? form.getAttribute('name') : ''); }); } function checkSuccess(node) { if (!node || node.nodeType !== 1) return; if (node.matches('.elementor-message-success') || node.querySelector('.elementor-message-success')) { var form = node.closest('form'); fireLeadConversion(form ? form.getAttribute('name') : ''); } } new MutationObserver(function (mutations) { mutations.forEach(function (mutation) { mutation.addedNodes.forEach(checkSuccess); }); }).observe(document.documentElement, { childList: true, subtree: true }); })();