PageSourceSearch

https://www.canvasrepublic.com/cdn/shop/t/3/assets/cr-cart.js?v=71696891401273758011787647322

js canvasrepublic.com collected 2026-10-10 01:27:35 UTC 2,640 bytes, 2 lines download raw bytes

1window.CR=window.CR||{},CR.cart=(function($){"use strict";var ENDPOINTS={get:"/cart.js",add:"/cart/add.js",change:"/cart/change.js"},TIMEOUT_MS=15e3,MAX_ATTEMPTS=3,RETRY_BASE_MS=400;function isRetryable(status){return status===0||status===429||status>=500&&status<600}function request(url,method,data,attempt){attempt=attempt||1;var deferred=$.Deferred();return $.ajax({url:url,type:method,dataType:"json",timeout:TIMEOUT_MS,contentType:method==="POST"?"application/json":void 0,data:method==="POST"?JSON.stringify(data):data}).done(function(response){deferred.resolve(response)}).fail(function(xhr,textStatus){var status=xhr?xhr.status:0;if(isRetryable(status)&&attempt<MAX_ATTEMPTS){var wait=RETRY_BASE_MS*Math.pow(2,attempt-1);window.setTimeout(function(){request(url,method,data,attempt+1).done(function(response){deferred.resolve(response)}).fail(function(error){deferred.reject(error)})},wait);return}deferred.reject(describeError(xhr,textStatus))}),deferred.promise()}function describeError(xhr,textStatus){var error={status:xhr?xhr.status:0,textStatus:textStatus||"error",message:""};return xhr&&xhr.responseJSON&&(error.message=xhr.responseJSON.description||xhr.responseJSON.message||""),!error.message&&error.textStatus==="timeout"&&(error.message="The request timed out."),error}function get(){return request(ENDPOINTS.get,"GET",{_:new Date().getTime()})}function add(payload){return request(ENDPOINTS.add,"POST",payload)}function changeLine(key,payload){var body=$.extend({id:key},payload);return request(ENDPOINTS.change,"POST",body)}function removeLine(key){return request(ENDPOINTS.change,"POST",{id:key,quantity:0})}function replaceLine(key,payload){var deferred=$.Deferred();return add(payload).done(function(){removeLine(key).done(function(cart){deferred.resolve(cart)}).fail(function(){get().done(function(cart){deferred.resolve(cart)}).fail(function(error){deferred.reject(error)})})}).fail(function(error){deferred.reject(error)}),deferred.promise()}function findLineKey(cart,variantId,imageFilename){if(!cart||!cart.items)return"";for(var i=0;i<cart.items.length;i++){var item=cart.items[i];if(!(variantId&&String(item.variant_id)!==String(variantId))){if(!imageFilename)return item.key||"";var props=item.properties||{},filename=CR.state.filenameFromUrl(props[CR.state.PROP_THUMBNAIL])||CR.state.filenameFromUrl(props[CR.state.PROP_ORIGINAL]);if(filename===imageFilename)return item.key||""}}return""}return{get:get,add:add,changeLine:changeLine,removeLine:removeLine,replaceLine:replaceLine,findLineKey:findLineKey}})(jQuery);
2//# sourceMappingURL=/cdn/shop/t/3/assets/cr-cart.js.map?v=71696891401273758011787647322

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.