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AAa5D,KAAK8D,QAAQH,YAAYC,EAC1C,CAEOO,SAAAA,CAAUC,GACbpE,KAAK+D,MAAQK,CACjB,IAfA9B,EAAAA,EAAAA,IAAA,CADC+B,EAAAA,I,kCAMD/B,EAAAA,EAAAA,IAAA,EADCgC,EAAAA,EAAAA,IAAO,CAAEC,OAAQ,e,+BAKlBjC,EAAAA,EAAAA,IAAA,EADCgC,EAAAA,EAAAA,IAAO,CAAEC,OAAQ,e,kCAKlBjC,EAAAA,EAAAA,IAAA,CADC+B,EAAAA,I,8BA5BCzC,GAAYU,EAAAA,EAAAA,IAAA,EANjBkC,EAAAA,EAAAA,IAAO,CACJC,MAAK,IACLC,SAAS,EACT/D,KAAM,SACNgE,YAAY,KAEV/C,GAmCN,SAAegD,EAAAA,EAAAA,IAAUhD,E","sources":["webpack://website-js/./src/components/recipe/RecipePortions.vue","webpack://website-js/./src/components/recipe/RecipePortions.vue?0a89","webpack://website-js/./src/components/recipe/RecipePortions.vue?c328","webpack://website-js/./src/components/recipe/RecipePortions.vue?2116","webpack://website-js/./src/services/RecipeService.ts","webpack://website-js/./src/store/modules/RecipeModule.ts"],"sourcesContent":["var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"recipe-portions\",class:{'is-dark': _vm.isDark}},[_c('button',{attrs:{\"uk-icon\":\"minus-circle\"},on:{\"click\":_vm.decrement}}),_c('input',{directives:[{name:\"model\",rawName:\"v-model.number\",value:(_vm.portions),expression:\"portions\",modifiers:{\"number\":true}}],staticClass:\"uk-input\",attrs:{\"type\":\"text\"},domProps:{\"value\":(_vm.portions)},on:{\"keypress\":function($event){return _vm.isNumber($event)},\"input\":function($event){if($event.target.composing)return;_vm.portions=_vm._n($event.target.value)},\"blur\":function($event){return _vm.$forceUpdate()}}}),_c('button',{attrs:{\"uk-icon\":\"plus-circle\"},on:{\"click\":_vm.increment}})])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\nimport RecipeModule from '@/store/modules/RecipeModule';\nimport { Component, Prop, Vue } from 'vue-property-decorator';\n\n@Component({\n name: 'RecipePortions',\n})\nexport default class RecipePortions extends Vue {\n @Prop({default: false}) isDark: boolean;\n\n get portions(): number {\n return RecipeModule.PORTIONS;\n }\n set portions(input: number)\n {\n if (input <= 0)\n input = 1;\n\n RecipeModule.SET_PORTIONS(input);\n }\n\n increment() {\n this.portions += 1;\n }\n\n decrement() {\n this.portions -= 1;\n }\n\n isNumber(event: KeyboardEvent) {\n const keysAllowed: string[] = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n const keyPressed: string = event.key;\n \n if (!keysAllowed.includes(keyPressed)) {\n event.preventDefault();\n }\n }\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??clonedRuleSet-41.use[0]!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??clonedRuleSet-41.use[3]!../../../node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!../../../node_modules/@vue/cli-service/lib/config/vue-loader-v15-resolve-compat/vue-loader.js??vue-loader-options!./RecipePortions.vue?vue&type=script&lang=ts\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??clonedRuleSet-41.use[0]!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??clonedRuleSet-41.use[3]!../../../node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!../../../node_modules/@vue/cli-service/lib/config/vue-loader-v15-resolve-compat/vue-loader.js??vue-loader-options!./RecipePortions.vue?vue&type=script&lang=ts\"","import { render, staticRenderFns } from \"./RecipePortions.vue?vue&type=template&id=95c37214\"\nimport script from \"./RecipePortions.vue?vue&type=script&lang=ts\"\nexport * from \"./RecipePortions.vue?vue&type=script&lang=ts\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/vue-loader-v15/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","import { AddedRecipe, RecipeCalculationRequest, RecipeCalculationResponse } from '@/models/Recipe';\nimport axios, { AxiosResponse } from 'axios';\n\nexport default class RecipeService {\n\n private profileId: string = (window as any).CbxApiContextKey;\n private endpoint: string;\n\n constructor(args: any = {}) {\n if (args.profileId)\n this.profileId = args.profileId;\n this.endpoint = `/contextapi/${this.profileId}/v1/recipe`;\n }\n \n public async calculate(data: RecipeCalculationRequest): Promise {\n try {\n const res: AxiosResponse = await axios.post(`${this.endpoint}/calculate`, data);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n }\n \n public async getAdded(): Promise {\n try {\n const res: AxiosResponse = await axios.post(`${this.endpoint}/added`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n } \n \n public async removeAdded(id: string): Promise {\n try {\n const res: AxiosResponse = await axios.post(`${this.endpoint}/remove/${id}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n } \n}\n","import { Module, VuexModule, Mutation, getModule, Action } from 'vuex-module-decorators';\nimport store from '@/store';\nimport { AddedRecipe } from '@/models/Recipe';\nimport RecipeService from '@/services/RecipeService';\n\n@Module({\n store,\n dynamic: true,\n name: 'recipe',\n namespaced: true,\n})\nclass RecipeModule extends VuexModule {\n\n private service: RecipeService = new RecipeService();\n\n private portions: number = 1;\n private added: AddedRecipe[] = [];\n\n get PORTIONS(): number {\n return this.portions;\n }\n\n get ADDED(): AddedRecipe[] {\n return this.added;\n }\n\n @Mutation\n public SET_PORTIONS(args: number) {\n this.portions = args;\n }\n\n @Action({ commit: 'SET_ADDED' })\n public async GET_ADDED() {\n return await this.service.getAdded();\n }\n @Action({ commit: 'SET_ADDED' })\n public async REMOVE_ADDED(id: string) {\n return await this.service.removeAdded(id);\n }\n @Mutation\n public SET_ADDED(payload: AddedRecipe[]) {\n this.added = payload;\n }\n\n}\n\nexport default getModule(RecipeModule);\n"],"names":["render","_vm","this","_c","_self","_setupProxy","staticClass","class","isDark","attrs","on","decrement","directives","name","rawName","value","portions","expression","modifiers","domProps","$event","isNumber","target","composing","_n","$forceUpdate","increment","staticRenderFns","RecipePortions","Vue","RecipeModule","PORTIONS","input","SET_PORTIONS","event","keysAllowed","keyPressed","key","includes","preventDefault","__decorate","Prop","default","Component","component","RecipeService","constructor","args","profileId","window","CbxApiContextKey","endpoint","calculate","data","res","axios","post","e","console","log","getAdded","removeAdded","id","VuexModule","service","added","ADDED","GET_ADDED","REMOVE_ADDED","SET_ADDED","payload","Mutation","Action","commit","Module","store","dynamic","namespaced","getModule"],"ignoreList":[],"sourceRoot":""}