1function hide(el) { 2 if (!el.hasAttribute('displayOld')) { 3 el.setAttribute("displayOld", el.style.display) 4 } 5 el.style.display = "none" 6 } 7 8 9function show(el) { 10 el = $(el) 11 if (el.hasClass('show_element')) 12 el.removeClass('show_element') 13 else 14 el.addClass("show_element") 15} 16 17const cookieConsentKey = 'accept-cookie' 18const analyticsScript = document.currentScript 19const yandexMetrikaId = Number(analyticsScript.dataset.yandexMetrikaId) 20 21function hasCookieConsent() { 22 try { 23 return localStorage.getItem(cookieConsentKey) === 'true' 24 } catch (error) { 25 return false 26 } 27} 28 29function loadYandexMetrika() { 30 if (!Number.isInteger(yandexMetrikaId) || yandexMetrikaId <= 0) 31 return 32 33 if (window[`yaCounter${yandexMetrikaId}`] || document.querySelector('script[data-yandex-metrika]')) 34 return 35 36 window.ym = window.ym || function() { 37 (window.ym.a = window.ym.a || []).push(arguments) 38 } 39 window.ym.l = window.ym.l || Date.now() 40 41 const metrikaScript = document.createElement('script') 42 metrikaScript.async = true 43 metrikaScript.src = 'https://mc.yandex.ru/metrika/tag.js' 44 metrikaScript.dataset.yandexMetrika = String(yandexMetrikaId) 45 document.head.appendChild(metrikaScript) 46 47 window.ym(yandexMetrikaId, 'init', { 48 clickmap: true, 49 trackLinks: true, 50 accurateTrackBounce: true, 51 webvisor: true, 52 }) 53} 54 55const cookieBanner = document.querySelector('.cookie-banner') 56const acceptCookieButton = document.querySelector('[data-cookie-accept]') 57 58if (hasCookieConsent()) { 59 if (cookieBanner) 60 cookieBanner.style.display = 'none' 61 loadYandexMetrika() 62} else if (cookieBanner) { 63 cookieBanner.style.display = '' 64} 65 66if (acceptCookieButton) { 67 acceptCookieButton.addEventListener('click', function() { 68 try { 69 localStorage.setItem(cookieConsentKey, 'true') 70 } catch (error) { 71 // Consent still applies to the current page when storage is unavailable. 72 } 73 74 if (cookieBanner) 75 $(cookieBanner).fadeOut() 76 loadYandexMetrika() 77 }) 78}
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.