Your IP : 3.145.71.235


Current Path : /home/bitrix/ext_www/teplo.home-comfort.in.ua/conv_files/
Upload File :
Current File : /home/bitrix/ext_www/teplo.home-comfort.in.ua/conv_files/getcall_utf-8.js

!function(e){var t=!1;if("function"==typeof define&&define.amd,!t){var n=window.bgcCookies,i=window.bgcCookies=e();i.noConflict=function(){return window.bgcCookies=n,i}}}(function(){function v(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var i in n)t[i]=n[i]}return t}return function e(p){function f(e,t,n){var i;if("undefined"!=typeof document){if(1<arguments.length){if("number"==typeof(n=v({path:"/"},f.defaults,n)).expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*n.expires),n.expires=s}n.expires=n.expires?n.expires.toUTCString():"";try{i=JSON.stringify(t),/^[\{\[]/.test(i)&&(t=i)}catch(e){}t=p.write?p.write(t,e):encodeURIComponent(String(t)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=(e=(e=encodeURIComponent(String(e))).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent)).replace(/[\(\)]/g,escape);var o="";for(var l in n)n[l]&&(o+="; "+l,!0!==n[l]&&(o+="="+n[l]));return document.cookie=e+"="+t+o}e||(i={});for(var a=document.cookie?document.cookie.split("; "):[],c=/(%[0-9A-Z]{2})+/g,r=0;r<a.length;r++){var d=a[r].split("="),g=d.slice(1).join("=");'"'===g.charAt(0)&&(g=g.slice(1,-1));try{var u=d[0].replace(c,decodeURIComponent);if(g=p.read?p.read(g,u):p(g,u)||g.replace(c,decodeURIComponent),this.json)try{g=JSON.parse(g)}catch(e){}if(e===u){i=g;break}e||(i[u]=g)}catch(e){}}return i}}return(f.set=f).get=function(e){return f.call(f,e)},f.getJSON=function(){return f.apply({json:!0},[].slice.call(arguments))},f.defaults={},f.remove=function(e,t){f(e,"",v(t,{expires:-1}))},f.withConverter=e,f}(function(){})}),function(d,w,s){var bgcConfig;for(var index in function(e){"use strict";var n=-1,o={onVisible:function(n){var e=o.isSupported();if(!e||!o.hidden())return n(),e;var i=o.change(function(e,t){o.hidden()||(o.unbind(i),n())});return i},change:function(e){if(!o.isSupported())return!1;var t=n+=1;return o._callbacks[t]=e,o._listen(),t},unbind:function(e){delete o._callbacks[e]},afterPrerendering:function(n){var e=o.isSupported(),i="prerender";if(!e||i!=o.state())return n(),e;var s=o.change(function(e,t){i!=t&&(o.unbind(s),n())});return s},hidden:function(){return!(!o._doc.hidden&&!o._doc.webkitHidden)},state:function(){return o._doc.visibilityState||o._doc.webkitVisibilityState||"visible"},isSupported:function(){return!(!o._doc.visibilityState&&!o._doc.webkitVisibilityState)},_doc:document||{},_callbacks:{},_change:function(e){var t=o.state();for(var n in o._callbacks)o._callbacks[n].call(o._doc,e,t)},_listen:function(){if(!o._init){var e="visibilitychange";o._doc.webkitVisibilityState&&(e="webkit"+e);var t=function(){o._change.apply(o,arguments)};o._doc.addEventListener?o._doc.addEventListener(e,t):o._doc.attachEvent(e,t),o._init=!0}}};"undefined"!=typeof module&&module.exports,e.bgcVisibility=o}(this),function(a){"use strict";var s=-1,e=function(l){return l.every=function(e,t,n){l._time(),n||(n=t,t=null);var i=s+=1;return l._timers[i]={visible:e,hidden:t,callback:n},l._run(i,!1),l.isSupported()&&l._listen(),i},l.stop=function(e){return!!l._timers[e]&&(l._stop(e),delete l._timers[e],!0)},l._timers={},l._time=function(){l._timed||(l._timed=!0,l._wasHidden=l.hidden(),l.change(function(){l._stopRun(),l._wasHidden=l.hidden()}))},l._run=function(e,t){var n,i=l._timers[e];if(l.hidden()){if(null===i.hidden)return;n=i.hidden}else n=i.visible;var s=function(){i.last=new Date,i.callback.call(a)};if(t){var o=new Date-i.last;o<n?i.delay=setTimeout(function(){s(),i.id=setInterval(s,n)},n-o):(s(),i.id=setInterval(s,n))}else i.id=setInterval(s,n)},l._stop=function(e){var t=l._timers[e];clearInterval(t.id),clearTimeout(t.delay),delete t.id,delete t.delay},l._stopRun=function(e){var t=l.hidden(),n=l._wasHidden;if(t&&!n||!t&&n)for(var i in l._timers)l._stop(i),l._run(i,!t)},l};"undefined"!=typeof module&&module.exports,e(a.bgcVisibility)}(window),function(e){function b(){var e=arguments[0],t=b.cache;return t[e]&&t.hasOwnProperty(e)||(t[e]=b.parse(e)),b.format.call(null,t[e],arguments)}function h(e){return"number"==typeof e?"number":"string"==typeof e?"string":Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}var y={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/bcdiefguxX/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};b.format=function(e,t){var n,i,s,o,l,a,c,r,d,g=1,u=e.length,p="",f=[],v=!0,m="";for(i=0;i<u;i++)if("string"===(p=h(e[i])))f[f.length]=e[i];else if("array"===p){if((o=e[i])[2])for(n=t[g],s=0;s<o[2].length;s++){if(!n.hasOwnProperty(o[2][s]))throw new Error(b('[sprintf] property "%s" does not exist',o[2][s]));n=n[o[2][s]]}else n=o[1]?t[o[1]]:t[g++];if(y.not_type.test(o[8])&&y.not_primitive.test(o[8])&&"function"==h(n)&&(n=n()),y.numeric_arg.test(o[8])&&"number"!=h(n)&&isNaN(n))throw new TypeError(b("[sprintf] expecting number but found %s",h(n)));switch(y.number.test(o[8])&&(v=0<=n),o[8]){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,o[6]?parseInt(o[6]):0);break;case"e":n=o[7]?parseFloat(n).toExponential(o[7]):parseFloat(n).toExponential();break;case"f":n=o[7]?parseFloat(n).toFixed(o[7]):parseFloat(n);break;case"g":n=o[7]?parseFloat(n).toPrecision(o[7]):parseFloat(n);break;case"o":n=n.toString(8);break;case"s":n=String(n),n=o[7]?n.substring(0,o[7]):n;break;case"t":n=String(!!n),n=o[7]?n.substring(0,o[7]):n;break;case"T":n=h(n),n=o[7]?n.substring(0,o[7]):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=o[7]?n.substring(0,o[7]):n;break;case"x":n=parseInt(n,10).toString(16);break;case"X":n=parseInt(n,10).toString(16).toUpperCase()}y.json.test(o[8])?f[f.length]=n:(!y.number.test(o[8])||v&&!o[3]?m="":(m=v?"+":"-",n=n.toString().replace(y.sign,"")),a=o[4]?"0"===o[4]?"0":o[4].charAt(1):" ",c=o[6]-(m+n).length,l=o[6]&&0<c?(r=a,0<=(d=c)&&d<=7&&w[r]?w[r][d]:Array(d+1).join(r)):"",f[f.length]=o[5]?m+n+l:"0"===a?m+l+n:l+m+n)}return f.join("")},b.cache={},b.parse=function(e){for(var t=e,n=[],i=[],s=0;t;){if(null!==(n=y.text.exec(t)))i[i.length]=n[0];else if(null!==(n=y.modulo.exec(t)))i[i.length]="%";else{if(null===(n=y.placeholder.exec(t)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){s|=1;var o=[],l=n[2],a=[];if(null===(a=y.key.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o[o.length]=a[1];""!==(l=l.substring(a[0].length));)if(null!==(a=y.key_access.exec(l)))o[o.length]=a[1];else{if(null===(a=y.index_access.exec(l)))throw new SyntaxError("[sprintf] failed to parse named argument key");o[o.length]=a[1]}n[2]=o}else s|=2;if(3===s)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i[i.length]=n}t=t.substring(n[0].length)}return i};var t=function(e,t,n){return(n=(t||[]).slice(0)).splice(0,0,e),b.apply(null,n)},w={0:["","0","00","000","0000","00000","000000","0000000"]," ":[""," ","  ","   ","    ","     ","      ","       "],_:["","_","__","___","____","_____","______","_______"]};e.sprintf=b,e.vsprintf=t,"function"==typeof define&&define.amd}("undefined"==typeof window?this:window),w.BinotelGetCall)if(!1===w.BinotelGetCall[index].initState){w.BinotelGetCall[index].initState="processing",bgcConfig=w.BinotelGetCall[index];break}if(bgcConfig){if(bgcConfig.debugMode&&console.log("Binotel Get Call in processing!!! Widget initiator is %s",bgcConfig.widgetId),w.BinotelGetCallSettings&&(void 0!==w.BinotelGetCallSettings.language&&(bgcConfig.language=w.BinotelGetCallSettings.language),void 0!==w.BinotelGetCallSettings.activeFormStatus&&(bgcConfig.activeFormStatus=w.BinotelGetCallSettings.activeFormStatus),void 0!==w.BinotelGetCallSettings.phoneButtonDisplay&&(bgcConfig.phoneButtonDisplay=w.BinotelGetCallSettings.phoneButtonDisplay),w.BinotelGetCallSettings.onReady&&"function"==typeof w.BinotelGetCallSettings.onReady&&(bgcConfig.onReady=w.BinotelGetCallSettings.onReady)),bgcConfig.customI18nDictionary)try{bgcConfig.customI18nDictionary=JSON.parse(bgcConfig.customI18nDictionary)}catch(e){console.log(e)}var bgc;setTimeout(function(){bgc=new BinotelGetCall,bgcConfig.openPassiveForm=bgc.openPassiveForm,bgcConfig.listeners=bgc.listeners,bgc.init()},100);var BinotelGetCall=function(){var self={helpers:{listeners:emitter()},requestForCallInProgress:!1,countdownTimerIntervalLink:null,timerForShowAndHideTooltip:null,cookies:w.bgcCookies.noConflict(),activityData:{pageviews:1,callWasMade:0,onPage:0,activeFormAdder:0,phoneButtonTooltipTimeoutOnFirstDisplay:65,phoneButtonTooltipTimeoutOnSecondDisplay:0,phoneButtonTooltipTimeoutAdderOnSecondDisplay:115,phoneButtonTooltipStage:0,phoneButtonTooltipDisplayingTime:0,phoneButtonTooltipAdder:0},timers:{rotatePhoneButtonTimer:null},workingDays:[],gaObject:null};return this.init=function(){self.helpers.init(),bgcConfig.onReady&&bgcConfig.onReady(bgcConfig.widgetId),setInterval(function(){self.helpers.setClientSideTimeOffset(!0)},18e5)},this.listeners=self.helpers.listeners,this.openPassiveForm=function(e,t){self.helpers.openPassiveForm(e,t)},self.helpers.init=function(){bgcConfig.clientSideTimezoneOffset=60*(new Date).getTimezoneOffset();var e=self.helpers.getModeOfWorkingHours();if("alwaysOffline"!==e||"1"!==bgcConfig.switchedOffInOffline){var t=d.createElement("div");t.className="bingc-passive bingc-passive-closed bingc-language-"+bgcConfig.language,t.id="bingc-passive",t.innerHTML=' \t\t\t\t<div class="bingc-passive-overlay"> \t\t\t\t\t<a class="bingc-passive-close-button" id="bingc-passive-close-button" href="javascript:void(0);" rel="nofollow noopener"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"><polygon fill="#FFFFFF" points="24,0.993 22.985,-0.024 12,10.983 1.015,-0.024 0,0.993 10.985,12 0,23.008 1.015,24.023 12,13.017 22.985,24.023 24,23.008 13.015,12 "/></svg></a> \t\t\t\t\t<div class="bingc-passive-content" id="bingc-passive-content"></div> \t\t\t\t\t<a href="javascript:void(0);" rel="nofollow noopener" class="bingc-powered-by" id="bingc-powered-by-passive-overlay"><span class="bingc-powered-by-text">'+self.helpers.i18n("Виртуальная АТС")+'</span></a> \t\t\t\t</div> \t\t\t\t<div class="bingc-passive-background" id="bingc-passive-background"></div> \t\t\t\t\t\t\t\t\t';var n=d.createElement("div");n.className="bingc-active bingc-active-closed bingc-language-"+bgcConfig.language,n.id="bingc-active",n.innerHTML=' \t\t\t\t<div class="bingc-active-overlay"> \t\t\t\t\t<div class="bingc-active-content" id="bingc-active-content"></div> \t\t\t\t</div> \t\t\t\t<a class="bingc-active-close-button" id="bingc-active-close-button" href="javascript:void(0);" rel="nofollow noopener"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 24 24" enable-background="new 0 0 24 24" xml:space="preserve"><polygon points="24,0.993 22.985,-0.024 12,10.983 1.015,-0.024 0,0.993 10.985,12 0,23.008 1.015,24.023 12,13.017 22.985,24.023 24,23.008 13.015,12 "/></svg></a> \t\t\t\t<a href="javascript:void(0);" rel="nofollow noopener" class="bingc-powered-by" id="bingc-powered-by-active-overlay"><span class="bingc-powered-by-text">'+self.helpers.i18n("Виртуальная АТС")+"</span></a> \t\t\t\t\t\t\t\t\t";var i,s,o=d.createElement("a");o.className="bingc-phone-button bingc-language-"+bgcConfig.language,o.id="bingc-phone-button",o.style[bgcConfig.phoneButtonPositionInVertical.property]=bgcConfig.phoneButtonPositionInVertical.value+"%",o.style[bgcConfig.phoneButtonPositionInHorizontal.property]=bgcConfig.phoneButtonPositionInHorizontal.value+"%",1===bgcConfig.phoneButtonDisplay&&o.classList.add("bingc-show"),"alwaysOnline"===e?i=sprintf(self.helpers.i18n("Хотите, перезвоним Вам<br>за %s секунд?"),bgcConfig.countdownTimerForCall):"alwaysOffline"===e&&(i=self.helpers.i18n("Хотите, перезвоним Вам<br>в удобное время?")),"top"===bgcConfig.phoneButtonPositionInVertical.property&&"left"===bgcConfig.phoneButtonPositionInHorizontal.property?s='\t\t\t\t\t<div id="bingc-phone-button-tooltip" class="bingc-phone-button-tooltip bingc-phone-button-tooltip-top-left"> \t\t\t\t\t\t'+i+' \t\t\t\t\t\t<svg version="1.1" class="bingc-phone-button-arrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 14" enable-background="new 0 0 18 14" xml:space="preserve"><polyline fill="#B3B3B3" points="0,14 18,14 0,0 "/></svg> \t\t\t\t\t</div> \t\t\t\t':"top"===bgcConfig.phoneButtonPositionInVertical.property&&"right"===bgcConfig.phoneButtonPositionInHorizontal.property?s='\t\t\t\t\t<div id="bingc-phone-button-tooltip" class="bingc-phone-button-tooltip bingc-phone-button-tooltip-top-right"> \t\t\t\t\t\t'+i+' \t\t\t\t\t\t<svg version="1.1" class="bingc-phone-button-arrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 14" enable-background="new 0 0 18 14" xml:space="preserve"><polyline fill="#B3B3B3" points="17.977,14 0,14 17.977,0 "/></svg> \t\t\t\t\t</div> \t\t\t\t':"bottom"===bgcConfig.phoneButtonPositionInVertical.property&&"left"===bgcConfig.phoneButtonPositionInHorizontal.property?s='\t\t\t\t\t<div id="bingc-phone-button-tooltip" class="bingc-phone-button-tooltip bingc-phone-button-tooltip-bottom-left"> \t\t\t\t\t\t'+i+' \t\t\t\t\t\t<svg version="1.1" class="bingc-phone-button-arrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 14" enable-background="new 0 0 18 14" xml:space="preserve"><polyline fill="#B3B3B3" points="17.977,0 0.083,0 17.977,13.927 "/></svg> \t\t\t\t\t</div> \t\t\t\t':"bottom"===bgcConfig.phoneButtonPositionInVertical.property&&"right"===bgcConfig.phoneButtonPositionInHorizontal.property&&(s='\t\t\t\t\t<div id="bingc-phone-button-tooltip" class="bingc-phone-button-tooltip bingc-phone-button-tooltip-bottom-right"> \t\t\t\t\t\t'+i+' \t\t\t\t\t\t<svg version="1.1" class="bingc-phone-button-arrow" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 18 14" enable-background="new 0 0 18 14" xml:space="preserve"><polyline fill="#B3B3B3" points="0,0 17.936,0 0,14.012 "/></svg> \t\t\t\t\t</div> \t\t\t\t'),o.innerHTML=s+' \t\t\t\t<svg class="bingc-phone-button-circle" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve"><circle class="bingc-phone-button-circle-outside" cx="50" cy="50" r="50"/><circle class="bingc-phone-button-circle-inside" cx="50" cy="50" r="40"/></svg> \t\t\t\t<div id="bingc-phone-button-icon-text" class="bingc-phone-button-icon-text"><span>'+self.helpers.i18n("КНОПКА<br>СВЯЗИ")+'</span></div> \t\t\t\t<svg id="bingc-phone-button-icon-icon" class="bingc-phone-button-icon-icon bingc-phone-button-icon-show" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 17.544 25.215" enable-background="new 0 0 17.544 25.215" xml:space="preserve"><path fill-rule="evenodd" clip-rule="evenodd" fill="#fff" d="M12.22,6.784c-0.135,0.871-1.654,4.073-2.084,4.89c-0.576,1.087-2.779,4.344-3.724,5.065l0,0l-0.775,0.532l-1.879-0.616L0,20.653l0.129,1.043l2.123,2.832l0.916,0.687c0,0,13.474-8.596,14.376-24.03c0,0-0.266-0.297-0.777-0.87L13.228,0l-1.16,0.454l-1.029,4.941l1.127,1.23"/></svg>',d.getElementsByTagName("body")[0].appendChild(t),d.getElementsByTagName("body")[0].appendChild(n),d.getElementsByTagName("body")[0].appendChild(o);var l,a=!1;d.getElementById("bingc-passive-background").addEventListener("click",function(){a||(self.activityData.activeFormAdder=40,self.helpers.closePassiveForm())}),d.getElementById("bingc-passive-close-button").addEventListener("click",function(){a||(self.activityData.activeFormAdder=40,self.helpers.closePassiveForm())}),d.getElementById("bingc-phone-button").addEventListener("click",function(){self.helpers.isOpenedPassiveForm()||(self.helpers.openPassiveForm(),clearTimeout(self.helpers.timerForShowAndHideTooltip),self.helpers.hidePhoneButtonTooltip(),a=!0,clearTimeout(l),l=setTimeout(function(){a=!1},500))}),d.getElementById("bingc-phone-button").addEventListener("touchend",function(){self.helpers.isOpenedPassiveForm()||(self.helpers.openPassiveForm(),clearTimeout(self.helpers.timerForShowAndHideTooltip),self.helpers.hidePhoneButtonTooltip(),a=!0,clearTimeout(l),l=setTimeout(function(){a=!1},500))}),d.getElementById("bingc-phone-button").addEventListener("mouseenter",function(){self.helpers.showPhoneButtonTooltip()}),d.getElementById("bingc-phone-button").addEventListener("mouseleave",function(){self.helpers.hidePhoneButtonTooltip()}),d.getElementById("bingc-active-close-button").addEventListener("click",function(){self.activityData.phoneButtonTooltipAdder=60,self.helpers.closeActiveForm()}),setTimeout(function(){for(var e=d.getElementsByClassName("bingc-action-open-passive-form"),t=0;t<e.length;t++)e[t].addEventListener("click",function(e){self.helpers.isOpenedActiveForm()&&self.helpers.closeActiveForm();try{self.helpers.openPassiveForm(this.getAttribute("data-getcall-title-in-working-hours"),this.getAttribute("data-getcall-description")),clearTimeout(self.helpers.timerForShowAndHideTooltip),self.helpers.hidePhoneButtonTooltip()}catch(e){}})},1e3);var c=self.cookies.getJSON("bingc-activity-data");c&&(self.activityData.pageviews=(parseInt(c.pageviews)||0)+1,self.activityData.callWasMade=parseInt(c.callWasMade)||0);bgcVisibility.every(3e3,function(){self.activityData.onPage+=3,1===bgcConfig.phoneButtonDisplay&&(0!==self.activityData.phoneButtonTooltipAdder&&(self.activityData.phoneButtonTooltipAdder-=3,self.activityData.phoneButtonTooltipAdder=0<=self.activityData.phoneButtonTooltipAdder?self.activityData.phoneButtonTooltipAdder:0),self.activityData.phoneButtonTooltipDisplayingTime&&(12<=self.activityData.phoneButtonTooltipDisplayingTime?(self.activityData.phoneButtonTooltipDisplayingTime=0,self.helpers.hidePhoneButtonTooltip()):self.activityData.phoneButtonTooltipDisplayingTime+=3),0===self.activityData.phoneButtonTooltipAdder&&!1===self.helpers.isOpenedPassiveForm()&&!1===self.helpers.isOpenedActiveForm()&&(self.activityData.onPage>=self.activityData.phoneButtonTooltipTimeoutOnFirstDisplay&&0===self.activityData.phoneButtonTooltipStage?(self.activityData.phoneButtonTooltipDisplayingTime=1,self.activityData.phoneButtonTooltipStage=1,self.activityData.phoneButtonTooltipTimeoutOnSecondDisplay=self.activityData.onPage+self.activityData.phoneButtonTooltipTimeoutAdderOnSecondDisplay,self.helpers.showPhoneButtonTooltip()):self.activityData.onPage>=self.activityData.phoneButtonTooltipTimeoutOnSecondDisplay&&1===self.activityData.phoneButtonTooltipStage&&(self.activityData.phoneButtonTooltipDisplayingTime=1,self.activityData.phoneButtonTooltipStage=2,self.helpers.showPhoneButtonTooltip())));var e=self.cookies.getJSON("bingc-activity-data");if(e?(e.pageviews=self.activityData.pageviews,e.callWasMade=self.activityData.callWasMade,e.updatedAt=Math.floor(Date.now()/1e3)):e={numberOfImpressions:0,activeFormSinceLastDisplayed:0,pageviews:self.activityData.pageviews,callWasMade:self.activityData.callWasMade,updatedAt:Math.floor(Date.now()/1e3)},1===bgcConfig.activeFormStatus&&0===e.callWasMade&&!1===self.helpers.isOpenedPassiveForm()&&!1===self.helpers.isOpenedActiveForm()){e.activeFormSinceLastDisplayed+=3,0!==self.activityData.activeFormAdder&&(self.activityData.activeFormAdder-=3,self.activityData.activeFormAdder=0<=self.activityData.activeFormAdder?self.activityData.activeFormAdder:0);self.helpers.getModeOfWorkingHours();0===self.activityData.activeFormAdder&&0===e.numberOfImpressions&&e.activeFormSinceLastDisplayed>=bgcConfig.activeFormTimeoutOfFirstVisit&&(self.activityData.onPage>=bgcConfig.activeFormTimeoutOnPageWithLowPageview||e.pageviews>=bgcConfig.activeFormHighPageviewCount&&self.activityData.onPage>=bgcConfig.activeFormTimeoutOnPageWithHighPageview)?(self.helpers.openActiveForm(),e.numberOfImpressions++,e.activeFormSinceLastDisplayed=0):0===self.activityData.activeFormAdder&&0<e.numberOfImpressions&&e.numberOfImpressions<bgcConfig.activeFormMaxNumberOfImpressions&&e.activeFormSinceLastDisplayed>=bgcConfig.activeFormTimeoutOfRepeatVisit&&(self.activityData.onPage>=bgcConfig.activeFormTimeoutOnPageWithLowPageview||e.pageviews>=bgcConfig.activeFormHighPageviewCount&&self.activityData.onPage>=bgcConfig.activeFormTimeoutOnPageWithHighPageview)&&(self.helpers.openActiveForm(),e.numberOfImpressions++,e.activeFormSinceLastDisplayed=0)}self.cookies.set("bingc-activity-data",e,{expires:.5})}),self.helpers.rotatePhoneButton(),bgcConfig.initState="success"}},self.helpers.openPassiveForm=function(e,t){self.helpers.sendEventToGa("Opened passive form","",void 0,!0),self.helpers.sendToGtm({event:"Binotel GetCall - Opened passive form"});var n={1:self.helpers.i18n("Понедельник"),2:self.helpers.i18n("Вторник"),3:self.helpers.i18n("Среда"),4:self.helpers.i18n("Четверг"),5:self.helpers.i18n("Пятница"),6:self.helpers.i18n("Суббота"),0:self.helpers.i18n("Воскресенье")},i=self.helpers.getModeOfWorkingHours();if("alwaysOnline"===i){e||(e=sprintf(self.helpers.i18n("Хотите, перезвоним Вам за <b>%s</b> секунд?"),bgcConfig.countdownTimerForCall));var s=' \t\t\t\t\t<div class="bingc-we-will-call-you"><div class="bingc-we-will-call-you-alignment"><div class="bingc-we-will-call-you-restriction">'+e+'</div></div></div> \t\t\t\t\t<div class="bingc-passive-get-phone-form"> \t\t\t\t\t\t<form id="bingc-passive-get-phone-form" class="bingc-passive-get-phone-form"> \t\t\t\t\t\t\t<div class="bingc-passive-get-phone-form-input-border"></div> \t\t\t\t\t\t\t<input type="tel" id="bingc-passive-get-phone-form-input" class="bingc-passive-get-phone-form-input" placeholder="'+self.helpers.i18n("Ваш номер телефона")+'" value="'+bgcConfig.externalNumberInputValue+'" autocomplete="off" onfocus="this.value = this.value;"><a href="javascript:void(0);" rel="nofollow noopener" id="bingc-passive-phone-form-button" class="bingc-passive-phone-form-button">'+self.helpers.i18n("Перезвоните")+'</a><span class="bingc-sample-countdown-timer"><span>00:</span>'+(bgcConfig.countdownTimerForCall-1)+'<span>:99</span></span> \t\t\t\t\t\t\t<input type="hidden" id="bingc-passive-get-phone-form-description" class="bingc-passive-get-phone-form-description" value="'+(t||"")+'"> \t\t\t\t\t\t</form> \t\t\t\t\t</div> \t\t\t\t\t<div id="bingc-phone-sample" class="bingc-phone-sample"><span>'+self.helpers.i18n("Например:")+" "+bgcConfig.externalNumberExample+"</span></div> \t\t\t\t\t\t\t\t\t\t\t  ";1===bgcConfig.statisticsDisplay&&(s+=' \t\t\t\t\t<div class="bingc-statistics">'+self.helpers.i18n("Свободных операторов на линии:")+" "+bgcConfig.freeEmployees+"<br>"+self.helpers.i18n("Заказов звонков сегодня:")+" "+bgcConfig.callsProcessedToday+"</div> \t\t\t\t\t\t\t\t\t\t\t   "),d.getElementById("bingc-passive-content").innerHTML=s,d.getElementById("bingc-passive-phone-form-button").addEventListener("click",function(e){var t=d.getElementById("bingc-passive-get-phone-form-input").value;if(t=t.toString().replace(/\D/g,""),self.helpers.isCorrectExternalNumber(t)){if(self.requestForCallInProgress)return;var n,i;self.requestForCallInProgress=!0,d.getElementById("bingc-passive-get-phone-form-input").classList.remove("warning");try{n=w.BinotelInformationAboutTheVisitor.getVisitorData(),i=w.BinotelInformationAboutTheVisitor.getGoogleAnalyticsData()}catch(e){console.error(e)}var s=d.getElementById("bingc-passive-get-phone-form-description").value;sendXHR({type:"POST",url:bgcConfig.backendHost+"/getcall/call/",data:{widgetID:bgcConfig.widgetId,externalNumber:t,sessionId:bgcConfig.sessionId,visitorData:n,description:s,googleAnalyticsData:i},dataType:"json"},function(e){self.requestForCallInProgress=!1,e&&"success"===e.status?(self.helpers.sendEventToGa("Call requested","gc-"+e.GetCallID),self.helpers.sendEventToFb("GetCall - Call requested"),self.helpers.sendToGtm({event:"Binotel GetCall - Call requested",GetCallID:e.GetCallID,GetCallDescription:s}),self.helpers.listeners.emit("Call requested",e.GetCallID),self.activityData.callWasMade=1,d.getElementById("bingc-passive-content").innerHTML=' \t\t\t\t\t\t\t\t\t<div class="bingc-we-already-call-you">'+self.helpers.i18n("Заказ звонка принят. Мы Вам уже звоним!")+'</div> \t\t\t\t\t\t\t\t\t<div id="bingc-passive-countdown-timer" class="bingc-passive-countdown-timer">00:'+(bgcConfig.countdownTimerForCall-1)+":99</div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  ",setTimeout(function(){var e,t,n,i=100*(bgcConfig.countdownTimerForCall-1)+99;self.countdownTimerIntervalLink=setInterval(function(){e=(i-=1).toString(),(t=Math.floor(i/100))<10&&(t="0"+t),(n=e.slice(-2)).length<2&&(n="0"+n),d.getElementById("bingc-passive-countdown-timer").innerHTML="00:"+t+":"+n,0===i&&clearInterval(self.countdownTimerIntervalLink)},10)},100)):d.getElementById("bingc-passive-content").innerHTML=' \t\t\t\t\t\t\t\t\t<div class="bingc-something-went-wrong">'+self.helpers.i18n("К сожалению, что-то пошло не так.<br>Пожалуйста, обновите страницу.")+"</div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  "},function(e,t){console.log(t,e),self.requestForCallInProgress=!1,d.getElementById("bingc-passive-content").innerHTML=' \t\t\t\t\t\t\t\t<div class="bingc-something-went-wrong">'+self.helpers.i18n("К сожалению, что-то пошло не так.<br>Пожалуйста, обновите страницу.")+"</div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  "})}else d.getElementById("bingc-passive-get-phone-form-input").classList.add("warning"),d.getElementById("bingc-passive-get-phone-form-input").focus()})}else if("alwaysOffline"===i){self.workingDays=[];for(var o=0;o<=9;o++){for(var l={},a=0;a<=23;a++)for(var c=0;c<=45;c+=15){var r=new Date(1e3*(Math.floor(Date.now()/1e3)+bgcConfig.widgetTimezoneOffset+bgcConfig.clientSideTimezoneOffset+bgcConfig.clientSideTimeOffset)),g=new Date(1e3*(Math.floor(Date.now()/1e3)+bgcConfig.widgetTimezoneOffset+bgcConfig.clientSideTimezoneOffset+bgcConfig.clientSideTimeOffset));if(g.setHours(a),g.setMinutes(c),g.setSeconds(0),g.setDate(r.getDate()+o),!(0===o&&r.getHours()>=a)&&!0===BinotelHelperPbx.checkingTimeOnTimeline(bgcConfig.rulesOfWorkingHours,Math.floor(g.getTime()/1e3))){if(void 0===l.dayName)l={dayName:0===o?self.helpers.i18n("Сегодня"):1===o?self.helpers.i18n("Завтра"):n[g.getDay()],workingHoursOrderedList:[],workingHours:{},addingDays:o};var u=g.getHours().toString().length<=1?"0"+g.getHours():g.getHours().toString();void 0===l.workingHours[u]&&(l.workingHours[u]=[],l.workingHoursOrderedList.push(u)),l.workingHours[u].push(0===g.getMinutes()?"00":g.getMinutes())}}if(void 0!==l.dayName&&(self.workingDays.push(l),3===self.workingDays.length))break}var p,f,v,m="",b="",h="";if(self.workingDays.length){m='<div id="bingc-passive-date-selection-select-day" class="bingc-passive-date-selection-select-day"><span id="bingc-passive-date-selection-selected-day" class="bingc-passive-date-selection-selected-day">'+self.workingDays[0].dayName+'</span><svg class="bingc-passive-date-selection-arrows" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10 14" enable-background="new 0 0 10 14" xml:space="preserve"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99,8.905L4.995,13.9L0,8.905"/></svg><input type="hidden" id="bingc-passive-date-selection-selected-day-index" value="0"><div id="bingc-passive-date-selection-select-day-list-of-days-container" class="bingc-passive-date-selection-select-day-list-of-days-container"><ul id="bingc-passive-date-selection-select-day-list-of-days" class="bingc-passive-date-selection-select-day-list-of-days">';for(o=0;o<self.workingDays.length;o++)m+='<li value="'+o+'">'+self.workingDays[o].dayName+"</li>";m+="</ul></div></div>";var y=Object.keys(self.workingDays[0].workingHours).length;if(b='<div id="bingc-passive-date-selection-select-hour" class="bingc-passive-date-selection-select-hour"><span id="bingc-passive-date-selection-selected-hour" class="bingc-passive-date-selection-selected-hour">'+self.workingDays[0].workingHoursOrderedList[0]+'</span><svg class="bingc-passive-date-selection-arrows" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10 14" enable-background="new 0 0 10 14" xml:space="preserve"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99,8.905L4.995,13.9L0,8.905"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0,4.995L4.995,0L9.99,4.995"/></svg><div id="bingc-passive-date-selection-select-hour-list-of-hours-container" class="bingc-passive-date-selection-select-hour-list-of-hours-container '+(10<=y&&y<=18?"two-columns":19<=y?"three-columns":"")+'"><ul class="bingc-passive-date-selection-select-hour-list-of-hours '+(y<10?"only-one-column":"")+'">',y)for(o=0;o<self.workingDays[0].workingHoursOrderedList.length;o++)9===o?b+='</ul><ul class="bingc-passive-date-selection-select-hour-list-of-hours second-column">':18===o&&(b+='</ul><ul class="bingc-passive-date-selection-select-hour-list-of-hours third-column">'),b+="<li>"+self.workingDays[0].workingHoursOrderedList[o]+"</li>";if(b+="</ul></div></div>",y&&self.workingDays[0].workingHours[self.workingDays[0].workingHoursOrderedList[0]]){var B=self.workingDays[0].workingHours[self.workingDays[0].workingHoursOrderedList[0]];h='<div id="bingc-passive-date-selection-select-minutes" class="bingc-passive-date-selection-select-minutes"><span id="bingc-passive-date-selection-selected-minutes" class="bingc-passive-date-selection-selected-minutes">'+B[0]+'</span><svg class="bingc-passive-date-selection-arrows" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10 14" enable-background="new 0 0 10 14" xml:space="preserve"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99,8.905L4.995,13.9L0,8.905"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0,4.995L4.995,0L9.99,4.995"/></svg><div id="bingc-passive-date-selection-select-minutes-list-of-minutes-container" class="bingc-passive-date-selection-select-minutes-list-of-minutes-container"><ul class="bingc-passive-date-selection-select-minutes-list-of-minutes">';for(o=0;o<B.length;o++)h+="<li>"+B[o]+"</li>";h+="</ul></div></div>"}}for(var C in d.getElementById("bingc-passive-content").innerHTML=' \t\t\t\t\t<div class="bingc-we-will-call-you bingc-offline-form"><span class="small-text">'+self.helpers.i18n("К сожалению, сейчас у нас нерабочее время.")+"</span><br>"+self.helpers.i18n("Хотите, перезвоним Вам точно в:")+'</div> \t\t\t\t\t<div class="bingc-passive-get-phone-form"> \t\t\t\t\t\t<form id="bingc-passive-get-phone-form" class="bingc-passive-get-phone-form"> \t\t\t\t\t\t\t<div class="bingc-passive-get-phone-form-date-selection"> \t\t\t\t\t\t\t\t '+b+" \t\t\t\t\t\t\t\t"+h+" \t\t\t\t\t\t\t\t"+m+' \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class="bingc-passive-get-phone-form-input-border bingc-offline-form"></div> \t\t\t\t\t\t\t<input type="tel" id="bingc-passive-get-phone-form-input" class="bingc-passive-get-phone-form-input" placeholder="'+self.helpers.i18n("Ваш номер телефона")+'" value="'+bgcConfig.externalNumberInputValue+'" autocomplete="off" onfocus="this.value = this.value;"><a href="javascript:void(0);" rel="nofollow noopener" id="bingc-passive-phone-form-button" class="bingc-passive-phone-form-button">'+self.helpers.i18n("Жду звонка")+'</a> \t\t\t\t\t\t\t<input type="hidden" id="bingc-passive-get-phone-form-description" class="bingc-passive-get-phone-form-description" value="'+(t||"")+'"> \t\t\t\t\t\t</form> \t\t\t\t\t</div> \t\t\t\t\t<div id="bingc-phone-sample" class="bingc-phone-sample"><span>'+self.helpers.i18n("Например:")+" "+bgcConfig.externalNumberExample+"</span></div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  ",{touchstart:"touchstart",mouseenter:"mouseenter"})d.getElementById("bingc-passive-date-selection-select-day").addEventListener(C,function(){clearTimeout(p),this.classList.add("bingc-passive-date-selection-select-day-hover")});for(var C in{touchmove:"touchmove",mouseleave:"mouseleave"})d.getElementById("bingc-passive-date-selection-select-day").addEventListener(C,function(){clearTimeout(p);var e=this;p=setTimeout(function(){e.classList.remove("bingc-passive-date-selection-select-day-hover")},100)});for(var C in{touchstart:"touchstart",mouseenter:"mouseenter"})d.getElementById("bingc-passive-date-selection-select-hour").addEventListener(C,function(){clearTimeout(f),this.classList.add("bingc-passive-date-selection-select-hour-hover")});for(var C in{touchmove:"touchmove",mouseleave:"mouseleave"})d.getElementById("bingc-passive-date-selection-select-hour").addEventListener(C,function(){clearTimeout(f);var e=this;f=setTimeout(function(){e.classList.remove("bingc-passive-date-selection-select-hour-hover")},100)});for(var C in{touchstart:"touchstart",mouseenter:"mouseenter"})d.getElementById("bingc-passive-date-selection-select-minutes").addEventListener(C,function(){clearTimeout(v),this.classList.add("bingc-passive-date-selection-select-minutes-hover")});for(var C in{touchmove:"touchmove",mouseleave:"mouseleave"})d.getElementById("bingc-passive-date-selection-select-minutes").addEventListener(C,function(){clearTimeout(v);var e=this;v=setTimeout(function(){e.classList.remove("bingc-passive-date-selection-select-minutes-hover")},100)});var T=d.getElementById("bingc-passive-date-selection-select-day").getElementsByTagName("li");for(o=0;o<T.length;o++)T[o].addEventListener("click",function(e){var t=this.value;d.getElementById("bingc-passive-date-selection-selected-day-index").value=t,d.getElementById("bingc-passive-date-selection-selected-day").textContent=this.textContent,d.getElementById("bingc-passive-date-selection-select-day").classList.remove("bingc-passive-date-selection-select-day-hover"),d.getElementById("bingc-passive-date-selection-selected-hour").textContent=self.workingDays[t].workingHoursOrderedList[0];var n=d.getElementById("bingc-passive-date-selection-select-hour-list-of-hours-container"),i=Object.keys(self.workingDays[t].workingHours).length;if(i){n.classList.remove("two-columns"),n.classList.remove("three-columns"),10<=i&&i<=18?n.classList.add("two-columns"):19<=i&&n.classList.add("three-columns");for(var s='<ul class="bingc-passive-date-selection-select-hour-list-of-hours '+(i<10?"only-one-column":"")+'">',o=0;o<self.workingDays[t].workingHoursOrderedList.length;o++)9===o?s+='</ul><ul class="bingc-passive-date-selection-select-hour-list-of-hours second-column">':18===o&&(s+='</ul><ul class="bingc-passive-date-selection-select-hour-list-of-hours third-column">'),s+="<li>"+self.workingDays[t].workingHoursOrderedList[o]+"</li>";s+="</ul>",n.innerHTML=s;var l=self.workingDays[t].workingHours[self.workingDays[t].workingHoursOrderedList[0]];d.getElementById("bingc-passive-date-selection-selected-minutes").textContent=l[0];var a='<ul class="bingc-passive-date-selection-select-minutes-list-of-minutes">';if(l)for(o=0;o<l.length;o++)a+="<li>"+l[o]+"</li>";a+="</ul>",d.getElementById("bingc-passive-date-selection-select-minutes-list-of-minutes-container").innerHTML=a;var c=d.getElementById("bingc-passive-date-selection-select-minutes").getElementsByTagName("li");for(o=0;o<c.length;o++)c[o].addEventListener("click",function(e){d.getElementById("bingc-passive-date-selection-selected-minutes").textContent=this.textContent,d.getElementById("bingc-passive-date-selection-select-minutes").classList.remove("bingc-passive-date-selection-select-minutes-hover")});self.helpers.passiveFormOfflineDynamicBindings()}});self.helpers.passiveFormOfflineDynamicBindings(),d.getElementById("bingc-passive-phone-form-button").addEventListener("click",function(e){var t=d.getElementById("bingc-passive-get-phone-form-input").value;if(t=t.toString().replace(/\D/g,""),self.helpers.isCorrectExternalNumber(t)){if(self.requestForCallInProgress)return;var n,i;self.requestForCallInProgress=!0,d.getElementById("bingc-passive-get-phone-form-input").classList.remove("warning");try{n=w.BinotelInformationAboutTheVisitor.getVisitorData(),i=w.BinotelInformationAboutTheVisitor.getGoogleAnalyticsData()}catch(e){console.error(e)}var s=d.getElementById("bingc-passive-get-phone-form-description").value;sendXHR({type:"POST",url:bgcConfig.backendHost+"/getcall/call/",data:{widgetID:bgcConfig.widgetId,externalNumber:t,scheduledCall:1,addingDays:self.workingDays[d.getElementById("bingc-passive-date-selection-selected-day-index").value].addingDays,scheduledAtHour:parseInt(d.getElementById("bingc-passive-date-selection-selected-hour").textContent,10),scheduledAtMinutes:parseInt(d.getElementById("bingc-passive-date-selection-selected-minutes").textContent,10),sessionId:bgcConfig.sessionId,visitorData:n,description:s,googleAnalyticsData:i},dataType:"json"},function(e){self.requestForCallInProgress=!1,e&&"success"===e.status?(self.helpers.sendEventToGa("Call requested","gc-"+e.GetCallID),self.helpers.sendEventToFb("GetCall - Call requested"),self.helpers.sendToGtm({event:"Binotel GetCall - Call requested",GetCallID:e.GetCallID,GetCallDescription:s}),self.helpers.listeners.emit("Call requested",e.GetCallID),self.activityData.callWasMade=1,d.getElementById("bingc-passive-content").innerHTML=' \t\t\t\t\t\t\t\t\t<div class="bingc-we-will-call-you-later">'+self.helpers.i18n("Заказ звонка принят.")+'<br><span class="small-text">'+self.helpers.i18n("В указанное время мы с Вами свяжемся!")+"</span></div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  "):d.getElementById("bingc-passive-content").innerHTML=' \t\t\t\t\t\t\t\t\t<div class="bingc-something-went-wrong">'+self.helpers.i18n("К сожалению, что-то пошло не так.<br>Пожалуйста, обновите страницу.")+"</div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  "},function(e,t){console.log(t,e),self.requestForCallInProgress=!1,d.getElementById("bingc-passive-content").innerHTML=' \t\t\t\t\t\t\t\t<div class="bingc-something-went-wrong">'+self.helpers.i18n("К сожалению, что-то пошло не так.<br>Пожалуйста, обновите страницу.")+"</div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  "})}else d.getElementById("bingc-passive-get-phone-form-input").classList.add("warning"),d.getElementById("bingc-passive-get-phone-form-input").focus()})}self.helpers.addBlurToWholePage(),d.getElementById("bingc-passive").classList.remove("bingc-passive-closed"),d.getElementById("bingc-phone-button").classList.add("bingc-hide"),d.getElementById("bingc-passive-get-phone-form-input").focus(),d.getElementById("bingc-passive-get-phone-form").addEventListener("submit",function(e){e.preventDefault(),d.getElementById("bingc-passive-phone-form-button").click()}),setTimeout(function(){if(979<(w.innerWidth||d.documentElement.clientWidth||d.body.clientWidth))try{d.getElementById("bingc-powered-by-passive-overlay").href="https://www.binotel.ua/getcall?utm_source="+bgcConfig.widgetId+"&utm_medium=client_getcall&utm_campaign=client_getcall_passive_overlay&utm_content="+(window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""),d.getElementById("bingc-powered-by-passive-overlay").target="_blank",d.getElementById("bingc-powered-by-active-overlay").href="https://www.binotel.ua/getcall?utm_source="+bgcConfig.widgetId+"&utm_medium=client_getcall&utm_campaign=client_getcall_active_overlay&utm_content="+(window.navigator&&window.navigator.userAgent?window.navigator.userAgent:""),d.getElementById("bingc-powered-by-active-overlay").target="_blank"}catch(e){}},2e3)},self.helpers.passiveFormOfflineDynamicBindings=function(){for(var o=d.getElementById("bingc-passive-date-selection-selected-day-index").value,e=d.getElementById("bingc-passive-date-selection-select-hour").getElementsByTagName("li"),t=0;t<e.length;t++)e[t].addEventListener("click",function(e){if(d.getElementById("bingc-passive-date-selection-selected-hour").textContent=this.textContent,d.getElementById("bingc-passive-date-selection-select-hour").classList.remove("bingc-passive-date-selection-select-hour-hover"),self.workingDays[o].workingHours[this.textContent]){var t=self.workingDays[o].workingHours[this.textContent];d.getElementById("bingc-passive-date-selection-selected-minutes").textContent=t[0];var n='<ul class="bingc-passive-date-selection-select-minutes-list-of-minutes">';if(t)for(var i=0;i<t.length;i++)n+="<li>"+t[i]+"</li>";n+="</ul>",d.getElementById("bingc-passive-date-selection-select-minutes-list-of-minutes-container").innerHTML=n;var s=d.getElementById("bingc-passive-date-selection-select-minutes").getElementsByTagName("li");for(i=0;i<s.length;i++)s[i].addEventListener("click",function(e){d.getElementById("bingc-passive-date-selection-selected-minutes").textContent=this.textContent,d.getElementById("bingc-passive-date-selection-select-minutes").classList.remove("bingc-passive-date-selection-select-minutes-hover")})}});for(e=d.getElementById("bingc-passive-date-selection-select-minutes").getElementsByTagName("li"),t=0;t<e.length;t++)e[t].addEventListener("click",function(e){d.getElementById("bingc-passive-date-selection-selected-minutes").textContent=this.textContent,d.getElementById("bingc-passive-date-selection-select-minutes").classList.remove("bingc-passive-date-selection-select-minutes-hover")})},self.helpers.activeFormOfflineDynamicBindings=function(){for(var o=d.getElementById("bingc-active-date-selection-selected-day-index").value,e=d.getElementById("bingc-active-date-selection-select-hour").getElementsByTagName("li"),t=0;t<e.length;t++)e[t].addEventListener("click",function(e){if(d.getElementById("bingc-active-date-selection-selected-hour").textContent=this.textContent,d.getElementById("bingc-active-date-selection-select-hour").classList.remove("bingc-active-date-selection-select-hour-hover"),self.workingDays[o].workingHours[this.textContent]){var t=self.workingDays[o].workingHours[this.textContent];d.getElementById("bingc-active-date-selection-selected-minutes").textContent=t[0];var n='<ul class="bingc-active-date-selection-select-minutes-list-of-minutes">';if(t)for(var i=0;i<t.length;i++)n+="<li>"+t[i]+"</li>";n+="</ul>",d.getElementById("bingc-active-date-selection-select-minutes-list-of-minutes-container").innerHTML=n;var s=d.getElementById("bingc-active-date-selection-select-minutes").getElementsByTagName("li");for(i=0;i<s.length;i++)s[i].addEventListener("click",function(e){d.getElementById("bingc-active-date-selection-selected-minutes").textContent=this.textContent,d.getElementById("bingc-active-date-selection-select-minutes").classList.remove("bingc-active-date-selection-select-minutes-hover")})}});for(e=d.getElementById("bingc-active-date-selection-select-minutes").getElementsByTagName("li"),t=0;t<e.length;t++)e[t].addEventListener("click",function(e){d.getElementById("bingc-active-date-selection-selected-minutes").textContent=this.textContent,d.getElementById("bingc-active-date-selection-select-minutes").classList.remove("bingc-active-date-selection-select-minutes-hover")})},self.helpers.closePassiveForm=function(){clearInterval(self.countdownTimerIntervalLink);try{d.getElementById("bingc-powered-by-passive-overlay").href="javascript:void(0);",d.getElementById("bingc-powered-by-passive-overlay").target="",d.getElementById("bingc-powered-by-active-overlay").href="javascript:void(0);",d.getElementById("bingc-powered-by-active-overlay").target=""}catch(e){}self.helpers.deleteBlurFromWholePage(),d.getElementById("bingc-passive").classList.add("bingc-passive-closed"),d.getElementById("bingc-phone-button").classList.remove("bingc-hide")},self.helpers.isOpenedPassiveForm=function(){var e=d.getElementById("bingc-passive");return!(!e||!1!==e.classList.contains("bingc-passive-closed"))},self.helpers.openActiveForm=function(){if((w.innerWidth||d.documentElement.clientWidth||d.body.clientWidth)<=979)return!1;var e={1:self.helpers.i18n("в понедельник"),2:self.helpers.i18n("во вторник"),3:self.helpers.i18n("в среду"),4:self.helpers.i18n("в четверг"),5:self.helpers.i18n("в пятницу"),6:self.helpers.i18n("в субботу"),0:self.helpers.i18n("в воскресенье")},t=self.helpers.getModeOfWorkingHours();if("alwaysOnline"===t){var n=' \t\t\t\t\t<div class="bingc-we-will-call-you">'+sprintf(self.helpers.i18n("Хотите, перезвоним Вам<br><span>за %s секунд?</span>"),bgcConfig.countdownTimerForCall)+'</div> \t\t\t\t\t<div class="bingc-active-get-phone-form"> \t\t\t\t\t\t<form id="bingc-active-get-phone-form" class="bingc-active-get-phone-form"> \t\t\t\t\t\t\t<div class="bingc-active-get-phone-form-input-border"></div> \t\t\t\t\t\t\t<input type="tel" id="bingc-active-get-phone-form-input" class="bingc-active-get-phone-form-input" placeholder="'+self.helpers.i18n("Ваш номер телефона")+'" value="'+bgcConfig.externalNumberInputValue+'" autocomplete="off" onfocus="this.value = this.value;"><a href="javascript:void(0);" rel="nofollow noopener" id="bingc-active-phone-form-button" class="bingc-active-phone-form-button">'+self.helpers.i18n("Перезвоните")+'</a><span class="bingc-sample-countdown-timer"><span>00:</span>'+(bgcConfig.countdownTimerForCall-1)+'<span>:99</span></span> \t\t\t\t\t\t</form> \t\t\t\t\t</div> \t\t\t\t\t<div id="bingc-phone-sample" class="bingc-phone-sample"><span>'+self.helpers.i18n("Например:")+" "+bgcConfig.externalNumberExample+"</span></div> \t\t\t\t\t\t\t\t\t\t\t ";1===bgcConfig.statisticsDisplay&&(n+=' \t\t\t\t\t<div class="bingc-statistics">'+self.helpers.i18n("Свободных операторов на линии:")+" "+bgcConfig.freeEmployees+" &nbsp; &nbsp;&nbsp; "+self.helpers.i18n("Заказов звонков сегодня:")+" "+bgcConfig.callsProcessedToday+"</div> \t\t\t\t\t\t\t\t\t\t\t  "),d.getElementById("bingc-active-content").innerHTML=n,d.getElementById("bingc-active-phone-form-button").addEventListener("click",function(e){var t=d.getElementById("bingc-active-get-phone-form-input").value;if(t=t.toString().replace(/\D/g,""),self.helpers.isCorrectExternalNumber(t)){if(self.requestForCallInProgress)return;var n,i;self.requestForCallInProgress=!0,d.getElementById("bingc-active-get-phone-form-input").classList.remove("warning");try{n=w.BinotelInformationAboutTheVisitor.getVisitorData(),i=w.BinotelInformationAboutTheVisitor.getGoogleAnalyticsData()}catch(e){console.error(e)}sendXHR({type:"POST",url:bgcConfig.backendHost+"/getcall/call/",data:{widgetID:bgcConfig.widgetId,externalNumber:t,sessionId:bgcConfig.sessionId,visitorData:n,googleAnalyticsData:i},dataType:"json"},function(e){self.requestForCallInProgress=!1,e&&"success"===e.status?(self.helpers.sendEventToGa("Call requested","gc-"+e.GetCallID),self.helpers.sendEventToFb("GetCall - Call requested"),self.helpers.sendToGtm({event:"Binotel GetCall - Call requested",GetCallID:e.GetCallID}),self.helpers.listeners.emit("Call requested",e.GetCallID),self.activityData.callWasMade=1,d.getElementById("bingc-active-content").innerHTML=' \t\t\t\t\t\t\t\t\t<div class="bingc-we-already-call-you">'+self.helpers.i18n("Заказ звонка принят. Мы Вам уже звоним!")+'</div> \t\t\t\t\t\t\t\t\t<div id="bingc-active-countdown-timer" class="bingc-active-countdown-timer">00:'+(bgcConfig.countdownTimerForCall-1)+":99</div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  ",setTimeout(function(){var e,t,n,i=100*(bgcConfig.countdownTimerForCall-1)+99;self.countdownTimerIntervalLink=setInterval(function(){e=(i-=1).toString(),(t=Math.floor(i/100))<10&&(t="0"+t),(n=e.slice(-2)).length<2&&(n="0"+n),d.getElementById("bingc-active-countdown-timer").innerHTML="00:"+t+":"+n,0==i&&clearInterval(self.countdownTimerIntervalLink)},10)},100)):d.getElementById("bingc-active-content").innerHTML=' \t\t\t\t\t\t\t\t\t<div class="bingc-something-went-wrong">'+self.helpers.i18n("К сожалению, что-то пошло не так.<br>Пожалуйста, обновите страницу.")+"</div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  "},function(e,t){console.log(t,e),self.requestForCallInProgress=!1,d.getElementById("bingc-active-content").innerHTML=' \t\t\t\t\t\t\t\t<div class="bingc-something-went-wrong">'+self.helpers.i18n("К сожалению, что-то пошло не так.<br>Пожалуйста, обновите страницу.")+"</div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  "})}else d.getElementById("bingc-active-get-phone-form-input").classList.add("warning"),d.getElementById("bingc-active-get-phone-form-input").focus()})}else if("alwaysOffline"===t){self.workingDays=[];for(var i=0;i<=9;i++){for(var s={},o=0;o<=23;o++)for(var l=0;l<=45;l+=15){var a=new Date(1e3*(Math.floor(Date.now()/1e3)+bgcConfig.widgetTimezoneOffset+bgcConfig.clientSideTimezoneOffset+bgcConfig.clientSideTimeOffset)),c=new Date(1e3*(Math.floor(Date.now()/1e3)+bgcConfig.widgetTimezoneOffset+bgcConfig.clientSideTimezoneOffset+bgcConfig.clientSideTimeOffset));if(c.setHours(o),c.setMinutes(l),c.setSeconds(0),c.setDate(a.getDate()+i),!(0===i&&a.getHours()>=o)&&!0===BinotelHelperPbx.checkingTimeOnTimeline(bgcConfig.rulesOfWorkingHours,Math.floor(c.getTime()/1e3))){if(void 0===s.dayName)s={dayName:0===i?self.helpers.i18n("сегодня"):1===i?self.helpers.i18n("завтра"):e[c.getDay()],workingHoursOrderedList:[],workingHours:{},addingDays:i};var r=c.getHours().toString().length<=1?"0"+c.getHours():c.getHours().toString();void 0===s.workingHours[r]&&(s.workingHours[r]=[],s.workingHoursOrderedList.push(r)),s.workingHours[r].push(0==c.getMinutes()?"00":c.getMinutes())}}if(void 0!==s.dayName&&(self.workingDays.push(s),3===self.workingDays.length))break}var g,u,p,f="",v="",m="";if(self.workingDays.length){f='<div id="bingc-active-date-selection-select-day" class="bingc-active-date-selection-select-day"><svg class="bingc-active-date-selection-arrows" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10 14" enable-background="new 0 0 10 14" xml:space="preserve"><path fill-rule="evenodd" clip-rule="evenodd" d="M0,4.995L4.995,0L9.99,4.995"/></svg><span id="bingc-active-date-selection-selected-day" class="bingc-active-date-selection-selected-day">'+self.workingDays[0].dayName+'</span><input type="hidden" id="bingc-active-date-selection-selected-day-index" value="0"><div id="bingc-active-date-selection-select-day-list-of-days-container" class="bingc-active-date-selection-select-day-list-of-days-container"><ul id="bingc-active-date-selection-select-day-list-of-days" class="bingc-active-date-selection-select-day-list-of-days">';for(i=0;i<self.workingDays.length;i++)f+='<li value="'+i+'">'+self.workingDays[i].dayName+"</li>";f+="</ul></div></div>";var b=Object.keys(self.workingDays[0].workingHours).length;if(v='<div id="bingc-active-date-selection-select-hour" class="bingc-active-date-selection-select-hour"><span id="bingc-active-date-selection-selected-hour" class="bingc-active-date-selection-selected-hour">'+self.workingDays[0].workingHoursOrderedList[0]+'</span><svg class="bingc-active-date-selection-arrows" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10 14" enable-background="new 0 0 10 14" xml:space="preserve"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99,8.905L4.995,13.9L0,8.905"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0,4.995L4.995,0L9.99,4.995"/></svg><div id="bingc-active-date-selection-select-hour-list-of-hours-container" class="bingc-active-date-selection-select-hour-list-of-hours-container '+(10<=b&&b<=18?"two-columns":19<=b?"three-columns":"")+'"><ul class="bingc-active-date-selection-select-hour-list-of-hours '+(b<10?"only-one-column":"")+'">',b)for(i=0;i<self.workingDays[0].workingHoursOrderedList.length;i++)9===i?v+='</ul><ul class="bingc-active-date-selection-select-hour-list-of-hours second-column">':18===i&&(v+='</ul><ul class="bingc-active-date-selection-select-hour-list-of-hours third-column">'),v+="<li>"+self.workingDays[0].workingHoursOrderedList[i]+"</li>";if(v+="</ul></div></div>",b&&self.workingDays[0].workingHours[self.workingDays[0].workingHoursOrderedList[0]]){var h=self.workingDays[0].workingHours[self.workingDays[0].workingHoursOrderedList[0]];m='<div id="bingc-active-date-selection-select-minutes" class="bingc-active-date-selection-select-minutes"><span id="bingc-active-date-selection-selected-minutes" class="bingc-active-date-selection-selected-minutes">'+h[0]+'</span><svg class="bingc-active-date-selection-arrows" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 10 14" enable-background="new 0 0 10 14" xml:space="preserve"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.99,8.905L4.995,13.9L0,8.905"/><path fill-rule="evenodd" clip-rule="evenodd" d="M0,4.995L4.995,0L9.99,4.995"/></svg><div id="bingc-active-date-selection-select-minutes-list-of-minutes-container" class="bingc-active-date-selection-select-minutes-list-of-minutes-container"><ul class="bingc-active-date-selection-select-minutes-list-of-minutes">';for(i=0;i<h.length;i++)m+="<li>"+h[i]+"</li>";m+="</ul></div></div>"}}d.getElementById("bingc-active-content").innerHTML=' \t\t\t\t\t<div class="bingc-we-will-call-you bingc-offline-form">'+sprintf(self.helpers.i18n("Хотите, перезвоним Вам<br>%s точно в:"),f)+'</div> \t\t\t\t\t<div class="bingc-active-get-phone-form bingc-offline-form"> \t\t\t\t\t\t<form id="bingc-active-get-phone-form" class="bingc-active-get-phone-form"> \t\t\t\t\t\t\t<div class="bingc-active-get-phone-form-date-selection"> \t\t\t\t\t\t\t\t '+v+" \t\t\t\t\t\t\t\t"+m+' \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class="bingc-active-get-phone-form-input-border bingc-offline-form"></div> \t\t\t\t\t\t\t<input type="tel" id="bingc-active-get-phone-form-input" class="bingc-active-get-phone-form-input" placeholder="'+self.helpers.i18n("Ваш номер телефона")+'" value="'+bgcConfig.externalNumberInputValue+'" autocomplete="off" onfocus="this.value = this.value;"><a href="javascript:void(0);" rel="nofollow noopener" id="bingc-active-phone-form-button" class="bingc-active-phone-form-button">'+self.helpers.i18n("Жду звонка")+'</a> \t\t\t\t\t\t</form> \t\t\t\t\t</div> \t\t\t\t\t<div id="bingc-phone-sample" class="bingc-phone-sample"><span>'+self.helpers.i18n("Например:")+" "+bgcConfig.externalNumberExample+"</span></div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  ",d.getElementById("bingc-active-date-selection-select-day").addEventListener("mouseenter",function(){clearTimeout(g),this.classList.add("bingc-active-date-selection-select-day-hover")}),d.getElementById("bingc-active-date-selection-select-day").addEventListener("mouseleave",function(){clearTimeout(g);var e=this;g=setTimeout(function(){e.classList.remove("bingc-active-date-selection-select-day-hover")},100)}),d.getElementById("bingc-active-date-selection-select-hour").addEventListener("mouseenter",function(){clearTimeout(u),this.classList.add("bingc-active-date-selection-select-hour-hover")}),d.getElementById("bingc-active-date-selection-select-hour").addEventListener("mouseleave",function(){clearTimeout(u);var e=this;u=setTimeout(function(){e.classList.remove("bingc-active-date-selection-select-hour-hover")},100)}),d.getElementById("bingc-active-date-selection-select-minutes").addEventListener("mouseenter",function(){clearTimeout(p),this.classList.add("bingc-active-date-selection-select-minutes-hover")}),d.getElementById("bingc-active-date-selection-select-minutes").addEventListener("mouseleave",function(){clearTimeout(p);var e=this;p=setTimeout(function(){e.classList.remove("bingc-active-date-selection-select-minutes-hover")},100)});var y=d.getElementById("bingc-active-date-selection-select-day").getElementsByTagName("li");for(i=0;i<y.length;i++)y[i].addEventListener("click",function(e){var t=this.value;d.getElementById("bingc-active-date-selection-selected-day-index").value=t,d.getElementById("bingc-active-date-selection-selected-day").textContent=this.textContent,d.getElementById("bingc-active-date-selection-select-day").classList.remove("bingc-active-date-selection-select-day-hover"),d.getElementById("bingc-active-date-selection-selected-hour").textContent=self.workingDays[t].workingHoursOrderedList[0];var n=d.getElementById("bingc-active-date-selection-select-hour-list-of-hours-container"),i=Object.keys(self.workingDays[t].workingHours).length;if(i){n.classList.remove("two-columns"),n.classList.remove("three-columns"),11<=i&&i<=20?n.classList.add("two-columns"):21<=i&&n.classList.add("three-columns");for(var s='<ul class="bingc-active-date-selection-select-hour-list-of-hours '+(i<11?"only-one-column":"")+'">',o=0;o<self.workingDays[t].workingHoursOrderedList.length;o++)10===o?s+='</ul><ul class="bingc-active-date-selection-select-hour-list-of-hours second-column">':20===o&&(s+='</ul><ul class="bingc-active-date-selection-select-hour-list-of-hours third-column">'),s+="<li>"+self.workingDays[t].workingHoursOrderedList[o]+"</li>";s+="</ul>",n.innerHTML=s;var l=self.workingDays[t].workingHours[self.workingDays[t].workingHoursOrderedList[0]];d.getElementById("bingc-active-date-selection-selected-minutes").textContent=l[0];var a='<ul class="bingc-active-date-selection-select-minutes-list-of-minutes">';if(l)for(o=0;o<l.length;o++)a+="<li>"+l[o]+"</li>";a+="</ul>",d.getElementById("bingc-active-date-selection-select-minutes-list-of-minutes-container").innerHTML=a;var c=d.getElementById("bingc-active-date-selection-select-minutes").getElementsByTagName("li");for(o=0;o<c.length;o++)c[o].addEventListener("click",function(e){d.getElementById("bingc-active-date-selection-selected-minutes").textContent=this.textContent,d.getElementById("bingc-active-date-selection-select-minutes").classList.remove("bingc-active-date-selection-select-minutes-hover")});self.helpers.activeFormOfflineDynamicBindings()}});self.helpers.activeFormOfflineDynamicBindings(),d.getElementById("bingc-active-phone-form-button").addEventListener("click",function(e){var t=d.getElementById("bingc-active-get-phone-form-input").value;if(t=t.toString().replace(/\D/g,""),self.helpers.isCorrectExternalNumber(t)){if(self.requestForCallInProgress)return;var n,i;self.requestForCallInProgress=!0,d.getElementById("bingc-active-get-phone-form-input").classList.remove("warning");try{n=w.BinotelInformationAboutTheVisitor.getVisitorData(),i=w.BinotelInformationAboutTheVisitor.getGoogleAnalyticsData()}catch(e){console.error(e)}sendXHR({type:"POST",url:bgcConfig.backendHost+"/getcall/call/",data:{widgetID:bgcConfig.widgetId,externalNumber:t,scheduledCall:1,addingDays:self.workingDays[d.getElementById("bingc-active-date-selection-selected-day-index").value].addingDays,scheduledAtHour:parseInt(d.getElementById("bingc-active-date-selection-selected-hour").textContent,10),scheduledAtMinutes:parseInt(d.getElementById("bingc-active-date-selection-selected-minutes").textContent,10),sessionId:bgcConfig.sessionId,visitorData:n,googleAnalyticsData:i},dataType:"json"},function(e){self.requestForCallInProgress=!1,e&&"success"===e.status?(self.helpers.sendEventToGa("Call requested","gc-"+e.GetCallID),self.helpers.sendEventToFb("GetCall - Call requested"),self.helpers.sendToGtm({event:"Binotel GetCall - Call requested",GetCallID:e.GetCallID}),self.helpers.listeners.emit("Call requested",e.GetCallID),self.activityData.callWasMade=1,d.getElementById("bingc-active-content").innerHTML=' \t\t\t\t\t\t\t\t\t<div class="bingc-we-will-call-you-later">'+self.helpers.i18n("Заказ звонка принят.")+'<br><span class="small-text">'+self.helpers.i18n("В указанное время мы с Вами свяжемся!")+"</span></div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  "):d.getElementById("bingc-active-content").innerHTML=' \t\t\t\t\t\t\t\t\t<div class="bingc-something-went-wrong">'+self.helpers.i18n("К сожалению, что-то пошло не так.<br>Пожалуйста, обновите страницу.")+"</div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  "},function(e,t){console.log(t,e),self.requestForCallInProgress=!1,d.getElementById("bingc-active-content").innerHTML=' \t\t\t\t\t\t\t\t<div class="bingc-something-went-wrong">'+self.helpers.i18n("К сожалению, что-то пошло не так.<br>Пожалуйста, обновите страницу.")+"</div> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  "})}else d.getElementById("bingc-active-get-phone-form-input").classList.add("warning"),d.getElementById("bingc-active-get-phone-form-input").focus()})}d.getElementById("bingc-active").classList.remove("bingc-active-closed"),d.getElementById("bingc-phone-button").classList.add("bingc-hide"),d.getElementById("bingc-active-get-phone-form-input").focus(),d.getElementById("bingc-active-get-phone-form").addEventListener("submit",function(e){e.preventDefault(),d.getElementById("bingc-active-phone-form-button").click()})},self.helpers.closeActiveForm=function(){clearInterval(self.countdownTimerIntervalLink),self.helpers.deleteBlurFromWholePage(),d.getElementById("bingc-active").classList.add("bingc-active-closed"),d.getElementById("bingc-phone-button").classList.remove("bingc-hide")},self.helpers.isOpenedActiveForm=function(){var e=d.getElementById("bingc-active");return!(!e||!1!==e.classList.contains("bingc-active-closed"))},self.helpers.addBlurToWholePage=function(){for(var e=d.getElementsByTagName("body")[0].childNodes,t=0;t<e.length;t++)if(1==e[t].nodeType&&"SCRIPT"!==e[t].nodeName&&"STYLE"!==e[t].nodeName){if("bingc-passive"===e[t].id||"bingc-phone-button"===e[t].id||"bingc-active"===e[t].id)continue;e[t].classList.add("bingc-blur-whole-page")}},self.helpers.deleteBlurFromWholePage=function(){for(var e=d.getElementsByTagName("body")[0].childNodes,t=0;t<e.length;t++)1==e[t].nodeType&&"SCRIPT"!==e[t].nodeName&&"STYLE"!==e[t].nodeName&&e[t].classList.remove("bingc-blur-whole-page")},self.helpers.setClientSideTimeOffset=function(n){sendXHR({type:"GET",url:bgcConfig.backendHost+"/getcall/getTimestamp/",dataType:"json"},function(e){e&&e.timestamp?bgcConfig.clientSideTimeOffset=e.timestamp-Math.floor(Date.now()/1e3):!0!==n&&setTimeout(function(){self.helpers.setClientSideTimeOffset(!0)},12e4)},function(e,t){console.log(t,e),!0!==n&&setTimeout(function(){self.helpers.setClientSideTimeOffset(!0)},12e4)})},self.helpers.getModeOfWorkingHours=function(){var e=bgcConfig.modeOfWorkingHours;return"rangeOfWorkingHours"===e&&(e="alwaysOffline",!0===BinotelHelperPbx.checkingTimeOnTimeline(bgcConfig.rulesOfWorkingHours,Math.floor(Date.now()/1e3)+bgcConfig.widgetTimezoneOffset+bgcConfig.clientSideTimezoneOffset+bgcConfig.clientSideTimeOffset)&&(e="alwaysOnline")),e},self.helpers.rotatePhoneButton=function(){var e,t=d.getElementById("bingc-phone-button-icon-text"),n=d.getElementById("bingc-phone-button-icon-icon");e=t.classList.contains("bingc-phone-button-icon-show")?(t.classList.remove("bingc-phone-button-icon-show"),n.classList.add("bingc-phone-button-icon-show"),8):(n.classList.remove("bingc-phone-button-icon-show"),t.classList.add("bingc-phone-button-icon-show"),4),clearTimeout(self.timers.rotatePhoneButtonTimer),self.timers.rotatePhoneButtonTimer=setTimeout(self.helpers.rotatePhoneButton,1e3*e)},self.helpers.showPhoneButtonTooltip=function(){var e=d.getElementById("bingc-phone-button-tooltip");e&&(e.classList.add("bingc-phone-button-tooltip-show-first"),setTimeout(function(){e.classList.add("bingc-phone-button-tooltip-show-second")},50))},self.helpers.hidePhoneButtonTooltip=function(){var e=d.getElementById("bingc-phone-button-tooltip");e&&(e.classList.remove("bingc-phone-button-tooltip-show-second"),setTimeout(function(){!1===e.classList.contains("bingc-phone-button-tooltip-show-second")&&e.classList.remove("bingc-phone-button-tooltip-show-first")},1e3))},self.helpers.isCorrectExternalNumber=function(e){if(""===e||e===bgcConfig.externalNumberExample.toString().replace(/\D/g,"")||e.length<bgcConfig.externalNumberMinLength||e.length>bgcConfig.externalNumberMaxLength)return!1;for(var t={},n=0,i=0;i<10;i++)t[e[i]]||(t[e[i]]=e[i],n++);return!(n<=2)},self.helpers.i18n=function(e){var t=bgcConfig.language,n="";return n=bgcConfig.i18nDictionary[t]&&bgcConfig.i18nDictionary[t][e]?bgcConfig.i18nDictionary[t][e]:("ru"!==bgcConfig.language&&console.log("[%s] %s",bgcConfig.language,e),e),bgcConfig.customI18nDictionary&&bgcConfig.customI18nDictionary[n]&&(n=bgcConfig.customI18nDictionary[n]),n},self.helpers.sendEventToGa=function(eventAction,eventLabel,eventValue,nonInteraction){var gaTrackingId;eventLabel=eventLabel||void 0,eventValue=eventValue?parseInt(eventValue):void 0,nonInteraction=!0===nonInteraction,self.gaObject=eval(bgcConfig.gaObjectName);try{gaTrackingId=w.BinotelInformationAboutTheVisitorSettings.gaTrackingId}catch(e){console.error(e)}if("object"!=typeof _gaq||gaTrackingId)if("function"==typeof self.gaObject){bgcConfig.debugMode&&console.log("[%s] %s",Date(),"Send event to universal GA.");try{var googleAnalyticsData;try{googleAnalyticsData=w.BinotelInformationAboutTheVisitor.getGoogleAnalyticsData()}catch(e){console.error(e)}var gaTrackerName="";googleAnalyticsData&&googleAnalyticsData.name&&(gaTrackerName=googleAnalyticsData.name+"."),self.gaObject(gaTrackerName+"send","event","Binotel GetCall",eventAction,eventLabel,eventValue,{nonInteraction:nonInteraction})}catch(e){bgcConfig.debugMode&&console.log("[%s] %s",Date(),"Error in sendEventToGa.",e)}}else bgcConfig.debugMode&&console.log("[%s] %s",Date(),"Can't find GA.");else{bgcConfig.debugMode&&console.log("[%s] %s",Date(),"Send event to old GA.");try{_gaq.push(["_trackEvent","Binotel GetCall",eventAction,eventLabel,eventValue,nonInteraction])}catch(e){bgcConfig.debugMode&&console.log("[%s] %s",Date(),"Error in sendEventToGa.",e)}}},self.helpers.sendEventToFb=function(e){if("function"==typeof fbq){bgcConfig.debugMode&&console.log("[%s] %s",Date(),"Send event to FB.");try{fbq("track",e)}catch(e){console.error(e)}}},self.helpers.sendToGtm=function(e){if("undefined"!=typeof dataLayer&&dataLayer&&dataLayer.push&&"function"==typeof dataLayer.push){bgcConfig.debugMode&&console.log("[%s] %s",Date(),"Send event to GTM.");try{dataLayer.push(e)}catch(e){console.error(e)}}},this},BinotelHelperPbx={checkingTimeOnTimeline:function(e,t){void 0===t&&(t=Math.floor(Date.now()/1e3));var n=new Date(1e3*t),i=n.getHours(),s=n.getMinutes(),o=n.getDay(),l=n.getDate(),a=n.getMonth()+1;for(var c in e){var r;try{r=e[c].split(",")}catch(e){}if(!("object"!=typeof r||r.length<4)){var d,g,u,p,f=void 0!==r[0]?r[0]:null,v=void 0!==r[1]?r[1]:null,m=void 0!==r[2]?r[2]:null,b=void 0!==r[3]?r[3]:null;if(null===f||null===v||null===m||null===b)break;if("*"!==f){var h=f.split("-"),y="object"==typeof h&&2===h.length?h[0].split(":"):["0","0"],w="object"==typeof h&&2===h.length?h[1].split(":"):["0","0"];d="object"==typeof y&&2===y.length?Math.round(y[0]):"0",g="object"==typeof y&&2===y.length?Math.round(y[1]):"0",u="object"==typeof w&&2===w.length?Math.round(w[0]):"0",p="object"==typeof w&&2===w.length?Math.round(w[1]):"0"}var B={};if("*"!==v){var C={mon:1,tue:2,wed:3,thu:4,fri:5,sat:6,sun:7};if(-1===v.indexOf("-"))void 0!==C[v]&&(B[C[v]]=C[v]);else for(var T=v.split("-"),I="object"==typeof T&&2===T.length&&void 0!==C[T[0]]?C[T[0]]:0,x="object"==typeof T&&2===T.length&&void 0!==C[T[1]]?C[T[1]]:0,k=I;k<=x;k++)B[k]=k}if("*"!==m){var E=m.split("-");startDayOfMonth="object"==typeof E&&2===E.length?E[0]:0,stopDayOfManth="object"==typeof E&&2===E.length?E[1]:0}var D={};if("*"!==b){var L={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12};if(-1===b.indexOf("-"))void 0!==L[b]&&(D[L[b]]=L[b]);else{var O=b.split("-"),H="object"==typeof O&&2===O.length&&void 0!==L[O[0]]?L[O[0]]:0,F="object"==typeof O&&2===O.length&&void 0!==L[O[1]]?L[O[1]]:0;for(k=H;k<=F;k++)D[k]=k}}if(0===o&&(o=7),("*"===f||(d==i&&g<=s||d<i)&&(u==i&&s<=p||i<u))&&("*"===v||void 0!==B[o])&&("*"===m||startDayOfMonth<=l&&stopDayOfManth>=l)&&("*"===b||void 0!==D[a]))return!0}}return!1}},Vf,Wf,Xf,Yf,Zf,$f;Date.now||(Date.now=function(){return(new Date).getTime()}),Vf=window,Wf={},Xf={},Yf=Xf.toString,Zf=/%20/g,$f=/\[\]$/,(Vf.binotelJqMini=Wf).type=function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?Xf[Yf.call(e)]||"object":typeof e},Wf.isFunction=function(e){return"function"===Wf.type(e)},Wf.buildParams=function(e,t,n){var s,o;if(Array.isArray(t))for(var l in t)o=t[l],$f.test(e)?n(e,o):Wf.buildParams(e+"["+("object"==typeof v?i:"")+"]",o,n);else if("object"===Wf.type(t))for(s in t)Wf.buildParams(e+"["+s+"]",t[s],n);else n(e,t)},Wf.param=function(e){var t,n,i;if(serialized=[],add=function(e,t){t=Wf.isFunction(t)?t():null==t?"":t,serialized[serialized.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)},Array.isArray(e))for(n in e)i=e[n],add(n,i);else for(t in e)Wf.buildParams(t,e[t],add);return serialized.join("&").replace(Zf,"+")}}function sendXHR(t,n,i){(t="object"==typeof t?t:{}).url=t.url||window.location.toString(),t.type="POST"===t.type?t.type:"GET",t.timeout=1e3*(0<t.timeout?parseInt(t.timeout):10),t.async=!1!==t.async||t.async,t.headers="object"==typeof t.headers?t.headers:{},t.dataType=-1!==["json","text"].indexOf(t.dataType)?t.dataType:"text";var s,o=getXHR(),e=null;if("object"==typeof t.data){var l=binotelJqMini.param(t.data);"GET"===t.type&&""!==l?t.url=(t.url+"&"+l).replace(/[&?]{1,2}/,"?"):"POST"===t.type&&""!==l&&(t.headers["Content-Type"]||(t.headers["Content-Type"]="application/x-www-form-urlencoded"),e=l)}for(headerName in o.onreadystatechange=function(){if(4==o.readyState)if(clearTimeout(s),200==o.status)if("json"==t.dataType){var e;try{e=JSON.parse(o.responseText)}catch(e){i(o,"parsererror")}e&&n(e)}else"text"==t.dataType&&n(o.responseText);else i(o,o.statusText)},o.open(t.type,t.url,t.async),t.headers)o.setRequestHeader(headerName,t.headers[headerName]);0<t.timeout&&(s=setTimeout(function(){o.onreadystatechange=function(){},o.abort(),i(o,"timeout")},t.timeout)),o.send(e)}function getXHR(){try{return new XMLHttpRequest}catch(e){}try{return new ActiveXObject("Msxml3.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}return null}function emitter(i){var s={};return(i=i||{}).emit=function(e,t){e=processTopic(e);var n=s[e];if(n)for(var i=0;i<n.length;i++)n[i](t)},i.emitArgs=function(e){e=processTopic(e);var t=s[e],n=[].slice.call(arguments,1);if(t)for(var i=0;i<t.length;i++)t[i].apply(null,n)},i.on=function(e,t){return e=processTopic(e),s[e]=s[e]||[],s[e].push(t),{un:function(){i.un(e,t)}}},i.un=function(e,t){e=processTopic(e);var n=s[e],i=n.indexOf(t);-1<i&&(n.splice(i,1),0<n.length||delete s[e])},i.one=function(e,t){var n=i.on(e,function(){n.un(),t.apply(null,arguments)})},i}function processTopic(e){return e.join?e.join(" "):e}}(document,window,"script");