text: (function ($) {
      "use strict";
  
      /*-------------------------------------
      Contact Form initiating
      -------------------------------------*/
      var contactForm = $('#contact-form');
      if (contactForm.length) {
          contactForm.validator().on('submit', function (e) {
              var $this = $(this),
                  $target = contactForm.find('.form-response');
              if (e.isDefaultPrevented()) {
                  $target.html("<div class='alert alert-success'><p>Please select all required field.</p></div>");
              } else {
                  $.ajax({
                      url: "vendor/php/contact-form-process.php",
                      type: "POST",
                      data: contactForm.serialize(),
                      beforeSend: function () {
                          $target.html("<div class='alert alert-info'><p>Loading ...</p></div>");
                      },
                      success: function (text) {
                          if (text === "success") {
                              $this[0].reset();
                              $target.html("<div class='alert alert-success'><p>Message has been sent successfully.</p></div>");
                          } else {
                              $target.html("<div class='alert alert-success'><p>" + text + "</p></div>");
                          }
                      }
                  });
                  return false;
              }
          });
      }
  
      /*-------------------------------------
      Jquery Serch Box
      -------------------------------------*/
      $('a[href="#search"]').on("click", function (event) {
          event.preventDefault();
          var target = $("#search");
          target.addClass("open");
          setTimeout(function () {
              target.find('input').focus();
          }, 600);
          return false;
      });
  
      $("#search, #search button.close").on("click keyup", function (event) {
          if (
              event.target === this ||
              event.target.className === "close" ||
              event.keyCode === 27
          ) {
              $(this).removeClass("open");
          }
      });
  
      /*-------------------------------------
      Jquery Advance Serch Box
      -------------------------------------*/
      $("#adv-serch").on('click', function () {
          var _self = $(this);
          _self.parents('.adv-search-wrap').find(".advance-search-form").slideToggle();
          _self.toggleClass('icon-alter');
  
      });
  
      /*-------------------------------------
      Quantity Holder
      -------------------------------------*/
      $('#quantity-holder').on('click', '.quantity-plus', function () {
  
          var $holder = $(this).parents('.quantity-holder');
          var $target = $holder.find('input.quantity-input');
          var $quantity = parseInt($target.val(), 10);
          if ($.isNumeric($quantity) && $quantity > 0) {
              $quantity = $quantity + 1;
              $target.val($quantity);
          } else {
              $target.val($quantity);
          }
  
      }).on('click', '.quantity-minus', function () {
  
          var $holder = $(this).parents('.quantity-holder');
          var $target = $holder.find('input.quantity-input');
          var $quantity = parseInt($target.val(), 10);
          if ($.isNumeric($quantity) && $quantity >= 2) {
              $quantity = $quantity - 1;
              $target.val($quantity);
          } else {
              $target.val(1);
          }
      });
  
      /*-------------------------------------
      On Scroll 
      -------------------------------------*/
      $(window).on('scroll', function () {
          if ($(window).scrollTop() > 700) {
              $('.scrollup').addClass('back-top');
          } else {
              $('.scrollup').removeClass('back-top');
          }
      });
  
      /*-------------------------------------
      Rating selection
      -------------------------------------*/
      $('.rate-wrapper').on('click', '.rate .rate-item', function () {
          var self = $(this),
              target = self.parent('.rate');
          target.addClass('selected');
          target.find('.rate-item').removeClass('active');
          self.addClass('active');
      });
  
      /*-------------------------------------
       Select2 activation code
       -------------------------------------*/
      if ($('select.select2').length) {
          $('select.select2').select2({
              theme: 'classic',
              dropdownAutoWidth: true,
              width: '100%'
          });
          $('.opening-hours-wrap select.select2').select2({
              theme: 'classic',
              width: '100%'
          });
      }
  
      /*-------------------------------------
       Google Map
      -------------------------------------*/
      if ($('#googleMap').length) {
          var initialize = function () {
              var mapOptions = {
                  zoom: 15,
                  scrollwheel: false,
                  center: new google.maps.LatLng(-37.81618, 144.95692),
                  styles: [{
                      stylers: [{
                          saturation: -100
                      }]
                  }]
              };
              var map = new google.maps.Map(document.getElementById("googleMap"), mapOptions);
              var marker = new google.maps.Marker({
                  position: map.getCenter(),
                  animation: google.maps.Animation.BOUNCE,
                  icon: 'img/map-marker.png',
                  map: map
              });
          }
          // Add the map initialize function to the window load function
          google.maps.event.addDomListener(window, "load", initialize);
      }
  
      /*-------------------------------------
      Active Menu
      -------------------------------------*/
      $('#site-menu li a').on('click', function () {
          $('#site-menu').find('.current').removeClass('current');
          $(this).parent().addClass('current');
      });
  
  
      $('.toggle-menu').on('click', function () {
          $('#site-menu').slideToggle(500);
          $(this).toggleClass('active');
      })
  
      /*-------------------------------------
      Menu fixded
      -------------------------------------*/
      if ($('header .header-main-menu').length && $('header .header-main-menu').hasClass('header-sticky')) {
          var header_position = $('header .header-main-menu').offset(),
              lastScroll = 100;
          $(window).on('scroll load', function (event) {
              var st = $(this).scrollTop();
              if (st > header_position.top) {
                  ($(".header-table").length) ? $('header .header-table').addClass("header-fixed"): $('header .header-main-menu').addClass("header-fixed");
              } else {
                  ($(".header-table").length) ? $('header .header-table').removeClass("header-fixed"): $('header .header-main-menu').removeClass("header-fixed");
              }
  
              lastScroll = st;
  
              if (st === 0) {
                  ($(".header-table").length) ? $('header .header-table').removeClass("header-fixed"): $('header .header-main-menu').removeClass("header-fixed");
              }
          });
      }
  
      /*---------------------------------------
      On Click Section Switch
      --------------------------------------- */
      $('[data-type="section-switch"]').on('click', function () {
          if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') && location.hostname === this.hostname) {
              var target = $(this.hash);
              if (target.length > 0) {
  
                  target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
                  $('html,body').animate({
                      scrollTop: target.offset().top
                  }, 1000);
                  return false;
              }
          }
      });
  
      /*-------------------------------------
      Carousel slider initiation
      -------------------------------------*/
      if ($.fn.owlCarousel) {
          $('.rc-carousel').each(function () {
              var carousel = $(this),
                  loop = carousel.data('loop'),
                  items = carousel.data('items'),
                  margin = carousel.data('margin'),
                  stagePadding = carousel.data('stage-padding'),
                  autoplay = carousel.data('autoplay'),
                  autoplayTimeout = carousel.data('autoplay-timeout'),
                  smartSpeed = carousel.data('smart-speed'),
                  dots = carousel.data('dots'),
                  nav = carousel.data('nav'),
                  navSpeed = carousel.data('nav-speed'),
                  rXsmall = carousel.data('r-x-small'),
                  rXsmallNav = carousel.data('r-x-small-nav'),
                  rXsmallDots = carousel.data('r-x-small-dots'),
                  rXmedium = carousel.data('r-x-medium'),
                  rXmediumNav = carousel.data('r-x-medium-nav'),
                  rXmediumDots = carousel.data('r-x-medium-dots'),
                  rSmall = carousel.data('r-small'),
                  rSmallNav = carousel.data('r-small-nav'),
                  rSmallDots = carousel.data('r-small-dots'),
                  rMedium = carousel.data('r-medium'),
                  rMediumNav = carousel.data('r-medium-nav'),
                  rMediumDots = carousel.data('r-medium-dots'),
                  rLarge = carousel.data('r-large'),
                  rLargeNav = carousel.data('r-large-nav'),
                  rLargeDots = carousel.data('r-large-dots'),
                  rExtraLarge = carousel.data('r-extra-large'),
                  rExtraLargeNav = carousel.data('r-extra-large-nav'),
                  rExtraLargeDots = carousel.data('r-extra-large-dots'),
                  center = carousel.data('center'),
                  custom_nav = carousel.data('custom-nav') || '';
              carousel.addClass('owl-carousel');
              var owl = carousel.owlCarousel({
                  loop: (loop ? true : false),
                  items: (items ? items : 4),
                  lazyLoad: true,
                  margin: (margin ? margin : 0),
                  autoplay: (autoplay ? true : false),
                  autoplayTimeout: (autoplayTimeout ? autoplayTimeout : 1000),
                  smartSpeed: (smartSpeed ? smartSpeed : 250),
                  dots: (dots ? true : false),
                  nav: (nav ? true : false),
                  navText: ['<i class="flaticon-back" aria-hidden="true"></i>', '<i class="flaticon-next" aria-hidden="true"></i>'],
                  navSpeed: (navSpeed ? true : false),
                  center: (center ? true : false),
                  responsiveClass: true,
                  responsive: {
                      0: {
                          items: (rXsmall ? rXsmall : 1),
                          nav: (rXsmallNav ? true : false),
                          dots: (rXsmallDots ? true : false)
                      },
                      576: {
                          items: (rXmedium ? rXmedium : 2),
                          nav: (rXmediumNav ? true : false),
                          dots: (rXmediumDots ? true : false)
                      },
                      768: {
                          items: (rSmall ? rSmall : 3),
                          nav: (rSmallNav ? true : false),
                          dots: (rSmallDots ? true : false)
                      },
                      992: {
                          items: (rMedium ? rMedium : 4),
                          nav: (rMediumNav ? true : false),
                          dots: (rMediumDots ? true : false)
                      },
                      1200: {
                          items: (rLarge ? rLarge : 5),
                          nav: (rLargeNav ? true : false),
                          dots: (rLargeDots ? true : false)
                      },
                      1400: {
                          items: (rExtraLarge ? rExtraLarge : 6),
                          nav: (rExtraLargeNav ? true : false),
                          dots: (rExtraLargeDots ? true : false)
                      }
                  }
              });
              if (custom_nav) {
                  var nav = $(custom_nav),
                      nav_next = $('.rt-next', nav),
                      nav_prev = $('.rt-prev', nav);
  
                  nav_next.on('click', function (e) {
                      e.preventDefault();
                      owl.trigger('next.owl.carousel');
                      return false;
                  });
  
                  nav_prev.on('click', function (e) {
                      e.preventDefault();
                      owl.trigger('prev.owl.carousel');
                      return false;
                  });
              }
          });
      }
  
      /*-------------------------------------
      Window On Load Function
      -------------------------------------*/
      $(window).on('load', function () {
  
          // Page Preloader
          $('#preloader').fadeOut('slow', function () {
              $(this).remove();
          });
  
      });
  
      /*---------------------------------------
      Summernote
      --------------------------------------- */
      if ($.fn.summernote !== undefined) {
          $(document).ready(function () {
              $('.summernote').summernote({
                  height: 300,
              });
          });
      }
  
      /*-------------------------------------
      Section background image 
      -------------------------------------*/
      imageFunction();
  
      function imageFunction() {
  
          $('[data-bg-image]').each(function () {
              var img = $(this).data('bg-image');
              $(this).css({
                  backgroundImage: 'url(' + img + ')',
              });
          });
      }
  
  })(jQuery);