PATH:
home
/
lab2454c
/
costbloc.com
/
public
/
dist
/
js
/
custom
/
site
"use strict";if($(".main-body .page-wrapper").find("#item-filter-container-mobile").length||$(".main-body .page-wrapper").find("#item-filter-container-desktop").length){function a(a=null,e=[],f=1){let g=[],h=[],i="",j=[];a=rating;let k=0;$("#filter_box_result").find(".option-checkbox").each(function(){let a=$(this).attr("id");$("#filter_box_result, #"+a).is(":checked")&&(g[k++]=$(this).val())}),h=$("input[name=\"brands[]\"]:checked").map(function(){return encodeURIComponent($(this).val())}).get(),0<$("input[name=\"b2b\"]:checked").length&&(i=$("input[name=\"b2b\"]:checked").val()),$.each($(".selected-category"),function(){$(this).hasClass("text-color-black")&&j.push(encodeURIComponent($(this).attr("data-category")))}),$.each($(".price_range"),function(){$(this).hasClass("text-color-black")&&(""==$(this).attr("data-min")?null:e.push($(this).attr("data-min")),""==$(this).attr("data-max")?null:e.push($(this).attr("data-max")))}),h=h.join(","),j=j.join(","),g=g.join(";"),0==e.length?"":e=e.join(",");let l="",m="undefined"!=typeof url.searchParams.get("categories")&&null!=url.searchParams.get("categories")?url.searchParams.get("categories"):"";if(""!=m&&0!=m.length&&!1==categoryClick)l+="?categories="+encodeURIComponent(m),$("#selectedCategory").val(m);else if(0!=j.length)l+="?categories="+j;else{let a="undefined"!=typeof url.searchParams.get("keyword")&&null!=url.searchParams.get("keyword")?url.searchParams.get("keyword"):"";""==a&&0==related_ids.length?(l+="?categories="+encodeURIComponent(m),$("#selectedCategory").val(j)):0==related_ids.length?l+="?categories="+j:l+="?categories="}let n="undefined"!=typeof url.searchParams.get("keyword")&&null!=url.searchParams.get("keyword")?url.searchParams.get("keyword"):"";""!=n&&""==keyWordChange?(l+="&keyword="+encodeURIComponent(n),$("#itemSearch").val(n)):""==keyWordChange?l+="&keyword=":l+="&keyword="+encodeURIComponent(keyWordChange);let o="undefined"!=typeof url.searchParams.get("brands")&&null!=url.searchParams.get("brands")?url.searchParams.get("brands"):"";if(l+=""!=o&&0!=o.length&&!1==brandClick?"&brands="+encodeURIComponent(o):"&brands="+h,1==parseInt(isActiveB2B)){let a="undefined"!=typeof url.searchParams.get("b2b")&&null!=url.searchParams.get("b2b")?url.searchParams.get("b2b"):"";l+=""!=a&&0!=a.length&&!1==b2bClick?"&b2b="+encodeURIComponent(a):"&b2b="+i}let p="undefined"!=typeof url.searchParams.get("attributes")&&null!=url.searchParams.get("attributes")?url.searchParams.get("attributes"):"";l+=""!=p&&0!=p.length&&!1==attributesClick?"&attributes="+p:"&attributes="+g;let q="undefined"!=typeof url.searchParams.get("price_range")&&null!=url.searchParams.get("price_range")?url.searchParams.get("price_range"):"";l+=""!=q&&0!=q.length&&!1==priceRangeClick?"&price_range="+q:"&price_range="+e,related_ids="undefined"!=typeof url.searchParams.get("related_ids")&&null!=url.searchParams.get("related_ids")?url.searchParams.get("related_ids"):"",""!=related_ids&&0!=related_ids.length&&(l+="&related_ids="+encodeURIComponent(related_ids)),!1==ratingClick&&(rating="undefined"!=typeof url.searchParams.get("rating")&&null!=url.searchParams.get("rating")?url.searchParams.get("rating"):""),!1==sortByClick&&(sortBy="undefined"!=typeof url.searchParams.get("sort_by")&&null!=url.searchParams.get("sort_by")?url.searchParams.get("sort_by"):"Price Low to High"),!1==showingClick&&(showing="undefined"!=typeof url.searchParams.get("showing")&&null!=url.searchParams.get("showing")?url.searchParams.get("showing"):d),b(l),c("/api/user/products",f)}function b(a=null){null==a?window.history.replaceState(null,null,"?rating="+rating+"&sort_by="+sortBy+"&showing="+showing):window.history.replaceState(null,null,a+"&rating="+rating+"&sort_by="+sortBy+"&showing="+showing)}function c(a,c=1,d=null){"reset"==d&&(null!=searchKeyword&&0!=searchKeyword.length?(b("?keyword="+encodeURIComponent(searchKeyword)),$("#itemSearch").val(searchKeyword)):null!=categoryData&&0!=categoryData.length&&0==related_ids.length?(b("?categories="+encodeURIComponent(null==categoryData?"":categoryData)),$("#itemSearch").val("")):0==related_ids.length?(b("?brands="+encodeURIComponent(null==brandData?"":brandData)),$("#itemSearch").val("")):(b("?related_ids="+encodeURIComponent(related_ids)),$("#itemSearch").val("")));let e=window.location.search.replace("?","");return $.ajax({url:SITE_URL+a,data:e+"&from=web&page="+c+"&user_id="+authUserId,method:"GET",beforeSend:function(){$(window).scrollTop(1),!0==dummyDataOnce&&(dummyDataOnce=!1,$(".ajax-load").removeClass("hidden")),$("#res-loader-html").css("height",1538),$("#res-loader-result").removeClass("hidden"),$(".product-result").addClass("hidden")},success:function(a){$("#loadHtml").html(a),!0==onceCount&&(onceCount=!1,$("#found_total_item_animation").html($("#found_total_item").text())),categoryPath=JSON.parse(categoryPath);let b=``;if("null"!=categoryPath&&null!=categoryPath&&0!=categoryPath.length){$("#search_result_path").addClass("display-none"),$(".all_categories_path").remove();let a=categoryPath.length;--a,$.each(categoryPath,function(c,d){b+=a==c?`<li class="flex items-center" id="all_categories_path"> <a href="javascript:void(0)" class="text-gray-12">${d.name}</a> </li>`:`<li class="flex items-center all_categories_path"> <a href="${SITE_URL+"/search-products?categories="+encodeURIComponent(d.name)}">${d.name}</a> <p class="px-2">/</p> </li>`})}else $(".all_categories_path").remove(),b=`<li class="flex items-center" id="all_categories_path"> <a href="javascript:void(0)">${jsLang("All Categories")}</a> <p class="px-2">/</p> </li>`,$("#search_result_path").removeClass("display-none");$("#all_categories_path").replaceWith(b)},complete:function(){$(".ajax-load").empty(),$(".ajax-load").addClass("hidden"),$("#res-loader-result").addClass("hidden"),$(".product-result").removeClass("hidden"),categorySelected&&($(".selected-category").closest(".show-details").removeClass("h-64 pb-10").find(".expand-more").hide(),categorySelected=!1)}}),1}var categorySelected=!1,searchKeyword=null,categoryData=null,brandData="",url=new URL(window.location.href),sortBy="Price Low to High";const d=12;var showing=12,rating="",min=null,max=null,filterBox=null,scrollDiv="filter_box",onceCount=!0,dummyDataOnce=!0,loaderHeight=1538,keyWordChange="",brandClick=!1,ratingClick=!1,attributesClick=!1,priceRangeClick=!1,categoryClick=!1,sortByClick=!1,showingClick=!1,b2bClick=!1,related_ids="";(function(){searchKeyword="undefined"!=typeof url.searchParams.get("keyword")&&null!=url.searchParams.get("keyword")?url.searchParams.get("keyword"):null,categoryData="undefined"!=typeof url.searchParams.get("categories")&&null!=url.searchParams.get("categories")?url.searchParams.get("categories"):null,brandData="undefined"!=typeof url.searchParams.get("brands")&&null!=url.searchParams.get("brands")?url.searchParams.get("brands"):null})(),a(),$(document).on("click",".selected-category",function(){$(this).hasClass("text-color-black")?$(this).removeClass("text-color-black"):($(this).addClass("text-color-black"),$(".selected-category").closest(".show-details").removeClass("h-64").find(".expand-more").hide(),categorySelected=!0),categoryClick=!0,a()}),$(document).on("keyup","#itemSearch",function(){let a=window.location.search;if(0<=a.indexOf("keyword=")){const b="keyword="+encodeURIComponent($(this).val()),c=a.replace(/keyword=(.*?)(?=&|$)/g,b);window.history.replaceState(null,null,c)}else{const b=a+="keyword="+encodeURIComponent($(this).val());window.history.replaceState(null,null,b)}keyWordChange=encodeURIComponent($(this).val())}),$(document).on("click",".button-update",function(b){b.preventDefault();let c=[];"undefined"!=typeof $("#price_minimum").val()&&""!=$("#price_minimum").val()?c.push($("#price_minimum").val()):"undefined"!=typeof $("#price_maximum").val()&&""!=$("#price_maximum").val()&&c.push(0),"undefined"!=typeof $("#price_maximum").val()&&""!=$("#price_maximum").val()&&c.push($("#price_maximum").val()),priceRangeClick=!0,a(null,c)}),$(document).on("click",".option-checkbox",function(){let b=$(this).attr("id"),c=$(this).attr("data-option");$("#filter_box > .option-checkbox").each(function(){let a=$(this).attr("id");$("#"+a).prop("checked",!1)}),$("#filter_box_result .option-checkbox").each(function(){let a=$(this).attr("id"),d=$(this).attr("data-option");b!=a&&c==d&&$("#"+a).prop("checked",!1)}),attributesClick=!0,a()}),$(document).on("click",".item-brand",function(){brandClick=!0,a()}),$(document).on("click",".b2b-checkbox",function(){b2bClick=!0,a()}),$(document).on("click",".item-ratings",function(){rating=$(this).attr("data-rating"),$("#rating_star").remove(),ratingClick=!0,a()}),$(document).on("click",".sort_by",function(){sortBy=$(this).attr("id"),sortByClick=!0,a(),$(".sort_by").removeClass("primary-bg-color text-gray-12"),$(".sort_by span.text-md").addClass("ml-3"),$(".sort_by span.text-md").text(""),$(this).addClass("primary-bg-color text-gray-12"),$(".animation_showing").html(showing),$(".animation_sort_by").html(sortBy)}),$(document).on("click",".price_range",function(){min=$(this).attr("data-min"),max=$(this).attr("data-max"),a(null,[min,max])}),$(document).on("change",".min_desktop",function(){min=$(".min_desktop").val()}),$(document).on("change",".max_desktop",function(){max=$(".max_desktop").val()}),$(document).on("click",".reset_all",function(){searchKeyword="undefined"!=typeof url.searchParams.get("keyword")&&null!=url.searchParams.get("keyword")?url.searchParams.get("keyword"):null,categoryData="undefined"!=typeof url.searchParams.get("categories")&&null!=url.searchParams.get("categories")?url.searchParams.get("categories"):null,brandData="undefined"!=typeof url.searchParams.get("brands")&&null!=url.searchParams.get("brands")?url.searchParams.get("brands"):null,sortBy="Price Low to High",showing=d,rating="",brandClick=!0,ratingClick=!0,attributesClick=!0,priceRangeClick=!0,categoryClick=!0,sortByClick=!0,showingClick=!0,b2bClick=!0,c("/api/user/products",1,"reset")}),$(document).on("click",".Showing",function(){showing=$(this).attr("id"),showingClick=!0,a(),$(".Showing").removeClass("primary-bg-color text-gray-12"),$(".Showing span.text-md").addClass(""),$(".Showing span.text-md").text(""),$(this).addClass("primary-bg-color text-gray-12"),$(".animation_showing").html(showing),$(".animation_sort_by").html(sortBy)}),$(document).on("click",".pagintion",function(){start=$(this).attr("data-start");let b=$(this).attr("data-pageNumber");a(null,[],b)}),$(document).on("click",".page-prev",function(){if(0<=parseInt(start)-1){let b=$("#pagination").find(".bg-green-500.text-white.color_switch_bac").attr("data-start"),c=$("#pagination").find(".bg-green-500.text-white.color_switch_bac").attr("data-pageNumber");c=parseInt(c)-1,start=parseInt(b)-parseInt(totalProductPerPage),a(null,[],c)}}),$(document).on("click",".page-next",function(){let b=$("#pagination").find(".bg-green-500.text-white.color_switch_bac").attr("data-start"),c=$("#pagination").find(".bg-green-500.text-white.color_switch_bac").attr("data-pageNumber");c=parseInt(c)+1,start=parseInt(b)+parseInt(totalProductPerPage),a(null,[],c)}),$(document).on("click",".page-link",function(b){b.preventDefault();var c=$(this).attr("href").split("page=")[1];let d=[];priceRangeClick&&("undefined"!=typeof $("#price_minimum").val()&&""!=$("#price_minimum").val()?d.push($("#price_minimum").val()):"undefined"!=typeof $("#price_maximum").val()&&""!=$("#price_maximum").val()&&d.push(0),"undefined"!=typeof $("#price_maximum").val()&&""!=$("#price_maximum").val()&&d.push($("#price_maximum").val())),a(null,d,c)}),$(document).on("keyup",".positive-int-number",function(){var a=$(this).val();$(this).val(a.replace(/[^0-9]/g,""))})}$(document).on("click",".expand-more",function(){var a=$(this).closest(".show-details");if(a.find(".expand-more.add").length)b=a.height(),c=a.css("height","auto").height(),a.height(b).animate({height:c},1e3),a.find(".expand-more").removeClass("add"),a.find(".expand-more span").text(jsLang("See Less"));else{var a=a,b=a.height(),c=a.css("height","305").height();a.height(b).animate({height:c},1e3),a.find(".expand-more").addClass("add"),a.find(".expand-more span").text(jsLang("See All"))}});
[-] checkout.js
[edit]
[-] be-seller.min.js
[edit]
[-] res-filter.min.js
[edit]
[-] sign_up.js
[edit]
[-] wishlist.min.js
[edit]
[-] filter.min.js
[edit]
[-] home.js
[edit]
[-] notification-popup.js
[edit]
[-] order-track.js
[edit]
[-] notification-popup.min.js
[edit]
[-] wishlist.js
[edit]
[-] description-tabs.js
[edit]
[-] vendor-profile.js
[edit]
[-] seller-registration.min.js
[edit]
[-] formatting.min.js
[edit]
[-] product-details.js
[edit]
[+]
..
[-] cart.min.js
[edit]
[-] be-seller.js
[edit]
[-] animation.min.js
[edit]
[-] product-view.min.js
[edit]
[-] address.js
[edit]
[-] lang.js
[edit]
[-] alpine.js
[edit]
[-] product-details.min.js
[edit]
[-] common.min.js
[edit]
[-] res-filter.js
[edit]
[-] order-track.min.js
[edit]
[-] common.js
[edit]
[-] drawer.js
[edit]
[-] seller.min.js
[edit]
[-] settings.js
[edit]
[-] checkout.min.js
[edit]
[-] coupon.js
[edit]
[-] login.js
[edit]
[-] seller.js
[edit]
[-] user_download.js
[edit]
[-] site.min.js
[edit]
[-] lang.min.js
[edit]
[-] seller-registration.js
[edit]
[-] password-validation.js
[edit]
[-] drawer.min.js
[edit]
[-] login.min.js
[edit]
[-] delivery-address.min.js
[edit]
[-] home.min.js
[edit]
[-] compare.js
[edit]
[-] description-tabs.min.js
[edit]
[-] all-categories.min.js
[edit]
[-] flatpickr.min.js
[edit]
[-] filter.js
[edit]
[-] cart.js
[edit]
[-] site.js
[edit]
[-] compare.min.js
[edit]
[-] animation.js
[edit]
[-] user_download.min.js
[edit]
[-] settings.min.js
[edit]
[-] vendor-profile.min.js
[edit]
[-] product-view.js
[edit]
[-] password-validation.min.js
[edit]
[-] address.min.js
[edit]
[-] formatting.js
[edit]
[-] coupon.min.js
[edit]
[-] delivery-address.js
[edit]
[-] sign_up.min.js
[edit]
[-] all-categories.js
[edit]