{"version":3,"sources":["webpack:///./src/composables/meta.ts","webpack:///./src/composables/canonical.ts","webpack:///./src/views/Error.vue","webpack:///./src/views/Error.vue?80fb"],"names":["setMeta","title","description","document","length","metaDescription","querySelector","setAttribute","newMetaDescription","createElement","head","appendChild","useMeta","titleRef","ref","descriptionRef","onMounted","value","watchEffect","i","setCanonical","href","address","canonical","metaCanonicalValue","useCanonical","hrefRef","dontUseCanonical","remove","removeCanonical","_hoisted_1","class","_hoisted_2","_hoisted_3","_createElementVNode","_hoisted_4","_hoisted_5","_hoisted_6","xmlns","width","height","fill","viewBox","d","_defineComponent","__name","props","statusCode","setup","__props","header","useRoute","text","async","_ctx","_cache","_component_router_link","_resolveComponent","_openBlock","_createElementBlock","_toDisplayString","_createVNode","to","name","custom","default","_withCtx","navigate","role","onClick","_createTextVNode","_","__exports__"],"mappings":"mGAAA,kDAEM,SAAUA,EAAQC,EAAeC,GACnCC,SAASF,MAAQ,GAAGA,IAASA,EAAMG,OAAS,MAAQ,uFACpD,MAAMC,EAAkBF,SAASG,cAAc,4BAC/C,GAAID,EACAA,EAAgBE,aAAa,UAAWL,OACrC,CACH,MAAMM,EAAqBL,SAASM,cAAc,QAClDD,EAAmBD,aAAa,OAAQ,eACxCC,EAAmBD,aAAa,UAAWL,GAC3CC,SAASO,KAAKC,YAAYH,IAI5B,SAAUI,EAAQX,EAAeC,GACnC,MAAMW,EAAWC,cAAIb,GACfc,EAAiBD,cAAIZ,GAU3B,OARAc,qBAAU,KACNhB,EAAQa,EAASI,MAAOF,EAAeE,MAAKA,IAGhDC,uBAAY,KACRlB,EAAQa,EAASI,MAAOF,EAAeE,MAAKA,IAGzC,CACHhB,MAAOY,EACPX,YAAaa,K,kCC7BrB,+DAAAI,CAAA,oBAEM,SAAUC,EAAaC,GACzB,MAAMC,EAAU,6BAA+BD,EAAKjB,OAAS,EAAI,IAAIiB,EAASA,GACxEE,EAAYpB,SAASG,cAAc,yBAEzC,GAAIiB,EACAA,EAAUhB,aAAa,OAA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,IACP,CACDC,QAASC,mBAAS,EAAGC,cAAe,CAClCjC,6BAAoB,SAAU,CAC5BkC,KAAM,SACNC,QAASF,EACTpC,MAAO,wCACN,CACDM,EACAiC,0BAAiB,sBAChB,EAAGlC,MAERmC,EAAG,UClET,MAAMC,EAAc,EAEL","file":"js/Error.109d1dc1.js","sourcesContent":["import { ref, onMounted, watchEffect } from 'vue';\r\n\r\nexport function setMeta(title: string, description: string) {\r\n document.title = `${title}${(title.length ? ' - ' : '')}NG Hantverk - Upplev äventyret med våra handgjorda och exklusiva knivar och fodral`;\r\n const metaDescription = document.querySelector('meta[name=\"description\"]');\r\n if (metaDescription) {\r\n metaDescription.setAttribute('content', description);\r\n } else {\r\n const newMetaDescription = document.createElement('meta');\r\n newMetaDescription.setAttribute('name', 'description');\r\n newMetaDescription.setAttribute('content', description);\r\n document.head.appendChild(newMetaDescription);\r\n }\r\n}\r\n\r\nexport function useMeta(title: string, description: string) {\r\n const titleRef = ref(title);\r\n const descriptionRef = ref(description);\r\n\r\n onMounted(() => {\r\n setMeta(titleRef.value, descriptionRef.value);\r\n });\r\n\r\n watchEffect(() => {\r\n setMeta(titleRef.value, descriptionRef.value);\r\n });\r\n\r\n return {\r\n title: titleRef,\r\n description: descriptionRef,\r\n };\r\n}","import { ref, onMounted, watchEffect } from 'vue';\r\n\r\nexport function setCanonical(href: string) {\r\n const address = 'https://www.nghantverk.se' + (href.length > 0 ? `/${href}` : href);\r\n const canonical = document.querySelector('link[rel=\"canonical\"]');\r\n\r\n if (canonical) {\r\n canonical.setAttribute('href', address);\r\n } else {\r\n const metaCanonicalValue = document.createElement('link');\r\n metaCanonicalValue.setAttribute('rel', 'canonical');\r\n metaCanonicalValue.setAttribute('href', address);\r\n document.head.appendChild(metaCanonicalValue);\r\n }\r\n}\r\n\r\nexport function removeCanonical() {\r\n const canonical = document.querySelector('link[rel=\"canonical\"]');\r\n if (canonical)\r\n canonical.remove();\r\n}\r\n\r\nexport function useCanonical(href: string) {\r\n const hrefRef = ref(href);\r\n\r\n onMounted(() => {\r\n setCanonical(hrefRef.value);\r\n });\r\n\r\n watchEffect(() => {\r\n setCanonical(hrefRef.value);\r\n });\r\n\r\n return {\r\n href: hrefRef\r\n };\r\n}\r\n\r\nexport function dontUseCanonical() {\r\n removeCanonical();\r\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"text-center\" }\nconst _hoisted_2 = {\n class: \"text-secondary mt-2\",\n \"font-size\": \"font-size: 1.8rem;\"\n}\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"h1\", { class: \"display-3 mt-4\" }, \"🐞\", -1)\nconst _hoisted_4 = { class: \"display-6 mt-4\" }\nconst _hoisted_5 = [\"onClick\"]\nconst _hoisted_6 = /*#__PURE__*/_createElementVNode(\"svg\", {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"16\",\n height: \"16\",\n fill: \"currentColor\",\n class: \"bi bi-house\",\n viewBox: \"0 0 16 16\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", { d: \"M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.707 1.5ZM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5 5 5Z\" })\n], -1)\n\nimport { useRoute } from 'vue-router';\r\n import { ref, onMounted } from 'vue';\r\n import { useMeta } from '@/composables/meta';\r\n import { dontUseCanonical } from '@/composables/canonical';\r\n\r\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'Error',\n props: {\n statusCode: null\n },\n setup(__props: any) {\n\nconst props = __props as { statusCode: number }\n\r\n const route = useRoute();\r\n\r\n \r\n const header = ref(`${props.statusCode} - Något gick snett!`);\r\n const text = ref('Sidan du försöker nå är inte tillgänglig. Försök igen!');\r\n\r\n onMounted(async () => {\r\n useMeta(`Fel ${props.statusCode}`, `Något gick snett, sidan du försöker nå är inte tillgänglig`);\r\n dontUseCanonical();\r\n });\r\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_link = _resolveComponent(\"router-link\")!\n\n return (_openBlock(), _createElementBlock(\"section\", _hoisted_1, [\n _createElementVNode(\"h1\", _hoisted_2, _toDisplayString(header.value), 1),\n _hoisted_3,\n _createElementVNode(\"h2\", _hoisted_4, _toDisplayString(text.value), 1),\n _createVNode(_component_router_link, {\n to: { name: 'Start' },\n custom: \"\"\n }, {\n default: _withCtx(({ navigate }) => [\n _createElementVNode(\"button\", {\n role: \"button\",\n onClick: navigate,\n class: \"btn btn-primary btn-custom-size mt-5\"\n }, [\n _hoisted_6,\n _createTextVNode(\" TILL STARTSIDAN \")\n ], 8, _hoisted_5)\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./Error.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./Error.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__"],"sourceRoot":""}