1(function(){ 2 if (!window.F152 || !F152.metrika || !F152.metrika.id) { 3 return; 4 } 5 6 var id = String(F152.metrika.id); 7 if (!id) { 8 return; 9 } 10 11 function readCookie(name) { 12 var pattern = new RegExp('(?:^|; )' + name.replace(/([.$?*|{}()\[\]\\/+^])/g, '\\$1') + '=([^;]*)'); 13 var match = document.cookie.match(pattern); 14 return match ? decodeURIComponent(match[1]) : null; 15 } 16 17 function parseConsent() { 18 try { 19 var raw = readCookie('f152_consent'); 20 if (!raw) { 21 return null; 22 } 23 24 var obj = JSON.parse(raw); 25 return obj && typeof obj === 'object' ? obj : null; 26 } catch (e) { 27 return null; 28 } 29 } 30 31 function analyticsAllowed(consent) { 32 consent = consent || parseConsent(); 33 if (!consent) { 34 return true; 35 } 36 37 if (Object.prototype.hasOwnProperty.call(consent, 'analytics') && consent.analytics === false) { 38 return false; 39 } 40 41 return true; 42 } 43 44 var mode = (F152.metrika && F152.metrika.mode) || 'always'; 45 var consent = parseConsent(); 46 47 if (mode === 'require_accept') { 48 if (!consent) { 49 return; 50 } 51 52 if (!analyticsAllowed(consent)) { 53 return; 54 } 55 } else if (mode === 'disable_on_reject') { 56 if (!analyticsAllowed(consent)) { 57 return; 58 } 59 } 60 61 var scriptUrl = 'https://mc.yandex.ru/metrika/tag.js?id=' + id; 62 63 (function(m,e,t,rurl,i,k,a){ 64 m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)}; 65 m[i].l=1*new Date(); 66 67 var scr = e.getElementsByTagName('script'); 68 for (var j = 0; j < scr.length; j++) { 69 if (scr[j].src === rurl) { 70 break; 71 } 72 } 73 if (j === scr.length) { 74 k=e.createElement(t); 75 a=e.getElementsByTagName(t)[0]; 76 k.async=1; 77 k.src=rurl; 78 a.parentNode.insertBefore(k,a); 79 } 80 })(window, document, 'script', scriptUrl, 'ym'); 81 82 try { 83 window.ym(parseInt(id, 10), 'init', { 84 ssr: true, 85 webvisor: true, 86 clickmap: true, 87 ecommerce: 'dataLayer', 88 accurateTrackBounce: true, 89 trackLinks: true 90 }); 91 } catch (e) {} 92})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.