PageSourceSearch

https://www.winbridgestore.com/cdn/shop/t/78/assets/product-bundle.js?v=132601456520010791341774326682

js winbridgestore.com collected 2026-10-08 21:30:07 UTC 2,891 bytes, 2 lines download raw bytes

1const{Core,Events,DOMEvents}=Global,{$fetch,$replaceContent,$toggleDisplay}=Global.Utils,R_PRODUC_CARD_SECTION="r_product-bundle-card",SEL_BUNDLE_CARD="#product-bundle-card",SEL_BUNDLE_CARD_TEMPLATE="[data-card-template]";function _getPriceValue(el){return Number(el.dataset.priceValue)}customElements.define("product-bundle",class extends Core{propTypes={"product-url":String,"initial-variant":String,subtotal:Number,"selected-count":Number};elements={$:[["product-bundle-item"],"subtotal","main-product","main-product-meta","footer"],"button-counter":"[data-i18n-amount]"};render(){this._initValues(),this.sub(Events.PRODUCT_BUNDLE_VARIANT_CHANGE,this._handleVariantChange,{global:!0}),this.$("product-bundle-item",{change:this._handleChange}),this.$("main-product",{update:this._handleMainProductUpdate})}_initValues(){this.mainPrice=_getPriceValue(this.$("main-product-meta")),this.subtotal=this.prop("subtotal"),this.selectedCount=this.prop("selected-count")}_handleMainProductUpdate(){const productMeta=this.$("main-product-meta");$toggleDisplay(this,productMeta.dataset.available);const updatedMainPrice=_getPriceValue(productMeta);this.mainPrice!==updatedMainPrice&&(this.subtotal=this.subtotal-this.mainPrice+updatedMainPrice,this.mainPrice=updatedMainPrice,this._renderSubtotal())}_handleChange(e){try{if(e.target.tagName==="INPUT"&&e.target.type==="checkbox"){this._handleCheckboxChange(e);return}throw new Error("invalid change event")}catch(e2){console.error(e2)}}_handleCheckboxChange(e){const checkbox=e.target,price=_getPriceValue(checkbox);if(isNaN(price))throw new Error("invalid price");checkbox.checked?(this.subtotal+=price,this.selectedCount++):(this.subtotal-=price,this.selectedCount--),this._renderSubtotal(),this._renderFooter(),this._updateButtonCount()}async _handleVariantChange(data){const $currentCard=this.$("product-bundle-item").find(item=>+item.dataset.productId===data.productId);this._setChecked($currentCard,!1);const cardContent=await this._fetchCard(data.productURL,data.variantId);$replaceContent($currentCard,cardContent),this._setChecked($currentCard,!0)}_setChecked($card,state){const $checkbox=$card.querySelector("[data-item-checkbox]");if(!state&&$checkbox.checked||state&&!$checkbox.checked){$checkbox.checked=state,$checkbox.dispatchEvent(new Event("change",{bubbles:!0}));return}}async _fetchCard(productURL,variantId){try{return await $fetch(productURL,{params:{variant:variantId,section_id:R_PRODUC_CARD_SECTION},select:SEL_BUNDLE_CARD_TEMPLATE})}catch(err){console.error(err)}}_renderFooter(){$toggleDisplay(this.$("footer"),this.selectedCount>0)}_updateButtonCount(){this.$("button-counter").innerText=this.selectedCount+1}_renderSubtotal(){const renderValue=Shopify.formatMoney(this.subtotal);this.$("subtotal").innerHTML=renderValue}});
2//# sourceMappingURL=/cdn/shop/t/78/assets/product-bundle.js.map?v=132601456520010791341774326682

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.