PageSourceSearch

https://primemybody.com/cdn/shop/t/9/assets/frequently-bought-together.js?v=81578196359778773171773942616

js primemybody.com collected 2026-10-06 13:49:43 UTC 8,829 bytes, 2 lines download raw bytes

1window.Eurus.loadedScript.has("frequently-bought-together.js")||(window.Eurus.loadedScript.add("frequently-bought-together.js"),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.data("xProductFrequently",sectionId=>({load:!1,show:!1,products:"",productsList:[],productsListDraft:[],loading:!1,addToCartButton:"",errorMessage:!1,isSelectItems:!1,init(){this.$watch("productsListDraft",()=>{this.productsList===this.productsListDraft?this.isSelectItems=!1:this.isSelectItems=!0,Alpine.store("xHelper").fbtProductListDraft=this.productsListDraft,document.dispatchEvent(new CustomEvent(`eurus:product-fbt:productsList-changed-${sectionId}`,{detail:{productsList:this.productsListDraft}}))})},renderRatingYotpo(el){const arrayRatingYotpo=Array.from(document.getElementById(`list-rating-yotpo-${sectionId}`).children);Array.from(el.querySelectorAll(".rating-review")).map((item,index)=>{for(let i=0;i<arrayRatingYotpo.length;i++)if(item.querySelector(".yotpo")||item.querySelector(".yotpo")!=null){let checkReplaceRating=!1;const interval=setInterval(()=>{(arrayRatingYotpo[i].querySelector(".star-container")||arrayRatingYotpo[i].querySelector(".yotpo-sr-bottom-line-left-panel"))&&(item.querySelector(".yotpo")&&item.querySelector(".yotpo").getAttribute("data-product-id")==arrayRatingYotpo[i].querySelector(".yotpo-widget-instance").getAttribute("data-yotpo-product-id")&&(item.innerHTML=arrayRatingYotpo[i].innerHTML,checkReplaceRating=!0),clearInterval(interval))},500);if(checkReplaceRating)break;setTimeout(()=>{interval&&clearInterval(interval)},3e3)}})},openPopup(){this.show=!0,Alpine.store("xPopup").open=!0},closePopup(){this.show=!1,Alpine.store("xPopup").close()},_getSelectedValueId(el){return el.querySelector("select option[selected][value], fieldset input:checked")?.dataset.optionValueId},_getCurrentVariantEl(el){return el.querySelector(`script[type="application/json"][data-option-value-id='${this._getSelectedValueId(el)}']`)},_getCurrentVariable(el){return JSON.parse(this._getCurrentVariantEl(el).textContent)},addToListDraft(el,productId,productUrl,hasVariant,cal,name_edt){let productsListDraft=JSON.parse(JSON.stringify(this.productsListDraft));const productName=el.closest(".x-product-fbt-data").querySelector(".product-name").textContent,currentVariant=hasVariant?this._getCurrentVariable(el.closest(".x-product-fbt-data")):JSON.parse(el.closest(".x-product-fbt-data").querySelector(".current-variant").textContent),price=!hasVariant&&JSON.parse(el.closest(".x-product-fbt-data").querySelector(".current-price").textContent),featured_image=currentVariant.featured_image?currentVariant.featured_image.src:el.closest(".x-product-fbt-data").querySelector(".featured-image").textContent,vendor=el.closest(".x-product-fbt-data").querySelector(".vendor")?el.closest(".x-product-fbt-data").querySelector(".vendor")?.textContent:"",rating=el.closest(".x-product-fbt-data").querySelector(".rating-fbt-mini")?el.closest(".x-product-fbt-data").querySelector(".rating-fbt-mini")?.innerHTML:"",edtElement=el.closest(".x-product-fbt-data").querySelector(`.hidden.cart-edt-properties-${productId}`);let shippingMessage="";edtElement&&(shippingMessage=edtElement.value.replace("time_to_cut_off",Alpine.store("xEstimateDelivery").noti));const preorderElement=el.closest(".x-product-fbt-data").querySelector(".hidden.preorder-edt-properties");let preorderMessage="";preorderElement&&(preorderMessage=preorderElement.value);const properties={...name_edt&&shippingMessage&&{[name_edt]:shippingMessage},...preorderMessage&&{Preorder:preorderMessage}};let productQuantity=parseInt(el.closest(".x-product-fbt-data").querySelector(".current-quantity").value);cal=="plus"&&(productQuantity=productQuantity+1),cal=="minus"&&(productQuantity=productQuantity-1);let variantId=currentVariant.id,newProductsListDraft=[],newItem=hasVariant?{...currentVariant,title:currentVariant.title.replaceAll("\\",""),product_id:productId,product_name:productName,productUrl:`${productUrl}?variant=${currentVariant.id}`,featured_image,quantity:productQuantity,vendor,rating,properties}:{id:variantId,product_id:productId,product_name:productName,productUrl,featured_image,quantity:productQuantity,price,vend
1or,rating,properties};productsListDraft=productsListDraft.filter(item=>item.id!==variantId),newProductsListDraft=[...productsListDraft,newItem],newProductsListDraft=newProductsListDraft.filter(item=>item.quantity>0),this.productsListDraft=newProductsListDraft,this.errorMessage=!1},addToList(el){this.productsList=this.productsListDraft,this.closePopup(el)},async handleAddToCart(el){this.loading=!0,await Alpine.store("xCartHelper").waitForCartUpdate(),window.updatingCart=!0,setTimeout(()=>{let items=JSON.parse(JSON.stringify(this.productsList));fetch(window.Shopify.routes.root+"cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items,sections:Alpine.store("xCartHelper").getSectionsToRender().map(section=>section.id)})}).then(response=>response.json()).then(response=>{if(response.status=="422"){const error_message=el.closest(".list-items").querySelector(".cart-warning");this.errorMessage=!0,error_message&&(error_message.textContent=response.description);return}this.errorMessage=!1,Alpine.store("xCartHelper").reRenderSections(response.sections),Alpine.store("xQuickView")&&Alpine.store("xQuickView").show&&(Alpine.store("xQuickView").show=!1),Alpine.store("xPopup").close(),Alpine.store("xCartNoti")&&Alpine.store("xCartNoti").enable?Alpine.store("xCartNoti").setItem(response):(Alpine.store("xMiniCart").openCart(),document.dispatchEvent(new CustomEvent("eurus:cart:redirect"))),Alpine.store("xCartHelper").currentItemCount=parseInt(document.getElementById("cart-icon-bubble").innerHTML),document.dispatchEvent(new CustomEvent("eurus:cart:items-changed")),this.productsList=[],this.productsListDraft=[],this.totalPrice=0}).catch(error=>{console.error("Error:",error)}).finally(()=>{window.updatingCart=!1,this.loading=!1})},0)},removeItem(el,indexItem){let item=this.productsList[indexItem],newProductsList=this.productsList.filter((item2,index)=>index!=indexItem);this.productsList=newProductsList,this.productsListDraft=this.productsList,document.dispatchEvent(new CustomEvent(`eurus:product-bundle:remove-item-${sectionId}`,{detail:{item,el}}))}})),Alpine.data("xProductItemFBT",(el,addText,unavailableText,soldoutText,sectionId,handleSectionId,productUrl,hasVariant,isCbl)=>({qty:1,productList:[],currentVariant:"",showButton:!0,productUrl,initEvent(){if(this.currentVariant=JSON.parse(document.getElementById(`current-variant-${sectionId}`).textContent),hasVariant){const variantSelectEventHandler=e=>{this.currentVariant=e.detail.currentVariant,this.currentVariant&&this.currentVariant.id&&(this.productUrl=productUrl+`/?variant=${this.currentVariant.id}`),this.currentVariant?this.renderAddButton():this.showButton=!0,this.renderAddButtonText()};Alpine.store("xHelper").cancelEvent(`eurus:product-card-variant-select:updated:${sectionId}:${productUrl}`);const variantSelectController=new AbortController;Alpine.store("xHelper").eventControllers.set(`eurus:product-card-variant-select:updated:${sectionId}:${productUrl}`,variantSelectController),document.addEventListener(`eurus:product-card-variant-select:updated:${sectionId}:${productUrl}`,variantSelectEventHandler,{signal:variantSelectController.signal})}const productListChangedEventHandler=e=>{this.productList=e.detail.productsList,this.renderAddButton()};document.addEventListener(`eurus:product-fbt:productsList-changed-${handleSectionId}`,productListChangedEventHandler),this.renderAddButton()},renderAddButtonText(){const buttonAdd=document.getElementById("x-atc-button-"+sectionId);if(buttonAdd)if(this.currentVariant)if(this.currentVariant.available){buttonAdd.removeAttribute("disabled");const addButtonText=buttonAdd.querySelector(".x-atc-text");addButtonText&&(addButtonText.textContent=addText)}else{const addButtonText=buttonAdd.querySelector(".x-atc-text");addButtonText&&(addButtonText.textContent=soldoutText)}else{const addButtonText=buttonAdd.querySelector(".x-atc-text");addButtonText&&(addButtonText.textContent=unavailableText)}},renderAddButton(){let variantId=this.currentVariant.id;const itemVariant=(this.productList.length==0&&isCbl?Alpine.store("xHelper").fbtProductListDraft:this.productList).find(({id})=>id===variantId);itemVariant?(this.showButton=!1,this.qty=itemVariant.quantity):(this.showButton=!0,this.qty=1)},minus(value){this.qty=parseInt(this.qty),this.qty==1?this.qty=1:this.qty-=value},plus(value){this.qty=parseInt(this.qty),this.qty+=value},invalid(el2){number=parseFloat(el2.value),(!Number.isInteger(number)||number<1)&&(this.qty=1)}}))})}));
2//# sourceMappingURL=/cdn/shop/t/9/assets/frequently-bought-together.js.map?v=81578196359778773171773942616

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.