var shop="a72fc544-48b4-4bb7-8bb5-9f415a80c325";var goaffproLastOrderConversionCallback=()=>{const path=document.location.pathname;if(window.goaffproTrackConversion&&path.includes("/thank-you-page")){window.goaffproTrackConversion('last_order')}}
function gfpLoadScript(){const exists=document.getElementById('goaffproApiScript')
if(!exists){const script=document.createElement('script');script.id="goaffproApiScript"
script.src="https://api.goaffpro.com/loader.js?shop="+shop;script.async=false
document.head.appendChild(script);}}
function goaffproRegisterListener(){gfpLoadScript();window.wixDevelopersAnalytics.register('1129148b-e312-4228-ad46-9e10c1f22229',function report(eventName,data){switch(eventName){case "Schedule":case "ViewContent":gfpLoadScript();break;case "PageView":gfpLoadScript();if(window.trackVisit)trackVisit();setTimeout(()=>{if(goaffproLastOrderConversionCallback){goaffproLastOrderConversionCallback()}},2000)
break;case "Purchase":goaffproLastOrderConversionCallback=undefined;window.gfpCallbackMade=false;if(data.origin!=="Stores"){window.goaffpro_order={id:(data.id!=="unknown"?data.id:null)||String(Date.now()),type:data.origin||'unknown',forceSDK:true,total:data.revenue,originalEvent:data,currency:data.currency,tax:data.tax,coupons:data.coupon?[data.coupon]:undefined,line_items:data.contents&&data.contents.map(({id,quantity,currency,price,name})=>{return{name:name||data.origin,quantity:quantity||1,price,id,currency,}})}
if(window.goaffproTrackConversionSync)window.goaffproTrackConversionSync(window.goaffpro_order)}else{window.goaffpro_order={id:data.orderId||data.id,}
if(window.checkoutPageCallback)checkoutPageCallback()}
break;}
console.log("goaffpro",eventName,data);})}
if(window.wixDevelopersAnalytics){goaffproRegisterListener()}else{gfpLoadScript();window.addEventListener('wixDevelopersAnalyticsReady',goaffproRegisterListener);}
function init(){const gfpWixLoadInterval=setInterval(function(){try{const path=document.location.pathname;if(path.includes("/thank-you-page")){const script=document.createElement('script');script.id="goaffproCheckoutWidget"
script.src="https://api.goaffpro.com/checkout_widget.js?shop="+shop;script.async=false
document.head.appendChild(script);clearInterval(gfpWixLoadInterval)}}catch(e){}},1000)}
init()