var url="assets/json/",allproductlist="",getJSON=function(e,t){var l=new XMLHttpRequest;l.open("GET",url+e,!0),l.responseType="json",l.onload=function(){var e=l.status;t(200===e?null:e,l.response)},l.send()};function loadProductData(e){document.querySelector("#explorecard-list").innerHTML="",Array.from(e).forEach(function(e,t){var l=e.like?"active":"";document.querySelector("#explorecard-list").innerHTML+='
'+e.salesType+'
'+e.totalLikes+'
'+e.category+'
",loadMoreBtn()})}getJSON("nft-explore-product-list.json",function(e,t){null!==e?console.log("Something went wrong: "+e):loadProductData(allproductlist=t)});var searchProductList=document.getElementById("searchProductList"),productCategoryInput=(searchProductList.addEventListener("keyup",function(){var e=searchProductList.value.toLowerCase();t=e;var t,e=allproductlist.filter(function(e){return-1!==e.title.toLowerCase().indexOf(t.toLowerCase())});0==e.length?(document.getElementById("noresult").style.display="block",document.getElementById("loadmore").style.display="none"):(document.getElementById("noresult").style.display="none",document.getElementById("loadmore").style.display="block"),loadProductData(e)}),new Choices(document.getElementById("select-category"),{searchEnabled:!1})),productFileTypeInput=(productCategoryInput.passedElement.element.addEventListener("change",function(e){var t,l=e.detail.value;e.detail.value?0==(t=allproductlist.filter(e=>e.category===l)).length?(document.getElementById("noresult").style.display="block",document.getElementById("loadmore").style.display="none"):(document.getElementById("noresult").style.display="none",document.getElementById("loadmore").style.display="block"):t=allproductlist,loadProductData(t)},!1),new Choices(document.getElementById("file-type"),{searchEnabled:!1}));productFileTypeInput.passedElement.element.addEventListener("change",function(e){var t,l=e.detail.value;e.detail.value?0==(t=allproductlist.filter(e=>e.productImg.split(".").pop()==l)).length?(document.getElementById("noresult").style.display="block",document.getElementById("loadmore").style.display="none"):(document.getElementById("noresult").style.display="none",document.getElementById("loadmore").style.display="block"):t=allproductlist,loadProductData(t)},!1);(productCategoryInput=new Choices(document.getElementById("select-category"),{searchEnabled:!1})).passedElement.element.addEventListener("change",function(e){var t,l=e.detail.value;e.detail.value?0==(t=allproductlist.filter(e=>e.category===l)).length?(document.getElementById("noresult").style.display="block",document.getElementById("loadmore").style.display="none"):(document.getElementById("noresult").style.display="none",document.getElementById("loadmore").style.display="block"):t=allproductlist,loadProductData(t)},!1);var productSalesInputInput=new Choices(document.getElementById("all-sales-type"),{searchEnabled:!1}),rangeProductPrice=(productSalesInputInput.passedElement.element.addEventListener("change",function(e){var t,l=e.detail.value;e.detail.value?0==(t=allproductlist.filter(e=>e.salesType===l)).length?(document.getElementById("noresult").style.display="block",document.getElementById("loadmore").style.display="none"):(document.getElementById("noresult").style.display="none",document.getElementById("loadmore").style.display="block"):t=allproductlist,loadProductData(t)},!1),document.getElementById("range-product-price")),minCostInput=(noUiSlider.create(rangeProductPrice,{start:[0,1e3],step:10,margin:20,connect:!0,behaviour:"tap-drag",tooltips:[!0,!0],range:{min:0,max:2e3},format:wNumb({decimals:0})}),mergeTooltips(rangeProductPrice,5," - "),document.getElementById("minCost")),maxCostInput=document.getElementById("maxCost"),filterDataAll="";function mergeTooltips(e,c,u){var m="rtl"===getComputedStyle(e).direction,p="rtl"===e.noUiSlider.options.direction,y="vertical"===e.noUiSlider.options.orientation,g=e.noUiSlider.getTooltips(),l=e.noUiSlider.getOrigins();Array.from(g).forEach(function(e,t){e&&l[t].appendChild(e)}),e&&e.noUiSlider.on("update",function(e,t,l,o,n){var a=[[]],s=[[]],i=[[]],r=0;g[0]&&(a[0][0]=0,s[0][0]=n[0],i[0][0]=e[0]);for(var d=1;dc)&&(a[++r]=[],i[r]=[],s[r]=[]),g[d]&&(a[r].push(d),i[r].push(e[d]),s[r].push(n[d]));Array.from(a).forEach(function(e,t){for(var l=e.length,o=0;o=t.length&&(event.target.style.display="none")}}))}rangeProductPrice.noUiSlider.on("change",function(e,t){var l=allproductlist,o=(t?maxCostInput.value=e[t]:minCostInput.value=e[t],maxCostInput.value),n=minCostInput.value;loadProductData(l.filter(e=>parseFloat(e.price)>=n&&parseFloat(e.price)<=o))});