1(function(){"use strict";var config=window.ADDON_ELIGIBILITY_CONFIG||{},cache={},loadingPromise=null;async function fetchCollectionVariantIds(handle){var ids=new Set;if(!handle)return ids;for(var page=1;page<=20;){var res;try{res=await fetch("/collections/"+handle+"/products.json?limit=250&page="+page)}catch(e){console.error("[addon-eligibility] fetch failed for collection",handle,e);break}if(!res.ok)break;var data=await res.json(),products=data&&data.products||[];if(products.forEach(function(p){(p.variants||[]).forEach(function(v){ids.add(v.id)})}),products.length<250)break;page+=1}return ids}function ready(){return loadingPromise||(loadingPromise=Promise.all(Object.keys(config).map(function(addon){return fetchCollectionVariantIds(config[addon]&&config[addon].collection).then(function(ids){cache[addon]=ids})})).then(function(){return cache}),loadingPromise)}function isEligible(variantId,addon){var set=cache[addon];return!!set&&set.has(parseInt(variantId,10))}function isStructural(item){var props=item.properties||{};if(props._bundled_product||props._attached_id)return!0;var gw=config.discreet&&config.discreet.product,es=config.expedited&&config.expedited.product;return item.handle===gw||item.handle===es}function eligibleBoxCount(cartItems,addon){var count=0;return(cartItems||[]).forEach(function(item){isStructural(item)||isEligible(item.id,addon)&&(count+=item.quantity)}),count}function shouldOffer(cartItems,addon){var cfg=config[addon];if(!cfg||!cfg.enabled||!cfg.collection)return!1;for(var eligibleCount=0,items=cartItems||[],i=0;i<items.length;i++){var item=items[i];if(!isStructural(item))if(isEligible(item.id,addon))eligibleCount+=item.quantity;else return!1}return eligibleCount>0}function cartAllowsAddon(cartItems,addon){return(cartItems||[]).every(function(item){return isStructural(item)?!0:isEligible(item.id,addon)})}window.AddonEligibility={ready,isEligible,shouldOffer,eligibleBoxCount,cartAllowsAddon,_cache:cache,_config:config}})(); 2//# sourceMappingURL=/cdn/shop/t/704/assets/addon-eligibility.js.map?v=48062389557899321931786557258
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.