\n \n \n\n\n\n\n\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PiHole.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--13-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PiHole.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./PiHole.vue?vue&type=template&id=516924ca&scoped=true&\"\nimport script from \"./PiHole.vue?vue&type=script&lang=js&\"\nexport * from \"./PiHole.vue?vue&type=script&lang=js&\"\nimport style0 from \"./PiHole.vue?vue&type=style&index=0&id=516924ca&scoped=true&lang=scss&\"\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 \"516924ca\",\n null\n \n)\n\nexport default component.exports","export default {\n props: {\n proxy: Object,\n },\n created: function () {\n // custom service often consume info from an API using the item link (url) as a base url,\n // but sometimes the base url is different. An optional alternative URL can be provided with the \"endpoint\" key.\n this.endpoint = this.item.endpoint || this.item.url;\n\n if (this.endpoint.endsWith(\"/\")) {\n this.endpoint = this.endpoint.slice(0, -1);\n }\n },\n methods: {\n fetch: function (path, init, json = true) {\n let options = {};\n\n if (this.proxy?.useCredentials) {\n options.credentials = \"include\";\n }\n\n // Each item can override the credential settings\n if (this.item.useCredentials !== undefined) {\n options.credentials =\n this.item.useCredentials === true ? \"include\" : \"omit\";\n }\n\n options = Object.assign(options, init);\n\n if (path.startsWith(\"/\")) {\n path = path.slice(1);\n }\n\n let url = this.endpoint;\n\n if (path) {\n url = `${this.endpoint}/${path}`;\n }\n\n return fetch(url, options).then((response) => {\n if (!response.ok) {\n throw new Error(\"Not 2xx response\");\n }\n\n return json ? response.json() : response;\n });\n },\n },\n};\n"],"sourceRoot":""}