%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/client/
Upload File :
Create Path :
Current File : //home/forge/takeaseat.eco-n-tech.co.uk/.nuxt/dist/client/6d96611.js

(window.webpackJsonp=window.webpackJsonp||[]).push([[49,24,32,36],{409:function(t,e,r){"use strict";r.r(e);var n=r(0),o=(r(3),r(30),{props:{value:{required:!0},selected_slots:{type:Object,required:!0},working:{type:Boolean,required:!0},button_text:{type:String,required:!0},nextStep:{type:Function,required:!0}},data:function(){return{loading:!0}},computed:{therapist:function(){return this.$store.state.booking.therapist},sessions:function(){return this.$store.state.booking.summary.sessions},totals:function(){return this.$store.state.booking.summary.totals},selected_session:function(){return this.$store.state.booking.summary.session}},mounted:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("booking/summary/get",{user_id:t.therapist.user.id,sessions:t.selected_slots,sessions_count:Object.keys(t.selected_slots).length}).then((function(){t.loading=!1}));case 2:case"end":return e.stop()}}),e)})))()},methods:{goBack:function(){this.$emit("input",1)}}}),l=r(10),component=Object(l.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("span",{staticClass:"block text-center text-3xl font-bold mb-6"},[t._v("Summary")]),t._v(" "),r("p",[t._v("You are nearly there. Please carefully check all details are correct before proceeding to payment.")]),t._v(" "),r("div",{staticClass:"my-2 mb-6"},[r("div",{staticClass:"grid grid-cols-3 gap-3 border-b-2 border-gray py-6"},[r("span",{staticClass:"uppercase text-sm"},[t._v("Therapist")]),t._v(" "),r("span",{staticClass:"col-span-2 text-sm"},[t._v(t._s(t.therapist.user.full_name))])]),t._v(" "),0==t.loading?r("div",{staticClass:"border-b-2 border-gray py-4"},[r("div",{staticClass:"grid grid-cols-3 gap-3 py-2"},[r("span",{staticClass:"uppercase text-sm"},[t._v("No. Of Sessions")]),t._v(" "),r("span",{staticClass:"text-sm"},[t._v(t._s(Object.keys(t.selected_slots).length))])]),t._v(" "),t._l(t.sessions,(function(e,n){return r("div",{key:n},[r("div",{staticClass:"grid grid-cols-6 gap-3 py-2"},[r("span",{staticClass:"col-span-2 uppercase text-sm"},[t._v("Session "+t._s(n+1))]),t._v(" "),r("span",{staticClass:"col-span-3 text-sm"},[t._v(t._s(t.$moment.utc(e.slot.start).format("D MMM Y - H:mm")+" - "+t.$moment.utc(e.slot.end).format("H:mm")))]),t._v(" "),r("div",{staticClass:"col-span-1 flex items-center justify-end"},[r("span",{staticClass:"text-sm"},[t._v(t._s(e.item_total.formatted))])])]),t._v(" "),r("div",{staticClass:"grid grid-cols-3 gap-3 py-2"},[r("span",{staticClass:"uppercase text-sm"},[t._v("Session Type")]),t._v(" "),r("span",{staticClass:"text-sm"},[t._v(t._s(e.session_name))]),t._v(" "),r("div",{staticClass:"flex items-center justify-end"},[r("button",{staticClass:"text-sm uppercase underline",attrs:{type:"button"},on:{click:t.goBack}},[t._v("Change")])])])])}))],2):t._e(),t._v(" "),0==t.loading?r("div",{staticClass:"grid grid-cols-2 gap-2 border-b-2 border-gray py-6"},[r("span",{staticClass:"uppercase text-sm"},[t._v("Total Price")]),t._v(" "),r("span",{staticClass:"uppercase font-bold flex items-center justify-end"},[t._v(t._s(t.totals.formatted))])]):r("div",{staticClass:"flex items-center justify-center py-6"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v("\n      Loading...\n    ")])]),t._v(" "),r("div",{staticClass:"flex flex-col items-center justify-center"},[r("button",{staticClass:"btn btn-primary btn-small rounded-full w-full sm:w-auto",attrs:{disabled:t.selected_slots.length<1,type:"button"},on:{click:function(e){return t.nextStep()}}},[0==t.working?r("span",[t._v(t._s(t.button_text))]):r("span",{staticClass:"flex items-center justify-center"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v(" "),r("span",[t._v("Processing")])])]),t._v(" "),r("button",{staticClass:"mt-6 uppercase text-blue-light text-sm",attrs:{type:"button"},on:{click:t.goBack}},[t._v("Go Back")])])])}),[],!1,null,null,null);e.default=component.exports},439:function(t,e,r){"use strict";r.r(e);var n=r(0),o=(r(3),{props:{value:{required:!0}},data:function(){return{register_working:!1,login_working:!1,register:{first_name:"",last_name:"",email:"",phone:"",password:"",password_confirmation:""},login:{email:"",password:""}}},methods:{userRegister:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.$refs.registerForm.validate().then((function(e){e&&(t.register_working=!0,t.$axios.post("/auth/register",{first_name:t.register.first_name,last_name:t.register.last_name,email:t.register.email,phone:t.register.phone,password:t.register.password,password_confirmation:t.register.password_confirmation}).then((function(e){200==e.status&&t.$auth.loginWith("laravelJWT",{data:{email:t.register.email,password:t.register.password}}).then((function(e){200==e.status&&(t.register_working=!1,t.$emit("input",4))}))})).catch((function(e){t.$refs.registerForm.setErrors(e.response.data.errors),t.register_working=!1})))}));case 1:case"end":return e.stop()}}),e)})))()},userLogin:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.$refs.loginForm.validate().then((function(e){e&&(t.login_working=!0,t.$auth.loginWith("laravelJWT",{data:t.login}).then((function(e){200==e.status&&(1==t.login.remember_me&&t.$auth.$storage.setCookie("_remember.".concat(t.$auth.options.defaultStrategy),t.$auth.strategy.token.get(),{maxAge:2147483647}),t.$emit("input",4))})).catch((function(e){t.login_working=!1,t.$toast.error(e.response.data.message).goAway(1500)})))}));case 1:case"end":return e.stop()}}),e)})))()},goBack:function(){this.$emit("input",2)}}}),l=r(10),component=Object(l.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("span",{staticClass:"block text-center text-3xl font-bold mb-6"},[t._v("Create Account")]),t._v(" "),r("ValidationObserver",{ref:"registerForm"},[r("form",{attrs:{role:"form",method:"POST"},on:{submit:function(e){return e.preventDefault(),t.userRegister(e)}}},[r("ValidationProvider",{attrs:{rules:"required",name:"first_name"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.errors;return[r("t-input-group",{attrs:{label:"First Name"}},[r("t-input",{attrs:{type:"text",placeholder:"First Name"},model:{value:t.register.first_name,callback:function(e){t.$set(t.register,"first_name",e)},expression:"register.first_name"}}),t._v(" "),n[0]?r("span",{staticClass:"field-invalid"},[t._v(t._s(n[0]))]):t._e()],1)]}}])}),t._v(" "),r("ValidationProvider",{attrs:{rules:"required",name:"last_name"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.errors;return[r("t-input-group",{attrs:{label:"Last Name"}},[r("t-input",{attrs:{type:"text",placeholder:"Last Name"},model:{value:t.register.last_name,callback:function(e){t.$set(t.register,"last_name",e)},expression:"register.last_name"}}),t._v(" "),n[0]?r("span",{staticClass:"field-invalid"},[t._v(t._s(n[0]))]):t._e()],1)]}}])}),t._v(" "),r("ValidationProvider",{attrs:{rules:"required",name:"email"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.errors;return[r("t-input-group",{attrs:{label:"Email"}},[r("t-input",{attrs:{type:"email",placeholder:"name@email.com"},model:{value:t.register.email,callback:function(e){t.$set(t.register,"email",e)},expression:"register.email"}}),t._v(" "),n[0]?r("span",{staticClass:"field-invalid"},[t._v(t._s(n[0]))]):t._e()],1)]}}])}),t._v(" "),r("ValidationProvider",{attrs:{rules:"required|phone_number",name:"phone"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.errors;return[r("t-input-group",{attrs:{label:"Phone"}},[r("t-input",{attrs:{type:"tel",placeholder:"+44"},model:{value:t.register.phone,callback:function(e){t.$set(t.register,"phone",e)},expression:"register.phone"}}),t._v(" "),n[0]?r("span",{staticClass:"field-invalid"},[t._v(t._s(n[0]))]):t._e()],1)]}}])}),t._v(" "),r("ValidationProvider",{attrs:{rules:"required|password:@password_confirmation",name:"password"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.errors;return[r("t-input-group",{attrs:{label:"Password"}},[r("t-input",{attrs:{type:"password",placeholder:"Password"},model:{value:t.register.password,callback:function(e){t.$set(t.register,"password",e)},expression:"register.password"}}),t._v(" "),n[0]?r("span",{staticClass:"field-invalid"},[t._v(t._s(n[0]))]):t._e()],1)]}}])}),t._v(" "),r("ValidationProvider",{attrs:{name:"password_confirmation",rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.errors;return[r("t-input-group",{attrs:{label:"Confirm Password"}},[r("t-input",{attrs:{type:"password",placeholder:"Confirm Password"},model:{value:t.register.password_confirmation,callback:function(e){t.$set(t.register,"password_confirmation",e)},expression:"register.password_confirmation"}}),t._v(" "),n[0]?r("span",{staticClass:"field-invalid"},[t._v(t._s(n[0]))]):t._e()],1)]}}])}),t._v(" "),r("div",{staticClass:"flex flex-col items-center justify-center"},[r("button",{staticClass:"btn btn-primary btn-small rounded-full",attrs:{type:"submit"}},[0==t.register_working?r("span",[t._v("Create Account & Proceed")]):r("span",{staticClass:"flex items-center justify-center"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v(" "),r("span",[t._v("Processing")])])])])],1)]),t._v(" "),t._m(0),t._v(" "),r("ValidationObserver",{ref:"loginForm"},[r("form",{attrs:{role:"form",method:"POST"},on:{submit:function(e){return e.preventDefault(),t.userLogin(e)}}},[r("ValidationProvider",{attrs:{rules:"required",name:"email"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.errors;return[r("t-input-group",{attrs:{label:"Email"}},[r("t-input",{attrs:{type:"email",placeholder:"name@email.com"},model:{value:t.login.email,callback:function(e){t.$set(t.login,"email",e)},expression:"login.email"}}),t._v(" "),n[0]?r("span",{staticClass:"field-invalid"},[t._v(t._s(n[0]))]):t._e()],1)]}}])}),t._v(" "),r("ValidationProvider",{attrs:{rules:"required",name:"password"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.errors;return[r("t-input-group",{attrs:{label:"Password"}},[r("t-input",{attrs:{type:"password",placeholder:"Password"},model:{value:t.login.password,callback:function(e){t.$set(t.login,"password",e)},expression:"login.password"}}),t._v(" "),n[0]?r("span",{staticClass:"field-invalid"},[t._v(t._s(n[0]))]):t._e()],1)]}}])}),t._v(" "),r("div",{staticClass:"flex flex-col items-center justify-center"},[r("button",{staticClass:"btn btn-primary btn-small rounded-full",attrs:{type:"submit"}},[0==t.login_working?r("span",[t._v("Log-in & Proceed")]):r("span",{staticClass:"flex items-center justify-center"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v(" "),r("span",[t._v("Processing")])])]),t._v(" "),r("button",{staticClass:"mt-6 uppercase text-blue-light text-sm",attrs:{type:"button"},on:{click:t.goBack}},[t._v("Go Back")])])],1)])],1)}),[function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"relative text-center mt-8 mb-6"},[r("span",{staticClass:"absolute z-10 top-1/2 left-0 transform -translate-y-1/2 block w-full h-0.5 bg-gray"}),t._v(" "),r("span",{staticClass:"relative z-20 inline-block px-6 bg-white uppercase font-bold text-lg"},[t._v("Or Login")])])}],!1,null,null,null);e.default=component.exports},440:function(t,e,r){"use strict";r.r(e);var n=r(0),o=(r(30),r(3),{props:{value:{required:!0},selected_slots:{type:Object,required:!0}},data:function(){return{error:null,working:!1,stripe:null,card:{},selected_payment_method:null,isPaymentRequestAllowed:!1,paymentRequest:{},card_name:null}},computed:{totals:function(){return this.$store.state.booking.summary.totals},therapist:function(){return this.$store.state.booking.therapist},payment_methods:function(){return this.$store.state.account.billing.paymentMethods},setup_intent:function(){return this.$store.state.account.billing.setupIntent},connect_id:function(){return this.$store.state.booking.payment.connect_id}},mounted:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$store.dispatch("account/billing/setupIntent");case 2:return e.next=4,t.$store.dispatch("account/billing/getPaymentMethods");case 4:t.mountCard();case 5:case"end":return e.stop()}}),e)})))()},methods:{mountCard:function(){var t=this.$stripe.elements();this.card=t.create("card",{style:{base:{fontSize:"15px",fontFamily:"Poppins, sans-serif"}}}),this.getPaymentRequest(),this.card.mount("#card-element")},submitForm:function(){var t=this;this.$refs.paymentForm.validate().then((function(e){e&&t.confirmCardSetup()}))},getPaymentRequest:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.$stripe.paymentRequest({country:"GB",currency:"gbp",total:{amount:parseInt(t.totals.amount),label:"Takeaseat Booking with "+t.therapist.user.full_name},requestPayerName:!0,requestPayerEmail:!0});case 2:t.paymentRequest=e.sent,t.mountPaymentButton();case 4:case"end":return e.stop()}}),e)})))()},mountPaymentButton:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=t.$stripe.elements(),n=r.create("paymentRequestButton",{paymentRequest:t.paymentRequest}),t.paymentRequest.canMakePayment().then(function(t){t?(this.isPaymentRequestAllowed=!0,n.mount("#payment-request-button")):this.isPaymentRequestAllowed=!1}.bind(t)),t.paymentRequest.on("paymentmethod",function(t){t.complete("success"),this.createPayment(t.paymentMethod.id)}.bind(t));case 4:case"end":return e.stop()}}),e)})))()},confirmCardSetup:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r,n,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.working=!0,e.next=3,t.$stripe.confirmCardSetup(t.setup_intent,{payment_method:{card:t.card,billing_details:{name:t.card_name}}});case 3:if(r=e.sent,n=r.setupIntent,!(o=r.error)){e.next=13;break}return t.$toast.error(o.message).goAway(3e3),e.next=10,t.$store.dispatch("account/billing/setupIntent");case 10:t.working=!1,e.next=14;break;case 13:t.createPayment(n.payment_method);case 14:case"end":return e.stop()}}),e)})))()},createPayment:function(t){var e=this;return Object(n.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.working=!0,r.next=3,e.$axios.post("/booking/payment/"+e.therapist.user.id,{grand_total:e.totals.amount,sessions:e.selected_slots,sessions_count:Object.keys(e.selected_slots).length,payment_method:t}).then((function(t){200==t.status&&e.createBooking(t.data)})).catch((function(t){e.working=!1,e.$toast.error(t.response.data.message).goAway(3e3)}));case 3:case"end":return r.stop()}}),r)})))()},createBooking:function(data){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.working=!0,e.next=3,t.$axios.post("/booking/create",{sessions:t.selected_slots,amount:t.totals.amount,therapist_id:t.therapist.id,charges:data.charges,transfer:data.transfer}).then((function(e){200==e.status&&(t.$store.commit("booking/success/setBookings",e.data),t.$router.push({path:"/booking/success"}))})).catch((function(e){t.$toast.error(e.response.message).goAway(1e3),t.working=!1}));case 3:case"end":return e.stop()}}),e)})))()},goBack:function(){this.$emit("input",2)}}}),l=r(10),component=Object(l.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("span",{staticClass:"block text-center text-3xl font-bold mb-6"},[t._v("Payment")]),t._v(" "),r("div",{staticClass:"grid grid-cols-1 sm:grid-cols-2 gap-y-3 mb-6"},[r("div",{staticClass:"leading-6 text-center sm:text-left"},[t._v(t._s(Object.keys(t.selected_slots).length)+" x Sessions with "+t._s(t.therapist.user.full_name))]),t._v(" "),r("div",{staticClass:"flex items-center justify-center sm:justify-end text-2xl font-bold"},[t._v(t._s(t.totals.formatted))])]),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:t.isPaymentRequestAllowed,expression:"isPaymentRequestAllowed"}],attrs:{id:"payment-request-wrapper"}},[t._m(0),t._v(" "),t._m(1)]),t._v(" "),0==t.isPaymentRequestAllowed?r("div",{staticClass:"relative text-center my-6"},[r("span",{staticClass:"absolute z-10 top-1/2 left-0 transform -translate-y-1/2 block w-full h-0.5 bg-gray"}),t._v(" "),r("span",{staticClass:"relative z-20 inline-block px-6 bg-white uppercase"},[t._v("Pay with Card")])]):t._e(),t._v(" "),t.payment_methods.length>0?r("div",{staticClass:"grid grid-cols-1 gap-y-2 mb-6"},t._l(t.payment_methods,(function(e,n){return r("label",{key:n,staticClass:"relative grid grid-cols-2 bg-white border border-black border-opacity-10 py-2 px-3 pl-12 rounded-lg transition cursor-pointer",class:t.selected_payment_method==e.id?"bg-gray":"",attrs:{for:"payment_method-"+n}},[r("input",{directives:[{name:"model",rawName:"v-model",value:t.selected_payment_method,expression:"selected_payment_method"}],staticClass:"hidden",attrs:{type:"radio",name:"payment_methods",id:"payment_method-"+n},domProps:{value:e.id,checked:t._q(t.selected_payment_method,e.id)},on:{change:function(r){t.selected_payment_method=e.id}}}),t._v(" "),r("div",{staticClass:"absolute top-0 left-0.5 w-10 h-full bg-center bg-contain",class:"card-icon-"+e.card.brand}),t._v(" "),r("span",{staticClass:"text-sm"},[t._v(t._s(e.billing_details.name))]),t._v(" "),r("div",{staticClass:"text-sm flex items-center justify-end"},[r("span",{staticClass:"mx-2"},[t._v("****"+t._s(e.card.last4))]),t._v(" "),r("span",{staticClass:"mx-2"},[t._v(t._s(e.card.exp_month)+"/"+t._s(e.card.exp_year))])])])})),0):t._e(),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:null==t.selected_payment_method,expression:"selected_payment_method == null"}]},[r("ValidationObserver",{ref:"paymentForm"},[r("form",{attrs:{role:"form",method:"POST"},on:{submit:function(e){return e.preventDefault(),t.submitForm(e)}}},[r("ValidationProvider",{attrs:{rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.errors;return[r("t-input-group",{attrs:{label:"Name on Card"}},[r("t-input",{attrs:{type:"text",placeholder:"Name on Card"},model:{value:t.card_name,callback:function(e){t.card_name=e},expression:"card_name"}}),t._v(" "),n[0]?r("span",{staticClass:"field-invalid"},[t._v(t._s(n[0]))]):t._e()],1)]}}])}),t._v(" "),r("t-input-group",{attrs:{label:"Card Information"}},[r("div",{staticClass:"px-4 py-4 bg-white border border-black border-opacity-20 rounded-xl",attrs:{id:"card-element"}})]),t._v(" "),r("div",{staticClass:"flex flex-col items-center justify-center sm:px-10"},[r("button",{staticClass:"btn btn-primary btn-small rounded-full w-full sm:w-auto",attrs:{disabled:1==t.working,type:"submit"}},[0==t.working?r("span",[t._v("Pay Now")]):r("span",{staticClass:"flex items-center justify-center"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v(" "),r("span",[t._v("Processing")])])]),t._v(" "),r("button",{staticClass:"mt-6 uppercase text-blue-light text-sm",attrs:{type:"button"},on:{click:t.goBack}},[t._v("Go Back")])])],1)])],1),t._v(" "),t.selected_payment_method?r("div",{staticClass:"flex flex-col items-center justify-center sm:px-10"},[r("button",{staticClass:"mb-2 uppercase text-blue-light text-sm",on:{click:function(e){t.selected_payment_method=null}}},[t._v("Use New Card")]),t._v(" "),r("button",{staticClass:"btn btn-primary btn-small rounded-full w-full sm:w-auto",attrs:{disabled:1==t.working,type:"button"},on:{click:function(e){return t.createPayment(t.selected_payment_method)}}},[0==t.working?r("span",[t._v("Pay Now")]):r("span",{staticClass:"flex items-center justify-center"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v(" "),r("span",[t._v("Processing")])])]),t._v(" "),r("button",{staticClass:"mt-6 uppercase text-blue-light text-sm",attrs:{type:"button"},on:{click:t.goBack}},[t._v("Go Back")])]):t._e(),t._v(" "),r("p",{staticClass:"text-sm text-center mt-6 text-black text-opacity-75"},[t._v("By subscribing to Take a Seat you are agreeing to all site "),r("NuxtLink",{staticClass:"text-blue-light hover:underline",attrs:{to:"/terms-conditions",target:"_blank"}},[t._v("Terms and Conditions")]),t._v(". Please read carefully before continuing.")],1)])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"w-full flex items-center justify-center mb-8"},[e("div",{staticClass:"w-full",attrs:{id:"payment-request-button"}})])},function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"relative text-center my-6"},[r("span",{staticClass:"absolute z-10 top-1/2 left-0 transform -translate-y-1/2 block w-full h-0.5 bg-gray"}),t._v(" "),r("span",{staticClass:"relative z-20 inline-block px-6 bg-white uppercase"},[t._v("Or Pay with Card")])])}],!1,null,null,null);e.default=component.exports},500:function(t,e,r){"use strict";r.r(e);r(28),r(47),r(27),r(48);var n=r(0),o=r(13),l=r(25);r(3),r(214),r(31),r(30),r(60),r(53),r(61);function c(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(object);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,r)}return e}function d(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?c(Object(source),!0).forEach((function(e){Object(o.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):c(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}var m={head:function(){return{titleTemplate:"Book "+this.full_name+" | %s"}},data:function(){return{step:1,isLoaded:!0,loading:!1,working:!1,timer:null,minDate:null,maxDate:null,availability:{},available_dates:[],selected_dates:[],selected_slots:{}}},computed:{is_logged_in:function(){return this.$auth.loggedIn},therapist:function(){return this.$store.state.booking.therapist},full_name:function(){return this.therapist.user.full_name},isSlotSelected:function(){for(var object=this.selected_slots,t=0,e=Object.entries(object);t<e.length;t++){var r=Object(l.a)(e[t],2),n=(r[0],r[1]);if(null!==n.slot&&null!==n.session_id&&null!==n.product_id)return!0}return!1},selectedSlots:function(){var t=this.selected_slots;return Object.keys(t).filter((function(e){return null!==t[e].slot&&null!==t[e].session_id&&null!==t[e].product_id})).reduce((function(e,r){return d(d({},e),{},Object(o.a)({},r,t[r]))}),{})}},mounted:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.$route.query,r=new Date,t.minDate=t.$moment(r).add(1,"days").format("Y-MM-DD"),e.next=5,t.$axios.post("/availability/"+t.therapist.id,{dates:t.selected_dates}).then((function(e){t.loading=!1,t.availability=e.data.availability,t.available_dates=e.data.available_dates,t.minDate=t.available_dates[0],t.maxDate=t.available_dates[t.available_dates.length-1],t.selected_dates=[t.available_dates[0]]})).catch((function(e){t.loading=!1,t.$toast.error(e).goAway(3e3)}));case 5:case"end":return e.stop()}}),e)})))()},asyncData:function(t){return Object(n.a)(regeneratorRuntime.mark((function e(){var r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.store,n=t.params,e.next=3,r.dispatch("booking/get",n.slug);case 3:case"end":return e.stop()}}),e)})))()},methods:{changeDates:function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout((function(){t.getTimes()}),250)},changeTimeSlot:function(t,slot){this.selected_slots[t].session_types=slot.session_types,null!==slot.address&&(this.selected_slots[t].address=slot.address,this.selected_slots[t].address_id=slot.address.id)},getTimes:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.$route.query,t.loading=!0,e.next=4,t.$axios.post("/availability/"+t.therapist.id,{dates:t.selected_dates}).then((function(e){t.loading=!1,t.availability=e.data.availability,t.available_dates=e.data.available_dates,t.selected_slots=e.data.selected_slots,t.minDate=t.available_dates[0],t.maxDate=t.available_dates[t.available_dates.length-1],1==t.isLoaded&&void 0!==r.time&&void 0!==r.date&&(t.selected_slots[r.date].slot=r.time,t.selected_slots[r.date].product_id=t.therapist.products[0].id,t.availability[r.date][0].address&&(t.selected_slots[r.date].address_id=t.availability[r.date][0].address.id,t.selected_slots[r.date].address=t.availability[r.date][0].address),t.availability[r.date][0].session_types&&(t.selected_slots[r.date].session_types=t.availability[r.date][0].session_types,t.selected_slots[r.date].session_id=t.availability[r.date][0].session_types[0].id),t.isLoaded=!1)})).catch((function(e){t.loading=!1,t.$toast.error(e).goAway(3e3)}));case 4:case"end":return e.stop()}}),e)})))()},getSummary:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.$refs.bookingStepOne.validate().then((function(e){e&&(t.step=2)}));case 1:case"end":return e.stop()}}),e)})))()},getPaymentStep:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:0==t.is_logged_in?t.step=3:t.step=4;case 1:case"end":return e.stop()}}),e)})))()},getDisabledDates:function(t){var e=this.$moment(t).format("Y-MM-DD");return!this.available_dates.includes(e)}}},_=r(10),component=Object(_.a)(m,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"page-wrapper"},[r("div",{staticClass:"py-10 sm:py-20 bg-white"},[r("div",{staticClass:"relative z-20 text-center"},[r("figure",{staticClass:"relative inline-block w-32 mb-4 sm:mb-8"},[r("div",{staticClass:"absolute top-0 left-0 w-full h-full border-15",class:"tas-border-"+t.therapist.colour}),t._v(" "),r("img",{staticClass:"block w-full",attrs:{src:t.therapist.user.photo_url,alt:t.therapist.user.first_name}})]),t._v(" "),r("h1",[r("span",{staticClass:"block w-full text-5xl md:text-7xl leading-none "},[t._v(t._s(t.therapist.user.first_name))]),t._v(" "),r("span",{staticClass:"block w-full uppercase text-2xl"},[t._v(t._s(t.therapist.user.last_name))])])])]),t._v(" "),r("div",{staticClass:"bg-gray px-4 py-6 sm:py-10 sm:px-8 md:py-20"},[r("div",{staticClass:"max-w-lg w-full mx-auto"},[r("div",{staticClass:"py-8 px-6 sm:py-12 sm:px-16 rounded-xl bg-white"},[1==t.step?[r("ValidationObserver",{ref:"bookingStepOne"},[r("form",{attrs:{role:"form",method:"POST"},on:{submit:function(e){return e.preventDefault(),t.summaryStep(e)}}},[r("span",{staticClass:"block text-center text-3xl font-bold mb-6"},[t._v("Your Session")]),t._v(" "),r("t-calendar",{attrs:{multiple:"",minDate:t.minDate,maxDate:t.maxDate,yearsPerView:1,disabledDates:t.getDisabledDates,inline:""},on:{"user-date-changed":t.changeDates},model:{value:t.selected_dates,callback:function(e){t.selected_dates=e},expression:"selected_dates"}}),t._v(" "),r("div",{staticClass:"mb-6"},[r("span",{staticClass:"block font-bold mb-3"},[t._v("Select time")]),t._v(" "),1==t.loading?r("div",{staticClass:"flex items-center justify-center"},[r("svg",{staticClass:"animate-spin -ml-1 mr-3 h-5 w-5 text-current",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"}},[r("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),r("path",{staticClass:"opacity-75",attrs:{fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"}})]),t._v("\n                  Loading Times...\n                ")]):0!==t.availability.length||null==t.availability.length?r("div",t._l(t.availability,(function(e,n){return r("div",{key:n,staticClass:"mb-3"},[e.length>0?[r("span",{staticClass:"block mb-2 font-bold"},[t._v(t._s(t.$moment(n).format("DD/MM/Y")))]),t._v(" "),r("div",{staticClass:"grid grid-cols-2 sm:grid-cols-3 gap-3"},t._l(e,(function(slot,e){return r("label",{key:e,staticClass:"border border-black px-3 py-2 rounded-md cursor-pointer text-center text-sm",class:t.selected_slots[n].slot==slot.start?"bg-yellow":""},[r("input",{directives:[{name:"model",rawName:"v-model",value:t.selected_slots[n].slot,expression:"selected_slots[key].slot"}],staticClass:"hidden",attrs:{type:"radio",id:"times-"+e,name:"times-"+e},domProps:{value:slot.start,checked:t._q(t.selected_slots[n].slot,slot.start)},on:{change:[function(e){return t.$set(t.selected_slots[n],"slot",slot.start)},function(e){return t.changeTimeSlot(n,slot)}]}}),t._v("\n                          "+t._s(t.$moment.utc(slot.start).format("H:mm"))+"\n                        ")])})),0),t._v(" "),r("div",{staticClass:"mt-4 mb-6"},[r("span",{staticClass:"block text-sm font-bold mb-2"},[t._v("Session type")]),t._v(" "),t.selected_slots[n].session_types?r("div",{staticClass:"grid grid-cols-2 sm:grid-cols-3 gap-3 mb-3"},t._l(t.selected_slots[n].session_types,(function(e,o){return r("label",{key:o,staticClass:"border border-black px-3 py-2 rounded-md cursor-pointer text-center text-sm",class:e.id==t.selected_slots[n].session_id?"bg-yellow":""},[r("input",{directives:[{name:"model",rawName:"v-model",value:t.selected_slots[n].session_id,expression:"selected_slots[key].session_id"}],staticClass:"hidden",attrs:{type:"radio",name:"session-"+n},domProps:{value:e.id,checked:t._q(t.selected_slots[n].session_id,e.id)},on:{change:function(r){return t.$set(t.selected_slots[n],"session_id",e.id)}}}),t._v("\n                            "+t._s(e.name)+"\n                          ")])})),0):r("div",[r("p",[t._v("No session types available.")])]),t._v(" "),3==t.selected_slots[n].session_id&&t.selected_slots[n].address&&"Personal"!==t.selected_slots[n].address.address_type?r("div",{staticClass:"relative pl-10 mb-3 px-3 py-2 text-sm leading-5 rounded bg-blue text-white"},[r("svg",{staticClass:"absolute top-2 left-3 w-5 h-5",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"}},[r("path",{attrs:{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"}})]),t._v(" "),r("span",[t._v("This session will be at: "+t._s(t.selected_slots[n].address.formatted))])]):t._e(),t._v(" "),r("t-radio-group",{attrs:{classes:{groupWrapper:"grid grid-cols-2 sm:grid-cols-3 gap-3",label:"block pl-2.5",input:"rounded-md w-5 h-5 text-black transition duration-100 ease-in-out border-gray-300 shadow-sm focus:border-black focus:ring-2 focus:ring-black focus:outline-none focus:ring-opacity-50 focus:ring-offset-0  disabled:opacity-50 disabled:cursor-not-allowed",inputWrapper:"inline-flex",wrapper:"flex items-center my-1"},textAttribute:"type",valueAttribute:"id",name:"product-"+n,options:t.therapist.products},model:{value:t.selected_slots[n].product_id,callback:function(e){t.$set(t.selected_slots[n],"product_id",e)},expression:"selected_slots[key].product_id"}})],1)]:[r("span",{staticClass:"block mb-2 text-sm font-bold"},[t._v(t._s(t.$moment(n).format("DD/MM/Y")))]),t._v(" "),r("p",[t._v("No availability for this day")])]],2)})),0):r("div",[r("p",[t._v("No availability found")])])]),t._v(" "),r("div",{staticClass:"mt-6 flex items-center justify-center"},[r("button",{staticClass:"btn btn-primary btn-small rounded-full w-full sm:w-auto",attrs:{disabled:0==t.isSlotSelected,type:"button"},on:{click:t.getSummary}},[t._v("Next")])])],1)])]:t._e(),t._v(" "),2==t.step?r("SummaryStep",{attrs:{selected_slots:t.selectedSlots,working:t.working,nextStep:t.getPaymentStep,button_text:"Proceed to Payment"},model:{value:t.step,callback:function(e){t.step=e},expression:"step"}}):t._e(),t._v(" "),3==t.step?r("RegisterStep",{model:{value:t.step,callback:function(e){t.step=e},expression:"step"}}):t._e(),t._v(" "),4==t.step?r("PaymentStep",{attrs:{selected_slots:t.selectedSlots},model:{value:t.step,callback:function(e){t.step=e},expression:"step"}}):t._e()],2)])])])}),[],!1,null,null,null);e.default=component.exports;installComponents(component,{SummaryStep:r(409).default,RegisterStep:r(439).default,PaymentStep:r(440).default})}}]);

Zerion Mini Shell 1.0