PageSourceSearch

https://www.naturopathica.com/cdn/shop/t/549/assets/related-products.js?v=68722257495101907311770819764

js naturopathica.com collected 2026-09-25 22:06:39 UTC 2,393 bytes, 1 lines download raw bytes

1!function(){"use strict";customElements.get("related-products")||customElements.define("related-products",class extends HTMLElement{constructor(){super()}connectedCallback(){this.loadRelatedProducts(),this.loadRecentlyViewedProducts()}loadRelatedProducts(){if(this.relatedProducts=this.querySelector("[data-related-products]"),!this.relatedProducts)return;const e=this.getAttribute("data-section-id"),t=this.getAttribute("data-product-id"),s=this.getAttribute("data-limit"),r=`${theme.routes.product_recommendations_url}?section_id=${e}&limit=${s}&product_id=${t}`;fetch(r).then((e=>{if(!e.ok){const t=new Error(e.status);throw this.hideRelated(),t}return e.text()})).then((e=>{const t=document.createElement("div");t.innerHTML=e;const s=t.querySelector("[data-related-products]");s&&s.querySelectorAll("[data-product-block]").length&&(this.relatedProducts.innerHTML=s.innerHTML)}))}loadRecentlyViewedProducts(){this.recentlyViewed=this.querySelector("recently-viewed"),this.recentlyViewed&&this.recentlyViewed.addEventListener("theme:recently-viewed:loaded",(()=>{this.handleRecentlyViewedResponse()}))}handleRecentlyViewedResponse(){const e=this.recentlyViewed.closest("[data-recently-viewed-wrapper]"),t=this.recentlyViewed.querySelectorAll("[data-product-block]"),s=this.recentlyViewed.querySelectorAll("[data-aos]"),r=this.recentlyViewed.querySelector("grid-slider"),d=this.recentlyViewed.hasAttribute("data-minimum")?parseInt(this.recentlyViewed.getAttribute("data-minimum")):1,i=!e&&t.length>0,l=e&&t.length>=d,a=r?.getAttribute("data-column-mobile");if(i||l){l&&this.classList.remove("hidden"),r&&(requestAnimationFrame((()=>{r.dispatchEvent(new CustomEvent("theme:slider:resize",{bubbles:!0}))})),r.querySelectorAll("[data-slide]").forEach((e=>{2==a?(e.classList.add("mobile--one-half"),e.classList.remove("mobile--one-whole")):(e.classList.add("mobile--one-whole"),e.classList.remove("mobile--one-half"))})));let e=[];this.recentlyViewed.addEventListener("theme:target:animate",(t=>{e.push(t.detail),e.length===s.length&&requestAnimationFrame((()=>s.forEach((e=>e.classList.add("aos-animate")))))}))}}hideRelated(){const e=this.relatedProducts.closest("[data-tab]"),t=this.relatedProducts.closest("[data-tabs-holder]"),s=t?.querySelector(`[data-tabs-link="${e.dataset.tab}"]`);e?.remove(),s&&(s.remove(),t.querySelector("[data-tabs-link]")?.dispatchEvent(new Event("click")))}})}();

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.