$(document).ready(function(){function handleSlideCloning(){var viewportWidth=$(window).outerWidth();if(viewportWidth<1024){if(!$('.insightSlider .swiper-slide').hasClass('cloned')){$('.insightSlider .swiper-wrapper').append($('.insightSlider .swiper-slide').clone().addClass('cloned'));}}else{$('.insightSlider .swiper-slide.cloned').remove();}}
handleSlideCloning();var homeRateSlider=new Swiper(".insightSlider",{loop:true,loopAdditionalSlides:$(window).outerWidth()<1024?1:0,pagination:{el:".insightSlider .swiper-pagination",clickable:true,renderBullet:function(index,className){const totalSlides=document.querySelectorAll('.insightSlider .swiper-slide:not(.cloned)').length;if(index>=totalSlides){return'';}
return'<span class="'+className+'" data-index="'+index+'"> </span>';},},autoplay:false,navigation:{nextEl:".insightSlider .swiper-button-next",prevEl:".insightSlider .swiper-button-prev",},breakpoints:{370:{slidesPerView:1,spaceBetween:10,slidesPerGroup:1,centeredSlides:true,},768:{slidesPerView:2,spaceBetween:15,slidesPerGroup:1,centeredSlides:false,},1024:{slidesPerView:3,spaceBetween:20,slidesPerGroup:1,centeredSlides:false,},},on:{slideChange:function(){const totalSlides=document.querySelectorAll('.insightSlider .swiper-slide:not(.cloned)').length;const realIndex=this.realIndex%totalSlides;$(".insightSlider .swiper-pagination .swiper-pagination-bullet").removeClass("swiper-pagination-bullet-active");$(".insightSlider .swiper-pagination .swiper-pagination-bullet").eq(realIndex).addClass("swiper-pagination-bullet-active");$(".holidayscta").click(function(e){e.preventDefault();var targetId=$(this).data("target");var content=$("#"+targetId).clone().show();$(".descPopupText").html(content);$(".holidayspopup, .holidaysoverlay").fadeIn();});$(".close-holidays, .holidaysoverlay").click(function(){$(".holidayspopup, .holidaysoverlay").fadeOut();});},},});$(window).on("resize",function(){setTimeout(function(){if(homeRateSlider&&homeRateSlider.update){handleSlideCloning();homeRateSlider.params.loopAdditionalSlides=$(window).outerWidth()<1024?1:0;homeRateSlider.update();}},300);});});$(document).ready(function(){setMaxHeight();$(".fliping .flipCta").on("click",function(e){e.preventDefault();let $card=$(this).closest('.colblock');let $dis=$(this).closest('.swiper-slide');setTimeout(function(){$card.find('.front').css('transform','rotateY(180deg)');$card.find('.back').css('transform','rotateY(0deg)');$card.parent().addClass('fillflip');$dis.find('.discBlock').css('display','none');},500);setTimeout(function(){$dis.find('.discBlock').css('display','block');},3000);});$(".fliping .flipCta.backcta").on("click",function(e){e.preventDefault();let $card=$(this).closest('.colblock');setTimeout(function(){$card.find('.front').css('transform','rotateY(0deg)');$card.find('.back').css('transform','rotateY(180deg)');$card.parent().removeClass('fillflip');$dis.find('.discBlock').css('display','none');},500);setTimeout(function(){$dis.find('.discBlock').css('display','block');},3000);});function setMaxHeight(){$(".featuresPanel .carouselcontainer .swiper-slide .colblock .front, .featuresPanel .carouselcontainer .swiper-slide .colblock .back").css('height','auto');var heightsnew=$(".featuresPanel .carouselcontainer .swiper-slide .colblock .front").map(function(){return $(this).height();}).get();var maxHeightnew=Math.max.apply(null,heightsnew);if($(window).outerWidth()<1024){$(".featuresPanel .carouselcontainer .swiper-slide .colblock .front, .featuresPanel .carouselcontainer .swiper-slide .colblock .back").css('height',maxHeightnew+70);}else{$(".featuresPanel .carouselcontainer .swiper-slide .colblock .front, .featuresPanel .carouselcontainer .swiper-slide .colblock .back").css('height',maxHeightnew+137);}}
$(window).resize(function(){setTimeout(function(){setMaxHeight();},300);});});;;
