{"version":3,"sources":["webpack:///./src/services/file.service.ts","webpack:///./src/components/Spinner.vue","webpack:///./src/components/Spinner.vue?575d","webpack:///./src/views/admin/article/SaveArticle.vue?121c","webpack:///./src/services/article.service.ts","webpack:///./src/services/attribute.service.ts","webpack:///./src/services/model.service.ts","webpack:///./src/services/suitable-for.service.ts","webpack:///./src/views/admin/article/SaveArticle.vue","webpack:///./src/views/admin/article/SaveArticle.vue?9f04"],"names":["FileService","Api","constructor","apiConfig","super","this","getAll","bind","remove","entityType","entityId","get","then","result","data","fileId","delete","fileApi","_hoisted_1","key","class","style","_hoisted_3","_createElementVNode","role","_defineComponent","__name","props","spinn","type","Boolean","setup","__props","_ctx","_cache","_openBlock","_createElementBlock","_createCommentVNode","__exports__","ArticleService","getAllActive","fetch","add","fetchById","articleSlug","id","dto","post","headers","articleApi","AttributeService","attributeApi","ModelService","modelApi","SuitableForService","suitableForApi","_withScopeId","n","_pushScopeId","_popScopeId","_hoisted_2","_hoisted_4","_hoisted_5","_hoisted_6","for","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","value","disabled","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_20","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","_hoisted_38","_hoisted_39","_hoisted_40","_hoisted_41","_hoisted_42","_hoisted_43","_hoisted_44","_hoisted_45","_hoisted_46","_hoisted_47","route","useRoute","article","ref","name","description","metaDescription","modelId","categoryId","attributes","files","suitsFor","isSold","isActive","price","isLoading","selectedCategoryId","selectedModelId","oldFiles","newFiles","fileInput","categories","models","suitsForList","addArticle","async","alert","articleObj","getSuitsFor","getAttributes","formData","FormData","append","JSON","stringify","forEach","file","index","fetchAll","checkAspectRatio","Promise","resolve","image","Image","reader","FileReader","onload","e","_e$target","src","target","readAsDataURL","aspectRatio","width","height","Math","abs","handleImageUpload","fileList","event","selectedImages","Array","from","filter","startsWith","invalidFiles","push","length","join","x","_suitsForList$value","isChecked","selected","categoryApi","articleId","Number","params","onMounted","error","console","_toDisplayString","_withDirectives","onSubmit","_withModifiers","$event","required","_vModelText","maxlength","placeholder","_Fragment","_renderList","model","_vModelSelect","category","_vModelCheckbox","attribute","toUpperCase","_createTextVNode","unit","suit","href","onClick","removeImage","ref_key","onChange","multiple","_vShow","_createVNode","Spinner"],"mappings":"uGAGA,8DAGA,MAAMA,UAAoBC,IACtBC,YAAmBC,GACfC,MAAMD,GAENE,KAAKC,OAASD,KAAKC,OAAOC,KAAKF,MAC/BA,KAAKG,OAASH,KAAKG,OAAOD,KAAKF,KAAKA,CAGjCC,OAAOG,EAAoBC,GAC9B,OAAOL,KAAKM,IAAqB,YAAYF,KAAcC,KACtDE,MAAMC,GACIA,EAAOC,OAInBN,OAAOC,EAAoBC,EAAkBK,GAChD,OAAOV,KAAKW,OAAY,cAAcP,KAAcC,KAAYK,KAC3DH,MAAMC,GACIA,EAAOC,QAKvB,MAAMG,EAAU,IAAIjB,EAAYG,M,kDC1BvC,MAAMe,EAAa,CACjBC,IAAK,EACLC,MAAO,mDACPC,MAAO,CAAC,OAAS,oBAQbC,EAAa,CANaC,6BAAoB,MAAO,CACzDH,MAAO,iBACPI,KAAM,UACL,CACYD,6BAAoB,OAAQ,CAAEH,MAAO,mBAAqB,eACrE,IAOwBK,gCAAiB,CAC3CC,OAAQ,UACRC,MAAO,CACLC,MAAO,CAAEC,KAAMC,UAEjBC,MAAMC,GAMD,CAACC,EAAUC,IACRF,EAAQJ,OACXO,sBAAcC,6BAAoB,MAAOlB,EAAYI,IACtDe,6BAAoB,IAAG,KC/B7B,MAAMC,EAAc,EAEL,O,kCCLf,W,oCCIA,8DAGA,MAAMC,UAAuBtC,IACzBC,YAAmBC,GACfC,MAAMD,GA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C,GAAa,CAClB,CAAC0J,SAAS3F,EAAUjD,SAEtB6I,sBAAaC,IAAS,CAAE5L,MAAO+F,EAAUjD,OAAS,KAAM,EAAG,CAAC,gB,yBCzehE,MAAMpC,G,OAA2B,GAAgB,GAAQ,CAAC,CAAC,YAAY,qBAExD,c","file":"js/SaveArticle.9c9804f9.js","sourcesContent":["import { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport { FileItem } from '../types/FileItem';\r\n\r\nimport { Api } from '../utils/api/api';\r\nimport { apiConfig } from '../utils/constants';\r\n\r\nclass FileService extends Api {\r\n public constructor(apiConfig: AxiosRequestConfig) {\r\n super(apiConfig);\r\n\r\n this.getAll = this.getAll.bind(this);\r\n this.remove = this.remove.bind(this);\r\n }\r\n\r\n public getAll(entityType: number, entityId: number): Promise> {\r\n return this.get>(`file/get/${entityType}/${entityId}`)\r\n .then((result: AxiosResponse>) => {\r\n return result.data\r\n });\r\n }\r\n\r\n public remove(entityType: number, entityId: number, fileId: number): Promise> {\r\n return this.delete(`admin/file/${entityType}/${entityId}/${fileId}`)\r\n .then((result: AxiosResponse) => {\r\n return result.data\r\n });\r\n }\r\n}\r\n\r\nexport const fileApi = new FileService(apiConfig);","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = {\n key: 0,\n class: \"d-flex justify-content-center align-items-center\",\n style: {\"height\":\"70vh !important\"}\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"div\", {\n class: \"spinner-border\",\n role: \"status\"\n}, [\n /*#__PURE__*/_createElementVNode(\"span\", { class: \"visually-hidden\" }, \"Laddar...\")\n], -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\n\n\r\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'Spinner',\n props: {\n spinn: { type: Boolean }\n },\n setup(__props: any) {\n\nconst props = __props as { spinn: boolean }\n\r\n \r\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.spinn)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, _hoisted_3))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./Spinner.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./Spinner.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--7-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--7-oneOf-1-1!../../../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--7-oneOf-1-2!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/vue-loader-v16/dist/index.js??ref--1-1!./SaveArticle.vue?vue&type=style&index=0&id=54f56187&scoped=true&lang=css\"","import { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport { ArticleViewModel } from '../types/ArticleViewModel';\r\nimport { SaveArticle } from '@/types/SaveArticle';\r\n\r\nimport { Api } from '../utils/api/api';\r\nimport { apiConfig } from '../utils/constants';\r\n\r\nclass ArticleService extends Api {\r\n public constructor(apiConfig: AxiosRequestConfig) {\r\n super(apiConfig);\r\n\r\n this.getAllActive = this.getAllActive.bind(this);\r\n this.getAll = this.getAll.bind(this);\r\n this.fetch = this.fetch.bind(this);\r\n this.add = this.add.bind(this);\r\n this.fetchById = this.fetchById.bind(this);\r\n }\r\n\r\n public getAllActive(): Promise> {\r\n return this.get>(`article/get`)\r\n .then((result: AxiosResponse>) => {\r\n return result.data\r\n });\r\n }\r\n\r\n public getAll(): Promise> {\r\n return this.get>(`admin/article/get`)\r\n .then((result: AxiosResponse>) => {\r\n return result.data\r\n });\r\n }\r\n\r\n public fetch(articleSlug: string): Promise {\r\n return this.get(`article/get/${articleSlug}`)\r\n .then((result: AxiosResponse) => {\r\n return result.data;\r\n })\r\n }\r\n\r\n public fetchById(id: number): Promise {\r\n return this.get(`admin/article/get/${id}`)\r\n .then((result: AxiosResponse) => {\r\n return result.data;\r\n })\r\n }\r\n\r\n public add(dto: FormData): Promise {\r\n return this.post(`admin/article`, dto, {\r\n headers: {\r\n 'Content-Type': 'multipart/form-data'\r\n }\r\n }).then((result: AxiosResponse) => {\r\n return result.data\r\n });\r\n }\r\n}\r\n\r\nexport const articleApi = new ArticleService(apiConfig);","import { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport { AttributeItem } from '../types/AttributeItem';\r\n\r\nimport { Api } from '../utils/api/api';\r\nimport { apiConfig } from '../utils/constants';\r\n\r\nclass AttributeService extends Api {\r\n public constructor(apiConfig: AxiosRequestConfig) {\r\n super(apiConfig);\r\n\r\n this.getAll = this.getAll.bind(this);\r\n }\r\n\r\n public getAll(): Promise> {\r\n return this.get>(`admin/attribute/get`)\r\n .then((result: AxiosResponse>) => {\r\n return result.data\r\n });\r\n }\r\n}\r\n\r\nexport const attributeApi = new AttributeService(apiConfig);","import { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport { Model } from '../types/Model';\r\n\r\nimport { Api } from '../utils/api/api';\r\nimport { apiConfig } from '../utils/constants';\r\n\r\nclass ModelService extends Api {\r\n public constructor(apiConfig: AxiosRequestConfig) {\r\n super(apiConfig);\r\n\r\n this.getAll = this.getAll.bind(this);\r\n }\r\n\r\n public getAll(): Promise> {\r\n return this.get>(`admin/model/get`)\r\n .then((result: AxiosResponse>) => {\r\n return result.data\r\n });\r\n }\r\n}\r\n\r\nexport const modelApi = new ModelService(apiConfig);","import { AxiosRequestConfig, AxiosResponse } from 'axios';\r\nimport { SuitsFor } from '@/types/SuitsFor';\r\n\r\nimport { Api } from '../utils/api/api';\r\nimport { apiConfig } from '../utils/constants';\r\n\r\nclass SuitableForService extends Api {\r\n public constructor(apiConfig: AxiosRequestConfig) {\r\n super(apiConfig);\r\n\r\n this.getAll = this.getAll.bind(this);\r\n }\r\n\r\n public getAll(): Promise> {\r\n return this.get>(`admin/suitablefor/get`)\r\n .then((result: AxiosResponse>) => {\r\n return result.data\r\n });\r\n }\r\n}\r\n\r\nexport const suitableForApi = new SuitableForService(apiConfig);","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, vModelText as _vModelText, withDirectives as _withDirectives, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, vModelSelect as _vModelSelect, vModelCheckbox as _vModelCheckbox, createTextVNode as _createTextVNode, withModifiers as _withModifiers, vShow as _vShow, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-54f56187\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"container-fluid\" }\nconst _hoisted_2 = [\"onSubmit\"]\nconst _hoisted_3 = { class: \"row\" }\nconst _hoisted_4 = { class: \"col-5\" }\nconst _hoisted_5 = { class: \"mb-3\" }\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", {\n for: \"name\",\n class: \"form-label\"\n}, \"Namn\", -1))\nconst _hoisted_7 = { class: \"mb-3\" }\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", {\n for: \"description\",\n class: \"form-label\"\n}, \"Beskrivning\", -1))\nconst _hoisted_9 = { class: \"mb-3\" }\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", {\n for: \"price\",\n class: \"form-label\"\n}, \"Pris\", -1))\nconst _hoisted_11 = { class: \"mb-3\" }\nconst _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", {\n for: \"meta-description\",\n class: \"form-label\"\n}, \"Meta-beskrivning\", -1))\nconst _hoisted_13 = { class: \"mb-3\" }\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", {\n for: \"model\",\n class: \"form-label\"\n}, \"Modell\", -1))\nconst _hoisted_15 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"option\", {\n value: \"-1\",\n disabled: \"\"\n}, \"Välj modell\", -1))\nconst _hoisted_16 = [\"value\"]\nconst _hoisted_17 = { class: \"mb-3\" }\nconst _hoisted_18 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", {\n for: \"category\",\n class: \"form-label\"\n}, \"Kategori\", -1))\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"option\", {\n value: \"-1\",\n disabled: \"\"\n}, \"Välj kategori\", -1))\nconst _hoisted_20 = [\"value\"]\nconst _hoisted_21 = { class: \"form-check mb-3\" }\nconst _hoisted_22 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", {\n class: \"form-check-label\",\n for: \"is-sold\"\n}, \" Såld \", -1))\nconst _hoisted_23 = { class: \"form-check mb-3\" }\nconst _hoisted_24 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", {\n class: \"form-check-label\",\n for: \"is-active\"\n}, \" Aktiv \", -1))\nconst _hoisted_25 = { class: \"col-7\" }\nconst _hoisted_26 = { class: \"col-12\" }\nconst _hoisted_27 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"h3\", { class: \"accent-4\" }, \"Specifikationer\", -1))\nconst _hoisted_28 = { class: \"list-group\" }\nconst _hoisted_29 = [\"for\"]\nconst _hoisted_30 = { class: \"attribute-value\" }\nconst _hoisted_31 = [\"id\", \"onUpdate:modelValue\"]\nconst _hoisted_32 = { class: \"attribute-description\" }\nconst _hoisted_33 = [\"onUpdate:modelValue\"]\nconst _hoisted_34 = { class: \"col-12 mt-4\" }\nconst _hoisted_35 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"h3\", { class: \"accent-4\" }, \"Lämpar sig för\", -1))\nconst _hoisted_36 = [\"onUpdate:modelValue\", \"id\"]\nconst _hoisted_37 = [\"for\"]\nconst _hoisted_38 = { class: \"row\" }\nconst _hoisted_39 = { class: \"col-12\" }\nconst _hoisted_40 = { class: \"mb-3\" }\nconst _hoisted_41 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"label\", {\n for: \"image\",\n class: \"form-label\"\n}, \"Bild(er)\", -1))\nconst _hoisted_42 = { class: \"row\" }\nconst _hoisted_43 = { class: \"image-container\" }\nconst _hoisted_44 = [\"href\"]\nconst _hoisted_45 = [\"src\"]\nconst _hoisted_46 = [\"onClick\"]\nconst _hoisted_47 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"button\", {\n type: \"submit\",\n class: \"btn btn-primary\"\n}, \"SPARA\", -1))\n\nimport { ref, onMounted } from 'vue';\r\n import Spinner from '@/components/Spinner.vue';\r\n import { categoryApi } from '@/services/category.service';\r\n import { attributeApi } from '@/services/attribute.service';\r\n import { modelApi } from '@/services/model.service';\r\n import { articleApi } from '@/services/article.service';\r\n import { suitableForApi } from '@/services/suitable-for.service';\r\n import { fileApi } from '@/services/file.service';\r\n import { CategoryViewModel } from '@/types/CategoryViewModel';\r\n import { Model } from '@/types/Model';\r\n import { AttributeItem } from '@/types/AttributeItem';\r\n import { SaveArticle } from '@/types/SaveArticle';\r\n import { SuitsFor } from '@/types/SuitsFor';\r\n import { SaveSuitsFor } from '@/types/SaveSuitsFor';\r\n import { useRoute } from 'vue-router';\r\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'SaveArticle',\n setup(__props) {\n\r\n const route = useRoute();\r\n\r\n const article = ref({\r\n id: -1,\r\n name: '',\r\n description: '',\r\n metaDescription: null,\r\n modelId: -1,\r\n categoryId: -1,\r\n attributes: [],\r\n files: [],\r\n suitsFor: [],\r\n isSold: false,\r\n isActive: true,\r\n price: 0\r\n });\r\n\r\n const isLoading = ref(true);\r\n\r\n const selectedCategoryId = ref(-1);\r\n const selectedModelId = ref(-1);\r\n const oldFiles = ref([])\r\n const newFiles = ref([]) \r\n const fileInput = ref(null);\r\n\r\n const categories = ref([]);\r\n const models = ref([]);\r\n const attributes = ref([]);\r\n const suitsForList = ref();\r\n\r\n const addArticle = async () => {\r\n isLoading.value = true;\r\n\r\n // Validera att både kategori och modell är valda\r\n if (selectedCategoryId.value < 0)\r\n return alert('Vänligen välj en kategori');\r\n\r\n // Skapa artikelobjektet\r\n const articleObj = {\r\n id: article.value.id,\r\n name: article.value.name,\r\n description: article.value.description,\r\n metaDescription: article.value.metaDescription,\r\n modelId: selectedModelId.value,\r\n categoryId: selectedCategoryId.value,\r\n suitsFor: getSuitsFor(),\r\n attributes: getAttributes(),\r\n files: article.value.files,\r\n isSold: article.value.isSold,\r\n isActive: article.value.isActive,\r\n price: article.value.price\r\n };\r\n\r\n const formData = new FormData();\r\n formData.append('article', JSON.stringify(articleObj));\r\n newFiles.value.forEach((file, index) => {\r\n formData.append('files', file);\r\n });\r\n\r\n await articleApi.add(formData);\r\n await fetchAll();\r\n isLoading.value = false;\r\n };\r\n\r\n const checkAspectRatio = (file: File): Promise => {\r\n return new Promise((resolve) => {\r\n const image = new Image();\r\n const reader = new FileReader();\r\n\r\n reader.onload = (e) => {\r\n image.src = e.target?.result as string;\r\n };\r\n reader.readAsDataURL(file);\r\n\r\n image.onload = () => {\r\n const width = image.width;\r\n const height = image.height;\r\n const aspectRatio = width / height;\r\n const targetAspectRatio = 4 / 3;\r\n\r\n if (Math.abs(aspectRatio - targetAspectRatio) > 0.01) {\r\n resolve(false);\r\n } else {\r\n resolve(true);\r\n }\r\n };\r\n });\r\n };\r\n\r\n const handleImageUpload = async (event: Event) => {\r\n const fileList = (event.target as HTMLInputElement).files || [];\r\n const selectedImages = Array.from(fileList).filter((file) => file.type.startsWith('image/'));\r\n\r\n const invalidFiles: string[] = [];\r\n for (const file of selectedImages) {\r\n const isValid = await checkAspectRatio(file);\r\n if (!isValid) {\r\n invalidFiles.push(file.name);\r\n }\r\n }\r\n\r\n if (invalidFiles.length > 0) {\r\n alert(`Formatet måste vara i 4:3. Följande bilder uppfyller inte kraven ${invalidFiles.join(', ')}`);\r\n } else {\r\n newFiles.value = selectedImages;\r\n }\r\n };\r\n\r\n const removeImage = async (entityId: number, fileId: number) => {\r\n try {\r\n isLoading.value = true;\r\n await fileApi.remove(0, entityId, fileId);\r\n oldFiles.value = oldFiles.value.filter(file => file.id !== fileId);\r\n } catch (e) {\r\n alert(e);\r\n }\r\n isLoading.value = false;\r\n };\r\n\r\n const getAttributes = () => {\r\n const selectedAttributes = attributes.value\r\n .filter(x => x.value !== null);\r\n\r\n return selectedAttributes;\r\n };\r\n\r\n const getSuitsFor = () => {\r\n const selected = suitsForList.value?.filter(x => x.isChecked);\r\n return selected;\r\n };\r\n\r\n const fetchAll = async() => {\r\n categories.value = await categoryApi.getAll();\r\n models.value = await modelApi.getAll();\r\n attributes.value = await attributeApi.getAll();\r\n suitsForList.value = (await suitableForApi.getAll()) as SaveSuitsFor[];\r\n newFiles.value = [];\r\n if (fileInput.value)\r\n fileInput.value.value = '';\r\n\r\n const articleId = Number(route.params.id);\r\n if (articleId > 0) {\r\n article.value = await articleApi.fetchById(articleId);\r\n selectedCategoryId.value = article.value.categoryId;\r\n selectedModelId.value = article.value.modelId;\r\n\r\n attributes.value = article.value.attributes;\r\n suitsForList.value = article.value.suitsFor as SaveSuitsFor[];\r\n oldFiles.value = article.value.files;\r\n }\r\n\r\n isLoading.value = false;\r\n }\r\n\r\n onMounted(async () => {\r\n try {\r\n await fetchAll();\r\n\r\n } catch (error) {\r\n console.error('Fel vid hämtning av data från API:', error);\r\n }\r\n });\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"h1\", null, _toDisplayString(article.value.id === -1 ? 'Lägg till ' : 'Ändra ') + \"artikel\", 1),\n _withDirectives(_createElementVNode(\"form\", {\n onSubmit: _withModifiers(addArticle, [\"prevent\"]),\n class: \"mt-4\"\n }, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", _hoisted_5, [\n _hoisted_6,\n _withDirectives(_createElementVNode(\"input\", {\n type: \"text\",\n id: \"name\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((article.value.name) = $event)),\n required: \"\",\n class: \"form-control\"\n }, null, 512), [\n [_vModelText, article.value.name]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _hoisted_8,\n _withDirectives(_createElementVNode(\"textarea\", {\n id: \"description\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((article.value.description) = $event)),\n class: \"form-control\"\n }, null, 512), [\n [_vModelText, article.value.description]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _hoisted_10,\n _withDirectives(_createElementVNode(\"input\", {\n type: \"number\",\n id: \"price\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => ((article.value.price) = $event)),\n required: \"\",\n class: \"form-control\"\n }, null, 512), [\n [_vModelText, article.value.price]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n _hoisted_12,\n _withDirectives(_createElementVNode(\"textarea\", {\n id: \"meta-description\",\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = ($event: any) => ((article.value.metaDescription) = $event)),\n class: \"form-control\",\n maxlength: \"280\",\n placeholder: \"Mycket beskrivande test för sökmotorer max: 270 tecken. Om Denna lämnas blank tas meta beskrivning från modell.\"\n }, null, 512), [\n [_vModelText, article.value.metaDescription]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_13, [\n _hoisted_14,\n _withDirectives(_createElementVNode(\"select\", {\n id: \"model\",\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = ($event: any) => ((selectedModelId).value = $event)),\n required: \"\",\n class: \"form-select\"\n }, [\n _hoisted_15,\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(models.value, (model) => {\n return (_openBlock(), _createElementBlock(\"option\", {\n value: model.id,\n key: model.id\n }, _toDisplayString(model.name), 9, _hoisted_16))\n }), 128))\n ], 512), [\n [_vModelSelect, selectedModelId.value]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_17, [\n _hoisted_18,\n _withDirectives(_createElementVNode(\"select\", {\n id: \"category\",\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = ($event: any) => ((selectedCategoryId).value = $event)),\n required: \"\",\n class: \"form-select\"\n }, [\n _hoisted_19,\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(categories.value, (category) => {\n return (_openBlock(), _createElementBlock(\"option\", {\n value: category.id,\n key: category.id\n }, _toDisplayString(category.name), 9, _hoisted_20))\n }), 128))\n ], 512), [\n [_vModelSelect, selectedCategoryId.value]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_21, [\n _withDirectives(_createElementVNode(\"input\", {\n class: \"form-check-input\",\n \"onUpdate:modelValue\": _cache[6] || (_cache[6] = ($event: any) => ((article.value.isSold) = $event)),\n type: \"checkbox\",\n value: \"\",\n id: \"is-sold\"\n }, null, 512), [\n [_vModelCheckbox, article.value.isSold]\n ]),\n _hoisted_22\n ]),\n _createElementVNode(\"div\", _hoisted_23, [\n _withDirectives(_createElementVNode(\"input\", {\n class: \"form-check-input\",\n \"onUpdate:modelValue\": _cache[7] || (_cache[7] = ($event: any) => ((article.value.isActive) = $event)),\n type: \"checkbox\",\n value: \"\",\n id: \"is-active\"\n }, null, 512), [\n [_vModelCheckbox, article.value.isActive]\n ]),\n _hoisted_24\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_25, [\n _createElementVNode(\"div\", _hoisted_26, [\n _hoisted_27,\n _createElementVNode(\"ul\", _hoisted_28, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(attributes.value, (attribute) => {\n return (_openBlock(), _createElementBlock(\"li\", {\n class: \"list-group-item attribute-item\",\n key: attribute.id\n }, [\n _createElementVNode(\"label\", {\n for: `label-for-${attribute.id}`,\n class: \"attribute-name\"\n }, _toDisplayString(attribute.name.toUpperCase()), 9, _hoisted_29),\n _createElementVNode(\"div\", _hoisted_30, [\n _withDirectives(_createElementVNode(\"input\", {\n type: \"text\",\n id: `label-for-${attribute.id}`,\n class: \"form-control-sm\",\n \"onUpdate:modelValue\": ($event: any) => ((attribute.value) = $event)\n }, null, 8, _hoisted_31), [\n [_vModelText, attribute.value]\n ]),\n _createTextVNode(\" \" + _toDisplayString(attribute.unit), 1)\n ]),\n _createElementVNode(\"div\", _hoisted_32, [\n _withDirectives(_createElementVNode(\"input\", {\n type: \"text\",\n class: \"form-control-sm\",\n \"onUpdate:modelValue\": ($event: any) => ((attribute.description) = $event),\n placeholder: \"Ange beskrivning...\"\n }, null, 8, _hoisted_33), [\n [_vModelText, attribute.description]\n ])\n ])\n ]))\n }), 128))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_34, [\n _hoisted_35,\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(suitsForList.value, (suit) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"form-check mb-3\",\n key: suit.id\n }, [\n _withDirectives(_createElementVNode(\"input\", {\n class: \"form-check-input\",\n \"onUpdate:modelValue\": ($event: any) => ((suit.isChecked) = $event),\n type: \"checkbox\",\n id: `label-for-suit-${suit.id}`\n }, null, 8, _hoisted_36), [\n [_vModelCheckbox, suit.isChecked]\n ]),\n _createElementVNode(\"label\", {\n class: \"form-check-label\",\n for: `label-for-suit-${suit.id}`\n }, _toDisplayString(suit.name.toUpperCase()), 9, _hoisted_37)\n ]))\n }), 128))\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_38, [\n _createElementVNode(\"div\", _hoisted_39, [\n _createElementVNode(\"div\", _hoisted_40, [\n _hoisted_41,\n _createElementVNode(\"div\", _hoisted_42, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(oldFiles.value, (image) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"col-md-4\",\n key: image.id\n }, [\n _createElementVNode(\"div\", _hoisted_43, [\n _createElementVNode(\"a\", {\n href: `/images/${image.name}.jpg`,\n target: \"_blank\"\n }, [\n _createElementVNode(\"img\", {\n src: `/images/${image.name}.webp`,\n class: \"img-fluid\"\n }, null, 8, _hoisted_45)\n ], 8, _hoisted_44),\n _createElementVNode(\"button\", {\n class: \"btn btn-danger btn-sm\",\n onClick: _withModifiers(($event: any) => (removeImage(image.entityId, image.id)), [\"prevent\"])\n }, \" Ta bort \", 8, _hoisted_46)\n ])\n ]))\n }), 128))\n ]),\n _createElementVNode(\"input\", {\n type: \"file\",\n ref_key: \"fileInput\",\n ref: fileInput,\n id: \"image\",\n onChange: handleImageUpload,\n class: \"form-control mt-3\",\n multiple: \"\"\n }, null, 544)\n ]),\n _hoisted_47\n ])\n ])\n ], 40, _hoisted_2), [\n [_vShow, !isLoading.value]\n ]),\n _createVNode(Spinner, { spinn: isLoading.value }, null, 8, [\"spinn\"])\n ]))\n}\n}\n\n})","import script from \"./SaveArticle.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./SaveArticle.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./SaveArticle.vue?vue&type=style&index=0&id=54f56187&scoped=true&lang=css\"\n\nimport exportComponent from \"C:\\\\dev\\\\priv\\\\NGHantverk.Store\\\\NGHantverk.Store.App\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-54f56187\"]])\n\nexport default __exports__"],"sourceRoot":""}