//SUPERNATURISTA MX window.cybConvCount = 0; function checkConversionsCYB() { if (location.href.includes("thank-you") && document.getElementById('checkout-main').querySelectorAll('header p').length) { window.cybOrderData = { order_id: document.getElementById('checkout-main').querySelectorAll('header p')[0].textContent.split('N°')[1].trim(), value: convertMonetaryValue(document.querySelectorAll('div[role=table] strong')[0].textContent.trim(), false) }; let cybCurr = localStorage.getItem('cybCurr') || "MXN" window._vteq = window._vteq || []; window._vteq.push({ confirmation: { items: [], orderId: window.cybOrderData.order_id || Date.now(), total: window.cybOrderData.value || 1, generic: { currency: cybCurr } } }); } else if (document.querySelector(".os-order-number") && document.querySelector(".total-line--subtotal .order-summary__emphasis")) { window.cybOrderData = { order_id: document.querySelector(".os-order-number").textContent.split('N°')[1].trim(), value: convertMonetaryValue(document.querySelector(".total-line--subtotal .order-summary__emphasis").textContent.trim(), false) }; let cybCurr = localStorage.getItem('cybCurr') || "MXN" window._vteq = window._vteq || []; window._vteq.push({ confirmation: { items: [], orderId: window.cybOrderData.order_id || Date.now(), total: window.cybOrderData.value || 1, generic: { currency: cybCurr } } }); } else if (cybConvCount > 5) { window.cybOrderData = { order_id: document.querySelector(".os-order-number").textContent.split('N°')[1].trim(), value: 1 }; window._vteq.push({ confirmation: { items: [], orderId: window.cybOrderData.order_id || Date.now(), total: window.cybOrderData.value || 1, generic: { currency: cybCurr } } }); } else setTimeout(function () { cybConvCount++; checkConversionsCYB() }, 1e3); } window.location.href.toLowerCase().indexOf("/thank_you") >= 0 && checkConversionsCYB(); function convertMonetaryValue(n, comma = true) { n = n.replace(/[^0-9.,\s]/gi, '').trim(); if (n.length >= 3) { if (n.at(-3) == ',') { return n.replace(/[^0-9,]/gi, '').replace(',', '.'); } else if (n.at(-3) == '.' && n.match(/\s/gi)) { return n.replace(/[^0-9.]/gi, ''); } else if (n.at(-3) == '.' || !n.match(/(\.|,)/g)) { if (comma) { return n; } else { return n.replace(',', '') } } } else return n } try{ const cybfw = document.cookie.includes('cybbafwtest') ? '//cybba-latest-framework-minified-staging.s3.amazonaws.com/js-minified/cybba_latest_mini_v1.5.js' : '//d2rp1k1dldbai6.cloudfront.net/cybba_latest.min.js'; var shopUrlCYB = '2789' !function(){ var e=function(e){var t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=e;var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n)},t=~document.cookie.indexOf("cybbatest")?"files":"files1";e("https://"+t+".cybba.solutions/"+shopUrlCYB+"/loader.min.js"),e(cybfw),window._vteq=window._vteq||[],setTimeout(function(){window._vtsdk||e("https://files2.cybba.solutions/"+shopUrlCYB+"/loader.js?")},1100),setTimeout(function(){if("nestedVarDefined"in window&&!nestedVarDefined("_vtsdk.state.eventQueue")&&"_vtsdk"in window) _vtsdk.init();},1500) }() }catch(e){}