PageSourceSearch

https://www.caffevita.com/cdn/shop/t/114/assets/recently-viewed-products-ycygokKt.js

js caffevita.com collected 2026-10-02 06:06:09 UTC 2,234 bytes, 1 lines download raw bytes

1import{n}from"./fluorescent-dom.es-Cu7dY8l0.js";import{r as a}from"./index-8UqU5rlX.js";import{C as m}from"./carousel-CyF55yaY.js";import{P as l}from"./product-item-D_7S7E2P.js";import{g as h}from"./recently-viewed-products-CUo44wPy.js";import{a as p}from"./list-slider-C2_E0Vm-.js";import{s as u}from"./shouldAnimate-BMbjctYf.js";import{m as w}from"./xhr-DPgtqhaK.js";import"./evx.es-D_-Lbk8t.js";import"./cart-Dp1qr_mc.js";import"./storage-CVUx8WVm.js";import"./intersection-watcher-D3vtB7Co.js";import"./media-queries-CokWIw5y.js";import"./delay-offset-DYAL33nW.js";const c={recentlyViewed:"[data-recently-viewed]",carouselSlide:".carousel__slide"};a("recently-viewed-products",{onLoad(){const{limit:e,productsPerView:t,mobileProductsPerView:s,productHandle:i}=this.container.dataset;this.limit=parseInt(e,10),this.perView=parseInt(t,10),this.mobilePerView=parseInt(s,10)*1.05,this.recentProductsContainer=n(".recently-viewed-products__slider-wrapper",this.container);const r=h();if(!(r||[]).length){this._removeSection();return}const o=r.filter(d=>d!==i).slice(0,this.limit);o.length>=1?this._renderProductItems(o):this._removeSection()},_renderProductItems(e){const t=e.map(this._renderProductItem.bind(this));Promise.all(t).then(()=>{const i=n(c.recentlyViewed,this.container),r=n(c.carouselSlide,this.container);this.productItem=l(this.container),u(this.container)&&(this.animateListSlider=p(this.container)),r?this.carousel=m(i,{slidesPerView:this.mobilePerView,spaceBetween:12,breakpoints:{720:{spaceBetween:16,slidesPerView:this.perView===5?this.perView-1:this.perView},1200:{spaceBetween:24,slidesPerView:this.perView}}}):this._removeSection()})},_renderProductItem(e){return new Promise(t=>{const s=`${theme.routes.products}/${e}?section_id=recently-viewed-product-item`;w("GET",s).then(i=>{let r=document.createElement("div");r.innerHTML=i;const o=r.querySelector("[data-recently-viewed-item]").innerHTML;this.recentProductsContainer.insertAdjacentHTML("beforeend",o),t()}).catch(()=>{console.error(`Recent product "${e}" not found`),t()})})},_removeSection(){this.container.parentNode.removeChild(this.container)},onUnload(){var e,t;(e=this.carousel)==null||e.destroy(),(t=this.animateListSlider)==null||t.destroy()}});

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.