PageSourceSearch

https://maxfliz.pl/cdn/shop/t/2/assets/unit-price-sort.js?v=177977932724379508751784722414

js maxfliz.pl collected 2026-10-10 01:20:41 UTC 2,583 bytes, 2 lines download raw bytes

1(function(){"use strict";var PRICE_SORTS=["price-ascending","price-descending"],GRID_ID="product-grid",reordering=!1,observer=null;function currentSort(){var fromUrl=new URLSearchParams(window.location.search).get("sort_by");if(fromUrl)return fromUrl;var select=document.querySelector(".facet-filters__sort");return select?select.value:null}function priceOf(li){var v=parseFloat(li.getAttribute("data-sort-price"));return isNaN(v)?0:v}function priceFilterBounds(){var params=new URLSearchParams(window.location.search);function num(name){var raw=params.get(name);if(raw===null)return null;var n=parseFloat(raw.replace(",","."));return isNaN(n)?null:n}return{min:num("filter.v.price.gte"),max:num("filter.v.price.lte")}}function applyPriceFilter(){var grid=document.getElementById(GRID_ID);if(grid)for(var bounds=priceFilterBounds(),active=bounds.min!==null||bounds.max!==null,products=grid.querySelectorAll("[data-sort-price]"),i=0;i<products.length;i++){var li=products[i],out=!1;if(active){var zl=priceOf(li)/100;bounds.min!==null&&zl<bounds.min&&(out=!0),bounds.max!==null&&zl>bounds.max&&(out=!0)}li.style.display=out?"none":""}}function isSorted(items,ascending){for(var i=1;i<items.length;i++){var diff=priceOf(items[i])-priceOf(items[i-1]);if(ascending?diff<0:diff>0)return!1}return!0}function sortGrid(){var grid=document.getElementById(GRID_ID);if(grid){var sort=currentSort();if(PRICE_SORTS.indexOf(sort)!==-1){var ascending=sort==="price-ascending",children=Array.prototype.slice.call(grid.children),products=children.filter(function(el){return el.hasAttribute&&el.hasAttribute("data-sort-price")});if(!(products.length<2)&&!isSorted(products,ascending)){var sortedProducts=products.slice().sort(function(a,b){return ascending?priceOf(a)-priceOf(b):priceOf(b)-priceOf(a)}),fragment=document.createDocumentFragment(),idx=0;children.forEach(function(node){node.hasAttribute&&node.hasAttribute("data-sort-price")?fragment.appendChild(sortedProducts[idx++]):fragment.appendChild(node)}),reordering=!0,grid.appendChild(fragment),reordering=!1}}}}function refresh(){applyPriceFilter(),sortGrid()}function observeGrid(){var container=document.getElementById("ProductGridContainer");container&&(observer&&observer.disconnect(),observer=new MutationObserver(function(){reordering||refresh()}),observer.observe(container,{childList:!0,subtree:!0}))}function init(){refresh(),observeGrid()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",init):init()})();
2//# sourceMappingURL=/cdn/shop/t/2/assets/unit-price-sort.js.map?v=177977932724379508751784722414

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.