PageSourceSearch

https://www.coolect.app/_next/static/chunks/6014-edde4397aaf047a8.js

js coolect.app collected 2026-10-04 23:47:43 UTC 110,017 bytes, 3 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6014],{99376:function(e,t,n){n.r(t);var i=n(35475),o={};for(var r in i)"default"!==r&&(o[r]=(function(e){return i[e]}).bind(0,r));n.d(t,o)},95377:function(e,t,n){n.d(t,{h:function(){return d}});var i=n(85230),o=n(6801),r=n(5270);n(28364);var s=n(66357),a=n(66388),c=n(31901),u=n(99388),l=n(83977);async function d({username:e,password:t,clientMetadata:n,config:d,tokenOrchestrator:h,authFlow:p,preferredChallenge:E}){let{userPoolId:f,userPoolClientId:g,userPoolEndpoint:y}=d,m=f?.split("_")[1]||"",x=await (0,r.d)(m),I={USERNAME:e,SRP_A:x.A.toString(16)};"USER_AUTH"===p&&E&&(I.PREFERRED_CHALLENGE=E);let v=(0,o.u)({username:e,userPoolId:f,userPoolClientId:g}),S=(0,a.N)({endpointResolver:(0,c.e)({endpointOverride:y})}),C=await S({region:(0,u.y)(f),userAgentValue:(0,l.W)(i.g4.SignIn)},{AuthFlow:p,AuthParameters:I,ClientMetadata:n,ClientId:g,UserContextData:v}),{ChallengeParameters:w,Session:A}=C,T=w?.USERNAME??e;return((0,s.r)(T),"PASSWORD_VERIFIER"===C.ChallengeName)?(0,s.H2)(s.ie,[t,w,n,A,x,d,h],T,h):C}},54501:function(e,t,n){var i;let o;function r(){return{username:void 0,challengeName:void 0,signInSession:void 0}}n.d(t,{P:function(){return c},k:function(){return a},signInStore:function(){return s}});let s=(o=(i=(e,t)=>{switch(t.type){case"SET_SIGN_IN_SESSION":return{...e,signInSession:t.value};case"SET_SIGN_IN_STATE":return{...t.value};case"SET_CHALLENGE_NAME":return{...e,challengeName:t.value};case"SET_USERNAME":return{...e,username:t.value};case"SET_INITIAL_STATE":return r();default:return e}})(r(),{type:"SET_INITIAL_STATE"}),{getState:()=>o,dispatch:e=>{o=i(o,e)}});function a(e){s.dispatch({type:"SET_SIGN_IN_STATE",value:e})}function c(){s.dispatch({type:"SET_INITIAL_STATE"})}},66388:function(e,t,n){n.d(t,{N:function(){return c}});var i=n(91742),o=n(5048),r=n(7107),s=n(83468),a=n(36168);let c=e=>(0,i.z)(s.x,(0,o.u)("InitiateAuth"),(0,r.o)(),{...a.n,...e})},23318:function(e,t,n){n.d(t,{t:function(){return a}});var i=n(39271),o=n(87433),r=n(34168);let s=async e=>{let t=e.getConfig().Auth?.Cognito;(0,o.FG)(t);let n=await e.Auth.getTokens({forceRefresh:!1});(0,r.CA)(n);let{"cognito:username":i,sub:s}=n.idToken?.payload??{},a={username:i,userId:s},c=n?.signInDetails;return c&&(a.signInDetails=c),a},a=async()=>s(i.d)},91727:function(e,t,n){n.d(t,{z:function(){return x}});var i=n(66357),o=n(39271),r=n(87433),s=n(39811),a=n(32002),c=n(45473),u=n(54501),l=n(12249),d=n(42096),h=n(85777);async function p(e){let t=o.d.getConfig().Auth?.Cognito;(0,r.FG)(t);let{username:n,password:p,options:E}=e,f={loginId:n,authFlowType:"CUSTOM_WITHOUT_SRP"},g=E?.clientMetadata;(0,a.n)(!!n,s.X.EmptySignInUsername),(0,a.n)(!p,s.X.CustomAuthSignInPassword);try{let{ChallengeName:e,ChallengeParameters:o,AuthenticationResult:r,Session:s}=await (0,i.H2)(i.pB,[n,g,t,d.C],n,d.C),a=(0,i.QS)(n);if((0,u.k)({signInSession:s,username:a,challengeName:e,signInDetails:f}),r)return(0,u.P)(),await (0,l.x)({username:a,...r,NewDeviceMetadata:await (0,i.FT)({userPoolId:t.userPoolId,userPoolEndpoint:t.userPoolEndpoint,newDeviceMetadata:r.NewDeviceMetadata,accessToken:r.AccessToken}),signInDetails:f}),await (0,h.O)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};return(0,i.cP)({challengeName:e,challengeParameters:o})}catch(t){(0,u.P)(),(0,c.R)(t);let e=(0,i.yM)(t.name);if(e)return e;throw t}}async function E(e){let{username:t,password:n,options:p}=e,E={loginId:t,authFlowType:"CUSTOM_WITH_SRP"},f=o.d.getConfig().Auth?.Cognito;(0,r.FG)(f);let g=p?.clientMetadata;(0,a.n)(!!t,s.X.EmptySignInUsername),(0,a.n)(!!n,s.X.EmptySignInPassword);try{let{ChallengeName:e,ChallengeParameters:o,AuthenticationResult:r,Session:s}=await (0,i.Mf)(t,n,g,f,d.C),a=(0,i.QS)(t);if((0,u.k)({signInSession:s,username:a,challengeName:e,signInDetails:E}),r)return await (0,l.x)({username:a,...r,NewDeviceMetadata:await (0,i.FT)({userPoolId:f.userPoolId,userPoolEndpoint:f.userPoolEndpoint,newDeviceMetadata:r.NewDeviceMetadata,accessToken:r.AccessToken}),signInDetails:E}),(0,u.P)(),await (0,h.O)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};return(0,i.cP)({challengeName:e,challengeParameters:o})}catch(t){(0,u.P)(),(0,c.R)(t);let e=(0,i.yM)(t.name);if(e)return e;throw t}}var f=n(57386);async function g(e){let{username:t,password:n}=e,p=o.d.getConfig().Auth?.Cognito,E={loginId:t,authFlowType:"USER_SRP_AUTH"};(0,r.FG)(p);let g=e.options?.clientMetadata;(0,a.n)(!!t,s.X.EmptySignInUsername),(0,a.n)(!!n,s.X.EmptySignInPassword);try{let{ChallengeName:e,ChallengeParameters:o,AuthenticationResult:r,Session:s}=await (0,i.U)(t,n,g,p,d.C),a=(0,i.QS)(t);if((0,u.k)({signInSession:s,username:a,challengeName:e,signInDetail
1s:E}),r)return(0,u.P)(),await (0,l.x)({username:a,...r,NewDeviceMetadata:await (0,i.FT)({userPoolId:p.userPoolId,userPoolEndpoint:p.userPoolEndpoint,newDeviceMetadata:r.NewDeviceMetadata,accessToken:r.AccessToken}),signInDetails:E}),await (0,h.O)(),(0,f.Dv)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};return(0,i.cP)({challengeName:e,challengeParameters:o})}catch(t){(0,u.P)(),(0,f.Dv)(),(0,c.R)(t);let e=(0,i.yM)(t.name);if(e)return e;throw t}}async function y(e){let{username:t,password:n,options:p}=e,E=o.d.getConfig().Auth?.Cognito,g={loginId:t,authFlowType:"USER_PASSWORD_AUTH"};(0,r.FG)(E);let y=p?.clientMetadata;(0,a.n)(!!t,s.X.EmptySignInUsername),(0,a.n)(!!n,s.X.EmptySignInPassword);try{let{ChallengeName:e,ChallengeParameters:o,AuthenticationResult:r,Session:s}=await (0,i.H2)(i.x6,[t,n,y,E,d.C],t,d.C),a=(0,i.QS)(t);if((0,u.k)({signInSession:s,username:a,challengeName:e,signInDetails:g}),r)return(0,u.P)(),await (0,l.x)({...r,username:a,NewDeviceMetadata:await (0,i.FT)({userPoolId:E.userPoolId,userPoolEndpoint:E.userPoolEndpoint,newDeviceMetadata:r.NewDeviceMetadata,accessToken:r.AccessToken}),signInDetails:g}),await (0,h.O)(),(0,f.Dv)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};return(0,i.cP)({challengeName:e,challengeParameters:o})}catch(t){(0,u.P)(),(0,f.Dv)(),(0,c.R)(t);let e=(0,i.yM)(t.name);if(e)return e;throw t}}var m=n(96510);async function x(e){(0,f.Dv)(!1);let t=e.options?.authFlowType;switch(await (0,i.OP)(),t){case"USER_SRP_AUTH":default:return g(e);case"USER_PASSWORD_AUTH":return y(e);case"CUSTOM_WITHOUT_SRP":return p(e);case"CUSTOM_WITH_SRP":return E(e);case"USER_AUTH":return(0,m.G)(e)}}},96510:function(e,t,n){n.d(t,{G:function(){return C}});var i=n(39271),o=n(87433),r=n(39811),s=n(32002),a=n(45473),c=n(66357),u=n(25280),l=n(54501),d=n(12249),h=n(85777),p=n(42096),E=n(85230),f=n(6801),g=n(66388),y=n(31901),m=n(99388),x=n(83977),I=n(95377);async function v({username:e,clientMetadata:t,config:n,tokenOrchestrator:i,preferredChallenge:o,password:a,session:u}){let{userPoolId:l,userPoolClientId:d,userPoolEndpoint:h}=n,p=(0,f.u)({username:e,userPoolId:l,userPoolClientId:d}),v={USERNAME:e};if(o){if("PASSWORD_SRP"===o)return(0,s.n)(!!a,r.X.EmptySignInPassword),(0,I.h)({username:e,password:a,clientMetadata:t,config:n,tokenOrchestrator:i,authFlow:"USER_AUTH",preferredChallenge:o});"PASSWORD"===o&&((0,s.n)(!!a,r.X.EmptySignInPassword),v.PASSWORD=a),v.PREFERRED_CHALLENGE=o}let S={AuthFlow:"USER_AUTH",AuthParameters:v,ClientMetadata:t,ClientId:d,UserContextData:p};u&&(S.Session=u);let C=(0,g.N)({endpointResolver:(0,y.e)({endpointOverride:h})}),w=await C({region:(0,m.y)(l),userAgentValue:(0,x.W)(E.g4.SignIn)},S);return(0,c.r)(e),w}var S=n(57386);async function C(e){let{username:t,password:n,options:E}=e,f=i.d.getConfig().Auth?.Cognito,g={loginId:t,authFlowType:"USER_AUTH"};(0,o.FG)(f);let y=E?.clientMetadata,m=E?.preferredChallenge;(0,s.n)(!!t,r.X.EmptySignInUsername);try{let e={username:t,config:f,tokenOrchestrator:p.C,clientMetadata:y,preferredChallenge:m,password:n},i=u.E.getState();i.active&&i.username===t&&(e.session=i.session);let o=await v(e),r=(0,c.QS)(t);if((0,l.k)({signInSession:o.Session,username:r,challengeName:o.ChallengeName,signInDetails:g}),o.AuthenticationResult)return(0,l.P)(),await (0,d.x)({username:r,...o.AuthenticationResult,NewDeviceMetadata:await (0,c.FT)({userPoolId:f.userPoolId,userPoolEndpoint:f.userPoolEndpoint,newDeviceMetadata:o.AuthenticationResult.NewDeviceMetadata,accessToken:o.AuthenticationResult.AccessToken}),signInDetails:g}),await (0,h.O)(),(0,S.Dv)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};return(0,c.cP)({challengeName:o.ChallengeName,challengeParameters:o.ChallengeParameters,availableChallenges:"AvailableChallenges"in o?o.AvailableChallenges:void 0})}catch(t){(0,l.P)(),(0,S.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 U}});var i=n(53110),o=n(39271),r=n(16175);function s(){return o.d.Auth.clearCredentials()}var a=n(85871),c=n(87433),u=n(85230),l=n(83977),d=n(57826),h=n(42251),p=n(42096),E=n(99388),f=n(34168);n(28364);let g=async e=>{await e.clearOAuthData(),p.C.clearTokens(),await s(),a.Xb.dispatch("auth",{event:"signedOut"},"Auth",a.SQ)},y=async e=>{window?.location&&(window.location.href=e.replace("http://","https://"))};var m=n(99075);let x=e=>e.startsWith(String((window.location.origin+window.location.pathname)??"/")),I=e=>e.includes(String(window.location.hostname)),v=e=>e.startsWith("http://"),S=e=>e.startsWith("https://"),C=async(e,t=!1,n)=>{(0,c.V0)(e);let{loginWith:i,userPoolClientId:o}=e,{domain:r,redirectSignOut:s}=i.oauth,a=function(e,t){if(t){let n=e?.find(e=>e===t);if(!n)throw m.x9;return n}{let t=e?.find(x)??e?.find(I),n=e?.find(S)??e?.find(v);if(t)return t;if(n)throw m.VL;throw m.vC}}(s,n);return y(`https://${r}/logout?${Object.entries({client_id:o,logout_uri:encodeURIComponent(a)}).map(([e,t])=>`${e}=${t}`).join("&")}`)},w=async(e,t,n,i)=>{let{isOAuthSignIn:o}=await t.loadOAuthSignIn(),r=await n.getOAuthMetadata();if(await g(t),o||r?.oauthSignIn)return C(e,!1,i)};var A=n(91742),T=n(83468),R=n(5048),P=n(7107),N=n(36168);let F=e=>
1(0,A.z)(T.x,(0,R.u)("RevokeToken"),(0,P.o)(),{...N.n,...e}),b=e=>(0,A.z)(T.x,(0,R.u)("GlobalSignOut"),(0,P.o)(),{...N.n,...e});var D=n(31901);let k=new i.k("Auth");async function U(e){let t;let n=o.d.getConfig().Auth?.Cognito;(0,c.FG)(n),e?.global?await M(n):await O(n);try{(0,c.V0)(n),t=!0}catch(e){t=!1}if(t){let t=new h.R(r.Fm);t.setAuthConfig(n);let{type:i}=await w(n,t,p.C,e?.oauth?.redirectUrl)??{};if("error"===i)throw new d.l({name:m.wW,message:"An error occurred when attempting to log out from OAuth provider."})}else p.C.clearTokens(),await s(),a.Xb.dispatch("auth",{event:"signedOut"},"Auth",a.SQ)}async function O(e){try{let{userPoolEndpoint:t,userPoolId:n,userPoolClientId:i}=e,o=await p.C.getTokenStore().loadTokens();if((0,f.XD)(o),_(o.accessToken)){let e=F({endpointResolver:(0,D.e)({endpointOverride:t})});await e({region:(0,E.y)(n),userAgentValue:(0,l.W)(u.g4.SignOut)},{ClientId:i,Token:o.refreshToken})}}catch(e){k.debug("Client signOut error caught but will proceed with token removal")}}async function M(e){try{let{userPoolEndpoint:t,userPoolId:n}=e,i=await p.C.getTokenStore().loadTokens();(0,f.CA)(i);let o=b({endpointResolver:(0,D.e)({endpointOverride:t})});await o({region:(0,E.y)(n),userAgentValue:(0,l.W)(u.g4.SignOut)},{AccessToken:i.accessToken.toString()})}catch(e){k.debug("Global signOut error caught but will proceed with token removal")}}let _=e=>!!e?.payload?.origin_jti},88198:function(e,t,n){n.d(t,{y:function(){return O}});var i=n(39271),o=n(87433),r=n(85230),s=n(32002),a=n(39811),c=n(99388);function u(e){return Object.entries(e).map(([e,t])=>({Name:e,Value:t}))}var l=n(85871),d=n(91727),h=n(57826),p=n(57386),E=n(99075),f=n(96510);function g(e,t){let n;return i=>{n||e(...i),clearTimeout(n),n=setTimeout(()=>{n=void 0},t)}}let y=g(function(e,t,n){let i=Date.now(),o=setInterval(async()=>{if(Date.now()-i>18e4)clearInterval(o),n(new h.l({name:E.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,p.Dv)();else try{let n=await (0,d.z)(e);"CONFIRM_SIGN_UP"!==n.nextStep.signInStep&&(t(n),clearInterval(o),(0,p.Dv)())}catch(e){clearInterval(o),n(e),(0,p.Dv)()}},5e3)},300),m=g(x,300);async function x(e,t,n){try{let n=e?.options?.authFlowType==="USER_AUTH"?await (0,f.G)(e):await (0,d.z)(e);t(n),(0,p.Dv)()}catch(e){n(e),(0,p.Dv)()}}function I(e){return async()=>new Promise((t,n)=>{m([e,t,n])})}var v=n(6801),S=n(83977),C=n(91742),w=n(48880),A=n(60117),T=n(45473),R=n(88881),P=n(5048),N=n(83468),F=n(36168);let b=()=>async e=>{if(e.statusCode>=300){let t=await (0,w.f)(e);if((0,T.R)(t),t.name===R.y3.InvalidParameterException&&/'password'/.test(t.message)&&/Member must not be null/.test(t.message)){let e=a.X.EmptySignUpPassword,{message:t,recoverySuggestion:n}=A.By[e];throw new h.l({name:e,message:t,recoverySuggestion:n})}throw new h.l({name:t.name,message:t.message})}return(0,w.e)(e)},D=e=>(0,C.z)(N.x,(0,P.u)("SignUp"),b(),{...F.n,...e});var k=n(31901),U=n(25280);async function O(e){let{username:t,password:n,options:d}=e,h=i.d.getConfig().Auth?.Cognito,E=h?.signUpVerificationMethod??"code",{clientMetadata:f,validationData:g,autoSignIn:m}=e.options??{};(0,o.FG)(h),(0,s.n)(!!t,a.X.EmptySignUpUsername);let x="boolean"!=typeof m?m:void 0,C={username:t,options:x};x?.authFlowType!=="CUSTOM_WITHOUT_SRP"&&(C.password=n);let{userPoolId:w,userPoolClientId:A,userPoolEndpoint:T}=h,R=D({endpointResolver:(0,k.e)({endpointOverride:T})}),P={Username:t,Password:void 0,UserAttributes:d?.userAttributes&&u(d?.userAttributes),ClientMetadata:f,ValidationData:g&&u(g),ClientId:A,UserContextData:(0,v.u)({username:t,userPoolId:w,userPoolClientId:A})};n&&(P.Password=n);let{UserSub:N,CodeDeliveryDetails:F,UserConfirmed:b,Session:O}=await R({region:(0,c.y)(w),userAgentValue:(0,S.W)(r.g4.SignUp)},P);(x||!0===m)&&(U.E.dispatch({type:"START"}),U.E.dispatch({type:"SET_USERNAME",value:t}),U.E.dispatch({type:"SET_SESSION",value:O}));let M={destination:F?.Destination,deliveryMedium:F?.DeliveryMedium,attributeName:F?.AttributeName},_=U.E.getState().active;if(b)return _?((0,p.I)(I(C)),{isSignUpComplete:!0,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN"},userId:N}):{isSignUpComplete:!0,nextStep:{signUpStep:"DONE"},userId:N};if(_){if("link"===E)return(0,p.I)(async()=>new Promise((e,t)=>
1{y([C,e,t])})),{isSignUpComplete:!1,nextStep:{signUpStep:"COMPLETE_AUTO_SIGN_IN",codeDeliveryDetails:M},userId:N};!function(e){let t=l.qC.listen("auth-internal",async({payload:n})=>{if("confirmSignUp"===n.event){let i=n.data;i?.isSignUpComplete&&(l.qC.dispatch("auth-internal",{event:"autoSignIn"}),(0,p.I)(I(e)),t())}}),n=setTimeout(()=>{t(),clearTimeout(n),(0,p.Dv)()},18e4)}(C)}return{isSignUpComplete:!1,nextStep:{signUpStep:"CONFIRM_SIGN_UP",codeDeliveryDetails:M},userId:N}}},77694:function(e,t,n){n.d(t,{sI:function(){return l},_X:function(){return h}});var i,o=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);(i||(i={})).InvalidAuthTokens="InvalidAuthTokens";let c={[i.InvalidAuthTokens]:{message:"Invalid tokens.",recoverySuggestion:"Make sure the tokens are valid."}},u=(0,a.$)(c);class l{constructor(){this.name="CognitoIdentityServiceProvider"}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,o.xp)(t),i=await this.getKeyValueStorage().getItem(e.idToken),s=i?(0,o.xp)(i):void 0,a=await this.getKeyValueStorage().getItem(e.refreshToken)??void 0,c=await this.getKeyValueStorage().getItem(e.clockDrift)??"0",u=Number.parseInt(c),l=await this.getKeyValueStorage().getItem(e.signInDetails),d={accessToken:n,idToken:s,refreshToken:a,deviceMetadata:await this.getDeviceMetadata()??void 0,clockDrift:u,username:await this.getLastAuthUser()};return l&&(d.signInDetails=JSON.parse(l)),d}catch(e){return null}}async storeTokens(e){u(void 0!==e,i.InvalidAuthTokens),await this.clearTokens();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()),e.refreshToken&&await this.getKeyValueStorage().setItem(n.refreshToken,e.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().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),i=await this.getKeyValueStorage().getItem(t.deviceGroupKey),o=await this.getKeyValueStorage().getItem(t.randomPasswordKey);return o&&i&&n?{deviceKey:n,deviceGroupKey:i,randomPassword:o}: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,o.FG)(this.authConfig?.Cognito);let t=e??await this.getLastAuthUser();return d(this.name,`${this.authConfig.Cognito.userPoolClientId}.${t}`)}getLastAuthUserKey(){(0,o.FG)(this.authConfig?.Cognito);let e=this.authConfig.Cognito.userPoolClientId;return`${this.name}.${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 d=(e,t)=>h(s)(`${e}`,t);function h(e){let t=Object.values({...e});return(e,n)=>t.reduce((t,i)=>({...t,[i]:`${e}.${n}.${i}`}),{})}},12249:function(e,t,n){n.d(t,{x:function(){return s}});var i=n(87433),o=n(75638),r=n(42096);async function s(e){if(e.AccessToken){let t,n,o;let s=(0,i.xp)(e.AccessToken),a=1e3*(s.payload.iat||0),c=new Date().getTime();e.RefreshToken&&(n=e.RefreshToken),e.IdToken&&(t=(0,i.xp)(e.IdToken)),e?.NewDeviceMetadata&&(o=e.NewDeviceMetadata);let u={accessToken:s,idToken:t,refreshToken:n,clockDrift:a>0?a-c:0,deviceMetadata:o,username:e.username};
1e?.signInDetails&&(u.signInDetails=e.signInDetails),await r.C.setTokens({tokens:u})}else throw new o._({message:"Invalid tokens",name:"InvalidTokens",recoverySuggestion:"Check Cognito UserPool settings"})}},42096:function(e,t,n){let i;n.d(t,{D:function(){return A},C:function(){return T}});var o,r=n(16175),s=n(87433),a=n(99388),c=n(34168),u=n(57826),l=n(66388),d=n(31901),h=n(6801);let p=(o=async({tokens:e,authConfig:t,username:n})=>{(0,s.FG)(t?.Cognito);let{userPoolId:i,userPoolClientId:o,userPoolEndpoint:r}=t.Cognito,p=(0,a.y)(i);(0,c.XD)(e);let E=e.refreshToken,f={REFRESH_TOKEN:E};e.deviceMetadata?.deviceKey&&(f.DEVICE_KEY=e.deviceMetadata.deviceKey);let g=(0,h.u)({username:n,userPoolId:i,userPoolClientId:o}),y=(0,l.N)({endpointResolver:(0,d.e)({endpointOverride:r})}),{AuthenticationResult:m}=await y({region:p},{ClientId:o,AuthFlow:"REFRESH_TOKEN_AUTH",AuthParameters:f,UserContextData:g}),x=(0,s.xp)(m?.AccessToken??""),I=m?.IdToken?(0,s.xp)(m.IdToken):void 0,{iat:v}=x.payload;if(!v)throw new u.l({name:"iatNotFoundException",message:"iat not found in access token"});return{accessToken:x,idToken:I,clockDrift:1e3*v-new Date().getTime(),refreshToken:E,username:n}},async(...e)=>i||(i=new Promise((t,n)=>{o(...e).then(e=>{t(e)}).catch(e=>{n(e)}).finally(()=>{i=void 0})})));var E=n(77694),f=n(85871),g=n(99262),y=n(6280),m=n(37701),x=n(45473);let I=new(n(42251)).R(r.Fm),v=[],S=e=>{v.push(e)};class C{constructor(){this.waitForInflightOAuth=(0,g.j)()?async()=>await I.loadOAuthInFlight()?(this.inflightPromise||(this.inflightPromise=new Promise((e,t)=>{S(e)})),this.inflightPromise):void 0:async()=>{}}setAuthConfig(e){I.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 i=!!t?.idToken&&(0,y.p)({expiresAt:(t.idToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0}),o=(0,y.p)({expiresAt:(t.accessToken?.payload?.exp??0)*1e3,clockDrift:t.clockDrift??0});return(e?.forceRefresh||i||o)&&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,i=await this.getTokenRefresher()({tokens:e,authConfig:this.authConfig,username:t});return i.signInDetails=n,await this.setTokens({tokens:i}),f.Xb.dispatch("auth",{event:"tokenRefresh"},"Auth",f.SQ),i}catch(e){return this.handleErrors(e)}}handleErrors(e){if((0,x.R)(e),e.name!==m.Z.NetworkError&&this.clearTokens(),f.Xb.dispatch("auth",{event:"tokenRefresh_failure",data:{error:e}},"Auth",f.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 w{constructor(){this.authTokenStore=new E.sI,this.authTokenStore.setKeyValueStorage(r.Fm),this.tokenOrchestrator=new C,this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore),this.tokenOrchestrator.setTokenRefresher(p)}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 A=new w,{tokenOrchestrator:T}=A},88881:function(e,t,n){var i,o,r,s,a,c,u,l,d,h,p,E,f,g,y,m,x,I,v,S,C,w,A,T,R,P,N,F,b,D,k,U,O,M,_,L,q,K,V,B,G,H,z,W,$,j,Q,Z;n.d(t,{OK:function(){return y},y3:function(){return v}}),(R=i||(i={})).ConcurrentModificationException="ConcurrentModificationException",R.ForbiddenException="ForbiddenException",R.InternalErrorException="InternalErrorException",R.InvalidParameterException="InvalidParameterException",R.NotAuthorizedException="NotAuthorizedException",R.ResourceNotFoundException="ResourceNotFoundException",R.SoftwareTokenMFANotFoundException="Softw
1areTokenMFANotFoundException",(P=o||(o={})).ForbiddenException="ForbiddenException",P.InternalErrorException="InternalErrorException",P.InvalidParameterException="InvalidParameterException",P.InvalidPasswordException="InvalidPasswordException",P.LimitExceededException="LimitExceededException",P.NotAuthorizedException="NotAuthorizedException",P.PasswordResetRequiredException="PasswordResetRequiredException",P.ResourceNotFoundException="ResourceNotFoundException",P.TooManyRequestsException="TooManyRequestsException",P.UserNotConfirmedException="UserNotConfirmedException",P.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",(F=s||(s={})).CodeMismatchException="CodeMismatchException",F.ExpiredCodeException="ExpiredCodeException",F.ForbiddenException="ForbiddenException",F.InternalErrorException="InternalErrorException",F.InvalidLambdaResponseException="InvalidLambdaResponseException",F.InvalidParameterException="InvalidParameterException",F.InvalidPasswordException="InvalidPasswordException",F.LimitExceededException="LimitExceededException",F.NotAuthorizedException="NotAuthorizedException",F.ResourceNotFoundException="ResourceNotFoundException",F.TooManyFailedAttemptsException="TooManyFailedAttemptsException",F.TooManyRequestsException="TooManyRequestsException",F.UnexpectedLambdaException="UnexpectedLambdaException",F.UserLambdaValidationException="UserLambdaValidationException",F.UserNotConfirmedException="UserNotConfirmedException",F.UserNotFoundException="UserNotFoundException",(b=a||(a={})).AliasExistsException="AliasExistsException",b.CodeMismatchException="CodeMismatchException",b.ExpiredCodeException="ExpiredCodeException",b.ForbiddenException="ForbiddenException",b.InternalErrorException="InternalErrorException",b.InvalidLambdaResponseException="InvalidLambdaResponseException",b.InvalidParameterException="InvalidParameterException",b.LimitExceededException="LimitExceededException",b.NotAuthorizedException="NotAuthorizedException",b.ResourceNotFoundException="ResourceNotFoundException",b.TooManyFailedAttemptsException="TooManyFailedAttemptsException",b.TooManyRequestsException="TooManyRequestsException",b.UnexpectedLambdaException="UnexpectedLambdaException",b.UserLambdaValidationException="UserLambdaValidationException",b.UserNotFoundException="UserNotFoundException",(D=c||(c={})).ForbiddenException="ForbiddenException",D.InternalErrorException="InternalErrorException",D.InvalidParameterException="InvalidParameterException",D.NotAuthorizedException="NotAuthorizedException",D.PasswordResetRequiredException="PasswordResetRequiredException",D.ResourceNotFoundException="ResourceNotFoundException",D.TooManyRequestsException="TooManyRequestsException",D.UserNotConfirmedException="UserNotConfirmedException",D.UserNotFoundException="UserNotFoundException",(k=u||(u={})).ForbiddenException="ForbiddenException",k.InternalErrorException="InternalErrorException",k.InvalidParameterException="InvalidParameterException",k.NotAuthorizedException="NotAuthorizedException",k.PasswordResetRequiredException="PasswordResetRequiredException",k.ResourceNotFoundException="ResourceNotFoundException",k.TooManyRequestsException="TooManyRequestsException",k.UserNotConfirmedException="UserNotConfirmedException",k.UserNotFoundException="UserNotFoundException",(U=l||(l={})).ForbiddenException="ForbiddenException",U.InternalErrorException="InternalErrorException",U.InvalidParameterException="InvalidParameterException",U.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",U.NotAuthorizedException="NotAuthorizedException",U.PasswordResetRequiredException="PasswordResetRequiredException",U.ResourceNotFoundException="ResourceNotFoundException",U.TooManyRequestsException="TooManyRequestsException",U.UserNotConfirmedException="UserNotConfirmedException",U.UserNotFoundException="UserNotFoundException",(O=d||(d={})).CodeDeliveryFailureException="CodeDeliveryFailureException",O.ForbiddenException="ForbiddenException",O.InternalErrorException="InternalErrorException",O.InvalidEmailRoleAccessPol
1icyException="InvalidEmailRoleAccessPolicyException",O.InvalidLambdaResponseException="InvalidLambdaResponseException",O.InvalidParameterException="InvalidParameterException",O.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",O.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",O.LimitExceededException="LimitExceededException",O.NotAuthorizedException="NotAuthorizedException",O.ResourceNotFoundException="ResourceNotFoundException",O.TooManyRequestsException="TooManyRequestsException",O.UnexpectedLambdaException="UnexpectedLambdaException",O.UserLambdaValidationException="UserLambdaValidationException",O.UserNotFoundException="UserNotFoundException",(M=h||(h={})).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",(_=p||(p={})).ExternalServiceException="ExternalServiceException",_.InternalErrorException="InternalErrorException",_.InvalidParameterException="InvalidParameterException",_.LimitExceededException="LimitExceededException",_.NotAuthorizedException="NotAuthorizedException",_.ResourceConflictException="ResourceConflictException",_.ResourceNotFoundException="ResourceNotFoundException",_.TooManyRequestsException="TooManyRequestsException",(L=E||(E={})).ExternalServiceException="ExternalServiceException",L.InternalErrorException="InternalErrorException",L.InvalidIdentityPoolConfigurationException="InvalidIdentityPoolConfigurationException",L.InvalidParameterException="InvalidParameterException",L.NotAuthorizedException="NotAuthorizedException",L.ResourceConflictException="ResourceConflictException",L.ResourceNotFoundException="ResourceNotFoundException",L.TooManyRequestsException="TooManyRequestsException",(q=f||(f={})).CodeDeliveryFailureException="CodeDeliveryFailureException",q.ForbiddenException="ForbiddenException",q.InternalErrorException="InternalErrorException",q.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",q.InvalidLambdaResponseException="InvalidLambdaResponseException",q.InvalidParameterException="InvalidParameterException",q.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",q.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",q.LimitExceededException="LimitExceededException",q.NotAuthorizedException="NotAuthorizedException",q.PasswordResetRequiredException="PasswordResetRequiredException",q.ResourceNotFoundException="ResourceNotFoundException",q.TooManyRequestsException="TooManyRequestsException",q.UnexpectedLambdaException="UnexpectedLambdaException",q.UserLambdaValidationException="UserLambdaValidationException",q.UserNotConfirmedException="UserNotConfirmedException",q.UserNotFoundException="UserNotFoundException",(K=g||(g={})).ForbiddenException="ForbiddenException",K.InternalErrorException="InternalErrorException",K.InvalidParameterException="InvalidParameterException",K.NotAuthorizedException="NotAuthorizedException",K.PasswordResetRequiredException="PasswordResetRequiredException",K.ResourceNotFoundException="ResourceNotFoundException",K.TooManyRequestsException="TooManyRequestsException",K.UserNotConfirmedException="UserNotConfirmedException",(V=y||(y={})).PasswordResetRequiredException="PasswordResetRequiredException",V.ForbiddenException="ForbiddenException",V.InternalErrorException="InternalErrorException",V.InvalidLambdaResponseException="InvalidLambdaResponseException",V.InvalidParameterException="InvalidParameterException",V.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",V.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",V.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",V.NotAuthorizedException="NotAuthorizedException",V.ResourceNotFoundException="ResourceNotFoundException",V.TooManyRequestsException="TooManyRequestsException",V.UnexpectedLambdaException="UnexpectedLambdaException",V.UserLambdaValidationException="UserLambdaValidationException",V.UserNotConfirmedException="UserNotConfirmedException",V.UserNotFoundException="UserNotFoundException",(B=m||(m={})).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=x||(x={})).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",(H=I||(I={})).ForbiddenException="ForbiddenException",H.InternalErrorException="InternalErrorException",H.InvalidParameterException="InvalidParameterException",H.NotAuthorizedException="NotAuthorizedException",H.PasswordResetRequiredException="PasswordResetRequiredException",H.ResourceNotFoundException="ResourceNotFoundException",H.UserNotConfirmedException="UserNotConfirmedException",H.UserNotFoundException="UserNotFoundException",(z=v||(v={})).CodeDeliveryFailureException="CodeDeliveryFailureException",z.InternalErrorException="InternalErrorException",z.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",z.InvalidLambdaResponseException="InvalidLambdaResponseException",z.InvalidParameterException="InvalidParameterException",z.InvalidPasswordException="InvalidPasswordException",z.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",z.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",z.NotAuthorizedException="NotAuthorizedException",z.ResourceNotFoundException="ResourceNotFoundException",z.TooManyRequestsException="TooManyRequestsException",z.UnexpectedLambdaException="UnexpectedLambdaException",z.UserLambdaValidationException="UserLambdaValidationException",z.UsernameExistsException="UsernameExistsException",(W=S||(S={})).AliasExistsException="AliasExistsException",W.CodeDeliveryFailureException="CodeDeliveryFailureException",W.CodeMismatchException="CodeMismatchException",W.ExpiredCodeException="ExpiredCodeException",W.ForbiddenException="ForbiddenException",W.InternalErrorException="InternalErrorException",W.InvalidEmailRoleAccessPolicyException="InvalidEmailRoleAccessPolicyException",W.InvalidLambdaResponseException="InvalidLambdaResponseException",W.InvalidParameterException="InvalidParameterException",W.InvalidSmsRoleAccessPolicyException="InvalidSmsRoleAccessPolicyException",W.InvalidSmsRoleTrustRelationshipException="InvalidSmsRoleTrustRelationshipException",W.NotAuthorizedException="NotAuthorizedException",W.PasswordResetRequiredException="PasswordResetRequiredException",W.ResourceNotFoundException="ResourceNotFoundException",W.TooManyRequestsException="TooManyRequestsException",W.UnexpectedLambdaException="UnexpectedLambdaException",W.UserLambdaValidationException="UserLambdaValidationException",W.UserNotConfirmedException="UserNotConfirmedException",W.UserNotFoundException="UserNotFoundException",($=C||(C={}
1)).CodeMismatchException="CodeMismatchException",$.EnableSoftwareTokenMFAException="EnableSoftwareTokenMFAException",$.ForbiddenException="ForbiddenException",$.InternalErrorException="InternalErrorException",$.InvalidParameterException="InvalidParameterException",$.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",$.NotAuthorizedException="NotAuthorizedException",$.PasswordResetRequiredException="PasswordResetRequiredException",$.ResourceNotFoundException="ResourceNotFoundException",$.SoftwareTokenMFANotFoundException="SoftwareTokenMFANotFoundException",$.TooManyRequestsException="TooManyRequestsException",$.UserNotConfirmedException="UserNotConfirmedException",$.UserNotFoundException="UserNotFoundException",(j=w||(w={})).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",(Q=A||(A={})).ForbiddenException="ForbiddenException",Q.InternalErrorException="InternalErrorException",Q.InvalidParameterException="InvalidParameterException",Q.InvalidUserPoolConfigurationException="InvalidUserPoolConfigurationException",Q.NotAuthorizedException="NotAuthorizedException",Q.PasswordResetRequiredException="PasswordResetRequiredException",Q.ResourceNotFoundException="ResourceNotFoundException",Q.TooManyRequestsException="TooManyRequestsException",Q.UserNotConfirmedException="UserNotConfirmedException",Q.UserNotFoundException="UserNotFoundException",(Z=T||(T={})).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"},85777:function(e,t,n){n.d(t,{O:function(){return a}});var i=n(85871),o=n(23318),r=n(99075),s=n(57826);let a=async()=>{try{i.Xb.dispatch("auth",{event:"signedIn",data:await (0,o.t)()},"Auth",i.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}}},66357:function(e,t,n){n.d(t,{OP:function(){return eC},QS:function(){return eR},FT:function(){return ew},cP:function(){return em},yM:function(){return ex},pB:function(){return ep},Mf:function(){return eE},ie:function(){return ey},x6:function(){return ed},U:function(){return eh},H2:function(){return eA},r:function(){return eT}});var i,o,r=n(39271),s=n(85230),a=n(87433),c=n(69514),u=n(92614);let l=async()=>{let{userAgentData:e}=navigator;if(!e)return navigator.userAgent;let{platform:t="",platformVersion:n="",model:i="",architecture:o="",fullVersionList:r=[]}=await e.getHighEntropyValues(["platform","platformVersion","architecture","model","fullVersionList"]);return[t,n,o,i,t,r.map(e=>`${e.brand}/${e.version}`).join(";")].filter(e=>e).join(" ")};var d=n(57826),h=n(88881),p=n(60117),E=n(99075),f=n(23318),g=n(83977),y=n(66388),m=n(91742),x=n(83468),I=n(5048),v=n(7107),S=n(36168);let C=e=>(0,m.z)(x.x,(0,I.u)("RespondToAuthChallenge"),(0,v.o)(),{...S.n,...e}),w=e=>(0,m.z)(x.x,(0,I.u)("AssociateSoftwareToken"),(0,v.o)(),{...S.n,...e}),A=e=>(0,m.z)(x.x,(0,I.u)("ConfirmDevice"),(0,v.o)(),{...S.n,...e});var T=n(31901),R=n(99388),P=n(12249),N=n(85777),F=n(54501),b=n(75638),D=n(97808),k=n(37701);class U extends b._{constructor(e){super(e),this.constructor=U,Object.setPrototypeOf(this,U.prototype)}}(i=o||(o={})).PasskeyNotSupported="PasskeyNotSupported",i.PasskeyAlreadyExists="PasskeyAlreadyExists",i.InvalidPasskeyRegistrationOptions="InvalidPasskeyRegistrationOptions",i.InvalidPasskeyAuthenticationOptions="InvalidPasskeyAuthenticationOptions",i.RelyingPartyMismatch="RelyingPartyMismatch",i.PasskeyRegistrationFailed="PasskeyRegistrationFailed",i.PasskeyRetrievalFailed="PasskeyRetrievalFailed",i.PasskeyRegistrationCanceled="PasskeyRegistrationCanceled",i.PasskeyAuthenticationCanceled="PasskeyAuthenticationCanceled",i.PasskeyOperationAborted="PasskeyOperationAborted";let O="Passkeys may not be supported on this device. Ensure your application is running in a secure context (HTTPS) and Web Authentication API is supported.",M="User may have canceled the ceremony or another interruption has occurred. Check underlying error for details.",_="Ensure your user pool is configured to support the WEB_AUTHN as an authentication factor.",L={[o.PasskeyNotSupported]:{message:"Passkeys may not be supported on this device.",recoverySuggestion:O},[o.InvalidPasskeyRegistrationOptions]:{message:"Invalid passkey registration options.",recoverySuggestion:_},[o.InvalidPasskeyAuthenticationOptions]:{message:"Invalid passkey authentication options.",recoverySuggestion:_},[o.PasskeyRegistrationFailed]:{message:"Device failed to create passkey.",recoverySuggestion:O},[o.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."},[o.PasskeyAlreadyExists]:{message:"Passkey already exists in authenticator.",recoverySuggestion:"Proceed with existing passkey or try again after deleting the credential."},[o.PasskeyRegistrationCanceled]:{message:"Passkey registration ceremony has been canceled.",recoverySuggestion:M},[o.PasskeyAuthenticationCanceled]:{message:"Passkey authentication ceremony has been canceled.",recoverySuggestion:M},[o.PasskeyOperationAborted]:{message:"Passkey operation has been aborted.",recoverySuggestion:M},[o.RelyingPartyMismatch]:{message:"Relying party does not match current domain.",recoverySuggestion:"Ensure relying party identifier matches current domain."}},q=(0,D.$)(L,U),K=e=>{if(e instanceof U)return e;if(e instanceof Error&&"NotAllowedError"===e.name){let{message:t,recoverySuggestion:n}=L[o.PasskeyAuthenticationCanceled];return new U({name:o.PasskeyAuthenticationCanceled,message:t,recoverySuggestion:n,underlyingError:e})}return V(e)},V=e=>{if(e instanceof Error){if("AbortError"===e.name){let{message:t,recoverySuggestion:n}=L[o.PasskeyOperationAborted];return new U({name:o.PasskeyOperationAborted,message:t,recoverySuggestion:n,underlyingError:e})}if("SecurityError"===e.name){let{message:t,recoverySuggestion:n}=L[o.RelyingPartyMismatch];return new U({name:o.RelyingPartyMismatch,message:t,recoverySuggestion:n,underlyingError:e})}}return new U({name:k.Z.Unknown,message:"An unknown error has occurred.",underlyingError:e})};var B=n(99262);let G=()=>(0,B.j)()&&window.isSecureContext&&"credentials"in navigator&&"function"==typeof window.PublicKeyCredential,H=e=>u.u.convert(new Uint8Array(e),{urlSafe:!0,skipPadding:!0});var z=n(70624);let W=e=>Uint8Array.from(z.$.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}},j=e=>{let t={clientDataJSON:H(e.response.clientDataJSON),authenticatorData:H(e.response.authenticatorData),signature:H(e.response.signature)};e.response.userHandle&&(t.userHandle=H(e.response.userHandle));let n={id:e.id,rawId:H(e.rawId),type:e.type,clientExtensionResults:e.getClientExtensionResults(),response:t};return e.authenticatorAttachment&&(n.authenticatorAttachment=e.authenticatorAttachment),n},Q=async e=>{try{let t=G();q(t,o.PasskeyNotSupported);let n=$(e),i=await navigator.credentials.get({publicKey:n});return q(i&&i instanceof PublicKeyCredential&&i.response instanceof AuthenticatorAssertionResponse,o.PasskeyRetrievalFailed),j(i)}catch(e){throw K(e)}};async function Z(e){let t=r.d.getConfig().Auth?.Cognito;(0,a.FG)(t);
1let{username:n,signInSession:i,signInDetails:c,challengeName:u}=F.signInStore.getState();if("WEB_AUTHN"!==u||!n)throw new d.l({name:p.kq.SignInException,message:"Unable to proceed due to invalid sign in state."});let{CREDENTIAL_REQUEST_OPTIONS:l}=e;q(!!l,o.InvalidPasskeyAuthenticationOptions);let h=await Q(JSON.parse(l)),E=C({endpointResolver:(0,T.e)({endpointOverride:t.userPoolEndpoint})}),{ChallengeName:f,ChallengeParameters:y,AuthenticationResult:m,Session:x}=await E({region:(0,R.y)(t.userPoolId),userAgentValue:(0,g.W)(s.g4.ConfirmSignIn)},{ChallengeName:"WEB_AUTHN",ChallengeResponses:{USERNAME:n,CREDENTIAL:JSON.stringify(h)},ClientId:t.userPoolClientId,Session:i});if((0,F.k)({signInSession:x,username:n,challengeName:f,signInDetails:c}),m)return await (0,P.x)({...m,username:n,NewDeviceMetadata:await ew({userPoolId:t.userPoolId,userPoolEndpoint:t.userPoolEndpoint,newDeviceMetadata:m.NewDeviceMetadata,accessToken:m.AccessToken}),signInDetails:c}),(0,F.P)(),await (0,N.O)(),{isSignedIn:!0,nextStep:{signInStep:"DONE"}};if("WEB_AUTHN"===f)throw new d.l({name:p.kq.SignInException,message:"Sequential WEB_AUTHN challenges returned from underlying service cannot be handled."});return em({challengeName:f,challengeParameters:y})}var X=n(95377),Y=n(34168),J=n(5270),ee=n(73949);let et=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],en=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ei=()=>{let e=new Date,t=en[e.getUTCDay()],n=et[e.getUTCMonth()],i=e.getUTCDate(),o=e.getUTCHours();o<10&&(o=`0${o}`);let r=e.getUTCMinutes();r<10&&(r=`0${r}`);let s=e.getUTCSeconds();s<10&&(s=`0${s}`);let a=e.getUTCFullYear();return`${t} ${n} ${i} ${o}:${r}:${s} UTC ${a}`};var eo=n(28364),er=n(42885);let es=({userPoolName:e,username:t,challengeParameters:n,dateNow:i,hkdf:o})=>{let r=er.o.convert(e),s=er.o.convert(t),a=ea(n.SECRET_BLOCK),c=er.o.convert(i),l=new Uint8Array(r.byteLength+s.byteLength+a.byteLength+c.byteLength);l.set(r,0),l.set(s,r.byteLength),l.set(a,r.byteLength+s.byteLength),l.set(c,r.byteLength+s.byteLength+a.byteLength);let d=new eo.f(o);d.update(l);let h=d.digestSync();return u.u.convert(h)},ea=e=>{let t="=".repeat((4-e.length%4)%4),n=(e+t).replace(/-/g,"+").replace(/_/g,"/"),i=z.$.convert(n),o=new Uint8Array(i.length);for(let e=0;e<i.length;++e)o[e]=i.charCodeAt(e);return o};var ec=n(26857),eu=n(6801);let el="userAttributes.";async function ed(e,t,n,i,o){let{userPoolClientId:r,userPoolId:a,userPoolEndpoint:c}=i,u={USERNAME:e,PASSWORD:t},l=await o.getDeviceMetadata(e);l&&l.deviceKey&&(u.DEVICE_KEY=l.deviceKey);let d=(0,eu.u)({username:e,userPoolId:a,userPoolClientId:r}),h=(0,y.N)({endpointResolver:(0,T.e)({endpointOverride:c})}),p=await h({region:(0,R.y)(a),userAgentValue:(0,g.W)(s.g4.SignIn)},{AuthFlow:"USER_PASSWORD_AUTH",AuthParameters:u,ClientMetadata:n,ClientId:r,UserContextData:d}),E=p.ChallengeParameters?.USERNAME??p.ChallengeParameters?.USER_ID_FOR_SRP??e;return(eT(E),"DEVICE_SRP_AUTH"===p.ChallengeName)?ef({username:E,config:i,clientMetadata:n,session:p.Session,tokenOrchestrator:o}):p}async function eh(e,t,n,i,o){return(0,X.h)({username:e,password:t,clientMetadata:n,config:i,tokenOrchestrator:o,authFlow:"USER_SRP_AUTH"})}async function ep(e,t,n,i){let{userPoolClientId:o,userPoolId:r,userPoolEndpoint:a}=n,c={USERNAME:e},u=await i.getDeviceMetadata(e);u&&u.deviceKey&&(c.DEVICE_KEY=u.deviceKey);let l=(0,eu.u)({username:e,userPoolId:r,userPoolClientId:o}),d=(0,y.N)({endpointResolver:(0,T.e)({endpointOverride:a})}),h=await d({region:(0,R.y)(r),userAgentValue:(0,g.W)(s.g4.SignIn)},{AuthFlow:"CUSTOM_AUTH",AuthParameters:c,ClientMetadata:t,ClientId:o,UserContextData:l}),p=h.ChallengeParameters?.USERNAME??e;return(eT(p),"DEVICE_SRP_AUTH"===h.ChallengeName)?ef({username:p,config:n,clientMetadata:t,session:h.Session,tokenOrchestrator:i}):h}async function eE(e,t,n,i,o){(0,a.FG)(i);let{userPoolId:r,userPoolClientId:c,userPoolEndpoint:u}=i,l=r?.split("_")[1]||"",d=await (0,J.d)(l),h={USERNAME:e,SRP_A:d.A.toString(16),CHALLENGE_NAME:"SRP_A"},p=(0,eu.u)({username:e,userPoolId:r,userPoolClientId:c}),E=(0,y.N)({endpointResolver:(0,T.e)({endpointOverride:u})}),{ChallengeParameters:f,Session:m}=await E({region:(0,R.y)(r),userAgentValue:(0,g.W)(s.g4.SignIn)},{AuthFlow:"CUSTOM_AUTH",AuthParameters:h,ClientMetadata:n,ClientId:c,UserContextData:p}),x=f?.USERNAME??e;return eT(x),eA(ey,[t,f,n,m,d,i,o],x,o)}async function ef({username:e,config:t,clientMetadata:n,session:i,tokenOrchestrator:o}){let{userPoolId:r,userPoolEndpoint:s}=t,a=t.userPoolClientId,c=await o?.getDeviceMetadata(e);(0,Y.tr)(c);let u=await (0,J.d)(c.deviceGroupKey),l={USERNAME:e,SRP_A:u.A.toString(16),DEVICE_KEY:c.deviceKey},d=C({endpointResolver:(0,T.e)({endpointOverride:s})}),{ChallengeParameters:h,Session:p}=await d({region:(0,R.y)(r)},{ChallengeName:"DEVICE_SRP_AUTH",ClientId:a,ChallengeResponses:l,ClientMetadata:n,Session:i});return eg(e,h,n,p,u,t,o)}async function eg(e,t,n,i,o,{userPoolId:r,userPoolClientId:s,userPoolEndpoint:a},c){let u=await c?.getDeviceMetadata(e);(0,Y.tr)(u);let l=new ec.Z(t?.SRP_B,16),d=new ec.Z(t?.SALT,16),{deviceKey:h}=u,{deviceGroupKey:p}=u,E=await o.getPasswordAuthenticationKey({username:u.deviceKey,password:u.randomPassword,serverBValue:l,salt:d}),f=ei(),g={USERNAME:t?.USERNAME??e,PASSWORD_CLAIM_SECRET_BLOCK:t?.SECRET_BLOCK,TIMESTAMP:f,PASSWORD_CLAIM_SIGNATURE:es({username:h,userPoolName:p,challengeParameters:t,dateNow:f,hkdf:E}),DEVICE_KEY:h},y=(0,eu.u)({username:e,userPoolId:r,userPoolClientId:s});return C({endpointResolver:(0,T.e)({endpointOverride:a})})({region:(0,R.y)(r)},{ChallengeName:"DEVICE_PASSWORD_VERIFIER",ClientId:s,ChallengeResponses:g,Session:i,ClientMetadata:n,UserContextData:y})}async function ey(e,t,n,i,o,r,s){let{userPoolId:a,userPoolClientId:c,userPoolEndpoint:u}=r,l=a?.split("_")[1]||"",h=new ec.Z(t?.SRP_B,16),p=new ec.Z(t?.SALT,16),E=t?.USER_ID_FOR_SRP;if(!E)throw new d.l({name:"EmptyUserIdForSRPException",message:"USER_ID_FOR_SRP was not found in challengeParameters"});let f=await o.getPasswordAuthenticationKey({username:E,password:e,serverBValue:h,salt:p}),g=ei(),y={USERNAME:E,PASSWORD_CLAIM_SECRET_BLOCK:t?.SECRET_BLOCK,TIMESTAMP:g,PASSWORD_CLAIM_SIGNATURE:es({username:E,userPoolName:l,challengeParameters:t,dateNow:g,hkdf:f})},m=await s.getDeviceMetadata(E);m&&m.deviceKey&&(y.DEVICE_KEY=m.deviceKey);let x=(0,eu.u)({username:E,userPoolId:a,userPoolClientId:c}),I=C({endpointResolver:(0,T.e)({endpointOverride:u})}),v=await I({region:(0,R.y)(a)},{ChallengeName:"PASSWORD_VERIFIER",ChallengeResponses:y,ClientMetadata:n,Session:i,ClientId:c,UserContextData:x});return"DEVICE_SRP_AUTH"===v.ChallengeName?ef({username:E,config:r,clientMetadata:n,session:v.Session,tokenOrchestrator:s}):v}async function em(e){var t;let{challengeName:n,challengeParameters:i,availableChallenges:o}=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:i}};case"MFA_SETUP":{let{signInSession:e,username:t}
1=F.signInStore.getState(),n=ev(eS(i.MFAS_CAN_SETUP))||[],o=n.filter(e=>"EMAIL"===e||"TOTP"===e),r=o.includes("TOTP"),a=o.includes("EMAIL");if(r&&a)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION",allowedMFATypes:o}};if(a)return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_EMAIL_SETUP"}};if(r){let n=w({endpointResolver:(0,T.e)({endpointOverride:s.userPoolEndpoint})}),{Session:i,SecretCode:o}=await n({region:(0,R.y)(s.userPoolId)},{Session:e});return F.signInStore.dispatch({type:"SET_SIGN_IN_SESSION",value:i}),{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_TOTP_SETUP",totpSetupDetails:{sharedSecret:o,getSetupUri:(e,n)=>{let i=`otpauth://totp/${e}:${n??t}?secret=${o}&issuer=${e}`;return new c.a(i)}}}}}throw new d.l({name:p.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=i.requiredAttributes)?JSON.parse(t).map(e=>e.includes(el)?e.replace(el,""):e):[]}};case"SELECT_MFA_TYPE":return{isSignedIn:!1,nextStep:{signInStep:"CONTINUE_SIGN_IN_WITH_MFA_SELECTION",allowedMFATypes:ev(eS(i.MFAS_CAN_CHOOSE))}};case"SMS_OTP":case"SMS_MFA":return{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_IN_WITH_SMS_CODE",codeDeliveryDetails:{deliveryMedium:i.CODE_DELIVERY_DELIVERY_MEDIUM,destination:i.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:i.CODE_DELIVERY_DELIVERY_MEDIUM,destination:i.CODE_DELIVERY_DESTINATION}}};case"WEB_AUTHN":return Z(i);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:o}}}throw new d.l({name:p.kq.SignInException,message:`An error occurred during the sign in process. ${n} challengeName returned by the underlying service was not addressed.`})}function ex(e){return e===h.OK.PasswordResetRequiredException?{isSignedIn:!1,nextStep:{signInStep:"RESET_PASSWORD"}}:e===h.OK.UserNotConfirmedException?{isSignedIn:!1,nextStep:{signInStep:"CONFIRM_SIGN_UP"}}:void 0}function eI(e){return"SMS_MFA"===e?"SMS":"SOFTWARE_TOKEN_MFA"===e?"TOTP":"EMAIL_OTP"===e?"EMAIL":void 0}function ev(e){if(e)return e.map(eI).filter(Boolean)}function eS(e){return e?JSON.parse(e):[]}async function eC(){let e;try{e=await (0,f.t)()}catch(e){}if(e&&e.userId&&e.username)throw new d.l({name:E.EU,message:"There is already a signed in user.",recoverySuggestion:"Call signOut before calling signIn again."})}async function ew({userPoolId:e,userPoolEndpoint:t,newDeviceMetadata:n,accessToken:i}){if(!n)return;let o=e.split("_")[1]||"",r=await (0,J.d)(o),s=n?.DeviceKey,a=n?.DeviceGroupKey;try{await r.generateHashDevice(a??"",s??"")}catch(e){return}let c={Salt:u.u.convert((0,ee.z)(r.getSaltToHashDevices())),PasswordVerifier:u.u.convert((0,ee.z)(r.getVerifierDevices()))},d=r.getRandomPassword();try{let o=A({endpointResolver:(0,T.e)({endpointOverride:t})});return await o({region:(0,R.y)(e)},{AccessToken:i,DeviceName:await l(),DeviceKey:n?.DeviceKey,DeviceSecretVerifierConfig:c}),{deviceKey:s,deviceGroupKey:a,randomPassword:d}}catch(e){return}}async function eA(e,t,n,i){try{return await e(...t)}catch(o){if(o instanceof d.l&&"ResourceNotFoundException"===o.name&&o.message.includes("Device does not exist."))return await i.clearDeviceMetadata(n),e(...t);throw o}}function eT(e){let{dispatch:t}=F.signInStore;t({type:"SET_USERNAME",value:e})}function eR(e){return F.signInStore.getState().username??e}},42251:function(e,t,n){n.d(t,{R:function(){return c}});var i=n(87433),o=n(77694),r=n(34168);let s="amplify-signin-with-hostedUI",a="CognitoIdentityServiceProvider";class c{constructor(e){this.keyValueStorage=e}async clearOAuthInflightData(){(0,i.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,i.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,i.FG)(this.cognitoConfig);let e=u(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthState)}storeOAuthState(e){(0,i.FG)(this.cognitoConfig);let t=u(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.setItem(t.oauthState,e)}loadPKCE(){(0,i.FG)(this.cognitoConfig);let e=u(a,this.cognitoConfig.userPoolClientId);return this.keyValueStorage.getItem(e.oauthPKCE)}storePKCE(e){(0,i.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,i.FG)(this.cognitoConfig);let e=u(a,this.cognitoConfig.userPoolClientId);return await this.keyValueStorage.getItem(e.inflightOAuth)==="true"}async storeOAuthInFlight(e){(0,i.FG)(this.cognitoConfig);let t=u(a,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(t.inflightOAuth,`${e}`)}async loadOAuthSignIn(){(0,i.FG)(this.cognitoConfig);let e=u(a,this.cognitoConfig.userPoolClientId),t=await this.keyValueStorage.getItem(s),[n,o]=(await this.keyValueStorage.getItem(e.oauthSignIn))?.split(",")??[];return{isOAuthSignIn:"true"===n||"true"===t,preferPrivateSession:"true"===o}}async storeOAuthSignIn(e,t=!1){(0,i.FG)(this.cognitoConfig);let n=u(a,this.cognitoConfig.userPoolClientId);await this.keyValueStorage.setItem(n.oauthSignIn,`${e},${t}`)}}let u=(e,t)=>
1(0,o._X)(r.Bx)(e,t)},26857:function(e,t,n){let i,o,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,i,o,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;o=((t=s*t+((32767&c)<<15)+n[i]+(1073741823&o))>>>30)+(c>>>15)+a*r+(o>>>30),n[i++]=1073741823&t}return o},i=30):c&&"Netscape"!==navigator.appName?(s.prototype.am=function(e,t,n,i,o,r){for(;--r>=0;){let r=t*this[e++]+n[i]+o;o=Math.floor(r/67108864),n[i++]=67108863&r}return o},i=26):(s.prototype.am=function(e,t,n,i,o,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;o=((t=s*t+((16383&c)<<14)+n[i]+o)>>28)+(c>>14)+a*r,n[i++]=268435455&t}return o},i=28),s.prototype.DB=i,s.prototype.DM=(1<<i)-1,s.prototype.DV=1<<i,s.prototype.FV=4503599627370496,s.prototype.F1=52-i,s.prototype.F2=2*i-52;let u=[];for(r=0,o=48;r<=9;++r)u[o++]=r;for(r=10,o=97;r<36;++r)u[o++]=r;for(r=10,o=65;r<36;++r)u[o++]=r;function l(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function d(e){let t=a();return t.fromInt(e),t}function h(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 p(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}p.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},p.prototype.revert=function(e){let t=a();return e.copyTo(t),this.reduce(t),t},p.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],i=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,i,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)},p.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},p.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 i=e.length,o=!1,r=0;for(;--i>=0;){let t=function(e,t){let n=u[e.charCodeAt(t)];return null==n?-1:n}(e,i);if(t<0){"-"===e.charAt(i)&&(o=!0);continue}o=!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(),o&&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 i=e%this.DB,o=this.DB-i,r=(1<<o)-1,s=Math.floor(e/this.DB),a=this.s<<i&this.DM;for(n=this.t-1;n>=0;--n)t[n+s+1]=this[n]>>o|a,a=(this[n]&r)<<i;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 i=e%this.DB,o=this.DB-i,r=(1<<i)-1;t[0]=this[n]>>i;for(let e=n+1;e<this.t;++e)t[e-n-1]|=(this[e]&r)<<o,t[e-n]=this[e]>>i;i>0&&(t[this.t-n-1]|=(this.s&r)<<o),t.t=this.t-n,t.clamp()},s.prototype.subTo=function(e,t){let n=0,i=0,o=Math.min(e.t,this.t);for(;n<o;)i+=this[n]-e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t<this.t){for(i-=e.s;n<this.t;)i+=this[n],t[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<e.t;)i-=e[n],t[n++]=i&this.DM,i>>=this.DB;i-=e.s}t.s=i<0?-1:0,i<-1?t[n++]=this.DV+i:i>0&&(t[n++]=i),t.t=n,t.clamp()},s.prototype.multiplyTo=function(e,t){let n=this.abs(),i=e.abs(),o=n.t;for(t.t=o+i.t;--o>=0;)t[o]=0;for(o=0;o<i.t;++o)t[o+n.t]=n.am(0,i[o],t,o,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 i=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,i,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 i=e.abs();if(i.t<=0)return;let o=this.abs();if(o.t<i.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,l=this.DB-h(i[i.t-1]);l>0?(i.lShiftTo(l,r),o.lShiftTo(l,n)):(i.copyTo(r),o.copyTo(n));let d=r.t,p=r[d-1];if(0===p)return;let E=p*(1<<this.F1)+(d>1?r[d-2]>>this.F2:0),f=this.FV/E,g=(1<<this.F1)/E,y=1<<this.F2,m=n.t,x=m-d,I=null===t?a():t;for(r.dlShiftTo(x,I),n.compareTo(I)>
1=0&&(n[n.t++]=1,n.subTo(I,n)),s.ONE.dlShiftTo(d,I),I.subTo(r,r);r.t<d;)r[r.t++]=0;for(;--x>=0;){let e=n[--m]===p?this.DM:Math.floor(n[m]*f+(n[m-1]+y)*g);if((n[m]+=r.am(0,e,n,x,0,d))<e)for(r.dlShiftTo(x,I),n.subTo(I,n);n[m]<--e;)n.subTo(I,n)}null!==t&&(n.drShiftTo(d,t),c!==u&&s.ZERO.subTo(t,t)),n.t=d,n.clamp(),l>0&&n.rShiftTo(l,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;return(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,i=0,o=Math.min(e.t,this.t);for(;n<o;)i+=this[n]+e[n],t[n++]=i&this.DM,i>>=this.DB;if(e.t<this.t){for(i+=e.s;n<this.t;)i+=this[n],t[n++]=i&this.DM,i>>=this.DB;i+=this.s}else{for(i+=this.s;n<e.t;)i+=e[n],t[n++]=i&this.DM,i>>=this.DB;i+=e.s}t.s=i<0?-1:0,i>0?t[n++]=i:i<-1&&(t[n++]=this.DV+i),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 i=(1<<t)-1,o=!1,r="",s=this.t,a=this.DB-s*this.DB%t;if(s-- >0)for(a<this.DB&&(n=this[s]>>a)>0&&(o=!0,r=l(n));s>=0;)a<t?n=(this[s]&(1<<a)-1)<<t-a|this[--s]>>(a+=this.DB-t):(n=this[s]>>(a-=t)&i,a<=0&&(a+=this.DB,--s)),n>0&&(o=!0),o&&(r+=l(n));return o?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)+h(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 i,o,r,s=e.bitLength(),c=d(1),u=new p(t);if(s<=0)return c;let l=[],E=3,f=(i=s<18?1:s<48?3:s<144?4:s<768?5:6)-1,g=(1<<i)-1;if(l[1]=u.convert(this),i>1){let e=a();for(u.sqrTo(l[1],e);E<=g;)l[E]=a(),u.mulTo(e,l[E-2],l[E]),E+=2}let y=e.t-1,m=!0,x=a();for(s=h(e[y])-1;y>=0;){for(s>=f?o=e[y]>>s-f&g:(o=(e[y]&(1<<s+1)-1)<<f-s,y>0&&(o|=e[y-1]>>this.DB+s-f)),E=i;(1&o)==0;)o>>=1,--E;if((s-=E)<0&&(s+=this.DB,--y),m)l[o].copyTo(c),m=!1;else{for(;E>1;)u.sqrTo(c,x),u.sqrTo(x,c),E-=2;E>0?u.sqrTo(c,x):(r=c,c=x,x=r),u.mulTo(x,l[o],c)}for(;y>=0&&(e[y]&1<<s)==0;)u.sqrTo(c,x),r=c,c=x,x=r,--s<0&&(s=this.DB-1,--y)}let I=u.revert(c);return n(null,I),I},s.ZERO=d(0),s.ONE=d(1)},30315:function(e,t,n){n.d(t,{$v:function(){return i},H3:function(){return r},rt:function(){return o}});let i="FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6BF12FFA06D98A0864D87602733EC86A64521F2B18177B200CBBE117577A615D6C770988C0BAD946E208E24FA074E5AB3143DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF",o={},r={};for(let e=0;e<256;e++){let t=e.toString(16).toLowerCase();1===t.length&&(t=`0${t}`),o[e]=t,r[t]=e}},5270:function(e,t,n){n.d(t,{d:function(){return w}});var i=n(57826),o=n(42885),r=n(26857);let s=async({a:e,g:t,k:n,x:i,B:o,N:r,U:s})=>new Promise((a,c)=>{t.modPow(i,r,(t,u)=>{if(t){c(t);return}o.subtract(n.multiply(u)).modPow(e.add(s.multiply(i)),r,(e,t)=>{if(e){c(e);return}a(t.mod(r))})})});var a=n(73949),c=n(28364),u=n(30315);let l=e=>{let t="";for(let n=0;n<e.byteLength;n++)t+=u.rt[e[n]];return t},d=e=>{let t=new c.f;t.update(e);let n=l(t.digestSync());return Array(64-n.length).join("0")+n},h=e=>d((0,a.z)(e)),p=/^[89a-f]/i,E=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=p.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},f=({A:e,B:t})=>{let n=new r.Z(h(E(e)+E(t)),16);if(n.equals(r.Z.ZERO))throw Error("U cannot be zero.");return n},g=(e,t,n)=>{let i=new c.f(t);i.update(e);let o=i.digestSync(),r=new c.f(o);return r.update(n),r.digestSync().slice(0,16)};var y=n(72237);class m{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,y.MX)().getRandomValues(new Uint32Array(1))[0]);return new m(t,e)}toString(){return function(e){let{words:t}=e,{sigBytes:n}=e,i=[];for(let e=0;e<n;e++){let n=t[e>>>2]>>>24-e%4*8&255;i.push((n>>>4).toString(16)),i.push((15&n).toString(16))}return i.join("")}(this)}}let x=e=>{let t=new m().random(e).toString();return(0,a.z)(t)};var I=n(92614);let v=()=>I.u.convert(x(40));
1class S{constructor({userPoolName:e,a:t,g:n,A:i,N:s}){this.encoder=o.o,this.userPoolName=e,this.a=t,this.g=n,this.A=i,this.N=s,this.k=new r.Z(h(`${E(s)}${E(n)}`),16)}getRandomPassword(){if(!this.randomPassword)throw new i.l({name:"EmptyBigIntegerRandomPassword",message:"random password is empty"});return this.randomPassword}getSaltToHashDevices(){if(!this.saltToHashDevices)throw new i.l({name:"EmptyBigIntegersaltToHashDevices",message:"saltToHashDevices is empty"});return this.saltToHashDevices}getVerifierDevices(){if(!this.verifierDevices)throw new i.l({name:"EmptyBigIntegerVerifierDevices",message:"verifyDevices is empty"});return this.verifierDevices}async generateHashDevice(e,t){this.randomPassword=v();let n=d(`${e}${t}:${this.randomPassword}`),i=l(x(16));return this.saltToHashDevices=E(new r.Z(i,16)),new Promise((e,t)=>{this.g.modPow(new r.Z(h(this.saltToHashDevices+n),16),this.N,(n,i)=>{if(n){t(n);return}this.verifierDevices=E(i),e()})})}async getPasswordAuthenticationKey({username:e,password:t,serverBValue:n,salt:i}){if(n.mod(this.N).equals(r.Z.ZERO))throw Error("B cannot be zero.");let o=f({A:this.A,B:n}),c=d(`${this.userPoolName}${e}:${t}`),u=new r.Z(h(E(i)+c),16),l=await s({a:this.a,g:this.g,k:this.k,x:u,B:n,N:this.N,U:o}),p=this.encoder.convert("Caldera Derived Key"),y=this.encoder.convert("\x01"),m=new Uint8Array(p.byteLength+y.byteLength);return m.set(p,0),m.set(y,p.byteLength),g((0,a.z)(E(l)),(0,a.z)(E(o)),m)}}let C=async({a:e,g:t,N:n})=>new Promise((i,o)=>{t.modPow(e,n,(e,t)=>{if(e){o(e);return}if(t.mod(n).equals(r.Z.ZERO)){o(Error("Illegal parameter. A mod N cannot be 0."));return}i(t)})}),w=async e=>{let t=new r.Z(u.$v,16),n=new r.Z("2",16),i=A(),o=await C({a:i,g:n,N:t});return new S({userPoolName:e,a:i,g:n,A:o,N:t})},A=()=>{let e=l(x(128));return new r.Z(e,16)}},73949:function(e,t,n){n.d(t,{z:function(){return o}});var i=n(30315);let o=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 o=e.slice(n,n+2).toLowerCase();if(o in i.H3)t[n/2]=i.H3[o];else throw Error(`Cannot decode unrecognized sequence ${o} as hexadecimal`)}return t}},42885:function(e,t,n){n.d(t,{o:function(){return i}});let i={convert:e=>new TextEncoder().encode(e)}},34168:function(e,t,n){n.d(t,{Bx:function(){return d},CA:function(){return r},Cg:function(){return s},XD:function(){return u},tr:function(){return l}});var i=n(57826),o=n(99075);function r(e){if(!e||!e.accessToken)throw new i.l({name:o.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 i.l({name:o.Jg,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."})}let a=new i.l({name:o.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 i.l({name:o.Jg,message:"User needs to be authenticated to call this API.",recoverySuggestion:"Sign in before calling this API again."});function u(e){if(h(e)&&!e?.refreshToken)throw a;if(!(h(e)&&e?.refreshToken))throw c}function l(e){if(!e||!e.deviceKey||!e.deviceGroupKey||!e.randomPassword)throw new i.l({name:o.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 d={inflightOAuth:"inflightOAuth",oauthSignIn:"oauthSignIn",oauthPKCE:"oauthPKCE",oauthState:"oauthState"};function h(e){return e?.accessToken||e?.idToken}},20389:function(e,t,n){n.d(t,{y:function(){return r}});var i=n(39271);let o=(e,t)=>e.Auth.fetchAuthSession(t),r=e=>o(i.d,e)},16175:function(e,t,n){n.d(t,{Fm:function(){return E}});var i=n(37701),o=n(75638);class r extends o._{constructor(){super({name:i.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"),l=()=>{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},d=()=>{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 h extends s{constructor(){super(l())}}class p extends s{constructor(){super(d())}}let E=new h;new p,new s(new c)},92614:function(e,t,n){n.d(t,{u:function(){return o}});var i=n(72237);let o={convert(e,t={urlSafe:!1,skipPadding:!1}){let n="string"==typeof e?e:Array.from(e,e=>String.fromCodePoint(e)).join(""),o=(0,i.Ds)()(n);return t.urlSafe&&(o=o.replace(/\+/g,"-").replace(/\//g,"_")),t.skipPadding&&(o=o.replace(/=/g,"")),o}}},99262:function(e,t,n){n.d(t,{j:function(){return i}});let i=()=>"undefined"!=typeof window&&void 0!==window.document},87045:function(e,t,n){n.d(t,{j:function(){return r}});var i=n(24112),o=n(45345),r=new class extends i.l{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!o.sk&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();
3this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#e?this.#e:globalThis.document?.visibilityState!=="hidden"}}},2894:function(e,t,n){n.d(t,{R:function(){return a},m:function(){return s}});var i=n(18238),o=n(7989),r=n(11255),s=class extends o.F{#i;#o;#r;constructor(e){super(),this.mutationId=e.mutationId,this.#o=e.mutationCache,this.#i=[],this.state=e.state||a(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#i.includes(e)||(this.#i.push(e),this.clearGcTimeout(),this.#o.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#i=this.#i.filter(t=>t!==e),this.scheduleGc(),this.#o.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#i.length||("pending"===this.state.status?this.scheduleGc():this.#o.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){this.#r=(0,r.Mz)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#s({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#o.canRun(this)});let t="pending"===this.state.status,n=!this.#r.canStart();try{if(!t){this.#s({type:"pending",variables:e,isPaused:n}),await this.#o.config.onMutate?.(e,this);let t=await this.options.onMutate?.(e);t!==this.state.context&&this.#s({type:"pending",context:t,variables:e,isPaused:n})}let i=await this.#r.start();return await this.#o.config.onSuccess?.(i,e,this.state.context,this),await this.options.onSuccess?.(i,e,this.state.context),await this.#o.config.onSettled?.(i,null,this.state.variables,this.state.context,this),await this.options.onSettled?.(i,null,e,this.state.context),this.#s({type:"success",data:i}),i}catch(t){try{throw await this.#o.config.onError?.(t,e,this.state.context,this),await this.options.onError?.(t,e,this.state.context),await this.#o.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this),await this.options.onSettled?.(void 0,t,e,this.state.context),t}finally{this.#s({type:"error",error:t})}}finally{this.#o.runNext(this)}}#s(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),i.V.batch(()=>{this.#i.forEach(t=>{t.onMutationUpdate(e)}),this.#o.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},18238:function(e,t,n){n.d(t,{V:function(){return i}});var i=function(){let e=[],t=0,n=e=>{e()},i=e=>{e()},o=e=>setTimeout(e,0),r=i=>{t?e.push(i):o(()=>{n(i)})},s=()=>{let t=e;e=[],t.length&&o(()=>{i(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{--t||s()}return n},batchCalls:e=>(...t)=>{r(()=>{e(...t)})},schedule:r,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{i=e},setScheduler:e=>{o=e}}}()},57853:function(e,t,n){n.d(t,{N:function(){return r}});var i=n(24112),o=n(45345),r=new class extends i.l{#a=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!o.sk&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}
3setOnline(e){this.#a!==e&&(this.#a=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#a}}},21733:function(e,t,n){n.d(t,{A:function(){return a},z:function(){return c}});var i=n(45345),o=n(18238),r=n(11255),s=n(7989),a=class extends s.F{#c;#u;#l;#r;#d;#h;constructor(e){super(),this.#h=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#l=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#c=function(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,n=void 0!==t,i=n?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=e.state??this.#c,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,t){let n=(0,i.oE)(this.state.data,e,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#s({type:"setState",state:e,setStateOptions:t})}cancel(e){let t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(i.ZT).catch(i.ZT):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#c)}isActive(){return this.observers.some(e=>!1!==(0,i.Nc)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===i.CN||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!(0,i.Kp)(this.state.dataUpdatedAt,e)}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#h?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus){if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,o=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,n.signal)})},s={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{let e=(0,i.cG)(this.options,t),n={queryKey:this.queryKey,meta:this.meta};return(o(n),this.#h=!1,this.options.persister)?this.options.persister(e,n,this):e(n)}};o(s),this.options.behavior?.onFetch(s,this),this.#u=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==s.fetchOptions?.meta)&&this.#s({type:"fetch",meta:s.fetchOptions?.meta});let a=e=>{(0,r.DV)(e)&&e.silent||this.#s({type:"error",error:e}),(0,r.DV)(e)||(this.#l.config.onError?.(e,this),this.#l.config.onSettled?.(this.state.data,e,this)),this.scheduleGc()};return this.#r=(0,r.Mz)({initialPromise:t?.initialPromise,fn:s.fetchFn,abort:n.abort.bind(n),onSuccess:e=>{if(void 0===e){a(Error(`${this.queryHash} data is undefined`));return}try{this.setData(e)}catch(e){a(e);return}this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),this.scheduleGc()},onError:a,onFail:(e,t)=>{this.#s({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}),this.#r.start()}#s(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...c(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":let n=e.error;if((0,r.DV)(n)&&n.revert&&this.#u)return{...this.#u,fetchStatus:"idle"};
3return{...t,error:n,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:n,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),o.V.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function c(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,r.Kw)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}},21623:function(e,t,n){n.d(t,{S:function(){return f}});var i=n(45345),o=n(21733),r=n(18238),s=n(24112),a=class extends s.l{constructor(e={}){super(),this.config=e,this.#p=new Map}#p;build(e,t,n){let r=t.queryKey,s=t.queryHash??(0,i.Rm)(r,t),a=this.get(s);return a||(a=new o.A({cache:this,queryKey:r,queryHash:s,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#p.has(e.queryHash)||(this.#p.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#p.get(e.queryHash);t&&(e.destroy(),t===e&&this.#p.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){r.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,i._x)(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>(0,i._x)(e,t)):t}notify(e){r.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){r.V.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){r.V.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},c=n(2894),u=class extends s.l{constructor(e={}){super(),this.config=e,this.#E=new Map,this.#f=Date.now()}#E;#f;build(e,t,n){let i=new c.m({mutationCache:this,mutationId:++this.#f,options:e.defaultMutationOptions(t),state:n});return this.add(i),i}add(e){let t=l(e),n=this.#E.get(t)??[];n.push(e),this.#E.set(t,n),this.notify({type:"added",mutation:e})}remove(e){let t=l(e);if(this.#E.has(t)){let n=this.#E.get(t)?.filter(t=>t!==e);
3n&&(0===n.length?this.#E.delete(t):this.#E.set(t,n))}this.notify({type:"removed",mutation:e})}canRun(e){let t=this.#E.get(l(e))?.find(e=>"pending"===e.state.status);return!t||t===e}runNext(e){let t=this.#E.get(l(e))?.find(t=>t!==e&&t.state.isPaused);return t?.continue()??Promise.resolve()}clear(){r.V.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}getAll(){return[...this.#E.values()].flat()}find(e){let t={exact:!0,...e};return this.getAll().find(e=>(0,i.X7)(t,e))}findAll(e={}){return this.getAll().filter(t=>(0,i.X7)(e,t))}notify(e){r.V.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return r.V.batch(()=>Promise.all(e.map(e=>e.continue().catch(i.ZT))))}};function l(e){return e.options.scope?.id??String(e.mutationId)}var d=n(87045),h=n(57853);function p(e){return{onFetch:(t,n)=>{let o=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,s=t.state.data?.pages||[],a=t.state.data?.pageParams||[],c={pages:[],pageParams:[]},u=0,l=async()=>{let n=!1,l=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(t.signal.aborted?n=!0:t.signal.addEventListener("abort",()=>{n=!0}),t.signal)})},d=(0,i.cG)(t.options,t.fetchOptions),h=async(e,o,r)=>{if(n)return Promise.reject();if(null==o&&e.pages.length)return Promise.resolve(e);let s={queryKey:t.queryKey,pageParam:o,direction:r?"backward":"forward",meta:t.options.meta};l(s);let a=await d(s),{maxPages:c}=t.options,u=r?i.Ht:i.VX;return{pages:u(e.pages,a,c),pageParams:u(e.pageParams,o,c)}};if(r&&s.length){let e="backward"===r,t={pages:s,pageParams:a},n=(e?function(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}:E)(o,t);c=await h(t,n,e)}else{let t=e??s.length;do{let e=0===u?a[0]??o.initialPageParam:E(o,c);if(u>0&&null==e)break;c=await h(c,e),u++}while(u<t)}return c};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function E(e,{pages:t,pageParams:n}){let i=t.length-1;return t.length>0?e.getNextPageParam(t[i],t,n[i],n):void 0}var f=class{#g;#o;#d;#y;#m;#x;#I;#v;constructor(e={}){this.#g=e.queryCache||new a,this.#o=e.mutationCache||new u,this.#d=e.defaultOptions||{},this.#y=new Map,this.#m=new Map,this.#x=0}mount(){this.#x++,1===this.#x&&(this.#I=d.j.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#g.onFocus())}),this.#v=h.N.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#g.onOnline())}))}unmount(){this.#x--,0===this.#x&&(this.#I?.(),this.#I=void 0,this.#v?.(),this.#v=void 0)}isFetching(e){return this.#g.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#o.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#g.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.getQueryData(e.queryKey);if(void 0===t)return this.fetchQuery(e);{let n=this.defaultQueryOptions(e),o=this.#g.build(this,n);return e.revalidateIfStale&&o.isStaleByTime((0,i.KC)(n.staleTime,o))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return this.#g.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let o=this.defaultQueryOptions({queryKey:e}),r=this.#g.get(o.queryHash),s=r?.state.data,a=(0,i.SE)(t,s);if(void 0!==a)return this.#g.build(this,o).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return r.V.batch(()=>this.#g.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#g.get(t.queryHash)?.state}removeQueries(e){let t=this.#g;r.V.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#g,i={type:"active",...e};return r.V.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries(i,t)))}cancelQueries(e,t={}){let n={revert:!0,...t};return Promise.all(r.V.batch(()=>this.#g.findAll(e).map(e=>e.cancel(n)))).then(i.ZT).catch(i.ZT)}invalidateQueries(e,t={}){return r.V.batch(()=>{if(this.#g.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")return Promise.resolve();let n={...e,type:e?.refetchType??e?.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0};return Promise.all(r.V.batch(()=>this.#g.findAll(e).filter(e=>!e.isDisabled()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(i.ZT)),"paused"===e.state.fetchStatus?Promise.resolve():t}
3))).then(i.ZT)}fetchQuery(e){let t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);let n=this.#g.build(this,t);return n.isStaleByTime((0,i.KC)(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(i.ZT).catch(i.ZT)}fetchInfiniteQuery(e){return e.behavior=p(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(i.ZT).catch(i.ZT)}ensureInfiniteQueryData(e){return e.behavior=p(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return h.N.isOnline()?this.#o.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#g}getMutationCache(){return this.#o}getDefaultOptions(){return this.#d}setDefaultOptions(e){this.#d=e}setQueryDefaults(e,t){this.#y.set((0,i.Ym)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#y.values()],n={};return t.forEach(t=>{(0,i.to)(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#m.set((0,i.Ym)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#m.values()],n={};return t.forEach(t=>{(0,i.to)(e,t.mutationKey)&&(n={...n,...t.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#d.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,i.Rm)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===i.CN&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#d.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#g.clear(),this.#o.clear()}}},7989:function(e,t,n){n.d(t,{F:function(){return o}});var i=n(45345),o=class{#S;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,i.PN)(this.gcTime)&&(this.#S=setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(i.sk?1/0:3e5))}clearGcTimeout(){this.#S&&(clearTimeout(this.#S),this.#S=void 0)}}},11255:function(e,t,n){n.d(t,{DV:function(){return l},Kw:function(){return c},Mz:function(){return d}});var i=n(87045),o=n(57853),r=n(16803),s=n(45345);function a(e){return Math.min(1e3*2**e,3e4)}function c(e){return(e??"online")!=="online"||o.N.isOnline()}var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function l(e){return e instanceof u}function d(e){let t,n=!1,l=0,d=!1,h=(0,r.O)(),p=()=>i.j.isFocused()&&("always"===e.networkMode||o.N.isOnline())&&e.canRun(),E=()=>c(e.networkMode)&&e.canRun(),f=n=>{d||(d=!0,e.onSuccess?.(n),t?.(),h.resolve(n))},g=n=>{d||(d=!0,e.onError?.(n),t?.(),h.reject(n))},y=()=>new Promise(n=>{t=e=>{(d||p())&&n(e)},e.onPause?.()}).then(()=>{t=void 0,d||e.onContinue?.()}),m=()=>{let t;if(d)return;let i=0===l?e.initialPromise:void 0;try{t=i??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(f).catch(t=>{if(d)return;let i=e.retry??(s.sk?0:3),o=e.retryDelay??a,r="function"==typeof o?o(l,t):o,c=!0===i||"number"==typeof i&&l<i||"function"==typeof i&&i(l,t);if(n||!c){g(t);return}l++,e.onFail?.(l,t),(0,s._v)(r).then(()=>p()?void 0:y()).then(()=>{n?g(t):m()})})};return{promise:h,cancel:t=>{d||(g(new u(t)),e.abort?.())},continue:()=>(t?.(),h),cancelRetry:()=>{n=!0},continueRetry:()=>{n=!1},canStart:E,start:()=>(E()?m():y().then(m),h)}}},24112:function(e,t,n){n.d(t,{l:function(){return i}});var i=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},16803:function(e,t,n){n.d(t,{O:function(){return i}});function i(){let e,t;let n=new Promise((n,i)=>{e=n,t=i});function i(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.status="pending",n.catch(()=>{}),n.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},n.reject=e=>{i({status:"rejected",reason:e}),t(e)},n}},45345:function(e,t,n){n.d(t,{CN:function(){return C},Ht:function(){return S},KC:function(){return c},Kp:function(){return a},Nc:function(){return u},PN:function(){return s},Rm:function(){return h},SE:function(){return r},VS:function(){return f},VX:function(){return v},X7:function(){return d},Ym:function(){return p},ZT:function(){return o},_v:function(){return x},_x:function(){return l},cG:function(){return w},oE:function(){return I},sk:function(){return i},to:function(){return E}});var i="undefined"==typeof window||"Deno"in globalThis;function o(){}function r(e,t){return"function"==typeof e?e(t):e}function s(e){return"number"==typeof e&&e>=0&&e!==1/0}function a(e,t){return Math.max(e+(t||0)-Date.now(),0)}function c(e,t){return"function"==typeof e?e(t):e}function u(e,t){return"function"==typeof e?e(t):e}function l(e,t){let{type:n="all",exact:i,fetchStatus:o,predicate:r,queryKey:s,stale:a}=e;if(s){if(i){if(t.queryHash!==h(s,t.options))return!1}else if(!E(t.queryKey,s))return!1}if("all"!==n){let e=t.isActive();if("active"===n&&!e||"inactive"===n&&e)return!1}return("boolean"!=typeof a||t.isStale()===a)&&(!o||o===t.state.fetchStatus)&&(!r||!!r(t))}function d(e,t){let{exact:n,status:i,predicate:o,mutationKey:r}=e;if(r){if(!t.options.mutationKey)return!1;if(n){if(p(t.options.mutationKey)!==p(r))return!1}else if(!E(t.options.mutationKey,r))return!1}return(!i||t.state.status===i)&&(!o||!!o(t))}function h(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>y(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function E(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&!Object.keys(t).some(n=>!E(e[n],t[n]))}function f(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function g(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function y(e){if(!m(e))return!1;let t=e.constructor;if(void 0===t)return!0;let n=t.prototype;return!!(m(n)&&n.hasOwnProperty("isPrototypeOf"))&&Object.getPrototypeOf(e)===Object.prototype}function m(e){return"[object Object]"===Object.prototype.toString.call(e)}function x(e){return new Promise(t=>{setTimeout(t,e)})}function I(e,t,n){return"function"==typeof n.structuralSharing?n.structuralSharing(e,t):!1!==n.structuralSharing?function e(t,n){if(t===n)return t;let i=g(t)&&g(n);if(i||y(t)&&y(n)){let o=i?t:Object.keys(t),r=o.length,s=i?n:Object.keys(n),a=s.length,c=i?[]:{},u=0;for(let r=0;r<a;r++){let a=i?r:s[r];(!i&&o.includes(a)||i)&&void 0===t[a]&&void 0===n[a]?(c[a]=void 0,u++):(c[a]=e(t[a],n[a]),c[a]===t[a
3]&&void 0!==t[a]&&u++)}return r===a&&u===r?t:c}return n}(e,t):t}function v(e,t,n=0){let i=[...e,t];return n&&i.length>n?i.slice(1):i}function S(e,t,n=0){let i=[t,...e];return n&&i.length>n?i.slice(0,-1):i}var C=Symbol();function w(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==C?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}},29827:function(e,t,n){n.d(t,{NL:function(){return s},aH:function(){return a}});var i=n(2265),o=n(57437),r=i.createContext(void 0),s=e=>{let t=i.useContext(r);if(e)return e;if(!t)throw Error("No QueryClient set, use QueryClientProvider to set one");return t},a=e=>{let{client:t,children:n}=e;return i.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),(0,o.jsx)(r.Provider,{value:t,children:n})}},79122:function(e,t,n){n.d(t,{V:function(){return $}});var i=n(39271);function o(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}var r=function e(t,n){function i(e,i,r){if("undefined"!=typeof document){"number"==typeof(r=o({},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,decodeURIComponent).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(i,e)+s}}return Object.create({set:i,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var n=document.cookie?document.cookie.split("; "):[],i={},o=0;o<n.length;o++){var r=n[o].split("="),s=r.slice(1).join("=");try{var a=decodeURIComponent(r[0]);if(i[a]=t.read(s,a),e===a)break}catch(e){}}return e?i[e]:i}},remove:function(e,t){i(e,"",o({},t,{expires:-1}))},withAttributes:function(t){return e(this.converter,o({},this.attributes,t))},withConverter:function(t){return e(o({},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:i,sameSite:o,secure:r}=e;if(this.domain=n,this.path=t||"/",this.expires=Object.prototype.hasOwnProperty.call(e,"expires")?i:365,this.secure=!Object.prototype.hasOwnProperty.call(e,"secure")||r,Object.prototype.hasOwnProperty.call(e,"sameSite")){if(!o||!["strict","lax","none"].includes(o))throw Error('The sameSite value of cookieStorage must be "lax", "strict" or "none".');if("none"===o&&!this.secure)throw Error("sameSite = None requires the Secure attribute in latest browser versions.");this.sameSite=o}}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(16175),c=n(64686),u=n(42096),l=n(53110),d=n(87433),h=n(77694);let p={identityId:"identityId"},E=new l.k("DefaultIdentityIdStore");class f{setAuthConfig(e){(0,d.YE)(e.Cognito),this.authConfig=e,this._authKeys=g("Cognito",e.Cognito.identityPoolId)}constructor(e){this._authKeys={},this._hasGuestIdentityId=!1,this.keyValueStorage=e}async loadIdentityId(){(0,d.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 E.log("Error getting stored IdentityId.",e),null}}async storeIdentityId(e){(0,d.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 g=(e,t)=>(0,h._X)(p)(`com.amplify.${e}`,t);n(28364),n(41162);var y=n(20831),m=n(48880),x=n(91742),I=n(51849),v=n(96526),S=n(37487),C=n(12221),w=n(69514),A=n(48146),T=n(52954),R=n(63171);let P=(0,A.V)(v.y,[()=>e=>async function(t){return t.headers["cache-control"]="no-store",e(t)}]),N={service:"cognito-identity",endpointResolver:({region:e})=>({url:new w.a(`https://cognito-identity.${e}.${(0,I.b)(e)}`)}),retryDecider:(0,C.j)(m.f),computeDelay:S.k,userAgentValue:(0,T.Zm)(),cache:"no-store"};(0,R.QW)(()=>{N.userAgentValue=(0,T.Zm)()});let F=e=>({"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${e}`}),b=({url:e},t,n)=>({headers:t,url:e,body:n,method:"POST"}),D=async e=>{if(e.statusCode>=300)throw await (0,m.f)(e);{let t=await (0,m.e)(e);return{IdentityId:t.IdentityId,Credentials:k(t.Credentials),$metadata:(0,y.B)(e)}}},k=({AccessKeyId:e,SecretKey:t,SessionToken:n,Expiration:i}={})=>({AccessKeyId:e,SecretKey:t,SessionToken:n,Expiration:i&&new Date(1e3*i)}),U=(0,x.z)(P,(e,t)=>b(t,F("GetCredentialsForIdentity"),JSON.stringify(e)),D,N);var O=n(57826),M=n(99388),_=n(34168);let L=async e=>{if(!(e.statusCode>=300))return{IdentityId:(await (0,m.e)(e)).IdentityId,$metadata:(0,y.B)(e)};throw await (0,m.f)(e)},q=(0,x.z)(P,(e,t)=>b(t,F("GetId"),JSON.stringify(e)),L,N);function K(e){let t=(0,d.xp)(e).payload.iss,n={};if(!t)throw new O.l({name:"InvalidIdTokenException",message:"Invalid Idtoken."});return n[t.replace(/(^\w+:|^)\/\//,"")]=e,n}let V=new l.k("CognitoIdentityIdProvider");async function B({tokens:e,authConfig:t,identityIdStore:n}){n.setAuthConfig({Cognito:t});let i=await n.loadIdentityId();if(e){if(i&&"primary"===i.type)return i.id;{let n=e.idToken?K(e.idToken.toString()):{},o=await G(n,t);i&&i.id===o&&V.debug(`The guest identity ${i.id} has become the primary identity.`),i={id:o,type:"primary"}}}else{if(i&&"guest"===i.type)return i.id;i={id:await G({},t),type:"guest"}}return n.storeIdentityId(i),i.id}async function G(e,t){let n=t?.identityPoolId,i=(0,M.N)(n),o=(await q({region:i},{IdentityPoolId:n,Logins:e})).IdentityId;if(!o)throw new O.l({name:"GetIdResponseException",message:"Received undefined response from getId operation",recoverySuggestion:"Make sure to pass a valid identityPoolId in the configuration."});return o}let H=new l.k("CognitoCredentialsProvider");class z{constructor(e){this._nextCredentialsRefresh=0,this._identityIdStore=e}async clearCredentialsAndIdentityId(){H.debug("Clearing out credentials and identityId"),this._credentialsAndIdentityId=void 0,await this._identityIdStore.clearIdentityId()}async clearCredentials(){H.debug("Clearing out in-memory credentials"),this._credentialsAndIdentityId=void 0}async getCredentialsAndIdentityId(e){let t=e.authenticated,{tokens:n}=e,{authConfig:i}=e;try{(0,d.YE)(i?.Cognito)}catch{return}if(!t&&!i.Cognito.allowGuestAccess)return;let{forceRefresh:o}=e,r=this.hasTokenChanged(n),s=await B({tokens:n,authConfig:i.Cognito,identityIdStore:this._identityIdStore});return((o||r)&&this.clearCredentials(),t)?((0,_.Cg)(n),this.credsForOIDCTokens(i.Cognito,n,s)):this.getGuestCredentials(s,i.Cognito)}async getGuestCredentials(e,t){if(this._credentialsAndIdentityId&&!this.isPastTTL()&&!1===this._credentialsAndIdentityId.isAuthenticatedCreds)return H.info("returning stored credentials as they neither past TTL n
3or expired."),this._credentialsAndIdentityId;this.clearCredentials();let n=(0,M.N)(t.identityPoolId),i=await U({region:n},{IdentityId:e});if(i.Credentials&&i.Credentials.AccessKeyId&&i.Credentials.SecretKey){this._nextCredentialsRefresh=new Date().getTime()+3e6;let t={credentials:{accessKeyId:i.Credentials.AccessKeyId,secretAccessKey:i.Credentials.SecretKey,sessionToken:i.Credentials.SessionToken,expiration:i.Credentials.Expiration},identityId:e},n=i.IdentityId;return n&&(t.identityId=n,this._identityIdStore.storeIdentityId({id:n,type:"guest"})),this._credentialsAndIdentityId={...t,isAuthenticatedCreds:!1},t}throw new O.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 H.debug("returning stored credentials as they neither past TTL nor expired."),this._credentialsAndIdentityId;this.clearCredentials();let i=t.idToken?K(t.idToken.toString()):{},o=(0,M.N)(e.identityPoolId),r=await U({region:o},{IdentityId:n,Logins:i});if(r.Credentials&&r.Credentials.AccessKeyId&&r.Credentials.SecretKey){let e={credentials:{accessKeyId:r.Credentials.AccessKeyId,secretAccessKey:r.Credentials.SecretKey,sessionToken:r.Credentials.SessionToken,expiration:r.Credentials.Expiration},identityId:n};this._credentialsAndIdentityId={...e,isAuthenticatedCreds:!0,associatedIdToken:t.idToken?.toString()},this._nextCredentialsRefresh=new Date().getTime()+3e6;let i=r.IdentityId;return i&&(e.identityId=i,this._identityIdStore.storeIdentityId({id:i,type:"primary"})),e}throw new O.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 W=new z(new f(a.Fm)),$={configure(e,t){let n=(0,c.h)(e);if(!n.Auth||t?.Auth){i.d.configure(n,t);return}if(!i.d.libraryOptions.Auth){u.D.setAuthConfig(n.Auth),u.D.setKeyValueStorage(t?.ssr?new s({sameSite:"lax"}):a.Fm),i.d.configure(n,{...t,Auth:{tokenProvider:u.D,credentialsProvider:W}});return}if(t){void 0!==t.ssr&&u.D.setKeyValueStorage(t.ssr?new s({sameSite:"lax"}):a.Fm),i.d.configure(n,{Auth:i.d.libraryOptions.Auth,...t});return}i.d.configure(n)},getConfig:()=>i.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.