1 2; /* Start:"a:4:{s:4:"full";s:116:"/bitrix/templates/aspro_max__/components/bitrix/catalog.smart.filter/main_compact_ajax/script.min.js?171213982629184";s:6:"source";s:96:"/bitrix/templates/aspro_max__/components/bitrix/catalog.smart.filter/main_compact_ajax/script.js";s:3:"min";s:0:"";s:3:"map";s:0:"";}"*/ 3function JCSmartFilter(ajaxURL,viewMode,params){this.ajaxURL=ajaxURL,this.form=null,this.timer=null,this.cacheKey="",this.cache=[],this.viewMode=viewMode,this.normal_url=!1,this.reset=!1,this.SEF_SET_FILTER_URL=params.SEF_SET_FILTER_URL,this.SEF_DEL_FILTER_URL=params.SEF_DEL_FILTER_URL,this.bindUrlToButton("set_filter",params.SEF_SET_FILTER_URL),this.sef=!0,this.bindUrlToButton("del_filter",params.SEF_DEL_FILTER_URL),params.SEF_DEL_FILTER_URL||(this.normal_url=!0)}window.JCSmartFilterBinds||$(document).ready((function(){$(document).on("click",".bx_filter.compact .bx_filter_parameters_box_title .delete_filter",(function(){var _this=$(this);_this.closest(".bx_filter_parameters_box").find("input[type=text]").val(""),_this.closest(".bx_filter_parameters_box").removeClass("set"),_this.closest(".bx_filter_parameters_box").find(".pict label").removeClass("active"),_this.closest(".bx_filter_parameters_box").find(".bx_filter_parameters_box_title .count_selected").text("");var t=!1;_this.closest(".bx_filter_parameters_box").find("input").each((function(){var __this=this;$(__this).prop("checked",!1),t&&clearTimeout(t),t=setTimeout((function(){smartFilter.reload(__this)}),100)}))})),$(document).on("click",".bx_filter.compact .bx_filter_block",(function(e){e.stopPropagation()})),$(document).on("click",".bx_filter_button_box .bx_filter_search_reset",(function(e){$(this).addClass("hidden"),$(".bx_filter_search_reset.btn-link-text").click()})),$(document).on("click","#mobilefilter .bx_filter_parameters_box_title:not(.prices)",(function(e){$(this).closest(".bx_filter_parameters_box").toggleClass("active")})),$(document).on("click",".filter-compact-block .bx_filter_parameters_box_title.prices.title",(function(e){BX.PopupWindowManager.getCurrentPopup()&&BX.PopupWindowManager.getCurrentPopup().close(),$(".bx_filter_parameters_box").removeClass("active")})),$(document).on("click",".filter-compact-block .bx_filter_parameters_box_title:not(.prices)",(function(e){var target=e.target;if(!$(e.target).hasClass("tooltip")&&!$(e.target).hasClass("delete_filter")&&!$(e.target).closest(".delete_filter").length){e.stopPropagation();var $box=$(this).closest(".bx_filter_parameters_box");if($box.hasClass("active"))$(this).next(".bx_filter_block").stop().slideUp(100);else{$(".bx_filter_block:not(.limited_block)").slideUp(100),$(".bx_filter_parameters_box").removeClass("active");var _this=$(this);setTimeout((function(){var boxOffsetLeft,boxWidth,windowWidth;_this.offset().left+_this.next(".bx_filter_block").outerWidth()>$(window).width()?_this.next(".bx_filter_block").addClass("right"):_this.next(".bx_filter_block").removeClass("right")}),0),_this.next(".bx_filter_block").stop().slideDown(300)}$box.toggleClass("active")}})),$(document).on("click",".bx_filter_block .bx_filter_button_box .btn",(function(){$(this).closest("form").find(".bx_filter_search_button").click()})),$(document).on("click",(function(e){$(".filter-compact-block .bx_filter_block:not(.limited_block)").stop().slideUp(100),$(".filter-compact-block .bx_filter_parameters_box").removeClass("active")})),$(document).click((function(e){$(e.target).hasClass("tooltip")||$(".bx_filter .hint.active").removeClass("active").find(".tooltip").slideUp(200)})),window.JCSmartFilterBinds=!0})),JCSmartFilter.prototype.keyup=function(input){this.timer&&clearTimeout(this.timer),$(input).hasClass("disabled")||(this.timer=setTimeout(BX.delegate((function(){this.reload(input)}),this),500))},JCSmartFilter.prototype.click=function(checkbox){this.timer&&clearTimeout(this.timer),this.timer=setTimeout(BX.delegate((function(){this.reload(checkbox)}),this),500)},JCSmartFilter.prototype.reload=function(input){if(""!==this.cacheKey)return this.timer&&clearTimeout(this.timer),void(this.timer=setTimeout(BX.delegate((function(){this.reload(input)}),this),1e3));if(this.cacheKey="|",this.position=BX.pos(input,!0),this.form=BX.findParent(input,{tag:"form"}),this.form){$(".middle > .container .ajax_load").length&&$(".middle > .container .ajax_load").addClass("loading-state");var values=[];values[0]={name:"ajax",value:"y"},this.gatherInputsValues(values,BX.findChildren(this.form,{tag:new RegExp("^(input|select)$","i")},!0)),$(".bx_filter_parameters_box").removeClass("set");for(var i=0;i<values.length;i++)this.cacheKey+=values[i].name+":"+values[i].value+"|",$("input[name="+values[i].name+"]").closest(".bx_filter_parameters_box").addClass("set");if(this.cache[this.cacheKey])this.curFilterinput=input,this.postHandler(this.cache[this.cacheKey],!0);else{if(this.sef){var set_filter=BX("set_filter"),reset_filter=BX("del_filter");set_filter&&(set_filter.disabled=!0),reset_filter&&(reset_filter.disabled=!0)}
3this.curFilterinput=input,BX.ajax.loadJSON(this.ajaxURL,this.values2post(values),BX.delegate(this.postHandler,this))}}var i=0;$(input).closest(".bx_filter_block").find("input[type=checkbox], input[type=radio]").each((function(){!0===$(this).prop("checked")&&++i})).promise().done((function(){0!=i?$(input).closest(".bx_filter_parameters_box").find(".bx_filter_parameters_box_title .count_selected").text(": "+i):$(input).closest(".bx_filter_parameters_box").find(".bx_filter_parameters_box_title .count_selected").text("")}))},JCSmartFilter.prototype.updateItem=function(PID,arItem,reset){if("N"===arItem.PROPERTY_TYPE||arItem.PRICE){var trackBar=window["trackBar"+PID];!trackBar&&arItem.ENCODED_ID&&(trackBar=window["trackBar"+arItem.ENCODED_ID]),trackBar&&arItem.VALUES&&(arItem.VALUES.MIN&&(arItem.VALUES.MIN.FILTERED_VALUE?trackBar.setMinFilteredValue(arItem.VALUES.MIN.FILTERED_VALUE):trackBar.setMinFilteredValue(arItem.VALUES.MIN.VALUE)),arItem.VALUES.MAX&&(arItem.VALUES.MAX.FILTERED_VALUE?trackBar.setMaxFilteredValue(arItem.VALUES.MAX.FILTERED_VALUE):trackBar.setMaxFilteredValue(arItem.VALUES.MAX.VALUE)),"Y"==reset&&(trackBar.leftPercent=trackBar.rightPercent=0,$("#"+arItem.VALUES.MIN.CONTROL_ID).val(""),$("#"+arItem.VALUES.MAX.CONTROL_ID).val(""),$("#left_slider_"+arItem.ENCODED_ID).css({left:"0%"}),$("#colorUnavailableActive_"+arItem.ENCODED_ID).css({left:"0%",right:"0%"}),$("#colorAvailableInactive_"+arItem.ENCODED_ID).css({left:"0%",right:"0%"}),$("#colorAvailableActive_"+arItem.ENCODED_ID).css({left:"0%",right:"0%"}),$("#right_slider_"+arItem.ENCODED_ID).css({right:"0%"})))}else if(arItem.VALUES)for(var i in arItem.VALUES)if(arItem.VALUES.hasOwnProperty(i)){var value=arItem.VALUES[i],control=BX(value.CONTROL_ID);if(control){var label=document.querySelector('[data-role="label_'+value.CONTROL_ID+'"]');input=document.querySelector('[id="'+value.CONTROL_ID+'"]'),value.DISABLED?label?(BX.addClass(label,"disabled"),input&&(input.setAttribute("disabled","disabled"),BX.addClass(input,"disabled"))):BX.addClass(control.parentNode,"disabled"):label?(BX.removeClass(label,"disabled"),input&&(input.removeAttribute("disabled"),BX.removeClass(input,"disabled")),$(control)&&($(control).prop("disabled",!1),$(control).removeClass("disabled")),$(label).find("span").removeClass("disabled")):BX.removeClass(control.parentNode,"disabled"),"Y"==reset&&("checkbox"!=$(control).attr("type")&&"radio"!=$(control).attr("type")||$(control).attr("checked")&&$(control).prop("checked",!1)),value.hasOwnProperty("ELEMENT_COUNT")&&(label=document.querySelector('[data-role="count_'+value.CONTROL_ID+'"]'))&&(label.innerHTML=value.ELEMENT_COUNT)}}},JCSmartFilter.prototype.postHandlerAjax=function(result,fromCache){$("#content").html(result)},JCSmartFilter.prototype.setUrlSortDisplay=function(url){var arReplace_url="",strReplace_url="";$(".sort_btn").each((function(){(arReplace_url=$(this).attr("href").split("?"))[0]=url,strReplace_url=arReplace_url.join("?"),$(this).attr("href",strReplace_url)}))},JCSmartFilter.prototype.filterCatalog=function(url,set_disabled,reset,count){url.match(/%(?![0-9][0-9a-fA-F]+)/g)?(url=url.replace(/%(?![0-9][0-9a-fA-F]+)/g,"%25"),$(".bx-ie").length&&!$(".bx-ie11").length||!$(".bx-core").length?location.href=url:window.history.pushState(null,document.title,url)):window.History.enabled||null!=window.history.pushState?window.History.pushState(null,document.title,decodeURIComponent(url)):location.href=url,$(".middle > .container .ajax_load").length&&$(".middle > .container .ajax_load").addClass("loading-state"),$.ajax({url:url,type:"GET",data:{ajax_get:"Y",ajax_get_filter:"Y"},success:function(html){if(!reset||$("#wrapInlineFilter").length&&$("#wrapInlineFilter").is(":empty")){var itemsHtml=$(html).find(".inner_wrapper").html();$(".middle > .container .inner_wrapper").html(itemsHtml),$(".sort_header").html($(html).find(".sort_header").html()),$(".top-content-block").html($(html).find(".top-content-block").html()),$(html).find(".filter_title").hasClass("active-filter")?($(".filter_title").addClass("active-filter"),$(".bx_filter_search_reset ").removeClass("hidden")):($(".filter_title").removeClass("active-filter"),$(".bx_filter_search_reset ").addClass("hidden")),reset&&$("#mobilefilter .bx_filter").length&&($("#mobilefilter").html(""),$(html).find(".bx_filter").appendTo($("#mobilefilter")),$("#mobilefilter .bx_filter_parameters").addClass("scrollbar"),$("#mobilefilter .bx_filter_parameters .bx_filter_parameters_box_title").addClass("colored_theme_hover_bg-block"),smartFilter.bindUrlToButton("set_filter",smartFilter.SEF_SET_FILTER_URL),smartFilter.bindUrlToButton("del_filter",smartFilter.SEF_DEL_FILTER_URL),mobileFilterNum(count),void 0!==window.sortFilterPopup&&"function"==typeof window.sortFilterPopup.destroy&&window.sortFilterPopup.destroy()),"checkFilterLandgings"in window&&"function"==typeof checkFilterLandgings&&checkFilterLandgings()}else $(".js-load-wrapper").html($(html).find(".js-load-wrapper").html()),$(".top-content-block").html($(html).find(".top-content-block").html()),"checkFilterLandgings"in window&&"function"==typeof checkFilterLandgings&&checkFilterLandgings();if($(".fast_view_frame").remove(),BX.onCustomEvent("onAjaxSuccessFilter"),"Y"==set_disabled){var set_filter=BX("set_filter"),reset_filter=BX("del_filter");set_filter&&(set_filter.disabled=!1),reset_filter&&(reset_filter.disabled=!1)}var eventdata={action:"jsLoadBlock"};if(BX.onCustomEvent("onCompleteAction",[eventdata,this]),$(".middle > .container .ajax_load").length&&$(".middle > .container .ajax_load").removeClass("loading-state"),"undefined"!=typeof Ya&&"function"==typeof Ya.share2){let myShare=document.querySelector(".ya-share2");myShare&&Ya.share2(myShare,{content:{url:location.href}})}}})},JCSmartFilter.prototype.postHandler=function(result,fromCache){var hrefFILTER,url,curProp,modef=BX("modef"),modef_mobile=BX("modef_mobile"),modef_num=BX("modef_num"),modef_num_mobile=BX("modef_num_mobile"),reset="N";if("RESET_FORM"in result&&(document.getElementsByClassName("smartfilter")[0].reset(),reset="Y"),result&&result.ITEMS){for(var PID in result.ITEMS)result.ITEMS.hasOwnProperty(PID)&&this.updateItem(PID,result.ITEMS[PID],reset);"Y"==reset&&$(".bx_filter_select_block").length&&$(".bx_filter_select_block").each((function(){var id=$(this).closest(".bx_filter_parameters_box").attr("property_id"),all_text=$(this).find(".input_wr_all input
3:first-child").data("title");$(this).find(".bx_filter_select_text").text(all_text),$(this).find(".bx_filter_select_popup li label").removeClass("selected")})),modef&&modef_num&&($(".bx_filter.compact .bx_filter_button_box .bx_filter_container_modef").html(BX.message("SELECTED")+result.ELEMENT_COUNT),$(".bx_filter.compact .bx_filter_button_box").show(),"function"==typeof mobileFilterNum&&mobileFilterNum(result.ELEMENT_COUNT),hrefFILTER=BX.findChildren(modef,{tag:"A"},!0),hrefFILTER_mobile=BX.findChildren(modef_mobile,{tag:"A"},!0),result.FILTER_URL&&hrefFILTER&&(hrefFILTER[0].href=BX.util.htmlspecialcharsback(result.FILTER_URL.replace("/filter/clear/apply/","/")),hrefFILTER_mobile[0].href=BX.util.htmlspecialcharsback(result.FILTER_URL.replace("/filter/clear/apply/","/"))),result.FILTER_AJAX_URL&&result.COMPONENT_CONTAINER_ID&&(BX.unbindAll(hrefFILTER[0]),BX.unbindAll(hrefFILTER_mobile[0]),BX.bind(hrefFILTER[0],"click",(function(e){return url=BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL),BX.ajax.insertToNode(url,result.COMPONENT_CONTAINER_ID),BX.PreventDefault(e)}))),result.INSTANT_RELOAD&&result.COMPONENT_CONTAINER_ID?(url=BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL),BX.ajax.insertToNode(url,result.COMPONENT_CONTAINER_ID)):(url=BX.util.htmlspecialcharsback(result.FILTER_AJAX_URL),this.filterCatalog(url,"N",this.reset,result.ELEMENT_COUNT),result.SEF_SET_FILTER_URL?this.bindUrlToButton("set_filter",result.SEF_SET_FILTER_URL):this.bindUrlToButton("set_filter",url)))}if(this.sef){var set_filter=BX("set_filter"),reset_filter=BX("del_filter");set_filter&&(set_filter.disabled=!1),reset_filter&&(reset_filter.disabled=!1)}fromCache||""===this.cacheKey||(this.cache[this.cacheKey]=result),this.cacheKey=""},JCSmartFilter.prototype.bindUrlToButton=function(buttonId,url){var button=BX(buttonId);if(button){var proxy=function(j,func){return function(){return func(j)}};"submit"==button.type&&(button.type="button"),$(button).data("href",url),BX.unbindAll(button),BX.bind(button,"click",BX.proxy((function(){var url_filter=$(button).data("href"),id=$(button).attr("id");if($(".middle > .container .ajax_load").length&&$(".middle > .container .ajax_load").addClass("loading-state"),"del_filter"==id){var values=[],url_form=this.normal_url?$("form.smartfilter").attr("action"):this.ajaxURL;if(values[0]={name:"ajax",value:"y"},this.normal_url||this.gatherInputsValues(values,BX.findChildren(document.getElementById("smartfilter"),{attribute:"hidden"},!0)),values[1]={name:"reset_form",value:"y"},this.sef){var set_filter=BX("set_filter"),reset_filter=BX("del_filter");set_filter&&(set_filter.disabled=!0),reset_filter&&(reset_filter.disabled=!0)}this.reset=!0,BX.ajax.loadJSON(url_form,this.values2post(values),BX.delegate(this.postHandler,this))}else if(url_filter){if(this.sef){var set_filter=BX("set_filter"),reset_filter=BX("del_filter");set_filter&&(set_filter.disabled=!0),reset_filter&&(reset_filter.disabled=!0)}this.filterCatalog(url_filter,"Y")}}),this))}},JCSmartFilter.prototype.gatherInputsValues=function(values,elements){if(elements)for(var i=0;i<elements.length;i++){var el=elements[i];if(el.type)switch(el.type.toLowerCase()){case"text":case"textarea":case"password":case"hidden":case"select-one":el.value.length&&(values[values.length]={name:el.name,value:el.value});break;case"radio":case"checkbox":el.checked&&(values[values.length]={name:el.name,value:el.value});break;case"select-multiple":for(var j=0;j<el.options.length;j++)el.options[j].selected&&(values[values.length]={name:el.name,value:el.options[j].value})}}},JCSmartFilter.prototype.values2post=function(values){for(var post=[],current=post,i=0;i<values.length;){var p=values[i].name.indexOf("[");if(-1==p)current[values[i].name]=values[i].value,current=post,i++;else{var name=values[i].name.substring(0,p),rest=values[i].name.substring(p+1);current[name]||(current[name]=[]);var pp=rest.indexOf("]");-1==pp?(current=post,i++):0==pp?(current=current[name],values[i].name=""+current.length):(current=current[name],values[i].name=rest.substring(0,pp)+rest.substring(pp+1))}}return post},JCSmartFilter.prototype.hideFilterProps=function(element){var obj=element.parentNode,filterBlock=obj.querySelector("[data-role='bx_filter_block']"),propAngle=obj.querySelector("[data-role='prop_angle']");if(BX.hasClass(obj,"bx-active"))new BX.easing({duration:300,start:{opacity:1,height:filterBlock.offsetHeight},finish:{opacity:0,height:0},transition:BX.easing.transitions.quart,step:function(state){filterBlock.style.opacity=state.o
3pacity,filterBlock.style.height=state.height+"px"},complete:function(){filterBlock.setAttribute("style",""),BX.removeClass(obj,"bx-active")}}).animate(),BX.addClass(propAngle,"fa-angle-down"),BX.removeClass(propAngle,"fa-angle-up");else{filterBlock.style.display="block",filterBlock.style.opacity=0,filterBlock.style.height="auto";var obj_children_height=filterBlock.offsetHeight;filterBlock.style.height=0,new BX.easing({duration:300,start:{opacity:0,height:0},finish:{opacity:1,height:obj_children_height},transition:BX.easing.transitions.quart,step:function(state){filterBlock.style.opacity=state.opacity,filterBlock.style.height=state.height+"px"},complete:function(){}}).animate(),BX.addClass(obj,"bx-active"),BX.removeClass(propAngle,"fa-angle-down"),BX.addClass(propAngle,"fa-angle-up")}},JCSmartFilter.prototype.showDropDownPopup=function(element,popupId){const dropDownID="smartFilterDropDown"+popupId;var contentNode=element.querySelector('[data-role="dropdownContent"]'),offset=$(element).offset(),el=BX.PopupWindowManager.create(dropDownID,element,{autoHide:!0,offsetLeft:0,offsetTop:0,overlay:!1,draggable:{restrict:!0},closeByEsc:!0,content:contentNode});void 0!==BX.PopupWindowManager._popups&&BX.PopupWindowManager._popups.length&&el.bindElement!==element&&(BX.PopupWindowManager._popups=BX.PopupWindowManager._popups.filter((function(popup){popup.uniquePopupId})),el=BX.PopupWindowManager.create(dropDownID,element,{autoHide:!0,offsetLeft:0,offsetTop:0,overlay:!1,draggable:{restrict:!0},closeByEsc:!0,content:contentNode})),"ASPRO_FILTER_SORT"==popupId&&(window.sortFilterPopup=el),el.show(),$(element).closest(".bx_filter_parameters_box_container").find("#smartFilterDropDown"+popupId).length||$("#smartFilterDropDown"+popupId).insertAfter($(element).closest(".bx_filter_parameters_box_container")),$("#smartFilterDropDown"+popupId).addClass("scrollblock").css({top:"auto",left:"auto"}),InitScrollBar()},JCSmartFilter.prototype.selectDropDownItem=function(element,controlId){var wrapContainer,currentOption;BX.hasClass(element,"disabled")||(this.keyup(BX(controlId)),BX.findParent(BX(controlId),{className:"bx_filter_select_container"},!1).querySelector('[data-role="currentOption"]').innerHTML=element.innerHTML,$(element).closest(".bx_filter_select_popup").find("label").removeClass("selected"),BX.addClass(element,"selected"),BX.PopupWindowManager.getCurrentPopup()&&BX.PopupWindowManager.getCurrentPopup().close())},BX.namespace("BX.Iblock.SmartFilter"),BX.Iblock.SmartFilter=function(){var SmartFilter=function(arParams){"object"==typeof arParams&&(this.leftSlider=BX(arParams.leftSlider),this.rightSlider=BX(arParams.rightSlider),this.tracker=BX(arParams.tracker),this.trackerWrap=BX(arParams.trackerWrap),this.minInput=BX(arParams.minInputId),this.maxInput=BX(arParams.maxInputId),this.minPrice=parseFloat(arParams.minPrice),this.maxPrice=parseFloat(arParams.maxPrice),this.curMinPrice=parseFloat(arParams.curMinPrice),this.curMaxPrice=parseFloat(arParams.curMaxPrice),this.fltMinPrice=arParams.fltMinPrice?parseFloat(arParams.fltMinPrice):parseFloat(arParams.curMinPrice),this.fltMaxPrice=arParams.fltMaxPrice?parseFloat(arParams.fltMaxPrice):parseFloat(arParams.curMaxPrice),this.precision=arParams.precision||0,this.priceDiff=this.maxPrice-this.minPrice,this.leftPercent=arParams.leftPercent?parseFloat(arParams.leftPercent):0,this.rightPercent=arParams.rightPercent?parseFloat(arParams.rightPercent):0,this.fltMinPercent=0,this.fltMaxPercent=0,this.colorUnavailableActive=BX(arParams.colorUnavailableActive),this.colorAvailableActive=BX(arParams.colorAvailableActive),this.colorAvailableInactive=BX(arParams.colorAvailableInactive),this.isTouch=!1,this.init(),"ontouchstart"in document.documentElement||"ontouchstart"in window?(this.isTouch=!0,BX.bind(this.leftSlider,"touchstart",BX.proxy((function(event){this.onMoveLeftSlider(event)}),this)),BX.bind(this.rightSlider,"touchstart",BX.proxy((function(event){this.onMoveRightSlider(event)}),this)),BX.bind(this.colorAvailableActive,"touchstart",BX.proxy((function(event){this.onChangeLeftSlider(event)}),this)),BX.bind(this.colorUnavailableActive,"touchstart",BX.proxy((function(event){this.onChangeLeftSlider(event)}),this)),BX.bind(this.colorAvailableInactive,"touchstart",BX.proxy((function(event){this.onChangeLeftSlider(event)}),this))):(BX.bind(this.leftSlider,"mousedown",BX.proxy((function(event){this.onMoveLeftSlider(event)}),this)),BX.bind(this.rightSlider,"mousedown",BX.proxy((function(event){this.onMoveRightSlider(event)}),this)),BX.bind(this.colorAvailableActive,"mousedown",BX.proxy((function(event){this.onChangeLeftSlider(event)}),this)),BX.bind(this.colorUnavailableActive,"mousedown",BX.proxy((function(event){this.onChangeLeftSlider(event)}),this)),BX.bind(this.colorAvailableInactive,"mousedown",BX.proxy((function(event){this.onChangeLeftSlider(event)}),this))),BX.bind(this.minInput,"keyup",BX.proxy((function(event){this.onInputChange()}),this)),BX.bind(this.maxInput,"keyup",BX.proxy((function(event){this.onInputChange()}),this)))};return SmartFilter.prototype.init=function(){var priceDiff;this.curMinPrice>this.minPrice&&(priceDiff=this.curMinPrice-this.minPrice,this.leftPercent=100*priceDiff/this.priceDiff,this.leftSlider.style.left=this.leftPercent+"%",this.colorUnavailableActive.style.left=this.leftPercent+"%"),this.setMinFilteredValue(this.fltMinPrice),this.curMaxPrice<this.maxPrice&&(priceDiff=this.maxPrice-this.curMaxPrice,this.rightPercent=100*priceDiff/this.priceDiff,this.rightSlider.style.right=this.rightPercent+"%",this.colorUnavailableActive.style.right=this.rightPercent+"%"),this.setMaxFilteredValue(this.fltMaxPrice)},SmartFilter.prototype.setMinFilteredValue=function(fltMinPrice){if(this.fltMinPrice=parseFloat(fltMinPrice),this.fltMinPrice>=this.minPrice){var priceDiff=this.fltMinPrice-this.minPrice;this.fltMinPercent=100*priceDiff/this.priceDiff,this.leftPercent>this.fltMinPercent?this.colorAvailableActive.style.left=this.leftPercent+"%":this.colorAvailableActive.style.left=this.fltMinPercent+"%",this.colorAvailableInactive.style.left=this.fltMinPercent+"%"}else this.colorAvailableActive.style.left="0%",this.colorAvailableInactive.style.left="0%"},SmartFilter.prototype.setMaxFilteredValue=function(fltMaxPrice){if(this.fltMaxPrice=parseFloat(fltMaxPrice),this.fltMaxPrice<=this.maxPrice){var priceDiff=this.maxPrice-this.fltMaxPrice;this.fltMaxPercent=100*priceDiff/this.priceDiff,this.rightPercent>this.fltMaxPercent?this.colorAvailableActive.style.right=this.rightPercent+"%":this.colorAvailableActive.style.right=this.fltMaxPercent+"%",this.colorAvailableInactive.style.right=this.fltMaxPercent+"%"}else this.colorAvailableActive.style.right="0%",this.colorAvailableInactive.style.right="0%"},SmartFilter.prototype.getXCoord=function(elem){var box=elem.getBoundingClientRect(),body=document.body,docElem=document.documentElement,scrollLeft=window.pageXOffset||docElem.scrollLeft||body.scrollLeft,clientLeft=docElem.clientLeft||body.clientLeft||0,left=box.left+scrollLeft-clientLeft;return Math.round(left)},SmartFilter.prototype.getPageX=function(e){e=e||window.event;var pageX=null;if(this.isTouch&&null!=e.targetTouches[0])pageX=e.targetTouches[0].pageX;else if(null!=e.pageX)pageX=e.pageX;else if(null!=e.clientX){var html=document.documentElement,body=document.body;pageX=e.clientX+(html.scrollLeft||body&&body.scrollLeft||0),pageX-=html.clientLeft||0}return pageX},SmartFilter.prototype.recountMinPrice=function(){var newMinPrice=this.priceDiff*this.leftPercent/100;(newMinPrice=(this.minPrice+newMinPrice).toFixed(this.precision))!=this.minPrice?this.minInput.value=newMinPrice:this.minInput.value="",smartFilter.keyup(this.minInput)},SmartFilter.prototype.recountMaxPrice=function(){var newMaxPrice=this.priceDiff*this.rightPercent/100;(newMaxPrice=(this.maxPrice-newMaxPrice).toFixed(this.precision))!=this.maxPrice?this.maxInput.value=newMaxPrice:this.maxInput.value="",smartFilter.keyup(this.maxInput)},SmartFilter.prototype.onInputChange=function(){var priceDiff;if(this.minInput.value){var leftInputValue=this.minInput.value;leftInputValue<this.minPrice&&(leftInputValue=this.minPrice),leftInputValue>this.maxPrice&&(leftInputValue=this.maxPrice),priceDiff=leftInputValue-this.minPrice,this.leftPercent=100*priceDiff/this.priceDiff,this.makeLeftSliderMove(!1)}if(this.maxInput.value){var rightInputValue=this.maxInput.value;rightInputValue<this.minPrice&&(rightInputValue=this.minPrice),rightInputValue>this.maxPrice&&(rightInputValue=this.maxPrice),priceDiff=this.maxPrice-rightInputValue,this.rightPercent=100*priceDiff/this.priceDiff,this.makeRightSliderMove(!1)}},SmartFilter.prototype.makeLeftSliderMove=function(recountPrice){recountPrice=!1!==recountPrice,this.leftSlider.style.left=this.leftPercent+"%",this.colorUnavailableActive.style.left=this.leftPercent+"%";var areBothSlidersMoving=!1;this.leftPercent+this.rightPercent>=100&&(areBothSlidersMoving=!0,this.rightPercent=100-this.leftPercent,this.rightSlider.style.right=this.rightPercent+"%",this.colorUnavailableActive.style.right=this.rightPercent+"%"),this.leftPercent>=this.fltMinPercent&&this.leftPercent<=100-this.fltMaxPercent?(this.colorAvailableActive.style.left=this.leftPercent+"%",areBothSlidersMoving&&(this.colorAvailableActive.style.right=100-this.leftPercent+"%")):this.leftPercent<=this.fltMinPercent?(this.colorAvailableActive.style.left=this.fltMinPercent+"%",areBothSlidersMoving&&(this.colorAvailableActive.style.right=100-this.fltMinPercent+"%")):this.leftPercent>=this.fltMaxPercent&&(this.colorAvailableActive.style.left=100-this.fltMaxPercent+"%",areBothSlidersMoving&&(this.colorAvailableActive.style.right=this.fltMaxPercent+"%")),recountPrice&&(this.recountMinPrice(),areBothSlidersMoving&&this.recountMaxPrice())},SmartFilter.prototype.countNewLeft=function(event){var pageX=this.getPageX(event),trackerXCoord=this.getXCoord(this.trackerWrap),rightEdge=this.trackerWrap.offsetWidth,newLeft=pageX-trackerXCoord;return newLeft<0?newLeft=0:newLeft>rightEdge&&(newLeft=rightEdge),newLeft},SmartFilter.prototype.onMoveLeftSlider=function(e){if(this.isTouch||(this.leftSlider.ondragstart=function(){return!1}),$(".bx_filter .bx_filter_parameters_box_container input").prop("disabled",!1),this.isTouch){var onMoveFunction=BX.proxy((function(event){this.leftPercent=100*this.countNewLeft(event)/this.trackerWrap.offsetWidth,this.makeLeftSliderMove()}),this),onEndFunction=BX.proxy((function(event){window.removeEventListener("touchmove",onMoveFunction,!1),window.removeEventListener("touchend",onEndFunction,!1),onMoveFunction=onEndFunction=null}),this);window.addEventListener("touchmove",onMoveFunction,!1),window.addEventListener("touchend",onEndFunction,!1)}else document.onmousemove=BX.proxy((function(event){this.leftPercent=100*this.countNewLeft(event)/this.trackerWrap.offsetWidth,this.makeLeftSliderMove()}),this),document.onmouseup=function(){document.onmousemove=document.onmouseup=null};return!1},SmartFilter.prototype.makeRightSliderMove=function(recountPrice){recountPrice=!1!==recountPrice,this.rightSlider.style.right=this.rightPercent+"%",this.colorUnavailableActive.style.right=this.rightPercent+"%";var areBothSlidersMoving=!1;this.leftPercent+this.rightPercent>=100&&(areBothSlidersMoving=!0,this.leftPercent=100-this.rightPercent,this.leftSlider.style.left=this.leftPercent+"%",this.colorUnavailableActive.style.left=this.leftPercent+"%"),100-this.rightPercent>=this.fltMinPercent&&this.rightPercent>=this.fltMaxPercent?(this.colorAvailableActive.style.right=this.rightPercent+"%",areBothSlidersMoving&&(this.colorAvailableActive.style.left=100-this.rightPercent+"%")):this.rightPercent<=this.fltMaxPercent?(this.colorAvailableActive.style.right=this.fltMaxPercent+"%",areBothSlidersMoving&&(this.colorAvailableActive.style.left=100-this.fltMaxPercent+"%")):100-this.rightPercent<=this.fltMinPercent&&(this.colorAvailableActive.style.right=100-this.fltMinPercent+"%",areBothSlidersMoving&&(this.colorAvailableActive.style.left=this.fltMinPercent+"%")),recountPrice&&(this.recountMaxPrice(),areBothSlidersMoving&&this.recountMinPrice())},SmartFilter.prototype.onMoveRightSlider=function(e){return this.isTouch||(this.rightSlider.ondragstart=function(){return!1}),$(".bx_filter .bx_filter_parameters_box_container input").prop("disabled",!1),this.isTouch?(document.ontouchmove=BX.proxy((function(event){this.rightPercent=100-100*this.countNewLeft(event)/this.trackerWrap.offsetWidth,this.makeRightSliderMove()}),this),document.ontouchend=function(){document.ontouchmove=document.ontouchend=null}):(document.onmousemove=BX.proxy((function(event){this.rightPercent=100-100*this.countNewLeft(event)/this.trackerWrap.offsetWidth,this.makeRightSliderMove()}),this),document.onmouseup=function(){document.onmousemove=document.onmouseup=null}),!1},SmartFilter.prototype.onChangeLeftSlider=function(e){if(this.isTouch||(this.leftSlider.ondragstart=function(){}),this.isTouch){var percent=100*this.countNewLeft(e)/this.trackerWrap.offsetWidth;if($(e.target).is(".bx_ui_slider_handle"))return;percent<50?(this.leftPercent=percent,this.makeLeftSliderMove()):(this.rightPercent=100-percent,this.makeRightSliderMove())}else{var percent=100*this.countNewLeft(event)/this.trackerWrap.offsetWidth;if($(event.target).is(".bx_ui_slider_handle")||!$(event.target).is("[class^=bx_ui_slider]"))return;percent<50?(this.leftPercent=percent+1,this.makeLeftSliderMove()):(this.rightPercent=100-percent,this.makeRightSliderMove()),document.onmouseup=function(){document.onmousemove=document.onmouseup=null}}return!1},SmartFilter}(); 4/* End */ 5;; /* /bitrix/templates/aspro_max__/components/bitrix/catalog.smart.filter/main_compact_ajax/script.min.js?171213982629184*/
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.