%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/864661c.js

(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{403:function(t,e,n){var content=n(415);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(34).default)("ce03f3c6",content,!0,{sourceMap:!1})},414:function(t,e,n){"use strict";n(403)},415:function(t,e,n){var r=n(33)((function(i){return i[1]}));r.push([t.i,".modal[data-v-7d8d7028]{padding-top:20vh}",""]),t.exports=r},427:function(t,e,n){"use strict";n.r(e);var r=n(0),o=(n(60),n(3),{props:{value:{required:!0}},data:function(){return{isActive:!1,working:!1,card:{},selected_card:null,card_name:null,discount_code:""}},computed:{setup_intent:function(){return this.$store.state.account.billing.setupIntent},payment_methods:function(){return this.$store.state.account.billing.paymentMethods},default_payment_method:function(){return this.$store.state.account.billing.defaultPaymentMethod},subscription:function(){return this.$store.state.account.subscription.subscription}},mounted:function(){var t=this.$stripe.elements();this.$store.dispatch("account/billing/setupIntent"),this.card=t.create("card",{style:{base:{fontSize:"15px",fontFamily:"Poppins, sans-serif"}}}),this.card.mount("#subscription-card-element")},methods:{closeModal:function(){this.$emit("input",!this.value)},submitForm:function(){var t=this;this.$refs.paymentForm.validate().then((function(e){e&&t.submitCard()}))},submitCard:function(){var t=this;return Object(r.a)(regeneratorRuntime.mark((function e(){var n,r,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null===t.setup_intent){e.next=8;break}return t.working=!0,e.next=4,t.$stripe.confirmCardSetup(t.setup_intent,{payment_method:{card:t.card,billing_details:{name:t.card_name}}});case 4:n=e.sent,r=n.setupIntent,(o=n.error)?(t.$toast.error(o.message).goAway(3e3),t.$store.dispatch("account/billing/setupIntent"),t.working=!1):t.subscription?t.saveCard(r.payment_method):t.startSubscription(r.payment_method);case 8:case"end":return e.stop()}}),e)})))()},startSubscription:function(t){var e=this;return Object(r.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.working=!0,1!=e.working){n.next=4;break}return n.next=4,e.$store.dispatch("account/subscription/startSubscription",{payment_method:t,discount_code:e.discount_code}).then((function(){e.$store.dispatch("account/subscription/getSubscription"),e.$store.dispatch("account/progress/get",{slug:"financial"}),e.$toast.success("Successfully started your subscription!").goAway(3e3),e.$emit("input",!1),e.working=!1})).catch((function(t){e.$store.dispatch("account/billing/setupIntent"),e.working=!1,e.$toast.error(t.response.data).goAway(3e3)}));case 4:case"end":return n.stop()}}),n)})))()},saveCard:function(t){var e=this;return Object(r.a)(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,e.$store.dispatch("account/billing/savePaymentMethod",{payment_method:t,discount_code:e.discount_code}).then((function(){e.$store.dispatch("account/subscription/getSubscription"),e.$toast.success("Successfully updated your subscription!").goAway(3e3),e.$emit("input",!1),e.working=!1})).catch((function(t){e.working=!1}));case 2:case"end":return n.stop()}}),n)})))()}},watch:{value:function(){var t=this;1==this.value?setTimeout((function(){t.isActive=!0}),100):setTimeout((function(){t.isActive=!1}),100)}}}),c=(n(414),n(10)),component=Object(c.a)(o,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{directives:[{name:"show",rawName:"v-show",value:1==t.value,expression:"value == true"}],staticClass:"modal fixed z-50 bottom-0 left-0 w-full h-screen"},[n("div",{staticClass:"absolute z-10 top-0 left-0 w-full h-full bg-black bg-opacity-25 cursor-pointer transition duration-100",class:1==t.isActive?"opacity-100":"opacity-0",on:{click:t.closeModal}}),t._v(" "),n("div",{staticClass:"relative z-20 h-full bg-white shadow-lg p-10 pt-16 transition transform duration-100",class:1==t.isActive?"translate-y-0 opacity-100":"translate-y-full opacity-0"},[n("button",{staticClass:"absolute top-6 right-10 uppercase hover:text-blue-light focus:outline-none transition",attrs:{type:"button"},on:{click:t.closeModal}},[t._v("Close")]),t._v(" "),n("div",{staticClass:"relative h-full bg-gray p-8 overflow-y-auto"},[n("div",{staticClass:"max-w-lg w-full mx-auto"},[t.subscription?n("h2",{staticClass:"mb-8 text-center text-4xl font-bold"},[t._v("Update Card Details")]):n("h2",{staticClass:"mb-8 text-center text-4xl font-bold"},[t._v("Your Card Details")]),t._v(" "),t.payment_methods.length?n("div",{staticClass:"grid grid-cols-1 gap-y-2 mb-6"},[t._l(t.payment_methods,(function(e,r){return n("label",{key:r,staticClass:"flex items-center py-3 px-4 cursor-pointer bg-white rounded-lg"},[n("input",{directives:[{name:"model",rawName:"v-model",value:t.selected_card,expression:"selected_card"}],attrs:{type:"radio"},domProps:{value:e.id,checked:t._q(t.selected_card,e.id)},on:{change:function(n){t.selected_card=e.id}}}),t._v(" "),n("span",{class:"icon-"+e.card.brand}),t._v(" "),n("span",{staticClass:"px-2"},[t._v("****"+t._s(e.card.last4))]),t._v(" "),n("span",{staticClass:"px-2"},[t._v(t._s(e.card.exp_month+"/"+e.card.exp_year))])])})),t._v(" "),t._m(0),t._v(" "),t.selected_card?n("div",{staticClass:"text-center"},[n("button",{staticClass:"text-blue-light uppercase",on:{click:function(e){t.selected_card=null}}},[t._v("Add New Card")])]):t._e()],2):t._e(),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:null==t.selected_card,expression:"selected_card == null"}]},[n("ValidationObserver",{ref:"paymentForm"},[n("form",{attrs:{role:"form",method:"POST"},on:{submit:function(e){return e.preventDefault(),t.submitForm(e)}}},[n("ValidationProvider",{attrs:{rules:"required"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.errors;return[n("t-input-group",{attrs:{label:"Name on Card"}},[n("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(" "),r[0]?n("span",{staticClass:"field-invalid"},[t._v(t._s(r[0]))]):t._e()],1)]}}])}),t._v(" "),n("t-input-group",{attrs:{label:"Card Information"}},[n("div",{staticClass:"px-4 py-4 bg-white border border-black border-opacity-20 rounded-xl",attrs:{id:"subscription-card-element"}})]),t._v(" "),n("t-input-group",{attrs:{label:"Discount Code"}},[n("t-input",{attrs:{type:"text"},model:{value:t.discount_code,callback:function(e){t.discount_code=e},expression:"discount_code"}})],1),t._v(" "),n("div",{staticClass:"flex items-center justify-center px-10"},[n("button",{staticClass:"w-full btn btn-primary btn-small rounded-full",attrs:{disabled:1==t.working,type:"submit"}},[0==t.working?n("div",[t._v("Submit")]):n("span",{staticClass:"flex items-center justify-center"},[n("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"}},[n("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),n("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("span",[t._v("Processing")])])])]),t._v(" "),n("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 "),n("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)],1)])],1),t._v(" "),t.selected_card?n("div",[n("div",{staticClass:"flex items-center justify-center px-10"},[n("button",{staticClass:"w-full btn btn-primary btn-small rounded-full",attrs:{disabled:1==t.working,type:"button"},on:{click:function(e){null!==t.subscription?t.saveCard(t.selected_card):t.startSubscription(t.selected_card)}}},[0==t.working?n("div",[t._v("Submit")]):n("span",{staticClass:"flex items-center justify-center"},[n("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"}},[n("circle",{staticClass:"opacity-25",attrs:{cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}}),t._v(" "),n("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("span",[t._v("Processing")])])])])]):t._e()])])])])}),[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"relative text-center my-6"},[n("span",{staticClass:"absolute z-10 top-1/2 left-0 transform -translate-y-1/2 block w-full h-0.5 w-full bg-black bg-opacity-10"}),t._v(" "),n("span",{staticClass:"relative z-20 inline-block px-6 bg-gray uppercase"},[t._v("Or add new Card")])])}],!1,null,"7d8d7028",null);e.default=component.exports}}]);

Zerion Mini Shell 1.0