{"version":3,"sources":["webpack:///resources/js/src/app/components/item/GraduatedPrices.vue","webpack:///./resources/js/src/app/components/item/GraduatedPrices.vue?64e9","webpack:///./resources/js/src/app/components/item/GraduatedPrices.vue","webpack:///./resources/js/src/app/components/item/GraduatedPrices.vue?0e64","webpack:///./resources/js/src/app/components/item/GraduatedPrices.vue?0295"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA;AAEA,0BAFA;AAIA;AACA;AACA;AADA,KADA;AAIA;AACA;AADA;AAJA,GAJA;AAaA;AACA;AACA;AADA;AADA,GAbA;AAmBA,YACA;AACA,mBADA,6BAEA;AACA;AAEA;AACA;AAEA;AAAA;AAAA;AAEA,uEACA;AACA;AACA,OAHA;AAIA,KAdA;AAgBA,iBAhBA,2BAiBA;AACA;AACA;AACA;AAEA;AACA,KAvBA;AAyBA,yBAzBA,mCA0BA;AAAA;;AACA;AAAA;AAAA;;AAEA,0BACA;AACA;AACA;;AAEA;AAAA;AAAA;AAEA;AACA,KArCA;AAuCA,0BAvCA,oCAwCA;AACA;AACA;AA1CA;AApBA,G;;;;;;;;;;;;AC5BA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,mDAAmD;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,SAAS,eAAe,EAAE;AACpE;AACA;AACA;AACA;AACA,wCAAwC;AACxC,+BAA+B;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gDAAgD;AACzE;AACA;AACA;AACA;AACA,2BAA2B;AAC3B;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACnIA;AAAA;AAAA;AAAA;AAA8F;AAC3B;AACL;;;AAG9D;AACsG;AACtG,gBAAgB,2GAAU;AAC1B,EAAE,qFAAM;AACR,EAAE,0FAAM;AACR,EAAE,mGAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;ACtCf;AAAA;AAAA,wCAAuM,CAAgB,mPAAG,EAAC,C;;;;;;;;;;;;ACA3N;AAAA;AAAA;AAAA;AAAA;AAAA","file":"chunks/ceres-33.js","sourcesContent":["<template>\n <div v-if=\"graduatedPrices[0]\">\n <b>{{ $translate(\"Ceres::Template.singleItemGraduatedPrices\") }}:</b>\n <table class=\"graduated-prices-table text-muted\">\n <tbody>\n <template v-for=\"(price, index) in graduatedPrices\">\n <tr>\n <td :class=\"paddingClasses\" :style=\"paddingInlineStyles\">{{ $translate(\"Ceres::Template.singleItemMinimumQuantity\") }} {{ price.minimumOrderQuantity }}</td>\n <td :class=\"paddingClasses\" :style=\"paddingInlineStyles\" class=\"graduated-price\">\n {{ price.unitPrice.formatted }}\n <transition name=\"fade\">\n <i class=\"fa fa-lg fa-check-circle-o text-appearance\" v-if=\"index === activeGraduationIndex\" aria-hidden=\"true\"></i>\n </transition>\n </td>\n <td v-if=\"showBasePrice\" :class=\"paddingClasses\" :style=\"paddingInlineStyles\" class=\"graduated-base-price pl-3 d-none d-xl-block\">{{ $translate(\"Ceres::Template.singleItemGraduatedBasePrice\", { \"price\": price.basePrice }) }}</td>\n </tr>\n <tr v-if=\"showBasePrice\" class=\"graduated-base-price d-xl-none\">\n <td :class=\"paddingClasses\" :style=\"paddingInlineStyles\"></td>\n <td :class=\"paddingClasses\" :style=\"paddingInlineStyles\">{{ $translate(\"Ceres::Template.singleItemGraduatedBasePrice\", { \"price\": price.basePrice }) }}</td>\n </tr>\n </template>\n </tbody>\n </table>\n <br>\n </div>\n</template>\n\n<script>\nexport default {\n\n name: \"graduated-prices\",\n\n props: {\n paddingClasses: {\n type: String\n },\n paddingInlineStyles: {\n type: String\n }\n },\n\n inject: {\n itemId: {\n default: null\n }\n },\n\n computed:\n {\n graduatedPrices()\n {\n const currentVariation = this.$store.getters[`${this.itemId}/currentItemVariation`];\n\n let prices = currentVariation && currentVariation.prices.graduatedPrices;\n const minQuantity = currentVariation && currentVariation.variation.minimumOrderQuantity;\n\n prices = prices.filter(price => price.minimumOrderQuantity > minQuantity);\n\n return [...prices].sort((priceA, priceB) =>\n {\n return priceA.minimumOrderQuantity - priceB.minimumOrderQuantity;\n });\n },\n\n showBasePrice()\n {\n const currentVariation = this.$store.getters[`${this.itemId}/currentItemVariation`];\n const mayShowUnitPrice = currentVariation.variation.mayShowUnitPrice;\n const isSinglePiece = currentVariation.unit && currentVariation.unit.content === 1 && currentVariation.unit.unitOfMeasurement === \"C62\";\n\n return mayShowUnitPrice && !isSinglePiece;\n },\n\n activeGraduationIndex()\n {\n const prices = this.graduatedPrices.filter(price => this.variationOrderQuantity >= price.minimumOrderQuantity);\n\n if (!prices.length)\n {\n return -1;\n }\n\n const price = prices.reduce((prev, current) => (prev.minimumOrderQuantity > current.minimumOrderQuantity) ? prev : current);\n\n return this.graduatedPrices.indexOf(price);\n },\n\n variationOrderQuantity()\n {\n return this.$store.state.items[this.itemId] && this.$store.state.items[this.itemId].variationOrderQuantity\n }\n }\n}\n</script>\n","var render = function() {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n return _vm.graduatedPrices[0]\n ? _c(\"div\", [\n _c(\"b\", [\n _vm._v(\n _vm._s(\n _vm.$translate(\"Ceres::Template.singleItemGraduatedPrices\")\n ) + \":\"\n )\n ]),\n _vm._v(\" \"),\n _c(\"table\", { staticClass: \"graduated-prices-table text-muted\" }, [\n _c(\n \"tbody\",\n [\n _vm._l(_vm.graduatedPrices, function(price, index) {\n return [\n _c(\"tr\", [\n _c(\n \"td\",\n {\n class: _vm.paddingClasses,\n style: _vm.paddingInlineStyles\n },\n [\n _vm._v(\n _vm._s(\n _vm.$translate(\n \"Ceres::Template.singleItemMinimumQuantity\"\n )\n ) +\n \" \" +\n _vm._s(price.minimumOrderQuantity)\n )\n ]\n ),\n _vm._v(\" \"),\n _c(\n \"td\",\n {\n staticClass: \"graduated-price\",\n class: _vm.paddingClasses,\n style: _vm.paddingInlineStyles\n },\n [\n _vm._v(\n \"\\n \" +\n _vm._s(price.unitPrice.formatted) +\n \"\\n \"\n ),\n _c(\"transition\", { attrs: { name: \"fade\" } }, [\n index === _vm.activeGraduationIndex\n ? _c(\"i\", {\n staticClass:\n \"fa fa-lg fa-check-circle-o text-appearance\",\n attrs: { \"aria-hidden\": \"true\" }\n })\n : _vm._e()\n ])\n ],\n 1\n ),\n _vm._v(\" \"),\n _vm.showBasePrice\n ? _c(\n \"td\",\n {\n staticClass:\n \"graduated-base-price pl-3 d-none d-xl-block\",\n class: _vm.paddingClasses,\n style: _vm.paddingInlineStyles\n },\n [\n _vm._v(\n _vm._s(\n _vm.$translate(\n \"Ceres::Template.singleItemGraduatedBasePrice\",\n { price: price.basePrice }\n )\n )\n )\n ]\n )\n : _vm._e()\n ]),\n _vm._v(\" \"),\n _vm.showBasePrice\n ? _c(\n \"tr\",\n { staticClass: \"graduated-base-price d-xl-none\" },\n [\n _c(\"td\", {\n class: _vm.paddingClasses,\n style: _vm.paddingInlineStyles\n }),\n _vm._v(\" \"),\n _c(\n \"td\",\n {\n class: _vm.paddingClasses,\n style: _vm.paddingInlineStyles\n },\n [\n _vm._v(\n _vm._s(\n _vm.$translate(\n \"Ceres::Template.singleItemGraduatedBasePrice\",\n { price: price.basePrice }\n )\n )\n )\n ]\n )\n ]\n )\n : _vm._e()\n ]\n })\n ],\n 2\n )\n ]),\n _vm._v(\" \"),\n _c(\"br\")\n ])\n : _vm._e()\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./GraduatedPrices.vue?vue&type=template&id=0fc0278e&\"\nimport script from \"./GraduatedPrices.vue?vue&type=script&lang=js&\"\nexport * from \"./GraduatedPrices.vue?vue&type=script&lang=js&\"\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\n/* hot reload */\nif (module.hot) {\n var api = require(\"/home/runner/work/plugin-ceres/plugin-ceres/node_modules/vue-hot-reload-api/dist/index.js\")\n api.install(require('vue'))\n if (api.compatible) {\n module.hot.accept()\n if (!api.isRecorded('0fc0278e')) {\n api.createRecord('0fc0278e', component.options)\n } else {\n api.reload('0fc0278e', component.options)\n }\n module.hot.accept(\"./GraduatedPrices.vue?vue&type=template&id=0fc0278e&\", function () {\n api.rerender('0fc0278e', {\n render: render,\n staticRenderFns: staticRenderFns\n })\n })\n }\n}\ncomponent.options.__file = \"resources/js/src/app/components/item/GraduatedPrices.vue\"\nexport default component.exports","import mod from \"-!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GraduatedPrices.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../../node_modules/babel-loader/lib/index.js!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GraduatedPrices.vue?vue&type=script&lang=js&\"","export * from \"-!../../../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GraduatedPrices.vue?vue&type=template&id=0fc0278e&\""],"sourceRoot":""}