1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9987],{41162:function(e,t,n){let o={},i={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),o[e]=t,i[t]=e}},28364:function(e,t,n){n.d(t,{f:function(){return d}});var o=n(5853),i=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),r=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],s=function(){function e(){this.state=Int32Array.from(r),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return e.prototype.update=function(e){if(this.finished)throw Error("Attempted to update an already finished hash.");var t=0,n=e.byteLength;if(this.bytesHashed+=n,8*this.bytesHashed>9007199254740991)throw Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[t++],n--,64===this.bufferLength&&(this.hashBuffer(),this.bufferLength=0)},e.prototype.digest=function(){if(!this.finished){var e=8*this.bytesHashed,t=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(t.setUint8(this.bufferLength++,128),n%64>=56){for(var o=this.bufferLength;o<64;o++)t.setUint8(o,0);this.hashBuffer(),this.bufferLength=0}for(var o=this.bufferLength;o<56;o++)t.setUint8(o,0);t.setUint32(56,Math.floor(e/4294967296),!0),t.setUint32(60,e),this.hashBuffer(),this.finished=!0}for(var i=new Uint8Array(32),o=0;o<8;o++)i[4*o]=this.state[o]>>>24&255,i[4*o+1]=this.state[o]>>>16&255,i[4*o+2]=this.state[o]>>>8&255,i[4*o+3]=this.state[o]>>>0&255;return i},e.prototype.hashBuffer=function(){for(var e=this.buffer,t=this.state,n=t[0],o=t[1],r=t[2],s=t[3],a=t[4],c=t[5],u=t[6],d=t[7],l=0;l<64;l++){if(l<16)this.temp[l]=(255&e[4*l])<<24|(255&e[4*l+1])<<16|(255&e[4*l+2])<<8|255&e[4*l+3];else{var p=this.temp[l-2],h=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,g=((p=this.temp[l-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;this.temp[l]=(h+this.temp[l-7]|0)+(g+this.temp[l-16]|0)}var E=(((a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7))+(a&c^~a&u)|0)+(d+(i[l]+this.temp[l]|0)|0)|0,f=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&r^o&r)|0;d=u,u=c,c=a,a=s+E|0,s=r,r=o,o=n,n=E+f|0}t[0]+=n,t[1]+=o,t[2]+=r,t[3]+=s,t[4]+=a,t[5]+=c,t[6]+=u,t[7]+=d},e}(),a=n(82957).lW,c=void 0!==a&&a.from?function(e){return a.from(e,"utf8")}:e=>new TextEncoder().encode(e);function u(e){return e instanceof Uint8Array?e:"string"==typeof e?c(e):ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(e)}var d=function(){function e(e){this.secret=e,this.hash=new s,this.reset()}return e.prototype.update=function(e){if(("string"==typeof e?0!==e.length:0!==e.byteLength)&&!this.error)try{this.hash.update(u(e))}catch(e){this.error=e}},e.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},e.prototype.digest=function(){return(0,o.mG)(this,void 0,void 0,function(){return(0,o.Jh)(this,function(e){return[2,this.digestSync()]})})},e.prototype.reset=function(){if(this.hash=new s,this.secret){this.outer=new s;var e=function(e){var t=u(e);if(t.byteLength>64){var n=new s;n.update(t),t=n.digest()}var o=new Uint8Array(64);return o.set(t),o}(this.secret),t=new Uint8Array(64);t.set(e);for(var n=0;n<64;n++)e[n]^=54,t[n]^=92;this.hash.update(e),this.outer.update(t);for(var n=0;n<e.byteLength;n++)e[n]=0}},e}()},95377:function(e,t,n){n.d(t,{h:function(){return h}});var o=n(85230),i=n(6801),r=n(5270);n(28364);var s=n(66388),a=n(31901),c=n(99388),u=n(83977),d=n(52886),l=n(17650),p=n(69954);async function h({username:e,password:t,clientMetadata:n,config:h,tokenOrchestrator:g,authFlow:E,preferredChallenge:f}){let{userPoolId:m,userPoolClientId:y,userPoolEndpoint:I}=h,S=m?.split("_")[1]||"",x=await (0,r.d)(S),v={USERNAME:e,SRP_A:x.A.toString(16)};"USER_AUTH"===E&&f&&(v.PREFERRED_CHALLENGE=f);let w=(0,i.u)({username:e,userPoolId:m,userPoolClientId:y}),A=(0,s.N)({endpointResolver:(0,a.e)({endpointOverride:I})}),C=await A({region:(0,c.y)(m),userAgentValue:(0,u.W)(o.g4.SignIn)},{AuthFlow:E,AuthParameters:v,ClientMetadata:n,ClientId:y,UserContextData:w}),{ChallengeParameters:R,Session:P}=C,T=R?.USERNAME??e;return((0,p.r)(T),"PASSWORD_VERIFIER"===C.ChallengeName)?(0,l.H)(d.i,[t,R,n,P,x,h,g],T,g):C}},25280:function(e,t,n){var o;let i;function r(){return{active:!1}}n.d(t,{E:function(){return s}});let s=(i=(o=(e,t)=>{switch(t.type){case"SET_USERNAME":return{...e,username:t.value};case"SET_SESSION":return{...e,session:t.value};case"START":return{...e,active:!0};case"RESET":return r();default:return e}})(r(),{type:"RESET"}),{getState:()=>i,dispatch:e=>{i=o(i,e)}})},54501:function(e,t,n){let o;n.d(t,{fZ:function(){return u},k4:function(){return g},signInStore:function(){return h}});var i,r=n(12876);let s="CognitoSignInState",a={username:`${s}.username`,challengeName:`${s}.challengeName`,signInSession:`${s}.signInSession`,expiry:`${s}.expiry`},c=e=>Number(e)<=Date.now(),u=()=>{h.dispatch({type:"RESET_STATE"})},d=()=>{for(let e of Object.values(a))r.$2.removeItem(e)},l=()=>({username:void 0,challengeName:void 0,signInSession:void 0}),p=()=>{let e=r.$2.getItem(a.expiry);return!e||c(e)?(d(),l()):{username:r.$2.getItem(a.username)??void 0,challengeName:r.$2.getItem(a.challengeName)??void 0,signInSession:r.$2.getItem(a.signInSession)??void 0}},h=(o=(i=(e,t)=>{switch(t.type){case"SET_SIGN_IN_SESSION":return E({signInSession:t.value}),{...e,signInSession:t.value};case"SET_SIGN_IN_STATE":return E(t.value),{...t.value};case"SET_CHALLENGE_NAME":return E({challengeName:t.value}),{...e,challengeName:t.value};case"SET_USERNAME":return E({username:t.value}),{...e,username:t.value};case"SET_INITIAL_STATE":return p();case"RESET_STATE":return d(),l();default:return e}})(l(),{type:"SET_INITIAL_STATE"}
1),{getState:()=>o,dispatch:e=>{o=i(o,e)}});function g(e){h.dispatch({type:"SET_SIGN_IN_STATE",value:e})}let E=({challengeName:e,signInSession:t,username:n})=>{n&&r.$2.setItem(a.username,n),e&&r.$2.setItem(a.challengeName,e),t&&(r.$2.setItem(a.signInSession,t),r.$2.setItem(a.expiry,String(Date.now()+18e4)))}},60117:function(e,t,n){n.d(t,{By:function(){return c},kq:function(){return s}});var o,i,r,s,a=n(39811);let c={[a.X.EmptyChallengeResponse]:{message:"challengeResponse is required to confirmSignIn"},[a.X.EmptyConfirmResetPasswordUsername]:{message:"username is required to confirmResetPassword"},[a.X.EmptyConfirmSignUpCode]:{message:"code is required to confirmSignUp"},[a.X.EmptyConfirmSignUpUsername]:{message:"username is required to confirmSignUp"},[a.X.EmptyConfirmResetPasswordConfirmationCode]:{message:"confirmationCode is required to confirmResetPassword"},[a.X.EmptyConfirmResetPasswordNewPassword]:{message:"newPassword is required to confirmResetPassword"},[a.X.EmptyResendSignUpCodeUsername]:{message:"username is required to confirmSignUp"},[a.X.EmptyResetPasswordUsername]:{message:"username is required to resetPassword"},[a.X.EmptySignInPassword]:{message:"password is required to signIn"},[a.X.EmptySignInUsername]:{message:"username is required to signIn"},[a.X.EmptySignUpPassword]:{message:"password is required to signUp"},[a.X.EmptySignUpUsername]:{message:"username is required to signUp"},[a.X.CustomAuthSignInPassword]:{message:"A password is not needed when signing in with CUSTOM_WITHOUT_SRP",recoverySuggestion:"Do not include a password in your signIn call."},[a.X.IncorrectMFAMethod]:{message:"Incorrect MFA method was chosen. It should be either SMS, TOTP, or EMAIL",recoverySuggestion:"Try to pass SMS, TOTP, or EMAIL as the challengeResponse"},[a.X.EmptyVerifyTOTPSetupCode]:{message:"code is required to verifyTotpSetup"},[a.X.EmptyUpdatePassword]:{message:"oldPassword and newPassword are required to changePassword"},[a.X.EmptyConfirmUserAttributeCode]:{message:"confirmation code is required to confirmUserAttribute"}};(o=r||(r={})).DEFAULT_MSG="Authentication Error",o.EMPTY_EMAIL="Email cannot be empty",o.EMPTY_PHONE="Phone number cannot be empty",o.EMPTY_USERNAME="Username cannot be empty",o.INVALID_USERNAME="The username should either be a string or one of the sign in types",o.EMPTY_PASSWORD="Password cannot be empty",o.EMPTY_CODE="Confirmation code cannot be empty",o.SIGN_UP_ERROR="Error creating account",o.NO_MFA="No valid MFA method provided",o.INVALID_MFA="Invalid MFA type",o.EMPTY_CHALLENGE="Challenge response cannot be empty",o.NO_USER_SESSION="Failed to get the session because the user is empty",o.NETWORK_ERROR="Network Error",o.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",o.AUTOSIGNIN_ERROR="Please use your credentials to sign in",o.OAUTH_ERROR="Couldn't finish OAuth flow, check your User Pool HostedUI settings",(i=s||(s={})).SignInException="SignInException",i.OAuthSignInError="OAuthSignInException"},57826:function(e,t,n){n.d(t,{l:function(){return i}});var o=n(75638);class i extends o._{constructor(e){super(e),this.constructor=i,Object.setPrototypeOf(this,i.prototype)}}},99075:function(e,t,n){n.d(t,{EU:function(){return r},Jg:function(){return i},MA:function(){return a},VL:function(){return d},hj:function(){return p},mP:function(){return s},sX:function(){return h},vC:function(){return c},wW:function(){return l},x9:function(){return u}});var o=n(57826);let i="UserUnAuthenticatedException",r="UserAlreadyAuthenticatedException",s="DeviceMetadataNotFoundException",a="AutoSignInException",c=new o.l({name:"InvalidRedirectException",message:"signInRedirect or signOutRedirect had an invalid format or was not found.",recoverySuggestion:"Please make sure the signIn/Out redirect in your oauth config is valid."});new o.l({name:"InvalidAppSchemeException",message:"A valid non-http app scheme was not found in the config.",recoverySuggestion:"Please make sure a valid custom app scheme is present in the config."});let u=new o.l({name:"InvalidPreferredRedirectUrlException",message:"The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.",recoverySuggestion:"Please make sure a matching preferredRedirectUrl is provided."}),d=new o.l({name:"InvalidOriginException",message:"redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin",recoverySuggestion:"Please call signInWithRedirect from the same origin."}),l="OAuthSignOutException",p="TokenRefreshException",h="UnexpectedSignInInterruptionException"},39811:function(e,t,n){var o,i;n.d(t,{X:function(){return o}}),(i=o||(o={})).EmptySignInUsername="EmptySignInUsername",i.EmptySignInPassword="EmptySignInPassword",i.CustomAuthSignInPassword="CustomAuthSignInPassword",i.EmptySignUpUsername="EmptySignUpUsername",i.EmptySignUpPassword="EmptySignUpPassword",i.EmptyConfirmSignUpUsername="EmptyConfirmSignUpUsername",i.EmptyConfirmSignUpCode="EmptyConfirmSignUpCode",i.EmptyResendSignUpCodeUsername="EmptyresendSignUpCodeUsername",i.EmptyChallengeResponse="EmptyChallengeResponse",i.EmptyConfirmResetPasswordUsername="EmptyConfirmResetPasswordUsername",i.EmptyConfirmResetPasswordNewPassword="EmptyConfirmResetPasswordNewPassword",i.EmptyConfirmResetPasswordConfirmationCode="EmptyConfirmResetPasswordConfirmationCode",i.EmptyResetPasswordUsername="EmptyResetPasswordUsername",i.EmptyVerifyTOTPSetupCode="EmptyVerifyTOTPSetupCode",i.EmptyConfirmUserAttributeCode="EmptyConfirmUserAttributeCode",i.IncorrectMFAMethod="IncorrectMFAMethod",i.EmptyUpdatePassword="EmptyUpdatePassword"},45473:function(e,t,n){n.d(t,{R:function(){return r}});var o=n(37701),i=n(57826);function r(e){if(!e||"Error"===e.name||e instanceof TypeError)throw new i.l({name:o.Z.Unknown,message:"An unknown error has occurred.",underlyingError:e})}},32002:function(e,t,n){n.d(t,{n:function(){return r}});var o=n(60117),i=n(57826);function r(e,t){let{message:n,recoverySuggestion:r}=o.By[t];if(!e)throw new i.l({name:t,message:n,recoverySuggestion:r})}},58249:function(e,t,n){n.d(t,{t:function(){return o}});let o="cognito-idp"},36168:function(e,t,n){n.d(t,{n:function(){return a}});var o=n(12221),i=n(48880),r=n(37487),s=n(52954);let a={service:n(58249).t,retryDecider:(0,o.j)(i.f),computeDelay:r.k,userAgentValue:(0,s.Zm)(),c
1ache:"no-store"}},66388:function(e,t,n){n.d(t,{N:function(){return c}});var o=n(91742),i=n(5048),r=n(7107),s=n(83468),a=n(36168);let c=e=>(0,o.z)(s.x,(0,i.u)("InitiateAuth"),(0,r.o)(),{...a.n,...e})},43773:function(e,t,n){n.d(t,{u:function(){return c}});var o=n(91742),i=n(83468),r=n(5048),s=n(7107),a=n(36168);let c=e=>(0,o.z)(i.x,(0,r.u)("RespondToAuthChallenge"),(0,s.o)(),{...a.n,...e})},83468:function(e,t,n){n.d(t,{x:function(){return r}});var o=n(48146),i=n(96526);let r=(0,o.V)(i.y,[()=>(e,t)=>async function(t){return t.headers["cache-control"]="no-store",e(t)}])},7107:function(e,t,n){n.d(t,{o:function(){return s}});var o=n(48880),i=n(45473),r=n(57826);let s=()=>async e=>{if(e.statusCode>=300){let t=await (0,o.f)(e);throw(0,i.R)(t),new r.l({name:t.name,message:t.message})}return(0,o.e)(e)}},5048:function(e,t,n){n.d(t,{u:function(){return o}});let o=e=>(t,n)=>r(n,i(e),JSON.stringify(t)),i=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityProviderService.${e}`}),r=({url:e},t,n)=>({headers:t,url:e,body:n,method:"POST"})},99388:function(e,t,n){n.d(t,{N:function(){return r},y:function(){return i}});var o=n(57826);function i(e){let t=e?.split("_")[0];if(!e||0>e.indexOf("_")||!t||"string"!=typeof t)throw new o.l({name:"InvalidUserPoolId",message:"Invalid user pool id provided."});return t}function r(e){if(!e||!e.includes(":"))throw new o.l({name:"InvalidIdentityPoolIdException",message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."});return e.split(":")[0]}},57386:function(e,t,n){n.d(t,{Dv:function(){return r},I:function(){return i}});var o=n(25280);function i(e){}function r(e=!0){o.E.dispatch({type:"RESET"})}n(57826),n(99075)},5660:function(e,t,n){n.d(t,{f:function(){return y}});var o=n(79722),i=n(87433),r=n(85230),s=n(39811),a=n(32002),c=n(83977),u=n(6801),d=n(91742),l=n(83468),p=n(5048),h=n(7107),g=n(36168);let E=e=>(0,d.z)(l.x,(0,p.u)("ConfirmForgotPassword"),(0,h.o)(),{...g.n,...e});var f=n(31901),m=n(99388);async function y(e){let t=o.d.getConfig().Auth?.Cognito;(0,i.FG)(t);let{userPoolClientId:n,userPoolId:d,userPoolEndpoint:l}=t,{username:p,newPassword:h}=e;(0,a.n)(!!p,s.X.EmptyConfirmResetPasswordUsername),(0,a.n)(!!h,s.X.EmptyConfirmResetPasswordNewPassword);let g=e.confirmationCode;(0,a.n)(!!g,s.X.EmptyConfirmResetPasswordConfirmationCode);let y=e.options?.clientMetadata,I=(0,u.u)({username:p,userPoolId:d,userPoolClientId:n}),S=E({endpointResolver:(0,f.e)({endpointOverride:l})});await S({region:(0,m.y)(t.userPoolId),userAgentValue:(0,c.W)(r.g4.ConfirmResetPassword)},{Username:p,ConfirmationCode:g,Password:h,ClientMetadata:y,ClientId:t.userPoolClientId,UserContextData:I})}},58751:function(e,t,n){n.d(t,{_:function(){return x}});var o=n(79722),i=n(87433),r=n(85230),s=n(85871),a=n(32002),c=n(39811),u=n(99388),d=n(83977),l=n(6801),p=n(91742),h=n(36168),g=n(83468),E=n(5048),f=n(7107);let m=e=>(0,p.z)(g.x,(0,E.u)("ConfirmSignUp"),(0,f.o)(),{...h.n,...e});var y=n(31901),I=n(25280),S=n(57386);async function x(e){let{username:t,confirmationCode:n,options:p}=e,h=o.d.getConfig().Auth?.Cognito;(0,i.FG)(h);let{userPoolId:g,userPoolClientId:E,userPoolEndpoint:f}=h,x=p?.clientMetadata;(0,a.n)(!!t,c.X.EmptyConfirmSignUpUsername),(0,a.n)(!!n,c.X.EmptyConfirmSignUpCode);let v=(0,l.u)({username:t,userPoolId:g,userPoolClientId:E}),w=m({endpointResolver:(0,y.e)({endpointOverride:f})}),{Session:A}=await w({region:(0,u.y)(h.userPoolId),userAgentValue:(0,d.W)(r.g4.ConfirmSignUp)},{Username:t,ConfirmationCode:n,ClientMetadata:x,ForceAliasCreation:p?.forceAliasCreation,ClientId:h.userPoolClientId,UserContextData:v});return new Promise((e,n)=>{try{let n={isSignUpComplete:!0,nextStep:{signUpStep:"DONE"}},o=I.E.getState();if(!o.active||o.username!==t){e(n),(0,S.Dv)();return}I.E.dispatch({type:"SET_SESSION",value:A});let i=s.qC.listen("auth-internal",({payload:t})=>{"autoSignIn"===t.event&&(e({isSignUpComplete:!0,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN"}}),i())});s.qC.dispatch("auth-internal",{event:"confirmSignUp",data:n})}catch(e){n(e)}})}},71926:function(e,t,n){n.d(t,{v:function(){return I}});var o=n(79722),i=n(87433),r=n(77116),s=n(85230),a=n(99388),c=n(34168),u=n(99189),d=n(83977),l=n(91742),p=n(83468),h=n(5048),g=n(7107),E=n(36168);let f=e=>(0,l.z)(p.x,(0,h.u)("GetUser"),(0,g.o)(),{...E.n,...e});var m=n(31901);let y=async e=>{let t=e.getConfig().Auth?.Cognito;(0,i.FG)(t);let{userPoolEndpoint:n,userPoolId:o}=t,{tokens:l}=await (0,r.y)(e,{forceRefresh:!1});(0,c.CA)(l);let p=f({endpointResolver:(0,m.e)({endpointOverride:n})}),{UserAttributes:h}=await p({region:(0,a.y)(o),userAgentValue:(0,d.W)(s.g4.FetchUserAttributes)},{AccessToken:l.accessToken.toString()});return(0,u.R)(h)},I=()=>y(o.d)},23318:function(e,t,n){n.d(t,{t:function(){return a}});var o=n(79722),i=n(87433),r=n(34168);let s=async e=>{let t=e.getConfig().Auth?.Cognito;(0,i.FG)(t);let n=await e.Auth.getTokens({forceRefresh:!1});(0,r.CA)(n);let{"cognito:username":o,sub:s}=n.idToken?.payload??{},a={username:o,userId:s}
1,c=n?.signInDetails;return c&&(a.signInDetails=c),a},a=async()=>s(o.d)},35017:function(e,t,n){n.d(t,{T:function(){return y}});var o=n(79722),i=n(87433),r=n(85230),s=n(32002),a=n(39811),c=n(99388),u=n(83977),d=n(6801),l=n(91742),p=n(83468),h=n(5048),g=n(7107),E=n(36168);let f=e=>(0,l.z)(p.x,(0,h.u)("ResendConfirmationCode"),(0,g.o)(),{...E.n,...e});var m=n(31901);async function y(e){let{username:t}=e;(0,s.n)(!!t,a.X.EmptySignUpUsername);let n=o.d.getConfig().Auth?.Cognito;(0,i.FG)(n);let{userPoolClientId:l,userPoolId:p,userPoolEndpoint:h}=n,g=e.options?.clientMetadata,E=(0,d.u)({username:t,userPoolId:p,userPoolClientId:l}),y=f({endpointResolver:(0,m.e)({endpointOverride:h})}),{CodeDeliveryDetails:I}=await y({region:(0,c.y)(n.userPoolId),userAgentValue:(0,u.W)(r.g4.ResendSignUpCode)},{Username:t,ClientMetadata:g,ClientId:n.userPoolClientId,UserContextData:E}),{DeliveryMedium:S,AttributeName:x,Destination:v}={...I};return{destination:v,deliveryMedium:S,attributeName:x||void 0}}},27215:function(e,t,n){n.d(t,{c:function(){return y}});var o=n(79722),i=n(87433),r=n(85230),s=n(39811),a=n(32002),c=n(99388),u=n(83977),d=n(6801),l=n(91742),p=n(83468),h=n(5048),g=n(7107),E=n(36168);let f=e=>(0,l.z)(p.x,(0,h.u)("ForgotPassword"),(0,g.o)(),{...E.n,...e});var m=n(31901);async function y(e){let{username:t}=e;(0,a.n)(!!t,s.X.EmptyResetPasswordUsername);let n=o.d.getConfig().Auth?.Cognito;(0,i.FG)(n);let{userPoolClientId:l,userPoolId:p,userPoolEndpoint:h}=n,g=e.options?.clientMetadata,E=(0,d.u)({username:t,userPoolId:p,userPoolClientId:l}),y=f({endpointResolver:(0,m.e)({endpointOverride:h})}),I=(await y({region:(0,c.y)(p),userAgentValue:(0,u.W)(r.g4.ResetPassword)},{Username:t,ClientMetadata:g,ClientId:l,UserContextData:E})).CodeDeliveryDetails;return{isPasswordReset:!1,nextStep:{resetPasswordStep:"CONFIRM_RESET_PASSWORD_WITH_CODE",codeDeliveryDetails:{deliveryMedium:I?.DeliveryMedium,destination:I?.Destination,attributeName:I?.AttributeName}}}}},91727:function(e,t,n){n.d(t,{z:function(){return x}});var o=n(9583),i=n(79722),r=n(87433),s=n(39811),a=n(32002),c=n(45473),u=n(54501),d=n(12249),l=n(74567),p=n(85777),h=n(17650),g=n(67455);async function E(e){let t=i.d.getConfig().Auth?.Cognito;(0,r.FG)(t);let{username:n,password:E,options:f}=e,m={loginId:n,authFlowType:"CUSTOM_WITHOUT_SRP"},y=f?.clientMetadata;(0,a.n)(!!n,s.X.EmptySignInUsername),(0,a.n)(!E,s.X.CustomAuthSignInPassword);try{let{ChallengeName:e,ChallengeParameters:i,AuthenticationResult:r,Session:s}=await (0,h.H)(o.pB,[n,y,t,l.C],n,l.C),a=(0,o.QS)(n);if((0,u.k4)({signInSession:s,username:a,challengeName:e,signInDetails:m}),r)return await (0,d.x)({username:a,...r,NewDeviceMetadata:await (0,g.F)({userPoolId:t.userPoolId,userPoolEndpoint:t.userPoolEndpoint,newDeviceMetadata:r.NewDeviceMetadata,accessToken:r.AccessToken}),signInDetails:m}),(0,u.fZ)(),await (0,p.O)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};return(0,o.cP)({challengeName:e,challengeParameters:i})}catch(t){(0,u.fZ)(),(0,c.R)(t);let e=(0,o.yM)(t.name);if(e)return e;throw t}}async function f(e){let{username:t,password:n,options:h}=e,E={loginId:t,authFlowType:"CUSTOM_WITH_SRP"},f=i.d.getConfig().Auth?.Cognito;(0,r.FG)(f);let m=h?.clientMetadata;(0,a.n)(!!t,s.X.EmptySignInUsername),(0,a.n)(!!n,s.X.EmptySignInPassword);try{let{ChallengeName:e,ChallengeParameters:i,AuthenticationResult:r,Session:s}=await (0,o.Mf)(t,n,m,f,l.C),a=(0,o.QS)(t);if((0,u.k4)({signInSession:s,username:a,challengeName:e,signInDetails:E}),r)return await (0,d.x)({username:a,...r,NewDeviceMetadata:await (0,g.F)({userPoolId:f.userPoolId,userPoolEndpoint:f.userPoolEndpoint,newDeviceMetadata:r.NewDeviceMetadata,accessToken:r.AccessToken}),signInDetails:E}),(0,u.fZ)(),await (0,p.O)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};return(0,o.cP)({challengeName:e,challengeParameters:i})}catch(t){(0,u.fZ)(),(0,c.R)(t);let e=(0,o.yM)(t.name);if(e)return e;throw t}}var m=n(57386);async function y(e){let{username:t,password:n}=e,h=i.d.getConfig().Auth?.Cognito,E={loginId:t,authFlowType:"USER_SRP_AUTH"};(0,r.FG)(h);let f=e.options?.clientMetadata;(0,a.n)(!!t,s.X.EmptySignInUsername),(0,a.n)(!!n,s.X.EmptySignInPassword);try{let{ChallengeName:e,ChallengeParameters:i,AuthenticationResult:r,Session:s}=await (0,o.U)(t,n,f,h,l.C),a=(0,o.QS)(t);if((0,u.k4)({signInSession:s,username:a,challengeName:e,signInDetail
1s:E}),r)return await (0,d.x)({username:a,...r,NewDeviceMetadata:await (0,g.F)({userPoolId:h.userPoolId,userPoolEndpoint:h.userPoolEndpoint,newDeviceMetadata:r.NewDeviceMetadata,accessToken:r.AccessToken}),signInDetails:E}),(0,u.fZ)(),await (0,p.O)(),(0,m.Dv)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};return(0,o.cP)({challengeName:e,challengeParameters:i})}catch(t){(0,u.fZ)(),(0,m.Dv)(),(0,c.R)(t);let e=(0,o.yM)(t.name);if(e)return e;throw t}}async function I(e){let{username:t,password:n,options:E}=e,f=i.d.getConfig().Auth?.Cognito,y={loginId:t,authFlowType:"USER_PASSWORD_AUTH"};(0,r.FG)(f);let I=E?.clientMetadata;(0,a.n)(!!t,s.X.EmptySignInUsername),(0,a.n)(!!n,s.X.EmptySignInPassword);try{let{ChallengeName:e,ChallengeParameters:i,AuthenticationResult:r,Session:s}=await (0,h.H)(o.x6,[t,n,I,f,l.C],t,l.C),a=(0,o.QS)(t);if((0,u.k4)({signInSession:s,username:a,challengeName:e,signInDetails:y}),r)return await (0,d.x)({...r,username:a,NewDeviceMetadata:await (0,g.F)({userPoolId:f.userPoolId,userPoolEndpoint:f.userPoolEndpoint,newDeviceMetadata:r.NewDeviceMetadata,accessToken:r.AccessToken}),signInDetails:y}),(0,u.fZ)(),await (0,p.O)(),(0,m.Dv)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};return(0,o.cP)({challengeName:e,challengeParameters:i})}catch(t){(0,u.fZ)(),(0,m.Dv)(),(0,c.R)(t);let e=(0,o.yM)(t.name);if(e)return e;throw t}}var S=n(96510);async function x(e){(0,m.Dv)(!1);let t=e.options?.authFlowType;switch(await (0,o.OP)(),t){case"USER_SRP_AUTH":default:return y(e);case"USER_PASSWORD_AUTH":return I(e);case"CUSTOM_WITHOUT_SRP":return E(e);case"CUSTOM_WITH_SRP":return f(e);case"USER_AUTH":return(0,S.G)(e)}}},96510:function(e,t,n){n.d(t,{G:function(){return C}});var o=n(79722),i=n(87433),r=n(39811),s=n(32002),a=n(45473),c=n(9583),u=n(25280),d=n(54501),l=n(12249),p=n(85777),h=n(74567),g=n(85230),E=n(6801),f=n(66388),m=n(31901),y=n(99388),I=n(83977),S=n(95377),x=n(69954);async function v({username:e,clientMetadata:t,config:n,tokenOrchestrator:o,preferredChallenge:i,password:a,session:c}){let{userPoolId:u,userPoolClientId:d,userPoolEndpoint:l}=n,p=(0,E.u)({username:e,userPoolId:u,userPoolClientId:d}),h={USERNAME:e};if(i){if("PASSWORD_SRP"===i)return(0,s.n)(!!a,r.X.EmptySignInPassword),(0,S.h)({username:e,password:a,clientMetadata:t,config:n,tokenOrchestrator:o,authFlow:"USER_AUTH",preferredChallenge:i});"PASSWORD"===i&&((0,s.n)(!!a,r.X.EmptySignInPassword),h.PASSWORD=a),h.PREFERRED_CHALLENGE=i}let v={AuthFlow:"USER_AUTH",AuthParameters:h,ClientMetadata:t,ClientId:d,UserContextData:p};c&&(v.Session=c);let w=(0,f.N)({endpointResolver:(0,m.e)({endpointOverride:l})}),A=await w({region:(0,y.y)(u),userAgentValue:(0,I.W)(g.g4.SignIn)},v);return(0,x.r)(e),A}var w=n(67455),A=n(57386);async function C(e){let{username:t,password:n,options:g}=e,E=o.d.getConfig().Auth?.Cognito,f={loginId:t,authFlowType:"USER_AUTH"};(0,i.FG)(E);let m=g?.clientMetadata,y=g?.preferredChallenge;(0,s.n)(!!t,r.X.EmptySignInUsername);try{let e={username:t,config:E,tokenOrchestrator:h.C,clientMetadata:m,preferredChallenge:y,password:n},o=u.E.getState();o.active&&o.username===t&&(e.session=o.session);let i=await v(e),r=(0,c.QS)(t);if((0,d.k4)({signInSession:i.Session,username:r,challengeName:i.ChallengeName,signInDetails:f}),i.AuthenticationResult)return await (0,l.x)({username:r,...i.AuthenticationResult,NewDeviceMetadata:await (0,w.F)({userPoolId:E.userPoolId,userPoolEndpoint:E.userPoolEndpoint,newDeviceMetadata:i.AuthenticationResult.NewDeviceMetadata,accessToken:i.AuthenticationResult.AccessToken}),signInDetails:f}),(0,d.fZ)(),await (0,p.O)(),(0,A.Dv)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};return(0,c.cP)({challengeName:i.ChallengeName,challengeParameters:i.ChallengeParameters,availableChallenges:"AvailableChallenges"in i?i.AvailableChallenges:void 0})}catch(t){(0,d.fZ)(),(0,A.Dv)(),(0,a.R)(t);let e=(0,c.yM)(t.name);if(e)return e;throw t}}},59138:function(e,t,n){n.d(t,{w:function(){return D}});var o=n(53110),i=n(79722),r=n(12876);function s(){return i.d.Auth.clearCredentials()}var a=n(85871),c=n(87433),u=n(85230),d=n(83977),l=n(57826),p=n(42251),h=n(74567),g=n(99388),E=n(34168);n(28364);let f=async e=>{await e.clearOAuthData(),h.C.clearTokens(),await s(),a.Xb.dispatch("auth",{event:"signedOut"},"Auth",a.SQ)},m=async e=>{window?.location&&(window.location.href=e.replace("http://","https://"))};var y=n(99075);let I=e=>e.startsWith(String((window.location.origin+window.location.pathname)??"/")),S=e=>e.includes(String(window.location.hostname)),x=e=>e.startsWith("http://"),v=e=>e.startsWith("https://"),w=async(e,t=!1,n)=>{(0,c.V0)(e);let{loginWith:o,userPoolClientId:i}=e,{domain:r,redirectSignOut:s}=o.oauth,a=function(e,t){if(t){let n=e?.find(e=>e===t);if(!n)throw y.x9;return n}{let t=e?.find(I)??e?.find(S),n=e?.find(v)??e?.find(x);if(t)return t;if(n)throw y.VL;throw y.vC}}(s,n);return m(`https://${r}/logout?${Object.entries({client_id:i,logout_uri:encodeURIComponent(a)}).map(([e,t])=>`${e}=${t}`).join("&")}`)},A=async(e,t,n,o)=>{let{isOAuthSignIn:i}=await t.loadOAuthSignIn(),r=await n.getOAuthMetadata();if(await f(t),i||r?.oauthSignIn)return w(e,!1,o)};var C=n(91742),R=n(83468),P=n(5048),T=n(7107),N=n(36168);let U=e=>
1(0,C.z)(R.x,(0,P.u)("RevokeToken"),(0,T.o)(),{...N.n,...e}),_=e=>(0,C.z)(R.x,(0,P.u)("GlobalSignOut"),(0,T.o)(),{...N.n,...e});var b=n(31901);let F=new o.k("Auth");async function D(e){let t;let n=i.d.getConfig().Auth?.Cognito;(0,c.FG)(n),e?.global?await M(n):await k(n);try{(0,c.V0)(n),t=!0}catch(e){t=!1}if(t){let t=new p.R(r.Fm);t.setAuthConfig(n);let{type:o}=await A(n,t,h.C,e?.oauth?.redirectUrl)??{};if("error"===o)throw new l.l({name:y.wW,message:"An error occurred when attempting to log out from OAuth provider."})}else h.C.clearTokens(),await s(),a.Xb.dispatch("auth",{event:"signedOut"},"Auth",a.SQ)}async function k(e){try{let{userPoolEndpoint:t,userPoolId:n,userPoolClientId:o}=e,i=await h.C.getTokenStore().loadTokens();if((0,E.XD)(i),O(i.accessToken)){let e=U({endpointResolver:(0,b.e)({endpointOverride:t})});await e({region:(0,g.y)(n),userAgentValue:(0,d.W)(u.g4.SignOut)},{ClientId:o,Token:i.refreshToken})}}catch(e){F.debug("Client signOut error caught but will proceed with token removal")}}async function M(e){try{let{userPoolEndpoint:t,userPoolId:n}=e,o=await h.C.getTokenStore().loadTokens();(0,E.CA)(o);let i=_({endpointResolver:(0,b.e)({endpointOverride:t})});await i({region:(0,g.y)(n),userAgentValue:(0,d.W)(u.g4.SignOut)},{AccessToken:o.accessToken.toString()})}catch(e){F.debug("Global signOut error caught but will proceed with token removal")}}let O=e=>!!e?.payload?.origin_jti},52220:function(e,t,n){n.d(t,{y:function(){return k}});var o=n(79722),i=n(87433),r=n(85230),s=n(32002),a=n(39811),c=n(99388),u=n(99189),d=n(85871),l=n(91727),p=n(57826),h=n(57386),g=n(99075),E=n(96510);function f(e,t){let n;return o=>{n||e(...o),clearTimeout(n),n=setTimeout(()=>{n=void 0},t)}}let m=f(function(e,t,n){let o=Date.now(),i=setInterval(async()=>{if(Date.now()-o>18e4)clearInterval(i),n(new p.l({name:g.MA,message:"The account was not confirmed on time.",recoverySuggestion:"Try to verify your account by clicking the link sent your email or phone and then login manually."})),(0,h.Dv)();else try{let n=await (0,l.z)(e);"CONFIRM_SIGN_UP"!==n.nextStep.signInStep&&(t(n),clearInterval(i),(0,h.Dv)())}catch(e){clearInterval(i),n(e),(0,h.Dv)()}},5e3)},300),y=f(I,300);async function I(e,t,n){try{let n=e?.options?.authFlowType==="USER_AUTH"?await (0,E.G)(e):await (0,l.z)(e);t(n),(0,h.Dv)()}catch(e){n(e),(0,h.Dv)()}}function S(e){return async()=>new Promise((t,n)=>{y([e,t,n])})}var x=n(6801),v=n(83977),w=n(91742),A=n(48880),C=n(60117),R=n(45473),P=n(88881),T=n(5048),N=n(83468),U=n(36168);let _=()=>async e=>{if(e.statusCode>=300){let t=await (0,A.f)(e);if((0,R.R)(t),t.name===P.y3.InvalidParameterException&&/'password'/.test(t.message)&&/Member must not be null/.test(t.message)){let e=a.X.EmptySignUpPassword,{message:t,recoverySuggestion:n}=C.By[e];throw new p.l({name:e,message:t,recoverySuggestion:n})}throw new p.l({name:t.name,message:t.message})}return(0,A.e)(e)},b=e=>(0,w.z)(N.x,(0,T.u)("SignUp"),_(),{...U.n,...e});var F=n(31901),D=n(25280);async function k(e){let{username:t,password:n,options:l}=e,p=o.d.getConfig().Auth?.Cognito,g=p?.signUpVerificationMethod??"code",{clientMetadata:E,validationData:f,autoSignIn:y}=e.options??{};(0,i.FG)(p),(0,s.n)(!!t,a.X.EmptySignUpUsername);let I="boolean"!=typeof y?y:void 0,w={username:t,options:I};I?.authFlowType!=="CUSTOM_WITHOUT_SRP"&&(w.password=n);let{userPoolId:A,userPoolClientId:C,userPoolEndpoint:R}=p,P=b({endpointResolver:(0,F.e)({endpointOverride:R})}),T={Username:t,Password:void 0,UserAttributes:l?.userAttributes&&(0,u.J)(l?.userAttributes),ClientMetadata:E,ValidationData:f&&(0,u.J)(f),ClientId:C,UserContextData:(0,x.u)({username:t,userPoolId:A,userPoolClientId:C})};n&&(T.Password=n);let{UserSub:N,CodeDeliveryDetails:U,UserConfirmed:_,Session:k}=await P({region:(0,c.y)(A),userAgentValue:(0,v.W)(r.g4.SignUp)},T);(I||!0===y)&&(D.E.dispatch({type:"START"}),D.E.dispatch({type:"SET_USERNAME",value:t}),D.E.dispatch({type:"SET_SESSION",value:k}));let M={destination:U?.Destination,deliveryMedium:U?.DeliveryMedium,attributeName:U?.AttributeName},O=D.E.getState().active;if(_)return O?((0,h.I)(S(w)),{isSignUpComplete:!0,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN"},userId:N}):{isSignUpComplete:!0,nextStep:{signUpStep:"DONE"},userId:N};if(O){if("link"===g)return(0,h.I)(async()=>new Promise((e,t)=>
1{m([w,e,t])})),{isSignUpComplete:!1,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN",codeDeliveryDetails:M},userId:N};!function(e){let t=d.qC.listen("auth-internal",async({payload:n})=>{if("confirmSignUp"===n.event){let o=n.data;o?.isSignUpComplete&&(d.qC.dispatch("auth-internal",{event:"autoSignIn"}),(0,h.I)(S(e)),t())}}),n=setTimeout(()=>{t(),clearTimeout(n),(0,h.Dv)()},18e4)}(w)}return{isSignUpComplete:!1,nextStep:{signUpStep:"CONFIRM_SIGN_UP",codeDeliveryDetails:M},userId:N}}},31901:function(e,t,n){n.d(t,{e:function(){return a}});var o=n(69514),i=n(51849),r=n(58249);let s=({region:e})=>({url:new o.a(`https://${r.t}.${e}.${(0,i.b)(e)}`)}),a=({endpointOverride:e})=>t=>e?{url:new o.a(e)}:s(t)},90445:function(e,t,n){n.d(t,{sI:function(){return l},_X:function(){return h}});var o,i=n(87433),r=n(57826);let s={accessToken:"accessToken",idToken:"idToken",oidcProvider:"oidcProvider",clockDrift:"clockDrift",refreshToken:"refreshToken",deviceKey:"deviceKey",randomPasswordKey:"randomPasswordKey",deviceGroupKey:"deviceGroupKey",signInDetails:"signInDetails",oauthMetadata:"oauthMetadata"};var a=n(97808);(o||(o={})).InvalidAuthTokens="InvalidAuthTokens";let c={[o.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},u=(0,a.$)(c),d="CognitoIdentityServiceProvider";class l{getKeyValueStorage(){if(!this.keyValueStorage)throw new r.l({name:"KeyValueStorageNotFoundException",message:"KeyValueStorage was not found in TokenStore"});return this.keyValueStorage}setKeyValueStorage(e){this.keyValueStorage=e}setAuthConfig(e){this.authConfig=e}async loadTokens(){try{let e=await this.getAuthKeys(),t=await this.getKeyValueStorage().getItem(e.accessToken);if(!t)throw new r.l({name:"NoSessionFoundException",message:"Auth session was not found. Make sure to call signIn."});let n=(0,i.xp)(t),o=await this.getKeyValueStorage().getItem(e.idToken),s=o?(0,i.xp)(o):void 0,a=await this.getKeyValueStorage().getItem(e.refreshToken)??void 0,c=await this.getKeyValueStorage().getItem(e.clockDrift)??"0",u=Number.parseInt(c),d=await this.getKeyValueStorage().getItem(e.signInDetails),l={accessToken:n,idToken:s,refreshToken:a,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:u,username:await this.getLastAuthUser()};return d&&(l.signInDetails=JSON.parse(d)),l}catch(e){return null}}async storeTokens(e){u(void 0!==e,o.InvalidAuthTokens);let t=e.username;await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(),t);let n=await this.getAuthKeys();await this.getKeyValueStorage().setItem(n.accessToken,e.accessToken.toString()),e.idToken?await this.getKeyValueStorage().setItem(n.idToken,e.idToken.toString()):await this.getKeyValueStorage().removeItem(n.idToken),e.refreshToken?await this.getKeyValueStorage().setItem(n.refreshToken,e.refreshToken):await this.getKeyValueStorage().removeItem(n.refreshToken),e.deviceMetadata&&(e.deviceMetadata.deviceKey&&await this.getKeyValueStorage().setItem(n.deviceKey,e.deviceMetadata.deviceKey),e.deviceMetadata.deviceGroupKey&&await this.getKeyValueStorage().setItem(n.deviceGroupKey,e.deviceMetadata.deviceGroupKey),await this.getKeyValueStorage().setItem(n.randomPasswordKey,e.deviceMetadata.randomPassword)),e.signInDetails?await this.getKeyValueStorage().setItem(n.signInDetails,JSON.stringify(e.signInDetails)):await this.getKeyValueStorage().removeItem(n.signInDetails),await this.getKeyValueStorage().setItem(n.clockDrift,`${e.clockDrift}`)}async clearTokens(){let e=await this.getAuthKeys();await Promise.all([this.getKeyValueStorage().removeItem(e.accessToken),this.getKeyValueStorage().removeItem(e.idToken),this.getKeyValueStorage().removeItem(e.clockDrift),this.getKeyValueStorage().removeItem(e.refreshToken),this.getKeyValueStorage().removeItem(e.signInDetails),this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),this.getKeyValueStorage().removeItem(e.oauthMetadata)])}async getDeviceMetadata(e){let t=await this.getAuthKeys(e),n=await this.getKeyValueStorage().getItem(t.deviceKey),o=await this.getKeyValueStorage().getItem(t.deviceGroupKey),i=await this.getKeyValueStorage().getItem(t.randomPasswordKey);return i&&o&&n?{deviceKey:n,deviceGroupKey:o,randomPassword:i}:null}async clearDeviceMetadata(e){let t=await this.getAuthKeys(e);await Promise.all([this.getKeyValueStorage().removeItem(t.deviceKey),this.getKeyValueStorage().removeItem(t.deviceGroupKey),this.getKeyValueStorage().removeItem(t.randomPasswordKey)])}async getAuthKeys(e){(0,i.FG)(this.authConfig?.Cognito);let t=e??await this.getLastAuthUser();return p(d,`${this.authConfig.Cognito.userPoolClientId}.${t}`)}getLastAuthUserKey(){(0,i.FG)(this.authConfig?.Cognito);let e=this.authConfig.Cognito.userPoolClientId;return`${d}.${e}.LastAuthUser`}async getLastAuthUser(){return await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())??"username"}async setOAuthMetadata(e){let{oauthMetadata:t}=await this.getAuthKeys();await this.getKeyValueStorage().setItem(t,JSON.stringify(e))}async getOAuthMetadata(){let{oauthMetadata:e}=await this.getAuthKeys(),t=await this.getKeyValueStorage().getItem(e);return t&&JSON.parse(t)}}let p=(e,t)=>h(s)(`${e}`,t);function h(e){let t=Object.values({...e});return(e,n)=>t.reduce((t,o)=>({...t,[o]:`${e}.${n}.${o}`}),{})}},12249:function(e,t,n){n.d(t,{x:function(){return s}});var o=n(87433),i=n(75638),r=n(74567);async function s(e){if(e.AccessToken){let t,n,i;let s=(0,o.xp)(e.AccessToken),a=1e3*(s.payload.iat||0),c=new Date().getTime();e.RefreshToken&&(n=e.RefreshToken),e.IdToken&&(t=(0,o.xp)(e.IdToken)),e?.NewDeviceMetadata&&(i=e.NewDeviceMetadata);let u={accessToken:s,idToken:t,refreshToken:n,clockDrift:a>0?a-c:0,deviceMetadata:i,username:e.username};
1e?.signInDetails&&(u.signInDetails=e.signInDetails),await r.C.setTokens({tokens:u})}else throw new i._({message:"Invalid tokens",name:"InvalidTokens",recoverySuggestion:"Check Cognito UserPool settings"})}},74567:function(e,t,n){let o;n.d(t,{D:function(){return C},C:function(){return R}});var i,r=n(12876),s=n(87433),a=n(99388),c=n(34168),u=n(57826),d=n(66388),l=n(31901),p=n(6801);let h=(i=async({tokens:e,authConfig:t,username:n})=>{(0,s.FG)(t?.Cognito);let{userPoolId:o,userPoolClientId:i,userPoolEndpoint:r}=t.Cognito,h=(0,a.y)(o);(0,c.XD)(e);let g=e.refreshToken,E={REFRESH_TOKEN:g};e.deviceMetadata?.deviceKey&&(E.DEVICE_KEY=e.deviceMetadata.deviceKey);let f=(0,p.u)({username:n,userPoolId:o,userPoolClientId:i}),m=(0,d.N)({endpointResolver:(0,l.e)({endpointOverride:r})}),{AuthenticationResult:y}=await m({region:h},{ClientId:i,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:E,UserContextData:f}),I=(0,s.xp)(y?.AccessToken??""),S=y?.IdToken?(0,s.xp)(y.IdToken):void 0,{iat:x}=I.payload;if(!x)throw new u.l({name:"iatNotFoundException",message:"iat not found in access token"});return{accessToken:I,idToken:S,clockDrift:1e3*x-new Date().getTime(),refreshToken:g,username:n}},async(...e)=>o||(o=new Promise((t,n)=>{i(...e).then(e=>{t(e)}).catch(e=>{n(e)}).finally(()=>{o=void 0})})));var g=n(90445),E=n(85871),f=n(99262);function m({expiresAt:e,clockDrift:t,tolerance:n=5e3}){return Date.now()+t+n>e}var y=n(37701),I=n(45473);let S=new(n(42251)).R(r.Fm),x=[],v=e=>{x.push(e)};class w{constructor(){this.waitForInflightOAuth=(0,f.j)()?async()=>await S.loadOAuthInFlight()?(this.inflightPromise||(this.inflightPromise=new Promise((e,t)=>{v(e)})),this.inflightPromise):void 0:async()=>{}}setAuthConfig(e){S.setAuthConfig(e.Cognito),this.authConfig=e}setTokenRefresher(e){this.tokenRefresher=e}setAuthTokenStore(e){this.tokenStore=e}getTokenStore(){if(!this.tokenStore)throw new u.l({name:"EmptyTokenStoreException",message:"TokenStore not set"});return this.tokenStore}getTokenRefresher(){if(!this.tokenRefresher)throw new u.l({name:"EmptyTokenRefresherException",message:"TokenRefresher not set"});return this.tokenRefresher}async getTokens(e){let t;try{(0,s.FG)(this.authConfig?.Cognito)}catch(e){return null}await this.waitForInflightOAuth(),this.inflightPromise=void 0,t=await this.getTokenStore().loadTokens();let n=await this.getTokenStore().getLastAuthUser();if(null===t)return null;let o=!!t?.idToken&&m({expiresAt:(t.idToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0}),i=m({expiresAt:(t.accessToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0});return(e?.forceRefresh||o||i)&&null===(t=await this.refreshTokens({tokens:t,username:n}))?null:{accessToken:t?.accessToken,idToken:t?.idToken,signInDetails:t?.signInDetails}}async refreshTokens({tokens:e,username:t}){try{let{signInDetails:n}=e,o=await this.getTokenRefresher()({tokens:e,authConfig:this.authConfig,username:t});return o.signInDetails=n,await this.setTokens({tokens:o}),E.Xb.dispatch("auth",{event:"tokenRefresh"},"Auth",E.SQ),o}catch(e){return this.handleErrors(e)}}handleErrors(e){if((0,I.R)(e),e.name!==y.Z.NetworkError&&this.clearTokens(),E.Xb.dispatch("auth",{event:"tokenRefresh_failure",data:{error:e}},"Auth",E.SQ),e.name.startsWith("NotAuthorizedException"))return null;throw e}async setTokens({tokens:e}){return this.getTokenStore().storeTokens(e)}async clearTokens(){return this.getTokenStore().clearTokens()}getDeviceMetadata(e){return this.getTokenStore().getDeviceMetadata(e)}clearDeviceMetadata(e){return this.getTokenStore().clearDeviceMetadata(e)}setOAuthMetadata(e){return this.getTokenStore().setOAuthMetadata(e)}getOAuthMetadata(){return this.getTokenStore().getOAuthMetadata()}}class A{constructor(){this.authTokenStore=new g.sI,this.authTokenStore.setKeyValueStorage(r.Fm),this.tokenOrchestrator=new w,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(h)}getTokens({forceRefresh:e}={forceRefresh:!1}){return this.tokenOrchestrator.getTokens({forceRefresh:e})}setKeyValueStorage(e){this.authTokenStore.setKeyValueStorage(e)}setAuthConfig(e){this.authTokenStore.setAuthConfig(e),this.tokenOrchestrator.setAuthConfig(e)}}let C=new A,{tokenOrchestrator:R}=C},88881:function(e,t,n){var o,i,r,s,a,c,u,d,l,p,h,g,E,f,m,y,I,S,x,v,w,A,C,R,P,T,N,U,_,b,F,D,k,M,O,L,V,K,q,B,G,W,$,z,H,j,X,Z;n.d(t,{OK:function(){return m},y3:function(){return x}}),(P=o||(o={})).ConcurrentModificationException="ConcurrentModificationException",P.ForbiddenException="ForbiddenException",P.InternalErrorException="InternalErrorException",P.InvalidParameterException="InvalidParameterException",P.NotAuthorizedException="NotAuthorizedException",P.ResourceNotFoundException="ResourceNotFoundException",P.SoftwareTokenMFANotFoundException="Softw
1areTokenMFANotFoundException",(T=i||(i={})).ForbiddenException="ForbiddenException",T.InternalErrorException="InternalErrorException",T.InvalidParameterException="InvalidParameterException",T.InvalidPasswordException="InvalidPasswordException",T.LimitExceededException="LimitExceededException",T.NotAuthorizedException="NotAuthorizedException",T.PasswordResetRequiredException="PasswordResetRequiredException",T.ResourceNotFoundException="ResourceNotFoundException",T.TooManyRequestsException="TooManyRequestsException",T.UserNotConfirmedException="UserNotConfirmedException",T.UserNotFoundException="UserNotFoundException",(N=r||(r={})).ForbiddenException="ForbiddenException",N.InternalErrorException="InternalErrorException",N.InvalidLambdaResponseException="InvalidLambdaResponseException",N.InvalidParameterException="InvalidParameterException",N.InvalidPasswordException="InvalidPasswordException",N.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",N.NotAuthorizedException="NotAuthorizedException",N.PasswordResetRequiredException="PasswordResetRequiredException",N.ResourceNotFoundException="ResourceNotFoundException",N.TooManyRequestsException="TooManyRequestsException",N.UsernameExistsException="UsernameExistsException",N.UserNotConfirmedException="UserNotConfirmedException",N.UserNotFoundException="UserNotFoundException",(U=s||(s={})).CodeMismatchException="CodeMismatchException",U.ExpiredCodeException="ExpiredCodeException",U.ForbiddenException="ForbiddenException",U.InternalErrorException="InternalErrorException",U.InvalidLambdaResponseException="InvalidLambdaResponseException",U.InvalidParameterException="InvalidParameterException",U.InvalidPasswordException="InvalidPasswordException",U.LimitExceededException="LimitExceededException",U.NotAuthorizedException="NotAuthorizedException",U.ResourceNotFoundException="ResourceNotFoundException",U.TooManyFailedAttemptsException="TooManyFailedAttemptsException",U.TooManyRequestsException="TooManyRequestsException",U.UnexpectedLambdaException="UnexpectedLambdaException",U.UserLambdaValidationException="UserLambdaValidationException",U.UserNotConfirmedException="UserNotConfirmedException",U.UserNotFoundException="UserNotFoundException",(_=a||(a={})).AliasExistsException="AliasExistsException",_.CodeMismatchException="CodeMismatchException",_.ExpiredCodeException="ExpiredCodeException",_.ForbiddenException="ForbiddenException",_.InternalErrorException="InternalErrorException",_.InvalidLambdaResponseException="InvalidLambdaResponseException",_.InvalidParameterException="InvalidParameterException",_.LimitExceededException="LimitExceededException",_.NotAuthorizedException="NotAuthorizedException",_.ResourceNotFoundException="ResourceNotFoundException",_.TooManyFailedAttemptsException="TooManyFailedAttemptsException",_.TooManyRequestsException="TooManyRequestsException",_.UnexpectedLambdaException="UnexpectedLambdaException",_.UserLambdaValidationException="UserLambdaValidationException",_.UserNotFoundException="UserNotFoundException",(b=c||(c={})).ForbiddenException="ForbiddenException",b.InternalErrorException="InternalErrorException",b.InvalidParameterException="InvalidParameterException",b.NotAuthorizedException="NotAuthorizedException",b.PasswordResetRequiredException="PasswordResetRequiredException",b.ResourceNotFoundException="ResourceNotFoundException",b.TooManyRequestsException="TooManyRequestsException",b.UserNotConfirmedException="UserNotConfirmedException",b.UserNotFoundException="UserNotFoundException",(F=u||(u={})).ForbiddenException="ForbiddenException",F.InternalErrorException="InternalErrorException",F.InvalidParameterException="InvalidParameterException",F.NotAuthorizedException="NotAuthorizedException",F.PasswordResetRequiredException="PasswordResetRequiredException",F.ResourceNotFoundException="ResourceNotFoundException",F.TooManyRequestsException="TooManyRequestsException",F.UserNotConfirmedException="UserNotConfirmedException",F.UserNotFoundException="UserNotFoundException",(D=d||(d={})).ForbiddenException="ForbiddenException",D.InternalErrorException="InternalErrorException",D.InvalidParameterException="InvalidParameterException",D.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",D.NotAuthorizedException="NotAuthorizedException",D.PasswordResetRequiredException="PasswordResetRequiredException",D.ResourceNotFoundException="ResourceNotFoundException",D.TooManyRequestsException="TooManyRequestsException",D.UserNotConfirmedException="UserNotConfirmedException",D.UserNotFoundException="UserNotFoundException",(k=l||(l={})).CodeDeliveryFailureException="CodeDeliveryFailureException",k.ForbiddenException="ForbiddenException",k.InternalErrorException="InternalErrorException",k.InvalidEmailRoleAccessPol
1icyException="InvalidEmailRoleAccessPolicyException",k.InvalidLambdaResponseException="InvalidLambdaResponseException",k.InvalidParameterException="InvalidParameterException",k.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",k.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",k.LimitExceededException="LimitExceededException",k.NotAuthorizedException="NotAuthorizedException",k.ResourceNotFoundException="ResourceNotFoundException",k.TooManyRequestsException="TooManyRequestsException",k.UnexpectedLambdaException="UnexpectedLambdaException",k.UserLambdaValidationException="UserLambdaValidationException",k.UserNotFoundException="UserNotFoundException",(M=p||(p={})).ForbiddenException="ForbiddenException",M.InternalErrorException="InternalErrorException",M.InvalidParameterException="InvalidParameterException",M.NotAuthorizedException="NotAuthorizedException",M.PasswordResetRequiredException="PasswordResetRequiredException",M.ResourceNotFoundException="ResourceNotFoundException",M.TooManyRequestsException="TooManyRequestsException",M.UserNotConfirmedException="UserNotConfirmedException",M.UserNotFoundException="UserNotFoundException",(O=h||(h={})).ExternalServiceException="ExternalServiceException",O.InternalErrorException="InternalErrorException",O.InvalidParameterException="InvalidParameterException",O.LimitExceededException="LimitExceededException",O.NotAuthorizedException="NotAuthorizedException",O.ResourceConflictException="ResourceConflictException",O.ResourceNotFoundException="ResourceNotFoundException",O.TooManyRequestsException="TooManyRequestsException",(L=g||(g={})).ExternalServiceException="ExternalServiceException",L.InternalErrorException="InternalErrorException",L.InvalidIdentityPoolConfigurationException="InvalidIdentityPoolConfigurationException",L.InvalidParameterException="InvalidParameterException",L.NotAuthorizedException="NotAuthorizedException",L.ResourceConflictException="ResourceConflictException",L.ResourceNotFoundException="ResourceNotFoundException",L.TooManyRequestsException="TooManyRequestsException",(V=E||(E={})).CodeDeliveryFailureException="CodeDeliveryFailureException",V.ForbiddenException="ForbiddenException",V.InternalErrorException="InternalErrorException",V.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",V.InvalidLambdaResponseException="InvalidLambdaResponseException",V.InvalidParameterException="InvalidParameterException",V.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",V.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",V.LimitExceededException="LimitExceededException",V.NotAuthorizedException="NotAuthorizedException",V.PasswordResetRequiredException="PasswordResetRequiredException",V.ResourceNotFoundException="ResourceNotFoundException",V.TooManyRequestsException="TooManyRequestsException",V.UnexpectedLambdaException="UnexpectedLambdaException",V.UserLambdaValidationException="UserLambdaValidationException",V.UserNotConfirmedException="UserNotConfirmedException",V.UserNotFoundException="UserNotFoundException",(K=f||(f={})).ForbiddenException="ForbiddenException",K.InternalErrorException="InternalErrorException",K.InvalidParameterException="InvalidParameterException",K.NotAuthorizedException="NotAuthorizedException",K.PasswordResetRequiredException="PasswordResetRequiredException",K.ResourceNotFoundException="ResourceNotFoundException",K.TooManyRequestsException="TooManyRequestsException",K.UserNotConfirmedException="UserNotConfirmedException",(q=m||(m={})).PasswordResetRequiredException="PasswordResetRequiredException",q.ForbiddenException="ForbiddenException",q.InternalErrorException="InternalErrorException",q.InvalidLambdaResponseException="InvalidLambdaResponseException",q.InvalidParameterException="InvalidParameterException",q.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",q.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",q.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",q.NotAuthorizedException="NotAuthorizedException",q.ResourceNotFoundException="ResourceNotFoundException",q.TooManyRequestsException="TooManyRequestsException",q.UnexpectedLambdaException="UnexpectedLambdaException",q.UserLambdaValidationException="UserLambdaValidationException",q.UserNotConfirmedException="UserNotConfirmedException",q.UserNotFoundException="UserNotFoundException",(B=y||(y={})).CodeDeliveryFailureException="CodeDeliveryFailureException",B.ForbiddenException="ForbiddenException",B.InternalErrorException="InternalErrorException",B.InvalidEmailRoleAccessPol
1icyException="InvalidEmailRoleAccessPolicyException",B.InvalidLambdaResponseException="InvalidLambdaResponseException",B.InvalidParameterException="InvalidParameterException",B.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",B.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",B.LimitExceededException="LimitExceededException",B.NotAuthorizedException="NotAuthorizedException",B.ResourceNotFoundException="ResourceNotFoundException",B.TooManyRequestsException="TooManyRequestsException",B.UnexpectedLambdaException="UnexpectedLambdaException",B.UserLambdaValidationException="UserLambdaValidationException",B.UserNotFoundException="UserNotFoundException",(G=I||(I={})).AliasExistsException="AliasExistsException",G.CodeMismatchException="CodeMismatchException",G.ExpiredCodeException="ExpiredCodeException",G.ForbiddenException="ForbiddenException",G.InternalErrorException="InternalErrorException",G.InvalidLambdaResponseException="InvalidLambdaResponseException",G.InvalidParameterException="InvalidParameterException",G.InvalidPasswordException="InvalidPasswordException",G.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",G.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",G.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",G.MFAMethodNotFoundException="MFAMethodNotFoundException",G.NotAuthorizedException="NotAuthorizedException",G.PasswordResetRequiredException="PasswordResetRequiredException",G.ResourceNotFoundException="ResourceNotFoundException",G.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",G.TooManyRequestsException="TooManyRequestsException",G.UnexpectedLambdaException="UnexpectedLambdaException",G.UserLambdaValidationException="UserLambdaValidationException",G.UserNotConfirmedException="UserNotConfirmedException",G.UserNotFoundException="UserNotFoundException",(W=S||(S={})).ForbiddenException="ForbiddenException",W.InternalErrorException="InternalErrorException",W.InvalidParameterException="InvalidParameterException",W.NotAuthorizedException="NotAuthorizedException",W.PasswordResetRequiredException="PasswordResetRequiredException",W.ResourceNotFoundException="ResourceNotFoundException",W.UserNotConfirmedException="UserNotConfirmedException",W.UserNotFoundException="UserNotFoundException",($=x||(x={})).CodeDeliveryFailureException="CodeDeliveryFailureException",$.InternalErrorException="InternalErrorException",$.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",$.InvalidLambdaResponseException="InvalidLambdaResponseException",$.InvalidParameterException="InvalidParameterException",$.InvalidPasswordException="InvalidPasswordException",$.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",$.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",$.NotAuthorizedException="NotAuthorizedException",$.ResourceNotFoundException="ResourceNotFoundException",$.TooManyRequestsException="TooManyRequestsException",$.UnexpectedLambdaException="UnexpectedLambdaException",$.UserLambdaValidationException="UserLambdaValidationException",$.UsernameExistsException="UsernameExistsException",(z=v||(v={})).AliasExistsException="AliasExistsException",z.CodeDeliveryFailureException="CodeDeliveryFailureException",z.CodeMismatchException="CodeMismatchException",z.ExpiredCodeException="ExpiredCodeException",z.ForbiddenException="ForbiddenException",z.InternalErrorException="InternalErrorException",z.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",z.InvalidLambdaResponseException="InvalidLambdaResponseException",z.InvalidParameterException="InvalidParameterException",z.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",z.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",z.NotAuthorizedException="NotAuthorizedException",z.PasswordResetRequiredException="PasswordResetRequiredException",z.ResourceNotFoundException="ResourceNotFoundException",z.TooManyRequestsException="TooManyRequestsException",z.UnexpectedLambdaException="UnexpectedLambdaException",z.UserLambdaValidationException="UserLambdaValidationException",z.UserNotConfirmedException="UserNotConfirmedException",z.UserNotFoundException="UserNotFoundException",(H=w||(w={}
1)).CodeMismatchException="CodeMismatchException",H.EnableSoftwareTokenMFAException="EnableSoftwareTokenMFAException",H.ForbiddenException="ForbiddenException",H.InternalErrorException="InternalErrorException",H.InvalidParameterException="InvalidParameterException",H.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",H.NotAuthorizedException="NotAuthorizedException",H.PasswordResetRequiredException="PasswordResetRequiredException",H.ResourceNotFoundException="ResourceNotFoundException",H.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",H.TooManyRequestsException="TooManyRequestsException",H.UserNotConfirmedException="UserNotConfirmedException",H.UserNotFoundException="UserNotFoundException",(j=A||(A={})).AliasExistsException="AliasExistsException",j.CodeMismatchException="CodeMismatchException",j.ExpiredCodeException="ExpiredCodeException",j.ForbiddenException="ForbiddenException",j.InternalErrorException="InternalErrorException",j.InvalidParameterException="InvalidParameterException",j.LimitExceededException="LimitExceededException",j.NotAuthorizedException="NotAuthorizedException",j.PasswordResetRequiredException="PasswordResetRequiredException",j.ResourceNotFoundException="ResourceNotFoundException",j.TooManyRequestsException="TooManyRequestsException",j.UserNotConfirmedException="UserNotConfirmedException",j.UserNotFoundException="UserNotFoundException",(X=C||(C={})).ForbiddenException="ForbiddenException",X.InternalErrorException="InternalErrorException",X.InvalidParameterException="InvalidParameterException",X.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",X.NotAuthorizedException="NotAuthorizedException",X.PasswordResetRequiredException="PasswordResetRequiredException",X.ResourceNotFoundException="ResourceNotFoundException",X.TooManyRequestsException="TooManyRequestsException",X.UserNotConfirmedException="UserNotConfirmedException",X.UserNotFoundException="UserNotFoundException",(Z=R||(R={})).ForbiddenException="ForbiddenException",Z.InternalErrorException="InternalErrorException",Z.InvalidParameterException="InvalidParameterException",Z.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",Z.NotAuthorizedException="NotAuthorizedException",Z.PasswordResetRequiredException="PasswordResetRequiredException",Z.ResourceNotFoundException="ResourceNotFoundException",Z.TooManyRequestsException="TooManyRequestsException",Z.UserNotConfirmedException="UserNotConfirmedException",Z.UserNotFoundException="UserNotFoundException"},99189:function(e,t,n){function o(e){return Object.entries(e).map(([e,t])=>({Name:e,Value:t}))}function i(e){let t={};return e?.forEach(e=>{e.Name&&(t[e.Name]=e.Value)}),t}n.d(t,{J:function(){return o},R:function(){return i}})},85777:function(e,t,n){n.d(t,{O:function(){return a}});var o=n(85871),i=n(23318),r=n(99075),s=n(57826);let a=async()=>{try{o.Xb.dispatch("auth",{event:"signedIn",data:await (0,i.t)()},"Auth",o.SQ)}catch(e){if(e.name===r.Jg)throw new s.l({name:r.sX,message:"Unable to get user session following successful sign-in.",recoverySuggestion:"This most likely is due to auth tokens not being persisted. If you are using cookie store, please ensure cookies can be correctly set from your server."});throw e}}},67455:function(e,t,n){n.d(t,{F:function(){return E}});var o=n(92614);let i=async()=>{let{userAgentData:e}=navigator;if(!e)return navigator.userAgent;let{platform:t="",platformVersion:n="",model:o="",architecture:i="",fullVersionList:r=[]}=await e.getHighEntropyValues(["platform","platformVersion","architecture","model","fullVersionList"]);return[t,n,i,o,t,r.map(e=>`${e.brand}/${e.version}`).join(";")].filter(e=>e).join(" ")||navigator.userAgent};var r=n(91742),s=n(83468),a=n(5048),c=n(7107),u=n(36168);let d=e=>(0,r.z)(s.x,(0,a.u)("ConfirmDevice"),(0,c.o)(),{...u.n,...e});var l=n(31901),p=n(99388),h=n(5270),g=n(73949);async function E({userPoolId:e,userPoolEndpoint:t,newDeviceMetadata:n,accessToken:r}){if(!n)return;let s=e.split("_")[1]||"",a=await (0,h.d)(s),c=n?.DeviceKey,u=n?.DeviceGroupKey;try{await a.generateHashDevice(u??"",c??"")}catch(e){return}let E={Salt:o.u.convert((0,g.z)(a.getSaltToHashDevices())),PasswordVerifier:o.u.convert((0,g.z)(a.getVerifierDevices()))},f=a.getRandomPassword();try{let o=d({endpointResolver:(0,l.e)({endpointOverride:t})});return await o({region:(0,p.y)(e)}
1,{AccessToken:r,DeviceName:await i(),DeviceKey:n?.DeviceKey,DeviceSecretVerifierConfig:E}),{deviceKey:c,deviceGroupKey:u,randomPassword:f}}catch(e){return}}n(28364)},24285:function(e,t,n){n.d(t,{z:function(){return p}});var o=n(43773),i=n(31901),r=n(99388),s=n(34168),a=n(5270),c=n(32386),u=n(32798),d=n(26857),l=n(6801);async function p({username:e,config:t,clientMetadata:n,session:c,tokenOrchestrator:u}){let{userPoolId:d,userPoolEndpoint:l}=t,p=t.userPoolClientId,g=await u?.getDeviceMetadata(e);(0,s.tr)(g);let E=await (0,a.d)(g.deviceGroupKey),f={USERNAME:e,SRP_A:E.A.toString(16),DEVICE_KEY:g.deviceKey},m=(0,o.u)({endpointResolver:(0,i.e)({endpointOverride:l})}),{ChallengeParameters:y,Session:I}=await m({region:(0,r.y)(d)},{ChallengeName:"DEVICE_SRP_AUTH",ClientId:p,ChallengeResponses:f,ClientMetadata:n,Session:c});return h(e,y,n,I,E,t,u)}async function h(e,t,n,a,p,{userPoolId:h,userPoolClientId:g,userPoolEndpoint:E},f){let m=await f?.getDeviceMetadata(e);(0,s.tr)(m);let y=new d.Z(t?.SRP_B,16),I=new d.Z(t?.SALT,16),{deviceKey:S}=m,{deviceGroupKey:x}=m,v=await p.getPasswordAuthenticationKey({username:m.deviceKey,password:m.randomPassword,serverBValue:y,salt:I}),w=(0,c.H)(),A={USERNAME:t?.USERNAME??e,PASSWORD_CLAIM_SECRET_BLOCK:t?.SECRET_BLOCK,TIMESTAMP:w,PASSWORD_CLAIM_SIGNATURE:(0,u.i)({username:S,userPoolName:x,challengeParameters:t,dateNow:w,hkdf:v}),DEVICE_KEY:S},C=(0,l.u)({username:e,userPoolId:h,userPoolClientId:g});return(0,o.u)({endpointResolver:(0,i.e)({endpointOverride:E})})({region:(0,r.y)(h)},{ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:g,ChallengeResponses:A,Session:a,ClientMetadata:n,UserContextData:C})}},52886:function(e,t,n){n.d(t,{i:function(){return p}});var o=n(57826),i=n(43773),r=n(31901),s=n(99388),a=n(26857);n(28364);var c=n(32386),u=n(32798),d=n(6801),l=n(24285);async function p(e,t,n,p,h,g,E){let{userPoolId:f,userPoolClientId:m,userPoolEndpoint:y}=g,I=f?.split("_")[1]||"",S=new a.Z(t?.SRP_B,16),x=new a.Z(t?.SALT,16),v=t?.USER_ID_FOR_SRP;if(!v)throw new o.l({name:"EmptyUserIdForSRPException",message:"USER_ID_FOR_SRP was not found in challengeParameters"});let w=await h.getPasswordAuthenticationKey({username:v,password:e,serverBValue:S,salt:x}),A=(0,c.H)(),C={USERNAME:v,PASSWORD_CLAIM_SECRET_BLOCK:t?.SECRET_BLOCK,TIMESTAMP:A,PASSWORD_CLAIM_SIGNATURE:(0,u.i)({username:v,userPoolName:I,challengeParameters:t,dateNow:A,hkdf:w})},R=await E.getDeviceMetadata(v);R&&R.deviceKey&&(C.DEVICE_KEY=R.deviceKey);let P=(0,d.u)({username:v,userPoolId:f,userPoolClientId:m}),T=(0,i.u)({endpointResolver:(0,r.e)({endpointOverride:y})}),N=await T({region:(0,s.y)(f)},{ChallengeName:"PASSWORD_VERIFIER",ChallengeResponses:C,ClientMetadata:n,Session:p,ClientId:m,UserContextData:P});return"DEVICE_SRP_AUTH"===N.ChallengeName?(0,l.z)({username:v,config:g,clientMetadata:n,session:N.Session,tokenOrchestrator:E}):N}},17650:function(e,t,n){n.d(t,{H:function(){return i}});var o=n(57826);async function i(e,t,n,i){try{return await e(...t)}catch(r){if(r instanceof o.l&&"ResourceNotFoundException"===r.name&&r.message.includes("Device does not exist."))return await i.clearDeviceMetadata(n),e(...t);throw r}}},69954:function(e,t,n){n.d(t,{r:function(){return i}});var o=n(54501);function i(e){let{dispatch:t}=o.signInStore;t({type:"SET_USERNAME",value:e})}},9583:function(e,t,n){n.d(t,{OP:function(){return eh},QS:function(){return eg},cP:function(){return ec},yM:function(){return eu},pB:function(){return es},Mf:function(){return ea},x6:function(){return ei},U:function(){return er}});var o,i,r=n(79722),s=n(85230),a=n(87433),c=n(69514),u=n(57826),d=n(88881),l=n(60117),p=n(99075),h=n(23318),g=n(83977),E=n(66388),f=n(91742),m=n(83468),y=n(5048),I=n(7107),S=n(36168);let x=e=>(0,f.z)(m.x,(0,y.u)("AssociateSoftwareToken"),(0,I.o)(),{...S.n,...e});var v=n(31901),w=n(99388),A=n(43773),C=n(12249),R=n(85777),P=n(54501),T=n(75638),N=n(97808),U=n(37701);class _ extends T._{constructor(e){super(e),this.constructor=_,Object.setPrototypeOf(this,_.prototype)}}(o=i||(i={})).PasskeyNotSupported="PasskeyNotSupported",o.PasskeyAlreadyExists="PasskeyAlreadyExists",o.InvalidPasskeyRegistrationOptions="InvalidPasskeyRegistrationOptions",o.InvalidPasskeyAuthenticationOptions="InvalidPasskeyAuthenticationOptions",o.RelyingPartyMismatch="RelyingPartyMismatch",o.PasskeyRegistrationFailed="PasskeyRegistrationFailed",o.PasskeyRetrievalFailed="PasskeyRetrievalFailed",o.PasskeyRegistrationCanceled="PasskeyRegistrationCanceled",o.PasskeyAuthenticationCanceled="PasskeyAuthenticationCanceled",o.PasskeyOperationAborted="PasskeyOperationAborted";let b="Passkeys may not be supported on this device. Ensure your application is running in a secure context (HTTPS) and Web Authentication API is supported.",F="User may have canceled the ceremony or another interruption has occurred. Check underlying error for details.",D="Ensure your user pool is configured to support the WEB_AUTHN as an authentication factor.",k={[i.PasskeyNotSupported]:{message:"Passkeys may not be supported on this device.",recoverySuggestion:b},[i.InvalidPasskeyRegistrationOptions]:{message:"Invalid passkey registration options.",recoverySuggestion:D},[i.InvalidPasskeyAuthenticationOptions]:{message:"Invalid passkey authentication options.",recoverySuggestion:D},[i.PasskeyRegistrationFailed]:{message:"Device failed to create passkey.",recoverySuggestion:b},[i.PasskeyRetrievalFailed]:{message:"Device failed to retrieve passkey.",recoverySuggestion:"Passkeys may not be available on this device. Try an alternative authentication factor like PASSWORD, EMAIL_OTP, or SMS_OTP."},[i.PasskeyAlreadyExists]:{message:"Passkey already exists in authenticator.",recoverySuggestion:"Proceed with existing passkey or try again after deleting the credential."},[i.PasskeyRegistrationCanceled]:{message:"Passkey registration ceremony has been canceled.",recoverySuggestion:F},[i.PasskeyAuthenticationCanceled]:{message:"Passkey authentication ceremony has been canceled.",recoverySuggestion:F},[i.PasskeyOperationAborted]:{message:"Passkey operation has been aborted.",recoverySuggestion:F},[i.RelyingPartyMismatch]:{message:"Relying party does not match current domain.",recoverySuggestion:"Ensure relying party identifier matches current domain."}},M=(0,N.$)(k,_),O=e=>{if(e instanceof _)return e;if(e instanceof Error&&"NotAllowedError"===e.name){let{message:t,recoverySuggestion:n}=k[i.PasskeyAuthenticationCanceled];return new _({name:i.PasskeyAuthenticationCanceled,message:t,recoverySuggestion:n,underlyingError:e})}return L(e)},L=e=>{if(e instanceof Error){if("AbortError"===e.name){let{message:t,recoverySuggestion:n}=k[i.PasskeyOperationAborted];return new _({name:i.PasskeyOperationAborted,message:t,recoverySuggestion:n,underlyingError:e})}if("SecurityError"===e.name){let{message:t,recoverySuggestion:n}=k[i.RelyingPartyMismatch];return new _({name:i.RelyingPartyMismatch,message:t,recoverySuggestion:n,underlyingError:e})}}return new _({name:U.Z.Unknown,message:"An unknown error has occurred.",underlyingError:e})};var V=n(99262);let K=()=>(0,V.j)()&&window.isSecureContext&&"credentials"in navigator&&"function"==typeof window.PublicKeyCredential;var q=n(92614);let B=e=>q.u.convert(new Uint8Array(e),{urlSafe:!0,skipPadding:!0});var G=n(70624);let W=e=>Uint8Array.from(G.$.convert(e,{urlSafe:!0}),e=>e.charCodeAt(0)).buffer,$=e=>{let t=W(e.challenge),n=(e.allowCredentials||[]).map(e=>({...e,id:W(e.id)}));return{...e,challenge:t,allowCredentials:n}},z=e=>{let t={clientDataJSON:B(e.response.clientDataJSON),authenticatorData:B(e.response.authenticatorData),signature:B(e.response.signature)};e.response.userHandle&&(t.userHandle=B(e.response.userHandle));let n={id:e.id,rawId:B(e.rawId),type:e.type,clientExtensionResults:e.getClientExtensionResults(),response:t};return e.authenticatorAttachment&&(n.authenticatorAttachment=e.authenticatorAttachment),n},H=async e=>{try{let t=K();M(t,i.PasskeyNotSupported);let n=$(e),o=await navigator.credentials.get({publicKey:n});return M(o&&o instanceof PublicKeyCredential&&o.response instanceof AuthenticatorAssertionResponse,i.PasskeyRetrievalFailed),z(o)}catch(e){throw O(e)}};var j=n(67455);async function X(e){let t=r.d.getConfig().Auth?.Cognito;(0,a.FG)(t);
1let{username:n,signInSession:o,signInDetails:c,challengeName:d}=P.signInStore.getState();if("WEB_AUTHN"!==d||!n)throw new u.l({name:l.kq.SignInException,message:"Unable to proceed due to invalid sign in state."});let{CREDENTIAL_REQUEST_OPTIONS:p}=e;M(!!p,i.InvalidPasskeyAuthenticationOptions);let h=await H(JSON.parse(p)),E=(0,A.u)({endpointResolver:(0,v.e)({endpointOverride:t.userPoolEndpoint})}),{ChallengeName:f,ChallengeParameters:m,AuthenticationResult:y,Session:I}=await E({region:(0,w.y)(t.userPoolId),userAgentValue:(0,g.W)(s.g4.ConfirmSignIn)},{ChallengeName:"WEB_AUTHN",ChallengeResponses:{USERNAME:n,CREDENTIAL:JSON.stringify(h)},ClientId:t.userPoolClientId,Session:o});if((0,P.k4)({signInSession:I,username:n,challengeName:f,signInDetails:c}),y)return await (0,C.x)({...y,username:n,NewDeviceMetadata:await (0,j.F)({userPoolId:t.userPoolId,userPoolEndpoint:t.userPoolEndpoint,newDeviceMetadata:y.NewDeviceMetadata,accessToken:y.AccessToken}),signInDetails:c}),P.signInStore.dispatch({type:"RESET_STATE"}),await (0,R.O)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};if("WEB_AUTHN"===f)throw new u.l({name:l.kq.SignInException,message:"Sequential WEB_AUTHN challenges returned from underlying service cannot be handled."});return{challengeName:f,challengeParameters:m}}var Z=n(95377),Q=n(5270);n(28364);var J=n(6801),Y=n(52886),ee=n(24285),et=n(17650),en=n(69954);let eo="userAttributes.";async function ei(e,t,n,o,i){let{userPoolClientId:r,userPoolId:a,userPoolEndpoint:c}=o,u={USERNAME:e,PASSWORD:t},d=await i.getDeviceMetadata(e);d&&d.deviceKey&&(u.DEVICE_KEY=d.deviceKey);let l=(0,J.u)({username:e,userPoolId:a,userPoolClientId:r}),p=(0,E.N)({endpointResolver:(0,v.e)({endpointOverride:c})}),h=await p({region:(0,w.y)(a),userAgentValue:(0,g.W)(s.g4.SignIn)},{AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:u,ClientMetadata:n,ClientId:r,UserContextData:l}),f=h.ChallengeParameters?.USERNAME??h.ChallengeParameters?.USER_ID_FOR_SRP??e;return((0,en.r)(f),"DEVICE_SRP_AUTH"===h.ChallengeName)?(0,ee.z)({username:f,config:o,clientMetadata:n,session:h.Session,tokenOrchestrator:i}):h}async function er(e,t,n,o,i){return(0,Z.h)({username:e,password:t,clientMetadata:n,config:o,tokenOrchestrator:i,authFlow:"USER_SRP_AUTH"})}async function es(e,t,n,o){let{userPoolClientId:i,userPoolId:r,userPoolEndpoint:a}=n,c={USERNAME:e},u=await o.getDeviceMetadata(e);u&&u.deviceKey&&(c.DEVICE_KEY=u.deviceKey);let d=(0,J.u)({username:e,userPoolId:r,userPoolClientId:i}),l=(0,E.N)({endpointResolver:(0,v.e)({endpointOverride:a})}),p=await l({region:(0,w.y)(r),userAgentValue:(0,g.W)(s.g4.SignIn)},{AuthFlow:"CUSTOM_AUTH",AuthParameters:c,ClientMetadata:t,ClientId:i,UserContextData:d}),h=p.ChallengeParameters?.USERNAME??e;return((0,en.r)(h),"DEVICE_SRP_AUTH"===p.ChallengeName)?(0,ee.z)({username:h,config:n,clientMetadata:t,session:p.Session,tokenOrchestrator:o}):p}async function ea(e,t,n,o,i){(0,a.FG)(o);let{userPoolId:r,userPoolClientId:c,userPoolEndpoint:u}=o,d=r?.split("_")[1]||"",l=await (0,Q.d)(d),p={USERNAME:e,SRP_A:l.A.toString(16),CHALLENGE_NAME:"SRP_A"},h=(0,J.u)({username:e,userPoolId:r,userPoolClientId:c}),f=(0,E.N)({endpointResolver:(0,v.e)({endpointOverride:u})}),{ChallengeParameters:m,Session:y}=await f({region:(0,w.y)(r),userAgentValue:(0,g.W)(s.g4.SignIn)},{AuthFlow:"CUSTOM_AUTH",AuthParameters:p,ClientMetadata:n,ClientId:c,UserContextData:h}),I=m?.USERNAME??e;return(0,en.r)(I),(0,et.H)(Y.i,[t,m,n,y,l,o,i],I,i)}async function ec(e){var t;let{challengeName:n,challengeParameters:o,availableChallenges:i}=e,s=r.d.getConfig().Auth?.Cognito;switch((0,a.FG)(s),n){case"CUSTOM_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE",additionalInfo:o}};case"MFA_SETUP":{let{signInSession:e,username:t}=P.signInStore.getState(),n=el(ep(o.MFAS_CAN_SETUP))||[],i=n.filter(e=>"EMAIL"===e||"TOTP"===e),r=i.includes("TOTP"),a=i.includes("EMAIL");if(r&&a)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION",allowedMFATypes:i}};if(a)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_EMAIL_SETUP"}};if(r){let n=x({endpointResolver:(0,v.e)({endpointOverride:s.userPoolEndpoint})}),{Session:o,SecretCode:i}=await n({region:(0,w.y)(s.userPoolId)},{Session:e});return P.signInStore.dispatch({type:"SET_SIGN_IN_SESSION",value:o}),{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_TOTP_SETUP",totpSetupDetails:{sharedSecret:i,get
1SetupUri:(e,n)=>{let o=`otpauth://totp/${e}:${n??t}?secret=${i}&issuer=${e}`;return new c.a(o)}}}}}throw new u.l({name:l.kq.SignInException,message:`Cannot initiate MFA setup from available types: ${n}`})}case"NEW_PASSWORD_REQUIRED":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED",missingAttributes:(t=o.requiredAttributes)?JSON.parse(t).map(e=>e.includes(eo)?e.replace(eo,""):e):[]}};case"SELECT_MFA_TYPE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SELECTION",allowedMFATypes:el(ep(o.MFAS_CAN_CHOOSE))}};case"SMS_OTP":case"SMS_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_SMS_CODE",codeDeliveryDetails:{deliveryMedium:o.CODE_DELIVERY_DELIVERY_MEDIUM,destination:o.CODE_DELIVERY_DESTINATION}}};case"SOFTWARE_TOKEN_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_TOTP_CODE"}};case"EMAIL_OTP":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_EMAIL_CODE",codeDeliveryDetails:{deliveryMedium:o.CODE_DELIVERY_DELIVERY_MEDIUM,destination:o.CODE_DELIVERY_DESTINATION}}};case"WEB_AUTHN":{let e=await X(o);if("isSignedIn"in e&&"nextStep"in e)return e;return ec(e)}case"PASSWORD":case"PASSWORD_SRP":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_PASSWORD"}};case"SELECT_CHALLENGE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION",availableChallenges:i}}}throw new u.l({name:l.kq.SignInException,message:`An error occurred during the sign in process. ${n} challengeName returned by the underlying service was not addressed.`})}function eu(e){return e===d.OK.PasswordResetRequiredException?{isSignedIn:!1,nextStep:{signInStep:"RESET_PASSWORD"}}:e===d.OK.UserNotConfirmedException?{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_UP"}}:void 0}function ed(e){return"SMS_MFA"===e?"SMS":"SOFTWARE_TOKEN_MFA"===e?"TOTP":"EMAIL_OTP"===e?"EMAIL":void 0}function el(e){if(e)return e.map(ed).filter(Boolean)}function ep(e){return e?JSON.parse(e):[]}async function eh(){let e;try{e=await (0,h.t)()}catch(e){}if(e&&e.userId&&e.username)throw new u.l({name:p.EU,message:"There is already a signed in user.",recoverySuggestion:"Call signOut before calling signIn again."})}function eg(e){return P.signInStore.getState().username??e}},42251:function(e,t,n){n.d(t,{R:function(){return c}});var o=n(87433),i=n(90445),r=n(34168);let s="amplify-signin-with-hostedUI",a="CognitoIdentityServiceProvider";class c{constructor(e){this.keyValueStorage=e}async clearOAuthInflightData(){(0,o.FG)(this.cognitoConfig);let e=u(a,this.cognitoConfig.userPoolClientId);await Promise.all([this.keyValueStorage.removeItem(e.inflightOAuth),this.keyValueStorage.removeItem(e.oauthPKCE),this.keyValueStorage.removeItem(e.oauthState)])}async clearOAuthData(){(0,o.FG)(this.cognitoConfig);let e=u(a,this.cognitoConfig.userPoolClientId);return await this.clearOAuthInflightData(),await this.keyValueStorage.removeItem(s),this.keyValueStorage.removeItem(e.oauthSignIn)}loadOAuthState(){(0,o.FG)(this.cognitoConfig);let e=u(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthState)}storeOAuthState(e){(0,o.FG)(this.cognitoConfig);let t=u(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(t.oauthState,e)}loadPKCE(){(0,o.FG)(this.cognitoConfig);let e=u(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthPKCE)}storePKCE(e){(0,o.FG)(this.cognitoConfig);let t=u(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(t.oauthPKCE,e)}setAuthConfig(e){this.cognitoConfig=e}async loadOAuthInFlight(){(0,o.FG)(this.cognitoConfig);let e=u(a,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(e.inflightOAuth)==="true"}async storeOAuthInFlight(e){(0,o.FG)(this.cognitoConfig);let t=u(a,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(t.inflightOAuth,`${e}`)}async loadOAuthSignIn(){(0,o.FG)(this.cognitoConfig);let e=u(a,this.cognitoConfig.userPoolClientId),t=await this.keyValueStorage.getItem(s),[n,i]=(await this.keyValueStorage.getItem(e.oauthSignIn))?.split(",")??[];return{isOAuthSignIn:"true"===n||"true"===t,preferPrivateSession:"true"===i}}async storeOAuthSignIn(e,t=!1){(0,o.FG)(this.cognitoConfig);let n=u(a,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(n.oauthSignIn,`${e},${t}`)}}let u=(e,t)=>
1(0,i._X)(r.Bx)(e,t)},26857:function(e,t,n){let o,i,r;function s(e,t){null!=e&&this.fromString(e,t)}function a(){return new s(null,null)}n.d(t,{Z:function(){return s}});let c="undefined"!=typeof navigator;c&&"Microsoft Internet Explorer"===navigator.appName?(s.prototype.am=function(e,t,n,o,i,r){let s=32767&t,a=t>>15;for(;--r>=0;){let t=32767&this[e],r=this[e++]>>15,c=a*t+r*s;i=((t=s*t+((32767&c)<<15)+n[o]+(1073741823&i))>>>30)+(c>>>15)+a*r+(i>>>30),n[o++]=1073741823&t}return i},o=30):c&&"Netscape"!==navigator.appName?(s.prototype.am=function(e,t,n,o,i,r){for(;--r>=0;){let r=t*this[e++]+n[o]+i;i=Math.floor(r/67108864),n[o++]=67108863&r}return i},o=26):(s.prototype.am=function(e,t,n,o,i,r){let s=16383&t,a=t>>14;for(;--r>=0;){let t=16383&this[e],r=this[e++]>>14,c=a*t+r*s;i=((t=s*t+((16383&c)<<14)+n[o]+i)>>28)+(c>>14)+a*r,n[o++]=268435455&t}return i},o=28),s.prototype.DB=o,s.prototype.DM=(1<<o)-1,s.prototype.DV=1<<o,s.prototype.FV=4503599627370496,s.prototype.F1=52-o,s.prototype.F2=2*o-52;let u=[];for(r=0,i=48;r<=9;++r)u[i++]=r;for(r=10,i=97;r<36;++r)u[i++]=r;for(r=10,i=65;r<36;++r)u[i++]=r;function d(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function l(e){let t=a();return t.fromInt(e),t}function p(e){let t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function h(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}h.prototype.convert=function(e){let t=a();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(s.ZERO)>0&&this.m.subTo(t,t),t},h.prototype.revert=function(e){let t=a();return e.copyTo(t),this.reduce(t),t},h.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(let t=0;t<this.m.t;++t){let n=32767&e[t],o=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(n=t+this.m.t,e[n]+=this.m.am(0,o,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},h.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},h.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},s.prototype.copyTo=function(e){for(let t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},s.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},s.prototype.fromString=function(e,t){let n;if(16===t)n=4;else if(8===t)n=3;else if(2===t)n=1;else if(32===t)n=5;else if(4===t)n=2;else throw Error("Only radix 2, 4, 8, 16, 32 are supported");this.t=0,this.s=0;let o=e.length,i=!1,r=0;for(;--o>=0;){let t=function(e,t){let n=u[e.charCodeAt(t)];return null==n?-1:n}(e,o);if(t<0){"-"===e.charAt(o)&&(i=!0);continue}i=!1,0===r?this[this.t++]=t:r+n>this.DB?(this[this.t-1]|=(t&(1<<this.DB-r)-1)<<r,this[this.t++]=t>>this.DB-r):this[this.t-1]|=t<<r,(r+=n)>=this.DB&&(r-=this.DB)}this.clamp(),i&&s.ZERO.subTo(this,this)},s.prototype.clamp=function(){let e=this.s&this.DM;for(;this.t>0&&this[this.t-1]==e;)--this.t},s.prototype.dlShiftTo=function(e,t){let n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},s.prototype.drShiftTo=function(e,t){for(let n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},s.prototype.lShiftTo=function(e,t){let n;let o=e%this.DB,i=this.DB-o,r=(1<<i)-1,s=Math.floor(e/this.DB),a=this.s<<o&this.DM;for(n=this.t-1;n>=0;--n)t[n+s+1]=this[n]>>i|a,a=(this[n]&r)<<o;for(n=s-1;n>=0;--n)t[n]=0;t[s]=a,t.t=this.t+s+1,t.s=this.s,t.clamp()},s.prototype.rShiftTo=function(e,t){t.s=this.s;let n=Math.floor(e/this.DB);if(n>=this.t){t.t=0;return}let o=e%this.DB,i=this.DB-o,r=(1<<o)-1;t[0]=this[n]>>o;for(let e=n+1;e<this.t;++e)t[e-n-1]|=(this[e]&r)<<i,t[e-n]=this[e]>>o;o>0&&(t[this.t-n-1]|=(this.s&r)<<i),t.t=this.t-n,t.clamp()},s.prototype.subTo=function(e,t){let n=0,o=0,i=Math.min(e.t,this.t);for(;n<i;)o+=this[n]-e[n],t[n++]=o&this.DM,o>>=this.DB;if(e.t<this.t){for(o-=e.s;n<this.t;)o+=this[n],t[n++]=o&this.DM,o>>=this.DB;o+=this.s}else{for(o+=this.s;n<e.t;)o-=e[n],t[n++]=o&this.DM,o>>=this.DB;o-=e.s}t.s=o<0?-1:0,o<-1?t[n++]=this.DV+o:o>0&&(t[n++]=o),t.t=n,t.clamp()},s.prototype.multiplyTo=function(e,t){let n=this.abs(),o=e.abs(),i=n.t;for(t.t=i+o.t;--i>=0;)t[i]=0;for(i=0;i<o.t;++i)t[i+n.t]=n.am(0,o[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!==e.s&&s.ZERO.subTo(t,t)},s.prototype.squareTo=function(e){let t=this.abs(),n=e.t=2*t.t;for(;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){let o=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,o,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},s.prototype.divRemTo=function(e,t,n){let o=e.abs();if(o.t<=0)return;let i=this.abs();if(i.t<o.t){null!=t&&t.fromInt(0),null!=n&&this.copyTo(n);return}null===n&&(n=a());let r=a(),c=this.s,u=e.s,d=this.DB-p(o[o.t-1]);d>0?(o.lShiftTo(d,r),i.lShiftTo(d,n)):(o.copyTo(r),i.copyTo(n));let l=r.t,h=r[l-1];if(0===h)return;let g=h*(1<<this.F1)+(l>1?r[l-2]>>this.F2:0),E=this.FV/g,f=(1<<this.F1)/g,m=1<<this.F2,y=n.t,I=y-l,S=null===t?a():t;for(r.dlShiftTo(I,S),n.compareTo(S)>=0&&(n[n.t++]=1,n.subTo(S,n)),s.ONE.dlShiftTo(l,S),S.subTo(r,r);r.t<l;)r[r.t++]=0;for(;--I>=0;){let e=n[--y]===h?this.DM:Math.floor(n[y]*E+(n[y-1]+m)*f);if((n[y]+=r.am(0,e,n,I,0,l))<e)for(r.dlShiftTo(I,S),n.subTo(S,n);n[y]<--e;)n.subTo(S,n)}null!==t&&(n.drShiftTo(l,t),c!==u&&s.ZERO.subTo(t,t)),n.t=l,n.clamp(),d>0&&n.rShiftTo(d,n),c<0&&s.ZERO.subTo(n,n)},s.prototype.invDigit=function(){if(this.t<1)return 0;let e=this[0];if((1&e)==0)return 0;let t=3&e;
1return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},s.prototype.addTo=function(e,t){let n=0,o=0,i=Math.min(e.t,this.t);for(;n<i;)o+=this[n]+e[n],t[n++]=o&this.DM,o>>=this.DB;if(e.t<this.t){for(o+=e.s;n<this.t;)o+=this[n],t[n++]=o&this.DM,o>>=this.DB;o+=this.s}else{for(o+=this.s;n<e.t;)o+=e[n],t[n++]=o&this.DM,o>>=this.DB;o+=e.s}t.s=o<0?-1:0,o>0?t[n++]=o:o<-1&&(t[n++]=this.DV+o),t.t=n,t.clamp()},s.prototype.toString=function(e){let t,n;if(this.s<0)return"-"+this.negate().toString(e);if(16==e)t=4;else if(8===e)t=3;else if(2===e)t=1;else if(32===e)t=5;else if(4===e)t=2;else throw Error("Only radix 2, 4, 8, 16, 32 are supported");let o=(1<<t)-1,i=!1,r="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(n=this[s]>>a)>0&&(i=!0,r=d(n));s>=0;)a<t?n=(this[s]&(1<<a)-1)<<t-a|this[--s]>>(a+=this.DB-t):(n=this[s]>>(a-=t)&o,a<=0&&(a+=this.DB,--s)),n>0&&(i=!0),i&&(r+=d(n));return i?r:"0"},s.prototype.negate=function(){let e=a();return s.ZERO.subTo(this,e),e},s.prototype.abs=function(){return this.s<0?this.negate():this},s.prototype.compareTo=function(e){let t=this.s-e.s;if(0!=t)return t;let n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},s.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this[this.t-1]^this.s&this.DM)},s.prototype.mod=function(e){let t=a();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(s.ZERO)>0&&e.subTo(t,t),t},s.prototype.equals=function(e){return 0===this.compareTo(e)},s.prototype.add=function(e){let t=a();return this.addTo(e,t),t},s.prototype.subtract=function(e){let t=a();return this.subTo(e,t),t},s.prototype.multiply=function(e){let t=a();return this.multiplyTo(e,t),t},s.prototype.divide=function(e){let t=a();return this.divRemTo(e,t,null),t},s.prototype.modPow=function(e,t,n){let o,i,r,s=e.bitLength(),c=l(1),u=new h(t);if(s<=0)return c;let d=[],g=3,E=(o=s<18?1:s<48?3:s<144?4:s<768?5:6)-1,f=(1<<o)-1;if(d[1]=u.convert(this),o>1){let e=a();for(u.sqrTo(d[1],e);g<=f;)d[g]=a(),u.mulTo(e,d[g-2],d[g]),g+=2}let m=e.t-1,y=!0,I=a();for(s=p(e[m])-1;m>=0;){for(s>=E?i=e[m]>>s-E&f:(i=(e[m]&(1<<s+1)-1)<<E-s,m>0&&(i|=e[m-1]>>this.DB+s-E)),g=o;(1&i)==0;)i>>=1,--g;if((s-=g)<0&&(s+=this.DB,--m),y)d[i].copyTo(c),y=!1;else{for(;g>1;)u.sqrTo(c,I),u.sqrTo(I,c),g-=2;g>0?u.sqrTo(c,I):(r=c,c=I,I=r),u.mulTo(I,d[i],c)}for(;m>=0&&(e[m]&1<<s)==0;)u.sqrTo(c,I),r=c,c=I,I=r,--s<0&&(s=this.DB-1,--m)}let S=u.revert(c);return n(null,S),S},s.ZERO=l(0),s.ONE=l(1)},30315:function(e,t,n){n.d(t,{$v:function(){return o},H3:function(){return r},rt:function(){return i}});let o="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",i={},r={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),i[e]=t,r[t]=e}},5270:function(e,t,n){n.d(t,{d:function(){return A}});var o=n(57826),i=n(42885),r=n(26857);let s=async({a:e,g:t,k:n,x:o,B:i,N:r,U:s})=>new Promise((a,c)=>{t.modPow(o,r,(t,u)=>{if(t){c(t);return}i.subtract(n.multiply(u)).modPow(e.add(s.multiply(o)),r,(e,t)=>{if(e){c(e);return}a(t.mod(r))})})});var a=n(73949),c=n(28364),u=n(30315);let d=e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=u.rt[e[n]];return t},l=e=>{let t=new c.f;t.update(e);let n=d(t.digestSync());return Array(64-n.length).join("0")+n},p=e=>l((0,a.z)(e)),h=/^[89a-f]/i,g=e=>{if(!(e instanceof r.Z))throw Error("Not a BigInteger");let t=0>e.compareTo(r.Z.ZERO),n=e.abs().toString(16);if(n=n.length%2!=0?`0${n}`:n,n=h.test(n)?`00${n}`:n,t){let e=n.split("").map(e=>{let t=15&~parseInt(e,16);return"0123456789ABCDEF".charAt(t)}).join("");(n=new r.Z(e,16).add(r.Z.ONE).toString(16)).toUpperCase().startsWith("FF8")&&(n=n.substring(2))}return n},E=({A:e,B:t})=>{let n=new r.Z(p(g(e)+g(t)),16);if(n.equals(r.Z.ZERO))throw Error("U cannot be zero.");return n},f=(e,t,n)=>{let o=new c.f(t);o.update(e);let i=o.digestSync(),r=new c.f(i);return r.update(n),r.digestSync().slice(0,16)};var m=n(72237);class y{constructor(e,t){this.words=[];let n=e;n=this.words=n||[],void 0!==t?this.sigBytes=t:this.sigBytes=4*n.length}random(e){let t=[];for(let n=0;n<e;n+=4)t.push((0,m.MX)().getRandomValues(new Uint32Array(1))[0]);return new y(t,e)}toString(){return function(e){let{words:t}=e,{sigBytes:n}=e,o=[];for(let e=0;e<n;e++){let n=t[e>>>2]>>>24-e%4*8&255;o.push((n>>>4).toString(16)),o.push((15&n).toString(16))}return o.join("")}(this)}}let I=e=>{let t=new y().random(e).toString();return(0,a.z)(t)};var S=n(92614);let x=()=>
1S.u.convert(I(40));class v{constructor({userPoolName:e,a:t,g:n,A:o,N:s}){this.encoder=i.o,this.userPoolName=e,this.a=t,this.g=n,this.A=o,this.N=s,this.k=new r.Z(p(`${g(s)}${g(n)}`),16)}getRandomPassword(){if(!this.randomPassword)throw new o.l({name:"EmptyBigIntegerRandomPassword",message:"random password is empty"});return this.randomPassword}getSaltToHashDevices(){if(!this.saltToHashDevices)throw new o.l({name:"EmptyBigIntegersaltToHashDevices",message:"saltToHashDevices is empty"});return this.saltToHashDevices}getVerifierDevices(){if(!this.verifierDevices)throw new o.l({name:"EmptyBigIntegerVerifierDevices",message:"verifyDevices is empty"});return this.verifierDevices}async generateHashDevice(e,t){this.randomPassword=x();let n=l(`${e}${t}:${this.randomPassword}`),o=d(I(16));return this.saltToHashDevices=g(new r.Z(o,16)),new Promise((e,t)=>{this.g.modPow(new r.Z(p(this.saltToHashDevices+n),16),this.N,(n,o)=>{if(n){t(n);return}this.verifierDevices=g(o),e()})})}async getPasswordAuthenticationKey({username:e,password:t,serverBValue:n,salt:o}){if(n.mod(this.N).equals(r.Z.ZERO))throw Error("B cannot be zero.");let i=E({A:this.A,B:n}),c=l(`${this.userPoolName}${e}:${t}`),u=new r.Z(p(g(o)+c),16),d=await s({a:this.a,g:this.g,k:this.k,x:u,B:n,N:this.N,U:i}),h=this.encoder.convert("Caldera Derived Key"),m=this.encoder.convert("\x01"),y=new Uint8Array(h.byteLength+m.byteLength);return y.set(h,0),y.set(m,h.byteLength),f((0,a.z)(g(d)),(0,a.z)(g(i)),y)}}let w=async({a:e,g:t,N:n})=>new Promise((o,i)=>{t.modPow(e,n,(e,t)=>{if(e){i(e);return}if(t.mod(n).equals(r.Z.ZERO)){i(Error("Illegal parameter. A mod N cannot be 0."));return}o(t)})}),A=async e=>{let t=new r.Z(u.$v,16),n=new r.Z("2",16),o=C(),i=await w({a:o,g:n,N:t});return new v({userPoolName:e,a:o,g:n,A:i,N:t})},C=()=>{let e=d(I(128));return new r.Z(e,16)}},73949:function(e,t,n){n.d(t,{z:function(){return i}});var o=n(30315);let i=e=>{if(e.length%2!=0)throw Error("Hex encoded strings must have an even number length");let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2){let i=e.slice(n,n+2).toLowerCase();if(i in o.H3)t[n/2]=o.H3[i];else throw Error(`Cannot decode unrecognized sequence ${i} as hexadecimal`)}return t}},32386:function(e,t,n){n.d(t,{H:function(){return r}});let o=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],r=()=>{let e=new Date,t=i[e.getUTCDay()],n=o[e.getUTCMonth()],r=e.getUTCDate(),s=e.getUTCHours();s<10&&(s=`0${s}`);let a=e.getUTCMinutes();a<10&&(a=`0${a}`);let c=e.getUTCSeconds();c<10&&(c=`0${c}`);let u=e.getUTCFullYear();return`${t} ${n} ${r} ${s}:${a}:${c} UTC ${u}`}},32798:function(e,t,n){n.d(t,{i:function(){return a}});var o=n(28364),i=n(92614),r=n(70624),s=n(42885);let a=({userPoolName:e,username:t,challengeParameters:n,dateNow:r,hkdf:a})=>{let u=s.o.convert(e),d=s.o.convert(t),l=c(n.SECRET_BLOCK),p=s.o.convert(r),h=new Uint8Array(u.byteLength+d.byteLength+l.byteLength+p.byteLength);h.set(u,0),h.set(d,u.byteLength),h.set(l,u.byteLength+d.byteLength),h.set(p,u.byteLength+d.byteLength+l.byteLength);let g=new o.f(a);g.update(h);let E=g.digestSync();return i.u.convert(E)},c=e=>{let t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),o=r.$.convert(n),i=new Uint8Array(o.length);for(let e=0;e<o.length;++e)i[e]=o.charCodeAt(e);return i}},42885:function(e,t,n){n.d(t,{o:function(){return o}});let o={convert:e=>new TextEncoder().encode(e)}},34168:function(e,t,n){n.d(t,{Bx:function(){return l},CA:function(){return r},Cg:function(){return s},XD:function(){return u},tr:function(){return d}});var o=n(57826),i=n(99075);function r(e){if(!e||!e.accessToken)throw new o.l({name:i.Jg,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}function s(e){if(!e||!e.idToken)throw new o.l({name:i.Jg,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}let a=new o.l({name:i.hj,message:`Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. 2 Please change your oauth configuration to use 'code grant' flow.`,recoverySuggestion:`Please logout and change your Amplify configuration to use "code grant" flow. 3 E.g { responseType: 'code' }`}),c=new o.l({name:i.Jg,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function u(e){if(p(e)&&!e?.refreshToken)throw a;if(!(p(e)&&e?.refreshToken))throw c}function d(e){if(!e||!e.deviceKey||!e.deviceGroupKey||!e.randomPassword)throw new o.l({name:i.mP,message:"Either deviceKey, deviceGroupKey or secretPassword were not found during the sign-in process.",recoverySuggestion:"Make sure to not clear storage after calling the signIn API."})}let l={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function p(e){return e?.accessToken||e?.idToken}},6801:function(e,t,n){n.d(t,{u:function(){return o}});function o({username:e,userPoolId:t,userPoolClientId:n}
3){if("undefined"==typeof window)return;let o=window.AmazonCognitoAdvancedSecurityData;if(void 0===o)return;let i=o.getData(e,t,n);return i?{EncodedData:i}:{}}},83977:function(e,t,n){n.d(t,{W:function(){return r}});var o=n(52954),i=n(85230);let r=(e,t)=>(0,o.Zm)({category:i.WD.Auth,action:e,...t})},85871:function(e,t,n){n.d(t,{SQ:function(){return s},Xb:function(){return u},qC:function(){return d}});var o=n(53110),i=n(79059),r=n(75638);let s="undefined"!=typeof Symbol?Symbol("amplify_default"):"@@amplify_default",a=new o.k("Hub");class c{constructor(e){this.listeners=new Map,this.protectedChannels=["core","auth","api","analytics","interactions","pubsub","storage","ui","xr"],this.name=e}_remove(e,t){let n=this.listeners.get(e);if(!n){a.warn(`No listeners for ${e}`);return}this.listeners.set(e,[...n.filter(({callback:e})=>e!==t)])}dispatch(e,t,n,o){"string"==typeof e&&this.protectedChannels.indexOf(e)>-1&&o!==s&&a.warn(`WARNING: ${e} is protected and dispatching on it can have unintended consequences`);let i={channel:e,payload:{...t},source:n,patternInfo:[]};try{this._toListeners(i)}catch(e){a.error(e)}}listen(e,t,n="noname"){if("function"!=typeof t)throw new r._({name:i.z2,message:"No callback supplied to Hub"});let o=this.listeners.get(e);return o||(o=[],this.listeners.set(e,o)),o.push({name:n,callback:t}),()=>{this._remove(e,t)}}_toListeners(e){let{channel:t,payload:n}=e,o=this.listeners.get(t);o&&o.forEach(o=>{a.debug(`Dispatching to ${t} with `,n);try{o.callback(e)}catch(e){a.error(e)}})}}let u=new c("__default__"),d=new c("internal-hub")},53110:function(e,t,n){n.d(t,{k:function(){return a}});var o,i,r=n(79059);(o=i||(i={})).DEBUG="DEBUG",o.ERROR="ERROR",o.INFO="INFO",o.WARN="WARN",o.VERBOSE="VERBOSE",o.NONE="NONE";let s={VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};class a{constructor(e,t=i.WARN){this.name=e,this.level=t,this._pluggables=[]}_padding(e){return e<10?"0"+e:""+e}_ts(){let e=new Date;return[this._padding(e.getMinutes()),this._padding(e.getSeconds())].join(":")+"."+e.getMilliseconds()}configure(e){return e&&(this._config=e),this._config}_log(e,...t){let n=this.level;a.LOG_LEVEL&&(n=a.LOG_LEVEL),"undefined"!=typeof window&&window.LOG_LEVEL&&(n=window.LOG_LEVEL);let o=s[n];if(!(s[e]>=o))return;let r=console.log.bind(console);e===i.ERROR&&console.error&&(r=console.error.bind(console)),e===i.WARN&&console.warn&&(r=console.warn.bind(console)),a.BIND_ALL_LOG_LEVELS&&(e===i.INFO&&console.info&&(r=console.info.bind(console)),e===i.DEBUG&&console.debug&&(r=console.debug.bind(console)));let c=`[${e}] ${this._ts()} ${this.name}`,u="";if(1===t.length&&"string"==typeof t[0])r(u=`${c} - ${t[0]}`);else if(1===t.length)u=`${c} ${t[0]}`,r(c,t[0]);else if("string"==typeof t[0]){let e=t.slice(1);1===e.length&&(e=e[0]),u=`${c} - ${t[0]} ${e}`,r(`${c} - ${t[0]}`,e)}else u=`${c} ${t}`,r(c,t);for(let e of this._pluggables){let t={message:u,timestamp:Date.now()};e.pushLogs([t])}}log(...e){this._log(i.INFO,...e)}info(...e){this._log(i.INFO,...e)}warn(...e){this._log(i.WARN,...e)}error(...e){this._log(i.ERROR,...e)}debug(...e){this._log(i.DEBUG,...e)}verbose(...e){this._log(i.VERBOSE,...e)}addPluggable(e){e&&e.getCategoryName()===r.YG&&(this._pluggables.push(e),e.configure(this._config))}listPluggables(){return this._pluggables}}a.LOG_LEVEL=null,a.BIND_ALL_LOG_LEVELS=!1},63171:function(e,t,n){let o;n.d(t,{Cj:function(){return m},QW:function(){return y}});var i=n(85230),r=n(40257);let s=()=>"undefined"!=typeof global,a=()=>"undefined"!=typeof window,c=()=>"undefined"!=typeof document,u=()=>void 0!==r,d=(e,t)=>!!Object.keys(e).find(e=>e.startsWith(t));var l=n(40257),p=n(40257),h=n(40257);let g=[{platform:i.gQ.Expo,detectionMethod:function(){return s()&&void 0!==global.expo}},{platform:i.gQ.ReactNative,detectionMethod:function(){return"undefined"!=typeof navigator&&void 0!==navigator.product&&"ReactNative"===navigator.product}},{platform:i.gQ.NextJs,detectionMethod:function(){return a()&&window.next&&"object"==typeof window.next}},{platform:i.gQ.Nuxt,detectionMethod:function(){return a()&&(void 0!==window.__NUXT__||void 0!==window.$nuxt)}},{platform:i.gQ.Angular,detectionMethod:function(){let e=!!(c()&&document.querySelector("[ng-version]")),t=!!(a()&&void 0!==window.ng);return e||t}},{platform:i.gQ.React,detectionMethod:function(){let e=e=>e.startsWith("_react")||e.startsWith("__react");return c()&&Array.from(document.querySelectorAll("[id]")).some(t=>Object.keys(t).find(e))}},{platform:i.gQ.VueJs,detectionMethod:function(){return a()&&d(window,"__VUE")}},{platform:i.gQ.Svelte,detectionMethod:function(){return a()&&d(window,"__SVELTE")}},{platform:i.gQ.WebUnknown,detectionMethod:function(){return a()}},{platform:i.gQ.NextJsSSR,detectionMethod:function(){return s()&&(d(global,"__next")||d(global,"__NEXT"))}},{platform:i.gQ.NuxtSSR,detectionMethod:function(){return s()&&void 0!==global.__NUXT_PATHS__}},{platform:i.gQ.ReactSSR,detectionMethod:function(){return u()&&void 0!==l.env&&!!Object.keys(l.env).find(e=>e.includes("react"))}},{platform:i.gQ.VueJsSSR,detectionMethod:function(){return s()&&d(global,"__VUE")}},{platform:i.gQ.AngularSSR,detectionMethod:function(){return u()&&"object"==typeof h.env&&h.env.npm_lifecycle_script?.startsWith("ng ")||!1}},{platform:i.gQ.SvelteSSR,detectionMethod:function(){return u()&&void 0!==p.env&&!!Object.keys(p.env).find(e=>e.includes("svelte"))}}],E=[],f=!1,m=()=>{if(!o){if(o=g.find(e=>e.detectionMethod())?.platform||i.gQ.ServerSideUnknown,f)for(;E.length;)E.pop()?.();
3else E.forEach(e=>{e()});I(i.gQ.ServerSideUnknown,10),I(i.gQ.WebUnknown,10)}return o},y=e=>{f||E.push(e)};function I(e,t){o!==e||f||setTimeout(()=>{o=void 0,f=!0,setTimeout(m,1e3)},t)}},52954:function(e,t,n){n.d(t,{Zm:function(){return p}});var o=n(85230);let i="6.13.4";var r=n(63171);let s={},a=(e,t)=>s[e]?.[t]?.additionalDetails,c="aws-amplify",u=e=>e.replace(/\+.*/,"");class d{constructor(){this.userAgent=`${c}/${u(i)}`}get framework(){return(0,r.Cj)()}get isReactNative(){return this.framework===o.gQ.ReactNative||this.framework===o.gQ.Expo}observeFrameworkChanges(e){(0,r.QW)(e)}}new d;let l=({category:e,action:t}={})=>{let n=[[c,u(i)]];if(e&&n.push([e,t]),n.push(["framework",(0,r.Cj)()]),e&&t){let o=a(e,t);o&&o.forEach(e=>{n.push(e)})}return n},p=e=>l(e).map(([e,t])=>e&&t?`${e}/${t}`:e).join(" ")},85230:function(e,t,n){var o,i,r,s,a,c,u,d,l,p,h,g,E,f,m,y,I,S,x,v,w,A,C,R,P,T;n.d(t,{WD:function(){return i},g4:function(){return c},gQ:function(){return o}}),(m=o||(o={})).WebUnknown="0",m.React="1",m.NextJs="2",m.Angular="3",m.VueJs="4",m.Nuxt="5",m.Svelte="6",m.ServerSideUnknown="100",m.ReactSSR="101",m.NextJsSSR="102",m.AngularSSR="103",m.VueJsSSR="104",m.NuxtSSR="105",m.SvelteSSR="106",m.ReactNative="201",m.Expo="202",(y=i||(i={})).AI="ai",y.API="api",y.Auth="auth",y.Analytics="analytics",y.DataStore="datastore",y.Geo="geo",y.InAppMessaging="inappmessaging",y.Interactions="interactions",y.Predictions="predictions",y.PubSub="pubsub",y.PushNotification="pushnotification",y.Storage="storage",(I=r||(r={})).CreateConversation="1",I.GetConversation="2",I.ListConversations="3",I.DeleteConversation="4",I.SendMessage="5",I.ListMessages="6",I.OnMessage="7",I.Generation="8",I.UpdateConversation="9",(S=s||(s={})).Record="1",S.IdentifyUser="2",(x=a||(a={})).GraphQl="1",x.Get="2",x.Post="3",x.Put="4",x.Patch="5",x.Del="6",x.Head="7",(v=c||(c={})).SignUp="1",v.ConfirmSignUp="2",v.ResendSignUpCode="3",v.SignIn="4",v.FetchMFAPreference="6",v.UpdateMFAPreference="7",v.SetUpTOTP="10",v.VerifyTOTPSetup="11",v.ConfirmSignIn="12",v.DeleteUserAttributes="15",v.DeleteUser="16",v.UpdateUserAttributes="17",v.FetchUserAttributes="18",v.ConfirmUserAttribute="22",v.SignOut="26",v.UpdatePassword="27",v.ResetPassword="28",v.ConfirmResetPassword="29",v.FederatedSignIn="30",v.RememberDevice="32",v.ForgetDevice="33",v.FetchDevices="34",v.SendUserAttributeVerificationCode="35",v.SignInWithRedirect="36",v.StartWebAuthnRegistration="37",v.CompleteWebAuthnRegistration="38",v.ListWebAuthnCredentials="39",v.DeleteWebAuthnCredential="40",(w=u||(u={})).Subscribe="1",w.GraphQl="2",(A=d||(d={})).SearchByText="0",A.SearchByCoordinates="1",A.SearchForSuggestions="2",A.SearchByPlaceId="3",A.SaveGeofences="4",A.GetGeofence="5",A.ListGeofences="6",A.DeleteGeofences="7",(C=l||(l={})).SyncMessages="1",C.IdentifyUser="2",C.NotifyMessageInteraction="3",(p||(p={})).None="0",(R=h||(h={})).Convert="1",R.Identify="2",R.Interpret="3",(g||(g={})).Subscribe="1",(P=E||(E={})).InitializePushNotifications="1",P.IdentifyUser="2",(T=f||(f={})).UploadData="1",T.DownloadData="2",T.List="3",T.Copy="4",T.Remove="5",T.GetProperties="6",T.GetUrl="7",T.GetDataAccess="8",T.ListCallerAccessGrants="9"},51849:function(e,t,n){n.d(t,{b:function(){return r}});let o={id:"aws",outputs:{dnsSuffix:"amazonaws.com"},regionRegex:"^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$",regions:["aws-global"]},i={partitions:[o,{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn"},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:["aws-cn-global"]}]},r=e=>{let{partitions:t}=i;for(let{regions:n,outputs:o,regionRegex:i}of t){let t=new RegExp(i);if(n.includes(e)||t.test(e))return o.dnsSuffix}return o.outputs.dnsSuffix}},96526:function(e,t,n){n.d(t,{y:function(){return p}});let o=3,i=(e,t)=>{let n,o;if(t?.aborted)return Promise.resolve();let i=new Promise(t=>{o=t,n=setTimeout(t,e)});return t?.addEventListener("abort",function e(i){clearTimeout(n),t?.removeEventListener("abort",e),o()}),i},r=(e,t)=>{"[object Object]"===Object.prototype.toString.call(e)&&(e.$metadata={...e.$metadata??{},attempts:t})};var s=n(48146),a=n(75638),c=n(37701);let u=e=>{let t;return()=>(t||(t=e()),t)},d=e=>!["HEAD","GET","DELETE"].includes(e.toUpperCase()),l=async({url:e,method:t,headers:n,body:o}
3,{abortSignal:i,cache:r,withCrossDomainCredentials:s})=>{let l;try{l=await fetch(e,{method:t,headers:n,body:d(t)?o:void 0,signal:i,cache:r,credentials:s?"include":"same-origin"})}catch(e){if(e instanceof TypeError)throw new a._({name:c.Z.NetworkError,message:"A network error has occurred.",underlyingError:e});throw e}let p={};l.headers?.forEach((e,t)=>{p[t.toLowerCase()]=e});let h={statusCode:l.status,headers:p,body:null},g=Object.assign(l.body??{},{text:u(()=>l.text()),blob:u(()=>l.blob()),json:u(()=>l.json())});return{...h,body:g}},p=(0,s.V)(l,[({userAgentHeader:e="x-amz-user-agent",userAgentValue:t=""})=>n=>async function(o){if(0===t.trim().length)return await n(o);{let i=e.toLowerCase();return o.headers[i]=o.headers[i]?`${o.headers[i]} ${t}`:t,await n(o)}},({maxAttempts:e=o,retryDecider:t,computeDelay:n,abortSignal:s})=>{if(e<1)throw Error("maxAttempts must be greater than 0");return(o,a)=>async function(c){let u,d;let l=a.attemptsCount??0,p=()=>{if(d)return r(d,l),d;throw r(u,l),u};for(;!s?.aborted&&l<e;){try{d=await o(c),u=void 0}catch(e){u=e,d=void 0}l=(a.attemptsCount??0)>l?a.attemptsCount??0:l+1,a.attemptsCount=l;let{isCredentialsExpiredError:r,retryable:h}=await t(d,u,a);if(!h)return p();if(a.isCredentialsExpired=!!r,!s?.aborted&&l<e){let e=n(l);await i(e,s)}}if(!s?.aborted)return p();throw Error("Request aborted.")}}])},91742:function(e,t,n){n.d(t,{z:function(){return o}});let o=(e,t,n,o)=>async(i,r)=>{let s={...o,...i},a=await s.endpointResolver(s,r),c=await t(r,a);return n(await e(c,{...s}))}},48146:function(e,t,n){n.d(t,{V:function(){return o}});let o=(e,t)=>(n,o)=>{let i={},r=t=>e(t,o);for(let e=t.length-1;e>=0;e--)r=(0,t[e])(o)(r,i);return r(n)}},12221:function(e,t,n){n.d(t,{j:function(){return s}});var o=n(37701);let i=["AuthFailure","InvalidSignatureException","RequestExpired","RequestInTheFuture","RequestTimeTooSkewed","SignatureDoesNotMatch","BadRequestException"],r=e=>!!e&&i.includes(e),s=e=>async(t,n)=>{let o=n??await e(t)??void 0,i=o?.code||o?.name,s=t?.statusCode;return{retryable:d(n)||u(s,i)||r(i)||l(s,i)}},a=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException"],c=["TimeoutError","RequestTimeout","RequestTimeoutException"],u=(e,t)=>
3429===e||!!t&&a.includes(t),d=e=>[o.Z.NetworkError,"ERR_NETWORK"].includes(e?.name),l=(e,t)=>!!e&&[500,502,503,504].includes(e)||!!t&&c.includes(t)},37487:function(e,t,n){n.d(t,{k:function(){return o}});let o=e=>{let t=(function(e=3e5){return t=>{let n=2**t*100+100*Math.random();return!(n>e)&&n}})(3e5)(e);return!1===t?3e5:t}},48880:function(e,t,n){n.d(t,{e:function(){return r},f:function(){return i}});var o=n(20831);let i=async e=>{if(!e||e.statusCode<300)return;let t=await r(e),n=(e=>{let[t]=e.toString().split(/[,:]+/);return t.includes("#")?t.split("#")[1]:t})(e.headers["x-amzn-errortype"]??t.code??t.__type??"UnknownError");return Object.assign(Error(t.message??t.Message??"Unknown error"),{name:n,$metadata:(0,o.B)(e)})},r=async e=>{if(!e.body)throw Error("Missing response payload");return Object.assign(await e.body.json(),{$metadata:(0,o.B)(e)})}},20831:function(e,t,n){n.d(t,{B:function(){return o}});let o=e=>{let{headers:t,statusCode:n}=e;return{...i(e)?e.$metadata:{},httpStatusCode:n,requestId:t["x-amzn-requestid"]??t["x-amzn-request-id"]??t["x-amz-request-id"],extendedRequestId:t["x-amz-id-2"],cfId:t["x-amz-cf-id"]}},i=e=>"object"==typeof e?.$metadata},79059:function(e,t,n){n.d(t,{YG:function(){return o},z2:function(){return i}});let o="Logging",i="NoHubcallbackProvidedException"},75638:function(e,t,n){n.d(t,{_:function(){return o}});class o extends Error{constructor({message:e,name:t,recoverySuggestion:n,underlyingError:i}){super(e),this.name=t,this.underlyingError=i,this.recoverySuggestion=n,this.constructor=o,Object.setPrototypeOf(this,o.prototype)}}},97808:function(e,t,n){n.d(t,{$:function(){return i}});var o=n(75638);let i=(e,t=o._)=>(n,o,i)=>{let{message:r,recoverySuggestion:s}=e[o];if(!n)throw new t({name:o,message:i?`${r} ${i}`:r,recoverySuggestion:s})}},79722:function(e,t,n){n.d(t,{d:function(){return u}});var o=n(85871);let i=e=>{for(let t of Reflect.ownKeys(e)){let n=e[t];(n&&"object"==typeof n||"function"==typeof n)&&i(n)}return Object.freeze(e)},r=Symbol("oauth-listener");var s=n(64686);n(28364),n(41162);class a{configure(e,t){this.authConfig=e,this.authOptions=t}async fetchAuthSession(e={}){let t,n;let o=await this.getTokens(e);return o?(n=o.accessToken?.payload?.sub,t=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,tokens:o,authenticated:!0,forceRefresh:e.forceRefresh})):t=await this.authOptions?.credentialsProvider?.getCredentialsAndIdentityId({authConfig:this.authConfig,authenticated:!1,forceRefresh:e.forceRefresh}),{tokens:o,credentials:t?.credentials,identityId:t?.identityId,userSub:n}}async clearCredentials(){await this.authOptions?.credentialsProvider?.clearCredentialsAndIdentityId()}async getTokens(e){return await this.authOptions?.tokenProvider?.getTokens(e)??void 0}}class c{constructor(){this.oAuthListener=void 0,this.resourcesConfig={},this.libraryOptions={},this.Auth=new a}configure(e,t){let n=(0,s.h)(e);this.resourcesConfig=n,t&&(this.libraryOptions=t),this.resourcesConfig=i(this.resourcesConfig),this.Auth.configure(this.resourcesConfig.Auth,this.libraryOptions.Auth),o.Xb.dispatch("core",{event:"configure",data:this.resourcesConfig},"Configure",o.SQ),this.notifyOAuthListener()}getConfig(){return this.resourcesConfig}[r](e){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth?e(this.resourcesConfig.Auth?.Cognito):this.oAuthListener=e}notifyOAuthListener(){this.resourcesConfig.Auth?.Cognito.loginWith?.oauth&&this.oAuthListener&&(this.oAuthListener(this.resourcesConfig.Auth?.Cognito),this.oAuthListener=void 0)}}let u=new c},87433:function(e,t,n){n.d(t,{YE:function(){return l},V0:function(){return d},FG:function(){return u},xp:function(){return p}});var o,i,r=n(70624),s=n(97808);(o=i||(i={})).AuthTokenConfigException="AuthTokenConfigException",o.AuthUserPoolAndIdentityPoolException="AuthUserPoolAndIdentityPoolException",o.AuthUserPoolException="AuthUserPoolException",o.InvalidIdentityPoolIdException="InvalidIdentityPoolIdException",o.OAuthNotConfigureException="OAuthNotConfigureException";let a={[i.AuthTokenConfigException]:{message:"Auth Token Provider not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app."},[i.AuthUserPoolAndIdentityPoolException]:{message:"Auth UserPool or IdentityPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with UserPoolId and IdentityPoolId."},[i.AuthUserPoolException]:{message:"Auth UserPool not configured.",recoverySuggestion:"Make sure to call Amplify.configure in your app with userPoolId and userPoolClientId."},[i.InvalidIdentityPoolIdException]:{message:"Invalid identity pool id provided.",recoverySuggestion:"Make sure a valid identityPoolId is given in the config."},[i.OAuthNotConfigureException]:{message:"oauth param not configured.",recoverySuggestion:"Make sure to call Amplify.configure with oauth parameter in your app."}},c=(0,s.$)(a);function u(e){c(!!e&&!!e.userPoolId&&!!e.userPoolClientId,i.AuthUserPoolException)}function d(e){c(!!e?.loginWith?.oauth?.domain&&!!e?.loginWith?.oauth?.redirectSignOut&&!!e?.loginWith?.oauth?.redirectSignIn&&!!e?.loginWith?.oauth?.responseType,i.OAuthNotConfigureException)}function l(e){c(!!e?.identityPoolId,i.InvalidIdentityPoolIdException)}function p(e){let t=e.split(".");if(3!==t.length)throw Error("Invalid token");try{let n=t[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(r.$.convert(n).split("").map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join("")),i=JSON.parse(o);return{toString:()=>e,payload:i}}catch(e){throw Error("Invalid token payload")}}},10924:function(e,t,n){n.d(t,{y:function(){return r}});var o=n(79722),i=n(77116);let r=e=>(0,i.y)(o.d,e)},77116:function(e,t,n){n.d(t,{y:function(){return o}});let o=(e,t)=>e.Auth.fetchAuthSession(t)},12876:function(e,t,n){n.d(t,{Fm:function(){return f},$2:function(){return m}});var o=n(37701),i=n(75638);class r extends i._{constructor(){super({name:o.Z.PlatformNotSupported,message:"Function not supported on current platform"})}}class s{constructor(e){this.storage=e}async setItem(e,t){if(!this.storage)throw new r;this.storage.setItem(e,t)}async getItem(e){if(!this.storage)throw new r;return this.storage.getItem(e)}async removeItem(e){if(!this.storage)throw new r;this.storage.removeItem(e)}async clear(){if(!this.storage)throw new r;this.storage.clear()}}var a=n(53110);class c{constructor(){this.storage=new Map}get length(){return this.storage.size}key(e){return e>this.length-1?null:Array.from(this.storage.keys())[e]}setItem(e,t){this.storage.set(e,t)}getItem(e){return this.storage.get(e)??null}removeItem(e){this.storage.delete(e)}clear(){this.storage.clear()}}let u=new a.k("CoreStorageUtils"),d=()=>{try{if("undefined"!=typeof window&&window.localStorage)return window.localStorage}catch(e){u.info("localStorage not found. InMemoryStorage is used as a fallback.")}return new c},l=()=>{try{if("undefined"!=typeof window&&window.sessionStorage)return window.sessionStorage.getItem("test"),window.sessionStorage;throw Error("sessionStorage is not defined")}catch(e){return u.info("sessionStorage not found. InMemoryStorage is used as a fallback."),new c}};class p extends s{constructor(){super(d())}}class h extends s{constructor(){super(l())}}class g{constructor(e){this._storage=e}get storage(){if(!this._storage)throw new r;return this._storage}setItem(e,t){this.storage.setItem(e,t)}getItem(e){return this.storage.getItem(e)}removeItem(e){this.storage.removeItem(e)}clear(){this.storage.clear()}}class E extends g{constructor(){super(l())}}let f=new p;new h;let m=new E;new s(new c)},37701:function(e,t,n){var o,i;n.d(t,{Z:function(){return o}}),(i=o||(o={})).NoEndpointId="NoEndpointId",i.PlatformNotSupported="PlatformNotSupported",i.Unknown="Unknown",i.NetworkError="NetworkError"},69514:function(e,t,n){n.d(t,{a:function(){return o}});let o=URL},70624:function(e,t,n){n.d(t,{$:function(){return i}});var o=n(72237);let i={convert(e,t){let n=e;return t?.urlSafe&&(n=n.replace(/-/g,"+").replace(/_/g,"/")),(0,o.tl)()(n)}}},92614:function(e,t,n){n.d(t,{u:function(){return i}});var o=n(72237);let i={convert(e,t={urlSafe:!1,skipPadding:!1}){let n="string"==typeof e?e:Array.from(e,e=>String.fromCodePoint(e)).join(""),i=(0,o.Ds)()(n);return t.urlSafe&&(i=i.replace(/\+/g,"-").replace(/\//g,"_")),t.skipPadding&&(i=i.replace(/=/g,"")),i}}},72237:function(e,t,n){n.d(t,{Ds:function(){return r},MX:function(){return i},tl:function(){return s}});var o=n(75638);let i=()=>
3{if("object"==typeof window&&"object"==typeof window.crypto)return window.crypto;if("object"==typeof crypto)return crypto;throw new o._({name:"MissingPolyfill",message:"Cannot resolve the `crypto` function from the environment."})},r=()=>{if("undefined"!=typeof window&&"function"==typeof window.btoa)return window.btoa;if("function"==typeof btoa)return btoa;throw new o._({name:"Base64EncoderError",message:"Cannot resolve the `btoa` function from the environment."})},s=()=>{if("undefined"!=typeof window&&"function"==typeof window.atob)return window.atob;if("function"==typeof atob)return atob;throw new o._({name:"Base64EncoderError",message:"Cannot resolve the `atob` function from the environment."})}},99262:function(e,t,n){n.d(t,{j:function(){return o}});let o=()=>"undefined"!=typeof window&&void 0!==window.document},64686:function(e,t,n){n.d(t,{h:function(){return h}});var o=n(53110),i=n(75638);let r=new o.k("parseAWSExports"),s={API_KEY:"apiKey",AWS_IAM:"iam",AMAZON_COGNITO_USER_POOLS:"userPool",OPENID_CONNECT:"oidc",NONE:"none",AWS_LAMBDA:"lambda",LAMBDA:"lambda"},a=(e={})=>{if(!Object.prototype.hasOwnProperty.call(e,"aws_project_region"))throw new i._({name:"InvalidParameterException",message:"Invalid config parameter.",recoverySuggestion:"Ensure passing the config object imported from `amplifyconfiguration.json`."});let{aws_appsync_apiKey:t,aws_appsync_authenticationType:n,aws_appsync_graphqlEndpoint:o,aws_appsync_region:a,aws_bots_config:c,aws_cognito_identity_pool_id:l,aws_cognito_sign_up_verification_method:p,aws_cognito_mfa_configuration:h,aws_cognito_mfa_types:g,aws_cognito_password_protection_settings:E,aws_cognito_verification_mechanisms:f,aws_cognito_signup_attributes:m,aws_cognito_social_providers:y,aws_cognito_username_attributes:I,aws_mandatory_sign_in:S,aws_mobile_analytics_app_id:x,aws_mobile_analytics_app_region:v,aws_user_files_s3_bucket:w,aws_user_files_s3_bucket_region:A,aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing:C,aws_user_pools_id:R,aws_user_pools_web_client_id:P,geo:T,oauth:N,predictions:U,aws_cloud_logic_custom:_,Notifications:b,modelIntrospection:F}=e,D={};x&&(D.Analytics={Pinpoint:{appId:x,region:v}});let{InAppMessaging:k,Push:M}=b??{};if(k?.AWSPinpoint||M?.AWSPinpoint){if(k?.AWSPinpoint){let{appId:e,region:t}=k.AWSPinpoint;D.Notifications={InAppMessaging:{Pinpoint:{appId:e,region:t}}}}if(M?.AWSPinpoint){let{appId:e,region:t}=M.AWSPinpoint;D.Notifications={...D.Notifications,PushNotification:{Pinpoint:{appId:e,region:t}}}}}if(Array.isArray(c)&&(D.Interactions={LexV1:Object.fromEntries(c.map(e=>[e.name,e]))}),o){let e=s[n];e||r.debug(`Invalid authentication type ${n}. Falling back to IAM.`),D.API={GraphQL:{endpoint:o,apiKey:t,region:a,defaultAuthMode:e??"iam"}},F&&(D.API.GraphQL.modelIntrospection=F)}let O=h?{status:h&&h.toLowerCase(),totpEnabled:g?.includes("TOTP")??!1,smsEnabled:g?.includes("SMS")??!1}:void 0,L=E?{minLength:E.passwordPolicyMinLength,requireLowercase:E.passwordPolicyCharacters?.includes("REQUIRES_LOWERCASE")??!1,requireUppercase:E.passwordPolicyCharacters?.includes("REQUIRES_UPPERCASE")??!1,requireNumbers:E.passwordPolicyCharacters?.includes("REQUIRES_NUMBERS")??!1,requireSpecialCharacters:E.passwordPolicyCharacters?.includes("REQUIRES_SYMBOLS")??!1}:void 0,V=Array.from(new Set([...f??[],...m??[]])).reduce((e,t)=>({...e,[t.toLowerCase()]:{required:!0}}),{}),K=I?.includes("EMAIL")??!1,q=I?.includes("PHONE_NUMBER")??!1;(l||R)&&(D.Auth={Cognito:{identityPoolId:l,allowGuestAccess:"enable"!==S,signUpVerificationMethod:p,userAttributes:V,userPoolClientId:P,userPoolId:R,mfa:O,passwordFormat:L,loginWith:{username:!(K||q),email:K,phone:q}}});let B=!!N&&Object.keys(N).length>0,G=!!y&&y.length>0;if(D.Auth&&B&&(D.Auth.Cognito.loginWith={...D.Auth.Cognito.loginWith,oauth:{...u(N),...G&&{providers:d(y)}}}),w&&(D.Storage={S3:{bucket:w,region:A,dangerouslyConnectToHttpEndpointForTesting:C}}),T){let{amazon_location_service:e}=T;D.Geo={LocationService:{maps:e.maps,geofenceCollections:e.geofenceCollections,searchIndices:e.search_indices,region:e.region}}}if(_&&(D.API={...D.API,REST:_.reduce((e,t)=>
3{let{name:n,endpoint:o,region:i,service:r}=t;return{...e,[n]:{endpoint:o,...r?{service:r}:void 0,...i?{region:i}:void 0}}},{})}),U){let{VoiceId:e}=U?.convert?.speechGenerator?.defaults??{};D.Predictions=e?{...U,convert:{...U.convert,speechGenerator:{...U.convert.speechGenerator,defaults:{voiceId:e}}}}:U}return D},c=e=>e?.split(",")??[],u=({domain:e,scope:t,redirectSignIn:n,redirectSignOut:o,responseType:i})=>({domain:e,scopes:t,redirectSignIn:c(n),redirectSignOut:c(o),responseType:i}),d=e=>e.map(e=>{let t=e.toLowerCase();return t.charAt(0).toUpperCase()+t.slice(1)}),l={AMAZON_COGNITO_USER_POOLS:"userPool",API_KEY:"apiKey",AWS_IAM:"iam",AWS_LAMBDA:"lambda",OPENID_CONNECT:"oidc"},p={GOOGLE:"Google",LOGIN_WITH_AMAZON:"Amazon",FACEBOOK:"Facebook",SIGN_IN_WITH_APPLE:"Apple"},h=e=>Object.keys(e).some(e=>e.startsWith("aws_"))?a(e):!function(e){let{version:t}=e;return!!t&&t.startsWith("1")}(e)?e:function(e){let t={};if(e.storage&&(t.Storage=function(e){if(!e)return;let{bucket_name:t,aws_region:n,buckets:o}=e;return{S3:{bucket:t,region:n,buckets:o&&function(e){let t={};return e.forEach(({name:e,bucket_name:n,aws_region:o,paths:i})=>{if(e in t)throw Error(`Duplicate friendly name found: ${e}. Name must be unique.`);let r=i?Object.entries(i).reduce((e,[t,n])=>(void 0!==n&&(e[t]=n),e),{}):void 0;t[e]={bucketName:n,region:o,paths:r}}),t}(o)}}}(e.storage)),e.auth&&(t.Auth=function(e){if(!e)return;let{user_pool_id:t,user_pool_client_id:n,identity_pool_id:o,password_policy:i,mfa_configuration:r,mfa_methods:s,unauthenticated_identities_enabled:a,oauth:c,username_attributes:u,standard_required_attributes:d,groups:l}=e,h={Cognito:{userPoolId:t,userPoolClientId:n,groups:l}};return o&&(h.Cognito={...h.Cognito,identityPoolId:o}),i&&(h.Cognito.passwordFormat={requireLowercase:i.require_lowercase,requireNumbers:i.require_numbers,requireUppercase:i.require_uppercase,requireSpecialCharacters:i.require_symbols,minLength:i.min_length??6}),r&&(h.Cognito.mfa={status:"OPTIONAL"===r?"optional":"REQUIRED"===r?"on":"off",smsEnabled:s?.includes("SMS"),totpEnabled:s?.includes("TOTP")}),a&&(h.Cognito.allowGuestAccess=a),c&&(h.Cognito.loginWith={oauth:{domain:c.domain,redirectSignIn:c.redirect_sign_in_uri,redirectSignOut:c.redirect_sign_out_uri,responseType:"token"===c.response_type?"token":"code",scopes:c.scopes,providers:function(e=[]){return e.reduce((e,t)=>(void 0!==p[t]&&e.push(p[t]),e),[])}(c.identity_providers)}}),u&&(h.Cognito.loginWith={...h.Cognito.loginWith,email:u.includes("email"),phone:u.includes("phone_number"),username:u.includes("username")}),d&&(h.Cognito.userAttributes=d.reduce((e,t)=>({...e,[t]:{required:!0}}),{})),h}(e.auth)),e.analytics&&(t.Analytics=function(e){if(!e?.amazon_pinpoint)return;let{amazon_pinpoint:t}=e;return{Pinpoint:{appId:t.app_id,region:t.aws_region}}}(e.analytics)),e.geo&&(t.Geo=function(e){if(!e)return;let{aws_region:t,geofence_collections:n,maps:o,search_indices:i}=e;return{LocationService:{region:t,searchIndices:i,geofenceCollections:n,maps:o}}}(e.geo)),e.data&&(t.API=function(e){if(!e)return;let{aws_region:t,default_authorization_type:n,url:o,api_key:i,model_introspection:r}=e;return{GraphQL:{endpoint:o,defaultAuthMode:l[n],region:t,apiKey:i,modelIntrospection:r}}}(e.data)),e.custom){let n=function(e){if(!e?.events)return;let{url:t,aws_region:n,api_key:o,default_authorization_type:i}=e.events;return{Events:{endpoint:t,defaultAuthMode:l[i],region:n,apiKey:o}}}(e.custom);n&&"Events"in n&&(t.API={...t.API,...n})}return e.notifications&&(t.Notifications=function(e){if(!e)return;let{aws_region:t,channels:n,amazon_pinpoint_app_id:o}=e,i=n.includes("IN_APP_MESSAGING"),r=n.includes("APNS")||n.includes("FCM");if(!(i||r))return;let s={};return i&&(s.InAppMessaging={Pinpoint:{appId:o,region:t}}),r&&(s.PushNotification={Pinpoint:{appId:o,region:t}}),s}(e.notifications)),t}(e)},33937:function(e,t,n){n.d(t,{M:function(){return a}});var o=n(69247),i=n(59329),r=n(68390),s=(e,t)=>(0,i.vx)(e.kind,e,{...e.context,authAttempt:t});function a(e){return({client:t,forward:n})=>{var a,c=new Set,u=(0,o.nN)(),d=(0,o.nN)(),l=new Map;function p(){a=void 0;var e=l;l=new Map,e.forEach(u.next)}function h(e){a=void 0;var t=l;l=new Map,t.forEach(t=>{d.next((0,r.b)(t,e))})}var g=null;return E=>{function f(){a=Promise.resolve().then(()=>e({mutate(e,n,i){var s=t.createRequestOperation("mutation",(0,r.h)(e,n),i);return(0,o.Vi)((0,o.qn)(1)((0,o.hX)(e=>e.operation.key===s.key&&s.context._instance===e.operation.context._instance)((0,o.Hr)(()=>{var e=y(s);c.add(e.context._instance),u.next(e)})(I))))},appendHeaders(e,t){var n="function"==typeof e.context.fetchOptions?e.context.fetchOptions():e.context.fetchOptions||{};return(0,i.vx)(e.kind,e,{...e.context,fetchOptions:{...n,headers:{...n.headers,...t}}})}})).then(e=>{e&&(g=e),p()}).catch(e=>{h(e)})}function m(e){l.set(e.key,s(e,!0)),g&&!a&&(a=g.refreshAuth().then(p).catch(h))}function y(e){return g?g.addAuthToOperation(e):e}f();var I=n((0,o.hX)(Boolean)((0,o.UI)(e=>"teardown"===e.kind?(l.delete(e.key),e):e.context._instance&&c.has(e.context._instance)?e:e.context.authAttempt?y(e):a||!g?(a||f(),l.has(e.key)||l.set(e.key,s(e,!1)),null):!e.context.authAttempt&&g&&g.willAuthError&&g.willAuthError(e)?(m(e),null):y(s(e,!1)))((0,o.TS)([u.source,E]))));return(0,o.TS)([d.source,(0,o.hX)(e=>!c.has(e.operation.context._instance)&&e.error&&g&&g.didAuthError&&g.didAuthError(e.error,e.operation)&&!e.operation.context.authAttempt?(m(e.operation),!1):(c.has(e.operation.context._instance)&&c.delete(e.operation.context._instance),!0))(I)])}}}},79122:function(e,t,n){n.d(t,{V:function(){return z}});var o=n(79722);function i(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var r=function e(t,n){function o(e,o,r){if("undefined"!=typeof document){"number"==typeof(r=i({},n,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),e=encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decode
3URIComponent).replace(/[()]/g,escape);var s="";for(var a in r)r[a]&&(s+="; "+a,!0!==r[a]&&(s+="="+r[a].split(";")[0]));return document.cookie=e+"="+t.write(o,e)+s}}return Object.create({set:o,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],o={},i=0;i<n.length;i++){var r=n[i].split("="),s=r.slice(1).join("=");try{var a=decodeURIComponent(r[0]);if(o[a]=t.read(s,a),e===a)break}catch(e){}}return e?o[e]:o}},remove:function(e,t){o(e,"",i({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,i({},this.attributes,t))},withConverter:function(t){return e(i({},this.converter,t),this.attributes)}},{attributes:{value:Object.freeze(n)},converter:{value:Object.freeze(t)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});class s{constructor(e={}){let{path:t,domain:n,expires:o,sameSite:i,secure:r}=e;if(this.domain=n,this.path=t||"/",this.expires=Object.prototype.hasOwnProperty.call(e,"expires")?o:365,this.secure=!Object.prototype.hasOwnProperty.call(e,"secure")||r,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!i||!["strict","lax","none"].includes(i))throw Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===i&&!this.secure)throw Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=i}}async setItem(e,t){r.set(e,t,this.getData())}async getItem(e){return r.get(e)??null}async removeItem(e){r.remove(e,this.getData())}async clear(){let e=Object.keys(r.get()).map(e=>this.removeItem(e));await Promise.all(e)}getData(){return{path:this.path,expires:this.expires,domain:this.domain,secure:this.secure,...this.sameSite&&{sameSite:this.sameSite}}}}var a=n(12876),c=n(64686),u=n(74567),d=n(53110),l=n(87433),p=n(90445);let h={identityId:"identityId"},g=new d.k("DefaultIdentityIdStore");class E{setAuthConfig(e){(0,l.YE)(e.Cognito),this.authConfig=e,this._authKeys=f("Cognito",e.Cognito.identityPoolId)}constructor(e){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=e}async loadIdentityId(){(0,l.YE)(this.authConfig?.Cognito);try{if(this._primaryIdentityId)return{id:this._primaryIdentityId,type:"primary"};{let e=await this.keyValueStorage.getItem(this._authKeys.identityId);if(e)return this._hasGuestIdentityId=!0,{id:e,type:"guest"};return null}}catch(e){return g.log("Error getting stored IdentityId.",e),null}}async storeIdentityId(e){(0,l.YE)(this.authConfig?.Cognito),"guest"===e.type?(this.keyValueStorage.setItem(this._authKeys.identityId,e.id),this._primaryIdentityId=void 0,this._hasGuestIdentityId=!0):(this._primaryIdentityId=e.id,this._hasGuestIdentityId&&(this.keyValueStorage.removeItem(this._authKeys.identityId),this._hasGuestIdentityId=!1))}async clearIdentityId(){this._primaryIdentityId=void 0,await this.keyValueStorage.removeItem(this._authKeys.identityId)}}let f=(e,t)=>(0,p._X)(h)(`com.amplify.${e}`,t);n(28364),n(41162);var m=n(20831),y=n(48880),I=n(91742),S=n(51849),x=n(96526),v=n(37487),w=n(12221),A=n(69514),C=n(48146),R=n(52954),P=n(63171);let T=(0,C.V)(x.y,[()=>e=>async function(t){return t.headers["cache-control"]="no-store",e(t)}]),N={service:"cognito-identity",endpointResolver:({region:e})=>({url:new A.a(`https://cognito-identity.${e}.${(0,S.b)(e)}`)}),retryDecider:(0,w.j)(y.f),computeDelay:v.k,userAgentValue:(0,R.Zm)(),cache:"no-store"};(0,P.QW)(()=>{N.userAgentValue=(0,R.Zm)()});let U=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),_=({url:e},t,n)=>({headers:t,url:e,body:n,method:"POST"}),b=async e=>{if(e.statusCode>=300)throw await (0,y.f)(e);{let t=await (0,y.e)(e);return{IdentityId:t.IdentityId,Credentials:F(t.Credentials),$metadata:(0,m.B)(e)}}},F=({AccessKeyId:e,SecretKey:t,SessionToken:n,Expiration:o}={})=>({AccessKeyId:e,SecretKey:t,SessionToken:n,Expiration:o&&new Date(1e3*o)}),D=(0,I.z)(T,(e,t)=>_(t,U("GetCredentialsForIdentity"),JSON.stringify(e)),b,N);var k=n(57826),M=n(99388),O=n(34168);let L=async e=>{if(!(e.statusCode>=300))return{IdentityId:(await (0,y.e)(e)).IdentityId,$metadata:(0,m.B)(e)};throw await (0,y.f)(e)},V=(0,I.z)(T,(e,t)=>_(t,U("GetId"),JSON.stringify(e)),L,N);function K(e){let t=(0,l.xp)(e).payload.iss,n={};if(!t)throw new k.l({name:"InvalidIdTokenException",message:"Invalid Idtoken."});return n[t.replace(/(^\w+:|^)\/\//,"")]=e,n}async function q({tokens:e,authConfig:t,identityIdStore:n}){n.setAuthConfig({Cognito:t});let o=await n.loadIdentityId();if(o)return o.id;let i=e?.idToken?K(e.idToken.toString()):{},r=await B(i,t);return n.storeIdentityId({id:r,type:e?"primary":"guest"}),r}async function B(e,t){let n=t?.identityPoolId,o=(0,M.N)(n),i=(await V({region:o},{IdentityPoolId:n,Logins:e})).IdentityId;if(!i)throw new k.l({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return i}let G=new d.k("CognitoCredentialsProvider");class W{constructor(e){this._nextCredentialsRefresh=0,this._identityIdStore=e}async clearCredentialsAndIdentityId(){G.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){G.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(e){let t=e.authenticated,{tokens:n}=e,{authConfig:o}=e;try{(0,l.YE)(o?.Cognito)}catch{return}if(!t&&!o.Cognito.allowGuestAccess)return;let{forceRefresh:i}=e,r=this.hasTokenChanged(n),s=await q({tokens:n,authConfig:o.Cognito,identityIdStore:this._identityIdStore});return((i||r)&&this.clearCredentials(),t)?((0,O.Cg)(n),this.credsForOIDCTokens(o.Cognito,n,s)):this.getGuestCredentials(s,o.Cognito)}async getGuestCredentials(e,t){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&!1===this._credentialsAndIdentityId.isAuthenticatedCreds)return G.info("returning stored credentials as they neither past TTL n
3or expired."),this._credentialsAndIdentityId;this.clearCredentials();let n=(0,M.N)(t.identityPoolId),o=await D({region:n},{IdentityId:e});if(o.Credentials&&o.Credentials.AccessKeyId&&o.Credentials.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+3e6;let t={credentials:{accessKeyId:o.Credentials.AccessKeyId,secretAccessKey:o.Credentials.SecretKey,sessionToken:o.Credentials.SessionToken,expiration:o.Credentials.Expiration},identityId:e};return o.IdentityId&&(t.identityId=o.IdentityId,this._identityIdStore.storeIdentityId({id:o.IdentityId,type:"guest"})),this._credentialsAndIdentityId={...t,isAuthenticatedCreds:!1},t}throw new k.l({name:"CredentialsNotFoundException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}async credsForOIDCTokens(e,t,n){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&!0===this._credentialsAndIdentityId.isAuthenticatedCreds)return G.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();let o=t.idToken?K(t.idToken.toString()):{},i=(0,M.N)(e.identityPoolId),r=await D({region:i},{IdentityId:n,Logins:o});if(r.Credentials&&r.Credentials.AccessKeyId&&r.Credentials.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+3e6;let e={credentials:{accessKeyId:r.Credentials.AccessKeyId,secretAccessKey:r.Credentials.SecretKey,sessionToken:r.Credentials.SessionToken,expiration:r.Credentials.Expiration},identityId:n};return r.IdentityId&&(e.identityId=r.IdentityId,this._identityIdStore.storeIdentityId({id:r.IdentityId,type:"primary"})),this._credentialsAndIdentityId={...e,isAuthenticatedCreds:!0,associatedIdToken:t.idToken?.toString()},e}throw new k.l({name:"CredentialsException",message:"Cognito did not respond with either Credentials, AccessKeyId or SecretKey."})}isPastTTL(){return void 0===this._nextCredentialsRefresh||this._nextCredentialsRefresh<=Date.now()}hasTokenChanged(e){return!!e&&!!this._credentialsAndIdentityId?.associatedIdToken&&e.idToken?.toString()!==this._credentialsAndIdentityId.associatedIdToken}}let $=new W(new E(a.Fm)),z={configure(e,t){let n=(0,c.h)(e);if(!n.Auth||t?.Auth){o.d.configure(n,t);return}if(!o.d.libraryOptions.Auth){u.D.setAuthConfig(n.Auth),u.D.setKeyValueStorage(t?.ssr?new s({sameSite:"lax"}):a.Fm),o.d.configure(n,{...t,Auth:{tokenProvider:u.D,credentialsProvider:$}});return}if(t){void 0!==t.ssr&&u.D.setKeyValueStorage(t.ssr?new s({sameSite:"lax"}):a.Fm),o.d.configure(n,{Auth:o.d.libraryOptions.Auth,...t});return}o.d.configure(n)},getConfig:()=>o.d.getConfig()}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.