{"version":3,"sources":["before.js","main.js","after.js"],"names":["$","OpalWoocommerceMain","_classCallCheck","this","initCarousel","addedToCart","initSelectOrder","_createClass","key","value","instance","hasClass","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","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","OpalTheme_Woocommerce_filter","_this3","selectorsClick","url","initCategoriesDropdown","initOrdering","window","history","state","woofilter","renderHtml","_this4","join","preventDefault","$this","sendRequest","val","objUrl","URL","location","href","searchParams","URLSearchParams","search","set","toString","position","offset","top","outerHeight","scrollTop","animate","getCookie","get","_this5","arguments","undefined","replaceUrl","initLoading","post","$html","title","filter","sidebar","html","content","pushState","scrollUp","initPriceSlider","getInstance","initSlideProduct","check","append","recentlyTitle","recentlyContent","hide","show","scrollHeight","height","contentHeight","_this","parent","off","replace","_this6","min_price","range","min","max","max_price","values","current_min_price","current_max_price","create","body","slide","ui","change","_this7","ca","substring","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,kBDNA,MAAAC,cAAAN,EAAA,OAAAO,IAAA,cAAAC,MAAA,WAAA,MCGAR,GAAAS,WACAT,EAAAS,SAAA,GAAAT,IDJAA,EAAAS,aAAAH,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6K,QAAA,OAAA,GApCA5D,IAAA,IAAAA,EAAAzF,QAAA,KAAAyF,EAAAA,cAAAgE,EAAA,cAAAC,EAAAjE,EAAAA,cAAAgE,EAAA,cAAAC,EAKAlL,EAAAA,YAAAA,QDleAQ,IAAA,YAAAC,MAAA,SCseAyK,EAAAA,GAwCA,IAAA,GAvCAE,GAAAA,EAAAA,IACAG,EAAAA,SAAAA,OAAAA,MAAAA,KAsCApK,EAAA,EAAAA,EAAA0K,EAAAtK,OAAAJ,IAAA,CAnCAnB,IADAA,GAAAA,GAAAA,EAAAA,GACAA,MAAAA,EAAAA,OAAAA,IAsCAsB,EAAAA,EAAAwK,UAAA,EAnCA,IAAA,IAAAxK,EAAAE,QAAAuK,GACAN,MAAAA,GAAAA,UAAAA,EAAAA,OAAAA,EAAAA,QAGAzL,MAAAA,MDlfAQ,IAAA,YAAAC,MAAA,SCqfAuL,EAAAC,GAAA,GAAAC,GAAAjD,UAAA1H,OAAA,OAAA2H,KAAAD,UAAA,GAAAA,UAAA,GAAA,GACA0C,EAAAA,GAAAA,KAsCAQ,GAAAC,QAAAD,EAAAE,UAAA,GAAAH,EAAA,GAAA,GAAA,IApCAlM,IAAAA,GAAAA,WAAAA,EAAAA,aACAe,UAAAuL,OAAAN,EAAA,IAAAC,EAAA,IAAAM,EAAA,cDzfAzF,IAAA9G,GAAAe,UAAAyL,MAAA,WC8fAvM,EAAA8J,cAwCA,GAAAjD,MCtiBA2F","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 }\n\n initSelectOrder(){\n if($('body').hasClass('post-type-archive-product')) {\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(`