PageSourceSearch

https://nutriben.es/cdn/shop/t/11/assets/cart-recommendations.js?v=80882683859316299571745400751

js nutriben.es collected 2026-10-03 21:19:25 UTC 2,580 bytes, 2 lines download raw bytes

1class CartRecommendations extends CustomRecommendations{constructor(container){super(container),this.isInitialized=!1,this.sectionContainer=document.getElementById(`shopify-section-${this.container.dataset.sectionId}`),this.loadingText=this.container.dataset.loadingText,this.emptyCartText=this.container.dataset.emptyCartText,this.noRecommendationsText=this.container.dataset.noRecommendationsText}async initCartRecommendations(){try{this.container.querySelector("#related-products").innerHTML=`<div class="text-center py-8">${this.loadingText}</div>`;const cartItems=document.querySelectorAll(".cart-item");if(!cartItems.length){this.hideSection();return}const allRelatedIds=[];cartItems.forEach(item=>{try{const relatedIds=JSON.parse(item.dataset.relatedIds||"[]");Array.isArray(relatedIds)&&relatedIds.length?allRelatedIds.push(...relatedIds):relatedIds&&!Array.isArray(relatedIds)&&allRelatedIds.push(relatedIds)}catch(error){console.warn("Error parsing related IDs for item:",item,error),item.dataset.relatedIds&&allRelatedIds.push(item.dataset.relatedIds)}});const uniqueRelatedIds=[...new Set(allRelatedIds)],cartProductIds=Array.from(cartItems).map(item=>item.getAttribute("data-product-cart-id")).filter(id=>id),filteredRelatedIds=uniqueRelatedIds.filter(id=>!cartProductIds.includes(id.toString()));if(!filteredRelatedIds.length){this.hideSection();return}this.showSection(),this.relatedIds=filteredRelatedIds.slice(0,parseInt(this.container.dataset.limit||6)),await super.init(),this.isInitialized=!0}catch(error){console.error("Error initializing cart recommendations:",error),this.hideSection()}}hideSection(){if(this.sectionContainer&&this.sectionContainer.querySelector("#data-cart-drawer-recommendations")){const DrawerRecommendationsElement=this.sectionContainer.querySelector("#data-cart-drawer-recommendations");DrawerRecommendationsElement.style.display="none"}else this.sectionContainer?this.sectionContainer.style.display="none":this.container.style.display="none"}showSection(){this.sectionContainer?this.sectionContainer.style.display="":this.container.style.display=""}}document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll("[data-cart-recommendations]").forEach(container=>{new CartRecommendations(container).initCartRecommendations()})}),document.addEventListener("cart:updated",()=>{document.querySelectorAll("[data-cart-recommendations]").forEach(container=>{new CartRecommendations(container).initCartRecommendations()})});
2//# sourceMappingURL=/cdn/shop/t/11/assets/cart-recommendations.js.map?v=80882683859316299571745400751

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.