{"version":3,"sources":["before.js","main.js","after.js"],"names":["$","OpalWoocommerceMain","_classCallCheck","this","initCarousel","addedToCart","initSelectOrder","renderWislistLoading","_createClass","key","value","instance","is","a","x","b","document","getElementsByClassName","elmnt","y","i","arrNo","push","c","length","indexOf","classList","add","j","selElmnt","$select","getElementsByTagName","createElement","setAttribute","innerHTML","options","selectedIndex","appendChild","addEventListener","e","k","s","h","parentNode","click","trigger","stopPropagation","closeAllSelect","toggle","each","index","element","$container","$slider","closest","flexslider","selector","animation","controlNav","smoothHeight","_this2","activeGalleryThumbnail","slider","currentSlide","after","start","setTimeout","data","resize","on","find","directionNav","slideshow","$gallery","removeClass","addClass","event","$item","hasClass","remove","$img","first","before","currentTarget","outerHTML","src","object","srcset","attr","$element","items","items980","items768","dots","responsive","0","768","980","1200","$product","button","productName","text","template","wp","$wishlist","ajax","action","dataType","success","beforeSend","complete","count","OpalTheme_Woocommerce_filter","_this3","selectorsClick","init","initRecentlyReviewed","priceSlideChange","initOrdering","window","renderHtml","history","state","_this4","join","preventDefault","$this","url","sendRequest","val","objUrl","URL","location","href","searchParams","URLSearchParams","search","set","toString","position","offset","top","outerHeight","getCookie","_this5","arguments","undefined","replaceUrl","initLoading","post","$html","woofilter","sidebar","html","content","filter","pushState","title","scrollUp","initPriceSlider","initCategoriesDropdown","getInstance","check","append","recentlyTitle","recentlyContent","hide","scrollHeight","height","contentHeight","animate","scrollTop","_this","show","parent","replace","_this6","current_min_price","min","min_price","max","max_price","values","current_max_price","create","slide","ui","change","body","_this7","bind","charAt","name","cname","cvalue","exdays","d","setTime","getTime","cookie","expires","ready","jQuery"],"mappings":"8XAAA,SAAAA,GAAA,GCAAC,GDAA,WAAA,QAAAA,KAAAC,gBAAAC,KAAAF,GAAAE,KAAAC,eCGAD,KAAAE,cACAJ,KAAAA,eAEAE,KAAAG,kBACAH,KAAAI,uBDPA,MAAAC,cAAAP,EAAA,OAAAQ,IAAA,cAAAC,MAAA,WAAA,MCGAT,GAAAU,WACAV,E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I,EAAAJ,OAAA,SD3dA,QAAA9K,IAAA,mBAAAC,MAAA,WCgeA,GAAAoL,GAAA3L,IACAH,GAAAgB,SAAA6K,MAAAE,KAAA,sBAAA,SAAAnH,EAAAuG,EAAAE,GACA,GAAArD,GAAAR,OAAAa,SAAAC,KAAA0C,QAAA,uCAAA,IACAhL,QAAAA,OAAAA,GAyCAgI,IAxCAhI,IAAAA,EAAAA,QAAAA,KAwCAgI,EAAAA,cAAAmD,EAAA,cAAAE,EAtCArD,EAAAA,cAAAmD,EAAA,cAAAE,EAAAS,EAAA7D,YAAAD,QDteAvH,IAAA,YAAAC,MAAA,SC6eAiK,EAAAA,GAGAY,IAAAA,GAFAJ,GAAAA,EAAAA,IACAE,EAAAA,SAAAA,OAAAA,MAAAA,KACAE,EAAAA,EAAAA,EAAAA,EAAAA,OAAAA,IAAAA,CAyCA,IAxCAE,GAAAA,GAAAA,EAAAA,GAwCA,MAAAlK,EAAAyK,OAAA,IAtCAhM,EAAAA,EAAAA,UAAAA,EAyCA,IAAA,IAAAuB,EAAAE,QAAAwK,GAtCAjM,MAAAA,GAAAA,UAAAA,EAAAA,OAAAA,EAAAA,QA0CA,MAAA,MDhiBAS,IAAA,YAAAC,MAAA,SCmiBAwL,EAAAC,GAAA,GAAAC,GAAAlD,UAAA1H,OAAA,OAAA2H,KAAAD,UAAA,GAAAA,UAAA,GAAA,GAtCAlJ,EAAAA,GAAAA,KACAqM,GAAAC,QAAAD,EAAAE,UAAA,GAAAH,EAAA,GAAA,GAAA,IACAR,IAAAA,GAAAA,WAAAA,EAAAA,aAwCA5K,UAAAwL,OAAAN,EAAA,IAAAC,EAAA,IAAAM,EAAA,cDviBAxF,IAAAjH,GAAAgB,UAAA0L,MAAA,WAAAzM,EAAAiK,cAAA,GAAAjD,MEAA0F","file":"main.js","sourcesContent":["(function ($) {","class OpalWoocommerceMain {\n static instance;\n static getInstance() {\n if (!OpalWoocommerceMain.instance) {\n OpalWoocommerceMain.instance = new OpalWoocommerceMain();\n }\n return OpalWoocommerceMain.instance;\n }\n\n constructor() {\n this.initCarousel();\n this.addedToCart();\n this.initWishlist();\n //this.initSlideProduct();\n this.initSelectOrder();\n this.renderWislistLoading();\n }\n\n initSelectOrder(){\n if($('body').is('.post-type-archive-product, .tax-product_cat')) {\n\n let x, i, j, selElmnt, a, b, c;\n /*look for any elements with the class \"custom-select\":*/\n x = document.getElementsByClassName(\"woocommerce-ordering\");\n let $select = $('.woocommerce-ordering .orderby');\n for (i = 0; i < x.length; i++) {\n selElmnt = x[i].getElementsByTagName(\"select\")[0];\n /*for each element, create a new DIV that will act as the selected item:*/\n a = document.createElement(\"DIV\");\n a.setAttribute(\"class\", \"select-selected\");\n a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML;\n x[i].appendChild(a);\n /*for each element, create a new DIV that will contain the option list:*/\n b = document.createElement(\"DIV\");\n b.setAttribute(\"class\", \"select-items select-hide\");\n for (j = 1; j < selElmnt.length; j++) {\n /*for each option in the original select element,\n create a new DIV that will act as an option item:*/\n c = document.createElement(\"DIV\");\n c.innerHTML = selElmnt.options[j].innerHTML;\n c.addEventListener(\"click\", function (e) {\n /*when an item is clicked, update the original select box,\n and the selected item:*/\n let y, i, k, s, h;\n s = this.parentNode.parentNode.getElementsByTagName(\"select\")[0];\n h = this.parentNode.previousSibling;\n for (i = 0; i < s.length; i++) {\n if (s.options[i].innerHTML == this.innerHTML) {\n s.selectedIndex = i;\n h.innerHTML = this.innerHTML;\n y = this.parentNode.getElementsByClassName(\"same-as-selected\");\n for (k = 0; k < y.length; k++) {\n y[k].removeAttribute(\"class\");\n }\n this.setAttribute(\"class\", \"same-as-selected\");\n break;\n }\n }\n h.click();\n $select.trigger('change');\n });\n b.appendChild(c);\n }\n x[i].appendChild(b);\n a.addEventListener(\"click\", function (e) {\n /*when the select box is clicked, close any other select boxes,\n and open/close the current select box:*/\n e.stopPropagation();\n closeAllSelect(this);\n this.nextSibling.classList.toggle(\"select-hide\");\n this.classList.toggle(\"select-arrow-active\");\n });\n }\n\n function closeAllSelect(elmnt) {\n /*a function that will close all select boxes in the document,\n except the current select box:*/\n let x, y, i, arrNo = [];\n x = document.getElementsByClassName(\"select-items\");\n y = document.getElementsByClassName(\"select-selected\");\n for (i = 0; i < y.length; i++) {\n if (elmnt == y[i]) {\n arrNo.push(i)\n } else {\n y[i].classList.remove(\"select-arrow-active\");\n }\n }\n for (i = 0; i < x.length; i++) {\n if (arrNo.indexOf(i)) {\n x[i].classList.add(\"select-hide\");\n }\n }\n }\n\n /*if the user clicks anywhere outside the select box,\n then close all select boxes:*/\n document.addEventListener(\"click\", closeAllSelect);\n }\n }\n\n initSlideProduct() {\n $('.product-block .product-img-wrap').each((index, element) => {\n let $slider = $(element);\n let $container = $slider.closest('.product-block');\n $slider.flexslider({\n selector: '.inner > .product-image',\n animation: 'slide',\n controlNav: true,\n directionNav: true,\n slideshow: false,\n smoothHeight: false,\n before: (slider) => {\n\n if (slider.direction === 'next') {\n this.activeGalleryThumbnail($container, slider.currentSlide + 1);\n } else {\n this.activeGalleryThumbnail($container, slider.currentSlide - 1);\n }\n },\n after: (slider) => {\n this.activeGalleryThumbnail($container, slider.currentSlide);\n },\n start: function(){\n setTimeout(function(){\n $slider.addClass('flexslider-loaded');\n $slider.data('flexslider').resize();\n }, 500);\n }\n // 'animationSpeed': 500,\n });\n $('.gallery-nav-next', $container).on('click', function () {\n $container.find('.flex-nav-next a').trigger('click');\n });\n\n $('.gallery-nav-prev', $container).on('click', function () {\n $container.find('.flex-nav-prev a').trigger('click');\n });\n\n $('.gallery_item', $container).on('click', (event) => {\n let number = $(event.currentTarget).data('number');\n $slider.data('flexslider').flexAnimate(number);\n this.activeGalleryThumbnail($container, number);\n })\n })\n }\n\n activeGalleryThumbnail($container, key) {\n let $gallery = $('.woocommerce-loop-product__gallery', $container);\n $('.gallery_item', $gallery).removeClass('active');\n $('.gallery_item[data-number=\"' + key + '\"]', $gallery).addClass('active');\n }\n\n initVariableItem() {\n $('.otf-wrap-swatches .swatch').on('click', (event) => {\n event.preventDefault();\n let $item = $(event.currentTarget);\n let $container = $item.closest('.product');\n\n if ($item.hasClass('checked')) {\n $container.removeClass('product-swatched');\n $item.removeClass('checked');\n $container.find('.product-image-swatch').remove();\n } else {\n $item.closest('.otf-wrap-swatches').find('.swatch').removeClass('checked');\n $container.addClass('product-swatched product-swatch-loading');\n $item.addClass('checked');\n let object = $item.data('image');\n if (object.src) {\n let $img = $('').on('load', (event) => {\n $container.find('.product-image-swatch').remove();\n $container.removeClass('product-swatch-loading');\n $container.find('.product-image').first().before(`
${event.currentTarget.outerHTML}
`);\n }).attr({\n src: object.src,\n });\n if (object.srcset) {\n $img.attr(srcset, object.srcset);\n }\n }\n }\n })\n }\n\n initCarousel() {\n $('.woocommerce-product-carousel').each((index, element) => {\n let $element = $(element);\n let items = $element.data('columns');\n let itemMobile = 1;\n let items768 = 2;\n let items980 = items;\n if (items > 3) {\n items980 = items - 1;\n items768 = items - 2;\n }\n if (items < 2) {\n items768 = items;\n }\n $element.find('ul.products').owlCarousel({\n items: items,\n nav: true,\n dots: false,\n responsive: {\n 0: {\n items: itemMobile,\n },\n 480: {\n items: itemMobile,\n },\n 768: {\n items: items768\n },\n 980: {\n items: items980\n },\n 1200: {\n items: items\n }\n }\n })\n });\n }\n\n addedToCart() {\n let $product;\n $('body').on('adding_to_cart', function (event, button) {\n $product = button.closest('li.product, .woosw-item');\n }).on('added_to_cart', function () {\n let src = $product.find('img').first().attr('src');\n let productName = $product.find('.woocommerce-loop-product__title, .woosw-item--name').text();\n let template = wp.template('added-to-cart-template');\n $('#page-title-bar').after(template({src: src, name: productName}));\n setTimeout(function () {\n $('.notification-added-to-cart').addClass('hide');\n }, 3000);\n });\n }\n\n initWishlist() {\n $(document).on('added_to_wishlist removed_from_wishlist', function () {\n let $wishlist = $('.opal-header-wishlist');\n $.ajax({\n url: yith_wcwl_l10n.ajax_url,\n data: {\n action: 'osf_update_wishlist_count'\n },\n dataType: 'json',\n success: function (data) {\n $wishlist.find('.count').text(data.count);\n },\n beforeSend: function () {\n },\n complete: function () {\n }\n })\n })\n\n $('body').on('woosw_change_count', function(event,count){\n let $wishlist = $('.opal-header-wishlist');\n $wishlist.find('.count').text(count);\n });\n }\n renderWislistLoading() {\n $('li.product .yith-wcwl-add-button .add_to_wishlist').after( \"\" );\n }\n}\n\nclass OpalTheme_Woocommerce_filter {\n selectorsClick = []\n selectorsChange = []\n\n constructor() {\n this.selectorsClick = [\n '#secondary .widget .product-categories a',\n '#secondary .widget .product-brands a',\n '#secondary .widget .woocommerce-widget-layered-nav-list a',\n '#secondary .widget.widget_layered_nav_filters a',\n '#secondary .widget.widget_rating_filter a',\n '#secondary .widget_product_tag_cloud a',\n\n '#opal-canvas-filter .widget .product-categories a',\n '#opal-canvas-filter .widget .product-brands a',\n '#opal-canvas-filter .widget .woocommerce-widget-layered-nav-list a',\n '#opal-canvas-filter .widget.widget_layered_nav_filters a',\n '#opal-canvas-filter .widget.widget_rating_filter a',\n '#opal-canvas-filter .widget_product_tag_cloud a',\n\n '#main ul.products + .woocommerce-pagination a',\n '#secondary .widget .product-brands a',\n '.otf-active-filters .widget_layered_nav_filters a',\n '.otf-active-filters .clear-all',\n ];\n this.initDisplayMode();\n this.init();\n this.initCategoriesDropdown();\n this.initRecentlyReviewed();\n this.priceSlideChange();\n this.initOrdering();\n\n $(window).on(\"popstate\", () => {\n if (history.state && history.state.woofilter) {\n this.renderHtml(history.state);\n }\n });\n }\n\n init() {\n $('body').on('click', this.selectorsClick.join(','), (event) => {\n event.preventDefault();\n let $this = $(event.currentTarget);\n let url = $this.attr('href');\n this.sendRequest(url);\n }).on('click', '.display-mode button[type=\"submit\"]', (event) => {\n event.preventDefault();\n let $this = $(event.currentTarget);\n if (!$this.hasClass('active')) {\n let value = $this.val();\n let objUrl = new URL(window.location.href);\n let searchParams = new URLSearchParams(window.location.search);\n searchParams.set('display', value);\n objUrl.search = searchParams.toString();\n this.sendRequest(objUrl.toString(), false);\n }\n });\n }\n\n scrollUp() {\n\n let position = $('#primary').offset().top;\n if ($('body').hasClass('opal-header-sticky')) {\n position -= $('#opal-header-sticky').outerHeight();\n }\n\n if ($('#wpadminbar').length > 0) {\n position -= $('#wpadminbar').outerHeight();\n }\n if ($(window).scrollTop() > position) {\n $('html, body').animate({scrollTop: position}, 'slow');\n }\n }\n\n replaceUrl(url) {\n let layout = this.getCookie('otf_woocommerce_display', 'grid');\n if (layout === 'list') {\n if (url.indexOf('?') !== -1) {\n url = url + '&display=list';\n } else {\n url = url + '?display=list';\n }\n }\n\n return url;\n }\n\n initDisplayMode() {\n if ($('body').hasClass('opal-woocommerce-archive')) {\n let display = this.getCookie('otf_woocommerce_display', 'grid');\n if (display === 'list') {\n let url = window.location.href;\n let objUrl = new URL(url);\n let dp = objUrl.searchParams.get(\"display\");\n if (!dp) {\n this.sendRequest(url);\n }\n }\n }\n }\n\n sendRequest(url, replace = true) {\n if (replace) {\n url = this.replaceUrl(url);\n }\n this.initLoading(true);\n $.post(url, (data) => {\n if (data) {\n let $html = $(data);\n let state = {\n woofilter: true,\n title : $html.filter('title').text(),\n sidebar : $html.find('#secondary').html(),\n content : $html.find('#primary').html(),\n filter : $html.find('.opal-canvas-filter-wrap').html(),\n };\n this.renderHtml(state);\n window.history.pushState(state, state.title, url);\n }\n this.initLoading(false)\n })\n }\n\n renderHtml(state) {\n this.scrollUp();\n $('head title').text(state.title);\n $('#primary').html(state.content);\n $('#secondary').html(state.sidebar);\n $('#opal-canvas-filter .opal-canvas-filter-wrap').html(state.filter);\n this.initPriceSlider();\n this.initCategoriesDropdown();\n this.initOrdering();\n this.initLoading(false);\n //OpalWoocommerceMain.getInstance().initSlideProduct();\n OpalWoocommerceMain.getInstance().initSelectOrder();\n }\n\n initLoading(check) {\n if (check) {\n $('body').addClass('opal-filter-loading').append('
');\n } else {\n $('body').removeClass('opal-filter-loading');\n $('#opal-woocommerce-loading').remove();\n }\n }\n\n initRecentlyReviewed() {\n let recentlyTitle = $('h2.otf-woocommerce-recently-viewed');\n let recentlyContent = $('.otf-product-recently-content');\n recentlyContent.hide();\n\n recentlyTitle.on('click', function (e) {\n e.stopPropagation();\n if (!recentlyTitle.hasClass('active')) {\n recentlyContent.show(400);\n recentlyTitle.addClass('active');\n let scrollHeight = $(document).height();\n let contentHeight = $('.widget_recently_viewed_products').height();\n $(\"html, body\").animate({scrollTop: scrollHeight}, contentHeight + 10);\n } else {\n recentlyContent.hide(400);\n recentlyTitle.removeClass('active');\n }\n });\n\n }\n\n\n initCategoriesDropdown() {\n $('.widget_product_categories ul li.cat-item').each(function () {\n let _this = $(this);\n _this.find('ul.children').hide();\n if (_this.find('.current-cat').length > 0) {\n _this.find('ul.children').show();\n $(this).append('');\n } else if (_this.find('ul.children').length > 0) {\n $(this).append('');\n }\n\n });\n $(\"body\").on(\"click\", '.widget_product_categories ul li.cat-item .closed', function () {\n $(this).parent().find('ul.children').first().show(400);\n $(this).parent().addClass('open');\n $(this).removeClass('closed').removeClass('fa-angle-down').addClass('opened').addClass('fa-angle-up');\n });\n $(\"body\").on(\"click\", '.widget_product_categories ul li.cat-item .opened', function () {\n $(this).parent().find('ul.children').first().hide(400);\n $(this).parent().addClass('close').removeClass('open');\n $(this).removeClass('opened').removeClass('fa-angle-up').addClass('closed').addClass('fa-angle-down');\n });\n }\n\n initOrdering() {\n setTimeout(() => {\n $('.woocommerce-ordering').off('change');\n $('.woocommerce-ordering').on('change', (event) => {\n let $select = $(event.currentTarget).find('.orderby');\n let url = window.location.href.replace(/&orderby(=[^&]*)?|^orderby(=[^&]*)?&?/g, '')\n .replace(/\\?orderby(=[^&]*)?|^orderby(=[^&]*)?&?/g, '?')\n .replace(/\\?$/g, '')\n\n\n if (url.indexOf('?') !== -1) {\n url = url + `&orderby=${$select.val()}`;\n } else {\n url = url + `?orderby=${$select.val()}`;\n }\n this.sendRequest(url);\n })\n }, 100);\n }\n\n initPriceSlider() {\n setTimeout(() => {\n if ($('.price_slider:not(.ui-slider)').length <= 0) {\n return true;\n }\n $('input#min_price, input#max_price').hide();\n $('.price_slider, .price_label').show();\n\n let min_price = $('.price_slider_amount #min_price').data('min'),\n max_price = $('.price_slider_amount #max_price').data('max'),\n current_min_price = $('.price_slider_amount #min_price').val(),\n current_max_price = $('.price_slider_amount #max_price').val();\n\n $('.price_slider:not(.ui-slider)').slider({\n range : true,\n animate: true,\n min : min_price,\n max : max_price,\n values : [current_min_price, current_max_price],\n create : function () {\n\n $('.price_slider_amount #min_price').val(current_min_price);\n $('.price_slider_amount #max_price').val(current_max_price);\n\n $(document.body).trigger('price_slider_create', [current_min_price, current_max_price]);\n },\n slide : function (event, ui) {\n\n $('input#min_price').val(ui.values[0]);\n $('input#max_price').val(ui.values[1]);\n\n $(document.body).trigger('price_slider_slide', [ui.values[0], ui.values[1]]);\n },\n change : function (event, ui) {\n\n $(document.body).trigger('price_slider_change', [ui.values[0], ui.values[1]]);\n }\n });\n }, 200);\n }\n\n priceSlideChange() {\n $(document.body).bind('price_slider_change', (event, min, max) => {\n let url = window.location.href.replace(/(min_price=\\d+\\&*|max_price=\\d+\\&*)/g, '')\n .replace(/\\?$/g, '')\n if (url.indexOf('?') !== -1) {\n url = url + `&min_price=${min}&max_price=${max}`;\n } else {\n url = url + `?min_price=${min}&max_price=${max}`;\n }\n this.sendRequest(url);\n })\n }\n\n getCookie(cname, _default) {\n let name = cname + \"=\";\n let ca = document.cookie.split(';');\n for (let i = 0; i < ca.length; i++) {\n let c = ca[i];\n while (c.charAt(0) === ' ') {\n c = c.substring(1);\n }\n if (c.indexOf(name) === 0) {\n return c.substring(name.length, c.length);\n }\n }\n return \"\";\n }\n\n setCookie(cname, cvalue, exdays = 10) {\n let d = new Date();\n d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));\n let expires = \"expires=\" + d.toUTCString();\n document.cookie = cname + \"=\" + cvalue + \";\" + expires + \";path=/\";\n }\n\n\n}\n\n$(document).ready(function () {\n OpalWoocommerceMain.getInstance();\n new OpalTheme_Woocommerce_filter();\n});","})(jQuery);"]}