jQuery(document).ready(function ($) {
	// Home2023 Testimonials
	if (jQuery('.slider-testimonials').length) {
		jQuery('.slider-testimonials .fl-col-content').slick({
			slidesToShow: 3,
			slidesToScroll: 1,
			centerMode: true,
			//variableWidth: true,
			arrows: false,
			dots: false,
			infinite: true,
			autoplay: true,
			autoplaySpeed: 2500,
			responsive: [
				{
					breakpoint: 980,
					settings: {
						slidesToShow: 1,
						centerMode: false,
						//adaptiveHeight: true,
					},
				},
			],
		});
	}

	if (jQuery('.testimonial-items').length) {
		jQuery('.testimonial-items .fl-col-content').slick({
			slidesToShow: 3,
			slidesToScroll: 0,
			centerMode: true,
			//variableWidth: true,
			arrows: false,
			dots: false,
			infinite: true,
			autoplay: false,
			autoplaySpeed: 4000,
			responsive: [
				{
					breakpoint: 980,
					settings: {
						slidesToShow: 1,
								autoplay: true,
						slidesToScroll: 1,
						centerMode: false,
						//adaptiveHeight: true,
					},
				},
			],
		});
	}

	//Social Share
	if ($('a.fl-post-sharing-btn').length) {
		$('a.fl-post-sharing-btn').on('click', function(e) {
				e.preventDefault();
				$(this).toggleClass('active');
		})
	}
	//End Social Share

	// Smooth scrolling to anchor
	var win = $(window);

	function bbScroll() {
		if ('undefined' != typeof FLBuilderLayoutConfig) {
			var offset = 120;

			if ('undefined' === typeof FLBuilderLayout) {
				return;
			}

			if ($('body.admin-bar').length > 0) {
				offset += 32;
			}

			FLBuilderLayoutConfig.anchorLinkAnimations.duration = 1000;
			FLBuilderLayoutConfig.anchorLinkAnimations.easing = 'swing';
			FLBuilderLayoutConfig.anchorLinkAnimations.offset = offset;
		}
	}

	bbScroll();
	win.on('resize', bbScroll);
	// Smooth scrolling to anchor
});
