text: (self.webpackChunk=self.webpackChunk||[]).push([["admin-chunk-0"],{"./resources/js/components/RecursiveCategories.vue":
  /*!*********************************************************************!*\
    !*** ./resources/js/components/RecursiveCategories.vue + 6 modules ***!
    \*********************************************************************/(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n  "default": () => (/* binding */ RecursiveCategories)\n});\n\n// EXTERNAL MODULE: ./node_modules/vue/dist/vue.esm-bundler.js\nvar vue_esm_bundler = __webpack_require__("./node_modules/vue/dist/vue.esm-bundler.js");\n;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[15].use[0]!./resources/js/components/RecursiveCategories.vue?vue&type=template&id=f123b25a&scoped=true\n\n\nconst _withId = /*#__PURE__*/(0,vue_esm_bundler.withScopeId)("data-v-f123b25a");\n\n(0,vue_esm_bundler.pushScopeId)("data-v-f123b25a");\n\nconst _hoisted_1 = {\n  href: "#",\n  class: "list-group-item"\n};\nconst _hoisted_2 = {\n  key: 0,\n  class: "list-group"\n};\n\n(0,vue_esm_bundler.popScopeId)();\n\nconst render = /*#__PURE__*/_withId((_ctx, _cache, $props, $setup, $data, $options) => {\n  const _component_recursive_categories = (0,vue_esm_bundler.resolveComponent)("recursive-categories", true);\n\n  return $props.categories ? ((0,vue_esm_bundler.openBlock)(true), (0,vue_esm_bundler.createBlock)(vue_esm_bundler.Fragment, {\n    key: 0\n  }, (0,vue_esm_bundler.renderList)($props.categories, category => {\n    return (0,vue_esm_bundler.openBlock)(), (0,vue_esm_bundler.createBlock)("div", {\n      class: ["list-group well", !category.parent_id ? \'list-group-root\' : \'\']\n    }, [(0,vue_esm_bundler.createVNode)("a", _hoisted_1, (0,vue_esm_bundler.toDisplayString)(category.name), 1\n    /* TEXT */\n    ), category.children ? ((0,vue_esm_bundler.openBlock)(), (0,vue_esm_bundler.createBlock)("div", _hoisted_2, [(0,vue_esm_bundler.createVNode)(_component_recursive_categories, {\n      categories: category.children\n    }, null, 8\n    /* PROPS */\n    , ["categories"])])) : (0,vue_esm_bundler.createCommentVNode)("v-if", true)], 2\n    /* CLASS */\n    );\n  }), 256\n  /* UNKEYED_FRAGMENT */\n  )) : (0,vue_esm_bundler.createCommentVNode)("v-if", true);\n});\n;// CONCATENATED MODULE: ./resources/js/components/RecursiveCategories.vue?vue&type=template&id=f123b25a&scoped=true\n\n;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[15].use[0]!./resources/js/components/RecursiveCategories.vue?vue&type=script&lang=js\n/* harmony default export */ const RecursiveCategoriesvue_type_script_lang_js = ({\n  name: \'recursive-categories\',\n  props: [\'categories\']\n});\n;// CONCATENATED MODULE: ./resources/js/components/RecursiveCategories.vue?vue&type=script&lang=js\n \n;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/sass-loader/dist/cjs.js!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[15].use[0]!./resources/js/components/RecursiveCategories.vue?vue&type=style&index=0&id=f123b25a&scoped=true&lang=scss\n// extracted by mini-css-extract-plugin\n\n;// CONCATENATED MODULE: ./resources/js/components/RecursiveCategories.vue?vue&type=style&index=0&id=f123b25a&scoped=true&lang=scss\n\n;// CONCATENATED MODULE: ./resources/js/components/RecursiveCategories.vue\n\n\n\n\n;\nRecursiveCategoriesvue_type_script_lang_js.render = render\nRecursiveCategoriesvue_type_script_lang_js.__scopeId = "data-v-f123b25a"\n/* hot reload */\nif (false) {}\n\nRecursiveCategoriesvue_type_script_lang_js.__file = "resources/js/components/RecursiveCategories.vue"\n\n/* harmony default export */ const RecursiveCategories = (RecursiveCategoriesvue_type_script_lang_js);\n\n//# sourceURL=webpack:///./resources/js/components/RecursiveCategories.vue_+_6_modules?')},"./resources/js/views/admin/Dashboard.vue":
  /*!************************************************************!*\
    !*** ./resources/js/views/admin/Dashboard.vue + 6 modules ***!
    \************************************************************/(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";eval('// ESM COMPAT FLAG\n__webpack_require__.r(__webpack_exports__);\n\n// EXPORTS\n__webpack_require__.d(__webpack_exports__, {\n  "default": () => (/* binding */ Dashboard)\n});\n\n// EXTERNAL MODULE: ./node_modules/vue/dist/vue.esm-bundler.js\nvar vue_esm_bundler = __webpack_require__("./node_modules/vue/dist/vue.esm-bundler.js");\n;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[15].use[0]!./resources/js/views/admin/Dashboard.vue?vue&type=template&id=22ef35f6&scoped=true\n\n\nconst _withId = /*#__PURE__*/(0,vue_esm_bundler.withScopeId)("data-v-22ef35f6");\n\n(0,vue_esm_bundler.pushScopeId)("data-v-22ef35f6");\n\nconst _hoisted_1 = {\n  key: 0\n};\n\nconst _hoisted_2 = /*#__PURE__*/(0,vue_esm_bundler.createVNode)("h1", null, "Admin panel", -1\n/* HOISTED */\n);\n\nconst _hoisted_3 = {\n  class: "mr-4"\n};\n\nconst _hoisted_4 = /*#__PURE__*/(0,vue_esm_bundler.createVNode)("p", {\n  class: "mb-0"\n}, "Name:", -1\n/* HOISTED */\n);\n\nconst _hoisted_5 = /*#__PURE__*/(0,vue_esm_bundler.createVNode)("h3", {\n  class: "mt-4"\n}, "Select category:", -1\n/* HOISTED */\n);\n\nconst _hoisted_6 = {\n  class: "category-dropdown"\n};\nconst _hoisted_7 = {\n  class: "data-items"\n};\nconst _hoisted_8 = {\n  class: "categories"\n};\n\nconst _hoisted_9 = /*#__PURE__*/(0,vue_esm_bundler.createVNode)("h3", null, "Categories", -1\n/* HOISTED */\n);\n\nconst _hoisted_10 = {\n  class: "list-group list-group-root well mt-8"\n};\nconst _hoisted_11 = {\n  key: 1\n};\n\nconst _hoisted_12 = /*#__PURE__*/(0,vue_esm_bundler.createVNode)("h1", null, "Please log in...", -1\n/* HOISTED */\n);\n\n(0,vue_esm_bundler.popScopeId)();\n\nconst render = /*#__PURE__*/_withId((_ctx, _cache, $props, $setup, $data, $options) => {\n  const _component_recursive_component = (0,vue_esm_bundler.resolveComponent)("recursive-component");\n\n  const _component_font_awesome_icon = (0,vue_esm_bundler.resolveComponent)("font-awesome-icon");\n\n  const _component_recursive_categories = (0,vue_esm_bundler.resolveComponent)("recursive-categories");\n\n  return _ctx.permission ? ((0,vue_esm_bundler.openBlock)(), (0,vue_esm_bundler.createBlock)("div", _hoisted_1, [_hoisted_2, (0,vue_esm_bundler.createVNode)("div", {\n    class: ["add-category", _ctx.add ? \'d-flex align-items-center\' : \'d-none\']\n  }, [(0,vue_esm_bundler.createVNode)("div", _hoisted_3, [_hoisted_4, (0,vue_esm_bundler.withDirectives)((0,vue_esm_bundler.createVNode)("input", {\n    type: "text",\n    id: "name",\n    "onUpdate:modelValue": _cache[1] || (_cache[1] = $event => _ctx.input.name = $event)\n  }, null, 512\n  /* NEED_PATCH */\n  ), [[vue_esm_bundler.vModelText, _ctx.input.name]])]), (0,vue_esm_bundler.createVNode)("div", null, [_hoisted_5, (0,vue_esm_bundler.createVNode)("div", _hoisted_6, [(0,vue_esm_bundler.createVNode)(_component_recursive_component, {\n    "active-class": _ctx.category,\n    selected: _ctx.selectCategory,\n    goto: () => {},\n    item: _ctx.categories\n  }, null, 8\n  /* PROPS */\n  , ["active-class", "selected", "goto", "item"])]), (0,vue_esm_bundler.createVNode)("button", {\n    class: "btn btn-primary",\n    onClick: _cache[2] || (_cache[2] = (...args) => _ctx.create && _ctx.create(...args))\n  }, "Add category")])], 2\n  /* CLASS */\n  ), (0,vue_esm_bundler.createVNode)("div", _hoisted_7, [(0,vue_esm_bundler.createVNode)("div", _hoisted_8, [_hoisted_9, (0,vue_esm_bundler.createVNode)("div", {\n    class: "add",\n    onClick: _cache[3] || (_cache[3] = $event => _ctx.add = !_ctx.add)\n  }, [(0,vue_esm_bundler.createVNode)(_component_font_awesome_icon, {\n    icon: ["fas", "plus"]\n  })]), (0,vue_esm_bundler.createVNode)("div", _hoisted_10, [(0,vue_esm_bundler.createVNode)(_component_recursive_categories, {\n    categories: _ctx.categories\n  }, null, 8\n  /* PROPS */\n  , ["categories"])])])])])) : ((0,vue_esm_bundler.openBlock)(), (0,vue_esm_bundler.createBlock)("div", _hoisted_11, [_hoisted_12]));\n});\n;// CONCATENATED MODULE: ./resources/js/views/admin/Dashboard.vue?vue&type=template&id=22ef35f6&scoped=true\n\n// EXTERNAL MODULE: ./node_modules/vuex/dist/vuex.esm-bundler.js\nvar vuex_esm_bundler = __webpack_require__("./node_modules/vuex/dist/vuex.esm-bundler.js");\n// EXTERNAL MODULE: ./node_modules/axios/index.js\nvar axios = __webpack_require__("./node_modules/axios/index.js");\nvar axios_default = /*#__PURE__*/__webpack_require__.n(axios);\n// EXTERNAL MODULE: ./resources/js/components/RecursiveCategories.vue + 6 modules\nvar RecursiveCategories = __webpack_require__("./resources/js/components/RecursiveCategories.vue");\n;// CONCATENATED MODULE: ./node_modules/ts-loader/index.js??clonedRuleSet-5.use[0]!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[15].use[0]!./resources/js/views/admin/Dashboard.vue?vue&type=script&lang=ts\n\r\n\r\n\r\n\r\n/* harmony default export */ const Dashboardvue_type_script_lang_ts = ((0,vue_esm_bundler.defineComponent)({\r\n    components: { RecursiveCategories: RecursiveCategories.default },\r\n    setup(props, { attrs }) {\r\n        const store = (0,vuex_esm_bundler.useStore)();\r\n        const user = (0,vue_esm_bundler.computed)(() => store.state.user);\r\n        const permission = (0,vue_esm_bundler.ref)(false);\r\n        const categories = (0,vue_esm_bundler.computed)(() => store.state.categories);\r\n        const add = (0,vue_esm_bundler.ref)(false);\r\n        const input = (0,vue_esm_bundler.ref)({ name: \'\', parent_id: 0 });\r\n        const parent = (0,vue_esm_bundler.ref)({});\r\n        const open = (0,vue_esm_bundler.ref)(false);\r\n        const products = (0,vue_esm_bundler.computed)(() => store.state.products);\r\n        const category = (0,vue_esm_bundler.ref)(0);\r\n        store.dispatch(\'fetchCategories\');\r\n        const getUser = () => {\r\n            axios_default().get(\'/api/user/\' + attrs[\'user\']).then((r) => permission.value = r.data);\r\n        };\r\n        const create = () => {\r\n            if (input.value.name) {\r\n                store.dispatch(\'createCategory\', input.value).then(() => {\r\n                    store.dispatch(\'fetchCategories\');\r\n                    input.value.name = \'\';\r\n                    input.value.parent_id = 0;\r\n                });\r\n            }\r\n        };\r\n        const selectCategory = (value) => {\r\n            if (category.value === value)\r\n                category.value = 0;\r\n            else\r\n                category.value = value;\r\n            input.value.parent_id = value;\r\n        };\r\n        getUser();\r\n        return {\r\n            user,\r\n            store,\r\n            permission,\r\n            categories,\r\n            add,\r\n            input,\r\n            parent,\r\n            open,\r\n            products,\r\n            category,\r\n            getUser,\r\n            selectCategory,\r\n            create\r\n        };\r\n    }\r\n}));\r\n\n;// CONCATENATED MODULE: ./resources/js/views/admin/Dashboard.vue?vue&type=script&lang=ts\n \n;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/vue-loader/dist/index.js??ruleSet[1].rules[15].use[0]!./resources/js/views/admin/Dashboard.vue?vue&type=style&index=0&id=22ef35f6&scoped=true&lang=css\n// extracted by mini-css-extract-plugin\n\n;// CONCATENATED MODULE: ./resources/js/views/admin/Dashboard.vue?vue&type=style&index=0&id=22ef35f6&scoped=true&lang=css\n\n;// CONCATENATED MODULE: ./resources/js/views/admin/Dashboard.vue\n\n\n\n\n;\nDashboardvue_type_script_lang_ts.render = render\nDashboardvue_type_script_lang_ts.__scopeId = "data-v-22ef35f6"\n/* hot reload */\nif (false) {}\n\nDashboardvue_type_script_lang_ts.__file = "resources/js/views/admin/Dashboard.vue"\n\n/* harmony default export */ const Dashboard = (Dashboardvue_type_script_lang_ts);\n\n//# sourceURL=webpack:///./resources/js/views/admin/Dashboard.vue_+_6_modules?')}}]);