| Linux server27.hostingraja.org 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64 Path : /home/udaipurk/www/websites/rishh/XStore Theme/xstore/js/modules/ |
| Current File : //home/udaipurk/www/websites/rishh/XStore Theme/xstore/js/modules/ethemeProductFilters.min.js |
!function(f){"use strict";f(window).on("elementor/frontend/init",function(){var t=elementorModules.frontend.handlers.Base.extend({onInit:function(){elementorModules.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.need_validations=!1,this.run()},getDefaultSettings:function(){return{selectors:{form:".etheme-product-filters",title:".etheme-product-filters-item-title",item:".etheme-product-filters-item",filterItem:".filter-item",itemContent:".etheme-product-filters-item-content",priceSlider:".etheme_price_slider",priceSliderNotRendered:".etheme_price_slider:not(.ui-slider)",priceList:".price-list-item",priceListInput:".price-filter-box input",priceListButton:".price-filter-box button",minPrice:"#min_price",maxPrice:"#max_price",priceLabel:".price-label",priceSliderAmount:".price_slider_amount",resultInput:".result-input",quickResults:".etheme-product-filters-quick-results",quickResultsLi:".etheme-product-filters-quick-results li",requiredItems:".etheme-product-filters-item[data-required]",requiredItemsDone:".etheme-product-filters-item.validation-passed[data-required]",submitBtn:".etheme-product-filters-button button"},options:{svg_delete_icon:'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width=".55em" height=".55em" viewBox="0 0 24 24">\n<path d="M13.056 12l10.728-10.704c0.144-0.144 0.216-0.336 0.216-0.552 0-0.192-0.072-0.384-0.216-0.528-0.144-0.12-0.336-0.216-0.528-0.216 0 0 0 0 0 0-0.192 0-0.408 0.072-0.528 0.216l-10.728 10.728-10.704-10.728c-0.288-0.288-0.768-0.288-1.056 0-0.168 0.144-0.24 0.336-0.24 0.528 0 0.216 0.072 0.408 0.216 0.552l10.728 10.704-10.728 10.704c-0.144 0.144-0.216 0.336-0.216 0.552s0.072 0.384 0.216 0.528c0.288 0.288 0.768 0.288 1.056 0l10.728-10.728 10.704 10.704c0.144 0.144 0.336 0.216 0.528 0.216s0.384-0.072 0.528-0.216c0.144-0.144 0.216-0.336 0.216-0.528s-0.072-0.384-0.216-0.528l-10.704-10.704z"></path>\n</svg>',openClass:"opened",activeClasses:"chosen selected"}}},getDefaultElements:function(){var e=this.getSettings("selectors");return{$form:this.$element.find(e.form),$title:this.$element.find(e.title),$item:this.$element.find(e.item),$filterItem:this.$element.find(e.filterItem),$itemContent:this.$element.find(e.itemContent),$priceSlider:this.$element.find(e.priceSlider),$priceSliderNotRendered:this.$element.find(e.priceSliderNotRendered),$priceList:this.$element.find(e.priceList),$priceListInput:this.$element.find(e.priceListInput),$priceListButton:this.$element.find(e.priceListButton),$minPrice:this.$element.find(e.minPrice),$maxPrice:this.$element.find(e.maxPrice),$priceLabel:this.$element.find(e.priceLabel),$priceSliderAmount:this.$element.find(e.priceSliderAmount),$resultInput:this.$element.find(e.resultInput),$quickResults:this.$element.find(e.quickResults),$quickResultsLi:this.$element.find(e.quickResultsLi),$requiredItems:this.$element.find(e.requiredItems),$submitBtn:this.$element.find(e.submitBtn)}},itemClickAction:function(){var o=this,d=this.getSettings("selectors"),c=this.getSettings("options");this.elements.$title.on("click",function(e){if(!f(this).data("processing")){if(f(this).data("processing","yes"),f(e.target).closest("[data-q-value]").length){var i,s,n,r,a=f(this).parent();let t=f(e.target).closest("[data-q-value]").attr("data-q-value");return"price"===t?(n=(i=f(this).parents(d.item)).find(d.minPrice),r=i.find(d.maxPrice),l=n.data("min"),s=r.data("max"),n.val(l),r.val(s),f(i).find(d.priceSlider).slider("values",[l,s]),o.need_validations&&a.removeClass("validation-passed"),i.find("[data-q-value]").hide(),void f(document.body).trigger("etheme_price_slider_slide",[l,s,i])):((r=(n=a.find(d.resultInput)).val().split(",")).splice([r.findIndex(e=>e===t)],1),n.val(r.join(",")),a.find('[data-value="'+t+'"]').parent().removeClass(c.activeClasses),f(e.target).remove(),void(o.need_validations&&!r.length&&a.removeClass("validation-passed")))}var l=f(this).parent();l.prevAll().removeClass(c.openClass).find(".etheme-product-filters-item-content").slideUp(200),l.nextAll().removeClass(c.openClass).find(".etheme-product-filters-item-content").slideUp(200),l.hasClass(c.openClass)?l.removeClass(c.openClass):l.addClass(c.openClass),f(this).next().slideToggle(200),setTimeout(function(e){f(e).data("processing",null)},200,this)}})},filterItemAction:function(){var d=this,c=this.getSettings("selectors"),m=this.getSettings("options");this.elements.$filterItem.on("click",function(e,t=!1){e.preventDefault();let i=f(this).parent(),s=!1;i.hasClass(m.activeClasses)?(s=!0,i.removeClass(m.activeClasses)):(s=!1,i.addClass(m.activeClasses));var e=f(this).parents(c.item),n=e.data("limit")??"",r=e.find(c.quickResults),a=e.find(c.resultInput),l=a.val(),l=l?l.split(","):l.split("");let o=f(this).data("value").toString();n&&(e.find(".selected.chosen").length>=n&&(t||e.removeClass(m.openClass).find(c.itemContent).slideUp(200)),l.length>=n)&&(l.shift(),n=r.find("[data-q-value]").first(),e.find('[data-value="'+n.attr("data-q-value")+'"]').parent().removeClass(m.activeClasses),n.remove()),-1<l.indexOf(o)?(l.splice([l.findIndex(e=>e===o)],1),r.find('[data-q-value="'+o+'"]').remove()):s&&!t||(l.push(o),r.append('<span data-q-value="'+o+'">'+m.svg_delete_icon+f(this).text()+"</span>")),i.hasClass("price-list-item")&&(n=o.split("-"),e.find("input[name=min_price]").val(n[0]),e.find("input[name=max_price]").val(n[1])),d.need_validations&&(l.length?e.addClass("validation-passed"):e.removeClass("validation-passed")),a.val(l.join(","))})},quickResultsAction:function(){var e=this.getSettings("selectors");this.elements.$quickResultsLi.on("click",function(){f(this).parents(e.item);f(this).remove()})},customTriggers:function(){var m,u,p=this.getSettings("selectors");"undefined"!=typeof woocommerce_price_slider_params&&(u=(m=this).getSettings("options"),f(document.body).on("etheme_price_slider_create etheme_price_slider_slide",function(e,t,i,s){var n=s.find("span.from"),r=s.find("span.to"),a=accounting.formatMoney(t,{symbol:woocommerce_price_slider_params.currency_format_symbol,decimal:woocommerce_price_slider_params.currency_format_decimal_sep,thousand:woocommerce_price_slider_params.currency_format_thousand_sep,precision:woocommerce_price_slider_params.currency_format_num_decimals,format:woocommerce_price_slider_params.currency_format}),l=accounting.formatMoney(i,{symbol:woocommerce_price_slider_params.currency_format_symbol,decimal:woocommerce_price_slider_params.currency_format_decimal_sep,thousand:woocommerce_price_slider_params.currency_format_thousand_sep,precision:woocommerce_price_slider_params.currency_format_num_decimals,format:woocommerce_price_slider_params.currency_format});n.html(a),r.html(l),m.need_validations&&s.removeClass("validation-passed"),f(document.body).trigger("price_slider_updated",[t,i])}),f.each(this.elements.$priceSliderNotRendered,function(){var i=f(this),s=i.parents(p.item),n=s.find(p.minPrice),r=s.find(p.maxPrice),e=s.find(p.priceLabel),t=s.find(p.priceSliderAmount),a=s.find(p.quickResults+" > span"),l=(a.prepend(u.svg_delete_icon),n.hide(),r.hide(),n.data("min")),o=r.data("max"),t=t.data("step")||1,d=n.val(),c=r.val();i.attr("style",null),e.attr("style",null),m.need_validations&&s.addClass("validation-passed"),i.slider({range:!0,animate:!0,min:l,max:o,step:t,values:[d,c],create:function(){n.val(d),r.val(c),f(document.body).trigger("etheme_price_slider_create",[d,c,s])},slide:function(e,t){n.val(t.values[0]),r.val(t.values[1]),f(document.body).trigger("etheme_price_slider_slide",[t.values[0],t.values[1],s]),a.attr("style",null),m.need_validations&&s.addClass("validation-passed")},change:function(e,t){f(document.body).trigger("etheme_price_slider_change",[t.values[0],t.values[1],i])}})})),this.elements.$priceListInput.on("change",function(){var e=f(this).val(),t=f(this).parents(p.item);let i="",s="";"min_price"==f(this).attr("name")?(i=e,s=f(t).find("input[name=max_price]").val()):(s=e,i=f(t).find("input[name=min_price]").val());e=[i,s].join("-");f(t).find(".filter-item-ghost").attr("data-value",e).data("value",e).text(e).trigger("click",[!0])}),this.elements.$priceListButton.on("click",function(e){e.preventDefault(),f(this).parents(p.item).find(p.title).trigger("click")})},onSubmit:function(){let t=this;var i=this.getSettings("selectors");this.elements.$submitBtn.on("click",function(e){t.$element.find(i.requiredItemsDone).length==t.$element.find(i.requiredItems).length?t.parseFormValues(t):(e.preventDefault(),t.elements.$requiredItems.each(function(){f(this).hasClass("validation-passed")||f(this).addClass("highlighted")}),setTimeout(function(){t.elements.$requiredItems.removeClass("highlighted")},2e3))})},onSubmitStatic:function(){let t=this;this.elements.$submitBtn.on("click",function(e){e.preventDefault(),t.parseFormValues(t)})},parseFormValues:function(e){let t=e.elements.$form.serializeArray(),s=(t=(t=t.filter(function(e,t,i){return""!==e.value})).filter((t,e,i)=>e===i.findIndex(e=>e.name===t.name)),new URL(e.elements.$form.attr("action")));t.forEach(function(e,t,i){s.searchParams.set(e.name,e.value)}),window.location.href=s.href},run:function(){this.need_validations=!!this.elements.$requiredItems.length,this.itemClickAction(),this.filterItemAction(),this.quickResultsAction(),this.customTriggers(),this.need_validations?this.onSubmit():this.onSubmitStatic()}});elementorFrontend.hooks.addAction("frontend/element_ready/etheme_product_filters.default",function(e){elementorFrontend.elementsHandler.addHandler(t,{$element:e})})})}(jQuery);