PageSourceSearch

https://www.allcamisetasnba.com/wp-content/plugins/razzi-addons/assets/js/product-shortcode.js

js allcamisetasnba.com collected 2026-10-08 04:32:45 UTC 90,235 bytes, 2,446 lines download raw bytes

1class RazziProductShortcodeWidgetHandler extends elementorModules.frontend.handlers.Base {
2    getDefaultSettings() {
3        return {
4            selectors: {
5                gallery: '.woocommerce-product-gallery'
6            },
7        };
8    }
9
10    getDefaultElements() {
11        const selectors = this.getSettings('selectors');
12
13        return {
14            $gallery: this.$element.find(selectors.gallery)
15        };
16
17    }
18
19    getSwipperOptions() {
20        const swiperOptions = {
21            watchOverflow: true,
22            slidesPerView: this.elements.$gallery.data('columns'),
23            spaceBetween: 15,
24            navigation: {
25                nextEl: this.elements.$gallery.find('.rz-gallery-button-next').get(0),
26                prevEl: this.elements.$gallery.find('.rz-gallery-button-prev').get(0),
27            },
28            breakpoints: {
29                300: {
30                    spaceBetween: 0,
31                    allowTouchMove: false,
32                },
33                991: {
34                    spaceBetween: 15,
35                },
36            }
37        };
38
39        return swiperOptions;
40    }
41
42    getFlexSliderInit() {
43        var self = this;
44
45        if (!self.$element.closest('body').hasClass('elementor-editor-active')) {
46            return;
47        }
48        const options = {
49            selector: '.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image',
50            allowOneSlide: false,
51            animation: "slide",
52            animationLoop: false,
53            controlNav: "thumbnails",
54            animationSpeed: 500,
55            directionNav: false,
56            rtl: false,
57            slideshow: false,
58            smoothHeight: true,
59            start: function () {
60                self.elements.$gallery.css('opacity', 1);
61            },
62        };
63
64        this.elements.$gallery.flexslider(options);
65    }
66
67    getImageZoomInit($target) {
68
69        if (!this.$element.closest('body').hasClass('elementor-editor-active')) {
70            return;
71        }
72
73        if (!jQuery.fn.zoom) {
74            return;
75        }
76
77
78        const settings = this.getElementSettings();
79
80        if (settings.show_image_zoom === 'show') {
81
82            var zoom_options = jQuery.extend({
83                touch: false
84            });
85
86            $target.trigger('zoom.destroy');
87            $target.zoom(zoom_options);
88        }
89    }
90
91    getVariationSwatcher() {
92
93        var $variations = this.$element.find('.variations_form');
94        if (typeof wc_add_to_cart_variation_params !== 'undefined') {
95            $variations.find('td.value select').each(function () {
96                jQuery(this).on('change', function () {
97                    var value = jQuery(this).find('option:selected').text();
98                    jQuery(this).closest('tr').find('td.label .razzi-attr-value').html(value);
99                }).trigger('change');
100            });
101        }
102    }
103
104    getSwiperInit() {
105        var $thumbnail = this.$element.find('.flex-control-thumbs');
106        $thumbnail.wrap('<div class="woocommerce-product-gallery__thumbs-carousel swiper-container linked-gallery-carousel"></div>');
107        $thumbnail.addClass('swiper-wrapper');
108        $thumbnail.find('li').addClass('swiper-slide');
109        $thumbnail.after('<span class="razzi-svg-icon rz-gallery-button-prev rz-swiper-button"><svg class="svg-icon" aria-hidden="true" role="img" focusable="false" width="13" height="24" viewBox="0 0 13 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.467723 13.1881L10.2737 23.5074C10.8975 24.1642 11.9089 24.1642 12.5324 23.5074C13.1559 22.8512 13.1559 21.787 12.5324 21.1308L3.85554 11.9998L12.5321 2.86914C13.1556 2.21269 13.1556 1.14853 12.5321 0.492339C11.9086 -0.164113 10.8973 -0.164113 10.2735 0.492339L0.46747 10.8118C0.155705 11.14 0 11.5698 0 11.9998C0 12.43 0.156009 12.86 0.467723 13.1881Z"></path></svg></span>');
110        $thumbnail.after('<span class="razzi-svg-icon rz-gallery-button-next rz-swiper-button"><svg class="svg-icon" aria-hidden="true" role="img" focusable="false" width="13" height="24" viewBox="0 0 13 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5323 13.1881L2.72626 23.5074C2.10248 24.1642 1.09112 24.1642 0.467647 23.5074C-0.155882 22.8512 -0.155882 21.787 0.467647 21.1308L9.14446 11.9998L0.467899 2.86914C-0.15563 2.21269 -0.15563 1.14853 0.467899 0.492339C1.09143 -0.164113 2.10273 -0.164113 2.72651 0.492339L12.5325 10.8118C12.8443 11.14 13 11.5698 13 
11011.9998C13 12.43 12.844 12.86 12.5323 13.1881Z"></path></svg></span>');
111
112        jQuery('li', $thumbnail).append('<span/>');
113
114        new Swiper(this.elements.$gallery.find('.linked-gallery-carousel').get(0), this.getSwipperOptions());
115    }
116
117    getLightBoxGalleryInit() {
118        var self = this;
119        const settings = this.getElementSettings();
120        if (this.$element.closest('body').hasClass('elementor-editor-active')) {
121            if (settings.show_lightbox !== 'show' && settings.show_image_zoom !== 'show') {
122                this.elements.$gallery.on('click', '.woocommerce-product-gallery__image > a', function (e) {
123                    return false;
124                });
125            }
126
127            if (settings.show_lightbox === 'show' && settings.show_image_zoom === 'show') {
128                this.elements.$gallery.on('click', '.woocommerce-product-gallery__image > .zoomImg', function (e) {
129                    jQuery(this).closest('.woocommerce-product-gallery__image').find('a').trigger('click');
130                });
131
132            }
133
134            if (jQuery.fn.quantityDropdown) {
135                self.$element.find('.quantity .qty').quantityDropdown();
136            }
137        } else {
138
139            if (settings.show_lightbox !== 'show') {
140                this.elements.$gallery.on('click', '.woocommerce-product-gallery__image > a', function (e) {
141                    return false;
142                });
143            }
144        }
145    }
146
147    getCountDownInit() {
148
149        if (!this.$element.closest('body').hasClass('elementor-editor-active')) {
150            return;
151        }
152
153        if (!jQuery.fn.rz_countdown) {
154            return;
155        }
156
157        this.$element.find('.razzi-countdown').rz_countdown();
158    }
159
160
161    onInit() {
162        var self = this;
163        super.onInit();
164
165        this.getCountDownInit();
166
167        this.getLightBoxGalleryInit();
168
169        this.getFlexSliderInit();
170
171        this.getVariationSwatcher();
172
173        this.getImageZoomInit(this.elements.$gallery.find('.woocommerce-product-gallery__image'));
174
175
176        this.elements.$gallery.imagesLoaded(function () {
177            setTimeout(function () {
178                self.getSwiperInit();
179            }, 200);
180
181        });
182    }
183}
184
185class RazziProductsMasonryWidgetHandler extends elementorModules.frontend.handlers.Base {
186    getDefaultSettings() {
187        return {
188            selectors: {
189                container: '.razzi-products-masonry'
190            },
191        };
192    }
193
194    getDefaultElements() {
195        const selectors = this.getSettings('selectors');
196
197        return {
198            $container: this.$element.find(selectors.container)
199        };
200
201    }
202
203    productsFound() {
204        var $found = this.elements.$container.find('.razzi-posts__found-inner'),
205            $foundEls = $found.find('.count-bar'),
206            $current = $found.find('.current-post').html(),
207            $total = $found.find('.found-post').html(),
208            pecent = ($current / $total) * 100;
209
210        $foundEls.css('width', pecent + '%');
211    }
212
213    loadProductsGrid() {
214        // Load Products
215        var self = this;
216
217        this.elements.$container.on('click', '.woocommerce-pagination a.next', function (e) {
218            e.preventDefault();
219
220            var $el = jQuery(this),
221                $nav = $el.closest('.woocommerce-pagination'),
222                url = $el.attr('href'),
223                $products = $el.closest('.razzi-products-masonry').find('ul.products'),
224                $currentPosts = $products.find('li.product:not(.has-banner)').length,
225                $found = $el.closest('.razzi-products-masonry').find('.razzi-posts__found');
226
227            $nav.addClass('loading');
228
229            jQuery.get(url, function (response) {
230                var $content = jQuery(response).find('.razzi-products-masonry ul.products li.product'),
231                    $navNew = jQuery(response).find('.razzi-products-masonry .woocommerce-pagination'),
232                    $foundItem = jQuery(response).find('.razzi-products-masonry ul.products li.product:not(.has-banner)'),
233                    $numberPosts = $foundItem.length + $currentPosts;
234
235                // Add animation class
236                for (var index = 0; index < $content.length; index++) {
237                    jQuery($content[index]).css('animation-delay', index * 100 + 'ms');
238                }
239                $content.addClass('razziFadeInUp');
240
241                $products.append($content);
242                $nav.replaceWith($navNew);
243
244                jQuery(document.body).trigger('razzi_products_masonry_loaded', [$content, true]);
245
246                $found.find('.current-post').html(' ' + $numberPosts);
247                self.productsFound();
248
249                $navNew.find('.next').parent().addClass('btn-load-more');
250                $navNew.removeClass('loading');
251            });
252        });
253    };
254
255    onInit() {
256        var self = this;
257        super.onInit();
258
259        this.elements.$container.find('.woocommerce-pagination .next').parent().addClass('btn-load-more');
260
261        self.loadProductsGrid();
262
263    }
264}
265
266class RazziProductsDealWidgetHandler extends elementorModules.frontend.handlers.Base {
267    getDefaultSettings() {
268        return {
269            selectors: {
270                container: '.razzi-products-deal'
271            },
272        };
273    }
274
275    getDefaultElements() {
276        const selectors = this.getSettings('selectors');
277
278        return {
279            $container: this.$element.find(selectors.container)
280        };
281
282    }
283
284    getProductSwiperInit() {
285        const settings = this.getElementSettings();
286
287        var $list = this.elements.$container.find('ul.product-loop-layout-deal');
288        $list.find('li.product').addClass('swiper-slide');
289        $list.after('<div class="swiper-pagination"></div>');
290        $list.after('<div class="swiper-scrollbar"></div>');
291
292        var slidesPerView = settings.centeredSlides == 'yes' ? 'auto' : settings.slidesToShow;
293
294        var options = {
295            watchOverflow: true,
296            pagination: {
297                el: this.elements.$container.find('.swiper-pagination').get(0),
298                clickable: true
299            },
300            scrollbar: {
301                el: '.swiper-scrollbar',
302                hide: false,
303                draggable: true
304            },
305            loop: settings.infinite == 'yes' ? true : false,
306            autoplay: settings.autoplay == 'yes' ? true : false,
307            speed: settings.speed,
308            centeredSlides: settings.centeredSlides == 'yes' ? true : false,
309            spaceBetween: 30,
310            on: {
311                init: function () {
312                    this.$el.css('opacity', 1);
313                }
314            },
315            breakpoints: {
316                300: {
317                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
318                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
319                    spaceBetween: 15,
320                },
321                480: {
322                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
323                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
324                    spaceBetween: 15,
325                },
326                768: {
327                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 3,
328                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 3,
329                },
330                1024: {
331                    slidesPerView: settings.slidesToShow > 5 ? 5 : slidesPerView,
332                    slidesPerGroup: settings.slidesToScroll > 5 ? 5 : settings.slidesToScroll,
333                    spaceBetween: 30
334                },
335                1366: {
336                    slidesPerView: settings.slidesToShow > 6 ? 6 : slidesPerView,
337                    slidesPerGroup: settings.slidesToScroll > 6 ? 6 : settings.slidesToScroll
338                },
339                1500: {
340                    slidesPerView: slidesPerView,
341                    slidesPerGroup: settings.slidesToScroll
342                }
343            }
344        };
345
346        new Swiper(this.elements.$container.find('.linked-products-deal-carousel').get(0), options);
347    }
348
349    onInit() {
350        var self = this;
351        super.onInit();
352
353        this.elements.$container.find('.razzi-countdown').rz_countdown();
354
355        this.elements.$container.imagesLoaded(function () {
356            setTimeout(function () {
357                self.getProductSwiperInit();
358            }, 200);
359
360        });
361    }
362}
363
364class RazziProductsDeal2WidgetHandler extends elementorModules.frontend.handlers.Base {
365    getDefaultSettings() {
366        return {
367            selectors: {
368                container: '.razzi-products-deal-2'
369            },
370        };
371    }
372
373    getDefaultElements() {
374        const selectors = this.getSettings('selectors');
375
376        return {
377            $container: this.$element.find(selectors.container)
378        };
379
380    }
381
382    getProductSwiperInit() {
383        const settings = this.getElementSettings();
384
385        var $list = this.elements.$container.find('ul.product-loop-layout-deal-2');
386        $list.find('li.product').addClass('swiper-slide');
387        $list.after('<div class="swiper-pagination"></div>');
388
389        var options = {
390            watchOverflow: true,
391            pagination: {
392                el: this.elements.$container.find('.swiper-pagination').get(0),
393                clickable: true
394            },
395            navigation: {
396                nextEl: this.elements.$container.find('.rz-swiper-button-next').get(0),
397                prevEl: this.elements.$container.find('.rz-swiper-button-prev').get(0),
398            },
399            loop: settings.infinite == 'yes' ? true : false,
400            autoplay: settings.autoplay == 'yes' ? true : false,
401            speed: settings.speed,
402            spaceBetween: 15,
403            on: {
404                init: function () {
405                    this.$el.css('opacity', 1);
406                }
407            },
408            breakpoints: {
409                300: {
410                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : 1,
411                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : 1,
412                },
413                480: {
414                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : 1,
415                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : 1,
416                },
417                768: {
418                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 2,
419                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 2,
420                },
421                1024: {
422                    slidesPerView: settings.slidesToShow > 5 ? 5 : settings.slidesToShow,
423                    slidesPerGroup: settings.slidesToScroll > 5 ? 5 : settings.slidesToScroll,
424                },
425                1366: {
426                    slidesPerView: settings.slidesToShow > 6 ? 6 : settings.slidesToShow,
427                    slidesPerGroup: settings.slidesToScroll > 6 ? 6 : settings.slidesToScroll
428                },
429                1500: {
430                    slidesPerView: settings.slidesToShow,
431                    slidesPerGroup: settings.slidesToScroll
432                }
433            }
434        };
435
436        new Swiper(this.elements.$container.find('.linked-products-deal-carousel').get(0), options);
437    }
438
439    onInit() {
440        var self = this;
441        super.onInit();
442
443        this.elements.$container.find('.razzi-countdown').rz_countdown();
444
445        this.elements.$container.imagesLoaded(function () {
446            setTimeout(function () {
447                self.getProductSwiperInit();
448            }, 200);
449
450        });
451    }
452}
453
454class RazziProductsDeal3WidgetHandler extends elementorModules.frontend.handlers.Base {
455    getDefaultSettings() {
456        return {
457            selectors: {
458                container: '.razzi-products-deal-3'
459            },
460        };
461    }
462
463    getDefaultElements() {
464        const selectors = this.getSettings('selectors');
465
466        return {
467            $container: this.$element.find(selectors.container)
468        };
469
470    }
471
472    getProductSwiperInit() {
473        const settings = this.getElementSettings();
474
475        var $list = this.elements.$container.find('ul.product-loop-layout-deal-3');
476        $list.find('li.product').addClass('swiper-slide');
477        $list.after('<div class="swiper-pagination"></div>');
478        $list.after('<div class="swiper-scrollbar"></div>');
479
480        var slidesPerView = settings.centeredSlides == 'yes' ? 'auto' : settings.slidesToShow;
481
482        var options = {
483            watchOverflow: true,
484            pagination: {
485                el: this.elements.$container.find('.swiper-pagination').get(0),
486                clickable: true
487            },
488            scrollbar: {
489                el: '.swiper-scrollbar',
490                hide: false,
491                draggable: true
492            },
493            loop: settings.infinite == 'yes' ? true : false,
494            autoplay: settings.autoplay == 'yes' ? true : false,
495            speed: settings.speed,
496            centeredSlides: settings.centeredSlides == 'yes' ? true : false,
497            on: {
498                init: function () {
499                    this.$el.css('opacity', 1);
500                    $list.find('.product-deal-3-countdown').rz_countdown();
501                }
502            },
503            breakpoints: {
504                300: {
505                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : 1,
506                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : 1,
507                },
508                480: {
509                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : 1,
510                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : 1,
511                },
512                768: {
513                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 2,
514                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 2,
515                },
516                1024: {
517                    slidesPerView: settings.slidesToShow > 5 ? 5 : slidesPerView,
518                    slidesPerGroup: settings.slidesToScroll > 5 ? 5 : settings.slidesToScroll,
519                },
520                1366: {
521                    slidesPerView: settings.slidesToShow > 6 ? 6 : slidesPerView,
522                    slidesPerGroup: settings.slidesToScroll > 6 ? 6 : settings.slidesToScroll
523                },
524                1500: {
525                    slidesPerView: slidesPerView,
526                    slidesPerGroup: settings.slidesToScroll
527                }
528            }
529        };
530
531        new Swiper(this.elements.$container.find('.linked-products-deal-carousel').get(0), options);
532    }
533
534    onInit() {
535        var self = this;
536        super.onInit();
537
538        this.elements.$container.imagesLoaded(function () {
539            setTimeout(function () {
540                self.getProductSwiperInit();
541            }, 200);
542
543        });
544    }
545}
546
547class RazziProductsShowcaseWidgetHandler extends elementorModules.frontend.handlers.Base {
548    getDefaultSettings() {
549        return {
550            selectors: {
551                container: '.razzi-products-showcase'
552            },
553        };
554    }
555
556    getDefaultElements() {
557        const selectors = this.getSettings('selectors');
558
559        return {
560            $container: this.$element.find(selectors.container)
561        };
562
563    }
564
565    getProductSwiperInit() {
566        var $products = this.elements.$container.find('ul.products');
567
568        $products.addClass('swiper-wrapper');
569        $products.find('li.product').addClass('swiper-slide');
570        $products.after('<div class="swiper-pagination"></div>');
571
572        var galleryBox = new Swiper(this.elements.$container.find('.showcase-image').get(0), {
573            watchOverflow: true,
574            watchSlidesVisibility: true,
575            watchSlidesProgress: true,
576            allowTouchMove: false,
577            effect: 'fade',
578            fadeEffect: {
579                crossFade: true
580            },
581        });
582        var galleryImage = new Swiper(this.elements.$container.find('.showcase-box .product-content').get(0), {
583            watchOverflow: true,
584            thumbs: {
585                swiper: galleryBox
586            },
587            navigation: {
588                nextEl: this.elements.$container.find('.rz-swiper-showcase-button-next').get(0),
589                prevEl: this.elements.$container.find('.rz-swiper-showcase-button-prev').get(0),
590            },
591            pagination: {
592                el: this.elements.$container.find('.swiper-pagination').get(0),
593                clickable: true
594            },
595        });
596    }
597
598    onInit() {
599        var self = this;
600        super.onInit();
601
602        self.getProductSwiperInit();
603    }
604}
605
606class RazziProductsCarouselWidgetHandler extends elementorModules.frontend.handlers.Base {
607    getDefaultSettings() {
608        return {
609            selectors: {
610                container: '.razzi-products-carousel'
611            },
612        };
613    }
614
615    getDefaultElements() {
616        const selectors = this.getSettings('selectors');
617
618        return {
619            $container: this.$element.find(selectors.container)
620        };
621
622    }
623
624    getProductSwiperInit() {
625        const settings = this.getElementSettings();
626
627        var $products = this.elements.$container.find('ul.products');
628        $products.wrap('<div class="swiper-container linked-elementor-product-carousel" style="opacity: 0;"></div>');
629        $products.addClass('swiper-wrapper');
630        $products.find('li.product').addClass('swiper-slide');
631        $products.after('<div class="swiper-pagination"></div>');
632        $products.after('<div class="swiper-scrollbar"></div>');
633
634        if ( settings.slidesPerViewAuto == 'yes' && settings.infinite !== 'yes' ) {
635			if ( settings.slidesToShow != 1 || settings.slidesToScroll != 1 ) {
636				$products.append('<li class="swiper-item-empty swiper-slide"></li>');
637			}
638		}
639
640        var slidesPerView = settings.slidesPerViewAuto == 'yes' ? 'auto' : settings.slidesToShow,
641            slidesRows = settings.slidesPerViewAuto == 'yes' ? 1 : settings.slidesRows;
642
643        var spaceBetween = jQuery(document.body).hasClass('razzi-product-card-solid') ? false : true;
644
645        var options = {
646            watchOverflow: true,
647            loop: settings.infinite == 'yes' ? true : false,
648            autoplay: settings.autoplay == 'yes' ? true : false,
649            speed: settings.speed,
650            spaceBetween: spaceBetween == true ? 30 : 0,
651            slidesPerColumnFill: 'row',
652            mousewheel: settings.mousewheel == 'yes' ? true : false,
653            navigation: {
654                nextEl: this.elements.$container.find('.rz-swiper-button-next').get(0),
655                prevEl: this.elements.$container.find('.rz-swiper-button-prev').get(0),
656            },
657            pagination: {
658                el: this.elements.$container.find('.swiper-pagination').get(0),
659                clickable: true
660            },
661            scrollbar: {
662                el: '.swiper-scrollbar',
663                hide: false,
664                draggable: true
665            },
666            on: {
667                init: function () {
668                    this.$el.css('opacity', 1);
669                }
670            },
671            breakpoints: {
672                300: {
673                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
674                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
675                    slidesPerColumn: settings.slidesPerViewAuto !== 'yes' && settings.slidesRows_mobile ? settings.slidesRows_mobile : slidesRows,
676                    spaceBetween: spaceBetween == true ? 15 : 0,
677                },
678                480: {
679                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
680                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
681                    slidesPerColumn: settings.slidesPerViewAuto !== 'yes' && settings.slidesRows_mobile ? settings.slidesRows_mobile : slidesRows,
682                    spaceBetween: spaceBetween == true ? 15 : 0,
683                },
684                768: {
685                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 3,
686                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 3,
687                    slidesPerColumn: settings.slidesPerViewAuto !== 'yes' && settings.slidesRows_tablet ? settings.slidesRows_tablet : slidesRows,
688                    spaceBetween: spaceBetween == true ? 15 : 0,
689                },
690                1024: {
691                    slidesPerView: slidesPerView > 5 ? 5 : slidesPerView,
692                    slidesPerGroup: settings.slidesToScroll > 5 ? 5 : settings.slidesToScroll,
693                    slidesPerColumn: slidesRows,
694                    spaceBetween: spaceBetween == true ? 30 : 0,
695                },
696                1366: {
697                    slidesPerView: slidesPerView > 6 ? 6 : slidesPerView,
698                    slidesPerGroup: settings.slidesToScroll > 6 ? 6 : settings.slidesToScroll,
699                    slidesPerColumn: slidesRows,
700                },
701                1500: {
702                    slidesPerView: slidesPerView,
703                    slidesPerGroup: settings.slidesToScroll,
704                    slidesPerColumn: slidesRows,
705                }
706            }
707        };
708
709        new Swiper(this.elements.$container.find('.linked-elementor-product-carou
709sel').get(0), options);
710    }
711
712    addClassProductLoopLayout() {
713        var $products = this.elements.$container.find('ul.products');
714
715        if ( ! $products.hasClass( 'product-loop-layout-5' ) && ! $products.hasClass( 'product-loop-layout-6' ) ) {
716            return;
717        }
718
719        $products.closest( '.woocommerce' ).addClass( 'product-loop-outsite' );
720    }
721
722    onInit() {
723        var self = this;
724        super.onInit();
725
726        self.getProductSwiperInit();
727        self.addClassProductLoopLayout();
728    }
729}
730
731class RazziProductOfCategoryWidgetHandler extends elementorModules.frontend.handlers.Base {
732    getDefaultSettings() {
733        return {
734            selectors: {
735                container: '.razzi-product-of-category'
736            },
737        };
738    }
739
740    getDefaultElements() {
741        const selectors = this.getSettings('selectors');
742
743        return {
744            $container: this.$element.find(selectors.container)
745        };
746
747    }
748
749    getProductSwiperInit() {
750        const settings = this.getElementSettings();
751
752        var $products = this.elements.$container.find('ul.products');
753        var spaceBetween = jQuery(document.body).hasClass('razzi-product-card-solid') ? false : true;
754
755        $products.wrap('<div class="swiper-container linked-elementor-product-carousel" style="opacity: 0;"></div>');
756        $products.addClass('swiper-wrapper');
757        $products.find('li.product').addClass('swiper-slide');
758        $products.after('<div class="swiper-pagination"></div>');
759        $products.after('<div class="swiper-scrollbar"></div>');
760
761        var options = {
762            watchOverflow: true,
763            loop: settings.infinite == 'yes' ? true : false,
764            autoplay: settings.autoplay == 'yes' ? true : false,
765            speed: settings.speed,
766            spaceBetween: spaceBetween == true ? 30 : 0,
767            navigation: {
768                nextEl: this.elements.$container.find('.rz-swiper-button-next').get(0),
769                prevEl: this.elements.$container.find('.rz-swiper-button-prev').get(0),
770            },
771            pagination: {
772                el: this.elements.$container.find('.swiper-pagination').get(0),
773                clickable: true
774            },
775            scrollbar: {
776                el: '.swiper-scrollbar',
777                hide: false,
778                draggable: true
779            },
780            on: {
781                init: function () {
782                    this.$el.css('opacity', 1);
783                }
784            },
785            breakpoints: {
786                300: {
787                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
788                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
789                    spaceBetween: spaceBetween == true ? 15 : 0,
790                },
791                480: {
792                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
793                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
794                },
795                768: {
796                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 3,
797                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 3,
798                },
799                900: {
800                    slidesPerView: settings.slidesToShow > 4 ? 4 : settings.slidesToShow,
801                    slidesPerGroup: settings.slidesToScroll > 4 ? 4 : settings.slidesToScroll,
802                    spaceBetween: spaceBetween == true ? 15 : 0,
803                },
804                1024: {
805                    slidesPerView: settings.slidesToShow > 5 ? 5 : settings.slidesToShow,
806                    slidesPerGroup: settings.slidesToScroll > 5 ? 5 : settings.slidesToScroll,
807                    spaceBetween: spaceBetween == true ? 30 : 0,
808                },
809                1200: {
810                    slidesPerView: settings.slidesToShow > 5 ? 5 : settings.slidesToShow,
811                    slidesPerGroup: settings.slidesToScroll > 5 ? 5 : settings.slidesToScroll
812                },
813                1366: {
814                    slidesPerView: settings.slidesToShow > 6 ? 6 : settings.slidesToShow,
815                    slidesPerGroup: settings.slidesToScroll > 6 ? 6 : settings.slidesToScroll
816                },
817                1500: {
818                    slidesPerView: settings.slidesToShow,
819                    slidesPerGroup: settings.slidesToScroll
820                }
821            }
822        };
823
824        new Swiper(this.elements.$container.find('.linked-elementor-product-carou
824sel').get(0), options);
825    }
826
827    addClassProductLoopLayout() {
828        var $products = this.elements.$container.find('ul.products');
829
830        if ( ! $products.hasClass( 'product-loop-layout-5' ) && ! $products.hasClass( 'product-loop-layout-6' ) ) {
831            return;
832        }
833
834        $products.closest( '.woocommerce' ).addClass( 'product-loop-outsite' );
835    }
836
837    onInit() {
838        var self = this;
839        super.onInit();
840
841        self.getProductSwiperInit();
842        self.addClassProductLoopLayout();
843    }
844}
845
846class RazziProductsCategorytabsWidgetHandler extends elementorModules.frontend.handlers.Base {
847    getDefaultSettings() {
848        return {
849            selectors: {
850                container: '.razzi-product-category-tabs'
851            },
852        };
853    }
854
855    getDefaultElements() {
856        const selectors = this.getSettings('selectors');
857
858        return {
859            $container: this.$element.find(selectors.container)
860        };
861
862    }
863
864    getProductCategory($selector, settings) {
865        var $list = $selector.find('ul.category-list');
866
867        $list.find('li.cat-item').addClass('swiper-slide');
868        $list.after('<div class="swiper-pagination"></div>');
869        $list.after('<span class="razzi-svg-icon rz-category-arrow-prev rz-swiper-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg></span>');
870        $list.after('<span class="razzi-svg-icon rz-category-arrow-next rz-swiper-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></span>');
871
872        var options = {
873            watchOverflow: true,
874            loop: settings.infinite == 'yes' ? true : false,
875            autoplay: settings.autoplay == 'yes' ? true : false,
876            speed: 500,
877            pagination: {
878                el: $selector.find('.swiper-pagination').get(0),
879                clickable: true
880            },
881            navigation: {
882                nextEl: $selector.find('.rz-category-arrow-next').get(0),
883                prevEl: $selector.find('.rz-category-arrow-prev').get(0),
884            },
885            spaceBetween: 30,
886            on: {
887                init: function () {
888                    this.$el.css('opacity', 1);
889                }
890            },
891            breakpoints: {
892                300: {
893                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
894                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
895                    spaceBetween: 15,
896                },
897                480: {
898                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
899                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
900                    spaceBetween: 15,
901                },
902                768: {
903                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 3,
904                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 3,
905                },
906                1024: {
907                    slidesPerView: settings.slidesToShow > 5 ? 5 : settings.slidesToShow,
908                    slidesPerGroup: settings.slidesToScroll > 5 ? 5 : settings.slidesToScroll,
909                    spaceBetween: 30
910                },
911                1366: {
912                    slidesPerView: settings.slidesToShow > 6 ? 6 : settings.slidesToShow,
913                    slidesPerGroup: settings.slidesToScroll > 6 ? 6 : settings.slidesToScroll
914                },
915                1500: {
916                    slidesPerView: settings.slidesToShow,
917                    slidesPerGroup: settings.slidesToScroll
918                }
919            }
920        };
921
922        new Swiper($selector.find('.linked-products-category').get(0), options);
923    };
924
925    productTabs($tabs, $el, $currentTab) {
926        $tabs.find('.tabs-nav a').removeClass('active');
927        $el.addClass('active');
928        $tabs.find('.tabs-panel').removeClass('active');
929        $currentTab.addClass('active');
930    }
931
932    getCategoryAJAXHandler($el, $tabs) {
933        var self = this,
934            tab = $el.data('href'),
935            $currentTab = $tabs.find('.tabs-' + tab),
936            $tabContent = $tabs.find('.tabs-content');
937
938        if ($currentTab.hasClass('tab-loaded')) {
939            self.productTabs($tabs, $el, $currentTab);
940            return;
941        }
942
943        $tabContent.addClass('loading');
944
945        var data = {},
946            elementSettings = $currentTab.data('settings'),
947            ajax_url = razziData.ajax_url.toString().replace('%%endpoint%%', 'ra_elementor_load_category');
948
949        jQuery.each(elementSettings, function (key, value) {
950            data[key] = value;
951        });
952
953        jQuery.post(
954            ajax_url,
955            data,
956            function (response) {
957                if (!response) {
958                    return;
959                }
960
961                $currentTab.find('.tab-content').html(response.data);
962                const settings = self.getElementSettings();
963
964                self.getProductCategory($currentTab, settings);
965
966                self.productTabs($tabs, $el, $currentTab);
967                $tabContent.removeClass('loading');
968
969                $currentTab.addClass('tab-loaded');
970            }
971        );
972    };
973
974    onInit() {
975        var self = this;
976        const settings = this.getElementSettings();
977
978        super.onInit();
979
980        var $selector = this.elements.$container,
981            $panels = $selector.find('.tab-loaded');
982
983
984        self.getProductCategory($panels, settings);
985        $selector.find('.tabs-nav').on('click', 'a', function (e) {
986            e.preventDefault();
987            self.getCategoryAJAXHandler(jQuery(this), $selector);
988        });
989
990    }
991}
992
993class RazziProductstabWidgetHandler extends elementorModules.frontend.handlers.Base {
994    getDefaultSettings() {
995        return {
996            selectors: {
997                container: '.razzi-products-tabs'
998            },
999        };
1000    }
1001
1002    getDefaultElements() {
1003        const selectors = this.getSettings('selectors');
1004
1005        return {
1006            $container: this.$element.find(selectors.container)
1007        };
1008
1009    }
1010
1011    getProductCarousel($selector, settings) {
1012        var $products = $selector.find('ul.products');
1013        var spaceBetween = jQuery(document.body).hasClass('razzi-product-card-solid') ? false : true;
1014
1015        $products.wrap('<div class="swiper-container linked-products-carousel" style="opacity: 0;"></div>');
1016        $products.addClass('swiper-wrapper');
1017        $products.find('li.product').addClass('swiper-slide');
1018        $products.after('<div class="swiper-pagination"></div>');
1019        $products.after('<div class="swiper-scrollbar"></div>');
1020
1021        if ( settings.slidesPerViewAuto == 'yes' && settings.infinite !== 'yes' ) {
1022			if ( settings.slidesToShow != 1 || settings.slidesToScroll != 1 ) {
1023				$products.append('<li class="swiper-item-empty swiper-slide"></li>');
1024			}
1025		}
1026
1027        var slidesPerView = settings.slidesPerViewAuto == 'yes' || settings.centeredSlides == 'yes' ? 'auto' : settings.slidesToShow;
1028
1029        var options = {
1030            loop: settings.infinite == 'yes' ? true : false,
1031            autoplay: settings.autoplay == 'yes' ? true : false,
1032            speed: settings.speed ? settings.speed : 500,
1033            watchOverflow: true,
1034            centeredSlides: settings.centeredSlides == 'yes' ? true : false,
1035            pagination: {
1036                el: $selector.find('.swiper-pagination').get(0),
1037                clickable: true
1038            },
1039            scrollbar: {
1040                el: '.swiper-scrollbar',
1041                hide: false,
1042                draggable: true
1043            },
1044            navigation: {
1045                nextEl: this.elements.$container.find('.rz-swiper-button-next').get(0),
1046                prevEl: this.elements.$container.find('.rz-swiper-button-prev').get(0),
1047            },
1048            spaceBetween: spaceBetween == true ? 30 : 0,
1049            on: {
1050                init: function () {
1051                    this.$el.css('opacity', 1);
1052                }
1053            },
1054            breakpoints: {
1055                300: {
1056                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
1057                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
1058                    spaceBetween: spaceBetween == true ? 15 : 0,
1059                },
1060                480: {
1061                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
1062                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
1063                    spaceBetween: spaceBetween == true ? 15 : 0,
1064                },
1065                768: {
1066                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 3,
1067                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 3,
1068                },
1069                1024: {
1070                    slidesPerView: slidesPerView > 5 ? 5 : slidesPerView,
1071                    slidesPerGroup: settings.slidesToScroll > 5 ? 5 : settings.slidesToScroll,
1072                    spaceBetween: spaceBetween == true ? 30 : 0,
1073                },
1074                1366: {
1075                    slidesPerView: slidesPerView > 6 ? 6 : slidesPerView,
1076                    slidesPerGroup: settings.slidesToScroll > 6 ? 6 : settings.slidesToScroll
1077                },
1078                1500: {
1079                    slidesPerView: slidesPerView,
1080                    slidesPerGroup: settings.slidesToScroll
1081                }
1082            }
1083        };
1084
1085        new Swiper($selector.find('.linked-products-carousel').get(0), options);
1086    };
1087
1088    /**
1089     * Get Product AJAX
1090     */
1091    getProductsAJAXHandler($el, $tabs) {
1092        var self = this,
1093            tab = $el.data('href'),
1094            $currentTab = $tabs.find('.tabs-' + tab),
1095            $tabContent = $tabs.find('.tabs-content');
1096
1097
1098        if ($currentTab.hasClass('tab-loaded')) {
1099            self.productTabs($tabs, $el, $currentTab);
1100            return;
1101        }
1102
1103        $tabContent.addClass('loading');
1104
1105        var data = {},
1106            elementSettings = $currentTab.data('settings'),
1107            ajax_url = razziData.ajax_url.toString().replace('%%endpoint%%', 'ra_elementor_load_products_grid');
1108
1109        const settings = this.getElementSettings();
1110
1111        jQuery.post(
1112            ajax_url,
1113            {
1114                settings: elementSettings
1115            },
1116            function (response) {
1117                if (!response) {
1118                    return;
1119                }
1120
1121                var content = response.data;
1122
1123                $currentTab.prepend(content);
1124
1125                self.getProductCarousel($currentTab, settings);
1126
1127                if ($currentTab.find('.products').is(':empty')) {
1128                    var $text = $currentTab.find('.page-number').data('text');
1129                    $currentTab.addClass('products-empty');
1130                    if ($text) {
1131                        $currentTab.find('.products').html('<li>' + $text + '</li>')
1132                    }
1133                }
1134
1135                $currentTab.addClass('tab-loaded');
1136
1137                self.productTabs($tabs, $el, $currentTab);
1138
1139                $tabContent.removeClass('loading');
1140
1141                jQuery(document.body).trigger('razzi_products_loaded', [jQuery(content), true]);
1142            }
1143        );
1144    };
1145
1146    productTabs($tabs, $el, $currentTab) {
1147        $tabs.find('.tabs-nav a').removeClass('active');
1148        $el.addClass('active');
1149        $tabs.find('.tabs-panel').removeClass('active');
1150        $currentTab.addClass('active');
1151    }
1152
1153    onInit() {
1154        var self = this;
1155        const settings = this.getElementSettings();
1156
1157        super.onInit();
1158
1159        var $selector = this.elements.$container,
1160            $panels = $selector.find('.tab-loaded');
1161
1162        self.getProductCarousel($panels, settings);
1163        $selector.find('.tabs-nav').on('click', 'a', function (e) {
1164            e.preventDefault();
1165            self.getProductsAJAXHandler(jQuery(this), $selector);
1166        });
1167    }
1168}
1169
1170class RazziProductstabGridWidgetHandler extends elementorModules.frontend.handlers.Base {
1171    getDefaultSettings() {
1172        return {
1173            selectors: {
1174                container: '.razzi-products-tabs-grid'
1175            },
1176        };
1177    }
1178
1179    getDefaultElements() {
1180        const selectors = this.getSettings('selectors');
1181
1182        return {
1183            $container: this.$element.find(selectors.container)
1184        };
1185
1186    }
1187
1188    /**
1189     * Get Product AJAX
1190     */
1191    getProductsAJAXHandler($el, $tabs) {
1192        var self = this,
1193            tab = $el.data('href'),
1194            $currentTab = $tabs.find('.tabs-' + tab),
1195            $tabContent = $tabs.find('.tabs-content');
1196
1197
1198        if ($currentTab.hasClass('tab-loaded')) {
1199            self.productTabs($tabs, $el, $currentTab);
1200            return;
1201        }
1202
1203        $tabContent.addClass('loading');
1204
1205        var data = {},
1206            elementSettings = $currentTab.data('settings'),
1207            ajax_url = razziData.ajax_url.toString().replace('%%endpoint%%', 'ra_elementor_load_products_grid');
1208
1209        const settings = this.getElementSettings();
1210
1211        jQuery.post(
1212            ajax_url,
1213            {
1214                settings: elementSettings
1215            },
1216            function (response) {
1217                if (!response) {
1218                    return;
1219                }
1220
1221                var content = response.data;
1222
1223                $currentTab.prepend(content);
1224
1225                if ($currentTab.find('.products').is(':empty')) {
1226                    var $text = $currentTab.find('.page-number').data('text');
1227                    $currentTab.addClass('products-empty');
1228                    if ($text) {
1229                        $currentTab.find('.products').html('<li>' + $text + '</li>')
1230                    }
1231                }
1232
1233                $currentTab.addClass('tab-loaded');
1234
1235                self.productTabs($tabs, $el, $currentTab);
1236
1237                $tabContent.removeClass('loading');
1238
1239                jQuery(document.body).trigger('razzi_products_loaded', [jQuery(content), true]);
1240            }
1241        );
1242    };
1243
1244    productTabs($tabs, $el, $currentTab) {
1245        $tabs.find('.tabs-nav a').removeClass('active');
1246        $el.addClass('active');
1247        $tabs.find('.tabs-panel').removeClass('active');
1248        $currentTab.addClass('active');
1249    }
1250
1251    loadMoreProducts() {
1252        var ajax_url = razziData.ajax_url.toString().replace('%%endpoint%%', 'ra_elementor_load_products_grid');
1253
1254        // Load Products
1255        this.elements.$container.on('click', 'a.ajax-load-products', function (e) {
1256            e.preventDefault();
1257
1258            var $el = jQuery(this),
1259                $settings = $el.closest('.tabs-panel').data('settings');
1260
1261            if ($el.hasClass('loading')) {
1262                return;
1263            }
1264
1265            $el.addClass('loading');
1266
1267            jQuery.post(
1268                ajax_url,
1269                {
1270                    page: $el.attr('data-page'),
1271                    settings: $settings
1272                },
1273                function (response) {
1274                    if (!response) {
1275                        return;
1276                    }
1277
1278                    $el.removeClass('loading');
1279
1280                    var $data = jQuery(response.data),
1281                        $products = $data.find('li.product'),
1282                        $container = $el.closest('.tabs-panel'),
1283                        $grid = $container.find('ul.products'),
1284                        $page_number = $data.find('.page-number').data('page');
1285
1286                    // If has products
1287                    if ($products.length) {
1288                        $products.addClass('razziFadeInUp');
1289
1290                        $grid.append($products);
1291
1292                        if ($page_number == '0') {
1293                            $el.remove();
1294                        } else {
1295                            $el.attr('data-page', $page_number);
1296                        }
1297                    }
1298
1299                    jQuery(document.body).trigger('razzi_products_loaded', [$products, true]);
1300                }
1301            );
1302        });
1303    };
1304
1305    onInit() {
1306        var self = this;
1307
1308        super.onInit();
1309
1310        var $selector = this.elements.$container;
1311
1312        $selector.find('.tabs-nav').on('click', 'a', function (e) {
1313            e.preventDefault();
1314            self.getProductsAJAXHandler(jQuery(this), $selector);
1315        });
1316        self.loadMoreProducts();
1317    }
1318}
1319
1320class RazziDealsCarouselWidgetHandler extends elementorModules.frontend.handlers.Base {
1321    getDefaultSettings() {
1322        return {
1323            selectors: {
1324                container: '.razzi-deals-carousel'
1325            },
1326        };
1327    }
1328
1329    getDefaultElements() {
1330        const selectors = this.getSettings('selectors');
1331
1332        return {
1333            $container: this.$element.find(selectors.container)
1334        };
1335
1336    }
1337
1338    getProductSwiperInit() {
1339        const settings = this.getElementSettings();
1340
1341        var $wrapper = this.elements.$container.find('.razzi-deals-carousel__inner');
1342
1343        $wrapper.after('<div class="swiper-pagination"></div>');
1344        $wrapper.after('<span class="razzi-svg-icon rz-swiper-button-prev rz-swiper-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg></span>');
1345        $wrapper.after('<span class="razzi-svg-icon rz-swiper-button-next rz-swiper-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></span>');
1346
1347        var options = {
1348            loop: settings.infinite == 'yes' ? true : false,
1349            autoplay: settings.autoplay == 'yes' ? true : false,
1350            speed: settings.autoplay_speed ? settings.autoplay_speed : 500,
1351            watchOverflow: true,
1352            navigation: {
1353                nextEl: this.elements.$container.find('.rz-swiper-button-next').get(0),
1354                prevEl: this.elements.$container.find('.rz-swiper-button-prev').get(0),
1355            },
1356            pagination: {
1357                el: this.elements.$container.find('.swiper-pagination').get(0),
1358                clickable: true
1359            },
1360            effect: settings.effect,
1361            fadeEffect: {
1362                crossFade: true
1363            },
1364            parallax: true,
1365            on: {
1366                init: function () {
1367                    this.$el.css('opacity', 1);
1368                }
1369            },
1370        };
1371
1372        if ( 'yes' === settings.autoplay ) {
1373			options.autoplay = {
1374				delay: settings.delay ? settings.delay : 500
1375			};
1376		}
1377
1378        new Swiper(this.elements.$container.find('.linked-deals-carousel').get(0), options);
1379    }
1380
1381    onInit() {
1382        var self = this;
1383        super.onInit();
1384
1385        this.elements.$container.find('.razzi-countdown').rz_countdown();
1386        self.getProductSwiperInit();
1387    }
1388}
1389class RazziDealsCarousel2WidgetHandler extends elementorModules.frontend.handlers.Base {
1390    getDefaultSettings() {
1391        return {
1392            selectors: {
1393                container: '.razzi-deals-carousel-2'
1394            },
1395        };
1396    }
1397
1398    getDefaultElements() {
1399        const selectors = this.getSettings('selectors');
1400
1401        return {
1402            $container: this.$element.find(selectors.container)
1403        };
1404
1405    }
1406
1407    getProductSwiperInit() {
1408        const settings = this.getElementSettings();
1409
1410        var $wrapper = this.elements.$container.find('.razzi-deals-carousel-2__inner');
1411
1412        $wrapper.after('<div class="swiper-pagination"></div>');
1413        $wrapper.after('<span class="razzi-svg-icon rz-swiper-button-prev rz-swiper-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg></span>');
1414        $wrapper.after('<span class="razzi-svg-icon rz-swiper-button-next rz-swiper-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></span>');
1415
1416        var options = {
1417            loop: settings.infinite == 'yes' ? true : false,
1418            autoplay: settings.autoplay == 'yes' ? true : false,
1419            speed: settings.autoplay_speed ? settings.autoplay_speed : 500,
1420            watchOverflow: true,
1421            spaceBetween: 30,
1422            navigation: {
1423                nextEl: this.elements.$container.find('.rz-swiper-button-next').get(0),
1424                prevEl: this.elements.$container.find('.rz-swiper-button-prev').get(0),
1425            },
1426            pagination: {
1427                el: this.elements.$container.find('.swiper-pagination').get(0),
1428                clickable: true
1429            },
1430            on: {
1431                init: function () {
1432                    this.$el.css('opacity', 1);
1433                }
1434            },
1435            breakpoints: {
1436                300: {
1437                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : 1,
1438                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : 1,
1439                    spaceBetween: 15,
1440                },
1441                768: {
1442                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 2,
1443                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 2,
1444                },
1445                1024: {
1446                    slidesPerView: settings.slidesToShow > 5 ? 5 : settings.slidesToShow,
1447                    slidesPerGroup: settings.slidesToScroll > 5 ? 5 : settings.slidesToScroll,
1448                    spaceBetween: 30
1449                },
1450                1366: {
1451                    slidesPerView: settings.slidesToShow > 6 ? 6 : settings.slidesToShow,
1452                    slidesPerGroup: settings.slidesToScroll > 6 ? 6 : settings.slidesToScroll
1453                },
1454                1500: {
1455                    slidesPerView: settings.slidesToShow,
1456                    slidesPerGroup: settings.slidesToScroll
1457                }
1458            }
1459        };
1460
1461        if ( 'yes' === settings.autoplay ) {
1462			options.autoplay = {
1463				delay: settings.delay ? settings.delay : 500
1464			};
1465		}
1466
1467        new Swiper(this.elements.$container.find('.linked-deals-carousel').get(0), options);
1468    }
1469
1470    onInit() {
1471        var self = this;
1472        super.onInit();
1473
1474        this.elements.$container.find('.razzi-countdown').rz_countdown();
1475        self.getProductSwiperInit();
1476    }
1477}
1478
1479class RazziProductsGridWidgetHandler extends elementorModules.frontend.handlers.Base {
1480    getDefaultSettings() {
1481        return {
1482            selectors: {
1483                container: '.razzi-products-grid'
1484            },
1485        };
1486    }
1487
1488    getDefaultElements() {
1489        const selectors = this.getSettings('selectors');
1490
1491        return {
1492            $container: this.$element.find(selectors.container)
1493        };
1494
1495    }
1496
1497    loadProductsGrid() {
1498        var ajax_url = razziData.ajax_url.toString().replace('%%endpoint%%', 'ra_elementor_load_products_grid');
1499        const settings = this.getElementSettings();
1500
1501        // Load Products
1502        this.elements.$container.on('click', 'a.ajax-load-products', function (e) {
1503            e.preventDefault();
1504
1505            var $el = jQuery(this);
1506
1507            if ($el.hasClass('loading')) {
1508                return;
1509            }
1510
1511            $el.addClass('loading');
1512
1513            jQuery.post(
1514                ajax_url,
1515                {
1516                    page: $el.attr('data-page'),
1517                    settings: settings
1518                },
1519                function (response) {
1520                    if (!response) {
1521                        return;
1522                    }
1523
1524                    $el.removeClass('loading');
1525
1526                    var $data = jQuery(response.data),
1527                        $products = $data.find('li.product'),
1528                        $container = $el.closest('.razzi-products-grid'),
1529                        $grid = $container.find('ul.products'),
1530                        $page_number = $data.find('.page-number').data('page');
1531
1532                    // If has products
1533                    if ($products.length) {
1534                        $products.addClass('razziFadeInUp');
1535
1536                        $grid.append($products);
1537
1538                        if ($page_number == '0') {
1539                            $el.remove();
1540                        } else {
1541                            $el.attr('data-page', $page_number);
1542                        }
1543                    }
1544
1545                    jQuery(document.body).trigger('razzi_products_loaded', [$products, true]);
1546                }
1547            );
1548        });
1549    };
1550
1551    loadProductsPagination() {
1552        // Load Products
1553        this.elements.$container.on('click', '.woocommerce-pagination a', function (e) {
1554            e.preventDefault();
1555
1556            var $el = jQuery(this),
1557                $nav = $el.closest('.woocommerce-pagination'),
1558                url = $el.attr('href'),
1559                $products = $el.closest('.razzi-products-grid').find('ul.products');
1560
1561            $nav.addClass('loading');
1562
1563            jQuery.get(url, function (response) {
1564                var $content = jQuery(response).find('.razzi-products-grid ul.products li.product'),
1565                    $navNew = jQuery(response).find('.razzi-products-grid .woocommerce-pagination');
1566
1567                $products.html($content);
1568                $nav.replaceWith($navNew);
1569
1570                jQuery(document.body).trigger('razzi_products_loaded', [$content, true]);
1571
1572                $navNew.removeClass('loading');
1573            });
1574        });
1575    }
1576
1577    loadProductsInfinite() {
1578        if (!this.elements.$container.find('.ajax-load-products').hasClass('ajax-infinite')) {
1579            return;
1580        }
1581        var $container = this.elements.$container;
1582        jQuery(window).on('scroll', function () {
1583            if ($container.find('.ajax-load-products').is(':in-viewport')) {
1584                $container.find('.ajax-load-products').trigger('click');
1585            }
1586        }).trigger('scroll');
1587    };
1588
1589    onInit() {
1590        var self = this;
1591        super.onInit();
1592
1593        self.loadProductsPagination();
1594        self.loadProductsGrid();
1595        self.loadProductsInfinite();
1596    }
1597}
1598
1599class RazziProductLoopHandler extends elementorModules.frontend.handlers.Base {
1600    getDefaultSettings() {
1601        return {
1602            selectors: {
1603                container: 'ul.products'
1604            },
1605        };
1606    }
1607
1608    getDefaultElements() {
1609        const selectors = this.getSettings('selectors');
1610
1611        return {
1612            $container: this.$element.find(selectors.container)
1613        };
1614
1615    }
1616
1617    getProductLoopHoverSlider() {
1618        var $selector = this.elements.$container.find('.product-thumbnails--slider'),
1619            options = {
1620                loop: false,
1621                autoplay: false,
1622                speed: 800,
1623                watchOverflow: true,
1624                lazy: true,
1625                breakpoints: {}
1626            };
1627
1628        $selector.find('.woocommerce-loop-product__link').addClass('swiper-slide');
1629
1630        $selector.imagesLoaded(function () {
1631            setTimeout(function () {
1632                $selector.each(function () {
1633                    options.navigation = {
1634                        nextEl: jQuery(this).find('.rz-product-loop-swiper-next').get(0),
1635                        prevEl: jQuery(this).find('.rz-product-loop-swiper-prev').get(0),
1636                    }
1637                    new Swiper(jQuery(this).get(0), options);
1638                });
1639            }, 200);
1640        });
1641    }
1642
1643    getProductLoopHover () {
1644
1645        if (! this.elements.$container.hasClass('product-loop-layout-8')) {
1646            return;
1647        }
1648
1649        this.elements.$container.on('mouseover', '.product-inner', function () {
1650
1651            if (jQuery(this).hasClass('has-transform')) {
1652                return;
1653            }
1654
1655            if (jQuery(this).closest('ul.products').hasClass('shortcode-element')) {
1656                return;
1657            }
1658
1659
1660            var $product_bottom = jQuery(this).find('.product-loop__buttons'),
1661                product_bottom_height = $product_bottom.outerHeight(),
1662                $product_summary = jQuery(this).find('.product-summary');
1663
1664            jQuery(this).addClass('has-transform');
1665            $product_summary.css({
1666                '-webkit-transform': "translateY(-" + product_bottom_height + "px)",
1667                'transform': "translateY(-" + product_bottom_height + "px)"
1668            });
1669
1670        });
1671
1672
1673    };
1674
1675
1676    onInit() {
1677        super.onInit();
1678
1679        if (!this.$element.closest('body').hasClass('elementor-editor-active')) {
1680            return;
1681        }
1682
1683        this.getProductLoopHoverSlider();
1684        this.getProductLoopHover();
1685    }
1686}
1687
1688class RazziProductsRecentlyViewedWidgetHandler extends elementorModules.frontend.handlers.Base {
1689    getDefaultSettings() {
1690        return {
1691            selectors: {
1692                container: '.razzi-products-recently-viewed-carousel'
1693            },
1694        };
1695    }
1696
1697    getDefaultElements() {
1698        const selectors = this.getSettings( 'selectors' );
1699
1700        return {
1701            $container: this.$element.find( selectors.container )
1702        };
1703    }
1704
1705    hoverInforProduct () {
1706        var self = this,
1707            $selector = self.elements.$container,
1708            $product = $selector.find('li.product');
1709
1710        $product.on('mousemove', function(e){
1711            var el = jQuery(this),
1712                left = e.pageX - el.offset().left + 10,
1713                top = e.pageY - el.offset().top + 10;
1714
1715            el.find('.product-infor')
1716                .show()
1717                .css({ left: left, top: top });
1718
1719        }).on('mouseout', function(){
1720            jQuery(this).find('.product-infor').hide();
1721        });
1722    }
1723
1724    getSwiperOption(){
1725        const settings = this.getElementSettings();
1726        const selector = this.elements.$container;
1727        const breakpoints = elementorFrontend.config.breakpoints;
1728        var $products = selector.find( 'ul.products' );
1729
1730        if( selector.find( '.no-products' ).length ) {
1731            return;
1732        }
1733
1734        $products.addClass( 'swiper-wrapper' );
1735        $products.find( 'li.product' ).addClass( 'swiper-slide' );
1736
1737        const   options = {
1738                    loop            : 'yes' === settings.infinite,
1739                    autoplay        : 'yes' === settings.autoplay,
1740                    speed           : settings.autoplay_speed,
1741                    watchOverflow   : true,
1742                    navigation : {
1743                        nextEl: selector.find('.rz-swiper-button-next').get(0),
1744                        prevEl: selector.find('.rz-swiper-button-prev').get(0),
1745                    },
1746                    scrollbar       : {
1747                        el: selector.find('.swiper-scrollbar'),
1748                        hide: false,
1749                        draggable: true
1750                    },
1751                    pagination: {
1752                       el: selector.find('.swiper-pagination').get(0),
1753                       type: 'bullets',
1754                       clickable: true
1755                    },
1756                    spaceBetween  : 30,
1757                    on              : {
1758                        init: function() {
1759                            selector.css( 'opacity', 1 );
1760                        }
1761                    },
1762                    breakpoints     : {}
1763                };
1764
1765        if ( 'yes' === settings.autoplay ) {
1766            options.autoplay = {
1767                delay: settings.delay
1768            };
1769        }
1770
1771        options.breakpoints[breakpoints.xs] = { slidesPerView: settings.slidesToShow_mobile, slidesPerGroup: settings.slidesToScroll_mobile  };
1772        options.breakpoints[breakpoints.md] = { slidesPerView: settings.slidesToShow_tablet, slidesPerGroup: settings.slidesToScroll_tablet  };
1773        options.breakpoints[breakpoints.lg] = { slidesPerView: settings.slidesToShow, slidesPerGroup: settings.slidesToScroll };
1774
1775        return options;
1776    }
1777
1778    getSwiperInit() {
1779        new Swiper( this.elements.$container.find('.products-content').get(0), this.get
1779SwiperOption() );
1780    }
1781
1782    /**
1783     * Get Product AJAX
1784     */
1785    getProductsHandler () {
1786        var self = this,
1787            $selector = self.elements.$container;
1788
1789        if ($selector.hasClass('loaded')) {
1790            return;
1791        }
1792
1793        var elementSettings = $selector.data('settings');
1794
1795        if( elementSettings.load_ajax != 'yes' ){
1796            self.hoverInforProduct();
1797            self.getSwiperInit();
1798
1799            return;
1800        }
1801
1802        jQuery(window).on('scroll', function () {
1803            if (jQuery(document.body).find('.razzi-products-recently-viewed-carousel').is(':in-viewport')) {
1804                self.getProductsAJAXHandler();
1805            }
1806        }).trigger('scroll');
1807    };
1808
1809    getProductsAJAXHandler () {
1810        var self = this,
1811            $selector = self.elements.$container;
1812
1813        if ($selector.hasClass('loaded')) {
1814            return;
1815        }
1816
1817        if ($selector.data('requestRunning')) {
1818            return;
1819        }
1820
1821        $selector.data('requestRunning', true);
1822
1823        var elementSettings = $selector.data('settings'),
1824            ajax_url = razziData.ajax_url.toString().replace('%%endpoint%%', 'ra_elementor_load_recently_viewed_products');
1825
1826        jQuery.post(
1827            ajax_url,
1828            {
1829                settings: elementSettings
1830            },
1831            function (response) {
1832                if (!response) {
1833                    return;
1834                }
1835
1836                var $content = jQuery(response.data).children('li.product');
1837
1838                $selector.find('.products-content').html(response.data);
1839                if ($selector.find('.product-list').hasClass('no-products')) {
1840                    $selector.addClass('no-products');
1841                }
1842                self.hoverInforProduct();
1843                self.getSwiperInit();
1844                $selector.addClass('loaded');
1845                $selector.data('requestRunning', false);
1846
1847                jQuery(document.body).trigger('razzi_products_loaded', [$content, true]);
1848            }
1849        );
1850    };
1851
1852    onInit() {
1853        super.onInit();
1854        this.getProductsHandler();
1855
1856    }
1857}
1858
1859class RazziProductsRecentlyViewedWidgetGridHandler extends elementorModules.frontend.handlers.Base {
1860    getDefaultSettings() {
1861        return {
1862            selectors: {
1863                container: '.razzi-products-recently-viewed-grid'
1864            },
1865        };
1866    }
1867
1868    getDefaultElements() {
1869        const selectors = this.getSettings( 'selectors' );
1870
1871        return {
1872            $container: this.$element.find( selectors.container )
1873        };
1874    }
1875
1876    hoverInforProduct () {
1877        var self = this,
1878            $selector = self.elements.$container,
1879            $product = $selector.find('li.product');
1880
1881        $product.on('mousemove', function(e){
1882            var el = jQuery(this),
1883                left = e.pageX - el.offset().left + 10,
1884                top = e.pageY - el.offset().top + 10;
1885
1886            el.find('.product-infor')
1887                .show()
1888                .css({ left: left, top: top });
1889
1890        }).on('mouseout', function(){
1891            jQuery(this).find('.product-infor').hide();
1892        });
1893    }
1894
1895    resetCookie () {
1896        var $selector = this.elements.$container;
1897
1898        $selector.on('click', '.reset-button' , function(e){
1899            e.preventDefault();
1900            document.cookie = "woocommerce_recently_viewed=null;expires=365;path=/";
1901
1902            jQuery(this).closest('.razzi-products-recently-viewed-grid').removeClass('has-products').find('.products-content, .woocommerce-pagination').remove();
1903
1904        });
1905    }
1906
1907    onInit() {
1908        super.onInit();
1909        this.hoverInforProduct();
1910        this.resetCookie();
1911    }
1912}
1913
1914class RazziProductsCarouselWithThumbnailsWidgetHandler extends elementorModules.frontend.handlers.Base {
1915    getDefaultSettings() {
1916        return {
1917            selectors: {
1918                container: '.razzi-products-carousel-with-thumbnails'
1919            },
1920        };
1921    }
1922
1923    getDefaultElements() {
1924        const selectors = this.getSettings( 'selectors' );
1925
1926        return {
1927            $container: this.$element.find( selectors.container )
1928        };
1929    }
1930
1931    hoverProduct () {
1932        var self = this,
1933            $selector = self.elements.$container,
1934            $product = $selector.find('li.product'),
1935            on_mobile = false;
1936
1937        if (! $selector.find('ul.products').hasClass('product-loop-layout-8')) {
1938            return;
1939        }
1940
1941        jQuery(window).on('resize', function () {
1942            if (jQuery(window).width() < 992) {
1943                on_mobile = true;
1944            } else {
1945                on_mobile = false;
1946            }
1947        }).trigger('resize');
1948
1949        $product.on('mouseover', '.product-inner', function () {
1950            var $this = jQuery(this);
1951            if (on_mobile) {
1952                return;
1953            }
1954
1955            if ($this.hasClass('has-transform')) {
1956                return;
1957            }
1958
1959            var $product_bottom = $this.find('.product-loop__buttons'),
1960                product_bottom_height = $product_bottom.outerHeight(),
1961                $product_summary = $this.find('.product-summary');
1962
1963            $this.addClass('has-transform');
1964            $product_summary.css({
1965                '-webkit-transform': "translateY(-" + product_bottom_height + "px)",
1966                'transform': "translateY(-" + product_bottom_height + "px)"
1967            });
1968
1969        });
1970    }
1971
1972    getProductSwiperInit() {
1973        const settings = this.getElementSettings();
1974
1975        var $products = this.elements.$container.find('ul.products');
1976        $products.wrap('<div class="swiper-container linked-elementor-product-carousel" style="opacity: 0;"></div>');
1977        $products.addClass('swiper-wrapper');
1978        $products.find('li.product').addClass('swiper-slide');
1979        $products.after('<div class="swiper-pagination"></div>');
1980        $products.after('<span class="razzi-svg-icon rz-swiper-button-prev rz-swiper-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="15 18 9 12 15 6"></polyline></svg></span>');
1981        $products.after('<span class="razzi-svg-icon rz-swiper-button-next rz-swiper-button"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg></span>');
1982
1983        var options = {
1984            watchOverflow: true,
1985            loop: settings.infinite == 'yes' ? true : false,
1986            autoplay: settings.autoplay == 'yes' ? true : false,
1987            speed: settings.speed,
1988            spaceBetween: 30,
1989            navigation: {
1990                nextEl: this.elements.$container.find('.rz-swiper-button-next').get(0),
1991                prevEl: this.elements.$container.find('.rz-swiper-button-prev').get(0),
1992            },
1993            pagination: {
1994                el: this.elements.$container.find('.swiper-pagination').get(0),
1995                clickable: true
1996            },
1997            on: {
1998                init: function () {
1999                    this.$el.css('opacity', 1);
2000                }
2001            },
2002            breakpoints: {
2003                300: {
2004                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : razziData.mobile_portrait,
2005                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : razziData.mobile_portrait,
2006                    spaceBetween: 15,
2007                },
2008                480: {
2009                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 2,
2010                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 2,
2011                    spaceBetween: 15,
2012                },
2013                768: {
2014                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 2,
2015                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 2,
2016                },
2017                1024: {
2018                    slidesPerView: settings.slidesToShow > 3 ? 3 : settings.slidesToShow,
2019                    slidesPerGroup: settings.slidesToScroll > 3 ? 3 : settings.slidesToScroll,
2020                    spaceBetween: 30
2021                },
2022            }
2023        };
2024
2025        new Swiper(this.elements.$container.find('.linked-elementor-product-carou
2025sel').get(0), options);
2026    }
2027
2028    onInit() {
2029        super.onInit();
2030        this.hoverProduct();
2031        this.getProductSwiperInit();
2032    }
2033}
2034
2035class RazziProductsSliderWidgetHandler extends elementorModules.frontend.handlers.Base {
2036    getDefaultSettings() {
2037        return {
2038            selectors: {
2039                container: '.razzi-products-slider'
2040            },
2041        };
2042    }
2043
2044    getDefaultElements() {
2045        const selectors = this.getSettings('selectors');
2046
2047        return {
2048            $container: this.$element.find(selectors.container)
2049        };
2050
2051    }
2052
2053    getProductSwiperInit() {
2054        const settings = this.getElementSettings();
2055
2056        var options = {
2057            watchOverflow: true,
2058            navigation: {
2059                nextEl: this.elements.$container.find('.rz-swiper-button-next').get(0),
2060                prevEl: this.elements.$container.find('.rz-swiper-button-prev').get(0),
2061            },
2062            pagination: {
2063                el: this.elements.$container.find('.swiper-pagination').get(0),
2064                clickable: true
2065            },
2066            loop: settings.infinite == 'yes' ? true : false,
2067            autoplay: settings.autoplay == 'yes' ? true : false,
2068            speed: settings.speed,
2069        };
2070
2071        new Swiper(this.elements.$container.find('.razzi-products-slider__wrapper').get(0), options);
2072    }
2073
2074    onInit() {
2075        var self = this;
2076
2077        super.onInit();
2078
2079        self.getProductSwiperInit();
2080    }
2081}
2082
2083class RazziProductsListingWidgetHandler extends elementorModules.frontend.handlers.Base {
2084    getDefaultSettings() {
2085        return {
2086            selectors: {
2087                container: '.razzi-products-listing'
2088            },
2089        };
2090    }
2091
2092    getDefaultElements() {
2093        const selectors = this.getSettings('selectors');
2094
2095        return {
2096            $container: this.$element.find(selectors.container)
2097        };
2098
2099    }
2100
2101    getProductSwiperInit() {
2102        const settings = this.getElementSettings();
2103
2104        var $products = this.elements.$container.find('ul.products');
2105        $products.wrap('<div class="swiper-container linked-elementor-product-carousel" style="opacity: 0;"></div>');
2106        $products.addClass('swiper-wrapper');
2107        $products.find('li.product').addClass('swiper-slide');
2108        $products.after('<div class="swiper-pagination"></div>');
2109        $products.after('<div class="swiper-scrollbar"></div>');
2110
2111        var options = {
2112            watchOverflow: true,
2113            loop: settings.infinite == 'yes' ? true : false,
2114            autoplay: settings.autoplay == 'yes' ? true : false,
2115            speed: settings.speed,
2116			spaceBetween:  30,
2117            slidesPerColumnFill: 'row',
2118            navigation: {
2119                nextEl: this.elements.$container.find('.rz-swiper-button-next').get(0),
2120                prevEl: this.elements.$container.find('.rz-swiper-button-prev').get(0),
2121            },
2122            pagination: {
2123                el: this.elements.$container.find('.swiper-pagination').get(0),
2124                clickable: true
2125            },
2126            scrollbar: {
2127                el: '.swiper-scrollbar',
2128                hide: false,
2129                draggable: true
2130            },
2131            on: {
2132                init: function () {
2133                    this.$el.css('opacity', 1);
2134                }
2135            },
2136            breakpoints: {
2137                300: {
2138                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : 1,
2139                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : 1,
2140                    slidesPerColumn: settings.slidesRows_mobile ? settings.slidesRows_mobile : settings.slidesRows,
2141                    spaceBetween: 15
2142                },
2143                480: {
2144                    slidesPerView: settings.slidesToShow_mobile ? settings.slidesToShow_mobile : 1,
2145                    slidesPerGroup: settings.slidesToScroll_mobile ? settings.slidesToScroll_mobile : 1,
2146                    slidesPerColumn: settings.slidesRows_mobile ? settings.slidesRows_mobile : settings.slidesRows,
2147                    spaceBetween: 15,
2148                },
2149                768: {
2150                    slidesPerView: settings.slidesToShow_tablet ? settings.slidesToShow_tablet : 2,
2151                    slidesPerGroup: settings.slidesToScroll_tablet ? settings.slidesToScroll_tablet : 2,
2152                    spaceBetween: 15,
2153                    slidesPerColumn:  settings.slidesRows_tablet ? settings.slidesRows_tablet : settings.slidesRows,
2154                },
2155                1024: {
2156                    slidesPerView: settings.slidesToShow > 5 ? 5 : settings.slidesToShow,
2157                    slidesPerGroup: settings.slidesToScroll > 5 ? 5 : settings.slidesToScroll,
2158                    spaceBetween:  15,
2159                    slidesPerColumn: settings.slidesRows,
2160                },
2161                1366: {
2162                    slidesPerView: settings.slidesToShow > 6 ? 6 : settings.slidesToShow,
2163                    slidesPerGroup: settings.slidesToScroll > 6 ? 6 : settings.slidesToScroll,
2164                    slidesPerColumn: settings.slidesRows,
2165                },
2166                1500: {
2167                    slidesPerView: settings.slidesToShow,
2168                    slidesPerGroup: settings.slidesToScroll,
2169                    slidesPerColumn: settings.slidesRows,
2170                }
2171
2172            }
2173        };
2174
2175        new Swiper(this.elements.$container.find('.linked-elementor-product-carou
2175sel').get(0), options);
2176    }
2177
2178    addClassProductLoopLayout() {
2179        var $products = this.elements.$container.find('ul.products');
2180
2181        if ( ! $products.hasClass( 'product-loop-layout-5' ) && ! $products.hasClass( 'product-loop-layout-6' ) ) {
2182            return;
2183        }
2184
2185        $products.closest( '.woocommerce' ).addClass( 'product-loop-outsite' );
2186    }
2187
2188    onInit() {
2189        var self = this;
2190        super.onInit();
2191
2192        self.getProductSwiperInit();
2193        self.addClassProductLoopLayout();
2194    }
2195}
2196
2197class RazziProductsListing2WidgetHandler extends elementorModules.frontend.handlers.Base {
2198    getDefaultSettings() {
2199        return {
2200            selectors: {
2201                container: '.razzi-products-listing-2'
2202            },
2203        };
2204    }
2205
2206    getDefaultElements() {
2207        const selectors = this.getSettings('selectors');
2208
2209        return {
2210            $container: this.$element.find(selectors.container)
2211        };
2212
2213    }
2214
2215    getFlexSliderInit() {
2216        var self = this;
2217
2218        if (!self.$element.closest('body').hasClass('elementor-editor-active')) {
2219            return;
2220        }
2221        const options = {
2222            selector: '.woocommerce-product-gallery__wrapper > .woocommerce-product-gallery__image',
2223            allowOneSlide: false,
2224            animation: "slide",
2225            animationLoop: false,
2226            controlNav: "thumbnails",
2227            animationSpeed: 500,
2228            directionNav: false,
2229            rtl: false,
2230            slideshow: false,
2231            smoothHeight: true,
2232            start: function () {
2233                self.elements.$container.find('.woocommerce-product-gallery').css('opacity', 1);
2234            },
2235        };
2236
2237        this.elements.$container.find('.woocommerce-product-gallery').flexslider(options);
2238    }
2239
2240    getProductSwiperInit() {
2241        const settings = this.getElementSettings();
2242
2243        var $products = this.elements.$container.find('.razzi-products-listing__items');
2244        $products.wrap('<div class="swiper-container linked-elementor-product-carousel" style="opacity: 0;"></div>');
2245        $products.addClass('swiper-wrapper');
2246        $products.find('.product-item').addClass('swiper-slide');
2247        $products.after('<div class="swiper-pagination"></div>');
2248
2249        var options = {
2250            slidesPerView: 1,
2251            slidesPerGroup: 1,
2252            watchOverflow: true,
2253            navigation: {
2254                nextEl: this.elements.$container.find('.rz-swiper-button-next').get(0),
2255                prevEl: this.elements.$container.find('.rz-swiper-button-prev').get(0),
2256            },
2257            pagination: {
2258                el: this.elements.$container.find('.swiper-pagination').get(0),
2259                clickable: true
2260            },
2261            on: {
2262                init: function () {
2263                    this.$el.css('opacity', 1);
2264                }
2265            },
2266        };
2267
2268        new Swiper(this.elements.$container.find('.linked-elementor-product-carousel').get(0), options);
2269    }
2270
2271    getSwiperInit() {
2272        var $thumbnail = this.elements.$container.find('.flex-control-thumbs');
2273        $thumbnail.wrap('<div class="swiper-container linked-gallery-carousel"></div>');
2274        $thumbnail.addClass('swiper-wrapper');
2275        $thumbnail.find('li').addClass('swiper-slide');
2276        $thumbnail.after('<span class="razzi-svg-icon rz-gallery-button-prev rz-swiper-button"><svg class="svg-icon" aria-hidden="true" role="img" focusable="false" width="13" height="24" viewBox="0 0 13 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0.467723 13.1881L10.2737 23.5074C10.8975 24.1642 11.9089 24.1642 12.5324 23.5074C13.1559 22.8512 13.1559 21.787 12.5324 21.1308L3.85554 11.9998L12.5321 2.86914C13.1556 2.21269 13.1556 1.14853 12.5321 0.492339C11.9086 -0.164113 10.8973 -0.164113 10.2735 0.492339L0.46747 10.8118C0.155705 11.14 0 11.5698 0 11.9998C0 12.43 0.156009 12.86 0.467723 13.1881Z"></path></svg></span>');
2277        $thumbnail.after('<span class="razzi-svg-icon rz-gallery-button-next rz-swiper-button"><svg class="svg-icon" aria-hidden="true" role="img" focusable="false" width="13" height="24" viewBox="0 0 13 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M12.5323 13.1881L2.72626 23.5074C2.10248 24.1642 1.09112 24.1642 0.467647 23.5074C-0.155882 22.8512 -0.155882 21.787 0.467647 21.1308L9.14446 11.9998L0.467899 2.86914C-0.15563 2.21269 -0.15563 1.14853 0.467899 0.492339C1.09143 -0.164113 2.10273 -0.164113 2.72651 0.492339L12.5325 10.8118C12.8443 11.14 13 11.5698 13 
227711.9998C13 12.43 12.844 12.86 12.5323 13.1881Z"></path></svg></span>');
2278
2279        jQuery('li', $thumbnail).append('<span/>');
2280
2281        var options = {
2282            slidesPerView: 4,
2283            slidesPerGroup: 1,
2284            watchOverflow: true,
2285            navigation: {
2286                nextEl: this.elements.$container.find('.rz-gallery-button-next').get(0),
2287                prevEl: this.elements.$container.find('.rz-gallery-button-prev').get(0),
2288            },
2289        };
2290
2291        new Swiper(this.elements.$container.find('.linked-gallery-carousel').get(0), options);
2292    }
2293
2294    onInit() {
2295        var self = this;
2296        super.onInit();
2297
2298        self.getProductSwiperInit();
2299
2300        this.elements.$container.imagesLoaded(function () {
2301            setTimeout(function () {
2302               self.getFlexSliderInit();
2303               self.getSwiperInit();
2304            }, 200);
2305
2306        });
2307    }
2308}
2309
2310class RazziProductBrandsWidgetHandler extends elementorModules.frontend.handlers.Base {
2311    getDefaultSettings() {
2312        return {
2313            selectors: {
2314                list: '.razzi-product-brands .razzi-product-brands__product-list'
2315            },
2316        };
2317    }
2318
2319    getDefaultElements() {
2320        const selectors = this.getSettings( 'selectors' );
2321
2322        return {
2323            $list: this.$element.find( selectors.list )
2324        };
2325
2326    }
2327
2328    getCarouselOptions() {
2329        return  {
2330            slidesPerView: 2,
2331            slidesPerGroup: 1,
2332            watchOverflow: true,
2333            spaceBetween: 20
2334        };
2335    }
2336
2337    onInit() {
2338        super.onInit();
2339
2340		var carouselOptions = this.getCarouselOptions();
2341
2342		this.elements.$list.each( function() {
2343			var $list = jQuery( this );
2344
2345			carouselOptions.navigation = {
2346				nextEl: $list.find('.rz-swiper-button-next').get(0),
2347                prevEl: $list.find('.rz-swiper-button-prev').get(0),
2348			};
2349
2350			new Swiper( $list.find( '.razzi-product-brands__product-container' ).get(0), carouselOptions );
2351		} );
2352    }
2353}
2354
2355jQuery(window).on('elementor/frontend/init', () => {
2356
2357
2358    elementorFrontend.hooks.addAction('frontend/element_ready/widget', ($element) => {
2359        elementorFrontend.elementsHandler.addHandler(RazziProductLoopHandler, {$element});
2360    });
2361
2362    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-product-shortcode.default', ($element) => {
2363        elementorFrontend.elementsHandler.addHandler(RazziProductShortcodeWidgetHandler, {$element});
2364    });
2365
2366    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-products-masonry.default', ($element) => {
2367        elementorFrontend.elementsHandler.addHandler(RazziProductsMasonryWidgetHandler, {$element});
2368    });
2369
2370    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-products-deal.default', ($element) => {
2371        elementorFrontend.elementsHandler.addHandler(RazziProductsDealWidgetHandler, {$element});
2372    });
2373
2374    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-products-deal-2.default', ($element) => {
2375        elementorFrontend.elementsHandler.addHandler(RazziProductsDeal2WidgetHandler, {$element});
2376    });
2377
2378    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-products-deal-3.default', ($element) => {
2379        elementorFrontend.elementsHandler.addHandler(RazziProductsDeal3WidgetHandler, {$element});
2380    });
2381
2382    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-products-showcase.default', ($element) => {
2383        elementorFrontend.elementsHandler.addHandler(RazziProductsShowcaseWidgetHandler, {$element});
2384    });
2385
2386    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-product-carousel.default', ($element) => {
2387        elementorFrontend.elementsHandler.addHandler(RazziProductsCarouselWidgetHandler, {$element});
2388    });
2389
2390    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-product-of-category.default', ($element) => {
2391        elementorFrontend.elementsHandler.addHandler(RazziProductOfCategoryWidgetHandler, {$element});
2392    });
2393
2394    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-product-category-tabs.default', ($element) => {
2395        elementorFrontend.elementsHandler.addHandler(RazziProductsCategorytabsWidgetHandler, {$element});
2396    });
2397
2398    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-product-tab.default', ($element) => {
2399        elementorFrontend.elementsHandler.addHandler(RazziProductstabWidgetHandler, {$element});
2400    });
2401
2402    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-product-tab-grid.default', ($element) => {
2403        elementorFrontend.elementsHandler.addHandler(RazziProductstabGridWidgetHandler, {$element});
2404    });
2405
2406    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-deals-carousel.default', ($element) => {
2407        elementorFrontend.elementsHandler.addHandler(RazziDealsCarouselWidgetHandler, {$element});
2408    });
2409
2410    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-deals-carousel-2.default', ($element) => {
2411        elementorFrontend.elementsHandler.addHandler(RazziDealsCarousel2WidgetHandler, {$element});
2412    });
2413
2414    elementorFrontend.hooks.addAction('frontend/element_ready/razzi-products-grid.default', ($element) => {
2415        elementorFrontend.elementsHandler.addHandler(RazziProductsGridWidgetHandler, {$element});
2416    });
2417
2418    elementorFrontend.hooks.addAction( 'frontend/element_ready/razzi-products-recently-viewed-carousel.default', ( $element ) => {
2419        elementorFrontend.elementsHandler.addHandler( RazziProductsRecentlyViewedWidgetHandler, { $element } );
2420    } );
2421
2422    elementorFrontend.hooks.addAction( 'frontend/element_ready/razzi-products-recently-viewed-grid.default', ( $element ) => {
2423        elementorFrontend.elementsHandler.addHandler( RazziProductsRecentlyViewedWidgetGridHandler, { $element } );
2424    } );
2425
2426    elementorFrontend.hooks.addAction( 'frontend/element_ready/razzi-products-carousel-with-thumbnails.default', ( $element ) => {
2427        elementorFrontend.elementsHandler.addHandler( RazziProductsCarouselWithThumbnailsWidgetHandler, { $element } );
2428    } );
2429
2430    elementorFrontend.hooks.addAction( 'frontend/element_ready/razzi-products-slider.default', ( $element ) => {
2431        elementorFrontend.elementsHandler.addHandler( RazziProductsSliderWidgetHandler, { $element } );
2432    } );
2433
2434    elementorFrontend.hooks.addAction( 'frontend/element_ready/razzi-products-listing.default', ( $element ) => {
2435		elementorFrontend.elementsHandler.addHandler( RazziProductsListingWidgetHandler, { $element } );
2436	} );
2437
2438    elementorFrontend.hooks.addAction( 'frontend/element_ready/razzi-products-listing-2.default', ( $element ) => {
2439		elementorFrontend.elementsHandler.addHandler( RazziProductsListing2WidgetHandler, { $element } );
2440	} );
2441
2442    elementorFrontend.hooks.addAction( 'frontend/element_ready/razzi-product-brands.default', ( $element ) => {
2443		elementorFrontend.elementsHandler.addHandler( RazziProductBrandsWidgetHandler, { $element } );
2444	} );
2445
2446});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.