PageSourceSearch

https://www.reebok.ae/cdn/shop/t/258/assets/recently-viewed-products.js?v=127598545914739778571788848735

js reebok.ae collected 2026-10-06 05:05:26 UTC 4,432 bytes, 2 lines download raw bytes

1(function(){var STORAGE_KEY="rbk-recently-viewed",STOREFRONT_TOKEN="3b94ea12d1444cf524c8d09d6567c97b",STOREFRONT_ENDPOINT="/api/2024-07/graphql.json";function readHandles(){try{var raw=window.localStorage.getItem(STORAGE_KEY),list=raw?JSON.parse(raw):[];return Array.isArray(list)?list:[]}catch(err){return[]}}function writeHandles(list){try{window.localStorage.setItem(STORAGE_KEY,JSON.stringify(list))}catch(err){}}function recordView(handle,maxProducts){if(handle){var handles=readHandles().filter(function(existing){return existing!==handle});handles.unshift(handle),handles.length>maxProducts&&(handles=handles.slice(0,maxProducts)),writeHandles(handles)}}function escapeHtml(value){return String(value==null?"":value).replace(/[&<>"']/g,function(char){return{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}[char]})}var dirhamIconHtml=(function(){var icon=document.querySelector(".uae-dirham-icon");return icon?icon.outerHTML:""})();function formatMoney(amount){return'<span class="currency-with-amount">'+dirhamIconHtml+amount.toFixed(2)+"</span>"}function buildCardHtml(product,slideIndex){var priceHtml=formatMoney(product.price);product.compareAtPrice&&product.compareAtPrice>product.price&&(priceHtml=priceHtml+' <s class="recently-viewed-card__compare-price">'+formatMoney(product.compareAtPrice)+"</s>");var subtitleHtml="";return product.subtitle&&(subtitleHtml='<span class="rbk-card__subtitle caption-large light">'+escapeHtml(product.subtitle)+"</span>"),'<li id="Slide-recently-viewed-'+slideIndex+'" class="grid__item slider__slide"><a href="'+escapeHtml(product.url)+'" class="recently-viewed-card"><span class="recently-viewed-card__media"><img src="'+escapeHtml(product.image)+'" alt="'+escapeHtml(product.title)+'" loading="lazy" class="recently-viewed-card__img"></span><span class="recently-viewed-card__title">'+escapeHtml(product.title)+'</span><span class="recently-viewed-card__price">'+priceHtml+"</span>"+subtitleHtml+"</a></li>"}var PRODUCT_QUERY="query RecentlyViewedProduct($handle: String!) {  productByHandle(handle: $handle) {    title    handle    featuredImage { url }    priceRange { minVariantPrice { amount } }    compareAtPriceRange { maxVariantPrice { amount } }  }}";function fetchProductData(handle){return fetch(STOREFRONT_ENDPOINT,{method:"POST",headers:{"Content-Type":"application/json","X-Shopify-Storefront-Access-Token":STOREFRONT_TOKEN},body:JSON.stringify({query:PRODUCT_QUERY,variables:{handle:handle}})}).then(function(res){return res.ok?res.json():null}).then(function(json){var p=json&&json.data&&json.data.productByHandle;if(!p)return null;var price=parseFloat(p.priceRange.minVariantPrice.amount),compareAtPrice=p.compareAtPriceRange?parseFloat(p.compareAtPriceRange.maxVariantPrice.amount):null;return{title:p.title,url:"/products/"+p.handle,image:p.featuredImage?p.featuredImage.url:"",price:price,compareAtPrice:compareAtPrice}}).catch(function(){return null})}function fetchSubtitle(handle){return fetch("/products/"+encodeURIComponent(handle)+"?section_id=recently-viewed-subtitle").then(function(res){return res.ok?res.text():""}).then(function(html){var match=/<div id="RecentlyViewedSubtitle">([^<]*)<\/div>/.exec(html);return match?match[1]:""}).catch(function(){return""})}function fetchProduct(handle){return Promise.all([fetchProductData(handle),fetchSubtitle(handle)]).then(function(results){var product=results[0];return product?(product.subtitle=results[1],product):null})}function initRecentlyViewed(root){var currentHandle=root.dataset.currentHandle,maxProducts=parseInt(root.dataset.maxProducts,10)||12,slider=root.querySelector(".discover__slider"),grid=root.querySelector(".discover__grid");if(!(!slider||!grid)){recordView(currentHandle,maxProducts);var handles=readHandles().filter(function(handle){return handle!==currentHandle});handles.length&&Promise.all(handles.map(fetchProduct)).then(function(products){var cardsHtml=products.filter(Boolean).map(function(product,index){return buildCardHtml(product,index+1)}).join("");cardsHtml&&(grid.innerHTML=cardsHtml,slider.hidden=!1,typeof slider.resetPages=="function"&&slider.resetPages())}).catch(function(err){console.error("[recently-viewed] Failed to load recently viewed products:",err)})}}document.querySelectorAll("[data-recently-viewed]").forEach(initRecentlyViewed)})();
2//# sourceMappingURL=/cdn/shop/t/258/assets/recently-viewed-products.js.map?v=127598545914739778571788848735

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.