var tour={id:'choose-your-training-language-tour',i18n:{nextBtn:"NEXT ",doneBtn:"DONE ",prevBtn:"BACK",closeTooltip:"Thanks!",stepNums:["1"]},steps:[{target:'welcome-choose-tour',content:"To kick off your training, click on the box of the language you'll be training in.",placement:'right',arrowOffset:60}],showPrevButton:true,scrollTopMargin:100,onClose:function(){handlerCloseandDoneTour();},onEnd:async function(){handlerCloseandDoneTour();},};
addClickListener=function(el,fn){if(el.addEventListener){el.addEventListener('click',fn,false);} else{el.attachEvent('onclick',fn);}};
init=function(){var startBtnId='welcome-choose-tour',calloutId='startTourCallout',mgr=hopscotch.getCalloutManager(),state=hopscotch.getState();
hopscotch.startTour(tour);
addClickListener(document.getElementById(startBtnId),function(){if(!hopscotch.isActive){mgr.removeAllCallouts();hopscotch.startTour(tour);}});
};
handlerCloseandDoneTour=async function(){var settings={"async":true,"crossDomain":true,"url":"https://bilingualbirdies.com/wp-json/bbhappymonsterwptheme/v1/tourdone","method":"POST","headers":{"apikey":"FPGgiTCNPwc2GTOGcYbU8bknJwTowuyA","content-type":"application/x-www-form-urlencoded",},"data":{"page":"Choose Your Training Language","user":theUser.username.ID,}}
const existtour=await search_tour_done();if(!Boolean(Number(existtour))){console.log("save");$.ajax(settings).done(function(response){console.log(response);});}else{console.log("the tour already exists");}}
function search_tour_done(){var settings={"async":true,"crossDomain":true,"url":"https://bilingualbirdies.com/wp-json/bbhappymonsterwptheme/v1/search-tourdone","method":"POST","headers":{"apikey":"FPGgiTCNPwc2GTOGcYbU8bknJwTowuyA","content-type":"application/x-www-form-urlencoded",},"data":{"page":"Choose Your Training Language","user":theUser.username.ID,}};
let result=$.ajax(settings).done(function(response){
return response;});
return result;
}
document.addEventListener('DOMContentLoaded',async function(){let existtour=await search_tour_done();console.log("tour exist --->",existtour);if(!Boolean(Number(existtour))){init();}},false);