function initExtraSettings(n){var i={labelResourceSelection:LanguageNL.ResourceSelection,placeholderfirstname:LanguageNL.placeholderfirstname,placeholderremarks:LanguageNL.placeholderremarks},t;try{return n==null?null:(t=JSON.parse(n),$.extend(i,t))}catch(r){return console.log("Error: initExtraSettings ",r),null}}var version_boekingapp="2024.08.21",gSelectServicesAndResources=!1,gConsumerContact,gProfielContact,AppRouter;gNoAppReload=!1;gHideDuration=!1;window.FormsAll=window.FormsAll||{};AppRouter=Backbone.Router.extend({ResourceServicesList:null,onlinebookingview:null,BookableResources:null,routes:{init:"init","OpenIntake/:Id":"OpenIntake","reserve/:querystring":"reserve","RenderConfirmMove/:message":"RenderConfirmMove"},OpenIntake:function(n){var i=this;FormsAll.hideTopAction=!0;FormsAll.PreviewMode=!1;FormsAll.Online=!0;var u=new FormModel,r=new ConsumerContact,t=new FormModel;t.url="/api/note/"+n;t.fetch().done(function(){r.set("id",t.get("ContactId"));var n=new FormsAll.IntakeForm({contact:r,notes:i.notes,note:t,parentview:i.parentview,formtype:"IntakeForm",intakeformtemplate:t.get("TextField21")});$("#Container").html(n.render().el)})},renderPageStyling:function(){var t,e,i,n,o,r,s,u,f;largescreen=$("#largescreen").is(":visible");t=app.appsettings.get("configsetting").BackgroundImage;e=app.appsettings.get("configsetting").FontFamily;tenantid==7613&&(t="https://suitsatsea.nl/wp-content/uploads/2017/04/Afspraak-maken-trouwpak-Suits-at-Sea-trouwpakken-trouwpak-op-maat.jpg");tenantid==6642&&(t="https://irp-cdn.multiscreensite.com/e42f668a/dms3rep/multi/desktop/woman_long_hair_cut.jpg");tenantid==7150&&(t="https://unicareclinic.nl/wp-content/uploads/2018/05/Copacabana_Cosmetic_Clinic_NLD_375701_0.jpg");tenantid==7519&&(t="https://sarasoft.blob.core.windows.net/medialibrary/7519//bg2.jpg");i="";tenantid==6550&&(i="#4c4c4c");tenantid==5596&&(e="Tahoma, Geneva, sans-serif, Arial !important;");n="orange";tenantid==4420&&(n="#F7C0D9");tenantid==7632&&(n="#3f7dba");tenantid==11472&&(n=" #ff6ddb");tenantid==11536&&(n=" #ee7676");tenantid==11097&&(n="#e8e0d8");gSelectColorEqual&&(n="#"+app.appsettings.get("ThemeColor"));i="";try{i="#"+gExtrasettings.BackgroundColor}catch(h){i=""}o=_.template($("#CSSTemplate").html());$("#themestyle").append(o({selectcolor:n,themecolor:themecolor,BackgroundImage:t,BackgroundColor:i,fontFamily:e}));(gShowBusinessheaderbar||gShowCompanyAddress)&&($("#CompanynameTopBar").html(app.appsettings.get("BusinessName")),gShowCompanyAddress&&(r="<div style='line-height:14px;'><div>"+app.appsettings.get("BusinessName")+"<\/div>                            <div style='font-size:11px;'> "+app.appsettings.get("BusinessAddress")+" "+app.appsettings.get("BusinessZip")+" "+app.appsettings.get("BusinessCity")+" "+app.appsettings.get("BusinessPhone")+" <\/div><\/div>",$("#CompanynameTopBar").html(r)),$("#loginlink").hide(),$(".logininfoContainer").show());(gExtrasettings.OnlineLoginNotRequired==!1||gExtrasettings.MandatoryLogin==!0)&&($("#CompanynameTopBar").html(app.appsettings.get("BusinessName")),gShowCompanyAddress&&(r="<div style='line-height:14px;'><div>"+app.appsettings.get("BusinessName")+"<\/div>                            <div style='font-size:11px;'> "+app.appsettings.get("BusinessAddress")+" "+app.appsettings.get("BusinessZip")+" "+app.appsettings.get("BusinessCity")+" "+app.appsettings.get("BusinessPhone")+" <\/div><\/div>",$("#CompanynameTopBar").html(r)),$(".logininfoContainer").show(),$("#loginlink").show(),$("#menutitems").hide(),gShowMyBookings&&$("#menutitems").show());window.top==window.self&&(s=app.appsettings.get("BusinessName"),u=app.appsettings.get("BusinessLogo"),u.indexOf("Default_logo.png")>-1||u==""?$("#CompanyLogo").html("<h1 class='themecolor' style='padding:0px;margin:0px'>"+s+"<\/h1>"):(f="https://sarasoft.blob.core.windows.net/images/logo_"+tenantid+"?v="+Math.random(),u.indexOf("6262")>-1&&(f="https://sarasoft.blob.core.windows.net/images/logo_6262?v="+Math.random()),u.indexOf("6288")>-1&&(f="https://sarasoft.blob.core.windows.net/images/logo_6288?v="+Math.random()),gWebsiteurl!=null?gWebsiteurl.indexOf("http")==-1&&(gWebsiteurl="http://"+gWebsiteurl):gWebsiteurl="#",$("#CompanyLogo").html("<a href="+gWebsiteurl+"><img src='"+f+"' /><\/a>")))},initVORIGExxxx:function(){var n,t;_thisapp=this;_thisapp.onlinebookingview=new OnlineBookingView;_thisapp.renderPageStyling();$("#MainContent").html(onlinebookingview.render().el);n=new ConsumerContact;n.url="/api/contact";n.fetch({data:"companyid="+tenantid}).done(function(){});t="Category/Group,Title";gOrderedServices&&(t="Category/Order,OrderNumber");_thisapp.ResourceServicesList=new Services;_thisapp.ResourceServicesList.fetch({data:"$select=Id,Title,TaxType,Category/Group,Duration,ProcessTime,Price,Description,Tool,CombinedServices,BufferTime,BufferTimeJSON&$expand=Category&$filter=OnlineTool+eq+true+and+tenantId+eq+"+tenantid+"&$orderby="+t,parse:!1,dataType:"json"}).done(function(){}).done(function(){_thisapp.GetResourceServices()}).fail(function(){alert("Load van services list failed")})},DialogNotification:function(n){var t=$("<div id='dialogNotification'>"+n.replaceAll("\n","<br>")+"<\/div>");t.dialog({modal:!0,width:DialogWidth(450),close:function(){$("#dialogNotification").dialog("destroy");$("#dialogNotification").remove()},buttons:[{text:"Gelezen","class":"pure-button greenbutton",click:function(){$("#dialogNotification").dialog("close")}}]})},SendAdminEmail:function(n,t){$.post("/api/mailsend?sarasystem=1",{Email:"info@sarasalonsoft.nl",Subject:n,Message:t})},init:function(){var n,t,i;if(_thisapp=this,_thisapp.onlinebookingview=new OnlineBookingView,_thisapp.renderPageStyling(),$("#MainContent").html(onlinebookingview.render().el),app.appsettings.get("SubscriptionForm")=="[PAUSED]"){this.DialogNotification(gExtrasettings.OnlineNotification);return}n=new ConsumerContact;n.url="/api/contact";n.fetch({data:"companyid="+tenantid}).done(function(n){authenticated=="True"&&(gProfielContact=n,_thisapp.RenderProfile(gProfielContact))});gConsumerContact=n;this.SetLocalStorageFields();t="Category/Group,Title";gOrderedServices&&(t="Category/Order,OrderNumber");_thisapp.ResourceServicesList=new Services;_thisapp.ResourceServicesList.url="/api/Service";_thisapp.ResourceServicesList.fetch({data:"companyid="+tenantid+"&Category=&$orderby="+t,parse:!1,dataType:"json"}).done(function(){_thisapp.GetResourceServices()}).fail(function(){$("#placeholderServicesList").append("<div style='height:100px;text-align:center;font-size:16px;margin-left:auto;margin-right:auto;background:white'><div style='font-size:20px;margin-top:50px'>Even geduld aub...<a href='#' onclick='location.reload();'>klik hier<\/a><\/div><\/div>")});gExtrasettings.OnlineNotificationShow&&this.DialogNotification(gExtrasettings.OnlineNotification);gExtrasettings.GoogleReserve&&(GoogleReserve.SetConversionCookie(tenantid,""),i=getParameterByName("rwg_token"),i!==""&&GoogleReserve.SetConversionCookie(tenantid,i))},SetLocalStorageFields:function(){try{if(getParameterByName("CustomerDetailstring")!=""){var n=getParameterByName("CustomerDetailstring").split(";");localStorage.FirstName=n[0];localStorage.LastName=n[1];localStorage.HomePhone=n[2];localStorage.EmailAddress=n[3]}}catch(t){}},GetResourceServices:function(){_thisapp.availablityitems=new AvailablityItems;_thisapp.availablityitems.url="/api/onlineBook/GetResourceServices";_thisapp.availablityitems.fetch({data:"&companyid="+tenantid+"&GetResourceServices=true",parse:!1}).done(function(){}).done(function(){_thisapp.ResourceServicesListJSON=_thisapp.availablityitems.toJSON();_thisapp.GetResources()}).fail(function(){alert("Load ResourcesServices list failed")})},GetResources:function(){_thisapp.BookableResources=new BookableResources;_thisapp.BookableResources.url="/api/onlineBook/BookableResources";_thisapp.BookableResources.fetch({data:"companyid="+tenantid+"&resource=true"}).done(function(){}).done(function(){_thisapp.onlinebookingview.renderServiceList(_thisapp.ResourceServicesList);_thisapp.BookableResources.length==1&&(gPreferStaff=!1,localStorage.preferredstaff="");_thisapp.SelectServicesAndResource();_thisapp.GetAppliances()}).fail(function(){alert("Load resources failed")})},GetAppliances:function(){try{_thisapp.ApplianceCollection=new ApplianceCollection;_thisapp.ApplianceCollection.url="/api/onlineBook/Appliances";const n=[];_thisapp.ApplianceCollection.fetch({data:"companyid="+tenantid+"&appliance=true"}).done(function(){}).done(function(){_.each(_thisapp.ApplianceCollection.models,function(t){n.push(t.id)});_thisapp.AppliancesList=jQuery.grep(_thisapp.ResourceServicesListJSON,function(t){return n.includes(t.ResourceId)})}).fail(function(){alert("Load Applicances failed")})}catch(n){}},SelectServicesAndResource:function(){try{var n=getParameterByName("service").split(",");getParameterByName("service")!=""&&(gSelectServicesAndResources=!0);_.each(n,function(n){$(".onlineservicelist #"+n).click();$(".onlineservicelist #"+n).parent().find("dd").show()})}catch(t){}},reserve:function(){var n,i,r,u,t;if(!gNoAppReload||typeof serviceId!="undefined"&&serviceId!=""){_thisreserveview=this;_thisreserveview.renderPageStyling();n=new ConsumerContact;n.url="/api/contact";var f=new Services,o=new Services,e=new AvailablityItems;e.url="/api/onlineBook/resources";i=new BookableResources;i.url="/api/onlineBook/GetResource";dateText=moment(new Date).format("YY/MMM/DD");serviceIds=[];serviceId.indexOf(",")>0?(serviceIds=serviceId.split(","),fetchids=[],_.each(serviceIds,function(n){fetchids.push("(Id+eq+"+n+")")}),filterids=fetchids.join("+or+")):(filterids="Id+eq+"+serviceId,serviceIds[0]=serviceId);r="Category/Group,Title";gOrderedServices&&(r="Category/Order,OrderNumber");u="companyid="+tenantid;DummyAccount&&(t=getParameterByName("CustId"),(t==null||t=="")&&(t=0),u=gNewSaveConsent?"companyid="+tenantid+"&EmailAddress="+localStorage.EmailAddress:"companyid="+tenantid+"&CustId="+t);gDuoBooking&&resourceId.indexOf("-")>-1&&(resourceId=resourceId.split("-")[0]);$.when(n.fetch({data:u}),f.fetch({data:"companyid="+tenantid+"&Category=&$filter="+filterids+"&$orderby="+r,parse:!1,dataType:"json"}),i.fetch({data:"&companyid="+tenantid+"&ResourceId="+resourceId,parse:!1}).done(function(n){AvailableResource=n[0]})).done(function(){authenticated=="True"&&(gProfielContact=n.toJSON(),_thisreserveview.RenderProfile(gProfielContact));gNewSaveConsent&&_thisreserveview.InitExtraProperties(n);_thisreserveview.ConfirmBooking(n,f,AvailableResource)})}},InitExtraProperties:function(n){CustomerConsents.initialisedConsents=new CustomerConsents.ConsentCollection;try{var t=JSON.parse(n.get("ExtraProperties"));CustomerConsents.initialisedConsents.reset(t)}catch(i){}},ConfirmBooking:function(n,t,i){var r=new ReserveView,e=getParameterByName("service"),o=e.split(","),u,f;r.tobebookedqueue=new Services;u=new Services;_.each(o,function(n){var i=t.get(parseInt(n));u.add(i);i.get("CombinedServices")?InjectResourceService(r.tobebookedqueue,i):r.tobebookedqueue.add(i)});r.selectedservice=u.models[0];r.selectedservices=u;r.selectedresource=i;r.selecteddate=BookedDateTime;r.contact=n;getParameterByName("Status")=="paid"?(r.AppointmentID=getParameterByName("AppointmentID"),r.confirmMessage(!0),gBatchAppointments?gExtrasettings.ShowOnlyOnlinePayment&&r.confirmMessage(!0):r.sendConfirmMessage(!0)):(gNoAppReload?($("#MainContentConfirmBooking").html(r.render().el),$("#MainContent").hide(),$("#MainContentConfirmBooking").show()):$("#MainContent").html(r.render().el),gfeatureCaptchaSecurity&&this.ReCaptcha(r));gSaleProducts&&(f=$("#onlinepayment:checked").val(),f&&($(".shoppingcartfeature").show(),r.rendershoppingCart(),r.Addproducts()))},RenderConfirmMove:function(n){var i=_.template($("#tmpConfirmAppointmentMove").html()),n="<strong>Uw afspraak is verplaatst. <\/strong><br>U ontvangt straks een bevestiging per email van uw afspraak. ",t;try{t=app.movedappointment;n+="<br> [Date]  <br>  met : [ResourceName] ";n=n.replaceAll("[Date]",moment(t.start).format("DD MMMM YYYY HH:mm"));n=n.replaceAll("[ResourceName]",t.resourceName);$("#MainContent").html(i({message:n}))}catch(r){$("#MainContent").html(i({message:n}))}},ReCaptcha:function(n){var n=n;grecaptcha.ready(function(){grecaptcha.render("captcha",{size:"invisible",sitekey:"6LcM9mgfAAAAAGYyivd6GWFiI4lf8f8sX0zUpzDy",callback:function(){console.log("recaptcha callback");n.StartBookingProcess()}})})},RenderProfile:function(n){n!=null&&n.RewardPoints!=null}});$(document).ready(function(){var n,t;document.addEventListener("visibilitychange",function(){document.hidden||$("#MyAppointments").html()!=undefined&&$("#refreshbutton").click()});$(".actionloginmenu").dropit();app=new AppRouter;n=new settings;app.appsettings=new setting;t=null;gExtrasettings={};setFeatures();$("#recaptchaplugin").hide();gfeatureCaptchaSecurity&&$("#recaptchaplugin").show();$.when(n.fetch({url:"/api/Setting/GetSetting?companyid="+tenantid})).done(function(){if(app.appsettings=n.models[0],moment.locale("nl"),LanguageDefault=LanguageNL,n.length==0)return $("#ui-message").notify("show",{type:"error",iconerror:"",closebutton:!0,autohide:!1,closebutton:!0,message:"Appsettings niet geladen. Stuur een email naar info@sarasalonsoft.nl"}),"appsetting not found";var t=app.appsettings.get("Extrasettings");if(gExtrasettings=initExtraSettings(t),gExtrasettings==null)return $("#ui-message").notify("show",{type:"error",iconerror:"",closebutton:!0,autohide:!1,closebutton:!0,message:"De instellingen konden niet worden geinitialiseerd. Stuur een email naar info@sarasalonsoft.nl"}),"Initialision error extrasettings";OverwriteLabels(LanguageNL,gExtrasettings);gWebsiteurl=app.appsettings.get("WebSiteURL");gWebsiteurl==null&&(gWebsiteurl="");gNewTicketModule=app.appsettings.get("MigrationDate")!=null?!0:!1;ShowPrices=app.appsettings.get("OnlineShowPrice");ShowAddress=app.appsettings.get("OnlineShowAddressInfo");gOrderedServices=!1;app.appsettings.get("ServiceSortOnNumber")&&(gOrderedServices=!0);gOnlinepayment=!1;app.appsettings.get("OnlinePayment")&&(gOnlinepayment=!0);color=app.appsettings.get("ThemeColor");themecolor=color!=null?color.indexOf("#")>-1?color:"#"+color:"#B42671";gShowAgreementlink=!1;gShowPrivacylink=!1;gExtrasettings.AgreementLink&&gExtrasettings.AgreementLink.length>2&&(gShowAgreementlink=!0);gExtrasettings.PrivacyLink&&gExtrasettings.PrivacyLink.length>2&&(gShowPrivacylink=!0);gExtrasettings.DuoBookingFeature&&(gDuoBooking=!0);gWaitList=!1;gExtrasettings.WaitListFeature&&(gWaitList=!0,gCheckDayOff=!0);gExtrasettings.ApparatenFeature&&(gCheckForRoomv2=!0);gExtrasettings.MultipleContacts&&(gCheckMultipleContactsFound=!0);gShowBirthdate=!1;gExtrasettings.ShowFieldBirthday&&(gShowBirthdate=!0);gHideDuration=!1;gExtrasettings.HideDuration&&(gHideDuration=!0);gExtrasettings.gOnlinetoolLogin&&(gShowMyBookings=!0);GeenVoorkeuroptieNietTonen=!1;gExtrasettings.HidePreference&&(GeenVoorkeuroptieNietTonen=!0);gGoogleReserveActivated=!1;gExtrasettings.GoogleReserve&&(gGoogleReserveActivated=!0);gShowCompanyAddress=!1;gReservationFromGoogle=!1;(getParameterByName("rwg_token")!=""||getParameterByName("rfg")!="")&&(gShowCompanyAddress=!0,gReservationFromGoogle=!0);gMaxMonthsAhead=app.appsettings.get("MaxMonthsAhead");gMaxMonthsAhead=gMaxMonthsAhead==0?"+12M":+ "+"+gMaxMonthsAhead.toString()+"M";gSaleProducts=!1;gExtrasettings.OnlineProducts&&(gSaleProducts=!0);BookedDateTime==""?app.init():app.reserve();Backbone.history.start()}).fail(function(err){var err=eval("("+err.responseText+")");err.statusText&&(window.location="/Error?message="+err.statusText);err.Message&&(window.location="/Error?message="+err.Message)})})