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,CAEItB,iBACA,OAAOuB,EAAAA,EAAWC,YACtB,CAEInB,gBACA,OAAOoB,EAAAA,EAAmBC,UAAUC,wBAA0BhD,KAAKiD,yBAA2BzD,EAAAA,EAAgB0D,KAClH,CAEID,8BACA,OAAOH,EAAAA,EAAmBC,UAAUI,eACxC,CAEIrB,gBACA,OAAOgB,EAAAA,EAAmBC,UAAUjB,SACxC,CAEQ5B,4BAA4BiD,GAC5BnD,KAAKiD,yBAA2BE,UAC1BnD,KAAKoD,GAAGC,sBAAsBF,GACpCtD,OAAOyD,SAASC,SAExB,GA7BiBhB,GAAoBiB,EAAAA,EAAAA,IAAA,EAHxCC,EAAAA,EAAAA,IAAU,CACPC,KAAM,0BAEWnB,G,UCVkd,I,wBCQneoB,GAAY,OACd,EACA5C,EACAuB,GACA,EACA,KACA,WACA,MAIF,QAAeqB,EAAiB,O,kBChBhC,IAAIC,EAAU,EAAQ,OACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAACtE,EAAOC,GAAIqE,EAAS,MAC7DA,EAAQG,SAAQzE,EAAO0E,QAAUJ,EAAQG,QAE5C,IAAIE,EAAM,WACGA,EAAI,WAAYL,GAAS,EAAM,CAAC,WAAY,EAAM,YAAa,G","sources":["webpack://website-js/./src/components/customer-profile/CustomerProfileModal.vue?1f15","webpack://website-js/./src/models/Customer.ts","webpack://website-js/./src/services/CustomerService.ts","webpack://website-js/./src/components/customer-profile/CustomerProfileModal.vue","webpack://website-js/./src/components/customer-profile/CustomerProfileModal.vue?ed2f","webpack://website-js/./src/components/customer-profile/CustomerProfileModal.vue?2430","webpack://website-js/./src/components/customer-profile/CustomerProfileModal.vue?9df5","webpack://website-js/./src/components/customer-profile/CustomerProfileModal.vue?b0ce"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.customer-profile-modal[data-v-8c247d34]{text-align:center}.customer-profile-modal-wrapper[data-v-8c247d34]{display:flex;flex:1;justify-content:center;flex-direction:column}.customer-profile-modal-body[data-v-8c247d34]{padding:35px 15px 15px}.customer-profile-modal-body .logo[data-v-8c247d34]{max-width:100px;margin-bottom:25px}.customer-profile-modal-actions[data-v-8c247d34]{padding:5px 15px 35px}.customer-profile-modal-actions .uk-button[data-v-8c247d34]:not(:first-of-type){margin-left:15px}.customer-profile-modal-actions .uk-button[data-v-8c247d34]:hover{background-color:var(--primary-color);border-color:var(--primary-color);color:#fff}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","export interface Customer {\n id: string;\n name: string;\n}\n\nexport enum CustomerProfile {\n UNSET,\n B2C,\n B2B,\n}\n\nexport interface AssociatedMember {\n email: string;\n name: string;\n}","import axios, { AxiosResponse } from 'axios';\nimport { AssociatedMember, Customer, CustomerProfile } from '@/models/Customer';\n\nexport default class CustomerService {\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/customer`;\n }\n\n public async getCustomer(): Promise<Customer> {\n try {\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n }\n\n public async search(query: string, limit: number = 15, offset: number = 0): Promise<Customer[]> {\n try {\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}/search/?query=${query}&limit=${limit}&offset=${offset}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n } \n\n public async changeCustomer(selectedcustomer: string): Promise<Customer> {\n try {\n const res: AxiosResponse<any> = await axios.post(`${this.endpoint}/change/?selectedcustomer=${selectedcustomer}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n } \n\n public async changeCustomerProfile(customerprofile: CustomerProfile): Promise<any> {\n try {\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}/changeprofile/?customerprofile=${customerprofile}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n }\n\n public async getAssociatedMembers(customerid: string): Promise<AssociatedMember[]> {\n try {\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}/getmembersbyid/?customerid=${customerid}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n }\n}\n","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return (_vm.translationsReady && !_vm.isSignedIn)?_c('Modal',{staticClass:\"customer-profile-modal\",attrs:{\"width\":\"500px\",\"auto-expand\":true},model:{value:(_vm.showModal),callback:function ($$v) {_vm.showModal=$$v},expression:\"showModal\"}},[_c('div',{staticClass:\"customer-profile-modal-wrapper\"},[_c('div',{staticClass:\"customer-profile-modal-body\"},[_c('img',{staticClass:\"logo\",attrs:{\"src\":_vm.logoImage,\"alt\":\"\"}}),_c('br'),_c('span',{staticClass:\"uk-h3\"},[_vm._v(_vm._s(_vm.$t('customer-profile.shop-as', ['I want to shop as'])))])]),_c('div',{staticClass:\"customer-profile-modal-actions\"},[_c('button',{staticClass:\"uk-button uk-button-default uk-button-large\",on:{\"click\":function($event){return _vm.toggleCustomerProfile(1)}}},[_vm._v(\" \"+_vm._s(_vm.$t('customer-profile.b2c', ['Private']))+\" \")]),_c('button',{staticClass:\"uk-button uk-button-default uk-button-large\",on:{\"click\":function($event){return _vm.toggleCustomerProfile(2)}}},[_vm._v(\" \"+_vm._s(_vm.$t('customer-profile.b2b', ['Business']))+\" \")])])])]):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\nimport { CbxVariablesModule } from '@/store/modules/CbxVariablesModule';\nimport UserModule from '../../store/modules/UserModule';\nimport { Component, Vue } from 'vue-property-decorator';\nimport CustomerService from '../../services/CustomerService'\nimport { CustomerProfile } from '../../models/Customer';\n\n@Component({\n name: 'CustomerProfileModal',\n})\nexport default class CustomerProfileModal extends Vue {\n \n private cs: CustomerService = new CustomerService();\n\n get translationsReady(): boolean {\n return this.$root.$data.translationsLoaded === true;\n }\n\n get isSignedIn(): boolean {\n return UserModule.IS_SIGNED_IN;\n }\n\n get showModal(): boolean {\n return CbxVariablesModule.VARIABLES.enableCustomerProfiles && this.selectedCustomerProfile == CustomerProfile.UNSET;\n }\n\n get selectedCustomerProfile(): CustomerProfile {\n return CbxVariablesModule.VARIABLES.customerProfile;\n }\n\n get logoImage(): string {\n return CbxVariablesModule.VARIABLES.logoImage;\n }\n\n private async toggleCustomerProfile(customerProfile: CustomerProfile) {\n if (this.selectedCustomerProfile != customerProfile) {\n await this.cs.changeCustomerProfile(customerProfile)\n window.location.reload();\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!./CustomerProfileModal.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!./CustomerProfileModal.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CustomerProfileModal.vue?vue&type=template&id=8c247d34&scoped=true&\"\nimport script from \"./CustomerProfileModal.vue?vue&type=script&lang=ts&\"\nexport * from \"./CustomerProfileModal.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./CustomerProfileModal.vue?vue&type=style&index=0&id=8c247d34&prod&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"8c247d34\",\n null\n \n)\n\nexport default component.exports","// style-loader: Adds some css to the DOM by adding a <style> tag\n\n// load the styles\nvar content = require(\"!!../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!../../../node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!../../../node_modules/@vue/cli-service/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!../../../node_modules/@vue/cli-service/node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!../../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[4]!../../../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!./CustomerProfileModal.vue?vue&type=style&index=0&id=8c247d34&prod&lang=scss&scoped=true&\");\nif(content.__esModule) content = content.default;\nif(typeof content === 'string') content = [[module.id, content, '']];\nif(content.locals) module.exports = content.locals;\n// add the styles to the DOM\nvar add = require(\"!../../../node_modules/vue-style-loader/lib/addStylesClient.js\").default\nvar update = add(\"6fc41a0a\", content, true, {\"sourceMap\":false,\"shadowMode\":false});"],"names":["___CSS_LOADER_EXPORT___","push","module","id","CustomerProfile","CustomerService","constructor","args","_defineProperty","window","CbxApiContextKey","profileId","this","endpoint","async","res","axios","data","e","console","log","query","limit","offset","selectedcustomer","customerprofile","customerid","render","_vm","_c","_self","_setupProxy","translationsReady","isSignedIn","staticClass","attrs","model","value","showModal","callback","$$v","expression","logoImage","_v","_s","$t","on","$event","toggleCustomerProfile","_e","staticRenderFns","CustomerProfileModal","Vue","$root","$data","translationsLoaded","UserModule","IS_SIGNED_IN","CbxVariablesModule","VARIABLES","enableCustomerProfiles","selectedCustomerProfile","UNSET","customerProfile","cs","changeCustomerProfile","location","reload","__decorate","Component","name","component","content","__esModule","default","locals","exports","add"],"sourceRoot":""}