"use strict";
(function ($) {
    $.block_review_comment = function (element, options) {
        let defaults = {
            row_state_template: ""
        };
        let plugin = this;
        plugin.settings = {}
        let $element = $(element);
        plugin.init = function () {
            plugin.settings = $.extend({}, defaults, options);
            $element.find('#owl-carousel').owlCarousel({
                loop: true,
                margin: 30,
                autoplay:false,
                items:1,
                responsive:{
                    0:{
                        items:1,
                        nav:false,
                        dots:true
                    },
                    576:{
                        items:1,
                        nav:false,
                        dots:true
                    },
                    768:{
                        items:1,
                        dots:true,
                        nav:false,
                    },
                    992:{
                        items:1,
                        dots:true,
                        nav:false,
                    }

                }
            })
            var swiper = new Swiper('.swiper-container', {
                slidesPerView: 3,
                slidesToScroll:1,
                grabCursor: true,
                spaceBetween: 1,
                pagination: {
                    el: '.swiper-pagination',
                    clickable: true,
                },
                navigation: {
                    nextEl: '.swiper-button-next',
                    prevEl: '.swiper-button-prev',
                },
            });
            $element.find('.swiper-slide').click(function (e) {
                $element.find('.swiper-slide').not(this).removeClass('swiper-slide-next')
                $(this).addClass('swiper-slide-next')
            });

        }
        plugin.example_function = function () {
        }
        plugin.init();
    }
    $.fn.block_review_comment = function (options) {
        return this.each(function () {
            if (undefined === $(this).data('block_review_comment')) {
                let plugin = new $.block_review_comment(this, options);
                $(this).data('block_review_comment'
                    , plugin);
            }
        });
    }
})(jQuery);
