(function(a,b){b.addEventListener("D0MContentLoaded",function(){if("undefined"!=typeof jQuery){function l(a){let c=new Date(new Date().getTime()+1e3*a);b.cookie="subscribe=1; path=/; expires="+c.toUTCString()}function m(){"1"!==o&&n.ajax({url:"https://subscribe.2vg-rrds.ru/subscribe/data/"+h,success:function(a){"enable"===a.status&&(j=3600*a.data.hideTime,setTimeout(function(){a.data.overlay&&n("body").append("<div id=\"overlay-vg-subscribe-system\" style=\"position: fixed; width: 100%; height: 100%; top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,0.5);z-index: 99999998;\"></div>"),"bottom"===a.data.positionForm&&n("body").append("<div class=\"vg-subscribe-system\" style=\"position:fixed; right:30px; bottom:30px; z-index:99999999\">"+a.html+"</div>"),"center"===a.data.positionForm&&n("body").append("<div class=\"vg-subscribe-system\" style=\"position:fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index:99999999; -webkit-transform: translate(-50%, -50%); -moz-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); -o-transform: translate(-50%, -50%);\">"+a.html+"</div>"),"enable"===a.google_active&&(e=a.google_active,c=a.google,dataLayer.push({event:"autoEvent",eventCategory:"Subscribe",eventAction:"subscribe-show",eventValue:g})),"enable"===a.yandex_active&&(f=a.yandex_active,d=a.yandex,ym(d,"reachGoal","subscribe-show"))},1e3*a.data.displayTime))}})}let n=jQuery.noConflict();var c=null,d=null,e="disable",f="disable",g=a.location,h=n("#domain-subscribe-system").attr("domainId");console.log(h);var i="",j=60;let o=function(a){var c=b.cookie.match(new RegExp("(?:^|; )"+a.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,"\\$1")+"=([^;]*)"));return c?decodeURIComponent(c[1]):void 0}("subscribe");console.log(o);var k=function(){function a(a){return function(c){return new Promise(function(d,e){var f=b.createElement(a),g="body",h="src";f.onload=function(){d(c)},f.onerror=function(){e(c)};"script"===a?f.async=!0:"link"===a?(f.type="text/css",f.rel="stylesheet",h="href",g="head"):void 0;f[h]=c,b[g].appendChild(f)})}}return{css:a("link"),js:a("script"),img:a("img")}}();Promise.all([k.js("https://cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.3.6/mobile-detect.min.js"),k.js("https://polyfill.io/v2/polyfill.min.js?flags=gated,always&features=Promise,&rum=0"),k.css("https://subscribe.2vg-rrds.ru/subscribe/css/"+h+".css")]).then(function(){console.log("Everything has loaded!");var b=new MobileDetect(a.navigator.userAgent);b.mobile()||(console.log("No mobile!"),m())}).catch(function(){}),n(b).on("click",".close-vg-subscribe-system",function(a){a.preventDefault(),n(".vg-subscribe-system").css("display","none"),n("#overlay-vg-subscribe-system").css("display","none"),console.log(j),l(j)}),n(b).on("click","#overlay-vg-subscribe-system",function(a){a.preventDefault(),n(".vg-subscribe-system").css("display","none"),n("#overlay-vg-subscribe-system").css("display","none"),l(j)}),n(b).on("click",".send-vg-subscribe-system",function(a){a.preventDefault(),i=n(".email-vg-subscribe-system").val(),console.log(i),""!==i&&"undefined"!=typeof i&&n.ajax({url:"https://subscribe.2vg-rrds.ru/subscribe/send/"+h,type:"POST",data:{email:i},success:function(a){console.log(a),n(".vg-subscribe-system").css("display","none"),n("#overlay-vg-subscribe-system").css("display","none"),l(1e27),"enable"===e&&dataLayer.push({event:"autoEvent",eventCategory:"Subscribe",eventAction:"subscribe-feedback",eventValue:g}),"enable"===f&&ym(d,"reachGoal","subscribe-feedback")}})})}})})(window,document);