(self.webpackChunkapp=self.webpackChunkapp||[]).push([[9064],{89565:(h,c,s)=>{s.d(c,{p:()=>u});var n=s(15861),y=s(2461);const t=(0,y.fo)("App",{web:()=>s.e(6622).then(s.bind(s,6622)).then(m=>new m.AppWeb)});var d=s(47394);class u extends y.Uw{authenticate(l){var e=this;return(0,n.Z)(function*(){try{yield e.internalAuthenticate(l)}catch(r){throw r instanceof y.xz?new d.AB(r.message,r.code):r}})()}addResumeListener(l){var e=this;return(0,n.Z)(function*(){return t.addListener("appStateChange",({isActive:r})=>{r&&e.checkBiometry().then(i=>{l(i)}).catch(console.error)})})()}}},29064:(h,c,s)=>{s.r(c),s.d(c,{BiometricAuthWeb:()=>u});var n=s(15861),y=s(89565),t=s(47394),d=s(6371);class u extends y.p{constructor(){super(...arguments),this.biometryType=t.dz.none,this.biometryTypes=[],this.biometryIsEnrolled=!1,this.deviceIsSecure=!1}checkBiometry(){var e=this;return(0,n.Z)(function*(){const r=e.biometryType!==t.dz.none;let o="",a=t.Ds.none;return r?e.biometryIsEnrolled||(o="Biometry is not enrolled",a=t.Ds.biometryNotEnrolled):(o="No biometry is available",a=t.Ds.biometryNotAvailable),Promise.resolve({isAvailable:r&&e.biometryIsEnrolled,strongBiometryIsAvailable:e.biometryIsEnrolled&&e.hasStrongBiometry(),biometryType:e.biometryType,biometryTypes:e.biometryTypes,deviceIsSecure:e.deviceIsSecure,reason:o,code:a})})()}hasStrongBiometry(){return this.biometryTypes.some(e=>e===t.dz.faceId||e===t.dz.touchId||e===t.dz.fingerprintAuthentication)}internalAuthenticate(e){var r=this;return(0,n.Z)(function*(){const i=yield r.checkBiometry();if(!i.isAvailable||!confirm(e?.reason||`Authenticate with ${i.biometryTypes.map(o=>(0,d.S)(o)).join(" or ")}?`)){if(e?.allowDeviceCredential){if(i.deviceIsSecure){if(confirm("Authenticate with device security?"))return;throw new t.AB("User cancelled",t.Ds.userCancel)}if(i.isAvailable)throw new t.AB("Device is not secure",t.Ds.noDeviceCredential)}else if(!i.isAvailable)throw i.biometryType===t.dz.none?new t.AB("Biometry is not available",t.Ds.biometryNotAvailable):new t.AB("Biometry is not enrolled",t.Ds.biometryNotEnrolled);throw new t.AB("User cancelled",t.Ds.userCancel)}})()}setBiometryType(e){var r=this;return(0,n.Z)(function*(){if(void 0===e)return Promise.resolve();const i=Array.isArray(e)?e:[e];if(r.biometryTypes=[],r.biometryType=t.dz.none,0===i.length)return Promise.resolve();if(function m(l){return Object.values(t.dz).includes(l[0])}(i))r.biometryType=i[0],r.biometryType!==t.dz.none&&(r.biometryTypes=i);else for(let o=0;o<i.length;o++)if(t.dz.hasOwnProperty(i[o])){const a=t.dz[i[o]];r.biometryType===t.dz.none?r.biometryTypes=[]:r.biometryTypes.push(a),0===o&&(r.biometryType=a)}return Promise.resolve()})()}setBiometryIsEnrolled(e){var r=this;return(0,n.Z)(function*(){return r.biometryIsEnrolled=e,Promise.resolve()})()}setDeviceIsSecure(e){var r=this;return(0,n.Z)(function*(){return r.deviceIsSecure=e,Promise.resolve()})()}}}}]);