twofactor_backupcodes-settings.js.map 28 KB

1
  1. {"version":3,"file":"twofactor_backupcodes-settings.js?v=ea45701c4a3809f5d4a0","mappings":"uBAAIA,E,oGCgEJ,MChE4L,EDgE5L,CACAC,KAAA,mBACAC,WAAA,CACAC,SAAA,IACAC,cAAAA,EAAAA,GAEAC,KAAAA,KACA,CACAC,iBAAA,IAGAC,SAAA,CACAC,WAAAA,GACA,YAAAC,MAGA,mBAAAC,mBAAA,KAAAD,MAAAE,QAAA,CAAAC,EAAAC,IACAD,EAAAC,EAAA,QACA,KAJA,EAKA,EACAC,iBAAAA,KACAC,GAAAC,MAAAf,MAAA,aACA,oBAEAgB,OAAAA,GACA,YAAAC,OAAAC,MAAAF,OACA,EACAG,KAAAA,GACA,YAAAF,OAAAC,MAAAC,KACA,EACAC,IAAAA,GACA,YAAAH,OAAAC,MAAAE,IACA,EACAZ,KAAAA,GACA,YAAAS,OAAAC,MAAAV,KACA,EACAR,KAAAA,IACAc,GAAAC,MAAAf,MAAA,YAEAqB,SAAAA,GACA,YAAAb,OAAA,KAAAA,MAAAc,OAAA,CACA,GAEAC,QAAA,CACAC,mBAAAA,IACAC,EAAAA,EAAAA,KAAAC,MAAA,KAEA,KAAArB,iBAAA,EAEA,KAAAY,OAAAU,SAAA,YAAAD,MAAA,KACA,KAAArB,iBAAA,KACAuB,OAAAC,IAGA,MAFAf,GAAAgB,aAAAC,cAAAC,EAAA,iFACA,KAAA3B,iBAAA,EACAwB,CAAA,GACA,IACAD,MAAAK,EAAAC,MAAAC,KAAA,MACA,EAEAC,aAAA5B,GACAA,EAGAA,EAAAE,QAAA,CAAAC,EAAAC,IACAD,EAAAC,EAAA,QACA,IAJA,GAOAyB,UAAAA,IE5HO,SAAejC,GACrB,MAAMJ,EAAOc,GAAGC,MAAMf,MAAQ,YACxBsC,EAASC,OAAOC,KAAK,GAAIR,EAAE,wBAAyB,sBAAuB,CAAEhC,UACnFsC,EAAOG,SAASC,MAAM,OAASV,EAAE,wBAAyB,sBAA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U3C,EAASI,GAChBf,EAAoB6B,EAAEwB,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOtD,EAAoBS,EAAEC,EAAO,EAGjCkD,EAAqBV,KAA4B,sBAAIA,KAA4B,uBAAK,GAC1FU,EAAmBC,QAAQN,EAAqB3H,KAAK,KAAM,IAC3DgI,EAAmBhE,KAAO2D,EAAqB3H,KAAK,KAAMgI,EAAmBhE,KAAKhE,KAAKgI,G,KClDvF5D,EAAoB8D,QAAK3D,ECGzB,IAAI4D,EAAsB/D,EAAoBS,OAAEN,EAAW,CAAC,OAAO,IAAOH,EAAoB,SAC9F+D,EAAsB/D,EAAoBS,EAAEsD,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/apps/twofactor_backupcodes/src/views/PersonalSettings.vue","webpack:///nextcloud/apps/twofactor_backupcodes/src/views/PersonalSettings.vue?vue&type=script&lang=js","webpack:///nextcloud/apps/twofactor_backupcodes/src/service/PrintService.js","webpack://nextcloud/./apps/twofactor_backupcodes/src/views/PersonalSettings.vue?26a5","webpack://nextcloud/./apps/twofactor_backupcodes/src/views/PersonalSettings.vue?81a7","webpack://nextcloud/./apps/twofactor_backupcodes/src/views/PersonalSettings.vue?0c03","webpack:///nextcloud/apps/twofactor_backupcodes/src/store.js","webpack:///nextcloud/apps/twofactor_backupcodes/src/service/BackupCodesService.js","webpack:///nextcloud/apps/twofactor_backupcodes/src/settings.js","webpack:///nextcloud/apps/twofactor_backupcodes/src/views/PersonalSettings.vue?vue&type=style&index=0&id=70ee3f3c&prod&lang=scss&scoped=true","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","<!--\n - SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<div class=\"backupcodes-settings\">\n\t\t<NcButton v-if=\"!enabled\"\n\t\t\tid=\"generate-backup-codes\"\n\t\t\t:disabled=\"generatingCodes\"\n\t\t\t@click=\"generateBackupCodes\">\n\t\t\t<template #icon>\n\t\t\t\t<NcLoadingIcon v-if=\"generatingCodes\" />\n\t\t\t</template>\n\t\t\t{{ t('twofactor_backupcodes', 'Generate backup codes') }}\n\t\t</NcButton>\n\t\t<template v-else>\n\t\t\t<p class=\"backupcodes-settings__codes\">\n\t\t\t\t<template v-if=\"!haveCodes\">\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used, total}) }}\n\t\t\t\t</template>\n\t\t\t\t<template v-else>\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later.') }}\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t<li v-for=\"code in codes\"\n\t\t\t\t\t\t\t:key=\"code\"\n\t\t\t\t\t\t\tclass=\"backupcodes-settings__codes__code\">\n\t\t\t\t\t\t\t{{ code }}\n\t\t\t\t\t\t</li>\n\t\t\t\t\t</ul>\n\t\t\t\t</template>\n\t\t\t</p>\n\t\t\t<p class=\"backupcodes-settings__actions\">\n\t\t\t\t<template v-if=\"haveCodes\">\n\t\t\t\t\t<NcButton :href=\"downloadUrl\"\n\t\t\t\t\t\t:download=\"downloadFilename\"\n\t\t\t\t\t\ttype=\"primary\">\n\t\t\t\t\t\t{{ t('twofactor_backupcodes', 'Save backup codes') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t\t<NcButton @click=\"printCodes\">\n\t\t\t\t\t\t{{ t('twofactor_backupcodes', 'Print backup codes') }}\n\t\t\t\t\t</NcButton>\n\t\t\t\t</template>\n\t\t\t\t<NcButton id=\"generate-backup-codes\"\n\t\t\t\t\t@click=\"generateBackupCodes\">\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'Regenerate backup codes') }}\n\t\t\t\t</NcButton>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\t<em>\n\t\t\t\t\t{{ t('twofactor_backupcodes', 'If you regenerate backup codes, you automatically invalidate old codes.') }}\n\t\t\t\t</em>\n\t\t\t</p>\n\t\t</template>\n\t</div>\n</template>\n\n<script>\nimport { confirmPassword } from '@nextcloud/password-confirmation'\nimport { print } from '../service/PrintService.js'\nimport NcButton from '@nextcloud/vue/dist/Components/NcButton.js'\nimport NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'\n\nimport '@nextcloud/password-confirmation/dist/style.css'\n\nexport default {\n\tname: 'PersonalSettings',\n\tcomponents: {\n\t\tNcButton,\n\t\tNcLoadingIcon,\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tgeneratingCodes: false,\n\t\t}\n\t},\n\tcomputed: {\n\t\tdownloadUrl() {\n\t\t\tif (!this.codes) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn 'data:text/plain,' + encodeURIComponent(this.codes.reduce((prev, code) => {\n\t\t\t\treturn prev + code + '\\r\\n'\n\t\t\t}, ''))\n\t\t},\n\t\tdownloadFilename() {\n\t\t\tconst name = OC.theme.name || 'Nextcloud'\n\t\t\treturn name + '-backup-codes.txt'\n\t\t},\n\t\tenabled() {\n\t\t\treturn this.$store.state.enabled\n\t\t},\n\t\ttotal() {\n\t\t\treturn this.$store.state.total\n\t\t},\n\t\tused() {\n\t\t\treturn this.$store.state.used\n\t\t},\n\t\tcodes() {\n\t\t\treturn this.$store.state.codes\n\t\t},\n\t\tname() {\n\t\t\treturn OC.theme.name || 'Nextcloud'\n\t\t},\n\t\thaveCodes() {\n\t\t\treturn this.codes && this.codes.length > 0\n\t\t},\n\t},\n\tmethods: {\n\t\tgenerateBackupCodes() {\n\t\t\tconfirmPassword().then(() => {\n\t\t\t\t// Hide old codes\n\t\t\t\tthis.generatingCodes = true\n\n\t\t\t\tthis.$store.dispatch('generate').then(() => {\n\t\t\t\t\tthis.generatingCodes = false\n\t\t\t\t}).catch(err => {\n\t\t\t\t\tOC.Notification.showTemporary(t('twofactor_backupcodes', 'An error occurred while generating your backup codes'))\n\t\t\t\t\tthis.generatingCodes = false\n\t\t\t\t\tthrow err\n\t\t\t\t})\n\t\t\t}).catch(console.error.bind(this))\n\t\t},\n\n\t\tgetPrintData(codes) {\n\t\t\tif (!codes) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn codes.reduce((prev, code) => {\n\t\t\t\treturn prev + code + '<br>'\n\t\t\t}, '')\n\t\t},\n\n\t\tprintCodes() {\n\t\t\tprint(this.getPrintData(this.codes))\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.backupcodes-settings {\n\t&__codes {\n\t\t&__code {\n\t\t\tfont-family: monospace;\n\t\t\tletter-spacing: 0.02em;\n\t\t\tfont-size: 1.2em;\n\t\t}\n\t}\n\n\t&__actions {\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\talign-items: center;\n\t\tgap: var(--default-grid-baseline);\n\t}\n}\n</style>\n","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.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!./PersonalSettings.vue?vue&type=script&lang=js\"","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * @param {any} data -\n */\nexport function print(data) {\n\tconst name = OC.theme.name || 'Nextcloud'\n\tconst newTab = window.open('', t('twofactor_backupcodes', '{name} backup codes', { name }))\n\tnewTab.document.write('<h1>' + t('twofactor_backupcodes', '{name} backup codes', { name }) + '</h1>')\n\tnewTab.document.write('<pre>' + data + '</pre>')\n\tnewTab.print()\n\tnewTab.close()\n}\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.vue?vue&type=style&index=0&id=70ee3f3c&prod&lang=scss&scoped=true\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PersonalSettings.vue?vue&type=style&index=0&id=70ee3f3c&prod&lang=scss&scoped=true\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./PersonalSettings.vue?vue&type=template&id=70ee3f3c&scoped=true\"\nimport script from \"./PersonalSettings.vue?vue&type=script&lang=js\"\nexport * from \"./PersonalSettings.vue?vue&type=script&lang=js\"\nimport style0 from \"./PersonalSettings.vue?vue&type=style&index=0&id=70ee3f3c&prod&lang=scss&scoped=true\"\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 \"70ee3f3c\",\n null\n \n)\n\nexport default component.exports","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"backupcodes-settings\"},[(!_vm.enabled)?_c('NcButton',{attrs:{\"id\":\"generate-backup-codes\",\"disabled\":_vm.generatingCodes},on:{\"click\":_vm.generateBackupCodes},scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [(_vm.generatingCodes)?_c('NcLoadingIcon'):_vm._e()]},proxy:true}],null,false,4108280908)},[_vm._v(\"\\n\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Generate backup codes'))+\"\\n\\t\")]):[_c('p',{staticClass:\"backupcodes-settings__codes\"},[(!_vm.haveCodes)?[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Backup codes have been generated. {used} of {total} codes have been used.', {used: _vm.used, total: _vm.total}))+\"\\n\\t\\t\\t\")]:[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'These are your backup codes. Please save and/or print them as you will not be able to read the codes again later.'))+\"\\n\\t\\t\\t\\t\"),_c('ul',_vm._l((_vm.codes),function(code){return _c('li',{key:code,staticClass:\"backupcodes-settings__codes__code\"},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\"+_vm._s(code)+\"\\n\\t\\t\\t\\t\\t\")])}),0)]],2),_vm._v(\" \"),_c('p',{staticClass:\"backupcodes-settings__actions\"},[(_vm.haveCodes)?[_c('NcButton',{attrs:{\"href\":_vm.downloadUrl,\"download\":_vm.downloadFilename,\"type\":\"primary\"}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Save backup codes'))+\"\\n\\t\\t\\t\\t\")]),_vm._v(\" \"),_c('NcButton',{on:{\"click\":_vm.printCodes}},[_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Print backup codes'))+\"\\n\\t\\t\\t\\t\")])]:_vm._e(),_vm._v(\" \"),_c('NcButton',{attrs:{\"id\":\"generate-backup-codes\"},on:{\"click\":_vm.generateBackupCodes}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'Regenerate backup codes'))+\"\\n\\t\\t\\t\")])],2),_vm._v(\" \"),_c('p',[_c('em',[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('twofactor_backupcodes', 'If you regenerate backup codes, you automatically invalidate old codes.'))+\"\\n\\t\\t\\t\")])])]],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Vue from 'vue'\nimport Vuex, { Store } from 'vuex'\nimport { generateCodes } from './service/BackupCodesService.js'\n\nVue.use(Vuex)\n\nconst state = {\n\tenabled: false,\n\ttotal: 0,\n\tused: 0,\n\tcodes: [],\n}\n\nconst mutations = {\n\tsetEnabled(state, enabled) {\n\t\tVue.set(state, 'enabled', enabled)\n\t},\n\tsetTotal(state, total) {\n\t\tVue.set(state, 'total', total)\n\t},\n\tsetUsed(state, used) {\n\t\tVue.set(state, 'used', used)\n\t},\n\tsetCodes(state, codes) {\n\t\tVue.set(state, 'codes', codes)\n\t},\n}\n\nconst actions = {\n\tgenerate({ commit }) {\n\t\tcommit('setEnabled', false)\n\n\t\treturn generateCodes().then(({ codes, state }) => {\n\t\t\tcommit('setEnabled', state.enabled)\n\t\t\tcommit('setTotal', state.total)\n\t\t\tcommit('setUsed', state.used)\n\t\t\tcommit('setCodes', codes)\n\t\t\treturn true\n\t\t})\n\t},\n}\n\nexport default new Store({\n\tstrict: process.env.NODE_ENV !== 'production',\n\tstate,\n\tmutations,\n\tactions,\n})\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport Axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\n\n/**\n *\n */\nexport function generateCodes() {\n\tconst url = generateUrl('/apps/twofactor_backupcodes/settings/create')\n\n\treturn Axios.post(url, {}).then(resp => resp.data)\n}\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { loadState } from '@nextcloud/initial-state'\nimport Vue from 'vue'\n\nimport PersonalSettings from './views/PersonalSettings.vue'\nimport store from './store.js'\n\nVue.prototype.t = t\n\nconst initialState = loadState('twofactor_backupcodes', 'state')\nstore.replaceState(initialState)\n\nconst View = Vue.extend(PersonalSettings)\nnew View({\n\tstore,\n}).$mount('#twofactor-backupcodes-settings')\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.backupcodes-settings__codes__code[data-v-70ee3f3c]{font-family:monospace;letter-spacing:.02em;font-size:1.2em}.backupcodes-settings__actions[data-v-70ee3f3c]{display:flex;flex-wrap:wrap;align-items:center;gap:var(--default-grid-baseline)}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/twofactor_backupcodes/src/views/PersonalSettings.vue\"],\"names\":[],\"mappings\":\"AAGE,oDACC,qBAAA,CACA,oBAAA,CACA,eAAA,CAIF,gDACC,YAAA,CACA,cAAA,CACA,kBAAA,CACA,gCAAA\",\"sourcesContent\":[\"\\n.backupcodes-settings {\\n\\t&__codes {\\n\\t\\t&__code {\\n\\t\\t\\tfont-family: monospace;\\n\\t\\t\\tletter-spacing: 0.02em;\\n\\t\\t\\tfont-size: 1.2em;\\n\\t\\t}\\n\\t}\\n\\n\\t&__actions {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-wrap: wrap;\\n\\t\\talign-items: center;\\n\\t\\tgap: var(--default-grid-baseline);\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","// The chunk loading function for additional chunks\n// Since all referenced chunks are already included\n// in this file, this function is empty here.\n__webpack_require__.e = () => (Promise.resolve());","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 4423;","__webpack_require__.b = document.baseURI || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t4423: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunknextcloud\"] = self[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(85781)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","name","components","NcButton","NcLoadingIcon","data","generatingCodes","computed","downloadUrl","codes","encodeURIComponent","reduce","prev","code","downloadFilename","OC","theme","enabled","$store","state","total","used","haveCodes","length","methods","generateBackupCodes","confirmPassword","then","dispatch","catch","err","Notification","showTemporary","t","console","error","bind","getPrintData","printCodes","newTab","window","open","document","write","print","close","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","_vm","this","_c","_self","staticClass","_v","_s","_l","key","attrs","on","_e","scopedSlots","_u","fn","proxy","Vue","use","Vuex","mutations","setEnabled","setTotal","setUsed","setCodes","actions","generate","_ref","commit","url","generateUrl","Axios","post","resp","generateCodes","_ref2","Store","strict","process","prototype","initialState","loadState","store","replaceState","extend","PersonalSettings","$mount","___CSS_LOADER_EXPORT___","push","module","id","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","exports","loaded","__webpack_modules__","call","m","O","result","chunkIds","priority","notFulfilled","Infinity","i","fulfilled","j","Object","keys","every","splice","r","n","getter","__esModule","d","a","definition","o","defineProperty","enumerable","get","e","Promise","resolve","g","globalThis","Function","obj","prop","hasOwnProperty","Symbol","toStringTag","value","nmd","paths","children","b","baseURI","self","location","href","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","forEach","nc","__webpack_exports__"],"sourceRoot":""}