2FAuth/public/js/app.js
2023-09-24 18:47:05 +02:00

2 lines
337 KiB
JavaScript
Vendored
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*! For license information please see app.js.LICENSE.txt */
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[773],{184:(t,e,r)=>{var n=r(538),o=r(152),i=r(806),a=r.n(i);n.default.use(o.Z);var s=document.documentElement.lang.substr(0,2);const c=new o.Z({locale:s,messages:a()});function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function l(){l=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function f(t,e,r,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),s=new E(o||[]);return n(a,"_invoke",{value:k(t,r,s)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var h={};function d(){}function m(){}function v(){}var y={};c(y,i,(function(){return this}));var g=Object.getPrototypeOf,_=g&&g(g(O([])));_&&_!==e&&r.call(_,i)&&(y=_);var w=v.prototype=d.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function o(n,i,a,s){var c=p(t[n],t,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==u(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){l.value=t,a(l)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function k(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return S()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=$(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=p(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function $(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,$(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function L(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(L,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:S}}function S(){return{value:void 0,done:!0}}return m.prototype=v,n(w,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:m,configurable:!0}),m.displayName=c(v,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,c(t,s,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},b(x.prototype),c(x.prototype,a,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(f(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(w),c(w,s,"Generator"),c(w,i,(function(){return this})),c(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function f(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}n.default.mixin({data:function(){return{appVersion:window.appVersion}},methods:{appLogout:function(t){var e,r=this;return(e=l().mark((function t(){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.$root.appConfig.proxyAuth){t.next=8;break}if(!r.$root.appConfig.proxyLogoutUrl){t.next=5;break}location.assign(r.$root.appConfig.proxyLogoutUrl),t.next=6;break;case 5:return t.abrupt("return",!1);case 6:t.next=12;break;case 8:return t.next=10,r.axios.get("/user/logout");case 10:r.clearStorage(),r.$router.push({name:"login",params:{forceRefresh:!0}});case 12:case"end":return t.stop()}}),t)})),function(){var t=this,r=arguments;return new Promise((function(n,o){var i=e.apply(t,r);function a(t){f(i,n,o,a,s,"next",t)}function s(t){f(i,n,o,a,s,"throw",t)}a(void 0)}))})()},clearStorage:function(){this.$storage.remove("accounts"),this.$storage.remove("groups"),this.$storage.remove("lastRoute"),this.$storage.remove("authenticated")},isUrl:function(t){return new RegExp(/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/).test(t)},openInBrowser:function(t){var e=document.createElement("a");e.setAttribute("href",t),e.dispatchEvent(new MouseEvent("click",{view:window,bubbles:!0,cancelable:!0}))},inputId:function(t,e){var r;switch(e=e.toString(),t){case"text":default:r="txt";break;case"button":r="btn";break;case"email":r="eml";break;case"password":r="pwd";break;case"radio":r="rdo";break;case"label":r="lbl"}return r+e[0].toUpperCase()+e.toLowerCase().slice(1)},setTheme:function(t){document.documentElement.dataset.theme=t},applyPreferences:function(t){for(var e in t)try{this.$root.userPreferences[e]=t[e]}catch(t){console.log(t)}"browser"!=this.$root.userPreferences.lang&&(c.locale=this.$root.userPreferences.lang,document.documentElement.lang=this.$root.userPreferences.lang),this.setTheme(this.$root.userPreferences.theme)},displayPwd:function(t){if(this.$root.userPreferences.formatPassword&&t.length>0){var e=Math.ceil(this.$root.userPreferences.formatPasswordBy<1?t.length*this.$root.userPreferences.formatPasswordBy:this.$root.userPreferences.formatPasswordBy),r=t.match(new RegExp(".{1,".concat(e,"}"),"g"));r&&(t=r.join(" "))}return this.$root.userPreferences.showOtpAsDot?t.replace(/[0-9]/g,"●"):t},strip_tags:function(t){return t.replace(/(<([^> ]+)>)/gi,"")}}});var p=r(23);n.default.use(p.S,{prefix:"",driver:"local",ttl:105408e5,replacer:function(t,e){return e}});var h=r(345);function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){v(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function v(t,e,r){return(e=_(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y(t){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},y(t)}function g(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,_(n.key),n)}}function _(t){var e=function(t,e){if("object"!==y(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==y(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===y(e)?e:String(e)}var w=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.errors={}}var e,r,n;return e=t,r=[{key:"set",value:function(t,e){"object"===y(t)?this.errors=t:this.set(m(m({},this.errors),{},v({},t,b(e))))}},{key:"all",value:function(){return this.errors}},{key:"has",value:function(t){return this.errors.hasOwnProperty(t)}},{key:"hasAny",value:function(){for(var t=this,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return r.some((function(e){return t.has(e)}))}},{key:"any",value:function(){return Object.keys(this.errors).length>0}},{key:"get",value:function(t){if(this.has(t))return this.getAll(t)[0]}},{key:"getAll",value:function(t){return b(this.errors[t]||[])}},{key:"only",value:function(){for(var t=this,e=[],r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return n.forEach((function(r){var n=t.get(r);n&&e.push(n)})),e}},{key:"flatten",value:function(){return Object.values(this.errors).reduce((function(t,e){return t.concat(e)}),[])}},{key:"clear",value:function(t){var e=this,r={};t&&Object.keys(this.errors).forEach((function(n){n!==t&&(r[n]=e.errors[n])})),this.set(r)}}],r&&g(e.prototype,r),n&&g(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function b(t){return Array.isArray(t)?t:[t]}function x(t){return x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},x(t)}function k(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function $(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?k(Object(r),!0).forEach((function(e){L(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function L(t,e,r){return(e=E(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function C(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,E(n.key),n)}}function E(t){var e=function(t,e){if("object"!==x(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==x(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===x(e)?e:String(e)}var O=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.isBusy=!1,this.isDisabled=!1,this.errors=new w,this.originalData=this.deepCopy(e),Object.assign(this,e)}var e,r,o;return e=t,r=[{key:"fill",value:function(t){var e=this;this.keys().forEach((function(r){e[r]=t[r]}))}},{key:"setOriginal",value:function(){var e=this;Object.keys(this).filter((function(e){return!t.ignore.includes(e)})).forEach((function(t){e.originalData[t]=e.deepCopy(e[t])}))}},{key:"fillWithKeyValueObject",value:function(t){var e=this;this.keys().forEach((function(r){var n=t.find((function(t){return t.key===r.toString()}));null!=n&&(e[r]=n.value)}))}},{key:"data",value:function(){var t=this;return this.keys().reduce((function(e,r){return $($({},e),{},L({},r,t[r]))}),{})}},{key:"keys",value:function(){return Object.keys(this).filter((function(e){return!t.ignore.includes(e)}))}},{key:"startProcessing",value:function(){this.errors.clear(),this.isBusy=!0}},{key:"finishProcessing",value:function(){this.isBusy=!1}},{key:"clear",value:function(){this.errors.clear()}},{key:"reset",value:function(){var e=this;Object.keys(this).filter((function(e){return!t.ignore.includes(e)})).forEach((function(t){e[t]=e.deepCopy(e.originalData[t])}))}},{key:"get",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.submit("get",t,e)}},{key:"post",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.submit("post",t,e)}},{key:"patch",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.submit("patch",t,e)}},{key:"put",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.submit("put",t,e)}},{key:"delete",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.submit("delete",t,e)}},{key:"submit",value:function(t,e){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.startProcessing();var i="get"===t?{params:this.data()}:this.data();return new Promise((function(a,s){n.default.axios.request($({url:r.route(e),method:t,data:i},o)).then((function(t){r.finishProcessing(),a(t)})).catch((function(t){r.isBusy=!1,t.response&&r.errors.set(r.extractErrors(t.response)),s(t)}))}))}},{key:"upload",value:function(t,e){var r=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.startProcessing(),new Promise((function(i,a){n.default.axios.request($({url:r.route(t),method:"post",data:e,header:{"Content-Type":"multipart/form-data"}},o)).then((function(t){r.finishProcessing(),i(t)})).catch((function(t){r.isBusy=!1,t.response&&r.errors.set(r.extractErrors(t.response)),a(t)}))}))}},{key:"extractErrors",value:function(e){return e.data&&"object"===x(e.data)?e.data.errors?$({},e.data.errors):e.data.message?{error:e.data.message}:$({},e.data):{error:t.errorMessage}}},{key:"route",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e;return t.routes.hasOwnProperty(e)&&(n=decodeURI(t.routes[e])),"object"!==x(r)&&(r={id:r}),Object.keys(r).forEach((function(t){n=n.replace("{".concat(t,"}"),r[t])})),n}},{key:"onKeydown",value:function(t){t.target.name&&this.errors.clear(t.target.name)}},{key:"deepCopy",value:function(t){var e=this;if(null===t||"object"!==x(t))return t;var r=Array.isArray(t)?[]:{};return Object.keys(t).forEach((function(n){r[n]=e.deepCopy(t[n])})),r}}],r&&C(e.prototype,r),o&&C(e,o),Object.defineProperty(e,"prototype",{writable:!1}),t}();O.routes={},O.errorMessage="Something went wrong. Please try again.",O.ignore=["isBusy","isDisabled","errors","originalData"];const S=O,P={name:"Start",data:function(){return{accountCount:null,form:new S,alternativeMethod:null}},props:{showAdvancedFormButton:{type:Boolean,default:!0},showImportButton:{type:Boolean,default:!0},returnToView:{type:String,default:"accounts"}},mounted:function(){var t=this;this.axios.get("api/v1/twofaccounts/count").then((function(e){t.accountCount=e.data.count}))},created:function(){var t=this;this.$nextTick((function(){t.$root.userPreferences.useDirectCapture&&"upload"===t.$root.userPreferences.defaultCaptureMode&&t.$refs.qrcodeInputLabel.click()}))},methods:{submitQrCode:function(){var t=this,e=new FormData;e.append("qrcode",this.$refs.qrcodeInput.files[0]),e.append("inputFormat","fileUpload"),this.form.upload("/api/v1/qrcode/decode",e,{returnError:!0}).then((function(e){"otpauth-migration://offline?data="===e.data.data.slice(0,33).toLowerCase()?t.$router.push({name:"importAccounts",params:{migrationUri:e.data.data}}):t.$router.push({name:"createAccount",params:{decodedUri:e.data.data}})})).catch((function(e){t.$notify({type:"is-danger",text:t.$t(e.response.data.message)})}))},capture:function(){this.$router.push({name:"capture"})}}};var T=r(900);const A=(0,T.Z)(P,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"container has-text-centered"},[e("div",{staticClass:"columns quick-uploader"},[e("div",{staticClass:"column is-full quick-uploader-header",class:{"is-invisible":0!==t.accountCount}},[t._v("\n "+t._s(t.$t("twofaccounts.no_account_here"))),e("br"),t._v("\n "+t._s(t.$t("twofaccounts.add_first_account"))+"\n ")]),t._v(" "),e("div",{staticClass:"column is-full quick-uploader-button"},[e("div",{staticClass:"quick-uploader-centerer"},[t.$root.userPreferences.useBasicQrcodeReader?e("label",{ref:"qrcodeInputLabel",staticClass:"button is-link is-medium is-rounded is-main",attrs:{role:"button",tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$refs.qrcodeInputLabel.click()}}},[e("input",{ref:"qrcodeInput",staticClass:"file-input",attrs:{"aria-hidden":"true",tabindex:"-1",type:"file",accept:"image/*"},on:{change:t.submitQrCode}}),t._v("\n "+t._s(t.$t("twofaccounts.forms.upload_qrcode"))+"\n ")]):e("button",{staticClass:"button is-link is-medium is-rounded is-main",on:{click:function(e){return t.capture()}}},[t._v("\n "+t._s(t.$t("twofaccounts.forms.scan_qrcode"))+"\n ")])])]),t._v(" "),e("div",{staticClass:"column is-full"},[e("div",{staticClass:"block",class:t.$root.showDarkMode?"has-text-light":"has-text-grey-dark"},[t._v(t._s(t.$t("twofaccounts.forms.alternative_methods")))]),t._v(" "),t.$root.userPreferences.useBasicQrcodeReader?t._e():e("div",{staticClass:"block has-text-link"},[e("label",{ref:"qrcodeInputLabel",staticClass:"button is-link is-outlined is-rounded",attrs:{role:"button",tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$refs.qrcodeInputLabel.click()}}},[e("input",{ref:"qrcodeInput",staticClass:"file-input",attrs:{"aria-hidden":"true",tabindex:"-1",type:"file",accept:"image/*"},on:{change:t.submitQrCode}}),t._v("\n "+t._s(t.$t("twofaccounts.forms.upload_qrcode"))+"\n ")])]),t._v(" "),t.showAdvancedFormButton?e("div",{staticClass:"block has-text-link"},[e("router-link",{staticClass:"button is-link is-outlined is-rounded",attrs:{to:{name:"createAccount"}}},[t._v("\n "+t._s(t.$t("twofaccounts.forms.use_advanced_form"))+"\n ")])],1):t._e(),t._v(" "),t.showImportButton?e("div",{staticClass:"block has-text-link"},[e("router-link",{staticClass:"button is-link is-outlined is-rounded",attrs:{id:"btnImport",to:{name:"importAccounts"}}},[t._v("\n "+t._s(t.$t("twofaccounts.import.import"))+"\n ")])],1):t._e()])]),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[t.accountCount>0?e("p",{staticClass:"control"},[e("router-link",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"lnkBack",to:{name:t.returnToView}}},[t._v("\n "+t._s(t.$t("commons.back"))+"\n ")])],1):t._e()])],1)}),[],!1,null,null,null).exports;function N(t){return N="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},N(t)}function j(){j=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==N(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function I(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function F(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){I(i,n,o,a,s,"next",t)}function s(t){I(i,n,o,a,s,"throw",t)}a(void 0)}))}}const D={data:function(){return{showStream:!0,errorText:"",form:new S({qrcode:null,uri:""})}},components:{QrcodeStream:r(464).QrcodeStream},methods:{exitStream:function(){this.camera="off",this.$router.go(-1)},onStreamerInit:function(t){var e=this;return F(j().mark((function r(){return j().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t;case 3:r.next=8;break;case 5:r.prev=5,r.t0=r.catch(0),"NotAllowedError"===r.t0.name?e.errorText="need_grant_permission":"NotReadableError"===r.t0.name?e.errorText="not_readable":"NotFoundError"===r.t0.name?e.errorText="no_cam_on_device":"NotSupportedError"===r.t0.name||"InsecureContextError"===r.t0.name?e.errorText="secured_context_required":"OverconstrainedError"===r.t0.name?e.errorText="camera_not_suitable":"StreamApiNotSupportedError"===r.t0.name&&(e.errorText="stream_api_not_supported");case 8:case"end":return r.stop()}}),r,null,[[0,5]])})))()},submitUri:function(t){var e=this;return F(j().mark((function r(){return j().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e.form.uri=t,e.form.uri?"otpauth-migration://offline?data="==e.form.uri.slice(0,33).toLowerCase()?e.pushUriToImportForm(e.form.uri):"otpauth://totp/"!==e.form.uri.slice(0,15).toLowerCase()&&"otpauth://hotp/"!==e.form.uri.slice(0,15).toLowerCase()?e.$notify({type:"is-warning",text:e.$t("errors.no_valid_otp")}):e.pushUriToCreateForm(e.form.uri):e.$notify({type:"is-warning",text:e.$t("errors.qrcode_cannot_be_read")});case 2:case"end":return r.stop()}}),r)})))()},pushUriToCreateForm:function(t){this.$router.push({name:"createAccount",params:{decodedUri:t}})},pushUriToImportForm:function(t){this.$router.push({name:"importAccounts",params:{migrationUri:t}})}}};const G=(0,T.Z)(D,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"modal is-active"},[e("div",{staticClass:"modal-background"}),t._v(" "),e("div",{staticClass:"modal-content"},[e("section",{staticClass:"section"},[e("div",{staticClass:"columns is-centered"},[e("div",{staticClass:"column is-three-quarters"},[e("div",{staticClass:"modal-slot box has-text-centered is-shadowless"},[t.errorText?e("div",[e("p",{staticClass:"block is-size-5"},[t._v(t._s(t.$t("twofaccounts.stream.live_scan_cant_start")))]),t._v(" "),e("p",{staticClass:"block",class:{"has-text-light":t.$root.showDarkMode}},[t._v(t._s(t.$t("twofaccounts.stream."+t.errorText+".reason")))]),t._v(" "),e("p",{staticClass:"is-size-7"},[t._v(t._s(t.$t("twofaccounts.stream."+t.errorText+".solution")))])]):e("span",{staticClass:"is-size-4",class:t.$root.showDarkMode?"has-text-light":"has-text-grey-dark"},[e("font-awesome-icon",{attrs:{icon:["fas","spinner"],size:"2x",spin:""}})],1)])])])])]),t._v(" "),e("div",{staticClass:"fullscreen-streamer"},[e("qrcode-stream",{attrs:{camera:"auto"},on:{decode:t.submitUri,init:t.onStreamerInit}})],1),t._v(" "),e("div",{staticClass:"fullscreen-footer"},[e("button",{staticClass:"button is-large is-warning is-rounded",attrs:{id:"btnCancel"},on:{click:function(e){return t.exitStream()}}},[t._v("\n "+t._s(t.$t("commons.cancel"))+"\n ")])])])}),[],!1,null,null,null).exports;const M={name:"Modal",data:function(){return{showcloseButton:this.closable}},props:{value:Boolean,closable:{type:Boolean,default:!0}},computed:{isActive:{get:function(){return this.value},set:function(t){this.$emit("input",t)}}},methods:{closeModal:function(t){t&&(this.isActive=!1,this.$notify({clean:!0}),this.$parent.$emit("modalClose"))}}};const B=(0,T.Z)(M,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"modal modal-otp",class:{"is-active":t.isActive}},[e("div",{staticClass:"modal-background",on:{click:function(e){return e.stopPropagation(),t.closeModal.apply(null,arguments)}}}),t._v(" "),e("div",{staticClass:"modal-content"},[e("section",{staticClass:"section"},[e("div",{staticClass:"columns is-centered"},[e("div",{staticClass:"column is-three-quarters"},[e("div",{staticClass:"modal-slot box has-text-centered is-shadowless"},[t._t("default")],2)])])])]),t._v(" "),this.showcloseButton?e("div",{staticClass:"fullscreen-footer"},[e("button",{ref:"closeModalButton",staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"btnClose"},on:{click:function(e){return e.stopPropagation(),t.closeModal.apply(null,arguments)}}},[t._v("\n "+t._s(t.$t("commons.close"))+"\n ")])]):t._e()])}),[],!1,null,null,null).exports;const q={name:"TotpLooper",data:function(){return{generatedAt:null,remainingTimeout:null,initialStepToNextStepTimeout:null,stepToStepInterval:null,stepIndex:null}},props:{step_count:{type:Number,default:10},period:Number,generated_at:Number,autostart:{type:Boolean,default:!0}},computed:{elapsedTimeInCurrentPeriod:function(){return this.generatedAt%this.period},remainingTimeBeforeEndOfPeriod:function(){return this.period-this.elapsedTimeInCurrentPeriod},durationBetweenTwoSteps:function(){return this.period/this.step_count},initialStepIndex:function(){var t=this.elapsedTimeInCurrentPeriod*this.step_count/this.period;return Math.floor(t)+0}},mounted:function(){1==this.autostart&&this.startLoop()},methods:{startLoop:function(){this.clearLooper(),this.generatedAt=this.generated_at,this.$emit("loop-started",this.initialStepIndex),this.stepIndex=this.initialStepIndex;var t=this;this.remainingTimeout=setTimeout((function(){t.clearLooper(),t.$emit("loop-ended")}),1e3*this.remainingTimeBeforeEndOfPeriod);var e=Math.ceil(this.elapsedTimeInCurrentPeriod/this.durationBetweenTwoSteps)*this.durationBetweenTwoSteps-this.elapsedTimeInCurrentPeriod;this.initialStepToNextStepTimeout=setTimeout((function(){e>0&&(t.stepIndex+=1,t.$emit("stepped-up",t.stepIndex)),t.stepToStepInterval=setInterval((function(){t.stepIndex+=1,t.$emit("stepped-up",t.stepIndex)}),1e3*t.durationBetweenTwoSteps)}),1e3*e)},clearLooper:function(){clearTimeout(this.remainingTimeout),clearTimeout(this.initialStepToNextStepTimeout),clearInterval(this.stepToStepInterval),this.stepIndex=this.generatedAt=null}},beforeDestroy:function(){this.clearLooper()}};const R=(0,T.Z)(q,(function(){return(0,this._self._c)("div")}),[],!1,null,null,null).exports;const U={name:"Dots",data:function(){return{activeDot:0}},mounted:function(){null!=this.initialIndex&&this.turnOn(this.initialIndex)},props:{stepCount:{type:Number,default:10},initialIndex:{type:Number,default:null}},methods:{turnOn:function(t){this.activeDot=t<10?t+1:1}}};const z=(0,T.Z)(U,(function(){var t=this,e=t._self._c;return e("ul",{staticClass:"dots"},t._l(t.stepCount,(function(r){return e("li",{key:r,attrs:{"data-is-active":r==t.activeDot||null}})})),0)}),[],!1,null,null,null).exports;function H(t){return H="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},H(t)}function Z(){Z=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==H(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function W(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Y(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){W(i,n,o,a,s,"next",t)}function s(t){W(i,n,o,a,s,"throw",t)}a(void 0)}))}}var K;const V={name:"OtpDisplayer",data:function(){return{internal_id:null,internal_otp_type:"",internal_account:"",internal_service:"",internal_icon:"",internal_secret:null,internal_digits:null,internal_algorithm:null,internal_period:null,internal_counter:null,internal_password:"",internal_uri:"",internal_generated_at:null,hasTOTP:!1}},props:{otp_type:String,account:String,service:String,icon:String,secret:String,digits:Number,algorithm:String,period:null,counter:null,image:String,qrcode:null,uri:String},computed:{},components:{TotpLooper:R,Dots:z},mounted:function(){},methods:{turnDotsOn:function(t){this.$refs.dots.turnOn(t)},copyOTP:function(t,e){var r=t.replace(/ /g,"");1==this.$clipboard(r)&&(-1==this.$root.userPreferences.kickUserAfter?this.appLogout():this.$root.userPreferences.closeOtpOnCopy&&!0===(e||!1)&&(this.$parent.isActive=!1,this.clearOTP()),this.$notify({type:"is-success",text:this.$t("commons.copied_to_clipboard")}))},isTimeBased:function(t){return"totp"===t||"steamtotp"===t},isHMacBased:function(t){return"hotp"===t},show:function(t){var e=this;return Y(Z().mark((function r(){var n,o;return Z().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.internal_otp_type=e.otp_type,e.internal_account=e.account,e.internal_service=e.service,e.internal_icon=e.icon,e.internal_secret=e.secret,e.internal_digits=e.digits,e.internal_algorithm=e.algorithm,e.internal_period=e.period,e.internal_counter=e.counter,!t){r.next=20;break}return e.internal_id=t,r.next=13,e.axios.get("api/v1/twofaccounts/"+e.internal_id);case 13:n=r.sent,o=n.data,e.internal_service=o.service,e.internal_account=o.account,e.internal_icon=o.icon,e.internal_otp_type=o.otp_type,e.isHMacBased(o.otp_type)&&o.counter&&(e.internal_counter=o.counter);case 20:if(e.uri&&(e.internal_uri=e.uri,e.internal_otp_type="otpauth://totp/"===e.uri.slice(0,15).toLowerCase()?"totp":"hotp"),!(e.internal_id||e.uri||e.secret)){r.next=41;break}if(r.prev=22,!e.isTimeBased(e.internal_otp_type)&&!e.isHMacBased(e.internal_otp_type)){r.next=28;break}return r.next=26,e.getOtp();case 26:r.next=29;break;case 28:e.$router.push({name:"genericError",params:{err:e.$t("errors.not_a_supported_otp_type")}});case 29:e.$parent.isActive=!0,e.focusOnOTP(),r.next=36;break;case 33:r.prev=33,r.t0=r.catch(22),e.clearOTP();case 36:return r.prev=36,e.$root.hideSpinner(),r.finish(36);case 39:r.next=42;break;case 41:e.$root.hideSpinner();case 42:case"end":return r.stop()}}),r,null,[[22,33,36,39]])})))()},getOtp:(K=Y(Z().mark((function t(){var e=this;return Z().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.axios(this.getOtpRequest()).then((function(t){var r=t.data;e.internal_password=r.password,e.$root.userPreferences.copyOtpOnDisplay&&e.copyOTP(r.password),e.isTimeBased(r.otp_type)?(e.internal_generated_at=r.generated_at,e.internal_period=r.period,e.hasTOTP=!0,e.$nextTick((function(){e.$refs.looper.startLoop()}))):e.isHMacBased(r.otp_type)&&(e.internal_counter=r.counter,e.$emit("increment-hotp",{nextHotpCounter:r.counter,nextUri:r.uri}))})).catch((function(t){throw 422===t.response.status&&e.$emit("validation-error",t.response),t}));case 2:case"end":return t.stop()}}),t,this)}))),function(){return K.apply(this,arguments)}),getOtpRequest:function(){return this.internal_id?{method:"get",url:"/api/v1/twofaccounts/"+this.internal_id+"/otp"}:this.internal_uri?{method:"post",url:"/api/v1/twofaccounts/otp",data:{uri:this.internal_uri}}:{method:"post",url:"/api/v1/twofaccounts/otp",data:{service:this.internal_service,account:this.internal_account,icon:this.internal_icon,otp_type:this.internal_otp_type,secret:this.internal_secret,digits:this.internal_digits,algorithm:this.internal_algorithm,period:this.internal_period,counter:this.internal_counter}}},clearOTP:function(){var t;this.internal_id=this.internal_counter=this.internal_generated_at=null,this.internal_service=this.internal_account=this.internal_icon=this.internal_otp_type=this.internal_secret="",this.internal_password="... ...",this.hasTOTP=!1,null===(t=this.$refs.looper)||void 0===t||t.clearLooper()},focusOnOTP:function(){var t=this;this.$nextTick((function(){t.$refs.otp.focus()}))}},beforeDestroy:function(){}};const Q=(0,T.Z)(V,(function(){var t=this,e=t._self._c;return e("div",[e("figure",{staticClass:"image is-64x64",class:{"no-icon":!t.internal_icon},staticStyle:{display:"inline-block"}},[t.internal_icon?e("img",{attrs:{src:t.$root.appConfig.subdirectory+"/storage/icons/"+t.internal_icon,alt:t.$t("twofaccounts.icon_to_illustrate_the_account")}}):t._e()]),t._v(" "),e("p",{staticClass:"is-size-4 has-ellipsis",class:t.$root.showDarkMode?"has-text-grey-light":"has-text-grey"},[t._v(t._s(t.internal_service))]),t._v(" "),e("p",{staticClass:"is-size-6 has-ellipsis",class:t.$root.showDarkMode?"has-text-grey":"has-text-grey-light"},[t._v(t._s(t.internal_account))]),t._v(" "),e("p",[e("span",{ref:"otp",staticClass:"otp is-size-1 is-clickable px-3",class:t.$root.showDarkMode?"has-text-white":"has-text-grey-dark",attrs:{id:"otp",role:"log",tabindex:"0",title:t.$t("commons.copy_to_clipboard")},on:{click:function(e){return t.copyOTP(t.internal_password,!0)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.copyOTP(t.internal_password,!0)}}},[t._v("\n "+t._s(t.displayPwd(this.internal_password))+"\n ")])]),t._v(" "),e("dots",{directives:[{name:"show",rawName:"v-show",value:t.isTimeBased(t.internal_otp_type),expression:"isTimeBased(internal_otp_type)"}],ref:"dots"}),t._v(" "),e("ul",{directives:[{name:"show",rawName:"v-show",value:t.isHMacBased(t.internal_otp_type),expression:"isHMacBased(internal_otp_type)"}]},[e("li",[t._v("counter: "+t._s(t.internal_counter))])]),t._v(" "),this.hasTOTP?e("totp-looper",{ref:"looper",attrs:{period:t.internal_period,generated_at:t.internal_generated_at,autostart:!1},on:{"loop-ended":function(e){return t.getOtp()},"loop-started":function(e){return t.turnDotsOn(e)},"stepped-up":function(e){return t.turnDotsOn(e)}}}):t._e()],1)}),[],!1,null,null,null).exports;var J=r(980),X=r.n(J),tt=r(661),et=r(162);function rt(t){return rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rt(t)}function nt(){nt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==rt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ot(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function it(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ot(i,n,o,a,s,"next",t)}function s(t){ot(i,n,o,a,s,"throw",t)}a(void 0)}))}}const at={data:function(){return{accounts:[],groups:[],selectedAccounts:[],search:"",editMode:this.initialEditMode,drag:!1,showTwofaccountInModal:!1,showGroupSwitch:!1,showGroupSelector:!1,moveAccountsTo:!1,form:new S({value:this.$root.userPreferences.activeGroup}),stepIndexes:{},isRenewingOTPs:!1}},computed:{filteredAccounts:{get:function(){var t=this;return this.accounts.filter((function(e){return parseInt(t.$root.userPreferences.activeGroup)>0?(!!e.service&&e.service.toLowerCase().includes(t.search.toLowerCase())||e.account.toLowerCase().includes(t.search.toLowerCase()))&&e.group_id==parseInt(t.$root.userPreferences.activeGroup):!!e.service&&e.service.toLowerCase().includes(t.search.toLowerCase())||e.account.toLowerCase().includes(t.search.toLowerCase())}))},set:function(t){this.accounts=t}},showAccounts:function(){return this.accounts.length>0&&!this.showGroupSwitch&&!this.showGroupSelector},activeGroupName:function(){var t=this,e=this.groups.find((function(e){return e.id===parseInt(t.$root.userPreferences.activeGroup)}));return e?e.name:this.$t("commons.all")},periods:function(){return this.$root.userPreferences.getOtpOnRequest?null:this.accounts.filter((function(t){return"totp"==t.otp_type})).map((function(t){return{period:t.period,generated_at:t.otp.generated_at}})).filter((function(t,e,r){return e===r.findIndex((function(e){return e.period===t.period}))})).sort()}},props:["initialEditMode","toRefresh"],mounted:function(){if(document.addEventListener("keydown",this.keyListener),this.$root.userPreferences.getOtpOnRequest&&!this.toRefresh&&!this.$route.params.isFirstLoad){var t=this.$storage.get("accounts",null);t&&(this.accounts=t);var e=this.$storage.get("groups",null);e&&(this.groups=e)}this.fetchAccounts(),this.$on("modalClose",(function(){this.$refs.OtpDisplayer.clearOTP()}))},destroyed:function(){document.removeEventListener("keydown",this.keyListener)},components:{Modal:B,OtpDisplayer:Q,TotpLooper:R,Dots:z,draggable:X()},methods:{showOrCopy:function(t){!this.$root.userPreferences.getOtpOnRequest&&t.otp_type.includes("totp")?this.copyOTP(t.otp.password):this.showAccount(t)},getAndCopyOTP:function(t){var e=this;return it(nt().mark((function r(){return nt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.axios.get("/api/v1/twofaccounts/"+t.id+"/otp").then((function(r){var n=r.data;if(e.copyOTP(n.password),"hotp"==n.otp_type){var o=e.accounts.find((function(e){return e.id==t.id}));null!=o&&(o.counter=n.counter)}}));case 2:case"end":return r.stop()}}),r)})))()},copyOTP:function(t){1==this.$clipboard(t)&&(-1==this.$root.userPreferences.kickUserAfter&&this.appLogout(),this.$notify({type:"is-success",text:this.$t("commons.copied_to_clipboard")}))},setCurrentStep:function(t,e){this.stepIndexes[t]=e,this.turnDotsOn(t,e)},turnDotsOnFromCache:function(t,e){null!=this.stepIndexes[t]&&this.turnDotsOn(t,this.stepIndexes[t])},turnDotsOn:function(t,e){this.$refs["dots_"+t].forEach((function(t){t.turnOn(e)}))},updateTotps:function(t){var e=this;return it(nt().mark((function r(){return nt().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e.isRenewingOTPs=!0,e.axios.get("api/v1/twofaccounts?withOtp=1&ids="+e.accountIdsWithPeriod(t).join(",")).then((function(r){r.data.forEach((function(r){var n=e.accounts.findIndex((function(t){return t.id===r.id}));e.accounts[n].otp=r.otp,e.$refs.loopers.forEach((function(n){n.period==t&&(n.generatedAt=r.otp.generated_at,e.$nextTick((function(){n.startLoop()})))}))}))})).finally((function(){e.isRenewingOTPs=!1}));case 2:case"end":return r.stop()}}),r)})))()},accountIdsWithPeriod:function(t){return this.accounts.filter((function(e){return e.period==t})).map((function(t){return t.id}))},start:function(){this.$root.userPreferences.useDirectCapture&&"advancedForm"===this.$root.userPreferences.defaultCaptureMode?this.$router.push({name:"createAccount"}):this.$root.userPreferences.useDirectCapture&&"livescan"===this.$root.userPreferences.defaultCaptureMode?this.$router.push({name:"capture"}):this.$router.push({name:"start"})},fetchAccounts:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=[];this.selectedAccounts=[];var n=this.$root.userPreferences.getOtpOnRequest?"":"?withOtp=1";this.axios.get("api/v1/twofaccounts"+n).then((function(n){n.data.forEach((function(t){r.push(t)})),t.accounts.length>0&&!(0,tt.ZP)(r,t.accounts,{depth:1})&&!e?t.$notify({type:"is-dark",text:'<span class="is-size-7">'+t.$t("commons.some_data_have_changed")+'</span><br /><a href="." class="button is-rounded is-warning is-small">'+t.$t("commons.reload")+"</a>",duration:-1,closeOnClick:!1}):0===t.accounts.length&&0===r.length?(t.$storage.set("accounts",t.accounts),t.$router.push({name:"start"})):(t.accounts=r,t.$storage.set("accounts",t.accounts),t.fetchGroups())}))},showAccount:function(t){this.editMode?this.selectAccount(t.id):(this.$root.showSpinner(this.$t("commons.generating_otp")),this.$refs.OtpDisplayer.show(t.id))},selectAccount:function(t){for(var e=0;e<this.selectedAccounts.length;e++)if(this.selectedAccounts[e]===t)return void this.selectedAccounts.splice(e,1);this.selectedAccounts.push(t)},getOTP:function(t){var e=this;this.axios.get("api/v1/twofaccounts/"+t+"/otp").then((function(t){e.$notify({type:"is-success",text:e.$t("commons.copied_to_clipboard")+" "+t.data})}))},saveOrder:function(){this.drag=!1,this.axios.post("/api/v1/twofaccounts/reorder",{orderedIds:this.accounts.map((function(t){return t.id}))})},destroyAccounts:function(){var t=this;return it(nt().mark((function e(){var r,n;return nt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!confirm(t.$t("twofaccounts.confirm.delete"))){e.next=7;break}return r=[],t.selectedAccounts.forEach((function(t){return r.push(t)})),n=t,e.next=6,t.axios.delete("/api/v1/twofaccounts?ids="+r.join()).then((function(e){r.forEach((function(t){n.accounts=n.accounts.filter((function(e){return e.id!==t}))})),t.$notify({type:"is-success",text:t.$t("twofaccounts.accounts_deleted")})}));case 6:t.fetchAccounts(!0);case 7:case"end":return e.stop()}}),e)})))()},exportAccounts:function(){var t=[];this.selectedAccounts.forEach((function(e){return t.push(e)})),this.axios.get("/api/v1/twofaccounts/export?ids="+t.join(),{responseType:"blob"}).then((function(t){var e=new Blob([t.data],{type:"application/json;charset=utf-8"});et.saveAs.saveAs(e,"2fauth_export.json")}))},moveAccounts:function(){var t=this;return it(nt().mark((function e(){var r;return nt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=[],t.selectedAccounts.forEach((function(t){return r.push(t)})),0!==t.moveAccountsTo){e.next=7;break}return e.next=5,t.axios.patch("/api/v1/twofaccounts/withdraw?ids="+r.join());case 5:e.next=9;break;case 7:return e.next=9,t.axios.post("/api/v1/groups/"+t.moveAccountsTo+"/assign",{ids:r});case 9:t.fetchAccounts(!0),t.showGroupSelector=!1,t.$notify({type:"is-success",text:t.$t("twofaccounts.accounts_moved")});case 12:case"end":return e.stop()}}),e)})))()},fetchGroups:function(){var t=this,e=[];this.axios.get("api/v1/groups").then((function(r){r.data.forEach((function(t){e.push(t)})),(0,tt.ZP)(e,t.groups)||(t.groups=e),t.$storage.set("groups",t.groups)}))},setActiveGroup:function(t){var e=this;this.form.value=this.$root.userPreferences.activeGroup=t,this.$root.userPreferences.rememberActiveGroup&&this.form.put("/api/v1/user/preferences/activeGroup",{returnError:!0}).then((function(t){})).catch((function(t){e.$router.push({name:"genericError",params:{err:t.response}})})),this.closeGroupSwitch()},toggleGroupSwitch:function(t){t&&(this.showGroupSwitch?this.closeGroupSwitch():this.openGroupSwitch())},openGroupSwitch:function(t){this.showGroupSwitch=!0},closeGroupSwitch:function(t){this.showGroupSwitch=!1},setEditModeTo:function(t){this.selectedAccounts=[],this.editMode=t},displayService:function(t){return t||this.$t("twofaccounts.no_service")},clearSelected:function(){this.selectedAccounts=[]},selectAll:function(){if(this.editMode){var t=this;this.accounts.forEach((function(e){t.selectedAccounts.includes(e.id)||t.selectedAccounts.push(e.id)}))}},sortAsc:function(){this.accounts.sort((function(t,e){return t.service>e.service?1:-1})),this.saveOrder()},sortDesc:function(){this.accounts.sort((function(t,e){return t.service<e.service?1:-1})),this.saveOrder()},keyListener:function(t){if("f"===t.key&&(t.ctrlKey||t.metaKey)){t.preventDefault();var e=document.getElementById("txtSearch");null!=e&&e.focus()}}}};var st=r(379),ct=r.n(st),ut=r(673),lt={insert:"head",singleton:!1};ct()(ut.Z,lt);ut.Z.locals;const ft=(0,T.Z)(at,(function(){var t=this,e=t._self._c;return e("div",[t.showGroupSwitch?e("div",{staticClass:"container groups",attrs:{id:"groupSwitch"}},[e("div",{staticClass:"columns is-centered"},[e("div",{staticClass:"column is-one-third-tablet is-one-quarter-desktop is-one-quarter-widescreen is-one-quarter-fullhd"},[e("div",{staticClass:"columns is-multiline"},t._l(t.groups,(function(r){return r.twofaccounts_count>0?e("div",{key:r.id,staticClass:"column is-full"},[e("button",{staticClass:"button is-fullwidth",class:{"is-dark has-text-light is-outlined":t.$root.showDarkMode},on:{click:function(e){return t.setActiveGroup(r.id)}}},[t._v(t._s(r.name))])]):t._e()})),0),t._v(" "),e("div",{staticClass:"columns is-centered"},[e("div",{staticClass:"column has-text-centered"},[e("router-link",{attrs:{to:{name:"groups"}}},[t._v(t._s(t.$t("groups.manage_groups")))])],1)])])]),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[e("p",{staticClass:"control"},[e("button",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"btnClose"},on:{click:function(e){return t.closeGroupSwitch()}}},[t._v(t._s(t.$t("commons.close")))])])])],1):t._e(),t._v(" "),t.showGroupSelector?e("div",{staticClass:"container group-selector"},[e("div",{staticClass:"columns is-centered is-multiline"},[e("div",{staticClass:"column is-full has-text-centered"},[t._v("\n "+t._s(t.$t("groups.move_selected_to"))+"\n ")]),t._v(" "),e("div",{staticClass:"column is-one-third-tablet is-one-quarter-desktop is-one-quarter-widescreen is-one-quarter-fullhd"},[e("div",{staticClass:"columns is-multiline"},t._l(t.groups,(function(r){return e("div",{key:r.id,staticClass:"column is-full"},[e("button",{staticClass:"button is-fullwidth",class:{"is-link":t.moveAccountsTo===r.id,"is-dark has-text-light is-outlined":t.$root.showDarkMode},on:{click:function(e){t.moveAccountsTo=r.id}}},[0===r.id?e("span",{staticClass:"is-italic"},[t._v("\n "+t._s(t.$t("groups.no_group"))+"\n ")]):e("span",[t._v("\n "+t._s(r.name)+"\n ")])])])})),0),t._v(" "),e("div",{staticClass:"columns is-centered"},[e("div",{staticClass:"column has-text-centered"},[e("router-link",{attrs:{to:{name:"groups"}}},[t._v(t._s(t.$t("groups.manage_groups")))])],1)])])]),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[e("p",{staticClass:"control"},[e("button",{staticClass:"button is-link is-rounded",on:{click:function(e){return t.moveAccounts()}}},[t._v(t._s(t.$t("commons.move")))])]),t._v(" "),e("p",{staticClass:"control"},[e("button",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"btnCancel"},on:{click:function(e){t.showGroupSelector=!1}}},[t._v(t._s(t.$t("commons.cancel")))])])])],1):t._e(),t._v(" "),this.showAccounts||this.showGroupSwitch?e("div",{staticClass:"header"},[e("div",{staticClass:"columns is-gapless is-mobile is-centered"},[e("div",{staticClass:"column is-three-quarters-mobile is-one-third-tablet is-one-quarter-desktop is-one-quarter-widescreen is-one-quarter-fullhd"},[e("div",{staticClass:"field",attrs:{role:"search"}},[e("div",{staticClass:"control has-icons-right"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.search,expression:"search"}],ref:"searchBox",staticClass:"input is-rounded is-search",attrs:{id:"txtSearch",type:"search",tabindex:"1","aria-label":t.$t("commons.search"),title:t.$t("commons.search")},domProps:{value:t.search},on:{input:function(e){e.target.composing||(t.search=e.target.value)}}}),t._v(" "),e("span",{staticClass:"icon is-small is-right"},[t.search?t._e():e("font-awesome-icon",{attrs:{icon:["fas","search"]}}),t._v(" "),t.search?e("button",{staticClass:"clear-selection delete",attrs:{id:"btnClearSearch",tabindex:"1",title:t.$t("commons.clear_search")},on:{click:function(e){t.search=""}}}):t._e()],1)])]),t._v(" "),t.editMode?e("div",{staticClass:"toolbar has-text-centered"},[e("div",{staticClass:"columns"},[e("div",{staticClass:"column"},[e("span",{staticClass:"has-text-grey mr-1"},[t._v(t._s(t.selectedAccounts.length)+" "+t._s(t.$t("commons.selected")))]),t._v(" "),e("button",{staticClass:"clear-selection delete mr-4",style:{visibility:t.selectedAccounts.length>0?"visible":"hidden"},attrs:{id:"btnUnselectAll",title:t.$t("commons.clear_selection")},on:{click:t.clearSelected}}),t._v(" "),e("button",{staticClass:"button mr-5 has-line-height p-1 is-ghost has-text-grey",attrs:{id:"btnSelectAll",title:t.$t("commons.select_all")},on:{click:t.selectAll}},[e("span",[t._v(t._s(t.$t("commons.all")))]),t._v(" "),e("font-awesome-icon",{staticClass:"ml-1",attrs:{icon:["fas","check-square"]}})],1),t._v(" "),e("button",{staticClass:"button has-line-height p-1 is-ghost has-text-grey",attrs:{id:"btnSortAscending",title:t.$t("commons.sort_ascending")},on:{click:t.sortAsc}},[e("font-awesome-icon",{attrs:{icon:["fas","sort-alpha-down"]}})],1),t._v(" "),e("button",{staticClass:"button has-line-height p-1 is-ghost has-text-grey",attrs:{id:"btnSortDescending",title:t.$t("commons.sort_descending")},on:{click:t.sortDesc}},[e("font-awesome-icon",{attrs:{icon:["fas","sort-alpha-up"]}})],1)])])]):e("div",{staticClass:"has-text-centered"},[e("div",{staticClass:"columns"},[t.showGroupSwitch?e("div",{staticClass:"column"},[e("button",{staticClass:"button is-text is-like-text",class:{"has-text-grey":!t.$root.showDarkMode},attrs:{id:"btnHideGroupSwitch",title:t.$t("groups.hide_group_selector"),tabindex:"1"},on:{click:function(e){return e.stopPropagation(),t.toggleGroupSwitch.apply(null,arguments)}}},[t._v("\n "+t._s(t.$t("groups.select_accounts_to_show"))+"\n ")])]):e("div",{staticClass:"column"},[e("button",{staticClass:"button is-text is-like-text",class:{"has-text-grey":!t.$root.showDarkMode},attrs:{id:"btnShowGroupSwitch",title:t.$t("groups.show_group_selector"),tabindex:"1"},on:{click:function(e){return e.stopPropagation(),t.toggleGroupSwitch.apply(null,arguments)}}},[t._v("\n "+t._s(t.activeGroupName)+" ("+t._s(t.filteredAccounts.length)+") \n "),e("font-awesome-icon",{attrs:{icon:["fas","caret-down"]}})],1)])])])])])]):t._e(),t._v(" "),e("modal",{model:{value:t.showTwofaccountInModal,callback:function(e){t.showTwofaccountInModal=e},expression:"showTwofaccountInModal"}},[e("otp-displayer",{ref:"OtpDisplayer"})],1),t._v(" "),this.showAccounts?e("div",{staticClass:"container",class:t.editMode?"is-edit-mode":""},[e("draggable",{staticClass:"accounts",attrs:{"ghost-class":"ghost",handle:".tfa-dots",animation:"200"},on:{start:function(e){t.drag=!0},end:t.saveOrder},model:{value:t.filteredAccounts,callback:function(e){t.filteredAccounts=e},expression:"filteredAccounts"}},[e("transition-group",{staticClass:"columns is-multiline",class:{"is-centered":"grid"===t.$root.userPreferences.displayMode},attrs:{type:"transition",name:t.drag?null:"flip-list"}},t._l(t.filteredAccounts,(function(r){return e("div",{key:r.id,staticClass:"column is-narrow",class:["grid"===t.$root.userPreferences.displayMode?"tfa-grid":"tfa-list"]},[e("div",{staticClass:"tfa-container"},[e("transition",{attrs:{name:"slideCheckbox"}},[t.editMode?e("div",{staticClass:"tfa-cell tfa-checkbox"},[e("div",{staticClass:"field"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.selectedAccounts,expression:"selectedAccounts"}],staticClass:"is-checkradio is-small",class:t.$root.showDarkMode?"is-white":"is-info",attrs:{id:"ckb_"+r.id,type:"checkbox",name:"ckb_"+r.id},domProps:{value:r.id,checked:Array.isArray(t.selectedAccounts)?t._i(t.selectedAccounts,r.id)>-1:t.selectedAccounts},on:{change:function(e){var n=t.selectedAccounts,o=e.target,i=!!o.checked;if(Array.isArray(n)){var a=r.id,s=t._i(n,a);o.checked?s<0&&(t.selectedAccounts=n.concat([a])):s>-1&&(t.selectedAccounts=n.slice(0,s).concat(n.slice(s+1)))}else t.selectedAccounts=i}}}),t._v(" "),e("label",{attrs:{tabindex:"0",for:"ckb_"+r.id},on:{keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.preventDefault(),t.selectAccount(r.id))}}})])]):t._e()]),t._v(" "),e("div",{staticClass:"tfa-cell tfa-content is-size-3 is-size-4-mobile",attrs:{tabindex:"0",role:"button"},on:{click:[function(e){return e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?null:t.showOrCopy(r)},function(e){return e.ctrlKey?t.getAndCopyOTP(r):null}],keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.showOrCopy(r)}}},[e("div",{staticClass:"tfa-text has-ellipsis"},[r.icon&&t.$root.userPreferences.showAccountsIcons?e("img",{staticClass:"tfa-icon",attrs:{src:t.$root.appConfig.subdirectory+"/storage/icons/"+r.icon,alt:t.$t("twofaccounts.icon_for_account_x_at_service_y",{account:r.account,service:r.service})}}):t._e(),t._v("\n "+t._s(t.displayService(r.service))),t.$root.appSettings.useEncryption&&r.account===t.$t("errors.indecipherable")?e("font-awesome-icon",{staticClass:"has-text-danger is-size-5 ml-2",attrs:{icon:["fas","exclamation-circle"]}}):t._e(),t._v(" "),e("span",{staticClass:"has-ellipsis is-family-primary is-size-6 is-size-7-mobile has-text-grey"},[t._v(t._s(r.account))])],1)]),t._v(" "),e("transition",{attrs:{name:"popLater"}},[e("div",{directives:[{name:"show",rawName:"v-show",value:0==t.$root.userPreferences.getOtpOnRequest&&!t.editMode,expression:"$root.userPreferences.getOtpOnRequest == false && !editMode"}],staticClass:"has-text-right"},[null!=r.otp&&t.isRenewingOTPs?e("span",{staticClass:"has-nowrap has-text-grey has-text-centered is-size-5"},[e("font-awesome-icon",{attrs:{icon:["fas","circle-notch"],spin:""}})],1):null!=r.otp&&0==t.isRenewingOTPs?e("span",{staticClass:"always-on-otp is-clickable has-nowrap has-text-grey is-size-5 ml-4",attrs:{title:t.$t("commons.copy_to_clipboard")},on:{click:function(e){return t.copyOTP(r.otp.password)},keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.copyOTP(r.otp.password)}}},[t._v("\n "+t._s(t.displayPwd(r.otp.password))+"\n ")]):e("span",[e("button",{staticClass:"button tag",class:t.$root.showDarkMode?"is-dark":"is-white",attrs:{title:t.$t("twofaccounts.import.import_this_account")},on:{click:function(e){return t.showAccount(r)}}},[t._v("\n "+t._s(t.$t("commons.generate"))+"\n ")])]),t._v(" "),r.otp_type.includes("totp")?e("dots",{ref:"dots_"+r.period,refInFor:!0,class:"condensed",on:{"hook:mounted":function(e){return t.turnDotsOnFromCache(r.period)}}}):t._e()],1)]),t._v(" "),e("transition",{attrs:{name:"fadeInOut"}},[t.editMode?e("div",{staticClass:"tfa-cell tfa-edit has-text-grey"},[e("router-link",{staticClass:"tag is-rounded mr-1",class:t.$root.showDarkMode?"is-dark":"is-white",attrs:{to:{name:"editAccount",params:{twofaccountId:r.id}}}},[t._v("\n "+t._s(t.$t("commons.edit"))+"\n ")]),t._v(" "),e("router-link",{staticClass:"tag is-rounded",class:t.$root.showDarkMode?"is-dark":"is-white",attrs:{to:{name:"showQRcode",params:{twofaccountId:r.id}},title:t.$t("twofaccounts.show_qrcode")}},[e("font-awesome-icon",{attrs:{icon:["fas","qrcode"]}})],1)],1):t._e()]),t._v(" "),e("transition",{attrs:{name:"fadeInOut"}},[t.editMode?e("div",{staticClass:"tfa-cell tfa-dots has-text-grey"},[e("font-awesome-icon",{attrs:{icon:["fas","bars"]}})],1):t._e()])],1)])})),0)],1),t._v(" "),e("vue-footer",{attrs:{showButtons:!0,editMode:t.editMode},on:{"exit-edit":function(e){return t.setEditModeTo(!1)}}},[t.editMode?t._e():e("p",{staticClass:"control"},[e("button",{staticClass:"button is-link is-rounded is-focus",on:{click:t.start}},[e("span",[t._v(t._s(t.$t("commons.new")))]),t._v(" "),e("span",{staticClass:"icon is-small"},[e("font-awesome-icon",{attrs:{icon:["fas","qrcode"]}})],1)])]),t._v(" "),t.editMode?t._e():e("p",{staticClass:"control"},[e("button",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"btnManage"},on:{click:function(e){return t.setEditModeTo(!0)}}},[t._v(t._s(t.$t("commons.manage")))])]),t._v(" "),t.editMode?e("p",{staticClass:"control"},[e("button",{staticClass:"button is-rounded",class:[{"is-outlined":t.$root.showDarkMode||0==t.selectedAccounts.length},0==t.selectedAccounts.length?"is-dark":"is-link"],attrs:{id:"btnMove",disabled:0==t.selectedAccounts.length,title:t.$t("groups.move_selected_to_group")},on:{click:function(e){t.showGroupSelector=!0}}},[t._v("\n "+t._s(t.$t("commons.move"))+"\n ")])]):t._e(),t._v(" "),t.editMode?e("p",{staticClass:"control"},[e("button",{staticClass:"button is-rounded",class:[{"is-outlined":t.$root.showDarkMode||0==t.selectedAccounts.length},0==t.selectedAccounts.length?"is-dark":"is-link"],attrs:{id:"btnDelete",disabled:0==t.selectedAccounts.length},on:{click:t.destroyAccounts}},[t._v("\n "+t._s(t.$t("commons.delete"))+"\n ")])]):t._e(),t._v(" "),t.editMode?e("p",{staticClass:"control"},[e("button",{staticClass:"button is-rounded",class:[{"is-outlined":t.$root.showDarkMode||0==t.selectedAccounts.length},0==t.selectedAccounts.length?"is-dark":"is-link"],attrs:{id:"btnExport",disabled:0==t.selectedAccounts.length,title:t.$t("twofaccounts.export_selected_to_json")},on:{click:t.exportAccounts}},[t._v("\n "+t._s(t.$t("commons.export"))+"\n ")])]):t._e()])],1):t._e(),t._v(" "),this.$root.userPreferences.getOtpOnRequest?t._e():e("span",t._l(t.periods,(function(r){return e("totp-looper",{key:r.period,ref:"loopers",refInFor:!0,attrs:{period:r.period,generated_at:r.generated_at},on:{"loop-ended":function(e){return t.updateTotps(r.period)},"loop-started":function(e){return t.setCurrentStep(r.period,e)},"stepped-up":function(e){return t.setCurrentStep(r.period,e)}}})})),1)],1)}),[],!1,null,null,null).exports;function pt(t){return pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pt(t)}function ht(){ht=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==pt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function dt(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}const mt={data:function(){return{showQuickForm:!1,showAdvancedForm:!1,ShowTwofaccountInModal:!1,showAlternatives:!1,tempIcon:"",uri:"",form:new S({service:"",account:"",otp_type:"",icon:"",secret:"",algorithm:"",digits:null,counter:null,period:null,image:"",qrcode:null}),otp_types:[{text:"TOTP",value:"totp"},{text:"HOTP",value:"hotp"},{text:"STEAM",value:"steamtotp"}],digitsChoices:[{text:6,value:6},{text:7,value:7},{text:8,value:8},{text:9,value:9},{text:10,value:10}],algorithms:[{text:"sha1",value:"sha1"},{text:"sha256",value:"sha256"},{text:"sha512",value:"sha512"},{text:"md5",value:"md5"}]}},watch:{tempIcon:function(t){var e=this;this.showQuickForm&&this.$nextTick((function(){e.$refs.QuickFormOtpDisplayer.internal_icon=t}))},"form.otp_type":function(t,e){this.setFormState(e,t)}},mounted:function(){var t=this;this.$route.params.decodedUri?(this.uri=this.$route.params.decodedUri,this.axios.post("/api/v1/twofaccounts/preview",{uri:this.uri}).then((function(e){t.form.fill(e.data),t.tempIcon=e.data.icon?e.data.icon:null,t.showQuickForm=!0,t.$nextTick((function(){t.$refs.QuickFormOtpDisplayer.show()}))})).catch((function(e){422===e.response.status&&e.response.data.errors.uri&&(t.showAlternatives=!0,t.showAdvancedForm=!0)}))):this.showAdvancedForm=!0,this.$on("modalClose",(function(){this.showAlternatives=!1,this.showAdvancedForm&&this.$refs.AdvancedFormOtpDisplayer.stopLoop()}))},components:{Modal:B,OtpDisplayer:Q},methods:{createAccount:function(){var t,e=this;return(t=ht().mark((function t(){return ht().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.form.icon=e.tempIcon,t.next=3,e.form.post("/api/v1/twofaccounts");case 3:!1===e.form.errors.any()&&(e.$notify({type:"is-success",text:e.$t("twofaccounts.account_created")}),e.$router.push({name:"accounts",params:{toRefresh:!0}}));case 4:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){dt(i,n,o,a,s,"next",t)}function s(t){dt(i,n,o,a,s,"throw",t)}a(void 0)}))})()},previewAccount:function(){this.form.clear(),this.$refs.AdvancedFormOtpDisplayer.show()},cancelCreation:function(){this.form.service&&!1===confirm(this.$t("twofaccounts.confirm.cancel"))||(this.deleteIcon(),this.$router.push({name:"accounts"}))},uploadQrcode:function(t){var e=this,r=new FormData;r.append("qrcode",this.$refs.qrcodeInput.files[0]),r.append("inputFormat","fileUpload"),this.form.upload("/api/v1/qrcode/decode",r,{returnError:!0}).then((function(t){e.uri=t.data.data,e.axios.post("/api/v1/twofaccounts/preview",{uri:e.uri}).then((function(t){e.form.fill(t.data),e.tempIcon=t.data.icon?t.data.icon:null})).catch((function(t){422===t.response.status&&t.response.data.errors.uri&&(e.showAlternatives=!0)}))})).catch((function(t){return e.$notify({type:"is-danger",text:e.$t(t.response.data.message)}),!1}))},uploadIcon:function(t){var e=this;this.deleteIcon();var r=new FormData;r.append("icon",this.$refs.iconInput.files[0]),this.form.upload("/api/v1/icons",r,{returnError:!0}).then((function(t){e.tempIcon=t.data.filename})).catch((function(t){e.$notify({type:"is-danger",text:e.$t(t.response.data.message)})}))},fetchLogo:function(){var t=this;this.$root.userPreferences.getOfficialIcons&&this.axios.post("/api/v1/icons/default",{service:this.form.service},{returnError:!0}).then((function(e){201===e.status?(t.deleteIcon(),t.tempIcon=e.data.filename):t.$notify({type:"is-warning",text:t.$t("errors.no_logo_found_for_x",{service:t.strip_tags(t.form.service)})})})).catch((function(e){t.$notify({type:"is-warning",text:t.$t("errors.no_logo_found_for_x",{service:t.strip_tags(t.form.service)})})}))},deleteIcon:function(t){this.tempIcon&&(this.axios.delete("/api/v1/icons/"+this.tempIcon),this.tempIcon="")},incrementHotp:function(t){this.form.counter=t.nextHotpCounter},clipboardSuccessHandler:function(t){t.value,t.event;-1==this.$root.appSettings.userPreferences&&this.appLogout(),this.$notify({type:"is-success",text:this.$t("commons.copied_to_clipboard")})},clipboardErrorHandler:function(t){var e=t.value;t.event;console.log("error",e)},setFormState:function(t,e){this.form.otp_type=e,"steamtotp"===e?(this.form.service="Steam",this.fetchLogo()):"steamtotp"===t&&(this.form.service="",this.deleteIcon())},mapDisplayerErrors:function(t){this.form.errors.set(this.form.extractErrors(t))}}};const vt=(0,T.Z)(mt,(function(){var t=this,e=t._self._c;return e("div",[t.showQuickForm?e("form",{on:{submit:function(e){return e.preventDefault(),t.createAccount.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("div",{staticClass:"container preview has-text-centered"},[e("div",{staticClass:"columns is-mobile"},[e("div",{staticClass:"column"},[t.tempIcon?t._e():e("label",{staticClass:"add-icon-button"},[e("input",{ref:"iconInput",staticClass:"file-input",attrs:{type:"file",accept:"image/*"},on:{change:t.uploadIcon}}),t._v(" "),e("font-awesome-icon",{attrs:{icon:["fas","image"],size:"2x"}})],1),t._v(" "),t.tempIcon?e("button",{staticClass:"delete delete-icon-button is-medium",on:{click:function(e){return e.preventDefault(),t.deleteIcon.apply(null,arguments)}}}):t._e(),t._v(" "),e("otp-displayer",t._b({ref:"QuickFormOtpDisplayer",on:{"increment-hotp":t.incrementHotp}},"otp-displayer",t.form.data(),!1))],1)]),t._v(" "),e("div",{staticClass:"columns is-mobile",attrs:{role:"alert"}},[t.form.errors.any()?e("div",{staticClass:"column"},t._l(t.form.errors.errors,(function(r,n){return e("p",{key:n,staticClass:"help is-danger"},[e("ul",t._l(r,(function(r,n){return e("li",{key:n},[t._v(t._s(r))])})),0)])})),0):t._e()]),t._v(" "),e("div",{staticClass:"columns is-mobile"},[e("div",{staticClass:"column quickform-footer"},[e("div",{staticClass:"field is-grouped is-grouped-centered"},[e("div",{staticClass:"control"},[e("v-button",{attrs:{isLoading:t.form.isBusy}},[t._v(t._s(t.$t("commons.save")))])],1),t._v(" "),e("div",{staticClass:"control"},[e("button",{staticClass:"button is-text",attrs:{id:"btnCancel",type:"button"},on:{click:t.cancelCreation}},[t._v(t._s(t.$t("commons.cancel")))])])])])])])]):t._e(),t._v(" "),t.showAdvancedForm?e("form-wrapper",{attrs:{title:t.$t("twofaccounts.forms.new_account")}},[e("form",{on:{submit:function(e){return e.preventDefault(),t.createAccount.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("div",{staticClass:"field is-grouped"},[e("div",{staticClass:"control"},[e("div",{staticClass:"file is-black is-small",attrs:{role:"button",tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$refs.qrcodeInputLabel.click()}}},[e("label",{ref:"qrcodeInputLabel",staticClass:"file-label",attrs:{title:t.$t("twofaccounts.forms.use_qrcode.title")}},[e("input",{ref:"qrcodeInput",staticClass:"file-input",attrs:{"aria-hidden":"true",tabindex:"-1",type:"file",accept:"image/*"},on:{change:t.uploadQrcode}}),t._v(" "),e("span",{staticClass:"file-cta"},[e("span",{staticClass:"file-icon"},[e("font-awesome-icon",{attrs:{icon:["fas","qrcode"],size:"lg"}})],1),t._v(" "),e("span",{staticClass:"file-label"},[t._v(t._s(t.$t("twofaccounts.forms.prefill_using_qrcode")))])])])])])]),t._v(" "),e("field-error",{staticClass:"help-for-file",attrs:{form:t.form,field:"qrcode"}}),t._v(" "),e("form-field",{attrs:{form:t.form,isDisabled:"steamtotp"===t.form.otp_type,fieldName:"service",inputType:"text",label:t.$t("twofaccounts.service"),placeholder:t.$t("twofaccounts.forms.service.placeholder"),autofocus:""}}),t._v(" "),e("form-field",{attrs:{form:t.form,fieldName:"account",inputType:"text",label:t.$t("twofaccounts.account"),placeholder:t.$t("twofaccounts.forms.account.placeholder")}}),t._v(" "),e("label",{staticClass:"label"},[t._v(t._s(t.$t("twofaccounts.icon")))]),t._v(" "),e("div",{staticClass:"field is-grouped"},[t.$root.userPreferences.getOfficialIcons?e("div",{staticClass:"control"},[e("v-button",{attrs:{color:t.$root.showDarkMode?"is-dark":"",nativeType:"button",isDisabled:t.form.service.length<1},on:{click:t.fetchLogo}},[e("span",{staticClass:"icon is-small"},[e("font-awesome-icon",{attrs:{icon:["fas","globe"]}})],1),t._v(" "),e("span",[t._v(t._s(t.$t("twofaccounts.forms.i_m_lucky")))])])],1):t._e(),t._v(" "),e("div",{staticClass:"control"},[e("div",{staticClass:"file",class:t.$root.showDarkMode?"is-dark":"is-white",attrs:{role:"button",tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$refs.iconInputLabel.click()}}},[e("label",{ref:"iconInputLabel",staticClass:"file-label"},[e("input",{ref:"iconInput",staticClass:"file-input",attrs:{"aria-hidden":"true",tabindex:"-1",type:"file",accept:"image/*"},on:{change:t.uploadIcon}}),t._v(" "),e("span",{staticClass:"file-cta"},[e("span",{staticClass:"file-icon"},[e("font-awesome-icon",{attrs:{icon:["fas","upload"]}})],1),t._v(" "),e("span",{staticClass:"file-label"},[t._v(t._s(t.$t("twofaccounts.forms.choose_image")))])])]),t._v(" "),t.tempIcon?e("span",{staticClass:"tag is-large",class:t.$root.showDarkMode?"is-dark":"is-white"},[e("img",{staticClass:"icon-preview",attrs:{src:t.$root.appConfig.subdirectory+"/storage/icons/"+t.tempIcon,alt:t.$t("twofaccounts.icon_to_illustrate_the_account")}}),t._v(" "),e("button",{staticClass:"clear-selection delete is-small",attrs:{"aria-label":t.$t("twofaccounts.remove_icon")},on:{click:function(e){return e.preventDefault(),t.deleteIcon.apply(null,arguments)}}})]):t._e()])])]),t._v(" "),e("div",{staticClass:"field"},[e("field-error",{staticClass:"help-for-file",attrs:{form:t.form,field:"icon"}}),t._v(" "),t.$root.userPreferences.getOfficialIcons?e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.$t("twofaccounts.forms.i_m_lucky_legend"))}}):t._e()],1),t._v(" "),e("form-toggle",{staticClass:"has-uppercased-button",attrs:{form:t.form,choices:t.otp_types,fieldName:"otp_type",label:t.$t("twofaccounts.forms.otp_type.label"),help:t.$t("twofaccounts.forms.otp_type.help"),hasOffset:!0}}),t._v(" "),t.form.otp_type?e("div",[e("label",{staticClass:"label",attrs:{for:this.inputId("text","secret")},domProps:{innerHTML:t._s(t.$t("twofaccounts.forms.secret.label"))}}),t._v(" "),e("div",{staticClass:"field"},[e("p",{staticClass:"control is-expanded"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.secret,expression:"form.secret"}],staticClass:"input",attrs:{id:this.inputId("text","secret"),type:"text"},domProps:{value:t.form.secret},on:{input:function(e){e.target.composing||t.$set(t.form,"secret",e.target.value)}}})])]),t._v(" "),e("div",{staticClass:"field"},[e("field-error",{attrs:{form:t.form,field:"secret"}}),t._v(" "),e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.$t("twofaccounts.forms.secret.help"))}})],1),t._v(" "),"steamtotp"!==t.form.otp_type?e("div",[e("h2",{staticClass:"title is-4 mt-5 mb-2"},[t._v(t._s(t.$t("commons.options")))]),t._v(" "),e("p",{staticClass:"help mb-4"},[t._v("\n "+t._s(t.$t("twofaccounts.forms.options_help"))+"\n ")]),t._v(" "),e("form-toggle",{attrs:{form:t.form,choices:t.digitsChoices,fieldName:"digits",label:t.$t("twofaccounts.forms.digits.label"),help:t.$t("twofaccounts.forms.digits.help")}}),t._v(" "),e("form-toggle",{attrs:{form:t.form,choices:t.algorithms,fieldName:"algorithm",label:t.$t("twofaccounts.forms.algorithm.label"),help:t.$t("twofaccounts.forms.algorithm.help")}}),t._v(" "),"totp"===t.form.otp_type?e("form-field",{class:"is-third-width-field",attrs:{pattern:"[0-9]{1,4}",form:t.form,fieldName:"period",inputType:"text",label:t.$t("twofaccounts.forms.period.label"),placeholder:t.$t("twofaccounts.forms.period.placeholder"),help:t.$t("twofaccounts.forms.period.help")}}):t._e(),t._v(" "),"hotp"===t.form.otp_type?e("form-field",{class:"is-third-width-field",attrs:{pattern:"[0-9]{1,4}",form:t.form,fieldName:"counter",inputType:"text",label:t.$t("twofaccounts.forms.counter.label"),placeholder:t.$t("twofaccounts.forms.counter.placeholder"),help:t.$t("twofaccounts.forms.counter.help")}}):t._e()],1):t._e()]):t._e(),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[e("p",{staticClass:"control"},[e("v-button",{staticClass:"is-rounded",attrs:{id:"btnCreate",isLoading:t.form.isBusy}},[t._v(t._s(t.$t("commons.create")))])],1),t._v(" "),t.form.otp_type&&t.form.secret?e("p",{staticClass:"control"},[e("button",{staticClass:"button is-success is-rounded",attrs:{id:"btnPreview",type:"button"},on:{click:t.previewAccount}},[t._v(t._s(t.$t("twofaccounts.forms.test")))])]):t._e(),t._v(" "),e("p",{staticClass:"control"},[e("button",{staticClass:"button is-text is-rounded",attrs:{id:"btnCancel",type:"button"},on:{click:t.cancelCreation}},[t._v(t._s(t.$t("commons.cancel")))])])])],1),t._v(" "),e("modal",{model:{value:t.ShowTwofaccountInModal,callback:function(e){t.ShowTwofaccountInModal=e},expression:"ShowTwofaccountInModal"}},[e("otp-displayer",t._b({ref:"AdvancedFormOtpDisplayer",on:{"increment-hotp":t.incrementHotp,"validation-error":t.mapDisplayerErrors}},"otp-displayer",t.form.data(),!1))],1)],1):t._e(),t._v(" "),e("modal",{model:{value:t.showAlternatives,callback:function(e){t.showAlternatives=e},expression:"showAlternatives"}},[e("div",{staticClass:"too-bad"}),t._v(" "),e("div",{staticClass:"block"},[t._v("\n "+t._s(t.$t("errors.data_of_qrcode_is_not_valid_URI"))+"\n ")]),t._v(" "),e("div",{staticClass:"block mb-6",class:t.$root.showDarkMode?"has-text-light":"has-text-grey-dark"},[t._v(t._s(t.uri))]),t._v(" "),e("div",{staticClass:"block has-text-link"},[e("button",{directives:[{name:"clipboard",rawName:"v-clipboard",value:function(){return t.uri},expression:"() => uri"},{name:"clipboard",rawName:"v-clipboard:success",value:t.clipboardSuccessHandler,expression:"clipboardSuccessHandler",arg:"success"}],staticClass:"button is-link is-outlined is-rounded"},[t._v("\n "+t._s(t.$t("commons.copy_to_clipboard"))+"\n ")])]),t._v(" "),t.isUrl(t.uri)?e("div",{staticClass:"block has-text-link",on:{click:function(e){return t.openInBrowser(t.uri)}}},[e("button",{staticClass:"button is-link is-outlined is-rounded"},[e("span",[t._v(t._s(t.$t("commons.open_in_browser")))]),t._v(" "),e("span",{staticClass:"icon is-small"},[e("font-awesome-icon",{attrs:{icon:["fas","external-link-alt"]}})],1)])]):t._e()])],1)}),[],!1,null,null,null).exports;function yt(t){return yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},yt(t)}function gt(){gt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==yt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function _t(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function wt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){_t(i,n,o,a,s,"next",t)}function s(t){_t(i,n,o,a,s,"throw",t)}a(void 0)}))}}const bt={data:function(){return{ShowTwofaccountInModal:!1,counterIsLocked:!0,twofaccountExists:!1,tempIcon:"",form:new S({service:"",account:"",otp_type:"",uri:"",icon:"",secret:"",algorithm:"",digits:null,counter:null,period:null,image:""}),otp_types:[{text:"TOTP",value:"totp"},{text:"HOTP",value:"hotp"},{text:"STEAM",value:"steamtotp"}],digitsChoices:[{text:6,value:6},{text:7,value:7},{text:8,value:8},{text:9,value:9},{text:10,value:10}],algorithms:[{text:"sha1",value:"sha1"},{text:"sha256",value:"sha256"},{text:"sha512",value:"sha512"},{text:"md5",value:"md5"}],secretIsLocked:!0}},mounted:function(){this.$on("modalClose",(function(){this.$refs.AdvancedFormOtpDisplayer.stopLoop()}))},created:function(){this.getAccount()},components:{Modal:B,OtpDisplayer:Q},methods:{getAccount:function(){var t=this;return wt(gt().mark((function e(){var r,n;return gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.axios.get("/api/v1/twofaccounts/"+t.$route.params.twofaccountId);case 2:r=e.sent,n=r.data,t.form.fill(n),t.twofaccountExists=!0,t.tempIcon=t.form.icon;case 7:case"end":return e.stop()}}),e)})))()},updateAccount:function(){var t=this;return wt(gt().mark((function e(){var r;return gt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.tempIcon!==t.form.icon&&("",r=t.form.icon,t.form.icon=t.tempIcon,t.tempIcon=r,t.deleteIcon()),e.next=3,t.form.put("/api/v1/twofaccounts/"+t.$route.params.twofaccountId);case 3:!1===t.form.errors.any()&&(t.$notify({type:"is-success",text:t.$t("twofaccounts.account_updated")}),t.$router.push({name:"accounts",params:{initialEditMode:!0,toRefresh:!0}}));case 4:case"end":return e.stop()}}),e)})))()},previewAccount:function(){this.$refs.AdvancedFormOtpDisplayer.show()},cancelCreation:function(){this.deleteIcon(),this.$router.push({name:"accounts",params:{initialEditMode:!0}})},uploadIcon:function(t){var e=this;return wt(gt().mark((function t(){var r;return gt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.deleteIcon(),(r=new FormData).append("icon",e.$refs.iconInput.files[0]),e.form.upload("/api/v1/icons",r,{returnError:!0}).then((function(t){e.tempIcon=t.data.filename})).catch((function(t){e.$notify({type:"is-danger",text:e.$t(t.response.data.message)})}));case 4:case"end":return t.stop()}}),t)})))()},fetchLogo:function(){var t=this;this.$root.userPreferences.getOfficialIcons&&this.axios.post("/api/v1/icons/default",{service:this.form.service},{returnError:!0}).then((function(e){201===e.status?(t.deleteIcon(),t.tempIcon=e.data.filename):t.$notify({type:"is-warning",text:t.$t("errors.no_logo_found_for_x",{service:t.strip_tags(t.form.service)})})})).catch((function(e){t.$notify({type:"is-warning",text:t.$t("errors.no_logo_found_for_x",{service:t.strip_tags(t.form.service)})})}))},deleteIcon:function(t){this.tempIcon&&this.tempIcon!==this.form.icon&&this.axios.delete("/api/v1/icons/"+this.tempIcon),this.tempIcon=""},incrementHotp:function(t){this.form.counter=t.nextHotpCounter,this.form.uri=t.nextUri},mapDisplayerErrors:function(t){this.form.errors.set(this.form.extractErrors(t))}}};const xt=(0,T.Z)(bt,(function(){var t=this,e=t._self._c;return e("form-wrapper",{attrs:{title:t.$t("twofaccounts.forms.edit_account")}},[e("form",{on:{submit:function(e){return e.preventDefault(),t.updateAccount.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-field",{attrs:{isDisabled:"steamtotp"===t.form.otp_type,form:t.form,fieldName:"service",inputType:"text",label:t.$t("twofaccounts.service"),placeholder:t.$t("twofaccounts.forms.service.placeholder"),autofocus:""}}),t._v(" "),e("form-field",{attrs:{form:t.form,fieldName:"account",inputType:"text",label:t.$t("twofaccounts.account"),placeholder:t.$t("twofaccounts.forms.account.placeholder")}}),t._v(" "),e("label",{staticClass:"label"},[t._v(t._s(t.$t("twofaccounts.icon")))]),t._v(" "),e("div",{staticClass:"field is-grouped"},[t.$root.userPreferences.getOfficialIcons?e("div",{staticClass:"control"},[e("v-button",{attrs:{color:t.$root.showDarkMode?"is-dark":"",nativeType:"button",isDisabled:t.form.service.length<3},on:{click:t.fetchLogo}},[e("span",{staticClass:"icon is-small"},[e("font-awesome-icon",{attrs:{icon:["fas","globe"]}})],1),t._v(" "),e("span",[t._v(t._s(t.$t("twofaccounts.forms.i_m_lucky")))])])],1):t._e(),t._v(" "),e("div",{staticClass:"control"},[e("div",{staticClass:"file",class:t.$root.showDarkMode?"is-dark":"is-white",attrs:{role:"button",tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$refs.iconInputLabel.click()}}},[e("label",{ref:"iconInputLabel",staticClass:"file-label"},[e("input",{ref:"iconInput",staticClass:"file-input",attrs:{"aria-hidden":"true",tabindex:"-1",type:"file",accept:"image/*"},on:{change:t.uploadIcon}}),t._v(" "),e("span",{staticClass:"file-cta"},[e("span",{staticClass:"file-icon"},[e("font-awesome-icon",{attrs:{icon:["fas","upload"]}})],1),t._v(" "),e("span",{staticClass:"file-label"},[t._v(t._s(t.$t("twofaccounts.forms.choose_image")))])])]),t._v(" "),t.tempIcon?e("span",{staticClass:"tag is-large",class:t.$root.showDarkMode?"is-dark":"is-white"},[e("img",{staticClass:"icon-preview",attrs:{src:t.$root.appConfig.subdirectory+"/storage/icons/"+t.tempIcon,alt:t.$t("twofaccounts.icon_to_illustrate_the_account")}}),t._v(" "),e("button",{staticClass:"clear-selection delete is-small",attrs:{"aria-label":t.$t("twofaccounts.remove_icon")},on:{click:function(e){return e.preventDefault(),t.deleteIcon.apply(null,arguments)}}})]):t._e()])])]),t._v(" "),e("div",{staticClass:"field"},[e("field-error",{staticClass:"help-for-file",attrs:{form:t.form,field:"icon"}}),t._v(" "),t.$root.userPreferences.getOfficialIcons?e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.$t("twofaccounts.forms.i_m_lucky_legend"))}}):t._e()],1),t._v(" "),e("form-toggle",{staticClass:"has-uppercased-button",attrs:{isDisabled:!0,form:t.form,choices:t.otp_types,fieldName:"otp_type",label:t.$t("twofaccounts.forms.otp_type.label"),help:t.$t("twofaccounts.forms.otp_type.help"),hasOffset:!0}}),t._v(" "),t.form.otp_type?e("div",[e("label",{staticClass:"label",attrs:{for:this.inputId("text","secret")},domProps:{innerHTML:t._s(t.$t("twofaccounts.forms.secret.label"))}}),t._v(" "),e("div",{staticClass:"field has-addons"},[e("p",{staticClass:"control is-expanded"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.secret,expression:"form.secret"}],staticClass:"input",attrs:{id:this.inputId("text","secret"),type:"text",disabled:t.secretIsLocked},domProps:{value:t.form.secret},on:{input:function(e){e.target.composing||t.$set(t.form,"secret",e.target.value)}}})]),t._v(" "),t.secretIsLocked?e("p",{staticClass:"control"},[e("button",{staticClass:"button field-lock",class:{"is-dark":t.$root.showDarkMode},attrs:{type:"button",title:t.$t("twofaccounts.forms.unlock.title")},on:{click:function(e){e.stopPropagation(),t.secretIsLocked=!1}}},[e("span",{staticClass:"icon"},[e("font-awesome-icon",{attrs:{icon:["fas","lock"]}})],1)])]):e("p",{staticClass:"control"},[e("button",{staticClass:"button field-unlock",class:{"is-dark":t.$root.showDarkMode},attrs:{type:"button",title:t.$t("twofaccounts.forms.lock.title")},on:{click:function(e){e.stopPropagation(),t.secretIsLocked=!0}}},[e("span",{staticClass:"icon has-text-danger"},[e("font-awesome-icon",{attrs:{icon:["fas","lock-open"]}})],1)])])]),t._v(" "),e("div",{staticClass:"field"},[e("field-error",{staticClass:"help-for-file",attrs:{form:t.form,field:"secret"}}),t._v(" "),e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.$t("twofaccounts.forms.secret.help"))}})],1),t._v(" "),"steamtotp"!==t.form.otp_type?e("div",[e("h2",{staticClass:"title is-4 mt-5 mb-2"},[t._v(t._s(t.$t("commons.options")))]),t._v(" "),e("p",{staticClass:"help mb-4"},[t._v("\n "+t._s(t.$t("twofaccounts.forms.options_help"))+"\n ")]),t._v(" "),e("form-toggle",{attrs:{form:t.form,choices:t.digitsChoices,fieldName:"digits",label:t.$t("twofaccounts.forms.digits.label"),help:t.$t("twofaccounts.forms.digits.help")}}),t._v(" "),e("form-toggle",{attrs:{form:t.form,choices:t.algorithms,fieldName:"algorithm",label:t.$t("twofaccounts.forms.algorithm.label"),help:t.$t("twofaccounts.forms.algorithm.help")}}),t._v(" "),"totp"===t.form.otp_type?e("form-field",{attrs:{form:t.form,fieldName:"period",inputType:"text",label:t.$t("twofaccounts.forms.period.label"),placeholder:t.$t("twofaccounts.forms.period.placeholder"),help:t.$t("twofaccounts.forms.period.help")}}):t._e(),t._v(" "),"hotp"===t.form.otp_type?e("div",[e("div",{staticClass:"field",staticStyle:{"margin-bottom":"0.5rem"}},[e("label",{staticClass:"label"},[t._v(t._s(t.$t("twofaccounts.forms.counter.label")))])]),t._v(" "),e("div",{staticClass:"field has-addons"},[e("div",{staticClass:"control is-expanded"},[e("input",{directives:[{name:"model",rawName:"v-model",value:t.form.counter,expression:"form.counter"}],staticClass:"input",attrs:{type:"text",placeholder:"",disabled:t.counterIsLocked},domProps:{value:t.form.counter},on:{input:function(e){e.target.composing||t.$set(t.form,"counter",e.target.value)}}})]),t._v(" "),t.counterIsLocked?e("div",{staticClass:"control"},[e("button",{staticClass:"button field-lock",class:{"is-dark":t.$root.showDarkMode},attrs:{type:"button",title:t.$t("twofaccounts.forms.unlock.title")},on:{click:function(e){t.counterIsLocked=!1}}},[e("span",{staticClass:"icon"},[e("font-awesome-icon",{attrs:{icon:["fas","lock"]}})],1)])]):e("div",{staticClass:"control"},[e("button",{staticClass:"button field-unlock",class:{"is-dark":t.$root.showDarkMode},attrs:{type:"button",title:t.$t("twofaccounts.forms.lock.title")},on:{click:function(e){t.counterIsLocked=!0}}},[e("span",{staticClass:"icon has-text-danger"},[e("font-awesome-icon",{attrs:{icon:["fas","lock-open"]}})],1)])])]),t._v(" "),e("field-error",{attrs:{form:t.form,field:"counter"}}),t._v(" "),e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.$t("twofaccounts.forms.counter.help_lock"))}})],1):t._e()],1):t._e()]):t._e(),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[e("p",{staticClass:"control"},[e("v-button",{staticClass:"is-rounded",attrs:{isLoading:t.form.isBusy}},[t._v(t._s(t.$t("commons.save")))])],1),t._v(" "),t.form.otp_type&&t.form.secret?e("p",{staticClass:"control"},[e("button",{staticClass:"button is-success is-rounded",attrs:{type:"button"},on:{click:t.previewAccount}},[t._v(t._s(t.$t("twofaccounts.forms.test")))])]):t._e(),t._v(" "),e("p",{staticClass:"control"},[e("button",{staticClass:"button is-text is-rounded",attrs:{id:"btnCancel",type:"button"},on:{click:t.cancelCreation}},[t._v(t._s(t.$t("commons.cancel")))])])])],1),t._v(" "),e("modal",{model:{value:t.ShowTwofaccountInModal,callback:function(e){t.ShowTwofaccountInModal=e},expression:"ShowTwofaccountInModal"}},[e("otp-displayer",t._b({ref:"AdvancedFormOtpDisplayer",on:{"increment-hotp":t.incrementHotp,"validation-error":t.mapDisplayerErrors}},"otp-displayer",t.form.data(),!1))],1)],1)}),[],!1,null,null,null).exports;function kt(t){return kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(t)}function $t(){$t=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==kt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Lt(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Ct(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Lt(i,n,o,a,s,"next",t)}function s(t){Lt(i,n,o,a,s,"throw",t)}a(void 0)}))}}var Et;const Ot={data:function(){return{migrationPayload:"",exportedAccounts:[],isFetching:!1,form:new S({service:"",account:"",otp_type:"",icon:"",secret:"",algorithm:"",digits:null,counter:null,period:null}),uploadForm:new S,ShowTwofaccountInModal:!1,supportedSources:[{app:"2FAuth",format:"JSON"},{app:"Google Auth",format:this.$t("twofaccounts.import.qr_code")},{app:"Aegis Auth",format:"JSON"},{app:"Aegis Auth",format:this.$t("twofaccounts.import.plain_text")},{app:"2FAS auth",format:"JSON"}]}},computed:{importableCount:function(){return this.exportedAccounts.filter((function(t){return-1==t.imported&&t.id>-2})).length},duplicateCount:function(){return this.exportedAccounts.filter((function(t){return-1===t.id&&-1===t.imported})).length},importedCount:function(){return this.exportedAccounts.filter((function(t){return 1===t.imported})).length}},mounted:(Et=Ct($t().mark((function t(){return $t().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.$route.params.migrationUri&&this.migrate(this.$route.params.migrationUri),this.$on("modalClose",(function(){this.$refs.AdvancedFormOtpDisplayer.clearOTP()}));case 2:case"end":return t.stop()}}),t,this)}))),function(){return Et.apply(this,arguments)}),components:{Modal:B,OtpDisplayer:Q},methods:{migrate:function(t){var e=this;return Ct($t().mark((function r(){return $t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return e.migrationPayload=t,e.isFetching=!0,r.next=4,e.axios.post("/api/v1/twofaccounts/migration",{payload:e.migrationPayload,withSecret:!0},{returnError:!0}).then((function(t){t.data.forEach((function(t){t.imported=-1,e.exportedAccounts.push(t)})),e.notifyValidAccountFound()})).catch((function(t){e.$notify({type:"is-danger",text:e.$t(t.response.data.message)})}));case 4:e.isFetching=!1;case 5:case"end":return r.stop()}}),r)})))()},discardDuplicates:function(){confirm(this.$t("twofaccounts.confirm.discard_duplicates"))&&(this.$notify({clean:!0}),this.$refs.AdvancedFormOtpDisplayer.clearOTP(),this.exportedAccounts=this.exportedAccounts.filter((function(t){return-1!==t.id})))},discardAccounts:function(){confirm(this.$t("twofaccounts.confirm.discard_all"))&&(this.$notify({clean:!0}),this.$refs.AdvancedFormOtpDisplayer.clearOTP(),this.exportedAccounts=[])},discardAccount:function(t){confirm(this.$t("twofaccounts.confirm.discard"))&&this.exportedAccounts.splice(t,1)},createAccounts:function(){var t=this;return Ct($t().mark((function e(){var r;return $t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.exportedAccounts.length)){e.next=8;break}if(-1!=t.exportedAccounts[r].imported){e.next=5;break}return e.next=5,t.createAccount(r);case 5:r++,e.next=1;break;case 8:case"end":return e.stop()}}),e)})))()},createAccount:function(t){var e=this;return Ct($t().mark((function r(){var n;return $t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.exportedAccounts[t],e.mapAccountToForm(n),r.next=4,e.form.post("/api/v1/twofaccounts",{returnError:!0}).then((function(r){e.exportedAccounts[t].imported=1,e.exportedAccounts[t].id=r.data.id})).catch((function(r){e.exportedAccounts[t].imported=0,e.exportedAccounts[t].id=0,e.exportedAccounts[t].errors=e.form.errors.flatten()}));case 4:case"end":return r.stop()}}),r)})))()},previewAccount:function(t){var e=this;this.mapAccountToForm(this.exportedAccounts[t]).then((function(){e.$refs.AdvancedFormOtpDisplayer.$forceUpdate(),e.$refs.AdvancedFormOtpDisplayer.show()}))},mapAccountToForm:function(t){var e=this;return Ct($t().mark((function r(){return $t().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:e.form.account=t.account,e.form.service=t.service,e.form.otp_type=t.otp_type,e.form.icon=t.icon,e.form.secret=t.secret,e.form.algorithm=t.algorithm,e.form.digits=t.digits,e.form.counter="hotp"===t.otp_type?t.counter:null,e.form.period="totp"===t.otp_type?t.period:null;case 9:case"end":return r.stop()}}),r)})))()},submitFile:function(){var t=this;this.isFetching=!0;var e=new FormData;e.append("file",this.$refs.fileInput.files[0]),e.append("withSecret",!0),this.uploadForm.upload("/api/v1/twofaccounts/migration",e,{returnError:!0}).then((function(e){e.data.forEach((function(e){e.imported=-1,t.exportedAccounts.push(e)})),t.notifyValidAccountFound()})).catch((function(e){422===e.response.status?null==e.response.data.errors.file&&t.$notify({type:"is-danger",text:t.$t("errors.invalid_2fa_data")}):t.$notify({type:"is-danger",text:e.response.data.message})})),this.isFetching=!1},submitQrCode:function(){var t=this,e=new FormData;e.append("qrcode",this.$refs.qrcodeInput.files[0]),e.append("withSecret",!0),this.uploadForm.upload("/api/v1/qrcode/decode",e,{returnError:!0}).then((function(e){t.migrate(e.data.data)})).catch((function(e){422===e.response.status?null==e.response.data.errors.qrcode&&t.$notify({type:"is-danger",text:t.$t("errors.invalid_2fa_data")}):t.$notify({type:"is-danger",text:e.response.data.message})}))},capture:function(){this.$router.push({name:"capture"})},notifyValidAccountFound:function(){this.$notify({type:"is-success",text:this.$t("twofaccounts.import.x_valid_accounts_found",{count:this.importableCount})})}}};const St=(0,T.Z)(Ot,(function(){var t=this,e=t._self._c;return e("div",[e("responsive-width-wrapper",[e("h1",{staticClass:"title has-text-grey-dark"},[t._v("\n "+t._s(t.$t("twofaccounts.import.import"))+"\n ")]),t._v(" "),0==t.exportedAccounts.length?e("div",[e("div",{staticClass:"block is-size-7-mobile",domProps:{innerHTML:t._s(t.$t("twofaccounts.import.import_legend"))}}),t._v(" "),e("h5",{staticClass:"title is-5 mb-3 has-text-grey"},[t._v(t._s(t.$t("twofaccounts.import.qr_code")))]),t._v(" "),e("div",{staticClass:"block"},[e("div",{staticClass:"buttons mb-0"},[e("button",{staticClass:"button is-link is-rounded mr-0",attrs:{tabindex:"0"},on:{click:function(e){return t.capture()}}},[e("span",{staticClass:"icon"},[e("font-awesome-icon",{attrs:{icon:["fas","camera"]}})],1),t._v(" "),e("span",[t._v(t._s(t.$t("twofaccounts.import.scan")))])]),t._v(" "),e("span",{staticClass:"p-2 mb-2"},[t._v(t._s(t.$t("commons.or")))]),t._v(" "),e("label",{ref:"qrcodeInputLabel",staticClass:"button is-link is-rounded is-outlined",attrs:{role:"button",tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$refs.qrcodeInputLabel.click()}}},[t._v("\n "+t._s(t.$t("twofaccounts.import.upload"))+"\n "),e("input",{ref:"qrcodeInput",staticClass:"file-input",attrs:{"aria-hidden":"true",tabindex:"-1",type:"file",accept:"image/*"},on:{change:t.submitQrCode}})])]),t._v(" "),e("field-error",{attrs:{form:t.uploadForm,field:"qrcode"}}),t._v(" "),e("p",{staticClass:"help"},[t._v(t._s(t.$t("twofaccounts.import.supported_formats_for_qrcode_upload")))])],1),t._v(" "),e("h5",{staticClass:"title is-5 mb-3 has-text-grey"},[t._v(t._s(t.$t("commons.file")))]),t._v(" "),e("div",{staticClass:"block mb-6"},[e("label",{ref:"fileInputLabel",staticClass:"button is-link is-rounded is-outlined",attrs:{role:"button",tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.$refs.fileInputLabel.click()}}},[e("input",{ref:"fileInput",staticClass:"file-input",attrs:{"aria-hidden":"true",tabindex:"-1",type:"file",accept:"text/plain,application/json,text/csv,.2fas"},on:{change:t.submitFile}}),t._v("\n "+t._s(t.$t("twofaccounts.import.upload"))+"\n ")]),t._v(" "),e("field-error",{attrs:{form:t.uploadForm,field:"file"}}),t._v(" "),e("p",{staticClass:"help"},[t._v(t._s(t.$t("twofaccounts.import.supported_formats_for_file_upload")))])],1),t._v(" "),e("h5",{staticClass:"title is-6 mb-3 has-text-grey-dark"},[t._v(t._s(t.$t("twofaccounts.import.supported_migration_formats")))]),t._v(" "),e("div",{staticClass:"field is-grouped is-grouped-multiline pt-0"},t._l(t.supportedSources,(function(r,n){return e("div",{key:n,staticClass:"control"},[e("div",{staticClass:"tags has-addons"},[e("span",{staticClass:"tag",class:t.$root.showDarkMode?"is-dark":"is-white"},[t._v(t._s(r.app))]),t._v(" "),e("span",{staticClass:"tag",class:t.$root.showDarkMode?"is-black":"has-background-grey-lighter has-text-black"},[t._v(t._s(r.format))])])])})),0),t._v(" "),e("span",{staticClass:"is-size-7",domProps:{innerHTML:t._s(t.$t("twofaccounts.import.do_not_set_password_or_encryption"))}})]):e("div",[t._l(t.exportedAccounts,(function(r,n){return e("div",{key:r.name,staticClass:"group-item is-size-5 is-size-6-mobile"},[e("div",{staticClass:"is-flex is-justify-content-space-between"},[r.id>-2&&0!==r.imported?e("div",{staticClass:"is-flex-grow-1 has-ellipsis is-clickable",attrs:{title:t.$t("twofaccounts.import.generate_a_test_password")},on:{click:function(e){return t.previewAccount(n)}}},[r.icon&&t.$root.userPreferences.showAccountsIcons?e("img",{staticClass:"import-icon",attrs:{src:t.$root.appConfig.subdirectory+"/storage/icons/"+r.icon,alt:t.$t("twofaccounts.icon_for_account_x_at_service_y",{account:r.account,service:r.service})}}):t._e(),t._v("\n "+t._s(r.account)+"\n ")]):e("div",{staticClass:"is-flex-grow-1 has-ellipsis"},[t._v(t._s(r.account))]),t._v(" "),-1===r.imported?e("div",{staticClass:"tags is-flex-wrap-nowrap"},[e("button",{staticClass:"button tag",class:{"is-dark has-text-grey-light":t.$root.showDarkMode},attrs:{title:t.$t("twofaccounts.import.discard_this_account")},on:{click:function(e){return t.discardAccount(n)}}},[e("font-awesome-icon",{attrs:{icon:["fas","trash"]}})],1),t._v(" "),r.id>-2?e("button",{staticClass:"button tag is-link",attrs:{title:t.$t("twofaccounts.import.import_this_account")},on:{click:function(e){return t.createAccount(n)}}},[t._v("\n "+t._s(t.$t("twofaccounts.import.to_import"))+"\n ")]):t._e()]):e("div",{staticClass:"has-nowrap"},[1===r.imported?e("span",{staticClass:"has-text-success"},[t._v("\n "+t._s(t.$t("twofaccounts.import.imported"))+" "),e("font-awesome-icon",{attrs:{icon:["fas","check"]}})],1):e("span",{staticClass:"has-text-danger"},[t._v("\n "+t._s(t.$t("twofaccounts.import.failure"))+" "),e("font-awesome-icon",{attrs:{icon:["fas","times"]}})],1)])]),t._v(" "),e("div",{staticClass:"is-size-6 is-size-7-mobile"},[e("div",{staticClass:"is-family-primary has-text-grey"},[t._v(t._s(t.$t("twofaccounts.import.issuer"))+": "+t._s(r.service))]),t._v(" "),-2===r.id?e("div",{staticClass:"has-text-danger"},[e("font-awesome-icon",{staticClass:"mr-1",attrs:{icon:["fas","times-circle"]}}),t._v(t._s(r.secret)+"\n ")],1):t._e(),t._v(" "),-1!==r.id||1===r.imported||r.errors?t._e():e("div",{staticClass:"has-text-warning"},[e("font-awesome-icon",{staticClass:"mr-1",attrs:{icon:["fas","exclamation-circle"]}}),t._v(t._s(t.$t("twofaccounts.import.possible_duplicate"))+"\n ")],1),t._v(" "),r.errors?e("ul",t._l(r.errors,(function(r){return e("li",{key:r,staticClass:"has-text-danger"},[t._v(t._s(r))])})),0):t._e()])])})),t._v(" "),t.importableCount>0?e("div",{staticClass:"mt-2 is-size-7 is-pulled-right"},[t.duplicateCount?e("button",{staticClass:"has-text-grey button is-small is-ghost",on:{click:function(e){return t.discardDuplicates()}}},[t._v(t._s(t.$t("twofaccounts.import.discard_duplicates"))+" ("+t._s(t.duplicateCount)+")")]):t._e(),t._v(" "),e("button",{staticClass:"has-text-grey button is-small is-ghost",on:{click:function(e){return t.discardAccounts()}}},[t._v(t._s(t.$t("twofaccounts.import.discard_all")))])]):t._e(),t._v(" "),t.importedCount==t.exportedAccounts.length?e("div",{staticClass:"mt-2 is-size-7 is-pulled-right"},[e("button",{staticClass:"has-text-grey button is-small is-ghost",on:{click:function(e){t.exportedAccounts=[]}}},[t._v(t._s(t.$t("commons.clear")))])]):t._e()],2),t._v(" "),t.isFetching&&0===t.exportedAccounts.length?e("div",{staticClass:"has-text-centered"},[e("span",{staticClass:"is-size-4"},[e("font-awesome-icon",{attrs:{icon:["fas","spinner"],spin:""}})],1)]):t._e(),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[t.importableCount>0?e("p",{staticClass:"control"},[e("button",{staticClass:"button is-link is-rounded is-focus",on:{click:t.createAccounts}},[e("span",[t._v(t._s(t.$t("twofaccounts.import.import_all"))+" ("+t._s(t.importableCount)+")")])])]):t._e(),t._v(" "),e("p",{staticClass:"control"},[e("router-link",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:t.importableCount>0?"btnCancel":"btnClose",to:{name:"accounts",params:{toRefresh:!0}}},domProps:{innerHTML:t._s(t.importableCount>0?t.$t("commons.cancel"):t.$t("commons.close"))}})],1)])],1),t._v(" "),e("modal",{model:{value:t.ShowTwofaccountInModal,callback:function(e){t.ShowTwofaccountInModal=e},expression:"ShowTwofaccountInModal"}},[e("otp-displayer",t._b({ref:"AdvancedFormOtpDisplayer"},"otp-displayer",t.form.data(),!1))],1)],1)}),[],!1,null,null,null).exports;function Pt(t){return Pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(t)}function Tt(){Tt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==Pt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function At(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}const Nt={data:function(){return{qrcode:null}},mounted:function(){this.getQRcode()},methods:{getQRcode:function(){var t,e=this;return(t=Tt().mark((function t(){var r,n;return Tt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.axios.get("/api/v1/twofaccounts/"+e.$route.params.twofaccountId+"/qrcode");case 2:r=t.sent,n=r.data,e.qrcode=n.qrcode;case 5:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){At(i,n,o,a,s,"next",t)}function s(t){At(i,n,o,a,s,"throw",t)}a(void 0)}))})()}}};const jt=(0,T.Z)(Nt,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"modal modal-otp is-active"},[e("div",{staticClass:"modal-background"}),t._v(" "),e("div",{staticClass:"modal-content"},[e("p",{staticClass:"has-text-centered m-5"},[e("img",{staticClass:"has-background-light",attrs:{src:t.qrcode,alt:t.$t("commons.image_of_qrcode_to_scan")}})])]),t._v(" "),e("div",{staticClass:"fullscreen-footer"},[e("button",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"btnClose"},on:{click:function(e){return e.stopPropagation(),t.$router.push({name:"accounts",params:{initialEditMode:!0}})}}},[t._v("\n "+t._s(t.$t("commons.close"))+"\n ")])])])}),[],!1,null,null,null).exports;function It(t){return It="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(t)}function Ft(){Ft=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==It(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Dt(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Gt(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Dt(i,n,o,a,s,"next",t)}function s(t){Dt(i,n,o,a,s,"throw",t)}a(void 0)}))}}const Mt={data:function(){return{groups:[],TheAllGroup:null,isFetching:!1}},mounted:function(){var t=this.$storage.get("groups",null);t&&(this.groups=t,this.TheAllGroup=this.groups.shift()),this.fetchGroups()},methods:{fetchGroups:function(){var t=this;return Gt(Ft().mark((function e(){return Ft().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.isFetching=!0,e.next=3,t.axios.get("api/v1/groups").then((function(e){var r=[];e.data.forEach((function(t){r.push(t)})),t.TheAllGroup=r.shift(),t.groups=r}));case 3:t.isFetching=!1;case 4:case"end":return e.stop()}}),e)})))()},deleteGroup:function(t){var e=this;return Gt(Ft().mark((function r(){return Ft().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!confirm(e.$t("groups.confirm.delete"))){r.next=3;break}return r.next=3,e.axios.delete("/api/v1/groups/"+t).then((function(r){e.groups=e.groups.filter((function(e){return e.id!==t})),e.$notify({type:"is-success",text:e.$t("groups.group_successfully_deleted")}),parseInt(e.$root.userPreferences.activeGroup)===t&&(e.$root.userPreferences.activeGroup=0)}));case 3:case"end":return r.stop()}}),r)})))()}},beforeRouteLeave:function(t,e,r){this.groups.unshift(this.TheAllGroup),this.$storage.set("groups",this.groups),r()}};const Bt=(0,T.Z)(Mt,(function(){var t=this,e=t._self._c;return e("responsive-width-wrapper",[e("h1",{staticClass:"title has-text-grey-dark"},[t._v("\n "+t._s(t.$t("groups.groups"))+"\n ")]),t._v(" "),e("div",{staticClass:"is-size-7-mobile"},[t._v("\n "+t._s(t.$t("groups.manage_groups_legend"))+"\n ")]),t._v(" "),e("div",{staticClass:"mt-3 mb-6"},[e("router-link",{staticClass:"is-link mt-5",attrs:{to:{name:"createGroup"}}},[e("font-awesome-icon",{attrs:{icon:["fas","plus-circle"]}}),t._v(" "+t._s(t.$t("groups.create_group"))+"\n ")],1)],1),t._v(" "),t.groups.length>0?e("div",[t._l(t.groups,(function(r){return e("div",{key:r.id,staticClass:"group-item is-size-5 is-size-6-mobile"},[t._v("\n "+t._s(r.name)+"\n "),t._v(" "),e("button",{staticClass:"button tag is-pulled-right",class:t.$root.showDarkMode?"is-dark":"is-white",attrs:{title:t.$t("commons.delete")},on:{click:function(e){return t.deleteGroup(r.id)}}},[t._v("\n "+t._s(t.$t("commons.delete"))+"\n ")]),t._v(" "),e("router-link",{staticClass:"has-text-grey px-1",attrs:{to:{name:"editGroup",params:{groupId:r.id,name:r.name}},title:t.$t("commons.rename")}},[e("font-awesome-icon",{attrs:{icon:["fas","pen-square"]}})],1),t._v(" "),e("span",{staticClass:"is-family-primary is-size-6 is-size-7-mobile has-text-grey"},[t._v(t._s(r.twofaccounts_count)+" "+t._s(t.$t("twofaccounts.accounts")))])],1)})),t._v(" "),t.groups.length>0?e("div",{staticClass:"mt-2 is-size-7 is-pulled-right"},[t._v("\n "+t._s(t.$t("groups.deleting_group_does_not_delete_accounts"))+"\n ")]):t._e()],2):t._e(),t._v(" "),t.isFetching&&0===t.groups.length?e("div",{staticClass:"has-text-centered"},[e("span",{staticClass:"is-size-4"},[e("font-awesome-icon",{attrs:{icon:["fas","spinner"],spin:""}})],1)]):t._e(),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[e("p",{staticClass:"control"},[e("router-link",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"btnClose",to:{name:"accounts",params:{toRefresh:!0}}}},[t._v(t._s(t.$t("commons.close")))])],1)])],1)}),[],!1,null,null,null).exports;function qt(t){return qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qt(t)}function Rt(){Rt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==qt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ut(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}const zt={data:function(){return{form:new S({name:""})}},methods:{createGroup:function(){var t,e=this;return(t=Rt().mark((function t(){return Rt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.form.post("/api/v1/groups");case 2:!1===e.form.errors.any()&&(e.$notify({type:"is-success",text:e.$t("groups.group_successfully_created")}),e.$router.push({name:"groups"}));case 3:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ut(i,n,o,a,s,"next",t)}function s(t){Ut(i,n,o,a,s,"throw",t)}a(void 0)}))})()}}};const Ht=(0,T.Z)(zt,(function(){var t=this,e=t._self._c;return e("form-wrapper",{attrs:{title:t.$t("groups.forms.new_group")}},[e("form",{on:{submit:function(e){return e.preventDefault(),t.createGroup.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-field",{attrs:{form:t.form,fieldName:"name",inputType:"text",label:t.$t("commons.name"),autofocus:""}}),t._v(" "),e("form-buttons",{attrs:{submitId:"btnCreateGroup",isBusy:t.form.isBusy,caption:t.$t("commons.create"),showCancelButton:!0,cancelLandingView:"groups"}})],1)])}),[],!1,null,null,null).exports;function Zt(t){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zt(t)}function Wt(){Wt=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==Zt(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Yt(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}const Kt={data:function(){return{form:new S({name:this.name})}},props:["groupId","name"],methods:{updateGroup:function(){var t,e=this;return(t=Wt().mark((function t(){return Wt().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.form.put("/api/v1/groups/"+e.groupId);case 2:!1===e.form.errors.any()&&(e.$notify({type:"is-success",text:e.$t("groups.group_name_saved")}),e.$router.push({name:"groups"}));case 3:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Yt(i,n,o,a,s,"next",t)}function s(t){Yt(i,n,o,a,s,"throw",t)}a(void 0)}))})()}}};const Vt=(0,T.Z)(Kt,(function(){var t=this,e=t._self._c;return e("form-wrapper",{attrs:{title:t.$t("groups.forms.rename_group")}},[e("form",{on:{submit:function(e){return e.preventDefault(),t.updateGroup.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-field",{attrs:{form:t.form,fieldName:"name",inputType:"text",label:t.$t("groups.forms.new_name"),autofocus:""}}),t._v(" "),e("form-buttons",{attrs:{submitId:"btnEditGroup",isBusy:t.form.isBusy,caption:t.$t("commons.save"),showCancelButton:!0,cancelLandingView:"groups"}})],1)])}),[],!1,null,null,null).exports;function Qt(t){return Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qt(t)}function Jt(t){return function(t){if(Array.isArray(t))return Xt(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return Xt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xt(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Xt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function te(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ee(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?te(Object(r),!0).forEach((function(e){re(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):te(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function re(t,e,r){return(e=oe(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ne(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,oe(n.key),n)}}function oe(t){var e=function(t,e){if("object"!==Qt(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Qt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Qt(e)?e:String(e)}var ie=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}var e,r,n;return e=t,n=[{key:"uint8Array",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Uint8Array.from(r?atob(e):t.base64UrlDecode(e),(function(t){return t.charCodeAt(0)}))}},{key:"arrayToBase64String",value:function(t){return btoa(String.fromCharCode.apply(String,Jt(new Uint8Array(t))))}},{key:"base64UrlDecode",value:function(t){var e=(t=t.replace(/-/g,"+").replace(/_/g,"/")).length%4;if(e){if(1===e)throw new Error("InvalidLengthError: Input base64url string is the wrong length to determine padding");t+=new Array(5-e).join("=")}return atob(t)}},{key:"supportsWebAuthn",value:function(){var t;return void 0!==(null===(t=window)||void 0===t?void 0:t.PublicKeyCredential)&&"function"==typeof window.PublicKeyCredential}},{key:"doesntSupportWebAuthn",value:function(){return!this.supportsWebAuthn()}}],(r=[{key:"parseIncomingServerOptions",value:function(e){return e.challenge=t.uint8Array(e.challenge),"user"in e&&(e.user=ee(ee({},e.user),{},{id:t.uint8Array(e.user.id)})),["excludeCredentials","allowCredentials"].filter((function(t){return t in e})).forEach((function(r){e[r]=e[r].map((function(e){return ee(ee({},e),{},{id:t.uint8Array(e.id)})}))})),e}},{key:"parseOutgoingCredentials",value:function(e){var r={id:e.id,type:e.type,rawId:t.arrayToBase64String(e.rawId),response:{}};return["clientDataJSON","attestationObject","authenticatorData","signature","userHandle"].filter((function(t){return t in e.response})).forEach((function(n){return r.response[n]=t.arrayToBase64String(e.response[n])})),r}}])&&ne(e.prototype,r),n&&ne(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function ae(t){return ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ae(t)}function se(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,ce(n.key),n)}}function ce(t){var e=function(t,e){if("object"!==ae(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==ae(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===ae(e)?e:String(e)}var ue=new(function(){function t(){var e,r,n;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=void 0,(r=ce(r="controller"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n}var e,r,n;return e=t,(r=[{key:"createNewAbortSignal",value:function(){if(this.controller){var t=new Error("Cancelling existing WebAuthn API call for new one");t.name="AbortError",this.controller.abort(t)}var e=new AbortController;return this.controller=e,e.signal}}])&&se(e.prototype,r),n&&se(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}());function le(t){return"localhost"===t||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function fe(t,e){var r=e.publicKey;if("AbortError"===t.name){if(e.signal instanceof AbortSignal)return{phrase:"errors.aborted_by_user",type:"is-warning"}}else{if("NotAllowedError"===t.name)return{phrase:"errors.not_allowed_operation",type:"is-danger"};if("SecurityError"===t.name){var n=window.location.hostname;if(!le(n))return{phrase:"errors.2fauth_has_not_a_valid_domain",type:"is-danger"};if(r.rpId!==n)return{phrase:"errors.security_error_check_rpid",type:"is-danger"}}else if("UnknownError"===t.name)return{phrase:"errors.unknown_error",type:"is-danger"}}return{phrase:"errors.unknown_error",type:"is-danger"}}function pe(t){return pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pe(t)}function he(){he=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==pe(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function de(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}const me={data:function(){return{isDemo:this.$root.isDemoApp,isTesting:this.$root.isTestingApp,form:new S({email:"",password:""}),isBusy:!1,showWebauthn:this.$root.userPreferences.useWebauthnOnly,csrfRefresher:null}},mounted:function(){this.csrfRefresher=setInterval(this.refreshToken,3e5),this.showWebauthn=this.$storage.get("showWebauthnForm",!1)},methods:{toggleForm:function(){this.showWebauthn=!this.showWebauthn,this.$storage.set("showWebauthnForm",this.showWebauthn)},handleSubmit:function(t){var e=this;t.preventDefault(),this.form.post("/user/login",{returnError:!0}).then((function(t){e.$storage.set("authenticated",!0),e.applyPreferences(t.data.preferences),e.$router.push({name:"accounts",params:{toRefresh:!0}})})).catch((function(t){e.$storage.set("authenticated",!1),401===t.response.status?e.$notify({type:"is-danger",text:e.$t("auth.forms.authentication_failed"),duration:-1}):422!==t.response.status&&e.$router.push({name:"genericError",params:{err:t.response}})}))},webauthnLogin:function(){var t,e=this;return(t=he().mark((function t(){var r,n,o,i,a,s;return he().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e.isBusy=!1,r=new ie,window.isSecureContext){t.next=5;break}return e.$notify({type:"is-danger",text:e.$t("errors.https_required")}),t.abrupt("return",!1);case 5:if(!r.doesntSupportWebAuthn){t.next=8;break}return e.$notify({type:"is-danger",text:e.$t("errors.browser_does_not_support_webauthn")}),t.abrupt("return",!1);case 8:return t.next=10,e.form.post("/webauthn/login/options").then((function(t){return t.data}));case 10:return n=t.sent,o=r.parseIncomingServerOptions(n),(i={publicKey:o}).signal=ue.createNewAbortSignal(),t.next=16,navigator.credentials.get(i).catch((function(t){var r=fe(t,i);e.$notify({type:r.type,text:e.$t(r.phrase)})}));case 16:if(a=t.sent){t.next=19;break}return t.abrupt("return",!1);case 19:(s=r.parseOutgoingCredentials(a)).email=e.form.email,e.axios.post("/webauthn/login",s,{returnError:!0}).then((function(t){e.$storage.set("authenticated",!0),e.applyPreferences(t.data.preferences),e.$router.push({name:"accounts",params:{toRefresh:!0}})})).catch((function(t){e.$storage.set("authenticated",!1),401===t.response.status?e.$notify({type:"is-danger",text:e.$t("auth.forms.authentication_failed"),duration:-1}):422!==t.response.status&&e.$router.push({name:"genericError",params:{err:t.response}})})),e.isBusy=!1;case 23:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){de(i,n,o,a,s,"next",t)}function s(t){de(i,n,o,a,s,"throw",t)}a(void 0)}))})()},refreshToken:function(){this.axios.get("/refresh-csrf")}},beforeRouteEnter:function(t,e,r){t.params.forceRefresh&&null!==e.name?window.location.href="."+t.path:r()},beforeRouteLeave:function(t,e,r){this.$notify({clean:!0}),clearInterval(this.csrfRefresher),this.$root.appSettings.disableRegistration&&"register"==t.name&&this.$router.push({name:"genericError",params:{err:this.$t("errors.unauthorized_legend")}}),r()}},ve=me;const ye=(0,T.Z)(ve,(function(){var t=this,e=t._self._c;return e("div",[t.showWebauthn?e("form-wrapper",{attrs:{title:t.$t("auth.forms.webauthn_login"),punchline:t.$t("auth.welcome_to_2fauth")}},[e("div",{staticClass:"field"},[t._v("\n "+t._s(t.$t("auth.webauthn.use_security_device_to_sign_in"))+"\n ")]),t._v(" "),e("form",{attrs:{id:"frmWebauthnLogin"},on:{submit:function(e){return e.preventDefault(),t.webauthnLogin.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-field",{attrs:{form:t.form,fieldName:"email",inputType:"email",label:t.$t("auth.forms.email"),autofocus:""}}),t._v(" "),e("form-buttons",{attrs:{isBusy:t.form.isBusy,caption:t.$t("commons.continue"),submitId:"btnContinue"}})],1),t._v(" "),e("div",{staticClass:"nav-links"},[e("p",[t._v(t._s(t.$t("auth.webauthn.lost_your_device"))+" "),e("router-link",{staticClass:"is-link",attrs:{id:"lnkRecoverAccount",to:{name:"webauthn.lost"}}},[t._v(t._s(t.$t("auth.webauthn.recover_your_account")))])],1),t._v(" "),this.$root.userPreferences.useWebauthnOnly?t._e():e("p",[t._v(t._s(t.$t("auth.sign_in_using"))+" \n "),e("a",{staticClass:"is-link",attrs:{id:"lnkSignWithLegacy",role:"button",tabindex:"0"},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.toggleForm.apply(null,arguments)},click:t.toggleForm}},[t._v(t._s(t.$t("auth.login_and_password")))])])])]):e("form-wrapper",{attrs:{title:t.$t("auth.forms.login"),punchline:t.$t("auth.welcome_to_2fauth")}},[t.isDemo?e("div",{staticClass:"notification is-info has-text-centered is-radiusless",domProps:{innerHTML:t._s(t.$t("auth.forms.welcome_to_demo_app_use_those_credentials"))}}):t._e(),t._v(" "),t.isTesting?e("div",{staticClass:"notification is-warning has-text-centered is-radiusless",domProps:{innerHTML:t._s(t.$t("auth.forms.welcome_to_testing_app_use_those_credentials"))}}):t._e(),t._v(" "),e("form",{attrs:{id:"frmLegacyLogin"},on:{submit:function(e){return e.preventDefault(),t.handleSubmit.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-field",{attrs:{form:t.form,fieldName:"email",inputType:"email",label:t.$t("auth.forms.email"),autofocus:""}}),t._v(" "),e("form-password-field",{attrs:{form:t.form,fieldName:"password",label:t.$t("auth.forms.password")}}),t._v(" "),e("form-buttons",{attrs:{isBusy:t.form.isBusy,caption:t.$t("auth.sign_in"),submitId:"btnSignIn"}})],1),t._v(" "),e("div",{staticClass:"nav-links"},[e("p",[t._v(t._s(t.$t("auth.forms.forgot_your_password"))+" "),e("router-link",{staticClass:"is-link",attrs:{id:"lnkResetPwd",to:{name:"password.request"},"aria-label":t.$t("auth.forms.reset_your_password")}},[t._v(t._s(t.$t("auth.forms.request_password_reset")))])],1),t._v(" "),e("p",[t._v(t._s(t.$t("auth.sign_in_using"))+" \n "),e("a",{staticClass:"is-link",attrs:{id:"lnkSignWithWebauthn",role:"button",tabindex:"0","aria-label":t.$t("auth.sign_in_using_security_device")},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.toggleForm.apply(null,arguments)},click:t.toggleForm}},[t._v(t._s(t.$t("auth.webauthn.security_device")))])]),t._v(" "),0==this.$root.appSettings.disableRegistration?e("p",{staticClass:"mt-4"},[t._v(t._s(t.$t("auth.forms.dont_have_account_yet"))+" "),e("router-link",{staticClass:"is-link",attrs:{id:"lnkRegister",to:{name:"register"}}},[t._v(t._s(t.$t("auth.register")))])],1):t._e()])]),t._v(" "),e("vue-footer")],1)}),[],!1,null,null,null).exports;function ge(t,e){var r=e.publicKey;if("AbortError"===t.name){if(e.signal instanceof AbortSignal)return{phrase:"errors.aborted_by_user",type:"is-warning"}}else if("ConstraintError"===t.name){var n,o;if(!0===(null===(n=r.authenticatorSelection)||void 0===n?void 0:n.requireResidentKey))return{phrase:"errors.authenticator_missing_discoverable_credential_support",type:"is-danger"};if("required"===(null===(o=r.authenticatorSelection)||void 0===o?void 0:o.userVerification))return{phrase:"errors.authenticator_missing_user_verification_support",type:"is-danger"}}else{if("InvalidStateError"===t.name)return{phrase:"errors.security_device_already_registered",type:"is-danger"};if("NotAllowedError"===t.name)return{phrase:"errors.not_allowed_operation",type:"is-danger"};if("NotSupportedError"===t.name)return 0===r.pubKeyCredParams.filter((function(t){return"public-key"===t.type})).length?{phrase:"errors.no_entry_was_of_type_public_key",type:"is-danger"}:{phrase:"errors.no_authenticator_support_specified_algorithms",type:"is-danger"};if("SecurityError"===t.name){var i=window.location.hostname;if(!le(i))return{phrase:"errors.2fauth_has_not_a_valid_domain",type:"is-danger"};if(r.rp.id!==i)return{phrase:"errors.security_error_check_rpid",type:"is-danger"}}else if("TypeError"===t.name){if(r.user.id.byteLength<1||r.user.id.byteLength>64)return{phrase:"errors.user_id_not_between_1_64",type:"is-danger"}}else if("UnknownError"===t.name)return{phrase:"errors.unknown_error",type:"is-danger"}}return{phrase:"errors.unknown_error",type:"is-danger"}}function _e(t){return _e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_e(t)}function we(){we=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==_e(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function be(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function xe(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){be(i,n,o,a,s,"next",t)}function s(t){be(i,n,o,a,s,"throw",t)}a(void 0)}))}}const ke={data:function(){return{registerForm:new S({name:"",email:"",password:"",password_confirmation:""}),deviceForm:new S({name:""}),showWebauthnRegistration:!1,deviceRegistered:!1,deviceId:null}},methods:{handleRegisterSubmit:function(t){var e=this;return xe(we().mark((function r(){return we().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:t.preventDefault(),e.registerForm.password_confirmation=e.registerForm.password,e.registerForm.post("/user",{returnError:!0}).then((function(t){e.$storage.set("authenticated",!0),e.showWebauthnRegistration=!0})).catch((function(t){422!==t.response.status&&e.$router.push({name:"genericError",params:{err:t.response}})}));case 3:case"end":return r.stop()}}),r)})))()},registerWebauthnDevice:function(){var t=this;return xe(we().mark((function e(){var r,n,o,i,a,s,c;return we().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new ie,window.isSecureContext){e.next=4;break}return t.$notify({type:"is-danger",text:t.$t("errors.https_required")}),e.abrupt("return",!1);case 4:if(!r.doesntSupportWebAuthn){e.next=7;break}return t.$notify({type:"is-danger",text:t.$t("errors.browser_does_not_support_webauthn")}),e.abrupt("return",!1);case 7:return e.next=9,t.axios.post("/webauthn/register/options").then((function(t){return t.data}));case 9:return n=e.sent,o=r.parseIncomingServerOptions(n),(i={publicKey:o}).signal=ue.createNewAbortSignal(),e.prev=13,e.next=16,navigator.credentials.create(i);case 16:a=e.sent,e.next=24;break;case 19:return e.prev=19,e.t0=e.catch(13),s=ge(e.t0,i),t.$notify({type:s.type,text:t.$t(s.phrase)}),e.abrupt("return",!1);case 24:c=r.parseOutgoingCredentials(a),t.axios.post("/webauthn/register",c,{returnError:!0}).then((function(e){t.deviceId=c.id,t.deviceRegistered=!0})).catch((function(e){422===e.response.status?t.$notify({type:"is-danger",text:e.response.data.message}):t.$router.push({name:"genericError",params:{err:e.response}})}));case 26:case"end":return e.stop()}}),e,null,[[13,19]])})))()},handleDeviceSubmit:function(t){var e=this;return xe(we().mark((function t(){return we().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.deviceForm.patch("/webauthn/credentials/"+e.deviceId+"/name");case 2:!1===e.deviceForm.errors.any()&&e.$router.push({name:"accounts",params:{toRefresh:!0}});case 3:case"end":return t.stop()}}),t)})))()}},beforeRouteLeave:function(t,e,r){this.$notify({clean:!0}),r()}},$e=ke;const Le=(0,T.Z)($e,(function(){var t=this,e=t._self._c;return e("div",[t.showWebauthnRegistration?e("form-wrapper",{attrs:{title:t.$t("auth.authentication"),punchline:t.$t("auth.webauthn.enhance_security_using_webauthn")}},[t.deviceRegistered?e("div",{staticClass:"field"},[e("label",{staticClass:"label mb-5",attrs:{id:"lblDeviceRegistrationSuccess"}},[t._v(t._s(t.$t("auth.webauthn.device_successfully_registered"))+" "),e("font-awesome-icon",{attrs:{icon:["fas","check"]}})],1),t._v(" "),e("form",{on:{submit:function(e){return e.preventDefault(),t.handleDeviceSubmit.apply(null,arguments)},keydown:function(e){return t.deviceForm.onKeydown(e)}}},[e("form-field",{attrs:{form:t.deviceForm,fieldName:"name",inputType:"text",placeholder:"iPhone 12, TouchID, Yubikey 5C",label:t.$t("auth.forms.name_this_device")}}),t._v(" "),e("form-buttons",{attrs:{isBusy:t.deviceForm.isBusy,isDisabled:t.deviceForm.isDisabled,caption:t.$t("commons.continue")}})],1)]):e("div",{staticClass:"field is-grouped"},[e("div",{staticClass:"control"},[e("button",{staticClass:"button is-link",attrs:{type:"button",id:"btnRegisterNewDevice"},on:{click:function(e){return t.registerWebauthnDevice()}}},[t._v(t._s(t.$t("auth.webauthn.register_a_device")))])]),t._v(" "),e("div",{staticClass:"control"},[e("router-link",{staticClass:"button is-text",attrs:{id:"btnMaybeLater",to:{name:"accounts",params:{toRefresh:!0}}}},[t._v(t._s(t.$t("auth.maybe_later")))])],1)])]):e("form-wrapper",{attrs:{title:t.$t("auth.register"),punchline:t.$t("auth.forms.register_punchline")}},[e("form",{on:{submit:function(e){return e.preventDefault(),t.handleRegisterSubmit.apply(null,arguments)},keydown:function(e){return t.registerForm.onKeydown(e)}}},[e("form-field",{attrs:{form:t.registerForm,fieldName:"name",inputType:"text",label:t.$t("auth.forms.name"),maxLength:255,autofocus:""}}),t._v(" "),e("form-field",{attrs:{form:t.registerForm,fieldName:"email",inputType:"email",label:t.$t("auth.forms.email"),maxLength:255}}),t._v(" "),e("form-password-field",{attrs:{form:t.registerForm,fieldName:"password",showRules:!0,label:t.$t("auth.forms.password")}}),t._v(" "),e("form-buttons",{attrs:{isBusy:t.registerForm.isBusy,isDisabled:t.registerForm.isDisabled,caption:t.$t("auth.register"),submitId:"btnRegister"}})],1),t._v(" "),e("div",{staticClass:"nav-links"},[e("p",[t._v(t._s(t.$t("auth.forms.already_register"))+" "),e("router-link",{staticClass:"is-link",attrs:{id:"lnkSignIn",to:{name:"login"}}},[t._v(t._s(t.$t("auth.sign_in")))])],1)])]),t._v(" "),e("vue-footer")],1)}),[],!1,null,null,null).exports;const Ce={data:function(){return{}},mounted:function(){this.axios.get("/user/logout",{returnError:!0}).catch((function(t){})),this.clearStorage()}};const Ee=(0,T.Z)(Ce,(function(){var t=this,e=t._self._c;return e("form-wrapper",{attrs:{title:t.$t("auth.autolock_triggered"),punchline:t.$t("auth.autolock_triggered_punchline")}},[e("p",[t._v(t._s(t.$t("auth.change_autolock_in_settings")))]),t._v(" "),e("div",{staticClass:"nav-links"},[e("p",[e("router-link",{staticClass:"button is-link",attrs:{to:{name:"login",params:{forceRefresh:!0}}}},[t._v(t._s(t.$t("auth.sign_in")))])],1)]),t._v(" "),e("vue-footer")],1)}),[],!1,null,null,null).exports;const Oe={data:function(){return{form:new S({email:""})}},methods:{handleSubmit:function(t){var e=this;t.preventDefault(),this.form.post("/user/password/lost",{returnError:!0}).then((function(t){e.$notify({type:"is-success",text:t.data.message,duration:-1})})).catch((function(t){t.response.data.requestFailed?e.$notify({type:"is-danger",text:t.response.data.requestFailed,duration:-1}):422!==t.response.status&&e.$router.push({name:"genericError",params:{err:t.response}})}))}},beforeRouteLeave:function(t,e,r){this.$notify({clean:!0}),r()}};const Se=(0,T.Z)(Oe,(function(){var t=this,e=t._self._c;return e("form-wrapper",{attrs:{title:t.$t("auth.forms.reset_password"),punchline:t.$t("auth.forms.reset_punchline")}},[e("form",{on:{submit:function(e){return e.preventDefault(),t.handleSubmit.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-field",{attrs:{form:t.form,fieldName:"email",inputType:"email",label:t.$t("auth.forms.email"),autofocus:""}}),t._v(" "),e("form-buttons",{attrs:{submitId:"btnSendResetPwd",isBusy:t.form.isBusy,caption:t.$t("auth.forms.send_password_reset_link"),showCancelButton:!0,cancelLandingView:"login"}})],1),t._v(" "),e("vue-footer")],1)}),[],!1,null,null,null).exports;const Pe={data:function(){return{pending:!0,form:new S({email:"",password:"",password_confirmation:"",token:""})}},created:function(){this.form.email=this.$route.query.email,this.form.token=this.$route.query.token},methods:{handleSubmit:function(t){var e=this;t.preventDefault(),this.form.password_confirmation=this.form.password,this.form.post("/user/password/reset",{returnError:!0}).then((function(t){e.pending=!1,e.$notify({type:"is-success",text:t.data.message,duration:-1})})).catch((function(t){t.response.data.resetFailed?e.$notify({type:"is-danger",text:t.response.data.resetFailed,duration:-1}):422!==t.response.status&&e.$router.push({name:"genericError",params:{err:t.response}})}))}},beforeRouteLeave:function(t,e,r){this.$notify({clean:!0}),r()}};const Te=(0,T.Z)(Pe,(function(){var t=this,e=t._self._c;return e("form-wrapper",{attrs:{title:t.$t("auth.forms.new_password")}},[e("form",{on:{submit:function(e){return e.preventDefault(),t.handleSubmit.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-field",{attrs:{form:t.form,fieldName:"email",inputType:"email",label:t.$t("auth.forms.email"),isDisabled:!0,readonly:""}}),t._v(" "),e("form-password-field",{attrs:{form:t.form,fieldName:"password",autocomplete:"new-password",showRules:!0,label:t.$t("auth.forms.new_password")}}),t._v(" "),e("field-error",{attrs:{form:t.form,field:"token"}}),t._v(" "),t.pending?e("form-buttons",{attrs:{isBusy:t.form.isBusy,caption:t.$t("auth.forms.change_password"),showCancelButton:!0,cancelLandingView:"login"}}):t._e(),t._v(" "),t.pending?t._e():e("router-link",{staticClass:"button is-link",attrs:{id:"btnContinue",to:{name:"accounts"}}},[t._v(t._s(t.$t("commons.continue")))])],1),t._v(" "),e("vue-footer")],1)}),[],!1,null,null,null).exports;const Ae={data:function(){return{form:new S({email:""})}},methods:{handleSubmit:function(t){var e=this;t.preventDefault(),this.form.post("/webauthn/lost",{returnError:!0}).then((function(t){e.$notify({type:"is-success",text:t.data.message,duration:-1})})).catch((function(t){t.response.data.requestFailed?e.$notify({type:"is-danger",text:t.response.data.requestFailed,duration:-1}):422!==t.response.status&&e.$router.push({name:"genericError",params:{err:t.response}})}))}},beforeRouteLeave:function(t,e,r){this.$notify({clean:!0}),r()}};const Ne=(0,T.Z)(Ae,(function(){var t=this,e=t._self._c;return e("form-wrapper",{attrs:{title:t.$t("auth.webauthn.account_recovery"),punchline:t.$t("auth.webauthn.recovery_punchline")}},[e("form",{on:{submit:function(e){return e.preventDefault(),t.handleSubmit.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-field",{attrs:{form:t.form,fieldName:"email",inputType:"email",label:t.$t("auth.forms.email"),autofocus:""}}),t._v(" "),e("form-buttons",{attrs:{isBusy:t.form.isBusy,caption:t.$t("auth.webauthn.send_recovery_link"),showCancelButton:!0,cancelLandingView:"login"}})],1),t._v(" "),e("vue-footer")],1)}),[],!1,null,null,null).exports;const je={data:function(){return{currentPassword:"",deviceRegistered:!1,deviceId:null,form:new S({email:"",password:"",token:"",revokeAll:!1})}},created:function(){this.form.email=this.$route.query.email,this.form.token=this.$route.query.token},methods:{recover:function(){var t=this;this.form.post("/webauthn/recover",{returnError:!0}).then((function(e){t.$router.push({name:"login",params:{forceRefresh:!0}})})).catch((function(e){401===e.response.status?t.$notify({type:"is-danger",text:t.$t("auth.forms.authentication_failed"),duration:-1}):422===e.response.status?t.$notify({type:"is-danger",text:e.response.data.message}):t.$router.push({name:"genericError",params:{err:e.response}})}))}},beforeRouteLeave:function(t,e,r){this.$notify({clean:!0}),r()}};const Ie=(0,T.Z)(je,(function(){var t=this,e=t._self._c;return e("form-wrapper",{attrs:{title:t.$t("auth.webauthn.account_recovery"),punchline:t.$t("auth.webauthn.recover_account_instructions")}},[e("div",[e("form",{on:{submit:function(e){return e.preventDefault(),t.recover.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-checkbox",{attrs:{form:t.form,fieldName:"revokeAll",label:t.$t("auth.webauthn.disable_all_security_devices"),help:t.$t("auth.webauthn.disable_all_security_devices_help")}}),t._v(" "),e("form-password-field",{attrs:{form:t.form,autocomplete:"current-password",fieldName:"password",label:t.$t("auth.forms.current_password.label"),help:t.$t("auth.forms.current_password.help")}}),t._v(" "),e("div",{staticClass:"field"},[e("p",[t._v(t._s(t.$t("auth.forms.forgot_your_password"))+" "),e("router-link",{staticClass:"is-link",attrs:{id:"lnkResetPwd",to:{name:"password.request"},"aria-label":t.$t("auth.forms.reset_your_password")}},[t._v(t._s(t.$t("auth.forms.request_password_reset")))])],1)]),t._v(" "),e("form-buttons",{attrs:{caption:t.$t("commons.continue"),cancelLandingView:"login",showCancelButton:!0,isBusy:t.form.isBusy,isDisabled:t.form.isDisabled,submitId:"btnRecover"}})],1)]),t._v(" "),e("vue-footer")],1)}),[],!1,null,null,null).exports;function Fe(t){return Fe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Fe(t)}function De(){De=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==Fe(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ge(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}const Me={name:"VersionChecker",data:function(){return{isScanning:!1,isUpToDate:null}},methods:{getLatestRelease:function(){var t,e=this;return(t=De().mark((function t(){return De().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.isScanning=!0,t.next=3,e.axios.get("/latestRelease").then((function(t){e.$root.appSettings.latestRelease=t.data.newRelease,e.isUpToDate=!1===t.data.newRelease}));case 3:e.isScanning=!1;case 4:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ge(i,n,o,a,s,"next",t)}function s(t){Ge(i,n,o,a,s,"throw",t)}a(void 0)}))})()}}};function Be(t){return Be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Be(t)}function qe(){qe=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==Be(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Re(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function Ue(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(!t)return;if("string"==typeof t)return ze(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ze(t,e)}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw i}}}}function ze(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}const He={data:function(){return{isReady:!1,preferencesForm:new S({lang:"",showOtpAsDot:null,closeOtpOnCopy:null,copyOtpOnDisplay:null,useBasicQrcodeReader:null,showAccountsIcons:null,displayMode:"",kickUserAfter:null,defaultGroup:"",useDirectCapture:null,defaultCaptureMode:"",rememberActiveGroup:null,getOfficialIcons:null,theme:"",formatPassword:null,formatPasswordBy:"",getOtpOnRequest:null}),settingsForm:null,settings:{useEncryption:null,checkForUpdate:null,disableRegistration:null},layouts:[{text:this.$t("settings.forms.grid"),value:"grid",icon:"th"},{text:this.$t("settings.forms.list"),value:"list",icon:"list"}],themes:[{text:this.$t("settings.forms.light"),value:"light",icon:"sun"},{text:this.$t("settings.forms.dark"),value:"dark",icon:"moon"},{text:this.$t("settings.forms.automatic"),value:"system",icon:"desktop"}],passwordFormats:[{text:"12 34 56",value:2,legend:this.$t("settings.forms.pair"),title:this.$t("settings.forms.pair_legend")},{text:"123 456",value:3,legend:this.$t("settings.forms.trio"),title:this.$t("settings.forms.trio_legend")},{text:"1234 5678",value:.5,legend:this.$t("settings.forms.half"),title:this.$t("settings.forms.half_legend")}],kickUserAfters:[{text:this.$t("settings.forms.never"),value:0},{text:this.$t("settings.forms.on_otp_copy"),value:-1},{text:this.$t("settings.forms.1_minutes"),value:1},{text:this.$t("settings.forms.5_minutes"),value:5},{text:this.$t("settings.forms.10_minutes"),value:10},{text:this.$t("settings.forms.15_minutes"),value:15},{text:this.$t("settings.forms.30_minutes"),value:30},{text:this.$t("settings.forms.1_hour"),value:60},{text:this.$t("settings.forms.1_day"),value:1440}],groups:[{text:this.$t("groups.no_group"),value:0},{text:this.$t("groups.active_group"),value:-1}],captureModes:[{text:this.$t("settings.forms.livescan"),value:"livescan"},{text:this.$t("settings.forms.upload"),value:"upload"},{text:this.$t("settings.forms.advanced_form"),value:"advancedForm"}],getOtpTriggers:[{text:this.$t("settings.forms.otp_generation_on_request"),value:!0,legend:this.$t("settings.forms.otp_generation_on_request_legend"),title:this.$t("settings.forms.otp_generation_on_request_title")},{text:this.$t("settings.forms.otp_generation_on_home"),value:!1,legend:this.$t("settings.forms.otp_generation_on_home_legend"),title:this.$t("settings.forms.otp_generation_on_home_title")}]}},components:{VersionChecker:(0,T.Z)(Me,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"columns is-mobile is-vcentered"},[e("div",{staticClass:"column is-narrow"},[e("button",{staticClass:"button is-link is-rounded is-small",class:t.isScanning?"is-loading":"",attrs:{type:"button"},on:{click:t.getLatestRelease}},[t._v("Check now")])]),t._v(" "),e("div",{staticClass:"column"},[t.$root.appSettings.latestRelease?e("span",{staticClass:"mt-2 has-text-warning"},[e("span",{staticClass:"release-flag"}),t._v(t._s(t.$root.appSettings.latestRelease)+" is available "),e("a",{staticClass:"is-size-7",attrs:{href:"https://github.com/Bubka/2FAuth/releases"}},[t._v("View on Github")])]):t._e(),t._v(" "),t.isUpToDate?e("span",{staticClass:"has-text-grey"},[t._v("\n "+t._s(t.$t("commons.you_are_up_to_date"))+"\n ")]):t._e()])])}),[],!1,null,null,null).exports},computed:{langs:function(){var t,e=[{text:this.$t("languages.browser_preference"),value:"browser"}],r=Ue(window.appLocales);try{for(r.s();!(t=r.n()).done;){var n=t.value;e.push({text:this.$t("languages."+n),value:n})}}catch(t){r.e(t)}finally{r.f()}return e}},mounted:function(){var t,e=this;return(t=qe().mark((function t(){var r;return qe().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.preferencesForm.get("/api/v1/user/preferences");case 2:r=t.sent,e.preferencesForm.fillWithKeyValueObject(r.data),e.preferencesForm.setOriginal(),e.axios.get("/api/v1/settings",{returnError:!0}).then((function(t){e.settingsForm=new S(e.settings),e.settingsForm.fillWithKeyValueObject(t.data),e.settingsForm.setOriginal()})).catch((function(t){})),e.fetchGroups(),e.$nextTick((function(){this.isReady=!0}));case 8:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Re(i,n,o,a,s,"next",t)}function s(t){Re(i,n,o,a,s,"throw",t)}a(void 0)}))})()},methods:{savePreference:function(t,e){var r=this;this.axios.put("/api/v1/user/preferences/"+t,{value:e}).then((function(e){r.$notify({type:"is-success",text:r.$t("settings.forms.setting_saved")}),"lang"===t&&e.data.value!==r.$root.$i18n.locale?r.$router.go():(r.$root.userPreferences[e.data.key]=e.data.value,"theme"===t&&r.setTheme(e.data.value))}))},saveSetting:function(t,e){var r=this;this.axios.put("/api/v1/settings/"+t,{value:e}).then((function(t){r.$notify({type:"is-success",text:r.$t("settings.forms.setting_saved")}),r.$root.appSettings[t.data.key]=t.data.value}))},fetchGroups:function(){var t=this;this.axios.get("/api/v1/groups").then((function(e){e.data.forEach((function(e){e.id>0&&t.groups.push({text:e.name,value:e.id})}))}))}},beforeRouteLeave:function(t,e,r){"accounts"==t.name&&this.$notify({clean:!0}),r()}};const Ze=(0,T.Z)(He,(function(){var t=this,e=t._self._c;return e("div",[e("setting-tabs",{attrs:{activeTab:"settings.options"}}),t._v(" "),e("div",{staticClass:"options-tabs"},[e("form-wrapper",[e("form",[e("input",{attrs:{type:"hidden",name:"isReady",id:"isReady"},domProps:{value:t.isReady}}),t._v(" "),e("div",{staticClass:"block"},[e("h4",{staticClass:"title is-4 has-text-grey-light"},[t._v(t._s(t.$t("settings.general")))]),t._v(" "),e("form-select",{attrs:{options:t.langs,form:t.preferencesForm,fieldName:"lang",label:t.$t("settings.forms.language.label"),help:t.$t("settings.forms.language.help")},on:{lang:function(e){return t.savePreference("lang",e)}}}),t._v(" "),e("div",{staticClass:"field help"},[t._v("\n "+t._s(t.$t("settings.forms.some_translation_are_missing"))+"\n "),e("a",{staticClass:"ml-2",attrs:{href:"https://crowdin.com/project/2fauth"}},[t._v("\n "+t._s(t.$t("settings.forms.help_translate_2fauth"))+"\n "),e("font-awesome-icon",{attrs:{icon:["fas","external-link-alt"]}})],1)]),t._v(" "),e("form-toggle",{attrs:{choices:t.layouts,form:t.preferencesForm,fieldName:"displayMode",label:t.$t("settings.forms.display_mode.label"),help:t.$t("settings.forms.display_mode.help")},on:{displayMode:function(e){return t.savePreference("displayMode",e)}}}),t._v(" "),e("form-toggle",{attrs:{choices:t.themes,form:t.preferencesForm,fieldName:"theme",label:t.$t("settings.forms.theme.label"),help:t.$t("settings.forms.theme.help")},on:{theme:function(e){return t.savePreference("theme",e)}}}),t._v(" "),e("form-checkbox",{attrs:{form:t.preferencesForm,fieldName:"showAccountsIcons",label:t.$t("settings.forms.show_accounts_icons.label"),help:t.$t("settings.forms.show_accounts_icons.help")},on:{showAccountsIcons:function(e){return t.savePreference("showAccountsIcons",e)}}}),t._v(" "),e("form-checkbox",{attrs:{form:t.preferencesForm,fieldName:"getOfficialIcons",label:t.$t("settings.forms.get_official_icons.label"),help:t.$t("settings.forms.get_official_icons.help")},on:{getOfficialIcons:function(e){return t.savePreference("getOfficialIcons",e)}}}),t._v(" "),e("form-checkbox",{attrs:{form:t.preferencesForm,fieldName:"formatPassword",label:t.$t("settings.forms.password_format.label"),help:t.$t("settings.forms.password_format.help")},on:{formatPassword:function(e){return t.savePreference("formatPassword",e)}}}),t._v(" "),t.preferencesForm.formatPassword?e("form-toggle",{attrs:{choices:t.passwordFormats,form:t.preferencesForm,fieldName:"formatPasswordBy"},on:{formatPasswordBy:function(e){return t.savePreference("formatPasswordBy",e)}}}):t._e(),t._v(" "),e("h4",{staticClass:"title is-4 pt-4 has-text-grey-light"},[t._v(t._s(t.$t("groups.groups")))]),t._v(" "),e("form-select",{attrs:{options:t.groups,form:t.preferencesForm,fieldName:"defaultGroup",label:t.$t("settings.forms.default_group.label"),help:t.$t("settings.forms.default_group.help")},on:{defaultGroup:function(e){return t.savePreference("defaultGroup",e)}}}),t._v(" "),e("form-checkbox",{attrs:{form:t.preferencesForm,fieldName:"rememberActiveGroup",label:t.$t("settings.forms.remember_active_group.label"),help:t.$t("settings.forms.remember_active_group.help")},on:{rememberActiveGroup:function(e){return t.savePreference("rememberActiveGroup",e)}}}),t._v(" "),e("h4",{staticClass:"title is-4 pt-4 has-text-grey-light"},[t._v(t._s(t.$t("settings.security")))]),t._v(" "),e("form-select",{attrs:{options:t.kickUserAfters,form:t.preferencesForm,fieldName:"kickUserAfter",label:t.$t("settings.forms.auto_lock.label"),help:t.$t("settings.forms.auto_lock.help")},on:{kickUserAfter:function(e){return t.savePreference("kickUserAfter",e)}}}),t._v(" "),e("form-toggle",{attrs:{choices:t.getOtpTriggers,form:t.preferencesForm,fieldName:"getOtpOnRequest",label:t.$t("settings.forms.otp_generation.label"),help:t.$t("settings.forms.otp_generation.help")},on:{getOtpOnRequest:function(e){return t.savePreference("getOtpOnRequest",e)}}}),t._v(" "),e("form-checkbox",{attrs:{form:t.preferencesForm,fieldName:"showOtpAsDot",label:t.$t("settings.forms.show_otp_as_dot.label"),help:t.$t("settings.forms.show_otp_as_dot.help")},on:{showOtpAsDot:function(e){return t.savePreference("showOtpAsDot",e)}}}),t._v(" "),e("form-checkbox",{attrs:{form:t.preferencesForm,fieldName:"closeOtpOnCopy",label:t.$t("settings.forms.close_otp_on_copy.label"),help:t.$t("settings.forms.close_otp_on_copy.help"),disabled:!t.preferencesForm.getOtpOnRequest},on:{closeOtpOnCopy:function(e){return t.savePreference("closeOtpOnCopy",e)}}}),t._v(" "),e("form-checkbox",{attrs:{form:t.preferencesForm,fieldName:"copyOtpOnDisplay",label:t.$t("settings.forms.copy_otp_on_display.label"),help:t.$t("settings.forms.copy_otp_on_display.help"),disabled:!t.preferencesForm.getOtpOnRequest},on:{copyOtpOnDisplay:function(e){return t.savePreference("copyOtpOnDisplay",e)}}}),t._v(" "),e("h4",{staticClass:"title is-4 pt-4 has-text-grey-light"},[t._v(t._s(t.$t("settings.data_input")))]),t._v(" "),e("form-checkbox",{attrs:{form:t.preferencesForm,fieldName:"useBasicQrcodeReader",label:t.$t("settings.forms.use_basic_qrcode_reader.label"),help:t.$t("settings.forms.use_basic_qrcode_reader.help")},on:{useBasicQrcodeReader:function(e){return t.savePreference("useBasicQrcodeReader",e)}}}),t._v(" "),e("form-checkbox",{attrs:{form:t.preferencesForm,fieldName:"useDirectCapture",label:t.$t("settings.forms.useDirectCapture.label"),help:t.$t("settings.forms.useDirectCapture.help")},on:{useDirectCapture:function(e){return t.savePreference("useDirectCapture",e)}}}),t._v(" "),e("form-select",{attrs:{options:t.captureModes,form:t.preferencesForm,fieldName:"defaultCaptureMode",label:t.$t("settings.forms.defaultCaptureMode.label"),help:t.$t("settings.forms.defaultCaptureMode.help")},on:{defaultCaptureMode:function(e){return t.savePreference("defaultCaptureMode",e)}}})],1),t._v(" "),t.settingsForm?e("div",[e("h4",{staticClass:"title is-4 pt-4 has-text-grey-light"},[t._v(t._s(t.$t("settings.administration")))]),t._v(" "),e("div",{staticClass:"is-size-7-mobile block",domProps:{innerHTML:t._s(t.$t("settings.administration_legend"))}}),t._v(" "),e("form-checkbox",{attrs:{form:t.settingsForm,fieldName:"checkForUpdate",label:t.$t("commons.check_for_update"),help:t.$t("commons.check_for_update_help")},on:{checkForUpdate:function(e){return t.saveSetting("checkForUpdate",e)}}}),t._v(" "),e("version-checker"),t._v(" "),e("form-checkbox",{attrs:{form:t.settingsForm,fieldName:"useEncryption",label:t.$t("settings.forms.use_encryption.label"),help:t.$t("settings.forms.use_encryption.help")},on:{useEncryption:function(e){return t.saveSetting("useEncryption",e)}}}),t._v(" "),e("form-checkbox",{attrs:{form:t.settingsForm,fieldName:"disableRegistration",label:t.$t("settings.forms.disable_registration.label"),help:t.$t("settings.forms.disable_registration.help")},on:{disableRegistration:function(e){return t.saveSetting("disableRegistration",e)}}})],1):t._e()])])],1),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[e("p",{staticClass:"control"},[e("router-link",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"btnClose",to:{path:t.$route.params.returnTo,params:{toRefresh:!1}},tabindex:"0",role:"button","aria-label":t.$t("commons.close_the_x_page",{pagetitle:t.$router.currentRoute.meta.title})}},[t._v("\n "+t._s(t.$t("commons.close"))+"\n ")])],1)])],1)}),[],!1,null,null,null).exports;function We(t){return We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},We(t)}function Ye(){Ye=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==We(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Ke(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}const Ve={data:function(){return{formProfile:new S({name:"",email:"",password:""}),formPassword:new S({currentPassword:"",password:"",password_confirmation:""}),formDelete:new S({password:""}),isRemoteUser:this.$root.appConfig.proxyAuth,isAdmin:!1}},mounted:function(){var t,e=this;return(t=Ye().mark((function t(){var r,n;return Ye().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.formProfile.get("/api/v1/user");case 2:r=t.sent,!0===(n=r.data).is_admin&&(e.isAdmin=!0),e.formProfile.fill(n);case 6:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Ke(i,n,o,a,s,"next",t)}function s(t){Ke(i,n,o,a,s,"throw",t)}a(void 0)}))})()},methods:{submitProfile:function(t){var e=this;t.preventDefault(),this.formProfile.put("/user",{returnError:!0}).then((function(t){e.$notify({type:"is-success",text:e.$t("auth.forms.profile_saved")})})).catch((function(t){400===t.response.status?e.$notify({type:"is-danger",text:t.response.data.message}):422!==t.response.status&&e.$router.push({name:"genericError",params:{err:t.response}})}))},submitPassword:function(t){var e=this;t.preventDefault(),this.formPassword.patch("/user/password",{returnError:!0}).then((function(t){e.$notify({type:"is-success",text:t.data.message})})).catch((function(t){400===t.response.status?e.$notify({type:"is-danger",text:t.response.data.message}):422!==t.response.status&&e.$router.push({name:"genericError",params:{err:t.response}})}))},submitDelete:function(t){var e=this;t.preventDefault(),confirm(this.$t("auth.confirm.delete_account"))&&this.formDelete.delete("/user",{returnError:!0}).then((function(t){e.$notify({type:"is-success",text:e.$t("auth.forms.user_account_successfully_deleted")}),e.$router.push({name:"register"})})).catch((function(t){400===t.response.status?e.$notify({type:"is-danger",text:t.response.data.message}):422!==t.response.status&&e.$router.push({name:"genericError",params:{err:t.response}})}))}},beforeRouteLeave:function(t,e,r){"accounts"==t.name&&this.$notify({clean:!0}),r()}};const Qe=(0,T.Z)(Ve,(function(){var t=this,e=t._self._c;return e("div",[e("setting-tabs",{attrs:{activeTab:"settings.account"}}),t._v(" "),e("div",{staticClass:"options-tabs"},[e("form-wrapper",[t.isAdmin?e("div",{staticClass:"notification is-warning"},[t._v("\n "+t._s(t.$t("settings.you_are_administrator"))+"\n ")]):t._e(),t._v(" "),e("form",{on:{submit:function(e){return e.preventDefault(),t.submitProfile.apply(null,arguments)},keydown:function(e){return t.formProfile.onKeydown(e)}}},[t.isRemoteUser?e("div",{staticClass:"notification is-warning has-text-centered",domProps:{innerHTML:t._s(t.$t("auth.user_account_controlled_by_proxy"))}}):t._e(),t._v(" "),e("h4",{staticClass:"title is-4 has-text-grey-light"},[t._v(t._s(t.$t("settings.profile")))]),t._v(" "),e("fieldset",{attrs:{disabled:t.isRemoteUser}},[e("form-field",{attrs:{form:t.formProfile,fieldName:"name",label:t.$t("auth.forms.name"),maxLength:255,autofocus:""}}),t._v(" "),e("form-field",{attrs:{form:t.formProfile,fieldName:"email",inputType:"email",label:t.$t("auth.forms.email"),maxLength:255}}),t._v(" "),e("form-field",{attrs:{form:t.formProfile,fieldName:"password",inputType:"password",label:t.$t("auth.forms.current_password.label"),help:t.$t("auth.forms.current_password.help")}}),t._v(" "),e("form-buttons",{attrs:{isBusy:t.formProfile.isBusy,caption:t.$t("commons.update")}})],1)]),t._v(" "),e("form",{on:{submit:function(e){return e.preventDefault(),t.submitPassword.apply(null,arguments)},keydown:function(e){return t.formPassword.onKeydown(e)}}},[e("h4",{staticClass:"title is-4 pt-6 has-text-grey-light"},[t._v(t._s(t.$t("settings.change_password")))]),t._v(" "),e("fieldset",{attrs:{disabled:t.isRemoteUser}},[e("form-password-field",{attrs:{form:t.formPassword,fieldName:"password",autocomplete:"new-password",showRules:!0,label:t.$t("auth.forms.new_password")}}),t._v(" "),e("form-field",{attrs:{form:t.formPassword,fieldName:"password_confirmation",inputType:"password",autocomplete:"new-password",label:t.$t("auth.forms.confirm_new_password")}}),t._v(" "),e("form-field",{attrs:{form:t.formPassword,fieldName:"currentPassword",inputType:"password",label:t.$t("auth.forms.current_password.label"),help:t.$t("auth.forms.current_password.help")}}),t._v(" "),e("form-buttons",{attrs:{isBusy:t.formPassword.isBusy,caption:t.$t("auth.forms.change_password")}})],1)]),t._v(" "),e("form",{attrs:{id:"frmDeleteAccount"},on:{submit:function(e){return e.preventDefault(),t.submitDelete.apply(null,arguments)},keydown:function(e){return t.formDelete.onKeydown(e)}}},[e("h4",{staticClass:"title is-4 pt-6 has-text-danger"},[t._v(t._s(t.$t("auth.forms.delete_account")))]),t._v(" "),e("div",{staticClass:"field is-size-7-mobile"},[t._v("\n "+t._s(t.$t("auth.forms.delete_your_account_and_reset_all_data"))+"\n ")]),t._v(" "),e("fieldset",{attrs:{disabled:t.isRemoteUser}},[e("form-field",{attrs:{form:t.formDelete,fieldName:"password",inputType:"password",label:t.$t("auth.forms.current_password.label"),help:t.$t("auth.forms.current_password.help")}}),t._v(" "),e("form-buttons",{attrs:{isBusy:t.formDelete.isBusy,caption:t.$t("auth.forms.delete_your_account"),submitId:"btnDeleteAccount",color:"is-danger"}})],1)])])],1),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[e("p",{staticClass:"control"},[e("router-link",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"btnClose",to:{path:t.$route.params.returnTo,params:{toRefresh:!1}},tabindex:"0",role:"button","aria-label":t.$t("commons.close_the_x_page",{pagetitle:t.$router.currentRoute.meta.title})}},[t._v("\n "+t._s(t.$t("commons.close"))+"\n ")])],1)])],1)}),[],!1,null,null,null).exports;function Je(t){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Je(t)}function Xe(){Xe=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==Je(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function tr(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function er(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){tr(i,n,o,a,s,"next",t)}function s(t){tr(i,n,o,a,s,"throw",t)}a(void 0)}))}}const rr={data:function(){return{tokens:[],isFetching:!1,form:new S({token:""}),isRemoteUser:!1}},mounted:function(){this.fetchTokens()},methods:{fetchTokens:function(){var t=this;return er(Xe().mark((function e(){return Xe().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.isFetching=!0,e.next=3,t.axios.get("/oauth/personal-access-tokens",{returnError:!0}).then((function(e){var r=[];e.data.forEach((function(e){e.id===t.$route.params.token_id?(e.value=t.$route.params.accessToken,r.unshift(e)):r.push(e)})),t.tokens=r})).catch((function(e){400===e.response.status?t.isRemoteUser=!0:t.$router.push({name:"genericError",params:{err:e.response}})}));case 3:t.isFetching=!1;case 4:case"end":return e.stop()}}),e)})))()},clipboardSuccessHandler:function(t){t.value,t.event;this.$notify({type:"is-success",text:this.$t("commons.copied_to_clipboard")})},clipboardErrorHandler:function(t){var e=t.value;t.event;console.log("error",e)},revokeToken:function(t){var e=this;return er(Xe().mark((function r(){return Xe().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!confirm(e.$t("settings.confirm.revoke"))){r.next=3;break}return r.next=3,e.axios.delete("/oauth/personal-access-tokens/"+t).then((function(r){e.tokens=e.tokens.filter((function(e){return e.id!==t})),e.$notify({type:"is-success",text:e.$t("settings.token_revoked")})}));case 3:case"end":return r.stop()}}),r)})))()},createToken:function(){this.isRemoteUser?this.$notify({type:"is-warning",text:this.$t("errors.unsupported_with_reverseproxy")}):this.$router.push({name:"settings.oauth.generatePAT"})}},beforeRouteLeave:function(t,e,r){"accounts"==t.name&&this.$notify({clean:!0}),r()}};const nr=(0,T.Z)(rr,(function(){var t=this,e=t._self._c;return e("div",[e("setting-tabs",{attrs:{activeTab:"settings.oauth.tokens"}}),t._v(" "),e("div",{staticClass:"options-tabs"},[e("form-wrapper",[t.isRemoteUser?e("div",{staticClass:"notification is-warning has-text-centered",domProps:{innerHTML:t._s(t.$t("auth.auth_handled_by_proxy"))}}):t._e(),t._v(" "),e("h4",{staticClass:"title is-4 has-text-grey-light"},[t._v(t._s(t.$t("settings.personal_access_tokens")))]),t._v(" "),e("div",{staticClass:"is-size-7-mobile"},[t._v("\n "+t._s(t.$t("settings.token_legend"))+"\n ")]),t._v(" "),e("div",{staticClass:"mt-3"},[e("a",{staticClass:"is-link",attrs:{tabindex:"0"},on:{click:t.createToken,keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.createToken.apply(null,arguments)}}},[e("font-awesome-icon",{attrs:{icon:["fas","plus-circle"]}}),t._v(" "+t._s(t.$t("settings.generate_new_token"))+"\n ")],1)]),t._v(" "),t.tokens.length>0?e("div",[t._l(t.tokens,(function(r){return e("div",{key:r.id,staticClass:"group-item is-size-5 is-size-6-mobile"},[r.value?e("font-awesome-icon",{staticClass:"has-text-success",attrs:{icon:["fas","check"]}}):t._e(),t._v(" "+t._s(r.name)+"\n "),t._v(" "),e("div",{staticClass:"tags is-pulled-right"},[r.value?e("button",{directives:[{name:"clipboard",rawName:"v-clipboard",value:function(){return r.value},expression:"() => token.value"},{name:"clipboard",rawName:"v-clipboard:success",value:t.clipboardSuccessHandler,expression:"clipboardSuccessHandler",arg:"success"}],staticClass:"button tag",class:{"is-link":!t.$root.showDarkMode}},[t._v(t._s(t.$t("commons.copy")))]):t._e(),t._v(" "),e("button",{staticClass:"button tag",class:t.$root.showDarkMode?"is-dark":"is-white",attrs:{title:t.$t("settings.revoke")},on:{click:function(e){return t.revokeToken(r.id)}}},[t._v(t._s(t.$t("settings.revoke")))])]),t._v(" "),r.value?e("span",{staticClass:"is-size-7-mobile is-size-6 my-3"},[t._v("\n "+t._s(t.$t("settings.make_sure_copy_token"))+"\n ")]):t._e(),t._v(" "),r.value?e("span",{staticClass:"pat is-family-monospace is-size-6 is-size-7-mobile has-text-success"},[t._v("\n "+t._s(r.value)+"\n ")]):t._e()],1)})),t._v(" "),e("div",{staticClass:"mt-2 is-size-7 is-pulled-right"},[t._v("\n "+t._s(t.$t("settings.revoking_a_token_is_permanent"))+"\n ")])],2):t._e(),t._v(" "),t.isFetching&&0===t.tokens.length?e("div",{staticClass:"has-text-centered mt-6"},[e("span",{staticClass:"is-size-4",attrs:{id:"icnSpinner"}},[e("font-awesome-icon",{attrs:{icon:["fas","spinner"],spin:""}})],1)]):t._e(),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[e("p",{staticClass:"control"},[e("router-link",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"btnClose",to:{path:t.$route.params.returnTo,params:{toRefresh:!1}},tabindex:"0",role:"button","aria-label":t.$t("commons.close_the_x_page",{pagetitle:t.$router.currentRoute.meta.title})}},[t._v("\n "+t._s(t.$t("commons.close"))+"\n ")])],1)])],1)],1)],1)}),[],!1,null,null,null).exports;function or(t){return or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},or(t)}function ir(){ir=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==or(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function ar(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}function sr(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){ar(i,n,o,a,s,"next",t)}function s(t){ar(i,n,o,a,s,"throw",t)}a(void 0)}))}}const cr={data:function(){return{form:new S({useWebauthnOnly:null}),credentials:[],isFetching:!1,isRemoteUser:!1}},mounted:function(){var t=this;return sr(ir().mark((function e(){var r,n;return ir().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.form.get("/api/v1/user/preferences");case 2:r=e.sent,n=r.data,t.form.fillWithKeyValueObject(n),t.form.setOriginal(),t.fetchCredentials();case 7:case"end":return e.stop()}}),e)})))()},methods:{savePreference:function(t,e){var r=this;this.axios.put("/api/v1/user/preferences/"+t,{value:e}).then((function(t){r.$notify({type:"is-success",text:r.$t("settings.forms.setting_saved")}),r.$root.userPreferences[t.data.key]=t.data.value}))},fetchCredentials:function(){var t=this;return sr(ir().mark((function e(){return ir().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.isFetching=!0,e.next=3,t.axios.get("/webauthn/credentials",{returnError:!0}).then((function(e){t.credentials=e.data})).catch((function(e){400===e.response.status?t.isRemoteUser=!0:t.$router.push({name:"genericError",params:{err:e.response}})}));case 3:t.isFetching=!1;case 4:case"end":return e.stop()}}),e)})))()},register:function(){var t=this;return sr(ir().mark((function e(){var r,n,o,i,a,s,c;return ir().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=new ie,!t.isRemoteUser){e.next=4;break}return t.$notify({type:"is-warning",text:t.$t("errors.unsupported_with_reverseproxy")}),e.abrupt("return",!1);case 4:if(window.isSecureContext){e.next=7;break}return t.$notify({type:"is-danger",text:t.$t("errors.https_required")}),e.abrupt("return",!1);case 7:if(!r.doesntSupportWebAuthn){e.next=10;break}return t.$notify({type:"is-danger",text:t.$t("errors.browser_does_not_support_webauthn")}),e.abrupt("return",!1);case 10:return e.next=12,t.axios.post("/webauthn/register/options").then((function(t){return t.data}));case 12:return n=e.sent,o=r.parseIncomingServerOptions(n),(i={publicKey:o}).signal=ue.createNewAbortSignal(),e.prev=16,e.next=19,navigator.credentials.create(i);case 19:a=e.sent,e.next=27;break;case 22:return e.prev=22,e.t0=e.catch(16),s=ge(e.t0,i),t.$notify({type:s.type,text:t.$t(s.phrase)}),e.abrupt("return",!1);case 27:c=r.parseOutgoingCredentials(a),t.axios.post("/webauthn/register",c,{returnError:!0}).then((function(e){t.$router.push({name:"settings.webauthn.editCredential",params:{credentialId:c.id,name:t.$t("auth.webauthn.my_device")}})})).catch((function(e){422===e.response.status?t.$notify({type:"is-danger",text:e.response.data.message}):t.$router.push({name:"genericError",params:{err:e.response}})}));case 29:case"end":return e.stop()}}),e,null,[[16,22]])})))()},revokeCredential:function(t){var e=this;return sr(ir().mark((function r(){return ir().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!confirm(e.$t("auth.confirm.revoke_device"))){r.next=3;break}return r.next=3,e.axios.delete("/webauthn/credentials/"+t).then((function(r){e.credentials=e.credentials.filter((function(e){return e.id!==t})),0==e.credentials.length&&(e.form.useWebauthnOnly=!1,e.$root.userPreferences.useWebauthnOnly=!1),e.$notify({type:"is-success",text:e.$t("auth.webauthn.device_revoked")})}));case 3:case"end":return r.stop()}}),r)})))()},displayName:function(t){return t.alias?t.alias:this.$t("auth.webauthn.my_device")+" (#"+t.id.substring(0,10)+")"}},beforeRouteLeave:function(t,e,r){"accounts"==t.name&&this.$notify({clean:!0}),r()}},ur=cr;const lr=(0,T.Z)(ur,(function(){var t=this,e=t._self._c;return e("div",[e("setting-tabs",{attrs:{activeTab:"settings.webauthn.devices"}}),t._v(" "),e("div",{staticClass:"options-tabs"},[e("form-wrapper",[t.isRemoteUser?e("div",{staticClass:"notification is-warning has-text-centered",domProps:{innerHTML:t._s(t.$t("auth.auth_handled_by_proxy"))}}):t._e(),t._v(" "),e("h4",{staticClass:"title is-4 has-text-grey-light"},[t._v(t._s(t.$t("auth.webauthn.security_devices")))]),t._v(" "),e("div",{staticClass:"is-size-7-mobile"},[t._v("\n "+t._s(t.$t("auth.webauthn.security_devices_legend"))+"\n ")]),t._v(" "),e("div",{staticClass:"mt-3"},[e("a",{attrs:{tabindex:"0"},on:{click:t.register,keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.register.apply(null,arguments)}}},[e("font-awesome-icon",{attrs:{icon:["fas","plus-circle"]}}),t._v(" "+t._s(t.$t("auth.webauthn.register_a_new_device"))+"\n ")],1)]),t._v(" "),t.credentials.length>0?e("div",{staticClass:"field"},[t._l(t.credentials,(function(r){return e("div",{key:r.id,staticClass:"group-item is-size-5 is-size-6-mobile"},[t._v("\n "+t._s(t.displayName(r))+"\n "),t._v(" "),e("button",{staticClass:"button tag is-pulled-right",class:t.$root.showDarkMode?"is-dark":"is-white",attrs:{title:t.$t("settings.revoke")},on:{click:function(e){return t.revokeCredential(r.id)}}},[t._v("\n "+t._s(t.$t("settings.revoke"))+"\n ")])])})),t._v(" "),e("div",{staticClass:"mt-2 is-size-7 is-pulled-right"},[t._v("\n "+t._s(t.$t("auth.webauthn.revoking_a_device_is_permanent"))+"\n ")])],2):t._e(),t._v(" "),t.isFetching&&0===t.credentials.length?e("div",{staticClass:"has-text-centered mt-6"},[e("span",{staticClass:"is-size-4",attrs:{id:"icnSpinner"}},[e("font-awesome-icon",{attrs:{icon:["fas","spinner"],spin:""}})],1)]):t._e(),t._v(" "),e("h4",{staticClass:"title is-4 pt-6 has-text-grey-light"},[t._v(t._s(t.$t("settings.options")))]),t._v(" "),e("div",{staticClass:"field"},[t._v("\n "+t._s(t.$t("auth.webauthn.need_a_security_device_to_enable_options"))+"\n ")]),t._v(" "),e("form",[e("form-checkbox",{attrs:{form:t.form,fieldName:"useWebauthnOnly",label:t.$t("auth.webauthn.use_webauthn_only.label"),help:t.$t("auth.webauthn.use_webauthn_only.help"),disabled:t.isRemoteUser||0===t.credentials.length},on:{useWebauthnOnly:function(e){return t.savePreference("useWebauthnOnly",e)}}})],1),t._v(" "),e("vue-footer",{attrs:{showButtons:!0}},[e("p",{staticClass:"control"},[e("router-link",{staticClass:"button is-rounded",class:{"is-dark":t.$root.showDarkMode},attrs:{id:"btnClose",to:{path:t.$route.params.returnTo,params:{toRefresh:!1}},tabindex:"0",role:"button","aria-label":t.$t("commons.close_the_x_page",{pagetitle:t.$router.currentRoute.meta.title})}},[t._v("\n "+t._s(t.$t("commons.close"))+"\n ")])],1)])],1)],1)],1)}),[],!1,null,null,null).exports;function fr(t){return fr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},fr(t)}function pr(){pr=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==fr(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function hr(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}const dr={data:function(){return{form:new S({name:this.name})}},props:["credentialId","name"],methods:{updateCredential:function(){var t,e=this;return(t=pr().mark((function t(){return pr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.form.patch("/webauthn/credentials/"+e.credentialId+"/name");case 2:!1===e.form.errors.any()&&(e.$notify({type:"is-success",text:e.$t("auth.webauthn.device_successfully_registered")}),e.$router.push({name:"settings.webauthn.devices",params:{toRefresh:!0}}));case 3:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){hr(i,n,o,a,s,"next",t)}function s(t){hr(i,n,o,a,s,"throw",t)}a(void 0)}))})()},cancelCreation:function(){this.$router.push({name:"settings.webauthn.devices"})}}};const mr=(0,T.Z)(dr,(function(){var t=this,e=t._self._c;return e("form-wrapper",{attrs:{title:t.$t("auth.webauthn.rename_device")}},[e("form",{on:{submit:function(e){return e.preventDefault(),t.updateCredential.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-field",{attrs:{form:t.form,fieldName:"name",inputType:"text",label:t.$t("commons.new_name"),autofocus:""}}),t._v(" "),e("form-buttons",{attrs:{submitId:"btnEditCredential",isBusy:t.form.isBusy,caption:t.$t("commons.save"),showCancelButton:!0,cancelLandingView:"settings.webauthn.devices"}})],1)])}),[],!1,null,null,null).exports;function vr(t){return vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vr(t)}function yr(){yr=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==vr(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function gr(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}const _r={data:function(){return{form:new S({name:""})}},methods:{generatePAToken:function(){var t,e=this;return(t=yr().mark((function t(){var r,n;return yr().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.form.post("/oauth/personal-access-tokens");case 2:r=t.sent,n=r.data,!1===e.form.errors.any()&&e.$router.push({name:"settings.oauth.tokens",params:{accessToken:n.accessToken,token_id:n.token.id}});case 5:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){gr(i,n,o,a,s,"next",t)}function s(t){gr(i,n,o,a,s,"throw",t)}a(void 0)}))})()}}};const wr=(0,T.Z)(_r,(function(){var t=this,e=t._self._c;return e("form-wrapper",{attrs:{title:t.$t("settings.forms.new_token")}},[e("form",{on:{submit:function(e){return e.preventDefault(),t.generatePAToken.apply(null,arguments)},keydown:function(e){return t.form.onKeydown(e)}}},[e("form-field",{attrs:{form:t.form,fieldName:"name",inputType:"text",label:t.$t("commons.name"),autofocus:""}}),t._v(" "),e("form-buttons",{attrs:{submitId:"btnGenerateToken",isBusy:t.form.isBusy,caption:t.$t("commons.generate"),showCancelButton:!0,cancelLandingView:"settings.oauth.tokens"}})],1)])}),[],!1,null,null,null).exports;const br={data:function(){return{ShowModal:!0,showcloseButton:this.closable}},computed:{debugMode:function(){return"production"},error:function(){return null!==this.err&&void 0!==this.err&&(407===this.err.status?{message:this.$t("errors.auth_proxy_failed"),originalMessage:this.$t("errors.auth_proxy_failed_legend")}:403===this.err.status?{message:this.$t("errors.unauthorized"),originalMessage:this.$t("errors.unauthorized_legend")}:this.err.data?this.err.data:{message:this.err})}},props:{err:[String,Object],closable:{type:Boolean,default:!0}},components:{Modal:B},mounted:function(){this.$on("modalClose",(function(){window.history.length>1&&"404"!==this.$route.name?this.$router.go(-1):this.$router.push({name:"accounts"})}))},beforeRouteEnter:function(t,e,r){r((function(r){e.params.returnTo&&(t.params.returnTo=e.params.returnTo)}))}};const xr=(0,T.Z)(br,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"error-message"},[e("modal",{attrs:{closable:this.showcloseButton},model:{value:t.ShowModal,callback:function(e){t.ShowModal=e},expression:"ShowModal"}},["404"==t.$route.name?e("div",{staticClass:"error-message"},[e("p",{staticClass:"error-404"}),t._v(" "),e("p",[t._v(t._s(t.$t("errors.resource_not_found")))]),t._v(" "),e("p",{},[e("router-link",{staticClass:"is-text",attrs:{to:{name:"accounts"}}},[t._v(t._s(t.$t("errors.refresh")))])],1)]):e("div",[e("p",{staticClass:"error-generic"}),t._v(" "),e("p",[t._v(t._s(t.$t("errors.error_occured"))+" ")]),t._v(" "),t.error.message?e("p",{staticClass:"has-text-grey-lighter"},[t._v(t._s(t.error.message))]):t._e(),t._v(" "),t.error.originalMessage?e("p",{staticClass:"has-text-grey-lighter"},[t._v(t._s(t.error.originalMessage))]):t._e(),t._v(" "),e("p",[e("router-link",{staticClass:"is-text",attrs:{to:{name:"accounts",params:{toRefresh:!0}}}},[t._v(t._s(t.$t("errors.refresh")))])],1),t._v(" "),"development"==t.debugMode&&t.error.debug?e("p",[e("br"),t._v("\n "+t._s(t.error.debug)+"\n ")]):t._e()])])],1)}),[],!1,null,null,null).exports;function kr(t){return kr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kr(t)}function $r(){$r=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{c({},"")}catch(t){c=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var i=e&&e.prototype instanceof p?e:p,a=Object.create(i.prototype),s=new L(o||[]);return n(a,"_invoke",{value:b(t,r,s)}),a}function l(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var f={};function p(){}function h(){}function d(){}var m={};c(m,i,(function(){return this}));var v=Object.getPrototypeOf,y=v&&v(v(C([])));y&&y!==e&&r.call(y,i)&&(m=y);var g=d.prototype=p.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){c(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(n,i,a,s){var c=l(t[n],t,i);if("throw"!==c.type){var u=c.arg,f=u.value;return f&&"object"==kr(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){u.value=t,a(u)}),(function(t){return o("throw",t,a,s)}))}s(c.arg)}var i;n(this,"_invoke",{value:function(t,r){function n(){return new e((function(e,n){o(t,r,e,n)}))}return i=i?i.then(n,n):n()}})}function b(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return E()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=l(t,e,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function x(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=l(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function k(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function $(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function C(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var n=-1,o=function e(){for(;++n<t.length;)if(r.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return h.prototype=d,n(g,"constructor",{value:d,configurable:!0}),n(d,"constructor",{value:h,configurable:!0}),h.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},_(w.prototype),c(w.prototype,a,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new w(u(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(g),c(g,s,"Generator"),c(g,i,(function(){return this})),c(g,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=C,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:C(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function Lr(t,e,r,n,o,i,a){try{var s=t[i](a),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(n,o)}const Cr={data:function(){return{pagetitle:this.$t("commons.about"),infos:null,adminSettings:null,userPreferences:null,showUserPreferences:!1,showAdminSettings:!1}},mounted:function(){var t,e=this;return(t=$r().mark((function t(){return $r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.axios.get("infos").then((function(t){e.infos=t.data.common,t.data.admin_settings&&(e.adminSettings=t.data.admin_settings,e.showAdminSettings=!0),t.data.user_preferences&&(e.userPreferences=t.data.user_preferences,e.showUserPreferences=!0)}));case 2:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){Lr(i,n,o,a,s,"next",t)}function s(t){Lr(i,n,o,a,s,"throw",t)}a(void 0)}))})()},methods:{clipboardSuccessHandler:function(t){t.value,t.event;this.$notify({type:"is-success",text:this.$t("commons.copied_to_clipboard")})},clipboardErrorHandler:function(t){var e=t.value;t.event;console.log("error",e)}},beforeRouteEnter:function(t,e,r){r((function(r){e.params.returnTo&&(t.params.returnTo=e.params.returnTo)}))}};const Er=(0,T.Z)(Cr,(function(){var t=this,e=this,r=e._self._c;return r("responsive-width-wrapper",[r("h1",{staticClass:"title has-text-grey-dark"},[e._v(e._s(e.pagetitle))]),e._v(" "),r("p",{staticClass:"block"},[r("span",{class:e.$root.showDarkMode?"has-text-white":"has-text-black"},[r("span",{staticClass:"is-size-5"},[e._v("2FAuth")]),e._v(" v"+e._s(e.appVersion))]),r("br"),e._v("\n "+e._s(e.$t("commons.2fauth_teaser"))+"\n ")]),e._v(" "),r("img",{staticClass:"about-logo",attrs:{src:"logo.svg",alt:"2FAuth logo"}}),e._v(" "),r("p",{staticClass:"block"},[e._v("\n ©Bubka "),r("a",{staticClass:"is-size-7",attrs:{href:"https://github.com/Bubka/2FAuth/blob/master/LICENSE"}},[e._v("AGPL-3.0 license")])]),e._v(" "),r("h2",{staticClass:"title is-5 has-text-grey-light"},[e._v("\n "+e._s(e.$t("commons.resources"))+"\n ")]),e._v(" "),r("div",{staticClass:"buttons"},[r("a",{staticClass:"button",class:{"is-dark":e.$root.showDarkMode},attrs:{href:"https://github.com/Bubka/2FAuth",target:"_blank"}},[r("span",{staticClass:"icon is-small"},[r("font-awesome-icon",{attrs:{icon:["fab","github-alt"]}})],1),e._v(" "),r("span",[e._v("Github")])]),e._v(" "),r("a",{staticClass:"button",class:{"is-dark":e.$root.showDarkMode},attrs:{href:"https://docs.2fauth.app/",target:"_blank"}},[r("span",{staticClass:"icon is-small"},[r("font-awesome-icon",{attrs:{icon:["fas","book"]}})],1),e._v(" "),r("span",[e._v("Docs")])]),e._v(" "),r("a",{staticClass:"button",class:{"is-dark":e.$root.showDarkMode},attrs:{href:"https://demo.2fauth.app/",target:"_blank"}},[r("span",{staticClass:"icon is-small"},[r("font-awesome-icon",{attrs:{icon:["fas","flask"]}})],1),e._v(" "),r("span",[e._v("Demo")])]),e._v(" "),r("a",{staticClass:"button",class:{"is-dark":e.$root.showDarkMode},attrs:{href:"https://docs.2fauth.app/resources/rapidoc.html",target:"_blank"}},[r("span",{staticClass:"icon is-small"},[r("font-awesome-icon",{attrs:{icon:["fas","code"]}})],1),e._v(" "),r("span",[e._v("API")])])]),e._v(" "),r("h2",{staticClass:"title is-5 has-text-grey-light"},[e._v("\n "+e._s(e.$t("commons.credits"))+"\n ")]),e._v(" "),r("p",{staticClass:"block"},[r("ul",[r("li",[e._v(e._s(e.$t("commons.made_with"))+" "),r("a",{attrs:{href:"https://docs.2fauth.app/credits/"}},[e._v("Laravel, Bulma CSS, Vue.js and more")])]),e._v(" "),r("li",[e._v(e._s(e.$t("commons.ui_icons_by"))+" "),r("a",{attrs:{href:"https://fontawesome.com/"}},[e._v("Font Awesome")]),e._v(" "),r("a",{staticClass:"is-size-7",attrs:{href:"https://fontawesome.com/license/free"}},[e._v("(CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)")])]),e._v(" "),r("li",[e._v(e._s(e.$t("commons.logos_by"))+" "),r("a",{attrs:{href:"https://2fa.directory/"}},[e._v("2FA Directory")]),e._v(" "),r("a",{staticClass:"is-size-7",attrs:{href:"https://github.com/2factorauth/twofactorauth/blob/master/LICENSE.md"}},[e._v("(MIT License)")])])])]),e._v(" "),r("h2",{staticClass:"title is-5 has-text-grey-light"},[e._v("\n "+e._s(e.$t("commons.environment"))+"\n ")]),e._v(" "),r("div",{staticClass:"about-debug box is-family-monospace is-size-7"},[r("button",{directives:[{name:"clipboard",rawName:"v-clipboard",value:function(){return t.$refs.listInfos.innerText},expression:"() => this.$refs.listInfos.innerText"},{name:"clipboard",rawName:"v-clipboard:success",value:e.clipboardSuccessHandler,expression:"clipboardSuccessHandler",arg:"success"}],staticClass:"button is-like-text is-pulled-right is-small is-text",attrs:{id:"btnCopyEnvVars","aria-label":e.$t("commons.copy_to_clipboard")}},[r("font-awesome-icon",{attrs:{icon:["fas","copy"]}})],1),e._v(" "),r("ul",{ref:"listInfos",attrs:{id:"listInfos"}},e._l(e.infos,(function(t,n){return r("li",{key:n,attrs:{value:t}},[r("b",[e._v(e._s(n))]),e._v(": "+e._s(t))])})),0)]),e._v(" "),e.showAdminSettings?r("h2",{staticClass:"title is-5 has-text-grey-light"},[e._v("\n "+e._s(e.$t("settings.admin_settings"))+"\n ")]):e._e(),e._v(" "),e.showAdminSettings?r("div",{staticClass:"about-debug box is-family-monospace is-size-7"},[r("button",{directives:[{name:"clipboard",rawName:"v-clipboard",value:function(){return t.$refs.listAdminSettings.innerText},expression:"() => this.$refs.listAdminSettings.innerText"},{name:"clipboard",rawName:"v-clipboard:success",value:e.clipboardSuccessHandler,expression:"clipboardSuccessHandler",arg:"success"}],staticClass:"button is-like-text is-pulled-right is-small is-text",attrs:{id:"btnCopyAdminSettings","aria-label":e.$t("commons.copy_to_clipboard")}},[r("font-awesome-icon",{attrs:{icon:["fas","copy"]}})],1),e._v(" "),r("ul",{ref:"listAdminSettings",attrs:{id:"listAdminSettings"}},e._l(e.adminSettings,(function(t,n){return r("li",{key:n,attrs:{value:t}},[r("b",[e._v(e._s(n))]),e._v(": "+e._s(t))])})),0)]):e._e(),e._v(" "),e.showUserPreferences?r("h2",{staticClass:"title is-5 has-text-grey-light"},[e._v("\n "+e._s(e.$t("settings.user_preferences"))+"\n ")]):e._e(),e._v(" "),e.showUserPreferences?r("div",{staticClass:"about-debug box is-family-monospace is-size-7"},[r("button",{directives:[{name:"clipboard",rawName:"v-clipboard",value:function(){return t.$refs.listUserPreferences.innerText},expression:"() => this.$refs.listUserPreferences.innerText"},{name:"clipboard",rawName:"v-clipboard:success",value:e.clipboardSuccessHandler,expression:"clipboardSuccessHandler",arg:"success"}],staticClass:"button is-like-text is-pulled-right is-small is-text",attrs:{id:"btnCopyUserPreferences","aria-label":e.$t("commons.copy_to_clipboard")}},[r("font-awesome-icon",{attrs:{icon:["fas","copy"]}})],1),e._v(" "),r("ul",{ref:"listUserPreferences",attrs:{id:"listUserPreferences"}},e._l(e.userPreferences,(function(t,n){return r("li",{key:n,attrs:{value:t}},[r("b",[e._v(e._s(n))]),e._v(": "+e._s(t))])})),0)]):e._e(),e._v(" "),r("vue-footer",{attrs:{showButtons:!0}},[r("p",{staticClass:"control"},[r("router-link",{staticClass:"button is-rounded",class:{"is-dark":e.$root.showDarkMode},attrs:{id:"lnkBack",to:{path:e.$route.params.goBackTo,params:{returnTo:e.$route.params.returnTo,toRefresh:!0}},"aria-label":e.$t("commons.close_the_x_page",{pagetitle:e.pagetitle})}},[e._v("\n "+e._s(e.$t("commons.back"))+"\n ")])],1)])],1)}),[],!1,null,null,null).exports;function Or(t){return Or="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Or(t)}function Sr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Pr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Sr(Object(r),!0).forEach((function(e){Tr(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Sr(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function Tr(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Or(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Or(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Or(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}n.default.use(h.ZP);var Ar=new h.ZP({mode:"history",base:window.appConfig.subdirectory?window.appConfig.subdirectory:"/",routes:[{path:"/start",name:"start",component:A,meta:{requiresAuth:!0},props:!0},{path:"/capture",name:"capture",component:G,meta:{requiresAuth:!0},props:!0},{path:"/accounts",name:"accounts",component:ft,meta:{requiresAuth:!0},alias:"/",props:!0},{path:"/account/create",name:"createAccount",component:vt,meta:{requiresAuth:!0}},{path:"/account/import",name:"importAccounts",component:St,meta:{requiresAuth:!0}},{path:"/account/:twofaccountId/edit",name:"editAccount",component:xt,meta:{requiresAuth:!0}},{path:"/account/:twofaccountId/qrcode",name:"showQRcode",component:jt,meta:{requiresAuth:!0}},{path:"/groups",name:"groups",component:Bt,meta:{requiresAuth:!0},props:!0},{path:"/group/create",name:"createGroup",component:Ht,meta:{requiresAuth:!0}},{path:"/group/:groupId/edit",name:"editGroup",component:Vt,meta:{requiresAuth:!0},props:!0},{path:"/settings/options",name:"settings.options",component:Ze,meta:{requiresAuth:!0,showAbout:!0}},{path:"/settings/account",name:"settings.account",component:Qe,meta:{requiresAuth:!0,showAbout:!0}},{path:"/settings/oauth",name:"settings.oauth.tokens",component:nr,meta:{requiresAuth:!0,showAbout:!0}},{path:"/settings/oauth/pat/create",name:"settings.oauth.generatePAT",component:wr,meta:{requiresAuth:!0,showAbout:!0}},{path:"/settings/webauthn/:credentialId/edit",name:"settings.webauthn.editCredential",component:mr,meta:{requiresAuth:!0,showAbout:!0},props:!0},{path:"/settings/webauthn",name:"settings.webauthn.devices",component:lr,meta:{requiresAuth:!0,showAbout:!0}},{path:"/login",name:"login",component:ye,meta:{disabledWithAuthProxy:!0,showAbout:!0}},{path:"/register",name:"register",component:Le,meta:{disabledWithAuthProxy:!0,showAbout:!0}},{path:"/autolock",name:"autolock",component:Ee,meta:{disabledWithAuthProxy:!0,showAbout:!0}},{path:"/password/request",name:"password.request",component:Se,meta:{disabledWithAuthProxy:!0,showAbout:!0}},{path:"/user/password/reset",name:"password.reset",component:Te,meta:{disabledWithAuthProxy:!0,showAbout:!0}},{path:"/webauthn/lost",name:"webauthn.lost",component:Ne,meta:{disabledWithAuthProxy:!0,showAbout:!0}},{path:"/webauthn/recover",name:"webauthn.recover",component:Ie,meta:{disabledWithAuthProxy:!0,showAbout:!0}},{path:"/about",name:"about",component:Er,meta:{showAbout:!0}},{path:"/error",name:"genericError",component:xr,props:!0},{path:"/404",name:"404",component:xr,props:!0},{path:"*",redirect:{name:"404"}}]}),Nr=!0;Ar.beforeEach((function(t,e,r){document.title=Ar.app.$options.i18n.t("titles."+t.name),"accounts"===t.name&&(t.params.isFirstLoad=!!Nr,Nr=!1),!t.meta.requiresAuth||n.default.$storage.get("authenticated",!1)||window.appConfig.proxyAuth?t.matched.some((function(t){return t.meta.disabledWithAuthProxy}))&&window.appConfig.proxyAuth?r({name:"accounts"}):t.name.startsWith("settings.")?null==t.params.returnTo?e.params.returnTo?r({name:t.name,params:Pr(Pr({},t.params),{},{returnTo:e.params.returnTo})}):e.name?r({name:t.name,params:Pr(Pr({},t.params),{},{returnTo:e.path})}):r({name:t.name,params:Pr(Pr({},t.params),{},{returnTo:"/accounts"})}):r():"about"==t.name&&null==t.params.goBackTo?e.name?r({name:t.name,params:{goBackTo:e.path}}):r({name:t.name,params:{goBackTo:"/accounts"}}):"genericError"===t.name&&null==t.params.err?r({name:"accounts"}):r():r({name:"login"})})),Ar.afterEach((function(t){n.default.$storage.set("lastRoute",t.name)}));const jr=Ar;var Ir=r(154),Fr=r(346);n.default.use(Fr.Z,Ir.Z),n.default.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest",n.default.axios.defaults.headers.common["Content-Type"]="application/json",window.appConfig.subdirectory&&(n.default.axios.defaults.baseURL=window.appConfig.subdirectory),n.default.axios.interceptors.response.use((function(t){return t}),(function(t){if(401===t.response.status&&n.default.$storage.remove("authenticated"),t.config.hasOwnProperty("returnError")&&!0===t.config.returnError)return Promise.reject(t);if(422===t.response.status)return Promise.reject(t);if(401===t.response.status)return jr.push({name:"login",params:{forceRefresh:!0}}),new Promise((function(){}));if(407===t.response.status)return jr.push({name:"genericError",params:{err:t.response,closable:!1}}),new Promise((function(){}));var e="genericError";return 418===t.response.status&&(e="autolock"),404===t.response.status&&(e="404"),jr.push({name:e,params:{err:t.response}}),new Promise((function(){}))}));var Dr=r(947),Gr=r(810),Mr=r(436),Br=r(417);Dr.vI.add(Mr.r8p,Mr.KtF,Mr.rtB,Mr.VmB,Mr.$aW,Mr.LEp,Mr.a3n,Mr.NBC,Mr.byT,Mr._1N,Mr.wn1,Mr.cNd,Mr.xiG,Mr.LM3,Br.Nz9,Mr.eW2,Mr.Krp,Mr.uMC,Mr.RLE,Mr.e0A,Mr.szN,Mr.Zrf,Mr.nYk,Mr.cf$,Mr.g4A,Mr.FL8,Mr.jZZ,Mr.dT$,Mr.kZ_,Mr.tHg,Mr.sr,Mr.Mdf,Mr.Aq,Mr.Xjp,Mr._jT,Mr.kwI,Mr.enB,Mr.DBF,Mr.tc$,Mr.IJ7),n.default.component("font-awesome-icon",Gr.GN);var qr=r(906),Rr=r.n(qr);n.default.use(Rr());var Ur=r(765),zr=r.n(Ur);const Hr={name:"Spinner",props:{active:{type:Boolean,default:!1},message:String}};var Zr=r(198),Wr={insert:"head",singleton:!1};ct()(Zr.Z,Wr);Zr.Z.locals;const Yr={name:"App",components:{Spinner:(0,T.Z)(Hr,(function(){var t=this,e=t._self._c;return t.active?e("div",{staticClass:"spinner-container"},[e("div",{staticClass:"spinner-wrapper"},[e("span",{staticClass:"is-size-1 spinner"},[e("font-awesome-icon",{attrs:{icon:["fas","spinner"],spin:""}})],1),t._v(" "),e("span",[t._v(t._s(t.message))])])]):t._e()}),[],!1,null,"a80773f6",null).exports},data:function(){return{}},computed:{kickInactiveUser:function(){return parseInt(this.$root.userPreferences.kickUserAfter)>0&&this.$route.meta.requiresAuth}}};const Kr=(0,T.Z)(Yr,(function(){var t=this,e=t._self._c;return e("div",[t.kickInactiveUser?e("kicker"):t._e(),t._v(" "),this.$root.isDemoApp?e("div",{staticClass:"demo has-background-warning has-text-centered is-size-7-mobile"},[t._v("\n "+t._s(t.$t("commons.demo_do_not_post_sensitive_data"))+"\n ")]):t._e(),t._v(" "),this.$root.isTestingApp?e("div",{staticClass:"demo has-background-warning has-text-centered is-size-7-mobile"},[t._v("\n "+t._s(t.$t("commons.testing_do_not_post_sensitive_data"))+"\n ")]):t._e(),t._v(" "),e("spinner",{attrs:{active:t.$root.spinner.active,message:t.$root.spinner.message}}),t._v(" "),e("notifications",{attrs:{id:"vueNotification",role:"alert",width:"100%",position:"top",duration:4e3,speed:0,max:1,classes:"notification is-radiusless"}}),t._v(" "),e("main",{staticClass:"main-section"},[e("router-view")],1)],1)}),[],!1,null,null,null).exports;function Vr(t){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vr(t)}function Qr(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==Vr(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==Vr(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===Vr(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const Jr={name:"VButton",props:{color:{type:String,default:"is-link"},nativeType:{type:String,default:"submit"},isLoading:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}}};const Xr=(0,T.Z)(Jr,(function(){var t,e=this;return(0,e._self._c)("button",{class:(t={button:!0},Qr(t,"".concat(e.color),!0),Qr(t,"is-loading",e.isLoading),t),attrs:{type:e.nativeType,disabled:e.isLoading||e.isDisabled},on:{click:function(t){return e.$emit("click")}}},[e._t("default")],2)}),[],!1,null,null,null).exports;const tn={name:"field-error",props:{form:{type:Object,required:!0},field:{type:String,required:!0}}};const en=(0,T.Z)(tn,(function(){var t=this,e=t._self._c;return e("div",{attrs:{role:"alert"}},[t.form.errors.has(t.field)?e("p",{staticClass:"help is-danger",attrs:{id:"valError"+t.field[0].toUpperCase()+t.field.toLowerCase().slice(1)},domProps:{innerHTML:t._s(t.form.errors.get(t.field))}}):t._e()])}),[],!1,null,null,null).exports;const rn={name:"FormWrapper",data:function(){return{}},props:{title:{type:String,default:""},punchline:{type:String,default:""}}};const nn=(0,T.Z)(rn,(function(){var t=this,e=t._self._c;return e("responsive-width-wrapper",[t.title?e("h1",{staticClass:"title has-text-grey-dark",domProps:{innerHTML:t._s(t.title)}}):t._e(),t._v(" "),t.punchline?e("div",{staticClass:"block",attrs:{id:"punchline"},domProps:{innerHTML:t._s(t.punchline)}}):t._e(),t._v(" "),t._t("default")],2)}),[],!1,null,null,null).exports;const on={name:"FormField",inheritAttrs:!1,data:function(){return{}},props:{label:{type:String,default:""},fieldName:{type:String,default:"",required:!0},inputType:{type:String,default:"text"},form:{type:Object,required:!0},placeholder:{type:String,default:""},help:{type:String,default:""},hasOffset:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},maxLength:{type:Number,default:null}}};const an=(0,T.Z)(on,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"field",class:{"pt-3":t.hasOffset}},[e("label",{staticClass:"label",attrs:{for:this.inputId(t.inputType,t.fieldName)},domProps:{innerHTML:t._s(t.label)}}),t._v(" "),e("div",{staticClass:"control"},["checkbox"===t.inputType?e("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"input",attrs:{disabled:t.isDisabled,id:this.inputId(t.inputType,t.fieldName),placeholder:t.placeholder,maxlength:this.maxLength,type:"checkbox"},domProps:{checked:Array.isArray(t.form[t.fieldName])?t._i(t.form[t.fieldName],null)>-1:t.form[t.fieldName]},on:{change:[function(e){var r=t.form[t.fieldName],n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.form,t.fieldName,r.concat([null])):i>-1&&t.$set(t.form,t.fieldName,r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.form,t.fieldName,o)},function(e){return t.$emit("field-changed",t.form[t.fieldName])}]}},"input",t.$attrs,!1)):"radio"===t.inputType?e("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"input",attrs:{disabled:t.isDisabled,id:this.inputId(t.inputType,t.fieldName),placeholder:t.placeholder,maxlength:this.maxLength,type:"radio"},domProps:{checked:t._q(t.form[t.fieldName],null)},on:{change:[function(e){return t.$set(t.form,t.fieldName,null)},function(e){return t.$emit("field-changed",t.form[t.fieldName])}]}},"input",t.$attrs,!1)):e("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"input",attrs:{disabled:t.isDisabled,id:this.inputId(t.inputType,t.fieldName),placeholder:t.placeholder,maxlength:this.maxLength,type:t.inputType},domProps:{value:t.form[t.fieldName]},on:{change:function(e){return t.$emit("field-changed",t.form[t.fieldName])},input:function(e){e.target.composing||t.$set(t.form,t.fieldName,e.target.value)}}},"input",t.$attrs,!1))]),t._v(" "),e("field-error",{attrs:{form:t.form,field:t.fieldName}}),t._v(" "),t.help?e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.help)}}):t._e()],1)}),[],!1,null,null,null).exports;const sn={name:"FormPasswordField",inheritAttrs:!1,data:function(){return{currentType:this.inputType,hasCapsLockOn:!1}},computed:{hasLowerCase:function(){return/[a-z]/.test(this.form[this.fieldName])},hasUpperCase:function(){return/[A-Z]/.test(this.form[this.fieldName])},hasNumber:function(){return/[0-9]/.test(this.form[this.fieldName])},hasSpecialChar:function(){return/[^A-Za-z0-9]/.test(this.form[this.fieldName])},IsLongEnough:function(){return this.form[this.fieldName].length>=8}},props:{label:{type:String,default:""},fieldName:{type:String,default:"",required:!0},inputType:{type:String,default:"password"},form:{type:Object,required:!0},placeholder:{type:String,default:""},help:{type:String,default:""},hasOffset:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},showRules:{type:Boolean,default:!1}},methods:{checkCapsLock:function(t){this.hasCapsLockOn=!!t.getModifierState("CapsLock")},setFieldType:function(t){this.currentType!=t&&(this.currentType=t)}}};const cn=(0,T.Z)(sn,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"field",class:{"pt-3":t.hasOffset}},[e("label",{staticClass:"label",attrs:{for:this.inputId("password",t.fieldName)},domProps:{innerHTML:t._s(t.label)}}),t._v(" "),e("div",{staticClass:"control has-icons-right"},["checkbox"===t.currentType?e("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"input",attrs:{disabled:t.isDisabled,id:this.inputId("password",t.fieldName),placeholder:t.placeholder,type:"checkbox"},domProps:{checked:Array.isArray(t.form[t.fieldName])?t._i(t.form[t.fieldName],null)>-1:t.form[t.fieldName]},on:{change:[function(e){var r=t.form[t.fieldName],n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.form,t.fieldName,r.concat([null])):i>-1&&t.$set(t.form,t.fieldName,r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.form,t.fieldName,o)},function(e){return t.$emit("field-changed",t.form[t.fieldName])}],keyup:t.checkCapsLock}},"input",t.$attrs,!1)):"radio"===t.currentType?e("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"input",attrs:{disabled:t.isDisabled,id:this.inputId("password",t.fieldName),placeholder:t.placeholder,type:"radio"},domProps:{checked:t._q(t.form[t.fieldName],null)},on:{change:[function(e){return t.$set(t.form,t.fieldName,null)},function(e){return t.$emit("field-changed",t.form[t.fieldName])}],keyup:t.checkCapsLock}},"input",t.$attrs,!1)):e("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"input",attrs:{disabled:t.isDisabled,id:this.inputId("password",t.fieldName),placeholder:t.placeholder,type:t.currentType},domProps:{value:t.form[t.fieldName]},on:{change:function(e){return t.$emit("field-changed",t.form[t.fieldName])},keyup:t.checkCapsLock,input:function(e){e.target.composing||t.$set(t.form,t.fieldName,e.target.value)}}},"input",t.$attrs,!1)),t._v(" "),"password"==t.currentType?e("span",{staticClass:"icon is-small is-right is-clickable",attrs:{role:"button",id:"btnTogglePassword",tabindex:"0",title:t.$t("auth.forms.reveal_password")},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.setFieldType("text")},click:function(e){return t.setFieldType("text")}}},[e("font-awesome-icon",{attrs:{icon:["fas","eye-slash"]}})],1):e("span",{staticClass:"icon is-small is-right is-clickable",attrs:{role:"button",id:"btnTogglePassword",tabindex:"0",title:t.$t("auth.forms.hide_password")},on:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.setFieldType("password")},click:function(e){return t.setFieldType("password")}}},[e("font-awesome-icon",{attrs:{icon:["fas","eye"]}})],1)]),t._v(" "),t.hasCapsLockOn?e("p",{staticClass:"help is-warning",domProps:{innerHTML:t._s(t.$t("auth.forms.caps_lock_is_on"))}}):t._e(),t._v(" "),e("field-error",{attrs:{form:t.form,field:t.fieldName}}),t._v(" "),t.help?e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.help)}}):t._e(),t._v(" "),t.showRules?e("div",{staticClass:"columns is-mobile is-size-7 mt-0"},[e("div",{staticClass:"column is-one-third"},[e("span",{staticClass:"has-text-weight-semibold"},[t._v(t._s(t.$t("auth.forms.mandatory_rules")))]),e("br"),t._v(" "),e("span",{staticClass:"is-underscored",class:{"is-dot":t.IsLongEnough},attrs:{id:"valPwdIsLongEnough"}}),t._v(t._s(t.$t("auth.forms.is_long_enough"))),e("br")]),t._v(" "),e("div",{staticClass:"column"},[e("span",{staticClass:"has-text-weight-semibold"},[t._v(t._s(t.$t("auth.forms.optional_rules_you_should_follow")))]),e("br"),t._v(" "),e("span",{staticClass:"is-underscored",class:{"is-dot":t.hasLowerCase},attrs:{id:"valPwdHasLowerCase"}}),t._v(t._s(t.$t("auth.forms.has_lower_case"))),e("br"),t._v(" "),e("span",{staticClass:"is-underscored",class:{"is-dot":t.hasUpperCase},attrs:{id:"valPwdHasUpperCase"}}),t._v(t._s(t.$t("auth.forms.has_upper_case"))),e("br"),t._v(" "),e("span",{staticClass:"is-underscored",class:{"is-dot":t.hasSpecialChar},attrs:{id:"valPwdHasSpecialChar"}}),t._v(t._s(t.$t("auth.forms.has_special_char"))),e("br"),t._v(" "),e("span",{staticClass:"is-underscored",class:{"is-dot":t.hasNumber},attrs:{id:"valPwdHasNumber"}}),t._v(t._s(t.$t("auth.forms.has_number"))+"\n ")])]):t._e()],1)}),[],!1,null,null,null).exports;const un={name:"FormSelect",data:function(){return{}},props:{label:{type:String,default:""},fieldName:{type:String,default:"",required:!0},options:{type:Array,required:!0},form:{type:Object,required:!0},help:{type:String,default:""}}};const ln=(0,T.Z)(un,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"field"},[e("label",{staticClass:"label",domProps:{innerHTML:t._s(t.label)}}),t._v(" "),e("div",{staticClass:"control"},[e("div",{staticClass:"select"},[e("select",{directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],on:{change:[function(e){var r=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.form,t.fieldName,e.target.multiple?r:r[0])},function(e){return t.$emit(t.fieldName,t.form[t.fieldName])}]}},t._l(t.options,(function(r){return e("option",{domProps:{value:r.value}},[t._v(t._s(r.text))])})),0)])]),t._v(" "),e("field-error",{attrs:{form:t.form,field:t.fieldName}}),t._v(" "),t.help?e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.help)}}):t._e()],1)}),[],!1,null,null,null).exports;const fn={name:"FormSwitch",data:function(){return{}},props:{label:{type:String,default:""},fieldName:{type:String,default:"",required:!0},form:{type:Object,required:!0},help:{type:String,default:""}}};const pn=(0,T.Z)(fn,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"field"},[e("label",{staticClass:"label",attrs:{for:t.fieldName},domProps:{innerHTML:t._s(t.label)}}),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"switch is-thin is-info",attrs:{id:t.fieldName,type:"checkbox",name:t.fieldName},domProps:{checked:Array.isArray(t.form[t.fieldName])?t._i(t.form[t.fieldName],null)>-1:t.form[t.fieldName]},on:{change:function(e){var r=t.form[t.fieldName],n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.form,t.fieldName,r.concat([null])):i>-1&&t.$set(t.form,t.fieldName,r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.form,t.fieldName,o)}}}),t._v(" "),e("label",{staticClass:"label",attrs:{for:t.fieldName}}),t._v(" "),t.help?e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.help)}}):t._e()])}),[],!1,null,null,null).exports;function hn(t){return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hn(t)}function dn(t,e,r){return(e=function(t){var e=function(t,e){if("object"!==hn(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var n=r.call(t,e||"default");if("object"!==hn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===hn(e)?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}const mn={name:"FormToggle",data:function(){return{inputType:"radio"}},props:{label:{type:String,default:""},fieldName:{type:String,default:"",required:!0},choices:{type:Array,required:!0},form:{type:Object,required:!0},help:{type:String,default:""},hasOffset:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1}},methods:{setRadio:function(t){this.form[this.fieldName]=t,this.$emit(this.fieldName,this.form[this.fieldName])}}};const vn=(0,T.Z)(mn,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"field",class:{"pt-3":t.hasOffset},attrs:{role:"radiogroup","aria-labelledby":t.inputId("label",t.fieldName)}},[t.label?e("label",{staticClass:"label",attrs:{id:t.inputId("label",t.fieldName)},domProps:{innerHTML:t._s(t.label)}}):t._e(),t._v(" "),e("div",{staticClass:"is-toggle buttons"},t._l(t.choices,(function(r,n){return e("button",{key:n,staticClass:"button",class:{"is-link":t.form[t.fieldName]===r.value,"is-dark":t.$root.showDarkMode,"is-multiline":r.legend},attrs:{id:t.inputId("button",t.fieldName+r.value),role:"radio",type:"button","aria-checked":t.form[t.fieldName]===r.value,disabled:t.isDisabled,title:r.title?r.title:""},on:{click:function(e){return e.stopPropagation(),t.setRadio(r.value)}}},["checkbox"===t.inputType?e("input",{directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"is-hidden",attrs:{id:t.inputId(t.inputType,r.value),disabled:t.isDisabled,type:"checkbox"},domProps:dn({checked:t.form[t.fieldName]===r.value,value:r.value},"checked",Array.isArray(t.form[t.fieldName])?t._i(t.form[t.fieldName],r.value)>-1:t.form[t.fieldName]),on:{change:function(e){var n=t.form[t.fieldName],o=e.target,i=!!o.checked;if(Array.isArray(n)){var a=r.value,s=t._i(n,a);o.checked?s<0&&t.$set(t.form,t.fieldName,n.concat([a])):s>-1&&t.$set(t.form,t.fieldName,n.slice(0,s).concat(n.slice(s+1)))}else t.$set(t.form,t.fieldName,i)}}}):"radio"===t.inputType?e("input",{directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"is-hidden",attrs:{id:t.inputId(t.inputType,r.value),disabled:t.isDisabled,type:"radio"},domProps:dn({checked:t.form[t.fieldName]===r.value,value:r.value},"checked",t._q(t.form[t.fieldName],r.value)),on:{change:function(e){return t.$set(t.form,t.fieldName,r.value)}}}):e("input",{directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"is-hidden",attrs:{id:t.inputId(t.inputType,r.value),disabled:t.isDisabled,type:t.inputType},domProps:dn({checked:t.form[t.fieldName]===r.value,value:r.value},"value",t.form[t.fieldName]),on:{input:function(e){e.target.composing||t.$set(t.form,t.fieldName,e.target.value)}}}),t._v(" "),r.legend?e("span",{staticClass:"is-block is-size-7",domProps:{innerHTML:t._s(r.legend)}}):t._e(),t._v(" "),r.icon?e("font-awesome-icon",{staticClass:"mr-2",attrs:{icon:["fas",r.icon]}}):t._e(),t._v(" "+t._s(r.text)+"\n ")],1)})),0),t._v(" "),e("field-error",{attrs:{form:t.form,field:t.fieldName}}),t._v(" "),t.help?e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.help)}}):t._e()],1)}),[],!1,null,null,null).exports;const yn={name:"FormCheckbox",inheritAttrs:!1,data:function(){return{}},props:{label:{type:String,default:""},labelClass:{type:String,default:""},fieldName:{type:String,default:"",required:!0},form:{type:Object,required:!0},help:{type:String,default:""}},methods:{setCheckbox:function(t){null==this.$attrs.disabled&&(this.form[this.fieldName]=!this.form[this.fieldName],this.$emit(this.fieldName,this.form[this.fieldName]))}}};const gn=(0,T.Z)(yn,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"field"},[e("input",t._b({directives:[{name:"model",rawName:"v-model",value:t.form[t.fieldName],expression:"form[fieldName]"}],staticClass:"is-checkradio is-info",attrs:{id:t.fieldName,type:"checkbox",name:t.fieldName},domProps:{checked:Array.isArray(t.form[t.fieldName])?t._i(t.form[t.fieldName],null)>-1:t.form[t.fieldName]},on:{change:[function(e){var r=t.form[t.fieldName],n=e.target,o=!!n.checked;if(Array.isArray(r)){var i=t._i(r,null);n.checked?i<0&&t.$set(t.form,t.fieldName,r.concat([null])):i>-1&&t.$set(t.form,t.fieldName,r.slice(0,i).concat(r.slice(i+1)))}else t.$set(t.form,t.fieldName,o)},function(e){return t.$emit(t.fieldName,t.form[t.fieldName])}]}},"input",t.$attrs,!1)),t._v(" "),e("label",{staticClass:"label",class:t.labelClass,attrs:{tabindex:"0",for:t.fieldName},domProps:{innerHTML:t._s(t.label)},on:{keypress:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"space",32,e.key,[" ","Spacebar"])?null:(e.preventDefault(),t.setCheckbox.apply(null,arguments))}}}),t._v(" "),t.help?e("p",{staticClass:"help",domProps:{innerHTML:t._s(t.help)}}):t._e()])}),[],!1,null,null,null).exports;const _n={name:"FormButtons",data:function(){return{}},props:{showCancelButton:{type:Boolean,default:!1},isBusy:{type:Boolean,default:!1},isDisabled:{type:Boolean,default:!1},caption:{type:String,default:"Submit"},cancelLandingView:{type:String,default:""},color:{type:String,default:"is-link"},submitId:{type:String,default:"btnSubmit"},cancelId:{type:String,default:"btnCancel"}}};const wn=(0,T.Z)(_n,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"field is-grouped"},[e("div",{staticClass:"control"},[e("v-button",{attrs:{id:t.submitId,color:t.color,isLoading:t.isBusy,disabled:t.isDisabled}},[t._v(t._s(t.caption))])],1),t._v(" "),t.showCancelButton?e("div",{staticClass:"control"},[e("router-link",{staticClass:"button is-text",attrs:{id:t.cancelId,to:{name:t.cancelLandingView}}},[t._v(t._s(t.$t("commons.cancel")))])],1):t._e()])}),[],!1,null,null,null).exports;const bn={name:"VueFooter",data:function(){return{}},props:{showButtons:!0,editMode:!1},methods:{logout:function(){confirm(this.$t("auth.confirm.logout"))&&this.appLogout()},exitEdit:function(){this.$emit("exit-edit")}}};const xn=(0,T.Z)(bn,(function(){var t=this,e=t._self._c;return e("footer",[t.showButtons?e("div",{staticClass:"columns is-gapless"},[e("div",{staticClass:"column has-text-centered"},[e("div",{staticClass:"field is-grouped"},[t._t("default")],2)])]):t._e(),t._v(" "),t.editMode?e("div",{staticClass:"content has-text-centered"},[e("button",{staticClass:"button is-ghost is-like-text",attrs:{id:"lnkExitEdit"},on:{click:t.exitEdit}},[t._v(t._s(t.$t("commons.done")))])]):e("div",{staticClass:"content has-text-centered"},[!0===t.$route.meta.showAbout?e("div",{staticClass:"is-size-6"},[e("router-link",{staticClass:"has-text-grey",attrs:{id:"lnkAbout",to:{name:"about"}}},[t._v("\n 2FAuth "),e("span",{staticClass:"has-text-weight-bold"},[t._v("v"+t._s(t.appVersion))])])],1):e("div",[e("router-link",{staticClass:"has-text-grey",attrs:{id:"lnkSettings",to:{name:"settings.options"}}},[t._v("\n "+t._s(t.$t("settings.settings"))),t.$root.appSettings.latestRelease&&t.$root.appSettings.checkForUpdate?e("span",{staticClass:"release-flag"}):t._e()]),t._v(" "),!this.$root.appConfig.proxyAuth||this.$root.appConfig.proxyAuth&&this.$root.appConfig.proxyLogoutUrl?e("span",[t._v("\n - "),e("button",{staticClass:"button is-text is-like-text has-text-grey",attrs:{id:"lnkSignOut"},on:{click:t.logout}},[t._v(t._s(t.$t("auth.sign_out")))])]):t._e()],1)])])}),[],!1,null,null,null).exports;const kn={name:"Kicker",data:function(){return{events:["click","mousedown","scroll","keypress","load"],logoutTimer:null}},mounted:function(){this.events.forEach((function(t){window.addEventListener(t,this.resetTimer)}),this),this.setTimer()},destroyed:function(){this.events.forEach((function(t){window.removeEventListener(t,this.resetTimer)}),this),clearTimeout(this.logoutTimer)},methods:{setTimer:function(){this.logoutTimer=setTimeout(this.logoutUser,60*this.$root.userPreferences.kickUserAfter*1e3)},logoutUser:function(){clearTimeout(this.logoutTimer),this.$router.push({name:"autolock"})},resetTimer:function(){clearTimeout(this.logoutTimer),this.setTimer()}}};const $n=(0,T.Z)(kn,(function(){return(0,this._self._c)("div")}),[],!1,null,null,null).exports;const Ln={name:"SettingTabs",data:function(){return{tabs:[{name:this.$t("settings.options"),view:"settings.options",id:"lnkTabOptions"},{name:this.$t("settings.account"),view:"settings.account",id:"lnkTabAccount"},{name:this.$t("settings.oauth"),view:"settings.oauth.tokens",id:"lnkTabOAuth"},{name:this.$t("settings.webauthn"),view:"settings.webauthn.devices",id:"lnkTabWebauthn"}]}},props:{activeTab:{type:String,default:""}}};const Cn={name:"ResponsiveWidthWrapper",data:function(){return{}}};[Kr,Xr,en,nn,an,cn,ln,pn,vn,gn,wn,xn,$n,(0,T.Z)(Ln,(function(){var t=this,e=t._self._c;return e("div",{staticClass:"options-header"},[e("responsive-width-wrapper",[e("div",{staticClass:"tabs is-centered is-fullwidth"},[e("ul",t._l(t.tabs,(function(r){return e("li",{key:r.view,class:{"is-active":r.view===t.activeTab}},[e("router-link",{attrs:{id:r.id,to:{name:r.view,params:{returnTo:t.$route.params.returnTo}}}},[t._v(t._s(r.name))])],1)})),0)])])],1)}),[],!1,null,null,null).exports,(0,T.Z)(Cn,(function(){var t=this._self._c;return t("div",{staticClass:"columns is-centered"},[t("div",{staticClass:"form-column column is-two-thirds-tablet is-half-desktop is-half-widescreen is-one-third-fullhd"},[this._t("default")],2)])}),[],!1,null,null,null).exports].forEach((function(t){n.default.component(t.name,t)})),n.default.use(zr());new n.default({el:"#app",data:{appSettings:window.appSettings,appConfig:window.appConfig,userPreferences:window.userPreferences,isDemoApp:window.isDemoApp,isTestingApp:window.isTestingApp,prefersDarkScheme:window.matchMedia("(prefers-color-scheme: dark)").matches,spinner:{active:!1,message:"loading"}},computed:{showDarkMode:function(){return"dark"==this.userPreferences.theme||"system"==this.userPreferences.theme&&this.prefersDarkScheme}},mounted:function(){var t=this;this.mediaQueryList=window.matchMedia("(prefers-color-scheme: dark)"),this.$nextTick((function(){t.mediaQueryList.addEventListener("change",t.setDarkScheme)}))},beforeDestroy:function(){this.mediaQueryList.removeEventListener("change",this.setDarkScheme)},methods:{setDarkScheme:function(t){var e=t.matches;this.prefersDarkScheme=e},showSpinner:function(t){this.spinner.message=t,this.spinner.active=!0},hideSpinner:function(){this.spinner.active=!1,this.spinner.message="loading"}},i18n:c,router:jr})},198:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(519),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".spinner-container[data-v-a80773f6]{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;text-align:center;top:0;z-index:10000}.spinner[data-v-a80773f6]{display:block}",""]);const i=o},673:(t,e,r)=>{r.d(e,{Z:()=>i});var n=r(519),o=r.n(n)()((function(t){return t[1]}));o.push([t.id,".flip-list-move{transition:transform .5s}.ghost{opacity:1}",""]);const i=o},609:()=>{}},t=>{var e=e=>t(t.s=e);t.O(0,[170,898],(()=>(e(184),e(609))));t.O()}]);