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AK,GAC3C,MAASA,EAAwB,qBAAS,OAAK,QAC/C,SAAY,GACZ,QAAWA,EAAwB,qBAAW,SAAK,GACnD,YAAeA,EAAgC,8BAAK,KACpD,SAAYA,EAAO,KACnB,KAGJJ,OAAOC,UAAUK,KAAK,CACpB,MAAS,iBACT,UAAa,CACX,gBAAmB,CACjB,YAAe,CAAC,KAAQQ,EAAM,OAAUC,MAKlD,CAEA5C,uBAAuBF,EAAoBH,EAAyB,WAClC,IAArBkC,OAAOC,WAIlBD,OAAOC,UAAUK,KAAK,CACpBW,MAAO,GAAGhD,EAAkB,MAAEiD,sBAC9BC,SAAUlD,EAAkB,MAC5BmD,OAAQ,QACRC,MAAOpD,EAAkB,MACzBqD,MAAOxD,EAAUA,EAA8B,qBAAIG,EAAwB,YAC3EsD,MAAOzD,EAAU,gBAAgBA,EAAc,OAAM,eAEzD,GAKM,EAAAI,kBAAAA,C,+LCjKR,SAXgB,E,SAAA,GACd,UACA,IACA,KACA,EACA,KACA,KACA,MAI8B,O,kJClBsN,QAAe,G,6DCArQ,IAAIsD,OAAS,WAAa,IAAIC,EAAI9D,KAAS+D,EAAGD,EAAIE,eAAuC,OAAjBF,EAAIG,MAAMC,IAAIH,GAAa,SAAS,CAACI,YAAY,WAAWC,MAAM,CAAE,iBAAkBN,EAAIhE,mBAAoBuE,MAAM,CAAC,SAAWP,EAAIhE,mBAAmBwE,SAAS,CAAC,YAAcR,EAAIS,GAAGT,EAAI9C,GAAG,iBAAiBwD,GAAG,CAAC,MAAQ,SAASC,GAAyD,OAAjDA,EAAOC,iBAAiBD,EAAOE,kBAAyBb,EAAI/D,qBAAqB6E,MAAM,KAAMC,UAAU,IAAI,EAC1ZC,EAAkB,E","sources":["webpack:///./resources/area/web/default/js/components/catalog/product/ProductBulkAddToCart.vue?2bb1","webpack:///./resources/area/web/default/js/shared/helpers/enhanced-ecommerce/index.ts","webpack:///./resources/area/web/default/js/components/catalog/product/ProductBulkAddToCart.vue","webpack:///./resources/area/web/default/js/components/catalog/product/ProductBulkAddToCart.vue?7bce","webpack:///./resources/area/web/default/js/components/catalog/product/ProductBulkAddToCart.vue?fbf9"],"sourcesContent":["\n\n\n\n\n\n\n\n\n\n\nimport {Component, Vue, Prop} from 'vue-property-decorator';\nimport ServiceContainer from '@flashpointbv/solar-service-container';\nimport {enhancedEcommerce} from '../../../shared/helpers/enhanced-ecommerce';\n\n@Component({\n  name: 'catalog-product-bulk-add-to-cart',\n  components: ServiceContainer().getComponents()\n})\n\nexport default class extends Vue {\n  @Prop({required: true}) private products!: Array<{ product: any }>;\n  @Prop({required: false, default: 1}) private qty: number;\n  @Prop({required: false, default: null}) private shopByLook: object | null;\n\n  private loadingAddToQuote: boolean = false;\n\n  private async bulkAddToQuoteAction(): Promise<void> {\n    this.products.forEach(product => {\n      if (product.product.in_stock === 1) {\n        this.addToQuoteAction(product);\n      }\n    });\n\n    if (this.shopByLook) {\n      enhancedEcommerce.addShopByLookDatalayer(this.shopByLook);\n    }\n  }\n\n  private async addToQuoteAction(product: object): Promise<any> {\n    this.loadingAddToQuote = true;\n\n    try {\n      let productPayload = {\n        sku: product['product']['sku'],\n        qty: this.qty,\n      };\n\n      await this.$store.dispatch('CheckoutQuote/addProductToQuote', productPayload);\n\n      await this.$store.dispatch('GlobalMessages/addGlobalMessage', {\n        id: `add-${product['product']['sku']}`,\n        message: this.$t('{productName} has been added to your shopping cart', {productName: product['product']['name']}),\n        type: '--success'\n      });\n\n      enhancedEcommerce.addProductAddToCart(product['product'], this.qty);\n    } catch (e) {\n      const response = e.response.data;\n\n      await this.$store.dispatch('GlobalMessages/addGlobalMessage', {\n        id: `error-${product['product']['sku']}`,\n        message: this.$t(response.message),\n        type: '--error'\n      });\n\n      this.loadingAddToQuote = false;\n      return;\n    } finally {\n      this.loadingAddToQuote = false;\n    }\n  }\n}\n","class EnhancedEcommerce {\n  addProductImpressions(products: Array<object>, listType: string = 'product-list', startIndex: number = 0): void {\n    const impressions: Array<object> = [];\n    const hasImpressionView = window.dataLayer.filter(e => e['event'] === 'ImpressionView').length;\n\n    products.forEach((p, i) => {\n      impressions.push({\n        'name': p['name'],\n        'id': p['product_id'],\n        'price': p['final_price_incl_tax'],\n        'sku': p['sku'],\n        'ean': p['erp_ean'] || '',\n        'brand': p['xenos_merk'] || 'Xenos',\n        'category': p.hasOwnProperty('category_names') ? p['category_names'].join(' | ') : '',\n        'variant': p['xen_kleur'] || '',\n        'dimension20': p['gses_durability_score_rating'] || null,\n        'list': listType,\n        'position': ((startIndex + i) + 1)\n      });\n    });\n\n    window.dataLayer.push({\n      'event': startIndex !== 0 && hasImpressionView > 0 ? 'ImpressionsPushed' : 'ImpressionView',\n      'ecommerce': {\n        'currencyCode': 'EUR',\n        'impressions': impressions\n      }\n    });\n  }\n\n  addProductClick(product: object, index: string | number | boolean | symbol): void {\n    window.dataLayer.push({\n      'event': 'productClick',\n      'ecommerce': {\n        'click': {\n          'actionField': {\n            'list': 'product-list'\n          },\n          'products': [{\n            'name': product['name'],\n            'id': product['product_id'],\n            'price': product['final_price_incl_tax'],\n            'sku': product['sku'],\n            'ean': product['erp_ean'] || '',\n            'brand': product['xenos_merk'] || 'Xenos',\n            'category': product.hasOwnProperty('category_names') ? product['category_names'].join(' | ') : '',\n            'variant': product['xen_kleur'] || '',\n            'dimension20': product['gses_durability_score_rating'] || null,\n            'position': (index as number) + 1\n          }]\n        }\n      }\n    });\n  }\n\n  addProductDetail(product: object): void {\n    window.dataLayer.push({\n      'ecommerce': {\n        'detail': {\n          'products': [{\n            'name': product['name'],\n            'id': product['product_id'],\n            'price': product['final_price_incl_tax'],\n            'sku': product['sku'],\n            'ean': product['erp_ean'] || '',\n            'brand': product['xenos_merk'] || 'Xenos',\n            'category': product.hasOwnProperty('category_names') ? product['category_names'].join(' | ') : '',\n            'variant': product['xen_kleur'] || '',\n            'dimension20': product['gses_durability_score_rating'] || null,\n          }]\n        }\n      }\n    });\n  }\n\n  addProductAddToCart(product: object, qty: number = 1): void {\n    window.dataLayer.push({\n      'event': 'addToCart',\n      'ecommerce': {\n        'currencyCode': 'EUR',\n        'add': {\n          'products': [{\n            'name': product['name'],\n            'id': product['product_id'],\n            'price': product['final_price_incl_tax'],\n            'sku': product['sku'],\n            'ean': product['erp_ean'] || '',\n            'brand': product['xenos_merk'] || 'Xenos',\n            'category': product.hasOwnProperty('category_names') ? product['category_names'].join(' | ') : '',\n            'variant': product['xen_kleur'] || '',\n            'dimension20': product['gses_durability_score_rating'] || null,\n            'quantity': qty\n          }]\n        }\n      }\n    });\n  }\n\n  addCrossSellDatalayer(product: object, qty: number = 1): void {\n    window.dataLayer.push({\n      'event': 'addtocart-checkout',\n      'ecommerce': {\n        'currencyCode': 'EUR',\n        'add': {\n          'products': [{\n            'name': product['name'],\n            'id': product['product_id'],\n            'price': product['final_price_incl_tax'],\n            'sku': product['sku'],\n            'ean': product['erp_ean'] || '',\n            'brand': product['xenos_merk'] || 'Xenos',\n            'category': product.hasOwnProperty('category_names') ? product['category_names'].join(' | ') : '',\n            'variant': product['xen_kleur'] || '',\n            'dimension20': product['gses_durability_score_rating'] || null,\n            'quantity': qty\n          }]\n        }\n      }\n    });\n  }\n\n  addCheckout(products: Array<object>, step: number, option: string = ''): void {\n    const productList: Array<object> = [];\n\n    if (step === 1) {\n      window.dataLayer.push({\n        'event': 'checkout',\n        'ecommerce': {\n          'checkout': {\n            'actionField': {'step': step, 'option': option},\n            'products': productList\n          }\n        }\n      });\n\n      products.forEach(p => {\n        productList.push({\n          'name': p['name'],\n          'id': p['item_id'],\n          'price': p['row_total_incl_tax'],\n          'sku': p['extension_attributes']['sku'] || '',\n          'ean': p['extension_attributes']['ean'] || '',\n          'brand': p['extension_attributes']['brand'] || 'Xenos',\n          'category': '',\n          'variant': p['extension_attributes']['variant'] || '',\n          'dimension20': p['gses_durability_score_rating'] || null,\n          'quantity': p['qty']\n        });\n      });\n    } else {\n      window.dataLayer.push({\n        'event': 'checkoutOption',\n        'ecommerce': {\n          'checkout_option': {\n            'actionField': {'step': step, 'option': option}\n          }\n        }\n      });\n    }\n  }\n\n  addShopByLookDatalayer(shopByLook: object, product: object | null = null): void {\n    if (typeof window.dataLayer === 'undefined') {\n      return;\n    }\n\n    window.dataLayer.push({\n      event: `${shopByLook['title'].toLowerCase()}-click`,\n      category: shopByLook['title'],\n      action: 'click',\n      label: shopByLook['title'],\n      price: product ? product['final_price_incl_tax'] : shopByLook['final_price'],\n      value: product ? `Add to cart: ${product['name']}` : `Add to cart`\n    });\n  }\n}\n\nconst enhancedEcommerce = new EnhancedEcommerce();\n\nexport {enhancedEcommerce};\n","import { render, staticRenderFns } from \"./ProductBulkAddToCart.vue?vue&type=template&id=0c85916a&\"\nimport script from \"./ProductBulkAddToCart.vue?vue&type=script&lang=ts&\"\nexport * from \"./ProductBulkAddToCart.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","import mod from \"-!../../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProductBulkAddToCart.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./ProductBulkAddToCart.vue?vue&type=script&lang=ts&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('button',{staticClass:\"--button\",class:{ '--loading-cart': _vm.loadingAddToQuote },attrs:{\"disabled\":_vm.loadingAddToQuote},domProps:{\"textContent\":_vm._s(_vm.$t('Add to cart'))},on:{\"click\":function($event){$event.preventDefault();$event.stopPropagation();return _vm.bulkAddToQuoteAction.apply(null, arguments)}}})}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }"],"names":["Vue","loadingAddToQuote","bulkAddToQuoteAction","this","products","forEach","product","in_stock","addToQuoteAction","shopByLook","enhancedEcommerce","addShopByLookDatalayer","productPayload","sku","qty","$store","dispatch","id","message","$t","productName","type","addProductAddToCart","e","response","data","Prop","required","Array","default","Component","name","components","getComponents","EnhancedEcommerce","addProductImpressions","listType","startIndex","impressions","hasImpressionView","window","dataLayer","filter","length","p","i","push","hasOwnProperty","join","addProductClick","index","addProductDetail","addCrossSellDatalayer","addCheckout","step","option","productList","event","toLowerCase","category","action","label","price","value","render","_vm","_h","$createElement","_self","_c","staticClass","class","attrs","domProps","_s","on","$event","preventDefault","stopPropagation","apply","arguments","staticRenderFns"],"sourceRoot":""}