PageSourceSearch

https://www.signmakerz.com/cdn/shop/t/54/assets/cart-journey.js?v=24855606885349838971789477438

js signmakerz.com collected 2026-10-06 02:03:48 UTC 6,406 bytes, 2 lines download raw bytes

1(function(){var CUSTOM_CART_URL="https://webhooks.codeblue.agency/api/cart/custom",PROJECT_NAME="signmakerz.com",PAYMENT_LINK_HOST="signmakerz.com",GEO_API_URL="https://ipwho.is/",GEO_WAIT_MS=800,ATC_SELECTOR=['button[name="add"]',"button.add-to-cart","button.sh-atc-btn","button[data-add-to-cart]"].join(", "),geoPromise=null;function collectLocationSignals(){var signals={city:"",region:"",country:"",ip:""};function fill(v,key){!signals[key]&&v&&String(v).trim()!==""&&(signals[key]=String(v).trim())}function readLS(key){try{return localStorage.getItem(key)}catch(e){return null}}function readSS(key){try{return sessionStorage.getItem(key)}catch(e){return null}}try{var raw=readLS("user_location_info");if(raw){var info=JSON.parse(raw)||{};fill(info.city,"city"),fill(info.region||info.regionName||info.state,"region"),fill(info.country||info.countryName,"country"),fill(info.ip||info.query,"ip")}}catch(e){}var stringSources=[readLS("location"),readLS("locationxh"),readLS("ev_location_and_time"),readSS("ev_location_and_time")];stringSources.forEach(function(str){if(str&&(str=String(str).trim(),!!str)){var ipMatch=str.match(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/);ipMatch&&fill(ipMatch[0],"ip");var clean=str.replace(/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,"").replace(/\d{4}-\d{2}-\d{2}[t\s\d:.\-z+]*/gi,""),parts=clean.split(/[,;]+/).map(function(p){return p.trim()}).filter(function(p){if(!p)return!1;var low=p.toLowerCase();return low!=="undefined"&&low!=="unknown"&&low!=="unknown country"&&low!=="n/a"});parts.length>=3?(fill(parts[0],"city"),fill(parts[1],"region"),fill(parts[2],"country")):parts.length===2?(fill(parts[0],"region"),fill(parts[1],"country")):parts.length===1&&fill(parts[0],"country")}}),fill(readLS("countryName"),"country"),fill(readLS("shopCountryCode"),"country");try{window.Shopify&&window.Shopify.country&&fill(window.Shopify.country,"country")}catch(e){}try{var tz=Intl.DateTimeFormat().resolvedOptions().timeZone;if(tz&&!signals.city){var seg=tz.split("/").pop();seg&&fill(seg.replace(/_/g," "),"city")}}catch(e){}return signals}function signalsAreEnough(sig){var hasCountry=!!(sig.country&&String(sig.country).trim()!==""),hasOther=!!(sig.city&&String(sig.city).trim()!==""||sig.region&&String(sig.region).trim()!==""||sig.ip&&String(sig.ip).trim()!=="");return hasCountry&&hasOther}function signalsToString(sig){return[sig.city,sig.region,sig.country,sig.ip].filter(function(p){return p&&String(p).trim()!==""}).join(", ")}function fetchGeoFallback(){return geoPromise||(geoPromise=fetch(GEO_API_URL,{method:"GET"}).then(function(r){return r.ok?r.json():null}).then(function(d){if(!d||d.success===!1)return null;var incoming={city:d.city||"",region:d.region||"",country:d.country_code||d.country||"",countryName:d.country||"",ip:d.ip||""};try{var raw=localStorage.getItem("user_location_info"),existing=raw?JSON.parse(raw)||{}:{};return Object.keys(incoming).forEach(function(k){(!existing[k]||String(existing[k]).trim()==="")&&incoming[k]&&(existing[k]=incoming[k])}),localStorage.setItem("user_location_info",JSON.stringify(existing)),existing}catch(e){return incoming}}).catch(function(){return null}),geoPromise)}function readVariantsFromDom(){var el=document.querySelector("[data-variant-json]");if(!el)return[];try{var parsed=JSON.parse(el.value||el.textContent||"[]");return Array.isArray(parsed)?parsed:[]}catch(e){return[]}}function readCurrentVariantFromDom(){var el=document.querySelector("[data-current-variant-json]");if(!el)return null;try{return JSON.parse(el.value||el.textContent||"null")}catch(e){return null}}function pickImageUrl(variant,variants){if(variant&&variant.featured_image&&variant.featured_image.src)return variant.featured_image.src;for(var i=0;i<variants.length;i++){var v=variants[i];if(v&&v.featured_image&&v.featured_image.src)return v.featured_image.src}return null}function buildPayload(locationString){var variants=readVariantsFromDom(),currentVariant=readCurrentVariantFromDom(),urlObj=new URL(window.location.href),paymentLinkPath=urlObj.pathname.replace(/-\d+$/,""),paymentLink=PAYMENT_LINK_HOST+paymentLinkPath,selectedVaEl=document.querySelector("input.selectedVaI
1d, .selectedVaId"),variantId=urlObj.searchParams.get("variant")||currentVariant&&currentVariant.id||selectedVaEl&&selectedVaEl.value||variants[0]&&variants[0].id||null,selectedVariant=currentVariant;if(!selectedVariant&&variantId){for(var i=0;i<variants.length;i++)if(String(variants[i].id)===String(variantId)){selectedVariant=variants[i];break}}!selectedVariant&&variants.length&&(selectedVariant=variants[0]);var productId=selectedVariant&&selectedVariant.product_id||variants[0]&&variants[0].product_id||null;return{project_name:PROJECT_NAME,payment_link:paymentLink,variant_id:variantId?String(variantId):null,product_id:productId?String(productId):null,image_url:pickImageUrl(selectedVariant,variants),price:selectedVariant&&selectedVariant.price!=null?selectedVariant.price/100:null,location:locationString}}function postPayload(locationString){try{var payload=buildPayload(locationString);fetch(CUSTOM_CART_URL,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(payload),keepalive:!0}).then(function(r){return r.json()}).then(function(d){console.log("[cart-journey] response",d)}).catch(function(e){console.warn("[cart-journey] request failed",e)})}catch(e){console.warn("[cart-journey] unexpected error",e)}}function sendCustomCartUpdate(){var localSignals=collectLocationSignals();if(signalsAreEnough(localSignals)){postPayload(signalsToString(localSignals));return}var waitCap=new Promise(function(resolve){setTimeout(resolve,GEO_WAIT_MS)});Promise.race([fetchGeoFallback(),waitCap]).then(function(){var merged=collectLocationSignals();postPayload(signalsToString(merged))})}var lastFireAt=0;function handleAtcEvent(e){var btn=e.target&&e.target.closest?e.target.closest(ATC_SELECTOR):null;if(!(!btn||btn.disabled)){var now=Date.now();now-lastFireAt<1500||(lastFireAt=now,sendCustomCartUpdate())}}function bindAtc(){document.__cartJourneyBound||(document.__cartJourneyBound=!0,document.addEventListener("pointerdown",handleAtcEvent,!0),document.addEventListener("click",handleAtcEvent,!0))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",bindAtc):bindAtc()})();
2//# sourceMappingURL=/cdn/shop/t/54/assets/cart-journey.js.map?v=24855606885349838971789477438

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.