!function(){let t=new URLSearchParams(document.currentScript.src.split("?")[1]).get("unique_id");if("undefined"==typeof jQuery&&"undefined"==typeof $){let t=document.createElement("script");t.src="https://code.jquery.com/jquery-3.6.0.min.js",document.head.appendChild(t),t.onload=function(){n(),e()}}else n(),e();function e(){document.body.addEventListener("click",function(t){let e=t.target,o=$(e).closest("form"),c=o.attr("action");e&&"Checkout-button"!==e.getAttribute("data-testid")&&o&&c?.includes("/cart/add")&&setTimeout(()=>{fetch("/cart.js",{method:"GET",headers:{"Content-Type":"application/json"}}).then(t=>t.json()).then(t=>{let{token:e}=t,o=e.split("?")[0];localStorage.setItem("abandon-cart",o),function(t){let e=JSON.parse(localStorage.getItem("welcome-popup-collect"))||null;e&&fetch("https://app.delightchat.io/marketingapi/usertracking/phone_number_abdcart",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cart_token:t,phone_number:e?.phone_number})}).then(t=>t.json()).then(t=>{n()}).catch(t=>{console.log(t)})}(o)}).catch(t=>{console.log(t)})},1e3)},!0)}function n(){let e=localStorage.getItem("abandon-cart")||null;e&&fetch("https://app.delightchat.io/marketingapi/usertracking/last_update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cart_token:e,user_tracking_script:t||void 0})}).then(t=>t.json()).then(t=>{}).catch(t=>{console.log(t)})}}();