{"version":3,"sources":["before.js","main.js","after.js"],"names":["$","OpalWoocommerceMain","_this2","this","_classCallCheck","initCarousel","addedToCart","initSelectOrder","renderWislistLoading","document","on","event","removeProductView","_createClass","key","value","instance","preventDefault","$button","currentTarget","ajax","method","url","mixmart","ajaxurl","data","action","success","response","closest","remove","is","closeAllSelect","elmnt","a","x","y","i","b","classList","c","productid","selElmnt","getElementsByTagName","setAttribute","innerHTML","options","selectedIndex","appendChild","createElement","j","length","addEventListener","e","k","s","h","arrNo","removeAttribute","click","$select","trigger","stopPropagation","nextSibling","toggle","_this3","$slider","flexslider","animation","controlNav","directionNav","slideshow","smoothHeight","slider","direction","after","start","setTimeout","addClass","resize","$container","find","selector","before","$gallery","removeClass","$item","object","src","$img","first","outerHTML","attr","srcset","items","$element","items768","items980","nav","480","980","1200","$product","button","productName","text","dots","responsive","dataType","beforeSend","complete","OpalTheme_Woocommerce_filter","_this4","selectorsClick","$wishlist","init","priceSlideChange","initOrdering","window","history","state","woofilter","renderHtml","_this5","join","$this","sendRequest","hasClass","val","objUrl","URL","location","href","searchParams","URLSearchParams","search","set","toString","position","offset","top","outerHeight","scrollTop","animate","getCookie","get","_this6","arguments","undefined","replaceUrl","initLoading","post","$html","sidebar","html","filter","pushState","title","scrollUp","content","initPriceSlider","getInstance","check","append","recentlyTitle","recentlyContent","hide","show","contentHeight","height","scrollHeight","each","_this","parent","_this7","replace","max","max_price","values","current_min_price","current_max_price","create","ui","body","_this8","indexOf","min","range","d","setTime","getTime","exdays","cookie","cname","cvalue","expires","ready","jQuery"],"mappings":"8XAAA,SAAAA,GAAA,GCAAC,GDAA,WAAA,QAAAA,KAAA,GAAAC,GAAAC,IAAAC,iBAAAD,KAAAF,GAAAE,KAAAE,eCGAF,KAAAG,cACAL,KAAAA,eAEAE,KAAAI,kBACAJ,KAAAK,uBDPAR,EAAAS,UAAAC,GAAA,QAAA,uCAAA,SAAAC,GCiBAT,EAAAU,kBAAAD,KDjBA,MAAAE,cAAAZ,EAAA,O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ommerceMain {\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 $(document).on('click', '.recently_viewed_product-item-remove', (event) => {\n this.removeProductView(event);\n })\n }\n\n removeProductView(event) {\n event.preventDefault();\n let $button = $(event.currentTarget);\n $.ajax({\n method : 'POST',\n url : mixmart.ajaxurl,\n data : {\n action : 'osf_product_view',\n productid: $button.data('productid'),\n },\n success : (response) => {\n $button.closest('.recently_viewed_product-item').remove();\n }\n })\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(`