{"version":3,"sources":["webpack:///./src/views/Subscription/Cancelconfirmation.vue?2770","webpack:///./src/views/Subscription/Cancelconfirmation.vue","webpack:///./src/views/Subscription/Cancelconfirmation.vue?e0c0","webpack:///./src/views/Subscription/Cancelconfirmation.vue?b05e","webpack:///./src/util/formatDate.ts"],"names":["render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","currentStateIs","states","INITIAL","isCancelledAndReadyToEnroll","_s","getCancellationDate","attrs","on","onSubmitAndEnroll","_e","onSubmit","onCancel","LOADING","COMPLETE","formatDate","processDate","$event","navigateToRegistrationFlow","undefined","$router","replace","name","ERROR","staticRenderFns","ConfirmCancellation","_mixins","_inherits","_super","_createSuper","_this","_classCallCheck","call","_createClass","key","get","$store","state","currentUser","cancel","cancellation","cancellationInfo","cancelReasonId","CancelReasonId","ChangeSportLocation","value","_this$currentUser$pro","projectInformation","registrationFlowLoginUri","_this$currentUser$pro2","win","window","open","focus","cancellationDate","push","query","aborted","_this$currentUser$sub","_this2","api","SubscriptionApi","fields","subscriptionId","subscription","uploadGuid","cancelUploadGuid","explanation","cancelExplanation","subscriptionCancelSubscription","then","data","Date","catch","_this$currentUser$sub2","_this3","mixins","State","__decorate","Component","components","Toolbar","Content","FormButton","methods","component","date","objDate","getFullYear","months","concat","getDate","getMonth"],"mappings":"yHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACE,YAAY,sBAAsB,CAACF,EAAG,UAAU,CAACA,EAAG,KAAK,CAACJ,EAAIO,GAAG,2BAA4BP,EAAIQ,eAAeR,EAAIS,OAAOC,WAAaV,EAAIW,4BAA6BP,EAAG,UAAU,CAACA,EAAG,KAAK,CAACJ,EAAIO,GAAG,yDAAyDH,EAAG,IAAI,CAACJ,EAAIO,GAAG,2CAA2CH,EAAG,IAAI,CAACJ,EAAIO,GAAGP,EAAIY,GAAGZ,EAAIa,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,GAET,IAAMC,EAAS,CACb,UACA,WACA,QACA,QACA,MACA,OACA,OACA,WACA,YACA,UACA,WACA,YAEF,MAAO,GAAPC,OAAUH,EAAQI,UAAS,KAAAD,OAAID,EAAOF,EAAQK,YAAW,KAAAF,OAAIH,EAAQC","file":"js/chunk-673a2656.1c2e1b25.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"view-view--toolbar\"},[_c('Toolbar',[_c('h2',[_vm._v(\"Abonnement opzeggen\")])]),(_vm.currentStateIs(_vm.states.INITIAL) && !_vm.isCancelledAndReadyToEnroll)?_c('Content',[_c('h2',[_vm._v(\"Weet je zeker dat je jouw abonnement wilt opzeggen?\")]),_c('p',[_vm._v(\" Je bedrijfsfitness abonnement kan per \"),_c('b',[_vm._v(_vm._s(_vm.getCancellationDate()))]),_vm._v(\" opgezegd worden. (hieronder bevestigen) \")]),(_vm.isChangingSportLocation)?_c('FormButton',{attrs:{\"caption\":'Abonnement opzeggen + nieuwe sportlocatie zoeken'},on:{\"click\":_vm.onSubmitAndEnroll}}):_vm._e(),_c('FormButton',{attrs:{\"caption\":'Abonnement opzeggen'},on:{\"click\":_vm.onSubmit}}),_c('FormButton',{staticClass:\"cancel--subscription--button\",attrs:{\"caption\":'Annuleren'},on:{\"click\":_vm.onCancel}})],1):_vm._e(),(_vm.currentStateIs(_vm.states.LOADING))?_c('Loader'):_vm._e(),(_vm.currentStateIs(_vm.states.COMPLETE) === true && _vm.isCancelledAndReadyToEnroll)?[_c('Content',[_c('h2',[_vm._v(\"Je abonnement wordt opgezegd\")]),_c('p',[_vm._v(\" Je abonnement wordt door ons opgezegd en eindigt op \"),_c('b',[_vm._v(_vm._s(_vm.getCancellationDate()))]),_vm._v(\". Een maand voor de door jou gekozen einddatum ontvang je van ons de bevestiging van de opzegging per e-mail. \")]),_c('p',[_vm._v(\" Je hebt tot \"),_c('b',[_vm._v(_vm._s(_vm.formatDate(_vm.processDate)))]),_vm._v(\" de tijd om je opzegging ongedaan te maken. Ga daarvoor opnieuw naar deze pagina. \")]),_c('FormButton',{attrs:{\"caption\":'Nieuwe sportlocatie zoeken'},on:{\"click\":function($event){return _vm.navigateToRegistrationFlow()}}})],1)]:_vm._e(),(_vm.currentStateIs(_vm.states.COMPLETE) === true && !_vm.isCancelledAndReadyToEnroll && _vm.processDate !== undefined)?[_c('Content',[_c('h2',[_vm._v(\"Je abonnement wordt opgezegd\")]),_c('p',[_vm._v(\" Je abonnement wordt door ons opgezegd en eindigt op \"),_c('b',[_vm._v(_vm._s(_vm.getCancellationDate()))]),_vm._v(\". Een maand voor de door jou gekozen einddatum ontvang je van ons de bevestiging van de opzegging per e-mail. \")]),_c('p',[_vm._v(\" Je hebt tot \"),_c('b',[_vm._v(_vm._s(_vm.formatDate(_vm.processDate)))]),_vm._v(\" de tijd om je opzegging ongedaan te maken. Ga daarvoor opnieuw naar deze pagina. \")]),_c('FormButton',{attrs:{\"caption\":'Naar overzicht'},on:{\"click\":function($event){return _vm.$router.replace({ name: 'users' })}}})],1)]:_vm._e(),(_vm.currentStateIs(_vm.states.COMPLETE) === true && !_vm.isCancelledAndReadyToEnroll && _vm.processDate === undefined)?[_c('Content',[_c('h2',[_vm._v(\"Je abonnement wordt opgezegd\")]),_c('p',[_vm._v(\" We hebben je opzegging ontvangen en zullen dit zo snel mogelijk verwerken. \")]),_c('FormButton',{attrs:{\"caption\":'Naar overzicht'},on:{\"click\":function($event){return _vm.$router.replace({ name: 'users' })}}})],1)]:_vm._e(),(_vm.currentStateIs(_vm.states.ERROR) === true)?[_c('Content',[_c('h2',[_vm._v(\"Er is iets mis gegaan bij het opzeggen\")]),_c('p',[_vm._v(\" We hebben geprobeerd je opzegging te verwerken maar daarbij is een fout opgetreden. Probeer het nogmaals. Als het probleem zich blijft voordoen neem dan contact op met de BFNL helpdesk via het \"),_c('router-link',{staticClass:\"link\",attrs:{\"to\":{ name: 'help'}}},[_c('span',[_vm._v(\"contactformulier\")])]),_vm._v(\". \")],1),_c('FormButton',{attrs:{\"caption\":'Naar overzicht'},on:{\"click\":function($event){return _vm.$router.replace({ name: 'users' })}}})],1)]:_vm._e()],2)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\n\r\nimport Component, { mixins } from 'vue-class-component'\r\nimport { State } from '@/mixins/state'\r\nimport Content from '@/components/Content.vue'\r\nimport Toolbar from '@/components/Layout/Toolbar.vue'\r\nimport FormButton from '@/components/Form/Button.vue'\r\nimport { Cancellation, User } from '@/types'\r\nimport { formatDate } from '@/util/formatDate'\r\n\r\nimport {\r\n SubscriptionApi,\r\n CancelSubscriptionCommand,\r\n CancelReasonId\r\n} from '@/api'\r\n\r\n@Component({\r\n components: {\r\n Toolbar,\r\n Content,\r\n FormButton\r\n },\r\n methods: {\r\n formatDate\r\n }\r\n})\r\nexport default class ConfirmCancellation extends mixins(State) {\r\n processDate: Date | undefined\r\n isCancelledAndReadyToEnroll: boolean\r\n\r\n get currentUser (): User {\r\n return this.$store.state.currentUser\r\n }\r\n\r\n get cancellationInfo (): Cancellation {\r\n return this.$store.state.cancel.cancellation\r\n }\r\n\r\n get isChangingSportLocation (): boolean {\r\n return this.cancellationInfo.cancelReasonId === CancelReasonId.ChangeSportLocation\r\n }\r\n\r\n public navigateToRegistrationFlow () {\r\n // Link the user to the registrationFlow so they can select thier new sportlocation.\r\n if (this.currentUser.projectInformation?.registrationFlowLoginUri) {\r\n const win = window.open(this.currentUser.projectInformation?.registrationFlowLoginUri, '_blank')\r\n if (win) {\r\n win.focus()\r\n }\r\n }\r\n this.$router.replace({ name: 'users' })\r\n }\r\n\r\n constructor () {\r\n super()\r\n this.isCancelledAndReadyToEnroll = false\r\n }\r\n\r\n public getCancellationDate () {\r\n return formatDate(this.cancellationInfo.cancellationDate)\r\n }\r\n\r\n public onCancel () {\r\n this.$router.push({\r\n name: 'subscriptionCancel',\r\n query: {\r\n aborted: 'true'\r\n }\r\n })\r\n }\r\n\r\n public getState () {\r\n return this.state\r\n }\r\n\r\n public onSubmitAndEnroll () {\r\n const api = new SubscriptionApi()\r\n const cancellationInfo = this.cancellationInfo\r\n const fields: CancelSubscriptionCommand = {\r\n subscriptionId: this.currentUser.subscription?.subscriptionId || 0,\r\n cancellationDate: cancellationInfo.cancellationDate,\r\n cancelReasonId: cancellationInfo.cancelReasonId,\r\n uploadGuid: cancellationInfo.cancelUploadGuid,\r\n explanation: cancellationInfo.cancelExplanation\r\n }\r\n\r\n api.subscriptionCancelSubscription(fields)\r\n .then((data) => {\r\n this.processDate = data.data ? new Date(data.data) : undefined\r\n this.isCancelledAndReadyToEnroll = true\r\n this.state = this.states.COMPLETE\r\n })\r\n .catch(() => {\r\n this.processDate = undefined\r\n this.state = this.states.ERROR\r\n })\r\n }\r\n\r\n public onSubmit () {\r\n const api = new SubscriptionApi()\r\n const cancellationInfo = this.cancellationInfo\r\n const fields: CancelSubscriptionCommand = {\r\n subscriptionId: this.currentUser.subscription?.subscriptionId || 0,\r\n cancellationDate: cancellationInfo.cancellationDate,\r\n cancelReasonId: cancellationInfo.cancelReasonId,\r\n uploadGuid: cancellationInfo.cancelUploadGuid,\r\n explanation: cancellationInfo.cancelExplanation\r\n }\r\n this.state = this.states.LOADING\r\n\r\n api.subscriptionCancelSubscription(fields)\r\n .then((data) => {\r\n this.processDate = data.data ? new Date(data.data) : undefined\r\n this.state = this.states.COMPLETE\r\n })\r\n .catch(() => {\r\n this.processDate = undefined\r\n this.state = this.states.ERROR\r\n })\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Cancelconfirmation.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Cancelconfirmation.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./Cancelconfirmation.vue?vue&type=template&id=2f53d425&\"\nimport script from \"./Cancelconfirmation.vue?vue&type=script&lang=ts&\"\nexport * from \"./Cancelconfirmation.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","export function formatDate (date: string) {\r\n if (date === '') {\r\n return date\r\n }\r\n\r\n const objDate = new Date(date)\r\n if (!objDate) {\r\n return date\r\n }\r\n if (objDate.getFullYear() === 1) {\r\n return ''\r\n }\r\n const months = [\r\n 'januari',\r\n 'februari',\r\n 'maart',\r\n 'april',\r\n 'mei',\r\n 'juni',\r\n 'juli',\r\n 'augustus',\r\n 'september',\r\n 'oktober',\r\n 'november',\r\n 'december'\r\n ]\r\n return `${objDate.getDate()} ${months[objDate.getMonth()]} ${objDate.getFullYear()}`\r\n}\r\n"],"sourceRoot":""}