exports.ids = [6];
exports.modules = {

/***/ 248:
/***/ (function(module, exports) {

module.exports = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjE0IiBoZWlnaHQ9IjE4Ij48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGZpbGw9IiMyMTIxMjEiIGQ9Ik0xIDE2YzAgMS4wOTkuOSAyIDIgMmg4YzEuMDk5IDAgMi0uOTAxIDItMlY0SDF2MTJ6TTMgNmg4djEwSDNWNnptNy41LTVsLTEtMWgtNWwtMSAxSDB2MmgxNFYxaC0zLjV6Ii8+PC9zdmc+"

/***/ }),

/***/ 249:
/***/ (function(module, exports) {

// Exports
module.exports = {

};


/***/ }),

/***/ 289:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VBtn/VBtn.js
var VBtn = __webpack_require__(101);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VCard/VCard.js
var VCard = __webpack_require__(97);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VCol.js
var VCol = __webpack_require__(110);

// EXTERNAL MODULE: ./node_modules/vuetify/lib/components/VGrid/VRow.js
var VRow = __webpack_require__(109);

// CONCATENATED MODULE: ./node_modules/vuetify-loader/lib/loader.js??ref--4!./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--7!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Cart.vue?vue&type=template&id=21e52b25





var Cartvue_type_template_id_21e52b25_render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c('div', [_vm.pageLoaded && _vm.isMobile ? _vm._ssrNode("<div" + _vm._ssrClass(null, {
    ' cart': _vm.showCart.length,
    ' ': !_vm.showCart.length
  }) + " style=\" \\n   width: 300px; \">", "</div>", [!_vm.showCart.length ? _vm._ssrNode("<p class=\"text-center mt-3\">", "</p>", [_vm._ssrNode("Your cart is empty")], 2) : _vm._ssrNode("<div>", "</div>", [_vm._ssrNode("<p class=\"font-weight-medium text-14 FF_Rubik-medium text-center mb-0 mt-4\">\n        Forget something? These items are still waiting for you!\n      </p> "), _vm._ssrNode("<div class=\"pl-4\">", "</div>", _vm._l(_vm.showCart, function (item, index) {
    return _c(VCard["a" /* default */], {
      key: index,
      staticClass: "mt-4 py-3 px-5 rounded-0",
      staticStyle: {
        "border": "1px solid #D4D4D5"
      },
      attrs: {
        "elevation": "0",
        "color": "greylighten6",
        "width": "95%"
      }
    }, [_c(VRow["a" /* default */], {
      staticClass: "justify-center"
    }, [_c(VCol["a" /* default */], {
      staticClass: "pb-0",
      attrs: {
        "cols": "12",
        "lg": "2",
        "md": "12",
        "sm": "6"
      }
    }, [_c('div', {
      staticClass: "text-center"
    }, [_c('img', {
      attrs: {
        "width": "100",
        "src": 'https://newshop.testshop1.bimmer-tech.net' + item.image
      }
    })])]), _vm._v(" "), _c(VCol["a" /* default */], {
      staticClass: "pb-0",
      attrs: {
        "cols": "12",
        "lg": "6",
        "md": "12",
        "sm": "9"
      }
    }, [_c('p', {
      staticClass: "font-weight-medium FF_Rubik-medium text-14"
    }, [_vm._v("\n                " + _vm._s(item.name) + "\n              ")])]), _vm._v(" "), _c(VCol["a" /* default */], {
      staticClass: "pb-0",
      attrs: {
        "cols": "12",
        "lg": "3",
        "md": "12",
        "sm": "6"
      }
    }, [_c('p', {
      staticClass: "FF_Rubik-regular text-14"
    }, [_vm._v("\n                " + _vm._s(item.quantity) + " x $" + _vm._s(item.unitPrice) + "\n              ")])]), _vm._v(" "), _c(VCol["a" /* default */], {
      staticClass: "pb-0",
      attrs: {
        "cols": "12",
        "lg": "1",
        "md": "12",
        "sm": "2"
      }
    }, [_c('img', {
      staticClass: "cursor_pointer",
      attrs: {
        "src": __webpack_require__(248),
        "alt": ""
      },
      on: {
        "click": function ($event) {
          return _vm.removeItem(item);
        }
      }
    })])], 1)], 1);
  }), 1)], 2), _vm._ssrNode(" "), _vm.showCart.length > 0 ? _vm._ssrNode("<div class=\"checkout_section_mobile pl-4 pr-2\">", "</div>", [_vm._ssrNode("<div class=\"text-right\"><p class=\"text-16 mb-0 FF_Rubik-regular\">" + _vm._ssrEscape("\n          Cart total: $" + _vm._s((_vm.totalPrice / 100).toFixed(2)) + "\n        ") + "</p></div> "), _c(VBtn["a" /* default */], {
    staticClass: "primary mt-4 font-weight-medium text-capitalize white--text FF_Rubik-regular",
    attrs: {
      "block": "",
      "elevation": "0",
      "rounded": "xxl",
      "to": "/address"
    }
  }, [_vm._v("Checkout")])], 2) : _vm._e()], 2) : _vm._ssrNode("<div" + _vm._ssrClass(null, {
    ' cart': _vm.showCart.length,
    ' ': !_vm.showCart.length
  }) + " style=\" \">", "</div>", [!_vm.showCart.length ? _vm._ssrNode("<p class=\"text-center mt-3\">", "</p>", [_vm._ssrNode("Your cart is empty")], 2) : _vm._ssrNode("<div>", "</div>", [_vm._ssrNode("<p class=\"font-weight-medium text-14 FF_Rubik-medium text-center mb-0 mt-4\">\n        Forget something? These items are still waiting for you!\n      </p> "), _vm._ssrNode("<div class=\"pl-4\">", "</div>", _vm._l(_vm.showCart, function (item, index) {
    var _item$addons;
    return _c(VCard["a" /* default */], {
      key: index,
      staticClass: "mt-4 py-3 px-5 round-0",
      staticStyle: {
        "border": "1px solid #D4D4D5"
      },
      attrs: {
        "elevation": "0",
        "color": "greylighten6",
        "width": "95%"
      }
    }, [_c(VRow["a" /* default */], [_c(VCol["a" /* default */], {
      staticClass: "pb-0",
      attrs: {
        "cols": "12",
        "lg": "2",
        "md": "12",
        "sm": "12"
      }
    }, [_c('img', {
      attrs: {
        "width": "40",
        "src": 'https://newshop.testshop1.bimmer-tech.net' + item.image
      }
    })]), _vm._v(" "), _c(VCol["a" /* default */], {
      staticClass: "pb-0",
      attrs: {
        "cols": "12",
        "lg": "6",
        "md": "12",
        "sm": "12"
      }
    }, [_c('p', {
      staticClass: "font-weight-medium FF_Rubik-medium text-14"
    }, [_vm._v("\n                " + _vm._s(item.name) + "\n              ")])]), _vm._v(" "), _c(VCol["a" /* default */], {
      staticClass: "pb-0 px-0",
      attrs: {
        "cols": "12",
        "lg": "3",
        "md": "12",
        "sm": "8"
      }
    }, [_c('p', {
      staticClass: "FF_Rubik-regular text-14"
    }, [_vm._v("\n                " + _vm._s(item.quantity) + " x $" + _vm._s((item.unitPrice / 100).toFixed(2)) + "\n              ")])]), _vm._v(" "), _c(VCol["a" /* default */], {
      staticClass: "pb-0",
      attrs: {
        "cols": "12",
        "lg": "1",
        "md": "12",
        "sm": "4"
      }
    }, [_c('img', {
      staticClass: "cursor_pointer",
      attrs: {
        "src": __webpack_require__(248),
        "alt": ""
      },
      on: {
        "click": function ($event) {
          return _vm.removeItem(item);
        }
      }
    })])], 1), _vm._v(" "), item !== null && item !== void 0 && (_item$addons = item.addons) !== null && _item$addons !== void 0 && _item$addons.length ? _c(VRow["a" /* default */], [_c('p', {
      staticClass: "mb-0 text-14 FF_Rubik-regular"
    }, [_vm._v("Add-ons")]), _vm._v(" "), _c(VCol["a" /* default */], {
      staticClass: "mb-md-3",
      attrs: {
        "cols": "12",
        "md": "12"
      }
    }, [_c(VRow["a" /* default */], _vm._l(item.addons, function (addon, i) {
      return _c(VCard["a" /* default */], {
        key: i,
        staticClass: "py-3 px-5",
        staticStyle: {
          "border": "1px solid rgba(0, 0, 0, 0.125) !important"
        },
        attrs: {
          "elevation": "0",
          "rounded": "xxl",
          "color": "white",
          "width": "98%"
        }
      }, [_c(VRow["a" /* default */], [_c(VCol["a" /* default */], {
        staticClass: "pa-1",
        attrs: {
          "cols": "12",
          "md": "8"
        }
      }, [_c('p', {
        staticClass: "mb-0 text-14 FF_Rubik-regular"
      }, [_vm._v(_vm._s(addon.name))])]), _vm._v(" "), _c(VCol["a" /* default */], {
        staticClass: "pa-1",
        attrs: {
          "cols": "12",
          "md": "4"
        }
      }, [_c('span', {
        staticClass: "mb-0 text-14 FF_Rubik-regular"
      }, [_vm._v(_vm._s(addon.quantity))]), _vm._v(" "), _c('span', [_vm._v("X")]), _vm._v(" "), _c('span', {
        staticClass: "mb-0 text-14 FF_Rubik-regular"
      }, [_vm._v(" $" + _vm._s((addon.unitPrice / 100).toFixed(2)))])])], 1)], 1);
    }), 1)], 1)], 1) : _vm._e()], 1);
  }), 1)], 2), _vm._ssrNode(" "), _vm.showCart.length > 0 ? _vm._ssrNode("<div class=\"checkout_section pl-4 pr-2\">", "</div>", [_vm._ssrNode("<div class=\"text-right\"><p class=\"text-16 mb-0 FF_Rubik-regular mt-4\">" + _vm._ssrEscape("\n          Cart total: $" + _vm._s((_vm.totalPrice / 100).toFixed(2)) + "\n        ") + "</p></div> "), _c(VBtn["a" /* default */], {
    staticClass: "primary mt-4 font-weight-medium text-capitalize white--text FF_Rubik-regular",
    attrs: {
      "block": "",
      "elevation": "0",
      "rounded": "xxl"
    },
    on: {
      "click": function ($event) {
        return _vm.gotoCheckout();
      }
    }
  }, [_vm._v("Checkout")])], 2) : _vm._e()], 2)]);
};
var staticRenderFns = [];

// CONCATENATED MODULE: ./components/Cart.vue?vue&type=template&id=21e52b25

// EXTERNAL MODULE: external "vuex"
var external_vuex_ = __webpack_require__(9);

// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/Cart.vue?vue&type=script&lang=js

/* harmony default export */ var Cartvue_type_script_lang_js = ({
  props: ["showCartTBar"],
  data() {
    return {
      totalPrice: 0,
      showCart: [],
      pageLoaded: false
    };
  },
  methods: {
    ...Object(external_vuex_["mapActions"])(["remove_item", "show_cart_items", "update_cart_items"]),
    gotoCheckout() {
      this.$router.push({
        path: '/cart'
      });
      this.$nuxt.$emit("closeCart", false);
    },
    removeItem(item) {
      this.loading = true;
      this.remove_item(item.id).then(response => {
        // this.vin = response.data.vinNumber;
        this.showCartItems();
        this.loading = false;
      }).catch(error => {
        console.log("error");
      });
    },
    showCartItems() {
      if (false) { var cartId; }
      if (cartId) this.show_cart_items(cartId).then(response => {
        this.cart = response.data;
        this.cartItems = response.data.cart_items;
        this.showCart = response.data.cart_items;
        this.totalPrice = response.data.calcPriceTotal;
        this.compatibility = this.cartItems.some(item => item.compatibility === "No");
        this.$nuxt.$emit("cartItemsCount", this.cartItems.length);
        this.$nuxt.$emit("cartTotalPrice", this.totalPrice);
      }).catch(error => {
        console.log("error");
      });
    }
  },
  computed: {
    orderTotal() {
      var _this$cartItems;
      return (_this$cartItems = this.cartItems) === null || _this$cartItems === void 0 ? void 0 : _this$cartItems.reduce((total, item) => total + item.total, 0);
    },
    isMobile() {
      return this.$vuetify.breakpoint.mobile;
    }
  },
  mounted() {
    this.$nuxt.$on("cartTotalPrice", payload => {
      console.log('topbarCart total');
      this.totalPrice = payload;
    });
    this.showCartItems();
    this.pageLoaded = true;
    this.showCart = this.showCartTBar;
  }
});
// CONCATENATED MODULE: ./components/Cart.vue?vue&type=script&lang=js
 /* harmony default export */ var components_Cartvue_type_script_lang_js = (Cartvue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(21);

// CONCATENATED MODULE: ./components/Cart.vue



function injectStyles (context) {
  
  var style0 = __webpack_require__(310)
if (style0.__inject__) style0.__inject__(context)

}

/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  components_Cartvue_type_script_lang_js,
  Cartvue_type_template_id_21e52b25_render,
  staticRenderFns,
  false,
  injectStyles,
  null,
  "73025440"
  
)

/* harmony default export */ var Cart = __webpack_exports__["default"] = (component.exports);

/***/ }),

/***/ 310:
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_3_oneOf_1_1_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Cart_vue_vue_type_style_index_0_id_21e52b25_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(249);
/* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_3_oneOf_1_1_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Cart_vue_vue_type_style_index_0_id_21e52b25_prod_lang_css__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_3_oneOf_1_1_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Cart_vue_vue_type_style_index_0_id_21e52b25_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_3_oneOf_1_1_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Cart_vue_vue_type_style_index_0_id_21e52b25_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_3_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_3_oneOf_1_1_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_Cart_vue_vue_type_style_index_0_id_21e52b25_prod_lang_css__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));


/***/ })

};;
//# sourceMappingURL=cart.js.map