PageSourceSearch

https://www.decathlon.com/cdn/shop/t/378/assets/price-per-item.js?v=144512917617120124431787069265

js decathlon.com collected 2026-09-24 08:41:56 UTC 2,203 bytes, 2 lines download raw bytes

1import{Component}from"@theme/component";import{ThemeEvents}from"@theme/events";class PricePerItemComponent extends Component{#priceBreaks=[];#abortController=new AbortController;connectedCallback(){super.connectedCallback(),this.#parsePriceBreaks(),this.#attachEventListeners(),this.#updatePriceDisplay()}disconnectedCallback(){super.disconnectedCallback(),this.#abortController.abort()}#parsePriceBreaks(){const minQuantity=parseInt(this.dataset.minQuantity||"")||1,{variantPrice,priceBreaks:priceBreaksData}=this.dataset;if(variantPrice&&this.#priceBreaks.push({quantity:minQuantity,price:variantPrice}),priceBreaksData){const breaks=JSON.parse(priceBreaksData);for(const{quantity,price}of breaks)quantity&&price&&this.#priceBreaks.push({quantity:parseInt(quantity),price})}this.#priceBreaks.sort((a,b)=>b.quantity-a.quantity)}#attachEventListeners(){const{signal}=this.#abortController;document.addEventListener(ThemeEvents.quantitySelectorUpdate,this.#handleQuantityUpdate,{signal}),document.addEventListener(ThemeEvents.cartUpdate,this.#handleCartUpdate,{signal})}#handleQuantityUpdate=event=>{const form=this.closest("product-form-component");!form||!(event.target instanceof Node)||!form.contains(event.target)||this.#updatePriceDisplay()};#handleCartUpdate=()=>{this.#updatePriceDisplay()};#getCurrentQuantity(){const quantityInput=this.closest("product-form-component")?.querySelector('input[name="quantity"]');if(!quantityInput)return 1;const cartQty=parseInt(quantityInput.getAttribute("data-cart-quantity")||"0")||0,inputQty=parseInt(quantityInput.value)||1;return cartQty+inputQty}updatePriceDisplay(){if(!this.#priceBreaks.length||!this.refs.pricePerItemText)return;const quantity=this.#getCurrentQuantity(),priceBreak=this.#priceBreaks.find(pb=>quantity>=pb.quantity)??this.#priceBreaks[this.#priceBreaks.length-1];priceBreak&&(this.refs.pricePerItemText.innerHTML=`${this.dataset.atText} ${priceBreak.price}/${this.dataset.eachText}`)}#updatePriceDisplay=()=>{this.updatePriceDisplay()}}customElements.get("price-per-item")||customElements.define("price-per-item",PricePerItemComponent);
2//# sourceMappingURL=/cdn/shop/t/378/assets/price-per-item.js.map?v=144512917617120124431787069265

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.