PageSourceSearch

https://jott.com/cdn/shop/t/149/assets/ClrzAbtastyRecoCart.min.BiYmhMWH.js

js jott.com collected 2026-09-25 14:20:10 UTC 2,136 bytes, 1 lines download raw bytes

1import{C as l}from"./Component.min.BXKnktQZ.js";class f extends l{onInit(t,e={}){this.el=t,this.siteId=this.el.getAttribute("data-site-id"),this.recoId=this.el.getAttribute("data-get-reco-id"),this.apiKey=this.el.getAttribute("data-api-key"),this.isSlider=this.el.getAttribute("data-is-slider"),this.recoContainer=this.el.querySelector("[data-js-slider-reco-container]"),this.recoTitle=this.el.querySelector("[data-js-reco-title]"),this.json=JSON.parse(this.el.querySelector('[type="application/json"][data-js-reco-info]').textContent),this.recoSlider=null,document.addEventListener("cart:open",()=>{this.emptyReco(),this.getInfo()}),document.addEventListener("cart:close",()=>{setTimeout(()=>{this.emptyReco()},500)})}async getInfo(){const t=this.siteId,e=this.recoId,s=this.apiKey,c=this.json.cart_items,r=`${localStorage.getItem("productAdded")}`;let o={cart_items:c.map(i=>`${i.product_id}`),addng_to_cart_item:r};o=encodeURIComponent(JSON.stringify(o));const a=encodeURIComponent(JSON.stringify(["handle"]));if(window.getComputedStyle(this.el).display!="none")try{const i=`https://uc-info.eu.abtasty.com/v1/reco/${t}/recos/${e}?variables=${o}&fields=${a}`,h=await(await fetch(i,{headers:{Authorization:`Bearer ${s}`}})).json();this.computedData(h)}catch(i){console.error("Error fetching recommendations:",i)}}computedData(t){let e=0;this.recoTitle.innerHTML=t.name;const s=t.items,c=s.map(r=>{const n=p(window.Shopify.routes.root,`products/${r.handle}`),o=new URL(n,window.location.origin);return o.searchParams.append("section_id","card-product-reco-cart"),fetch(o).then(a=>{if(a.ok)return a.text();throw new Error("Failed to fetch")})});Promise.all(c).then(r=>{r.forEach((n,o)=>{this.renderProduct(n),e++}),e===s.length&&this.recoContainer.setAttribute("data-reco-id",this.recoId)}).catch(r=>{console.error("Error fetching product data:",r)})}renderProduct(t){const e=new DOMParser().parseFromString(t,"text/html").querySelector("[data-id=card-product]");e&&this.recoContainer.appendChild(e)}emptyReco(){this.recoContainer.innerHTML=""}}function p(d,t){return`${d.replace(/\/$/,"")}/${t.replace(/^\//,"")}`}export{f as default};

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.