{"version":3,"sources":["webpack:///./node_modules/core-js/modules/es.object.values.js","webpack:///./src/views/TellAFriend/TellAFriend.vue?4c65","webpack:///./src/views/TellAFriend/TellAFriend.vue","webpack:///./src/views/TellAFriend/TellAFriend.vue?3ec4","webpack:///./src/views/TellAFriend/TellAFriend.vue?85d4","webpack:///./src/views/TellAFriend/TellAFriend.vue?a6fe"],"names":["$","$values","values","target","stat","O","render","_vm","this","_h","$createElement","_c","_self","staticClass","_v","currentStateIs","states","LOADING","_e","ERROR","COMPLETE","_s","currentUser","projectInformation","name","tellAFriendCode","attrs","on","$event","emailToSelf","shareLink","onWhatsappClick","employeeDetails","fullName","address","postalCode","city","phonePersonal","staticRenderFns","TellAFriend","_mixins","_inherits","_super","_createSuper","_this","_classCallCheck","undefined","sentEmail","inputFields","gift","value","required","inline","type","options","label","TellAFriendGift","Towel","image","GymBag","WaterBottle","placeholder","errors","hasDirtyInput","_createClass","key","get","$store","state","subscription","_emailToSelf","_asyncToGenerator","_regeneratorRuntime","mark","_callee","_this$currentUser$sub","api","fields","wrap","_context","prev","next","$gtag","event","event_category","TellAFriendApi","subscriptionId","tellAFriendShareCodeByEmailToSelf","t0","stop","apply","arguments","_updateGift","_callee2","_context2","clearErrors","validateInput","abrupt","tellAFriendUpdateGift","setErrors","response","data","$root","$emit","updateGift","_this2","Object","entries","forEach","_ref","_ref2","_slicedToArray","errorKey","errorValue","_ref3","_ref4","fieldKey","fieldValue","toLowerCase","_this3","valid","keys","input","Array","isArray","$refs","validate","hasError","length","_this$currentUser$sub2","_this4","setState","tellAFriendGetTellAFriendCode","then","_this4$currentUser$pr","_this4$currentUser$em","encodedLink","encodeURIComponent","registrationFlowLoginUri","replace","concat","firstName","catch","mixins","State","__decorate","Component","components","Content","Toolbar","FormInput","FormButton","component"],"mappings":"qGAAA,IAAIA,EAAI,EAAQ,QACZC,EAAU,EAAQ,QAAgCC,OAItDF,EAAE,CAAEG,OAAQ,SAAUC,MAAM,GAAQ,CAClCF,OAAQ,SA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oBAAoBP,EAAKzG,gBAAgBiH,0BAA4B,IAAIC,QAAQ,QAAS,MAC9GT,EAAKpG,UAAY,kKAAH8G,OACEH,oBAAsD,QAAnCH,EAAAJ,EAAK5G,YAAYC,0BAAkB,IAAA+G,OAAA,EAAnCA,EAAqC9G,OAAQ,IAAG,gPAAAoH,OAA+OJ,EAAW,wEAAAI,OAErUH,oBAAmD,QAAhCF,EAAAL,EAAK5G,YAAYU,uBAAe,IAAAuG,OAAA,EAAhCA,EAAkCM,YAAa,KAC1EX,EAAKC,SAASD,EAAKlH,OAAOI,aAE3B0H,OAAM,WACLZ,EAAKC,SAASD,EAAKlH,OAAOG,cAE/BoB,EApK6B,CAASwG,eAAOC,SAA3BzG,EAAW0G,eAAA,CAR/BC,eAAU,CACTC,WAAY,CACVC,eACAC,eACAC,iBACAC,sBAGiBhH,WC9GmY,I,wBCQpZiH,EAAY,eACd,EACAlJ,EACAgC,GACA,EACA,KACA,WACA,MAIa,aAAAkH,E,6CCnBf","file":"js/chunk-5d70612a.4c3890bd.js","sourcesContent":["var $ = require('../internals/export');\nvar $values = require('../internals/object-to-array').values;\n\n// `Object.values` method\n// https://tc39.es/ecma262/#sec-object.values\n$({ target: 'Object', stat: true }, {\n values: function values(O) {\n return $values(O);\n }\n});\n","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(\"Mijn acties\")])]),_c('Content',[(_vm.currentStateIs(_vm.states.LOADING))?_c('Loader'):_vm._e(),(_vm.currentStateIs(_vm.states.ERROR))?_c('AlertError',[_vm._v(\" Deze actie is nog niet geactiveerd voor jouw account. Dit gebeurt automatisch, dus probeer het over enkele minuten nog eens. \")]):_vm._e(),(_vm.sentEmail)?_c('AlertSuccess',[_vm._v(\" De e-mail is verstuurd, controleer je inbox. \")]):_vm._e(),(_vm.currentStateIs(_vm.states.COMPLETE))?_c('div',[_c('h2',[_vm._v(\"Sporten werkt: spread the word\")]),_c('p',{staticClass:\"paragraph\"},[_vm._v(\" Goed bezig! Dankzij \"+_vm._s(_vm.currentUser.projectInformation.name)+\" werk jij aan je gezondheid. (Fit)ter worden, je hoofd leegmaken, sterker in je schoenen staan… Wat je doelen ook zijn: sporten werkt! Dat fijne gevoel gunnen we iedereen. Daarom hebben we de maand oktober uitgeroepen tot de Sporten Werkt actiemaand! \")]),_c('h3',[_vm._v(\"Maak kans op een sporten werkt rugtas\")]),_c('p',{staticClass:\"paragraph\"},[_vm._v(\"Tijdens de Sporten Werkt actie kan jij jouw collega’s uitnodigen voor bedrijfsfitness met een unieke actiecode. Meldt een collega zich aan met jouw code? Dan ontvang je een sportieve rugtas! \")]),_c('br'),_c('div',{staticClass:\"action-code\"},[_c('h3',[_vm._v(\"Jouw unieke actiecode:\")]),_c('div',{staticClass:\"personal-code\"},[_vm._v(\" \"+_vm._s(_vm.tellAFriendCode.tellAFriendCode)+\" \")]),_c('h3',[_vm._v(\"Let's share!\")]),_c('div',{staticClass:\"share\"},[_c('a',{staticClass:\"share-link\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){_vm.emailToSelf();return false;}}},[_c('font-awesome-icon',{attrs:{\"icon\":['fal', 'envelope']}})],1),_c('a',{staticClass:\"share-link\",attrs:{\"href\":_vm.shareLink,\"target\":\"_blank\"},on:{\"click\":function($event){return _vm.onWhatsappClick()}}},[_c('font-awesome-icon',{attrs:{\"icon\":['fab', 'whatsapp']}})],1)])]),_c('h3',[_vm._v(\"Zo doe je mee aan de share actie\")]),_c('p',{staticClass:\"paragraph\"},[_vm._v(\" Via de deelopties hierboven kan je jouw unieke actiecode, inclusief uitleg voor jouw collega’s, naar jezelf mailen of Whatsappen. Vanuit daar is het heel eenvoudig delen. Door de actiecode te delen, ga je akkoord met de \"),_c('a',{staticClass:\"link\",attrs:{\"href\":\"https://www.mijnbfnl.nl/websites/implementatie/mediadepot/7434e0b8ebad.pdf\",\"target\":\"_blank\",\"rel\":\"noopener noreferrer\"}},[_vm._v(\"actievoorwaarden\")]),_vm._v(\". \")]),_c('p',{staticClass:\"paragraph\"},[_c('img',{attrs:{\"src\":\"action/banner-sportenwerkt-2023-win.png\",\"alt\":\"Rugzak\"}})]),_c('h3',[_vm._v(\"Zijn je gegevens nog actueel?\")]),_c('p',{staticClass:\"paragraph\"},[_vm._v(\" Mocht jij een rugtas bemachtigen, dan sturen we die rond december naar je thuisadres. We doen daarom een controle op de gegevens die bij ons bekend zijn: \"),_c('strong',[_vm._v(_vm._s(_vm.currentUser.employeeDetails.fullName)+\", \"+_vm._s(_vm.currentUser.employeeDetails.address)+\" \"+_vm._s(_vm.currentUser.employeeDetails.postalCode)+\" \"+_vm._s(_vm.currentUser.employeeDetails.city)+\", \"+_vm._s(_vm.currentUser.employeeDetails.phonePersonal))]),_vm._v(\". Kloppen de gegevens niet (meer)? Geef dan een wijziging aan ons door \"),_c('router-link',{staticClass:\"link\",attrs:{\"to\":{ name: 'detailEdit' }}},[_vm._v(\" Gegevens wijzigen. \")])],1)]):_vm._e()],1)],1)}\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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport Component, { mixins } from 'vue-class-component'\r\nimport { State } from '@/mixins/state'\r\n\r\nimport { User } from '@/types'\r\nimport { ShareCodeByEmailToSelfCommand, TellAFriendApi, TellAFriendCodeDto, TellAFriendGift, UpdateGiftCommand } from '@/api'\r\nimport Content from '@/components/Content.vue'\r\nimport Toolbar from '@/components/Layout/Toolbar.vue'\r\nimport FormInput, { InputField } from '@/components/Form/Input.vue'\r\nimport FormButton from '@/components/Form/Button.vue'\r\n\r\ninterface InputFields {\r\n gift: InputField;\r\n}\r\n\r\n@Component({\r\n components: {\r\n Content,\r\n Toolbar,\r\n FormInput,\r\n FormButton\r\n }\r\n})\r\nexport default class TellAFriend extends mixins(State) {\r\n public tellAFriendCode: TellAFriendCodeDto|undefined = undefined;\r\n public shareLink = '';\r\n public sentEmail = false;\r\n\r\n inputFields: InputFields = {\r\n gift: {\r\n name: 'gift',\r\n value: '',\r\n required: true,\r\n inline: true,\r\n type: 'image-radio',\r\n options: [\r\n {\r\n label: 'Handdoek',\r\n value: TellAFriendGift.Towel,\r\n image: 'action/towel.png'\r\n },\r\n {\r\n label: 'Sporttas',\r\n value: TellAFriendGift.GymBag,\r\n image: 'action/bag.jpg'\r\n },\r\n {\r\n label: 'Dopper',\r\n value: TellAFriendGift.WaterBottle,\r\n image: 'action/bottle.jpg'\r\n }\r\n ],\r\n placeholder: 'Cadeau',\r\n errors: []\r\n }\r\n };\r\n\r\n hasDirtyInput = false;\r\n\r\n get currentUser (): User {\r\n return this.$store.state.currentUser\r\n }\r\n\r\n get subscription () {\r\n return this.currentUser.subscription\r\n }\r\n\r\n public async emailToSelf () {\r\n this.$gtag.event('Sporten werkt', {\r\n // eslint-disable-next-line @typescript-eslint/camelcase\r\n event_category: 'Actiepagina',\r\n value: 'Email share'\r\n })\r\n const api = new TellAFriendApi()\r\n const fields: ShareCodeByEmailToSelfCommand = {\r\n subscriptionId: this.currentUser.subscription?.subscriptionId || 0\r\n }\r\n try {\r\n this.state = this.states.LOADING\r\n await api.tellAFriendShareCodeByEmailToSelf(fields)\r\n\r\n this.state = this.states.COMPLETE\r\n this.sentEmail = true\r\n } catch (error) {\r\n this.state = this.states.ERROR\r\n this.sentEmail = false\r\n }\r\n }\r\n\r\n public onWhatsappClick () {\r\n this.$gtag.event('Sporten werkt', {\r\n // eslint-disable-next-line @typescript-eslint/camelcase\r\n event_category: 'Actiepagina',\r\n value: 'Whatsapp share'\r\n })\r\n }\r\n\r\n public async updateGift () {\r\n this.clearErrors()\r\n if (!this.validateInput()) {\r\n return\r\n }\r\n\r\n const api = new TellAFriendApi()\r\n const fields: UpdateGiftCommand = {\r\n gift: this.inputFields.gift.value as TellAFriendGift\r\n }\r\n try {\r\n this.state = this.states.LOADING\r\n this.clearErrors()\r\n await api.tellAFriendUpdateGift(fields)\r\n this.hasDirtyInput = false\r\n\r\n this.state = this.states.COMPLETE\r\n } catch (error) {\r\n this.state = this.states.ERROR\r\n\r\n this.setErrors(error.response.data.errors)\r\n\r\n this.$root.$emit('scrollToTop')\r\n }\r\n }\r\n\r\n public setErrors (errors: []) {\r\n Object.entries(errors).forEach(([errorKey, errorValue]) => {\r\n Object.entries(this.inputFields).forEach(([fieldKey, fieldValue]) => {\r\n if (errorKey.toLowerCase() === fieldKey.toLowerCase()) {\r\n fieldValue.errors = errorValue\r\n }\r\n })\r\n })\r\n }\r\n\r\n public clearErrors () {\r\n Object.values(this.inputFields).forEach((fieldValue: InputField) => {\r\n fieldValue.errors = []\r\n })\r\n }\r\n\r\n public inputChange () {\r\n this.hasDirtyInput = true\r\n }\r\n\r\n private validateInput () {\r\n let valid = true\r\n\r\n Object.keys(this.inputFields).forEach((key: string) => {\r\n let input\r\n if (Array.isArray(this.$refs[key])) {\r\n input = (this.$refs[key] as Element[])[0]\r\n } else {\r\n input = this.$refs[key]\r\n }\r\n valid = (input as FormInput).validate() && valid\r\n })\r\n\r\n return valid\r\n }\r\n\r\n get hasErrors () {\r\n let hasError = false\r\n Object.values(this.inputFields).forEach((fieldValue: InputField) => {\r\n hasError = hasError || fieldValue.errors.length > 0\r\n })\r\n return hasError\r\n }\r\n\r\n mounted () {\r\n this.setState(this.states.LOADING)\r\n\r\n const api = new TellAFriendApi()\r\n\r\n api.tellAFriendGetTellAFriendCode(this.currentUser.subscription?.subscriptionId || 0)\r\n .then((data) => {\r\n this.tellAFriendCode = data.data\r\n // Disabled because there's no choice this year: this.inputFields.gift.value = this.tellAFriendCode.gift?.toString() || ''\r\n // Remove default https-port from uri, it is ugly.\r\n const encodedLink = encodeURIComponent((this.tellAFriendCode.registrationFlowLoginUri || '').replace(':443/', '/'))\r\n this.shareLink = `https://api.whatsapp.com/send?text=Hi collega, wist je dat het deze maand dé Sporten Werkt actiemaand is bij Bedrijfsfitness Nederland?\r\n %0a%0aDankzij ${encodeURIComponent(this.currentUser.projectInformation?.name || '')} kan je – net als ik – genieten van korting op een sportabonnement. Als jij je in oktober inschrijft voor bedrijfsfitness en daarbij mijn actiecode gebruikt, ontvang je een limited edition rugtas. Je gebruikt hiervoor de volgende link: ${encodedLink}.\r\n %0a%0aVeel sportplezier! Sportieve groet,\r\n %0a%0a${encodeURIComponent(this.currentUser.employeeDetails?.firstName || '')}`\r\n this.setState(this.states.COMPLETE)\r\n })\r\n .catch(() => {\r\n this.setState(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!./TellAFriend.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!./TellAFriend.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./TellAFriend.vue?vue&type=template&id=6294a668&scoped=true&\"\nimport script from \"./TellAFriend.vue?vue&type=script&lang=ts&\"\nexport * from \"./TellAFriend.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./TellAFriend.vue?vue&type=style&index=0&id=6294a668&prod&lang=scss&scoped=true&\"\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 \"6294a668\",\n null\n \n)\n\nexport default component.exports","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./TellAFriend.vue?vue&type=style&index=0&id=6294a668&prod&lang=scss&scoped=true&\""],"sourceRoot":""}