1(function(){var PRO_BUILD_HANDLE="brompton-pro-build",busy=!1;function isBike(item){var pt=item.product_type||"";return item.vendor==="Brompton"&&(pt.indexOf("Bikes")===0||pt.indexOf("Electric Bikes")===0)}function check(){busy||(busy=!0,fetch("/cart.js",{headers:{Accept:"application/json"}}).then(function(r){return r.json()}).then(function(cart){var pro=[],bikeQty=0;(cart.items||[]).forEach(function(item){item.handle===PRO_BUILD_HANDLE?pro.push(item):isBike(item)&&(bikeQty+=item.quantity)});var changes=[],allowed=bikeQty;if(pro.forEach(function(item){var want=Math.min(item.quantity,Math.max(allowed,0));allowed-=want,want!==item.quantity&&changes.push({id:item.key,quantity:want})}),!changes.length){busy=!1;return}var chain=Promise.resolve();changes.forEach(function(c){chain=chain.then(function(){return fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(c)})})}),chain.then(function(){busy=!1,location.pathname.indexOf("/cart")===0&&location.reload()}).catch(function(){busy=!1})}).catch(function(){busy=!1}))}var origFetch=window.fetch;window.fetch=function(){var target=arguments[0],url=target&&(target.url||String(target))||"",result=origFetch.apply(this,arguments);return!busy&&/\/cart\/(add|change|update|clear)/.test(url)&&result.then(function(){setTimeout(check,400)},function(){}),result},document.readyState==="loading"?document.addEventListener("DOMContentLoaded",check):check()})(); 2//# sourceMappingURL=/cdn/shop/t/53/assets/pro-build-cart-guard.js.map?v=34731022448296847861789397259
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.