<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">/* eslint-disable no-var,@typescript-eslint/naming-convention */
/* eslint-env jquery  */

/* eslint-env browser  */

function toTop() {
  const height = ($(window).height() / 30) * 100;
  if ($(window).scrollTop() &gt; height) {
    $('.to_top_btn').addClass('_show');
  } else {
    $('.to_top_btn').removeClass('_show');
  }
}

function toTopVisibility() {
  $('.to_top_btn')
    .off()
    .click(function () {
      $('html, body').animate({ scrollTop: 0 }, '1000');
      return false;
    });
}

function MobileMenu() {
  $('.menu-Hamburger')
    .off()
    .click(function (e) {
      $('.menu_holder').stop().fadeIn(100);
      $('.mobile_menu').stop().addClass('open');
      $('.header_holder,.search_header,.main_body,footer,.custom_breadcrumb')
        .delay(300)
        .addClass('blur_filter');
    });
  $('.menu_holder,.close_menu')
    .off()
    .click(function (e) {
      $('.mobile_menu').stop().removeClass('open');
      $('.menu_holder').stop().fadeOut('fast');
      $('.header_holder,.search_header,.main_body,footer,.custom_breadcrumb')
        .delay(300)
        .removeClass('blur_filter');
    });

  $('.mobile_menu').click(function (e) {
    e.stopPropagation();
  });
  $('.mobile_menu  &gt; ul &gt; li')
    .off()
    .click(function (event) {
      if ($(this).hasClass('open')) {
        $(this).stop().removeClass('open').find('ul:first').slideUp().removeClass('open');
      } else {
        $('.mobile_menu &gt; ul &gt; li')
          .stop()
          .removeClass('open')
          .find('ul:first')
          .slideUp()
          .removeClass('open');
        $(this).stop().addClass('open').find('ul:first').slideDown().addClass('open');
      }
      event.stopPropagation();
    });
  $('.submenu &gt; li')
    .off()
    .click(function (event) {
      if ($(this).hasClass('open')) {
        $(this).stop().removeClass('open').find('ul:first').slideUp().removeClass('open');
      } else {
        $('.submenu &gt; li')
          .stop()
          .removeClass('open')
          .find('ul:first')
          .slideUp()
          .removeClass('open');
        $(this).stop().addClass('open').find('ul:first').slideDown().addClass('open');
      }
      event.stopPropagation();
    });
  $('.mobile_menu li').click(function (e) {
    e.stopPropagation();
  });
}

// Count Down
function countDown() {
  var date = $('#countDownDate').attr('data-beforeDateTime');
  var countDownDate = new Date(date).getTime();

  var x = setInterval(function () {
    var now = new Date().getTime();
    var distance = countDownDate - now;

    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
    var seconds = Math.floor((distance % (1000 * 60)) / 1000);

    $('#days').html(`${days}`);
    $('#hours').html(`${hours}`);
    if (minutes &gt; 9) {
      $('#minutes').html(`${minutes}`);
    } else {
      $('#minutes').html(`0${minutes}`);
    }

    if (seconds &gt; 9) {
      $('#seconds').html(`${seconds}`);
    } else {
      $('#seconds').html(`0${seconds}`);
    }

    if (distance &lt; 0) {
      clearInterval(x);
      $('#days').html('00');
      $('#hours').html('00');
      $('#minutes').html('00');
      $('#seconds').html('00');

      $('.count_down_caption').addClass('active');
      $('.number_box').addClass('deactive');
    }
  }, 1000);
}

function loginPage() {
  var win_h = $(window).height();
  $('.login_page').css('min-height', win_h);

  countDown();
}

function searchResult() {
  $('.top_header .search_box')
    .off()
    .click(function () {
      $(this).addClass('showResultBox');
      $('.result_search').fadeIn();
    });
}

function keyupSearchResult() {
  $('.top_header .search_box').keyup(function () {
    $(this).addClass('change_icon_search');
    $('.search_history').css('display', 'none');
    $('.search_type').fadeIn();
  });
}

function openProfileMenu() {
  $(document)
    .off('click', '.top_header .user_btn')
    .on('click', '.top_header .user_btn', function () {
      $(this).find('.profile_submenu').slideToggle();
    });
}

// Main Slider
function mainSlider() {
  $('.anim-slider').animateSlider({
    autoplay: true,
    interval: 5000,
    animations: {
      0: {
        img: {
          show: 'fadeIn',
          hide: 'fadeOut',
          delayShow: 'delay0s',
        },
      },
      1: {
        img: {
          show: 'fadeIn',
          hide: 'fadeOut',
          delayShow: 'delay0s',
        },
      },
      2: {
        img: {
          show: 'fadeIn',
          hide: 'fadeOut',
          delayShow: 'delay0s',
        },
      },
    },
  });
}

// Sale Slider
function saleSlider() {
  if ($('.sale_slider').length) {
    $('.sale_slider').owlCarousel({
      rtl: true,
      loop: true,
      margin: 0,
      dots: false,
      autoWidth: false,
      nav: true,
      margin: 16,
      navText: ["&lt;i class='icon-Right'&gt;&lt;/i&gt;", "&lt;i class='icon-Left'&gt;&lt;/i&gt;"],

      responsive: {
        1200: {
          autoWidth: true,
        },
        768: {
          autoWidth: true,
        },
        460: {
          autoWidth: false,
          items: 2,
        },
        362: {
          autoWidth: true,
        },
        200: {
          autoWidth: false,
          items: 1,
        },
      },
    });
  }
}

// Full Slider
function fullSlider() {
  if ($('.full_slider').length) {
    $('.full_slider').owlCarousel({
      rtl: true,
      loop: true,
      margin: 0,
      dots: false,
      autoWidth: false,
      nav: true,
      margin: 24,
      navText: ["&lt;i class='icon-Right'&gt;&lt;/i&gt;", "&lt;i class='icon-Left'&gt;&lt;/i&gt;"],

      responsive: {
        1200: {
          autoWidth: true,
        },
        768: {
          autoWidth: true,
        },
        460: {
          autoWidth: false,
          items: 2,
        },
        362: {
          autoWidth: true,
          margin: 16,
        },
        200: {
          autoWidth: false,
          items: 1,
        },
      },
    });
  }
}

function fullSliderPays() {
  // Full Slider
  if ($('.full_slider_pays').length) {
    $('.full_slider_pays').owlCarousel({
      rtl: true,
      loop: false,
      margin: 0,
      dots: false,
      autoWidth: false,
      nav: true,
      margin: 24,
      navText: ["&lt;i class='icon-Right'&gt;&lt;/i&gt;", "&lt;i class='icon-Left'&gt;&lt;/i&gt;"],

      responsive: {
        1200: {
          autoWidth: false,
          items: 5,
        },
        990: {
          autoWidth: false,
          items: 4,
        },
        768: {
          autoWidth: false,
          items: 3,
        },
        460: {
          autoWidth: false,
          items: 2,
        },
        362: {
          autoWidth: false,
          items: 2,
        },
        200: {
          autoWidth: false,
          items: 1,
        },
      },
    });
  }
}

// Bestsellers Slider
function bestsellersSlider() {
  if ($('.bestsellers_slider').length) {
    $('.bestsellers_slider').owlCarousel({
      rtl: true,
      loop: false,
      margin: 0,
      dots: false,
      autoWidth: false,
      nav: true,
      margin: 8,
      navText: ["&lt;i class='icon-Right'&gt;&lt;/i&gt;", "&lt;i class='icon-Left'&gt;&lt;/i&gt;"],

      responsive: {
        768: {
          autoWidth: true,
          nav: true,
        },
        460: {
          autoWidth: true,
          nav: true,
        },
        362: {
          autoWidth: true,
          nav: true,
        },
        200: {
          autoWidth: true,
          nav: true,
        },
      },
    });
  }
}

$('.slider_nav .right')
  .off()
  .click(function () {
    $(this).parents('.sale_sec_type2').find('.owl-prev').trigger('click');
  });
$('.slider_nav .left')
  .off()
  .click(function () {
    $(this).parents('.sale_sec_type2').find('.owl-next').trigger('click');
  });

// close result search on click body
$(document).on('click', function (e) {
  if ($(e.target).closest('.h_search').length === 0) {
    $('.result_search').hide();
    $('.top_header .search_box').removeClass('showResultBox');
    $('.top_header .search_box').removeClass('change_icon_search');
  }
});

// JS Shopping
function categoryPage() {
  var catSubHeightSidebar;
  var position = 'collapsed';

  $('#sidebar .cat_sub.collapsed_box').css('height', 'auto');
  $('#sidebar .brands .collapsed_box2').css('height', 'auto');
  catSubHeightSidebar = $('#sidebar .cat_sub.collapsed_box').height();
  collpaseHeightSidebar = $('#sidebar .brands .collapsed_box2').height();
  $('#sidebar .cat_sub.collapsed_box').css('height', '170px');
  $('#sidebar .brands .collapsed_box2').css('height', '220px');
  $('#sidebar .view_all_cat_btn')
    .off()
    .click(function () {
      if (position == 'collapsed') {
        $(this).prev().find('.collapsed_box').animate({ height: catSubHeightSidebar }, 300);
        $(this).prev().find('.collapsed_box2').animate({ height: collpaseHeightSidebar }, 300);
        $(this).find('.icon').addClass('rotate');
        $(this).find('.btn_txt').text('بستن');
        position = 'expanded';
      } else {
        $(this).prev().find('.collapsed_box').animate({ height: '170px' }, 300);
        $(this).prev().find('.collapsed_box2').animate({ height: '220px' }, 300);
        $(this).find('.icon').removeClass('rotate');
        $(this).find('.btn_txt').text('مشاهده همه');
        position = 'collapsed';
      }
    });

  // Count Down
  var date = $('#countDownDate_1').attr('data-beforeDateTime');
  var countDownDate = new Date(date).getTime();

  var x = setInterval(function () {
    var now = new Date().getTime();
    var distance = countDownDate - now;

    var days = Math.floor(distance / (1000 * 60 * 60 * 24));
    var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
    var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
    var seconds = Math.floor((distance % (1000 * 60)) / 1000);

    $('#days_1').html(`${days}`);
    $('#hours_1').html(`${hours}`);
    if (minutes &gt; 9) {
      $('#minutes_1').html(`${minutes}`);
    } else {
      $('#minutes_1').html(`0${minutes}`);
    }

    if (seconds &gt; 9) {
      $('#seconds_1').html(`${seconds}`);
    } else {
      $('#seconds_1').html(`0${seconds}`);
    }

    if (distance &lt; 0) {
      clearInterval(x);
      $('#days_1').html('00');
      $('#hours_1').html('00');
      $('#minutes_1').html('00');
      $('#seconds_1').html('00');

      $('#countDownDate_1 .count_down_caption').addClass('active');
      $('#countDownDate_1 .number_box').addClass('deactive');
    }
  }, 1000);

  // sticky sidebar
  var stickySidebar = new StickySidebar('#sidebar', {
    topSpacing: 20,
    bottomSpacing: 20,
    containerSelector: '.container',
    innerWrapperSelector: '.sidebar_inner',
  });
}

function scoreDetailsModal() {
  $('.open-score-details-modal').click(function () {
    $('.body_overlay').fadeIn('fast');
    $('body').addClass('modal-open');
    $('.score_details_tooltip').fadeIn('fast');

    // close
    $('.body_overlay').click(function () {
      $(this).fadeOut('fast');
      $('body').removeClass('modal-open');
      $('.score_details_tooltip').fadeOut('fast');
    });
  });
}

// JS Order Page
function addrModal() {
  $('.has_modal')
    .off()
    .click(function () {
      var target = $(this).data('modal');
      $('._modal').stop().hide().removeClass('open');
      $(`._modal#${target}`).stop().fadeIn().addClass('open');
    });
  $('._modal .close_btn')
    .off()
    .click(function () {
      $(this).parents('._modal').stop().hide().removeClass('open');
    });
}

function priceChartModal() {
  $('.has_modal').click(function () {
    var target = $(this).data('modal');
    $('._modal').stop().hide().removeClass('open');
    $(`._modal#${target}`).stop().fadeIn().addClass('open');
    $('body').addClass('modal-open');
  });
  $('._modal .close_btn').click(function () {
    $(this).parents('._modal').stop().hide().removeClass('open');
    $('body').removeClass('modal-open');
  });
}

function orderSlider() {
  // Order Slider
  if ($('.order_slider').length) {
    $('.order_slider').owlCarousel({
      rtl: true,
      loop: false,
      margin: 0,
      dots: false,
      autoWidth: false,
      nav: false,
      margin: 24,
      navText: ["&lt;i class='icon-Right'&gt;&lt;/i&gt;", "&lt;i class='icon-Left'&gt;&lt;/i&gt;"],

      responsive: {
        1200: {
          items: 9,
        },
        990: {
          items: 5,
        },
        768: {
          items: 7,
        },
        460: {
          items: 4,
        },
        362: {
          margin: 3,
        },
        200: {
          autoWidth: false,
          items: 1,
        },
      },
    });
  } else {
    setTimeout(() =&gt; orderSlider(), 1000);
  }
}

function menuFixer() {
  var menuHeight = $('#header_lendo').outerHeight(true);
  if ($(window).scrollTop() &gt; menuHeight) {
    $('#header_lendo').addClass('fixed');
  } else {
    $('#header_lendo').removeClass('fixed');
  }
}

// Privillages
function selectSec() {
  $('.dots_holder .item')
    .off()
    .click(function () {
      var active_index = $('._section.active').index();
      var current_index = $(this).index();
      var id = $(this).data('target');

      $('._section').removeClass('active');
      $('._section').find('.desc').removeClass('animate__fadeInUp');
      $(`#${id}`).addClass('active');
      $(`#${id}`).find('.desc').addClass('animate__fadeInUp');

      if (current_index &lt; active_index) {
        $(`#${id}`).removeClass('out-bottom in-bottom out-top').addClass('in-top');
        $(`#${id}`).next().removeClass('out-top in-top in-bottom').addClass('out-bottom');
      } else if (current_index &gt; active_index) {
        $(`#${id}`).prev().removeClass('in-top in-bottom out-bottom').addClass('out-top');
        $(`#${id}`).removeClass('out-bottom out-top in-top').addClass('in-bottom');
      }

      $('.dots_holder .item').removeClass('active');
      $(this).addClass('active');
    });

  // slide to position
  var searchParams = new URLSearchParams(window.location.search);
  var param = searchParams.get('slide');
  setTimeout(function () {
    var itemTarget = $(`.item[data-target=_sec_${param}]`);
    if (param &amp;&amp; !itemTarget.hasClass('active')) {
      console.info('clicked');
      itemTarget.click();
    }
  }, 1000);

  $('.dots_holder .item').each(function () {
    var target = $(this).data('target');
    var scrollPos = $(`#${target}`).position().top;
    $(this).click(function () {
      $('.section_holder').animate(
        {
          scrollTop: scrollPos,
        },
        600,
      );
    });
  });
  $('.controller .arrow')
    .off()
    .click(function () {
      if ($(this).hasClass('up')) {
        $('.dots_holder .item.active').stop().prev().trigger('click');
      } else if ($(this).hasClass('down')) {
        $('.dots_holder .item.active').stop().next().trigger('click');
      }
    });

  $('.section_holder').on('wheel', function (e) {
    e.preventDefault();
    clearTimeout($.data(this, 'timer'));

    $.data(
      this,
      'timer',
      setTimeout(function () {
        if (e.originalEvent.wheelDelta &gt; 0) {
          $('.arrow.up').stop().trigger('click');
        } else {
          $('.arrow.down').stop().trigger('click');
        }
      }, 250),
    );
  });
  $('.section_holder').on('touchmove', function (e) {
    e.preventDefault();
    clearTimeout($.data(this, 'timer'));

    $.data(
      this,
      'timer',
      setTimeout(function () {
        if (e.originalEvent.wheelDelta &gt; 0) {
          $('.arrow.up').stop().trigger('click');
        } else {
          $('.arrow.down').stop().trigger('click');
        }
      }, 250),
    );
  });
}

function carouselShahneshinMobile() {
  $('.shah_slider_mobile').owlCarousel({
    rtl: true,
    loop: false,
    margin: 0,
    dots: false,
    autoWidth: true,
    nav: true,
    margin: 16,
    navText: ["&lt;i class='icon-Right'&gt;&lt;/i&gt;", "&lt;i class='icon-Left'&gt;&lt;/i&gt;"],

    responsive: {
      768: {
        items: 4,
      },
      460: {
        items: 3,
      },
      360: {
        items: 2,
      },
    },
  });
}

function faqAccordionShahneshinMobile() {
  $('.faq_accordion_mobile&gt;li').click(function () {
    $attr_data = $(this).attr('data-collapse');
    $('.faq-accordion&gt;li').each(function () {
      $(this).attr('data-collapse', 'close');
      $(this).find('.icon').removeClass('icon-Minus rotateArrow').addClass('icon-Plus');
    });
    if ($attr_data == 'open') {
      $('.faq_accordion_mobile&gt;li')
        .find('.icon')
        .removeClass('icon-Minus rotateArrow')
        .addClass('icon-Plus');
      $(this).attr('data-collapse', 'close');
    } else {
      $(this).find('.icon').removeClass('icon-Plus').addClass('icon-Minus rotateArrow');
      $(this).attr('data-collapse', 'open');
    }
    $('.faq_accordion_mobile&gt;li p').slideUp();
    $(this).find('p').stop().slideToggle();
  });
}

function faqAccordionShahneshin() {
  $('.faq_accordion&gt;li')
    .off()
    .click(function () {
      $attr_data = $(this).attr('data-collapse');
      $('.faq-accordion&gt;li').each(function () {
        $(this).attr('data-collapse', 'close');
        $(this).find('.icon').removeClass('icon-Minus rotateArrow').addClass('icon-Plus');
      });
      if ($attr_data == 'open') {
        $('.faq_accordion&gt;li')
          .find('.icon')
          .removeClass('icon-Minus rotateArrow')
          .addClass('icon-Plus');
        $(this).attr('data-collapse', 'close');
      } else {
        $(this).find('.icon').removeClass('icon-Plus').addClass('icon-Minus rotateArrow');
        $(this).attr('data-collapse', 'open');
      }
      $('.faq_accordion&gt;li p').slideUp();
      $(this).find('p').stop().slideToggle();
    });
}

$(window).on('scroll', function () {
  menuFixer();
});

$(document).ready(function () {
  MobileMenu();
  openProfileMenu();
  // searchResult();
  // keyupSearchResult();
  // collapseAboutFooter();
  // mainSlider();
  countDown();
  saleSlider();
  fullSlider();
  fullSliderPays();
  // categoryPage();
  // shoppingCartPage();
  addrModal();
  scoreDetailsModal();
  priceChartModal();
  // payWay();
  orderSlider();

  bestsellersSlider();
  // carouselShahneshin();
  faqAccordionShahneshin();
  carouselShahneshinMobile();
  faqAccordionShahneshinMobile();
  selectSec();
  $('._modal .close_btn')
    .off()
    .click(function () {
      $(this).parents('._modal').stop().hide().removeClass('open');
      $('body').removeClass('modal-open');
    });

  var { hash } = window.location;
  var hash = window.location.hash.slice(1);

  $(`.dots_holder .item[data-target='_${hash}']`).trigger('click');

  // Slider
  if ($('.privilages_slider').length) {
    var privilageSlider = $('.privilages_slider');
    privilageSlider.owlCarousel({
      rtl: true,
      loop: false,
      margin: 0,
      dots: false,
      autoWidth: false,
      nav: true,
      margin: 16,
      items: 1,
      navText: [
        "&lt;i class='icon-ArrowRight icon'&gt;&lt;/i&gt;&lt;div class='caption'&gt;قبلی&lt;/div&gt;",
        "&lt;div class='caption'&gt;بعدی&lt;/div&gt; &lt;i class='icon-ArrowLeft icon'&gt;&lt;/i&gt;",
      ],
      onInitialized: owlCallback,
    });
    $('.slide_num .all').html($('.privilages_slider .owl-item').length);
    $('.slide_num .current').html($('.privilages_slider .owl-item.active').index() + 1);

    $('.owl-nav button').click(function (e) {
      $('.slide_num .current').html($('.privilages_slider .owl-item.active').index() + 1);
    });

    function owlCallback() {
      var searchParams = new URLSearchParams(window.location.search);
      var param = searchParams.get('slide');
      if (param) {
        setTimeout(() =&gt; {
          privilageSlider.trigger('to.owl.carousel', [param - 1, 300]);
        }, 1000);
      }
    }
  }

  $('#info_variant #custom_select_box_holder_clickable')
    .off()
    .click(function () {
      $(this).parent().find('#select_box_list_holder').slideDown();
      $(this).parent().find('#custom_select_box_holder_icon').addClass('rotate180');
      // niceScroll plugin
      $(this).parent().find('#select_box_list').niceScroll({
        autohidemode: false,
        rtlmode: true,
        railalign: 'left',
      });
    })
    .focusout(function () {
      $(this).parent().find('#select_box_list_holder').slideUp();
      $(this).parent().find('#custom_select_box_holder_icon').removeClass('rotate180');
    });

  $('#seller_view_more #link_anchor')
    .off()
    .click(function () {
      var topsection = $('#sellers_list_all').offset().top - 30;
      $('html, body').animate({ scrollTop: topsection }, 'slow');
    });

  // search mobile
  // $('.search_box.mobile').off().click(function () {
  //   $('.modal_full_custom').fadeIn(300);
  //   $('body').addClass('modal-open');
  // });

  $('.close_modal')
    .off()
    .click(function () {
      $('.modal_full_custom').fadeOut(300);
      $('body').removeClass('modal-open');
    });

  // sort mobile
  $('.sort_btn')
    .off()
    .click(function () {
      $('.modal_full_sort').fadeIn(300);
      $('body').addClass('modal-open');
    });
  $('.sort_radio')
    .off()
    .click(function () {
      $('.modal_full_sort').stop().fadeOut(300);
      $('body').removeClass('modal-open');
    });
  $('.close_sort_modal')
    .off()
    .click(function () {
      $('.modal_full_sort').fadeOut(300);
      $('body').removeClass('modal-open');
    });

  // filter mobile
  $('.filter_btn')
    .off()
    .click(function () {
      $('.modal_full_filter').fadeIn(300);
      $('body').addClass('modal-open');
    });
  $('.close_filter_modal')
    .off()
    .click(function () {
      $('.modal_full_filter').fadeOut(300);
      $('body').removeClass('modal-open');
    });

  // filter mobile collapse
  $('.title_cat_box')
    .off()
    .click(function () {
      $(this).toggleClass('collpase').next('.body_cat_box').slideToggle();
      if ($(this).hasClass('collpase')) {
        $(this).find('.icon').removeClass('icon-Minus').addClass('icon-Plus');
      } else {
        $(this).find('.icon').removeClass('icon-Plus').addClass('icon-Minus');
      }
    });

  $('.fixed_factor .handler')
    .off()
    .click(function () {
      $(this).parents('.fixed_factor').toggleClass('open');
      $('body').toggleClass('modal-open');
    });

  // seo box show more
  $('.seo-box-context .view-more')
    .off()
    .click(function () {
      var txt = $(this).find('.txt').text();
      if (txt == 'نمایش بیشتر') {
        $(this).find('.txt').text('بستن');
        $(this).find('.icon').addClass('rotate');
      }
      if (txt == 'بستن') {
        $(this).find('.txt').text('نمایش بیشتر');
        $(this).find('.icon').removeClass('rotate');
      }
      $('.seo-box-context .context').toggleClass('view-all');
    });

  // Product Gallery

  var slideIndex = 1;

  function showSlides(n) {
    var i;
    var slides = document.getElementsByClassName('slides');
    var dots = document.getElementsByClassName('thumbnail_modal');

    if (slides &amp;&amp; dots) {
      if (n &gt; slides.length) {
        slideIndex = 1;
      }
      if (n &lt; 1) {
        slideIndex = slides.length;
      }
      for (i = 0; i &lt; slides.length; i++) {
        slides[i].style.display = 'none';
      }
      for (i = 0; i &lt; dots.length; i++) {
        dots[i].className = dots[i].className.replace(' active', '');
      }
      if (slides[slideIndex - 1]) {
        slides[slideIndex - 1].style.display = 'block';
      }

      if (dots[slideIndex - 1]) {
        dots[slideIndex - 1].className += ' active';
      }
    }
  }

  showSlides(slideIndex);

  function plusSlides(n) {
    showSlides((slideIndex += n));
  }

  function currentSlide(n) {
    showSlides((slideIndex = n));
  }

  $('[data-plus-slide]').on('click', function () {
    plusSlides($(this).data().plusSlide);
  });

  $('[data-thumb-slide]').on('click', function () {
    currentSlide($(this).data().thumbSlide);
  });
});
$(window).scroll(function () {
  if ($('.product_tab_holder .custom_tab_content').offset()) {
    var beginOffset = $('.product_tab_holder .custom_tab_content').offset().top;
    // var endOffset = $('.related_products').offset().top - 160;
    var endOffset = 2000 - 160;

    if ($(window).scrollTop() &gt;= beginOffset &amp;&amp; $(window).scrollTop() &lt;= endOffset) {
      $('.product_tab_holder .custom_tab_list_holder').addClass('__fixed_product');
    } else {
      $('.product_tab_holder .custom_tab_list_holder').removeClass('__fixed_product');
    }
  }
});

// Yalda Landing
// Mobile Menu
function mobileMenu() {
  $('.yalda_header_page .hamburger')
    .off()
    .click(function (e) {
      $('.mobile_menu').stop().toggleClass('open');
      $('body').stop().toggleClass('no-scroll');
    });
  $('.yalda_header_page .mobile_menu .close_menu,.yalda_header_page .mobile_menu a').click(
    function (e) {
      $('.mobile_menu').stop().removeClass('open');
      $('body').stop().removeClass('no-scroll');
    },
  );
  $('.yalda_header_page .mobile_menu').click(function (e) {
    e.stopPropagation();
  });
}

/**
 * example: &lt;a href="#" data-scroll="products_sec" data-gap={-56}&gt;&lt;/a&gt;
 */
function scrollByDataAttribute() {
  $('[data-scroll]')
    .off()
    .click(function (event) {
      event.preventDefault();
      var target = $(this).data().scroll;
      var gap = $(this).data().gap || 0;
      window.scroll({
        top: $(`#${target}`).offset().top + gap,
        left: 0,
        behavior: 'smooth',
      });
    });
}

function RadioBtn() {
  $('.select-container ._item,.select-container &gt; div:not(._head)').on('click', function () {
    $('.select-container&gt;div').removeClass('active').find('.radio-btn').removeClass('active');
    $(this).addClass('active').find('.radio-btn').addClass('active');
  });
  $('.warranty-type .radio-holder label').on('click', function () {
    $('.warranty-type .radio-holder label').removeClass('active');
    $('.warranty-type .radio-holder label').parents('.warranty-type').removeClass('active');
    $(this).addClass('active');
    $(this).parents('.warranty-type').addClass('active');
  });
}

function faqAccordion() {
  $('.faq-accordion&gt;li')
    .off()
    .click(function () {
      $attr_data = $(this).attr('data-collapse');
      $('.faq-accordion&gt;li').each(function () {
        $(this).attr('data-collapse', 'close');
        $(this).find('.icon').removeClass('icon-minus rotateArrow').addClass('icon-plus');
      });
      if ($attr_data == 'open') {
        $('.faq-accordion&gt;li')
          .find('.icon')
          .removeClass('icon-minus rotateArrow')
          .addClass('icon-plus');
        $(this).attr('data-collapse', 'close');
      } else {
        $(this).find('.icon').removeClass('icon-plus').addClass('icon-minus rotateArrow');
        $(this).attr('data-collapse', 'open');
      }
      $('.faq-accordion&gt;li p').slideUp();
      $(this).find('p').stop().slideToggle();
    });
}

function lendoLandingPage() {
  $('.nav-tabs li').click(function () {
    $('.warranty-tab .desc-box').removeClass('left-arrow');
    if (this.id == 'item_2') {
      $('.warranty-tab .desc_box').addClass('left-arrow');
    }
    if ($(this).attr('id') == 'item_2') {
      $('.nav-tabs').addClass('left_bg');
    } else {
      $('.nav-tabs').removeClass('left_bg');
    }
  });
}

function careerMenu() {
  var section = $('.section-body');
  var nav = $('header');

  $(window).on('load scroll', function () {
    var cur_pos = $(this).scrollTop();

    section.each(function () {
      var top = $(this).offset().top - 84;
      var bottom = top + $(this).outerHeight(true);

      if (cur_pos &gt;= top &amp;&amp; cur_pos &lt;= bottom) {
        $('nav').find('a').removeClass('active');
        section.removeClass('active');

        $(this).addClass('active');
        $('nav')
          .find(`a[href="#${$(this).attr('id')}"]`)
          .addClass('active');
      }
    });
  });
  $('nav.nav-web')
    .find('a')
    .not('.off')
    .on('click', function () {
      var $el = $(this);
      var id = $el.attr('href');
      $('html, body').animate(
        {
          scrollTop: $(id).offset().top - 80,
        },
        500,
      );

      return false;
    });
}

function landigMobileMenu() {
  $('header .menu-collaps')
    .off()
    .click(function () {
      $('header .menu-holder').addClass('open');
      $('body').addClass('no-scroll');
    });
  $('header .close-menu')
    .off()
    .click(function () {
      $('header .menu-holder').removeClass('open');
      $('body').removeClass('no-scroll');
    });
  $('nav')
    .find('a')
    .off()
    .on('click', function () {
      $('header .menu-holder').stop().removeClass('open');
      $('body').removeClass('no-scroll');
    });
  $('nav.nav-mobile')
    .find('a')
    .off()
    .on('click', function () {
      var $el = $(this);
      var id = $el.attr('href');
      $('html, body').animate(
        {
          scrollTop: $(id).offset().top - 30,
        },
        500,
      );

      return false;
    });
}

function helpSliderHelper() {
  $('.sec_3 .help .item').on('click', function () {
    var itemIndex = $(this).index();

    $('.owl-dot').trigger('to.owl.carousel', [itemIndex, 300]);

    $('.sec_3 .help .item').removeClass('active');
    $(this).addClass('active');
  });

  $('.help_slider').on('changed.owl.carousel', function () {
    $(`.sec_3 .help .item:eq(${$('.owl-dot.active').index()})`).trigger('click');
  });
}

function helpSlider() {
  if ($('.help_slider').length) {
    $('.help_slider').owlCarousel({
      autoplay: true,
      autoplayTimeout: 5000,
      rtl: true,
      loop: true,
      margin: 0,
      dots: true,
      items: 1,
      touchDrag: false,
      mouseDrag: false,
      nav: true,
      animateOut: 'fadeOut',
      navText: [
        "&lt;img src='https://static.timcheh.com/uploads/manual/images/landing/ayandehdaran/arrow-right.svg' alt=''&gt;",
        "&lt;img src='https://static.timcheh.com/uploads/manual/images/landing/ayandehdaran/arrow-left.svg' alt=''&gt;",
      ],
      responsive: {
        // breakpoint from 0 up
        0: {
          touchDrag: true,
          mouseDrag: true,
        },
        768: {
          touchDrag: false,
          mouseDrag: false,
        },
      },
    });
  }
  helpSliderHelper();
}

function careerSlider() {
  $('.career_slider').owlCarousel({
    rtl: true,
    loop: false,
    margin: 0,
    dots: false,
    autoWidth: false,
    nav: true,
    margin: 16,
    items: 2,
    navText: ["&lt;i class='icon-chevron-right'&gt;&lt;/i&gt;", "&lt;i class='icon-chevron-left'&gt;&lt;/i&gt;"],

    responsive: {
      768: {
        items: 2,
      },
      320: {
        items: 1,
      },
    },
  });
}

function careerSliderMobile() {
  $('.career_slider').owlCarousel({
    rtl: true,
    loop: false,
    margin: 0,
    dots: false,
    autoWidth: false,
    nav: true,
    margin: 16,
    items: 4,
    navText: ["&lt;i class='icon-chevron-right'&gt;&lt;/i&gt;", "&lt;i class='icon-chevron-left'&gt;&lt;/i&gt;"],

    responsive: {
      992: {
        items: 4,
        autoWidth: false,
        nav: true,
      },
      768: {
        items: 3,
        autoWidth: false,
        nav: true,
      },
      320: {
        items: 2,
        autoWidth: true,
        nav: false,
      },
    },
  });
}

function mobileTimeSlotSlider(mobileTimeSlides) {
  var sync1 = mobileTimeSlides;
  var sync2 = $(sync1).parent().find('[data-mobileTimeTabs]');
  var slidesPerPage = 5; // globaly define number of elements per page
  var syncedSecondary = true;

  sync1
    .owlCarousel({
      rtl: true,
      items: 1,
      autoWidth: true,
      centerMode: true,
      margin: 8,
      slideSpeed: 2000,
      nav: false,
      dots: false,
      responsiveRefreshRate: 200,
    })
    .on('changed.owl.carousel', syncPosition);

  sync2
    .on('initialized.owl.carousel', function () {
      sync2.find('.owl-item').eq(0).addClass('current');
    })
    .owlCarousel({
      rtl: true,
      items: slidesPerPage,
      dots: false,
      nav: false,
      autoWidth: true,
      margin: 8,
      // center:true,
      smartSpeed: 200,
      slideSpeed: 500,
      URLhashListener: true,
      startPosition: 'URLHash',
      slideBy: slidesPerPage, // alternatively you can slide by 1, this way the active slide will stick to the first item in the second carousel
      responsiveRefreshRate: 100,
    })
    .on('changed.owl.carousel', syncPosition2);

  function syncPosition(el) {
    // if you set loop to false, you have to restore this next line
    var current = el.item.index;
    sync2.find('.owl-item').removeClass('current').eq(current).addClass('current');
    var onscreen = sync2.find('.owl-item.active').length - 1;
    var start = sync2.find('.owl-item.active').first().index();
    var end = sync2.find('.owl-item.active').last().index();

    if (current &gt; end) {
      sync2.data('owl.carousel').to(current, 100, true);
    }
    if (current &lt; start) {
      sync2.data('owl.carousel').to(current - onscreen, 100, true);
    }
  }

  function syncPosition2(el) {
    if (syncedSecondary) {
      var number = el.item.index;
      sync1.data('owl.carousel').to(number, 100, true);
    }
  }

  sync2.on('click', '.owl-item', function (e) {
    e.preventDefault();
    var number = $(this).index();
    sync1.data('owl.carousel').to(number, 300, true);
  });
}

$(window).on('scroll', function () {
  menuFixer();
});

$(document).ready(function () {
  if ($('.order_mobile_page').length) {
    function timeSlotsVisibilityCheck() {
      if ($('[data-mobileTimeSlides]').length) {
        $('[data-mobileTimeSlides]').each(function () {
          mobileTimeSlotSlider($(this));
        });
      } else {
        setTimeout(() =&gt; {
          timeSlotsVisibilityCheck();
        }, 500);
      }
    }

    timeSlotsVisibilityCheck();
  }

  if ($('.ayandehdaran-page').length) {
    helpSlider();
  }
  if ($('.career-desktop-page').length) {
    careerMenu();
    careerSlider();
  }
  if ($('.career-mobile-page').length) {
    landigMobileMenu();
    careerSliderMobile();
  }
  // if ($('.lendo-desktop-page').length || $('.lendo-mobile-page').length) {
  //   lendoLandingPage();
  //   RadioBtn();
  //   faqAccordion();
  //   landigMobileMenu();
  // }
  // menuActivator();
  toTop();
  toTopVisibility();
  scrollByDataAttribute();
  mobileMenu();
  menuFixer();
  countDown();
  // Sale Slider
  if ($('.product_slider').length &amp;&amp; !$('.product_slider').hasClass('owl-loaded')) {
    setTimeout(() =&gt; {
      $('.product_slider').owlCarousel({
        rtl: true,
        loop: false,
        margin: 0,
        dots: true,
        autoWidth: true,
        nav: true,
        margin: 16,
        navText: [
          "&lt;img src='https://images.timcheh.com/1/fill/100/100/sm/true/plain/https://static.timcheh.com/uploads/manual/images/landing/yalda/images/arrow-left-big.svg'/&gt;",
          "&lt;img src='https://images.timcheh.com/1/fill/100/100/sm/true/plain/https://static.timcheh.com/uploads/manual/images/landing/yalda/images/arrow-left-big.svg'/&gt;",
        ],

        responsive: {
          768: {
            autoWidth: true,
          },
          460: {
            autoWidth: true,
            dots: true,
          },
          362: {
            autoWidth: true,
            dots: false,
          },
          200: {
            autoWidth: true,
            dots: false,
          },
        },
      });
    }, 1000);
  }

  $('[class*="info_variant"] [class*="custom_select_box_holder"] [class*="select_box"]')
    .off()
    .click(function () {
      // var value = $(this).find('[class*="input_value"]').text();
      $(this).find('[class*="select_box_list_holder"]').slideToggle('fast');
      $(this).find('[class*="icon"]').toggleClass('rotate');
      $('[class*="item_select_box"]')
        .off()
        .click(function () {
          const value = $(this).text();
          $('[class*="input_value"]').text(value);
        });

      $(this).find('[class*="select_box_list"]').niceScroll({
        autohidemode: false,
        rtlmode: true,
        railalign: 'left',
      });
    });

  $('[class*="product_wrapper"] #select_box')
    .off()
    .click(function () {
      console.log('Main');
      var value = $(this).find('[class*="input_value"]').text();
      $('.body_overlay').fadeIn('fast');
      $('body').addClass('modal-open');
      $(this).parent().find('[class*="select_box_list_holder"]').fadeIn('fast');

      $('[class*="item_select_box"]')
        .off()
        .click(function () {
          console.log('item_select_box');
          var new_Value = $(this).html();
          $(this)
            .parents('[class*="custom_select_box_holder"]')
            .find('[class*="input_value"]')
            .html(new_Value);
          $('body').removeClass('modal-open');
          $('.body_overlay').fadeOut('fast');
          $('[class*="select_box_list_holder"]').fadeOut('fast');
        });

      $('.body_overlay')
        .off()
        .click(function () {
          console.log('body_overlay');
          $(this).fadeOut('fast');
          $('body').removeClass('modal-open');
          $('[class*="select_box_list_holder"]').fadeOut('fast');
        });
    });

  $('[class*="related_slider"]')
    .owlCarousel('destroy')
    .owlCarousel({
      rtl: true,
      dots: false,
      autoWidth: false,
      nav: false,
      margin: 8,
      items: 3,
      navText: ["&lt;i class='icon-Right'&gt;&lt;/i&gt;", "&lt;i class='icon-Left'&gt;&lt;/i&gt;"],

      responsive: {
        1200: {
          autoWidth: true,
        },
        768: {
          autoWidth: true,
        },
        460: {
          autoWidth: false,
          items: 2,
        },
        320: {
          autoWidth: true,
          items: 1,
        },
      },
    });
  $('[data-target="#myModal"]').click(function () {
    $('#myModal').modal();
  });
  $('[data-target="#better_price"]')
    .off()
    .click(function () {
      $('#better_price').addClass('open');
    });

  $('#view_all_seller_btn')
    .off()
    .click(function () {
      $('[class*="body_all_seller_table"]').niceScroll({
        autohidemode: false,
        rtlmode: true,
        railalign: 'left',
      });
    });

  $('#back_table')
    .off()
    .click(function () {
      $('[class*="body_all_seller_table"]').getNiceScroll().remove();
    });
});

$(document)
  .off()
  .click(function (e) {
    if ($(e.target).closest('[class*="select_box"]').length === 0) {
      $(this).find('[class*="select_box_list_holder"]').slideUp();
    }
  });

$(window).scroll(function () {
  toTop();
});

$(document).on('component.select', function Handler() {
  console.log('component.select event triggered');
  $('#component_select_box')
    .off()
    .unbind()
    .click(function () {
      $(this).find('#component_select_box_list_holder').slideToggle('fast');
      $(this).find('[class*=icon]').toggleClass('rotate');

      $(this).find('#component_select_box_list').niceScroll({
        autohidemode: false,
        rtlmode: true,
        railalign: 'left',
      });
    });
});
</pre></body></html>