var post_id=0,post_rating=0,is_being_rated=!1;ratingsL10n.custom=parseInt(ratingsL10n.custom);ratingsL10n.max=parseInt(ratingsL10n.max);ratingsL10n.show_loading=parseInt(ratingsL10n.show_loading);ratingsL10n.show_fading=parseInt(ratingsL10n.show_fading);
function current_rating(a,b,c){if(!is_being_rated){post_id=a;post_rating=b;if(ratingsL10n.custom&&2==ratingsL10n.max)jQuery("#rating_"+post_id+"_"+b).attr("src",eval("ratings_"+b+"_mouseover_image.src"));else for(i=1;i<=b;i++)ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",eval("ratings_"+i+"_mouseover_image.src")):jQuery("#rating_"+post_id+"_"+i).attr("src",ratings_mouseover_image.src);jQuery("#ratings_"+post_id+"_text").length&&(jQuery("#ratings_"+post_id+"_text").show(),jQuery("#ratings_"+
post_id+"_text").html(c))}}
function ratings_off(a,b,c){if(!is_being_rated){for(i=1;i<=ratingsL10n.max;i++)i<=a?ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_on."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_on."+ratingsL10n.image_ext):i==b?ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+
i+"_half"+(c?"-rtl":"")+"."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_half"+(c?"-rtl":"")+"."+ratingsL10n.image_ext):ratingsL10n.custom?jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_"+i+"_off."+ratingsL10n.image_ext):jQuery("#rating_"+post_id+"_"+i).attr("src",ratingsL10n.plugin_url+"/images/"+ratingsL10n.image+"/rating_off."+ratingsL10n.image_ext);jQuery("#ratings_"+
post_id+"_text").length&&(jQuery("#ratings_"+post_id+"_text").hide(),jQuery("#ratings_"+post_id+"_text").empty())}}function set_is_being_rated(a){is_being_rated=a}function rate_post_success(a){jQuery("#post-ratings-"+post_id).html(a);ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").hide();ratingsL10n.show_fading?jQuery("#post-ratings-"+post_id).fadeTo("def",1,function(){set_is_being_rated(!1)}):set_is_being_rated(!1)}
function rate_post(){post_ratings_el=jQuery("#post-ratings-"+post_id);if(is_being_rated)alert(ratingsL10n.text_wait);else{post_ratings_nonce=jQuery(post_ratings_el).data("nonce");if("undefined"==typeof post_ratings_nonce||null==post_ratings_nonce)post_ratings_nonce=jQuery(post_ratings_el).attr("data-nonce");set_is_being_rated(!0);ratingsL10n.show_fading?jQuery(post_ratings_el).fadeTo("def",0,function(){ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").show();jQuery.ajax({type:"POST",
xhrFields:{withCredentials:!0},dataType:"html",url:ratingsL10n.ajax_url,data:"action=postratings&pid="+post_id+"&rate="+post_rating+"&postratings_"+post_id+"_nonce="+post_ratings_nonce,cache:!1,success:rate_post_success})}):(ratingsL10n.show_loading&&jQuery("#post-ratings-"+post_id+"-loading").show(),jQuery.ajax({type:"POST",xhrFields:{withCredentials:!0},dataType:"html",url:ratingsL10n.ajax_url,data:"action=postratings&pid="+post_id+"&rate="+post_rating+"&postratings_"+post_id+"_nonce="+post_ratings_nonce,
cache:!1,success:rate_post_success}))}};
(function(){
const siteNavigation=document.getElementById('site-navigation');
if(! siteNavigation){
return;
}
const button=siteNavigation.getElementsByTagName('button')[ 0 ];
if('undefined'===typeof button){
return;
}
const menu=siteNavigation.getElementsByTagName('ul')[ 0 ];
if('undefined'===typeof menu){
button.style.display='none';
return;
}
if(! menu.classList.contains('nav-menu')){
menu.classList.add('nav-menu');
}
button.addEventListener('click', function(){
siteNavigation.classList.toggle('toggled');
if(button.getAttribute('aria-expanded')==='true'){
button.setAttribute('aria-expanded', 'false');
}else{
button.setAttribute('aria-expanded', 'true');
}});
document.addEventListener('click', function(event){
const isClickInside=siteNavigation.contains(event.target);
if(! isClickInside){
siteNavigation.classList.remove('toggled');
button.setAttribute('aria-expanded', 'false');
}});
const links=menu.getElementsByTagName('a');
const linksWithChildren=menu.querySelectorAll('.menu-item-has-children > a, .page_item_has_children > a');
for(const link of links){
link.addEventListener('focus', toggleFocus, true);
link.addEventListener('blur', toggleFocus, true);
}
for(const link of linksWithChildren){
link.addEventListener('touchstart', toggleFocus, false);
}
function toggleFocus(){
if(event.type==='focus'||event.type==='blur'){
let self=this;
while(! self.classList.contains('nav-menu')){
if('li'===self.tagName.toLowerCase()){
self.classList.toggle('focus');
}
self=self.parentNode;
}}
if(event.type==='touchstart'){
const menuItem=this.parentNode;
event.preventDefault();
for(const link of menuItem.parentNode.children){
if(menuItem!==link){
link.classList.remove('focus');
}}
menuItem.classList.toggle('focus');
}}
}());
window.addComment=function(v){var I,C,h,E=v.document,b={commentReplyClass:"comment-reply-link",commentReplyTitleId:"reply-title",cancelReplyId:"cancel-comment-reply-link",commentFormId:"commentform",temporaryFormId:"wp-temp-form-div",parentIdFieldId:"comment_parent",postIdFieldId:"comment_post_ID"},e=v.MutationObserver||v.WebKitMutationObserver||v.MozMutationObserver,r="querySelector"in E&&"addEventListener"in v,n=!!E.documentElement.dataset;function t(){d(),e&&new e(o).observe(E.body,{childList:!0,subtree:!0})}function d(e){if(r&&(I=g(b.cancelReplyId),C=g(b.commentFormId),I)){I.addEventListener("touchstart",l),I.addEventListener("click",l);function t(e){if((e.metaKey||e.ctrlKey)&&13===e.keyCode&&"a"!==E.activeElement.tagName.toLowerCase())return C.removeEventListener("keydown",t),e.preventDefault(),C.submit.click(),!1}C&&C.addEventListener("keydown",t);for(var n,d=function(e){var t=b.commentReplyClass;e&&e.childNodes||(e=E);e=E.getElementsByClassName?e.getElementsByClassName(t):e.querySelectorAll("."+t);return e}(e),o=0,i=d.length;o<i;o++)(n=d[o]).addEventListener("touchstart",a),n.addEventListener("click",a)}}function l(e){var t,n,d=g(b.temporaryFormId);d&&h&&(g(b.parentIdFieldId).value="0",t=d.textContent,d.parentNode.replaceChild(h,d),this.style.display="none",n=(d=(d=g(b.commentReplyTitleId))&&d.firstChild)&&d.nextSibling,d&&d.nodeType===Node.TEXT_NODE&&t&&(n&&"A"===n.nodeName&&n.id!==b.cancelReplyId&&(n.style.display=""),d.textContent=t),e.preventDefault())}function a(e){var t=g(b.commentReplyTitleId),t=t&&t.firstChild.textContent,n=this,d=m(n,"belowelement"),o=m(n,"commentid"),i=m(n,"respondelement"),r=m(n,"postid"),n=m(n,"replyto")||t;d&&o&&i&&r&&!1===v.addComment.moveForm(d,o,i,r,n)&&e.preventDefault()}function o(e){for(var t=e.length;t--;)if(e[t].addedNodes.length)return void d()}function m(e,t){return n?e.dataset[t]:e.getAttribute("data-"+t)}function g(e){return E.getElementById(e)}return r&&"loading"!==E.readyState?t():r&&v.addEventListener("DOMContentLoaded",t,!1),{init:d,moveForm:function(e,t,n,d,o){var i,r,l,a,m,c,s,e=g(e),n=(h=g(n),g(b.parentIdFieldId)),y=g(b.postIdFieldId),p=g(b.commentReplyTitleId),u=(p=p&&p.firstChild)&&p.nextSibling;if(e&&h&&n){void 0===o&&(o=p&&p.textContent),a=h,m=b.temporaryFormId,c=g(m),s=(s=g(b.commentReplyTitleId))?s.firstChild.textContent:"",c||((c=E.createElement("div")).id=m,c.style.display="none",c.textContent=s,a.parentNode.insertBefore(c,a)),d&&y&&(y.value=d),n.value=t,I.style.display="",e.parentNode.insertBefore(h,e.nextSibling),p&&p.nodeType===Node.TEXT_NODE&&(u&&"A"===u.nodeName&&u.id!==b.cancelReplyId&&(u.style.display="none"),p.textContent=o),I.onclick=function(){return!1};try{for(var f=0;f<C.elements.length;f++)if(i=C.elements[f],r=!1,"getComputedStyle"in v?l=v.getComputedStyle(i):E.documentElement.currentStyle&&(l=i.currentStyle),(i.offsetWidth<=0&&i.offsetHeight<=0||"hidden"===l.visibility)&&(r=!0),"hidden"!==i.type&&!i.disabled&&!r){i.focus();break}}catch(e){}return!1}}}}(window);
!function(){"use strict";var e=window&&window.__assign||function(){return e=Object.assign||function(e){for(var t,s=1,i=arguments.length;s<i;s++)for(var r in t=arguments[s])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},e.apply(this,arguments)},t={lines:12,length:7,width:5,radius:10,scale:1,corners:1,color:"#000",fadeColor:"transparent",animation:"spinner-line-fade-default",rotate:0,direction:1,speed:1,zIndex:2e9,className:"spinner",top:"50%",left:"50%",shadow:"0 0 1px transparent",position:"absolute"},s=function(){function s(s){void 0===s&&(s={}),this.opts=e(e({},t),s)}return s.prototype.spin=function(e){return this.stop(),this.el=document.createElement("div"),this.el.className=this.opts.className,this.el.setAttribute("role","progressbar"),this.el.style.position=this.opts.position,this.el.style.width="0",this.el.style.zIndex=this.opts.zIndex.toString(),this.el.style.left=this.opts.left,this.el.style.top=this.opts.top,this.el.style.transform="scale(".concat(this.opts.scale,")"),e&&e.insertBefore(this.el,e.firstChild||null),function(e,t){var s=Math.round(t.corners*t.width*500)/1e3+"px",n="none";!0===t.shadow?n="0 2px 4px #000":"string"==typeof t.shadow&&(n=t.shadow);for(var a=function(e){for(var t=/^\s*([a-zA-Z]+\s+)?(-?\d+(\.\d+)?)([a-zA-Z]*)\s+(-?\d+(\.\d+)?)([a-zA-Z]*)(.*)$/,s=[],i=0,r=e.split(",");i<r.length;i++){var n=r[i].match(t);if(null!==n){var a=+n[2],o=+n[5],h=n[4],l=n[7];0!==a||h||(h=l),0!==o||l||(l=h),h===l&&s.push({prefix:n[1]||"",x:a,y:o,xUnits:h,yUnits:l,end:n[8]})}}return s}(n),o=0;o<t.lines;o++){var h=~~(360/t.lines*o+t.rotate),l=document.createElement("div");l.style.position="absolute",l.style.top="".concat(-t.width/2,"px"),l.style.width=t.length+t.width+"px",l.style.height=t.width+"px",l.style.background=i(t.fadeColor,o),l.style.borderRadius=s,l.style.transformOrigin="left",l.style.transform="rotate(".concat(h,"deg) translateX(").concat(t.radius,"px)");var u=o*t.direction/t.lines/t.speed;u-=1/t.speed;var c=document.createElement("div");c.style.width="100%",c.style.height="100%",c.style.background=i(t.color,o),c.style.borderRadius=s,c.style.boxShadow=r(a,h),c.style.animation="".concat(1/t.speed,"s linear ").concat(u,"s infinite ").concat(t.animation),l.appendChild(c),e.appendChild(l)}}(this.el,this.opts),this},s.prototype.stop=function(){return this.el&&(this.el.parentNode&&this.el.parentNode.removeChild(this.el),this.el=void 0),this},s}();function i(e,t){return"string"==typeof e?e:e[t%e.length]}function r(e,t){for(var s=[],i=0,r=e;i<r.length;i++){var a=r[i],o=n(a.x,a.y,t);s.push(a.prefix+o[0]+a.xUnits+" "+o[1]+a.yUnits+a.end)}return s.join(", ")}function n(e,t,s){var i=s*Math.PI/180,r=Math.sin(i),n=Math.cos(i);return[Math.round(1e3*(e*n+t*r))/1e3,Math.round(1e3*(-e*r+t*n))/1e3]}!function(){var e="searchwp_live_search";function t(e){this.config=null,this.input_el=e,this.results_id=null,this.results_el=null,this.parent_el=null,this.results_showing=!1,this.form_el=null,this.timer=!1,this.last_string="",this.spinner=null,this.spinner_showing=!1,this.has_results=!1,this.current_request=!1,this.results_destroy_on_blur=!0,this.a11y_keys=[27,40,13,38,9],this.init()}t.prototype={init:function(){var e=this,t=this.input_el;this.form_el=t.parents("form:eq(0)"),this.results_id=this.uniqid("searchwp_live_search_results_");var i=!1,r=t.data("swpconfig");if(r&&void 0!==r)for(var n in searchwp_live_search_params.config)r===n&&(i=!0,this.config=searchwp_live_search_params.config[n]);else for(var a in searchwp_live_search_params.config)"default"===a&&(i=!0,this.config=searchwp_live_search_params.config[a]);if(i){var o=t.data("swpengine");o||(o=this.config.engine),t.data("swpengine",o),t.attr("autocomplete","off"),t.attr("aria-owns",this.results_id),t.attr("aria-autocomplete","both"),t.attr("aria-label",searchwp_live_search_params.aria_instructions);var h='<div aria-expanded="false" class="searchwp-live-search-results" id="'+this.results_id+'" tabindex="0"></div>',l=t.data("swpparentel");l?(this.parent_el=jQuery(l),this.parent_el.append(h)):this.config.parent_el?(this.parent_el=jQuery(this.config.parent_el),this.parent_el.append(h)):jQuery("body").append(jQuery(h)),this.results_el=jQuery("#"+this.results_id),this.position_results(),jQuery(window).on("resize",(function(){e.position_results()})),this.config.spinner&&(void 0===this.config.spinner.scale&&(this.config.spinner.scale=1),void 0===this.config.spinner.fadeColor&&(this.config.spinner.fadeColor="transparent"),void 0===this.config.spinner.animation&&(this.config.spinner.animation="searchwp-spinner-line-fade-quick"),void 0===this.config.spinner.position&&(this.config.spinner.position="absolute"),this.spinner=new s(this.config.spinner)),void 0===this.config.abort_on_enter&&(this.config.abort_on_enter=!0),t.on("keyup",(function(t){jQuery.inArray(t.keyCode,e.a11y_keys)>-1||(e.current_request&&e.config.abort_on_enter&&13===t.keyCode&&e.current_request.abort(),e.input_el.val().trim().length?e.results_showing||(e.position_results(),e.results_el.addClass("searchwp-live-search-results-showing").attr("role","listbox"),e.show_spinner(),e.results_showing=!0):e.destroy_results(),e.has_results&&!e.spinner_showing&&e.last_string!==e.input_el.val().trim()&&(e.results_el.empty(),e.show_spinner()),t.currentTarget.value.length>=e.config.input.min_chars?e.results_el.removeClass("searchwp-live-search-no-min-chars"):e.results_el.addClass("searchwp-live-search-no-min-chars"),e.position_results())})).on("keyup",jQuery.proxy(this.maybe_search,this)),(this.config.results_destroy_on_blur||void 0===this.config.results_destroy_on_blur)&&jQuery("html").on("click",(function(t){jQuery(t.target).parents(".searchwp-live-search-results").length||e.destroy_results()})),t.on("click",(function(e){e.stopPropagation()}))}else alert(searchwp_live_search_params.msg_no_config_found)},keyboard_navigation:function(){var e=this,t=this.input_el,s=this.results_el,i="searchwp-live-search-result--focused",r=".searchwp-live-search-result",n=this.a11y_keys;jQuery(document).off("keyup.searchwp_a11y").on("keyup.searchwp_a11y",(function(a){if(s.hasClass("searchwp-live-search-results-showing")){if(-1!==jQuery.inArray(a.keyCode,n)){if(a.preventDefault(),27===a.keyCode)return e.destroy_results(),jQuery(document).off("keyup.searchwp_a11y"),t.focus(),void jQuery(document).trigger("searchwp_live_escape_results");if(40===a.keyCode){var o=jQuery(s[0]).find("."+i);1===o.length&&1===o.next().length?o.removeClass(i).attr("aria-selected","false").next().addClass(i).attr("aria-selected","true").find("a").focus():(o.removeClass(i).attr("aria-selected","false"),s.find(r+":first").addClass(i).attr("aria-selected","true").find("a").focus()),jQuery(document).trigger("searchwp_live_key_arrowdown_pressed")}if(38===a.keyCode){var h=jQuery(s[0]).find("."+i);1===h.length&&1===h.prev().length?h.removeClass(i).attr("aria-selected","false").prev().addClass(i).attr("aria-selected","true").find("a").focus():(h.removeClass(i).attr("aria-selected","false"),s.find(r+":last").addClass(i).attr("aria-selected","true").find("a").focus()),jQuery(document).trigger("searchwp_live_key_arrowup_pressed")}13===a.keyCode&&jQuery(document).trigger("searchwp_live_key_enter_pressed"),9===a.keyCode&&jQuery(document).trigger("searchwp_live_key_tab_pressed")}}else jQuery(document).off("keyup.searchwp_a11y")})),jQuery(document).trigger("searchwp_live_keyboad_navigation")},aria_expanded:function(e){var t=this.results_el;e?t.attr("aria-expanded","true"):t.attr("aria-expanded","false"),jQuery(document).trigger("searchwp_live_aria_expanded")},position_results:function(){var e=this.input_el,t=e.parents("form:eq(0)"),s=e.parents(".wp-block-search__inside-wrapper"),i=t.hasClass("wp-block-search__button-inside"),r=this.results_el,n={},a=0;if(!e.is(":hidden")){if(s.length&&i&&(e=s),(n=e.offset()).left+=parseInt(this.config.results.offset.x,10),n.top+=parseInt(this.config.results.offset.y,10),"top"===this.config.results.position)a=0-r.height();else a=e.outerHeight();r.css("left",n.left),r.css("top",n.top+a+"px"),"auto"===this.config.results.width&&r.width(e.outerWidth()-parseInt(r.css("paddingRight").replace("px",""),10)-parseInt(r.css("paddingLeft").replace("px",""),10)),jQuery(document).trigger("searchwp_live_position_results",[r.css("left"),r.css("top"),r.width()])}},destroy_results:function(e){this.hide_spinner(),this.aria_expanded(!1),this.results_el.empty().removeClass("searchwp-live-search-results-showing"),this.results_el.removeAttr("role"),this.results_showing=!1,this.has_results=!1,jQuery(document).trigger("searchwp_live_destroy_results")},maybe_search:function(e){jQuery.inArray(e.keyCode,this.a11y_keys)>-1||(clearTimeout(this.timer),e.currentTarget.value.length>=this.config.input.min_chars&&(this.current_request&&this.current_request.abort(),this.timer=setTimeout(jQuery.proxy(this.search,this,e),this.config.input.delay)))},show_spinner:function(){this.config.spinner&&!this.spinner_showing&&(this.spinner.spin(document.getElementById(this.results_id)),this.spinner_showing=!0,jQuery(document).trigger("searchwp_live_show_spinner"))},hide_spinner:function(){this.config.spinner&&(this.spinner.stop(),this.spinner_showing=!1,jQuery(document).trigger("searchwp_live_hide_spinner"))},search:function(e){var t=this,s=this.form_el,i=s.serialize(),r=s.attr("action")?s.attr("action"):"",n=this.input_el,a=this.results_el;jQuery(document).trigger("searchwp_live_search_start",[n,a,s,r,i]),this.aria_expanded(!1),i+="&action=searchwp_live_search&swpengine="+n.data("swpengine"),i+="&swpquery="+encodeURIComponent(n.val()),i+="&origin_id="+parseInt(searchwp_live_search_params.origin_id,10),-1!==r.indexOf("?")&&(r=r.split("?"),i+="&"+r[1]),this.last_string=n.val(),this.has_results=!0,this.current_request=jQuery.ajax({url:searchwp_live_search_params.ajaxurl,type:"GET",data:i,complete:function(){jQuery(document).trigger("searchwp_live_search_complete",[n,a,s,r,i]),t.spinner_showing=!1,this.current_request=!1,jQuery(document).trigger("searchwp_live_search_shutdown",[n,a,s,r,i])},success:function(e){0===e&&(e=""),jQuery(document).trigger("searchwp_live_search_success",[n,a,s,r,i]),a.html(e),t.position_results(),t.aria_expanded(!0),t.keyboard_navigation(),jQuery(document).trigger("searchwp_live_search_shutdown",[n,a,s,r,i])}})},uniqid:function(e,t){var s;void 0===e&&(e="");var i=function(e,t){return t<(e=parseInt(e,10).toString(16)).length?e.slice(e.length-t):t>e.length?new Array(t-e.length+1).join("0")+e:e};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,s=e,s+=i(parseInt((new Date).getTime()/1e3,10),8),s+=i(this.php_js.uniqidSeed,5),t&&(s+=(10*Math.random()).toFixed(8).toString()),s}},jQuery.fn[e]=function(s){return this.each((function(){jQuery.data(this,"plugin_"+e)||jQuery.data(this,"plugin_"+e,new t(jQuery(this)))})),this}}(),jQuery(document).ready((function(){"function"==typeof jQuery().searchwp_live_search&&(jQuery('input[data-swplive="true"]').searchwp_live_search(),"undefined"!=typeof _SEARCHWP_LIVE_AJAX_SEARCH_BLOCKS&&_SEARCHWP_LIVE_AJAX_SEARCH_BLOCKS&&jQuery("input.wp-block-search__input").each((function(){jQuery(this).attr("data-swpengine",_SEARCHWP_LIVE_AJAX_SEARCH_ENGINE),jQuery(this).attr("data-swpconfig",_SEARCHWP_LIVE_AJAX_SEARCH_CONFIG),jQuery(this).searchwp_live_search()})))}))}();
(function(){
var supportsPassive=false;
try {
var opts=Object.defineProperty({}, 'passive', {
get:function(){
supportsPassive=true;
}});
window.addEventListener('testPassive', null, opts);
window.removeEventListener('testPassive', null, opts);
} catch(e){}
function init(){
var input_begin='';
var keydowns={};
var lastKeyup=null;
var lastKeydown=null;
var keypresses=[];
var modifierKeys=[];
var correctionKeys=[];
var lastMouseup=null;
var lastMousedown=null;
var mouseclicks=[];
var mouseclickCoordinates=[];
var mousemoveTimer=null;
var lastMousemoveX=null;
var lastMousemoveY=null;
var mousemoveStart=null;
var mousemoves=[];
var touchmoveCountTimer=null;
var touchmoveCount=0;
var lastTouchEnd=null;
var lastTouchStart=null;
var touchEvents=[];
var scrollCountTimer=null;
var scrollCount=0;
var correctionKeyCodes=[ 'Backspace', 'Delete', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Home', 'End', 'PageUp', 'PageDown' ];
var modifierKeyCodes=[ 'Shift', 'CapsLock' ];
var forms=document.querySelectorAll('form[method=post]');
for(var i=0; i < forms.length; i++){
var form=forms[i];
var formAction=form.getAttribute('action');
if(formAction){
if(formAction.indexOf('http://')==0||formAction.indexOf('https://')==0){
if(formAction.indexOf('http://' + window.location.hostname + '/')!=0&&formAction.indexOf('https://' + window.location.hostname + '/')!=0){
continue;
}}
}
form.addEventListener('submit', function (){
var ak_bkp=prepare_array_for_request(keypresses);
var ak_bmc=prepare_array_for_request(mouseclicks);
var ak_bte=prepare_array_for_request(touchEvents);
var ak_bmm=prepare_array_for_request(mousemoves);
var ak_bcc=prepare_array_for_request(mouseclickCoordinates);
var input_fields={
'bib': input_begin,
'bfs': Date.now(),
'bkpc': keypresses.length,
'bkp': ak_bkp,
'bmc': ak_bmc,
'bmcc': mouseclicks.length,
'bmk': modifierKeys.join(';'),
'bck': correctionKeys.join(';'),
'bmmc': mousemoves.length,
'btmc': touchmoveCount,
'bsc': scrollCount,
'bte': ak_bte,
'btec':touchEvents.length,
'bmm':ak_bmm,
'bcc':ak_bcc
};
var akismet_field_prefix='ak_';
if(this.getElementsByClassName){
var possible_akismet_containers=this.getElementsByClassName('akismet-fields-container');
for(var containerIndex=0; containerIndex < possible_akismet_containers.length; containerIndex++){
var container=possible_akismet_containers.item(containerIndex);
if(container.getAttribute('data-prefix')){
akismet_field_prefix=container.getAttribute('data-prefix');
break;
}}
}
for(var field_name in input_fields){
var field=document.createElement('input');
field.setAttribute('type', 'hidden');
field.setAttribute('name', akismet_field_prefix + field_name);
field.setAttribute('value', input_fields[ field_name ]);
this.appendChild(field);
}}, supportsPassive ? { passive: true }:false);
form.addEventListener('keydown', function(e){
if(e.key in keydowns){
return;
}
var keydownTime=(new Date()).getTime();
keydowns[ e.key ]=[ keydownTime ];
if(! input_begin){
input_begin=keydownTime;
}
var lastKeyEvent=Math.max(lastKeydown, lastKeyup);
if(lastKeyEvent){
keydowns[ e.key ].push(keydownTime - lastKeyEvent);
}
lastKeydown=keydownTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener('keyup', function(e){
if(!(e.key in keydowns)){
return;
}
var keyupTime=(new Date()).getTime();
if('TEXTAREA'===e.target.nodeName||'INPUT'===e.target.nodeName){
if(-1!==modifierKeyCodes.indexOf(e.key)){
modifierKeys.push(keypresses.length - 1);
}else if(-1!==correctionKeyCodes.indexOf(e.key)){
correctionKeys.push(keypresses.length - 1);
}else{
var keydownTime=keydowns[ e.key ][0];
var keypress=[];
keypress.push(keyupTime - keydownTime);
if(keydowns[ e.key ].length > 1){
keypress.push(keydowns[ e.key ][1]);
}
keypresses.push(keypress);
}}
delete keydowns[ e.key ];
lastKeyup=keyupTime;
}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusin", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
form.addEventListener("focusout", function(e){
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
}
document.addEventListener('mousedown', function(e){
lastMousedown=(new Date()).getTime();
var mouseclickCoordinate=[];
var rect=e.target.getBoundingClientRect();
var relativeX=e.clientX - rect.left;
var relativeY=e.clientY - rect.top;
mouseclickCoordinate.push(Math.round(relativeX));
mouseclickCoordinate.push(Math.round(relativeY));
mouseclickCoordinate.push(rect.width > 0 ? Math.round(relativeX / rect.width * 100):0);
mouseclickCoordinate.push(rect.height > 0 ? Math.round(relativeY / rect.height * 100):0);
mouseclickCoordinates.push(mouseclickCoordinate);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('mouseup', function(e){
if(! lastMousedown){
return;
}
var now=(new Date()).getTime();
var mouseclick=[];
mouseclick.push(now - lastMousedown);
if(lastMouseup){
mouseclick.push(lastMousedown - lastMouseup);
}
mouseclicks.push(mouseclick);
lastMouseup=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('mousemove', function(e){
if(mousemoveTimer){
clearTimeout(mousemoveTimer);
mousemoveTimer=null;
}else{
mousemoveStart=(new Date()).getTime();
lastMousemoveX=e.offsetX;
lastMousemoveY=e.offsetY;
}
mousemoveTimer=setTimeout(function(theEvent, originalMousemoveStart){
var now=(new Date()).getTime() - 500;
var mousemove=[];
mousemove.push(now - originalMousemoveStart);
mousemove.push(Math.round(Math.sqrt(Math.pow(theEvent.offsetX - lastMousemoveX, 2) +
Math.pow(theEvent.offsetY - lastMousemoveY, 2)
)
)
);
if(mousemove[1] > 0){
mousemoves.push(mousemove);
}
mousemoveStart=null;
mousemoveTimer=null;
}, 500, e, mousemoveStart);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchmove', function(e){
if(touchmoveCountTimer){
clearTimeout(touchmoveCountTimer);
}
touchmoveCountTimer=setTimeout(function (){
touchmoveCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchstart', function(e){
lastTouchStart=(new Date()).getTime();
}, supportsPassive ? { passive: true }:false);
document.addEventListener('touchend', function(e){
if(! lastTouchStart){
return;
}
var now=(new Date()).getTime();
var touchEvent=[];
touchEvent.push(now - lastTouchStart);
if(lastTouchEnd){
touchEvent.push(lastTouchStart - lastTouchEnd);
}
touchEvents.push(touchEvent);
lastTouchEnd=now;
lastKeydown=null;
lastKeyup=null;
keydowns={};}, supportsPassive ? { passive: true }:false);
document.addEventListener('scroll', function(e){
if(scrollCountTimer){
clearTimeout(scrollCountTimer);
}
scrollCountTimer=setTimeout(function (){
scrollCount++;
}, 500);
}, supportsPassive ? { passive: true }:false);
}
function prepare_array_for_request(a, limit){
if(! limit){
limit=100;
}
var rv='';
if(a.length > 0){
var random_starting_point=Math.max(0, Math.floor(Math.random() * a.length - limit));
for(var i=0; i < limit&&i < a.length; i++){
var entry=a[ random_starting_point + i ];
rv +=entry.join(',') + ';';
}}
return rv;
}
if(document.readyState!=='loading'){
init();
}else{
document.addEventListener('DOMContentLoaded', init);
}})();
$(function(){
document.getElementById('burger').onclick=function(){
const menu=document.getElementById('mobile-menu')
menu.style.display='block'
document.body.style.overflow='hidden';
}
document.getElementById('close').onclick=function(){
const menu=document.getElementById('mobile-menu')
menu.style.display='none'
document.body.style.overflow='visible';
}
const btnformodal=document.getElementsByClassName("btn-for-modal")
for(let i=0; i < btnformodal.length;i++){
btnformodal[i].addEventListener("click", ()=> {
document.getElementById('modal-window').style.display="block";
document.body.style.overflow='hidden';
})
}
document.getElementById("modal-close").addEventListener("click", ()=> {
document.getElementById('modal-window').style.display="none";
document.body.style.overflow='auto';
})
})
$(window).scroll(function(){300<$(this).scrollTop()?$(".scrollup").fadeIn():$(".scrollup").fadeOut()}),$(".scrollup").click(function(){return $("html, body").animate({scrollTop:0},600),!1});
$(document).ready(function(){
if((window).innerWidth <=1023){
document.querySelector('.lang_fix').onclick=function(){
document.querySelector('.mob_fix').classList.toggle('show');
};}});
const urlParams=new URLSearchParams(window.location.search);
const gclidParam=urlParams.get('gclid');
if(gclidParam!==null){
const ulElement=document.getElementById('ft_link_phone');
ulElement.innerHTML='';
const block=document.getElementById('ft_link_phone');
block.innerHTML='<li><a href="tel:+380 (93) 011 80 57" rel="nofollow">+380 (93) 011 80 57</a></li>';
sessionStorage.setItem('block_content', block.innerHTML);
}else{
const savedContent=sessionStorage.getItem('block_content');
if(savedContent!==null){
const ulElement=document.getElementById('ft_link_phone');
ulElement.innerHTML='';
const block=document.getElementById('ft_link_phone');
block.innerHTML=savedContent;
}};
const correct_text=document.getElementById('helper').dataset.correct
const incorrect_text=document.getElementById('helper').dataset.incorrect
const reset_text=document.getElementById('helper').dataset.newcheck
const questionsOne=document.getElementsByClassName("question-one")
for (const question of questionsOne){
const answer=question.dataset.answer;
const btn=question.getElementsByClassName('checkAnswer')[0]
btn.addEventListener('click', ()=> {
const placeForAnswer=question.getElementsByClassName('placeForAnswer')[0];
const userAnswer=question.querySelector('.question__choices input:checked').value;
const inputs=question.querySelectorAll('input')
for (const input of inputs){
input.disabled=true;
}
const block=document.createElement('div');
if(userAnswer===answer){
block.classList.add('answer-correct')
block.innerText=correct_text
}else{
block.classList.add('answer-incorrect')
block.innerText=incorrect_text
const resetBtn=document.createElement('button');
resetBtn.innerHTML=reset_text;
question.appendChild(resetBtn);
resetBtn.addEventListener('click', ()=> {
const placeForAnswer=question.getElementsByClassName('placeForAnswer')[0];
const inputs=question.querySelectorAll('input');
for (const input of inputs){
input.checked=false;
input.disabled=false;
}
while (placeForAnswer.firstChild){
placeForAnswer.firstChild.remove();
}
btn.style.display="block";
resetBtn.style.display="none";
});
}
placeForAnswer.appendChild(block)
btn.style.display="none"
})
}
const questions=document.getElementsByClassName("question-several")
for (const question of questions){
const answer=question.dataset.answer;
const parsedAnswer=JSON.parse(answer);
const btn=question.getElementsByClassName('checkAnswer')[0]
btn.addEventListener('click', ()=> {
const placeForAnswer=question.getElementsByClassName('placeForAnswer')[0];
const userAnswer=question.querySelectorAll('input:checked');
let result=true;
if(userAnswer.length===parsedAnswer.length){
for (let i=0; i < userAnswer.length; i++){
if(parsedAnswer[i]!=userAnswer[i].value){
result=false;
break;
}}
}else{
result=false;
}
const inputs=question.querySelectorAll('input')
for (const input of inputs){
input.disabled=true;
}
const block=document.createElement('div');
if(result){
block.classList.add('answer-correct')
block.innerText=correct_text
}else{
block.classList.add('answer-incorrect')
block.innerText=incorrect_text
}
placeForAnswer.appendChild(block)
btn.style.display="none"
})
}
const accordions=document.getElementsByClassName('accordion');
for (const accordion of accordions){
const items=accordion.getElementsByClassName('accordion__content')[0].children;
const close=()=> {
for (const item of accordion.getElementsByClassName('accordion__itemContent')){
item.style.display="none"
}
for (const item of accordion.getElementsByClassName('accordion__arrow')){
item.style.transform="rotate(0deg)";
}}
for (const item of items){
item.addEventListener('click', ()=> {
const itemContent=item.getElementsByClassName('accordion__itemContent')[0];
const itemArrow=item.getElementsByClassName('accordion__arrow')[0];
if(itemContent.style.display==='block'){
close();
}else{
close()
itemContent.style.display="block";
itemArrow.style.transform="rotate(180deg)";
}})
}}
$(document).ready(function (){
$('.slider').slick({
slidesToShow: 1,
arrows: false,
dots: true,
customPaging: function (){
return '<div class="custom-dots light"/>'
},
});
});