(function(){
var CN = 'menthorq_utm_params';
var LK = 'menthorq_utm_params';
var UK = ['utm_source','utm_medium','utm_campaign','utm_term','utm_content','utm_id'];
var CK = ['gclid','fbclid','msclkid','ttclid','twclid'];
var CD = 30;
var AK = UK.concat(CK);function sC(n,v,d){var e=new Date(Date.now()+d*864e5).toUTCString();var c=n+'='+encodeURIComponent(v)+';expires='+e+';path=/;SameSite=Lax';if(location.protocol==='https:')c+=';Secure';document.cookie=c;}
function gC(n){var m=document.cookie.match(new RegExp('(?:^|; )'+n+'=([^;]*)'));return m?decodeURIComponent(m[1]):'';}
function sv(d){var j=JSON.stringify(d);sC(CN,j,CD);try{localStorage.setItem(LK,j);}catch(e){}}
function hk(o){if(!o)return false;for(var i=0;i<AK.length;i++)if(o[AK[i]])return true;return false;}
function nm(d){if(!d)return null;if(d.first)return d;if(hk(d))return{first:d,last:d};return null;}
function ld(){var r=gC(CN);if(r){try{var n=nm(JSON.parse(r));if(n)return n;}catch(e){}}try{var s=localStorage.getItem(LK);if(s){var n=nm(JSON.parse(s));if(n)return n;}}catch(e){}return null;}
function mg(p,n){var o={};if(p)for(var k in p)o[k]=p[k];for(var k in n)o[k]=n[k];return o;}var ps = new URLSearchParams(window.location.search);
var fd = {}, has = false;
for (var i = 0; i < AK.length; i++) {
var v = ps.get(AK[i]);
if (v) { fd[AK[i]] = v; has = true; }
}// Click-ID synthesis: when only a click-id is present (no utm_source), derive
// utm_source/utm_medium so downstream analytics groups under the right channel.
var SY = {
gclid: ['google', 'cpc'],
fbclid: ['facebook', 'cpc'],
msclkid: ['bing', 'cpc'],
ttclid: ['tiktok', 'cpc'],
twclid: ['twitter', 'cpc']
};
if (has && !fd.utm_source) {
for (var sk in SY) {
if (fd[sk]) { fd.utm_source = SY[sk][0]; fd.utm_medium = SY[sk][1]; break; }
}
}if (has) {
fd.captured_at = new Date().toISOString();
var ex = ld();
// Last-touch: merge new fields ON TOP of previous last (preserva campi pregressi)
var newLast = ex && ex.last ? mg(ex.last, fd) : fd;
// First-touch: se ex.first ha almeno un UTM, e' completo e sticky.
// Se ex.first esiste ma e' click-id-only (orphan), completa con i campi nuovi.
// Se ex.first non esiste, usa fd come first.
var newFirst;
if (ex && ex.first) {
var firstHasUtm = false;
for (var i = 0; i < UK.length; i++) if (ex.first[UK[i]]) { firstHasUtm = true; break; }
newFirst = firstHasUtm ? ex.first : mg(ex.first, fd);
} else {
newFirst = fd;
}
sv({first: newFirst, last: newLast});
return;
}var raw = gC(CN);
if (raw) {
try {
var p = JSON.parse(raw);
if (!p.first && hk(p)) sv({first: p, last: p});
} catch(e) {}
return;
}try {
var s = localStorage.getItem(LK);
if (s) { var n = nm(JSON.parse(s)); if (n) sv(n); }
} catch(e) {}
})();
var breeze_prefetch = {"local_url":"https://menthorq.com","ignore_remote_prefetch":"1","ignore_list":["/account/","/login/","/thank-you/","/wp-json/openid-connect/userinfo","wp-admin","wp-login.php"]};
//# sourceURL=breeze-prefetch-js-extra
var menthorq_gtm = {"system":{"ajax_url":"https:\/\/menthorq.com\/wp-admin\/admin-ajax.php","nonce":"33bafe1685","site_url":"https:\/\/menthorq.com","home_url":"https:\/\/menthorq.com","timestamp":1784365345,"environment":"production"},"debug":{"enabled":false,"environment":"production"},"user":[],"container_id":"GTM-599ZCR89"};