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AOH,EAAAA,EAAmBC,UAAUI,eACxC,CAEIrB,gBACA,OAAOgB,EAAAA,EAAmBC,UAAUjB,SACxC,CAEQ3B,4BAA4BgD,GAC5BlD,KAAKgD,yBAA2BE,UAC1BlD,KAAKmD,GAAGC,sBAAsBF,GACpCrD,OAAOwD,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,CAACrE,EAAOC,GAAIoE,EAAS,MAC7DA,EAAQG,SAAQxE,EAAOyE,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 {\r\n id: string;\r\n name: string;\r\n}\r\n\r\nexport enum CustomerProfile {\r\n UNSET,\r\n B2C,\r\n B2B,\r\n}\r\n","import axios, { AxiosResponse } from 'axios';\r\nimport { Customer, CustomerProfile } from '@/models/Customer';\r\n\r\nexport default class CustomerService {\r\n\r\n private profileId: string = (window as any).CbxApiContextKey;\r\n private endpoint: string;\r\n\r\n constructor(args: any = {}) {\r\n if (args.profileId)\r\n this.profileId = args.profileId;\r\n this.endpoint = `/contextapi/${this.profileId}/v1/customer`;\r\n }\r\n\r\n public async getCustomer(): Promise<Customer> {\r\n try {\r\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n }\r\n\r\n public async search(query: string, limit: number = 15, offset: number = 0): Promise<Customer[]> {\r\n try {\r\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}/search/?query=${query}&limit=${limit}&offset=${offset}`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n } \r\n\r\n public async changeCustomer(selectedcustomer: string): Promise<Customer> {\r\n try {\r\n const res: AxiosResponse<any> = await axios.post(`${this.endpoint}/change/?selectedcustomer=${selectedcustomer}`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n } \r\n\r\n public async changeCustomerProfile(customerprofile: CustomerProfile): Promise<any> {\r\n try {\r\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}/changeprofile/?customerprofile=${customerprofile}`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n }\r\n}\r\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 }","\r\nimport { CbxVariablesModule } from '@/store/modules/CbxVariablesModule';\r\nimport UserModule from '../../store/modules/UserModule';\r\nimport { Component, Vue } from 'vue-property-decorator';\r\nimport CustomerService from '../../services/CustomerService'\r\nimport { CustomerProfile } from '../../models/Customer';\r\n\r\n@Component({\r\n name: 'CustomerProfileModal',\r\n})\r\nexport default class CustomerProfileModal extends Vue {\r\n \r\n private cs: CustomerService = new CustomerService();\r\n\r\n get translationsReady(): boolean {\r\n return this.$root.$data.translationsLoaded === true;\r\n }\r\n\r\n get isSignedIn(): boolean {\r\n return UserModule.IS_SIGNED_IN;\r\n }\r\n\r\n get showModal(): boolean {\r\n return CbxVariablesModule.VARIABLES.enableCustomerProfiles && this.selectedCustomerProfile == CustomerProfile.UNSET;\r\n }\r\n\r\n get selectedCustomerProfile(): CustomerProfile {\r\n return CbxVariablesModule.VARIABLES.customerProfile;\r\n }\r\n\r\n get logoImage(): string {\r\n return CbxVariablesModule.VARIABLES.logoImage;\r\n }\r\n\r\n private async toggleCustomerProfile(customerProfile: CustomerProfile) {\r\n if (this.selectedCustomerProfile != customerProfile) {\r\n await this.cs.changeCustomerProfile(customerProfile)\r\n window.location.reload();\r\n }\r\n }\r\n}\r\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","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":""}