{"version":3,"sources":["webpack:///resources/js/src/app/components/item/TagList.vue","webpack:///./resources/js/src/app/components/item/TagList.vue?425f","webpack:///./resources/js/src/app/components/item/TagList.vue","webpack:///./resources/js/src/app/components/item/TagList.vue?bc9d","webpack:///./resources/js/src/app/components/item/TagList.vue?0b72"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA;AAEA;AAEA,kBAFA;AAIA;AACA,mBACA;AACA,kBADA;AAEA;AAFA,KAFA;AAMA,mBACA;AACA,kBADA;AAEA;AAFA,KAPA;AAWA,wBACA;AACA,kBADA;AAEA;AAFA,KAZA;AAgBA,mBACA;AACA,iBADA;AAEA;AAAA;AAAA;AAFA;AAjBA,GAJA;AA2BA;AACA;AACA;AADA;AADA,GA3BA;AAiCA;AACA,qBADA,+BAEA;AACA;AACA,KAJA;AAMA,QANA,kBAOA;AACA;AAEA;AAAA;AAAA;AACA;AAXA,GAjCA;AA+CA,WACA;AACA,qBADA,6BACA,OADA,EAEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA,KAXA;AAYA,aAZA,qBAYA,GAZA,EAaA;AACA,qBACA;AACA;AACA;AADA;AAGA;;AACA;AACA,KArBA;AAsBA,cAtBA,sBAsBA,GAtBA,EAuBA;AACA;;AACA,+CACA;AACA;AACA;;AACA;AACA;AA9BA;AAhDA,G;;;;;;;;;;;;AC7BA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,2BAA2B;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B,mBAAmB;AACnB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACjDA;AAAA;AAAA;AAAA;AAAsF;AAC3B;AACL;;;AAGtD;AACsG;AACtG,gBAAgB,2GAAU;AAC1B,EAAE,6EAAM;AACR,EAAE,kFAAM;AACR,EAAE,2FAAe;AACjB;AACA;AACA;AACA;;AAEA;;AAEA;AACA,IAAI,KAAU,EAAE,YAiBf;AACD;AACe,gF;;;;;;;;;;;;ACtCf;AAAA;AAAA,wCAA+L,CAAgB,2OAAG,EAAC,C;;;;;;;;;;;;ACAnN;AAAA;AAAA;AAAA;AAAA;AAAA","file":"chunks/ceres-client-40.js","sourcesContent":["<template>\n    <div v-if=\"tags && tags.length > 0\" class=\"pt-1 pb-1\">\n        <template v-if=\"isTagRouteEnabled\">\n            <a\n                v-for=\"tag in tags\"\n                :key=\"tag.id\"\n                :href=\"getTagLink(tag)\"\n                class=\"badge mr-1\"\n                :class=\"[tagAppearance, marginClasses, getTextColorClass(tag.color)]\"\n                :style=\"[getStyles(tag), marginInlineStyles]\">\n                <span>{{ tag.names.name }}</span>\n            </a>\n        </template>\n        <template v-else>\n            <span\n                v-for=\"tag in tags\"\n                :key=\"tag.id\"\n                class=\"badge mr-1\"\n                :class=\"[tagAppearance, marginClasses, getTextColorClass(tag.color)]\"\n                :style=\"[getStyles(tag), marginInlineStyles]\">\n                <span>{{ tag.names.name }}</span>\n            </span>\n        </template>\n    </div>\n</template>\n\n<script>\nimport { mapState } from \"vuex\";\n\nexport default {\n\n    name: \"tag-list\",\n\n    props: {\n        tagAppearance:\n        {\n            type: String,\n            default: \"\"\n        },\n        marginClasses:\n        {\n            type: String,\n            default: \"\"\n        },\n        marginInlineStyles:\n        {\n            type: String,\n            default: \"\"\n        },\n        enabledRoutes:\n        {\n            type: Array,\n            default: () => []\n        }\n    },\n\n    inject: {\n        itemId: {\n            default: null\n        }\n    },\n\n    computed: {\n        isTagRouteEnabled()\n        {\n            return this.enabledRoutes.includes(\"all\") || this.enabledRoutes.includes(\"tags\");\n        },\n\n        tags()\n        {\n            const currentVariation = this.$store.getters[`${this.itemId}/currentItemVariation`];\n            \n            return (currentVariation && currentVariation.tags) ? currentVariation.tags.filter((tag) => tag.names.name) : [];\n        }\n    },\n\n    methods:\n    {\n        getTextColorClass(bgColor)\n        {\n            if (!bgColor)return \"badge-primary\";\n            const color = (bgColor.charAt(0) === \"#\") ? bgColor.substring(1, 7) : bgColor;\n            const red = parseInt(color.substring(0, 2), 16);\n            const green = parseInt(color.substring(2, 4), 16);\n            const blue = parseInt(color.substring(4, 6), 16);\n            const result = (red * 0.299) + (green * 0.587) + (blue * 0.114);\n\n            return (result > 186) ? \"text-dark\" : \"text-light\";\n        },\n        getStyles(tag)\n        {\n            if (tag.color)\n            {\n                return {\n                    backgroundColor: tag.color\n                };\n            }\n            return {};\n        },\n        getTagLink(tag)\n        { \n            let url = \"/\" + encodeURIComponent(tag.names.name.toLowerCase().replace(/\\s+/g,'_')) + \"_t\" + tag.id;\n            if (App.defaultLanguage != App.language)\n            {\n                url = \"/\" + App.language + url;\n            }\n            return url;\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.tags && _vm.tags.length > 0\n    ? _c(\n        \"div\",\n        { staticClass: \"pt-1 pb-1\" },\n        [\n          _vm.isTagRouteEnabled\n            ? _vm._l(_vm.tags, function(tag) {\n                return _c(\n                  \"a\",\n                  {\n                    key: tag.id,\n                    staticClass: \"badge mr-1\",\n                    class: [\n                      _vm.tagAppearance,\n                      _vm.marginClasses,\n                      _vm.getTextColorClass(tag.color)\n                    ],\n                    style: [_vm.getStyles(tag), _vm.marginInlineStyles],\n                    attrs: { href: _vm.getTagLink(tag) }\n                  },\n                  [_c(\"span\", [_vm._v(_vm._s(tag.names.name))])]\n                )\n              })\n            : _vm._l(_vm.tags, function(tag) {\n                return _c(\n                  \"span\",\n                  {\n                    key: tag.id,\n                    staticClass: \"badge mr-1\",\n                    class: [\n                      _vm.tagAppearance,\n                      _vm.marginClasses,\n                      _vm.getTextColorClass(tag.color)\n                    ],\n                    style: [_vm.getStyles(tag), _vm.marginInlineStyles]\n                  },\n                  [_c(\"span\", [_vm._v(_vm._s(tag.names.name))])]\n                )\n              })\n        ],\n        2\n      )\n    : _vm._e()\n}\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns }","import { render, staticRenderFns } from \"./TagList.vue?vue&type=template&id=2a940624&\"\nimport script from \"./TagList.vue?vue&type=script&lang=js&\"\nexport * from \"./TagList.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('2a940624')) {\n      api.createRecord('2a940624', component.options)\n    } else {\n      api.reload('2a940624', component.options)\n    }\n    module.hot.accept(\"./TagList.vue?vue&type=template&id=2a940624&\", function () {\n      api.rerender('2a940624', {\n        render: render,\n        staticRenderFns: staticRenderFns\n      })\n    })\n  }\n}\ncomponent.options.__file = \"resources/js/src/app/components/item/TagList.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!./TagList.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!./TagList.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!./TagList.vue?vue&type=template&id=2a940624&\""],"sourceRoot":""}