!function(t){vare={};functionn(r){if(e[r])returne[r].exports;varo=e[r]={i:r,l:!1,exports:{}};returnt[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeofSymbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)returnt;if(4&e&&"object"==typeoft&&t&&t.__esModule)returnt;varr=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeoft)for(varoint)n.d(r,o,function(e){returnt[e]}.bind(null,o));returnr},n.n=function(t){vare=t&&t.__esModule?function(){returnt.default}:function(){returnt};returnn.d(e,"a",e),e},n.o=function(t,e){returnObject.prototype.hasOwnProperty.call(t,e)},n.p="/js/",n(n.s=579)}([function(t,e,n){(function(e){varn=function(t){returnt&&t.Math==Math&&t};t.exports=n("object"==typeofglobalThis&&globalThis)||n("object"==typeofwindow&&window)||n("object"==typeofself&&self)||n("object"==typeofe&&e)||function(){returnthis}()||Function("return this")()}).call(this,n(9))},function(t,e,n){varr=n(0),o=n(25).f,i=n(15),a=n(16),s=n(54),l=n(113),u=n(82);t.exports=function(t,e){varn,c,p,f,A,d=t.target,h=t.global,g=t.stat;if(n=h?r:g?r[d]||s(d,{}):(r[d]||{}).prototype)for(cine){if(f=e[c],p=t.noTargetGet?(A=o(n,c))&&A.value:n[c],!u(h?c:d+(g?".":"#")+c,t.forced)&&void0!==p){if(typeoff==typeofp)continue;l(f,p)}(t.sham||p&&p.sham)&&i(f,"sham",!0),a(n,c,f,t)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){varr=n(0),o=n(43),i=n(5),a=n(64),s=n(65),l=n(116),u=o("wks"),c=r.Symbol,p=l?c:c&&c.withoutSetter||a;t.exports=function(t){returni(u,t)&&(s||"string"==typeofu[t])||(s&&i(c,t)?u[t]=c[t]:u[t]=p("Symbol."+t)),u[t]}},function(t,e,n){varr=n(7);t.exports=function(t){if(!r(t))throwTypeError(String(t)+" is not an object");returnt}},function(t,e,n){varr=n(14),o={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){returno.call(r(t),e)}},function(t,e,n){varr=n(2);t.exports=!r((function(){return7!=Object.defineProperty({},1,{get:function(){return7}})[1]}))},function(t,e){t.exports=function(t){return"object"==typeoft?null!==t:"function"==typeoft}},function(t,e,n){"use strict";varr=n(138),o=Object.prototype.toString;functioni(t){return"[object Array]"===o.call(t)}functiona(t){returnvoid0===t}functions(t){returnnull!==t&&"object"==typeoft}functionl(t){if("[object Object]"!==o.call(t))return!1;vare=Object.getPrototypeOf(t);returnnull===e||e===Object.prototype}functionu(t){return"[object Function]"===o.call(t)}functionc(t,e){if(null!=t)if("object"!=typeoft&&(t=[t]),i(t))for(varn=0,r=t.length;n<r;n++)e.call(null,t[n],n,t);elsefor(varoint)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}t.exports={isArray:i,isArrayBuffer:function(t){return"[object ArrayBuffer]"===o.call(t)},isBuffer:function(t){returnnull!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"==typeoft.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return"undefined"!=typeofFormData&&tinstanceofFormData},isArrayBufferView:function(t){return"undefined"!=typeofArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.bufferinstanceofArrayBuffer},isString:function(t){return"string"==typeoft},isNumber:function(t){return"number"==typeoft},isObject:s,isPlainObject:l,isUndefined:a,isDate:function(t){return"[object Date]"===o.call(t)},isFile:function(t){return"[object File]"===o.call(t)},isBlob:function(t){return"[object Blob]"===o.call(t)},isFunction:u,isStream:function(t){returns(t)&&u(t.pipe)},isURLSearchParams:function(t){return"undefined"!=typeofURLSearchParams&&tinstanceofURLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeofnavigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeofwindow&&"undefined"!=typeofdocument
varn="undefined"!=typeofwindow&&"undefined"!=typeofdocument&&"undefined"!=typeofnavigator,r=function(){for(vart=["Edge","Trident","Firefox"],e=0;e<t.length;e+=1)if(n&&navigator.userAgent.indexOf(t[e])>=0)return1;return0}();varo=n&&window.Promise?function(t){vare=!1;returnfunction(){e||(e=!0,window.Promise.resolve().then((function(){e=!1,t()})))}}:function(t){vare=!1;returnfunction(){e||(e=!0,setTimeout((function(){e=!1,t()}),r))}};functioni(t){returnt&&"[object Function]"==={}.toString.call(t)}functiona(t,e){if(1!==t.nodeType)return[];varn=t.ownerDocument.defaultView.getComputedStyle(t,null);returne?n[e]:n}functions(t){return"HTML"===t.nodeName?t:t.parentNode||t.host}functionl(t){if(!t)returndocument.body;switch(t.nodeName){case"HTML":case"BODY":returnt.ownerDocument.body;case"#document":returnt.body}vare=a(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return/(auto|scroll|overlay)/.test(n+o+r)?t:l(s(t))}functionu(t){returnt&&t.referenceNode?t.referenceNode:t}varc=n&&!(!window.MSInputMethodContext||!document.documentMode),p=n&&/MSIE 10/.test(navigator.userAgent);functionf(t){return11===t?c:10===t?p:c||p}functionA(t){if(!t)returndocument.documentElement;for(vare=f(10)?document.body:null,n=t.offsetParent||null;n===e&&t.nextElementSibling;)n=(t=t.nextElementSibling).offsetParent;varr=n&&n.nodeName;returnr&&"BODY"!==r&&"HTML"!==r?-1!==["TH","TD","TABLE"].indexOf(n.nodeName)&&"static"===a(n,"position")?A(n):n:t?t.ownerDocument.documentElement:document.documentElement}functiond(t){returnnull!==t.parentNode?d(t.parentNode):t}functionh(t,e){if(!(t&&t.nodeType&&e&&e.nodeType))returndocument.documentElement;varn=t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_FOLLOWING,r=n?t:e,o=n?e:t,i=document.createRange();i.setStart(r,0),i.setEnd(o,0);vara,s,l=i.commonAncestorContainer;if(t!==l&&e!==l||r.contains(o))return"BODY"===(s=(a=l).nodeName)||"HTML"!==s&&A(a.firstElementChild)!==a?A(l):l;varu=d(t);returnu.host?h(u.host,e):h(t,d(e).host)}functiong(t){vare=arguments.length>1&&void0!==arguments[1]?arguments[1]:"top",n="top"===e?"scrollTop":"scrollLeft",r=t.nodeName;if("BODY"===r||"HTML"===r){varo=t.ownerDocument.documentElement,i=t.ownerDocument.scrollingElement||o;returni[n]}returnt[n]}functionv(t,e){varn=arguments.length>2&&void0!==arguments[2]&&arguments[2],r=g(e,"top"),o=g(e,"left"),i=n?-1:1;returnt.top+=r*i,t.bottom+=r*i,t.left+=o*i,t.right+=o*i,t}functionm(t,e){varn="x"===e?"Left":"Top",r="Left"===n?"Right":"Bottom";returnparseFloat(t["border"+n+"Width"])+parseFloat(t["border"+r+"Width"])}functiony(t,e,n,r){returnMath.max(e["offset"+t],e["scroll"+t],n["client"+t],n["offset"+t],n["scroll"+t],f(10)?parseInt(n["offset"+t])+parseInt(r["margin"+("Height"===t?"Top":"Left")])+parseInt(r["margin"+("Height"===t?"Bottom":"Right")]):0)}functionb(t){vare=t.body,n=t.documentElement,r=f(10)&&getComputedStyle(n);return{height:y("Height",e,n,r),width:y("Width",e,n,r)}}varx=function(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")},w=function(){functiont(t,e){for(varn=0;n<e.length;n++){varr=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}returnfunction(e,n,r){returnn&&t(e.prototype,n),r&&t(e,r),e}}(),C=function(t,e,n){returneint?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},E=Object.assign||function(t){for(vare=1;e<arguments.length;e++){varn=arguments[e];for(varrinn)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}returnt};functionS(t){returnE({},t,{right:t.left+t.width,bottom:t.top+t.height})}functionT(t){vare={};try{if(f(10)){e=t.getBoundingClientRect();varn=g(t,"top"),r=g(t,"left");e.top+=n,e.left+=r,e.bottom+=n,e.right+=r}elsee=t.getBoundingClientRect()}catch(t){}varo={left:e.left,top:e.top,width:e.right-e.left,height:e.bottom-e.top},i="HTML"===t.nodeName?b(t.ownerDocument):{},s=i.width||t.clientWidth||o.width,l=i.height||t.clientHeight||o.height,u=t.offsetWidth-s,c=t.offsetHeight-l;if(u||c){varp=a(t);u-=m(p,"x"),c-
returnasyncfunction(){constt=Object(d.generateUrl)("/settings/api/personal/webauthn/registration");return(awaitA.a.get(t)).data}().then(t=>(console.debug(t),t.challenge=Uint8Array.from(function(t){conste=(t=t.replace(/-/g,"+").replace(/_/g,"/")).length%4;if(e){if(1===e)thrownewError("InvalidLengthError: Input base64url string is the wrong length to determine padding");t+=newArray(5-e).join("=")}returnwindow.atob(t)}(t.challenge),t=>t.charCodeAt(0)),t.user.id=Uint8Array.from(t.user.id,t=>t.charCodeAt(0)),t)).catch(e=>{throwconsole.error("Error getting webauthn registration data from server",e),newError(t("settings","Server error while trying to add WebAuthn device"))})},register(t){returnconsole.debug("starting webauthn registration"),navigator.credentials.create({publicKey:t}).then(t=>{this.credential={id:t.id,type:t.type,rawId:this.arrayToBase64String(newUint8Array(t.rawId)),response:{clientDataJSON:this.arrayToBase64String(newUint8Array(t.response.clientDataJSON)),attestationObject:this.arrayToBase64String(newUint8Array(t.response.attestationObject))}}})},submit(){returnthis.step=g.PERSIST,s()().then(h("confirmed password")).then(this.saveRegistrationData).then(h("registration data saved")).then(()=>this.reset()).then(h("app reset")).catch(console.error.bind(this))},asyncsaveRegistrationData(){try{constt=awaitasyncfunction(t,e){constn=Object(d.generateUrl)("/settings/api/personal/webauthn/registration");return(awaitA.a.post(n,{name:t,data:e})).data}(this.name,JSON.stringify(this.credential));p.info("new device added",{device:t}),this.$emit("added",t)}catch(e){throwp.error("Error persisting webauthn registration",{error:e}),newError(t("settings","Server error while trying to complete WebAuthn device registration"))}},reset(){this.name="",this.registrationData={},this.step=g.READY}}},m=r(71),y=r.n(m),b=r(451),x={insert:"head",singleton:!1},w=(y()(b.a,x),b.a.locals,r(41)),C=Object(w.a)(v,(function(){vart=this,e=t.$createElement,n=t._self._c||e;returnt.isHttps?n("div",[t.step===t.RegistrationSteps.READY?n("div",[n("button",{on:{click:t.start}},[t._v("\n\t\t\t"+t._s(t.t("settings","Add WebAuthn device"))+"\n\t\t")])]):t.step===t.RegistrationSteps.REGISTRATION?n("div",{staticClass:"new-webauthn-device"},[n("span",{staticClass:"icon-loading-small webauthn-loading"}),t._v("\n\t\t"+t._s(t.t("settings","Please authorize your WebAuthn device."))+"\n\t")]):t.step===t.RegistrationSteps.NAMING?n("div",{staticClass:"new-webauthn-device"},[n("span",{staticClass:"icon-loading-small webauthn-loading"}),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.name,expression:"name"}],attrs:{type:"text",placeholder:t.t("settings","Name your device")},domProps:{value:t.name},on:{":keyup":function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.submit(e)},input:function(e){e.target.composing||(t.name=e.target.value)}}}),t._v(" "),n("button",{on:{click:t.submit}},[t._v("\n\t\t\t"+t._s(t.t("settings","Add"))+"\n\t\t")])]):t.step===t.RegistrationSteps.PERSIST?n("div",{staticClass:"new-webauthn-device"},[n("span",{staticClass:"icon-loading-small webauthn-loading"}),t._v("\n\t\t"+t._s(t.t("settings","Adding your device …"))+"\n\t")]):n("div",[t._v("\n\t\tInvalid registration step. This should not have happened.\n\t")])]):n("div",[t._v("\n\t"+t._s(t.t("settings","Passwordless authentication requires a secure connection."))+"\n")])}),[],!1,null,"35971b5e",null).exports,E=r(455),S=r.n(E),T=r(454),I={name:"Device",components:{ActionButton:r.n(T).a,Actions:S.a},props:{name:{type:String,required:!0}}},_=r(452),B={insert:"head",singleton:!1},O=(y()(_.a,B),_.a.locals,Object(w.a)(I,(function(){vart=this,e=t.$createElement,n=t._self._c||e;returnn("div",{staticClass:"webauthn-device"},[n("span",{staticClass:"icon-webauthn-device"}),t._v("\n\t"+t._s(t.name||t.t("settings","Unnamed device"))+"\n\t"),n("Actions",{attrs:{"force-menu":!0}},[n("ActionButton",{attrs:{icon:"icon-delete"},on:{click:function(e){returnt.$emit("delete")}}},[t._v("\n\t\t\t"+t._s(t.t("settings","Delete"))+"