if(void 0!==document.getElementById("wcs-settings__app")&&null!=document.getElementById("wcs-settings__app")){ELEMENT.locale(window.EventsSchedule.locale_element_ui);var WcsSettings=new Vue({el:"#wcs-settings__app",data:function(){return{visible:!1,form:{},loading:!0,tabs:"general"}},mounted:function(){var e=this;e.$http.get(window.EventsSchedule.rest_route+"weekly-class/v1/settings/",{headers:{"X-WP-Nonce":window.EventsSchedule.nonce}}).then(e.successCallback,e.errorCallback)},methods:{successCallback:function(e){var t=this;t.loading=!1,t.form=e.body,console.log(e)},errorCallback:function(e){this.loading=!1,console.log(e)},saveSettings:function(){var e=this;e.loading=!0,e.$http.post(window.EventsSchedule.rest_route+"weekly-class/v1/settings/",e.form,{emulateJSON:!0,headers:{"X-WP-Nonce":window.EventsSchedule.nonce}}).then(e.successCallbackUpdate,e.errorCallbackUpdate)},successCallbackUpdate:function(e){this.loading=!1,this.$notify({title:"Success",message:"Settings saved succesfully.",type:"success",offset:40,duration:2e3}),console.log(e)},errorCallbackUpdate:function(e){this.loading=!1,this.$notify({title:"Error",message:"Settings could not be saved. Please try again!",type:"error",offset:40,duration:2e3}),console.log(e)}}})}