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AauB,EAAC,CAAC,KAAG1F,EAAA,GAAgBmE,EAAaf,CAAC,CAAC,EAAGwB,CAAI,CAEvG,CACJ,CCtHA,MAAMiB,EAAa,MAAO,CAAE,EAAAxpB,EAAG,EAAA2F,EAAG,EAAAmhB,CAAG,IAC1B,IAAI,QAAQ,CAACrd,EAASuI,IAAW,CACpCrM,EAAE,OAAO3F,EAAG8mB,EAAG,CAAC1pB,EAAKgrB,IAAM,CACvB,GAAIhrB,EAAK,CACL4U,EAAO5U,CAAG,EACV,MACJ,CACA,GAAIgrB,EAAE,IAAItB,CAAC,EAAE,OAAO/mB,EAAA,EAAW,IAAI,EAAG,CAClCiS,EAAO,IAAI,MAAM,yCAAyC,CAAC,EAC3D,MACJ,CACAvI,EAAQ2e,CAAC,CACb,CAAC,CACL,CAAC,ECFC/I,EAA0B,MAAOxT,GAAiB,CACpD,MAAMib,EAAI,IAAI/mB,EAAA,EAAW,KAAQ,EAAE,EAC7B4F,EAAI,IAAI5F,EAAA,EAAW,IAAK,EAAE,EAC1BC,EAAIypB,EAAyB,EAC7B,EAAI,MAAMD,EAAW,CAAE,EAAAxpB,EAAG,EAAA2F,EAAG,EAAAmhB,CAAE,CAAC,EACtC,OAAO,IAAIiC,EAAqB,CAAE,aAAAld,EAAc,EAAA7L,EAAG,EAAA2F,EAAG,EAAG,EAAAmhB,CAAE,CAAC,CAChE,EAMM2C,EAA2B,IAAM,CAEnC,MAAMP,EAAY9B,EAAgBsB,EAAe,GAAG,CAAC,EAErD,OAAO,IAAI3oB,EAAA,EAAWmpB,EAAW,EAAE,CACvC,C","sources":["../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/apiHelpers.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/internal/fetchUserAttributes.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/fetchUserAttributes.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/types.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/IdentityIdStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/utils.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/IdentityIdProvider.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/credentialsProvider.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/credentialsProvider/index.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserAttributeVerificationCodeClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/sendUserAttributeVerificationCode.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/BigInteger/BigInteger.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/types.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/errorHelpers.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/constants.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/setActiveSignInUsername.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getNowString.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/refreshAuthTokens.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/TokenOrchestrator.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/CognitoUserPoolsTokenProvider.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/tokenProvider.mjs","../node_modules/@aws-amplify/auth/dist/esm/utils/getAuthUserAgentValue.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInWithRedirectStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/types.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getSignatureString.mjs","../node_modules/@aws-amplify/auth/dist/esm/utils/openAuthSession.mjs","../node_modules/@aws-amplify/auth/dist/esm/errors/types/validation.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/parsers/regionParsers.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/userContextData.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/utils/store/signInStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/handlePasswordVerifierChallenge.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/types/errors.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/textEncoder/index.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmForgotPasswordClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/confirmResetPassword.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signUpHelpers.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signUp.mjs","../node_modules/@aws-amplify/auth/dist/esm/errors/utils/assertValidationError.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/getRedirectUrl.mjs","../node_modules/@aws-amplify/auth/dist/esm/errors/utils/assertServiceError.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/inflightPromise.mjs","../node_modules/@aws-amplify/auth/dist/esm/Errors.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/createOAuthError.mjs","../node_modules/@aws-amplify/auth/dist/esm/types/Auth.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/validateState.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/completeOAuthFlow.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/handleFailure.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/attemptCompleteOAuthFlow.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/enableOAuthListener.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/types/models.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/generateCodeVerifier.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/generateState.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/cancelOAuthFlow.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithRedirect.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/cognitoUserPoolEndpointResolver.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs","../node_modules/@aws-amplify/auth/dist/esm/common/AuthErrorStrings.mjs","../node_modules/@aws-amplify/auth/dist/esm/errors/AuthError.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmSignUpClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/confirmSignUp.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolDeserializer.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/utils/store/autoSignInStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleUserAuthFlow.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithUserAuth.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/autoSignIn.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/confirmSignIn.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createResendConfirmationCodeClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/resendSignUpCode.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/handleDeviceSRPAuth.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/oAuthStore.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createVerifySoftwareTokenClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createAssociateSoftwareTokenClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/utils/passkey/errors.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/utils/passkey/getIsPasskeySupported.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/convert/base64url/convertArrayBufferToBase64Url.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/convert/base64url/convertBase64UrlToArrayBuffer.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/utils/passkey/serde.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/utils/passkey/types/index.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/utils/passkey/getPasskey.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleWebAuthnSignInResult.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleSelectChallenge.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleSelectChallengeWithPassword.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/signInHelpers.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithCustomAuth.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithCustomSRPAuth.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithSRP.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signInWithUserPassword.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signIn.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/retryOnResourceNotFoundException.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/internal/getCurrentUser.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/getCurrentUser.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolSerializer.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/dispatchSignedInHubEvent.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/cacheTokens.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getBytesFromHex.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/constants.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/completeOAuthSignOut.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/oAuthSignOutRedirect.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/handleOAuthSignOut.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createRevokeTokenClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGlobalSignOutClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/signOut.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmDeviceClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/getNewDeviceMetadata.mjs","../node_modules/@aws-amplify/auth/dist/esm/client/flows/shared/handlePasswordSRP.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/constants.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createForgotPasswordClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/resetPassword.mjs","../node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createVerifyUserAttributeClient.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/confirmUserAttribute.mjs","../node_modules/@aws-amplify/auth/dist/esm/errors/constants.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/calculate/calculateS.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getHexFromBytes.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getHashFromData.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getHashFromHex.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getPaddedHex.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/calculate/calculateU.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getHkdfKey.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getRandomBytes.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getRandomString.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/AuthenticationHelper/AuthenticationHelper.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/calculate/calculateA.mjs","../node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getAuthenticationHelper.mjs"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Transforms a user attributes object into an array of AttributeType objects.\n * @param attributes user attributes to be mapped to AttributeType objects.\n * @returns an array of AttributeType objects.\n */\nfunction toAttributeType(attributes) {\n    return Object.entries(attributes).map(([key, value]) => ({\n        Name: key,\n        Value: value,\n    }));\n}\n/**\n * Transforms an array of AttributeType objects into a user attributes object.\n *\n * @param attributes - an array of AttributeType objects.\n * @returns AuthUserAttributes object.\n */\nfunction toAuthUserAttribute(attributes) {\n    const userAttributes = {};\n    attributes?.forEach(attribute => {\n        if (attribute.Name)\n            userAttributes[attribute.Name] = attribute.Value;\n    });\n    return userAttributes;\n}\n\nexport { toAttributeType, toAuthUserAttribute };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createGetUserClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('GetUser'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createGetUserClient };\n","import { assertTokenProviderConfig, fetchAuthSession, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { getRegionFromUserPoolId } from '../../../../foundation/parsers/regionParsers.mjs';\nimport { assertAuthTokens } from '../../utils/types.mjs';\nimport { toAuthUserAttribute } from '../../utils/apiHelpers.mjs';\nimport { getAuthUserAgentValue } from '../../../../utils/getAuthUserAgentValue.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../../common/AuthErrorStrings.mjs';\nimport '../../../../errors/types/validation.mjs';\nimport '../../types/errors.mjs';\nimport { createGetUserClient } from '../../../../foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst fetchUserAttributes = async (amplify) => {\n    const authConfig = amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const { userPoolEndpoint, userPoolId } = authConfig;\n    const { tokens } = await fetchAuthSession(amplify, {\n        forceRefresh: false,\n    });\n    assertAuthTokens(tokens);\n    const getUser = createGetUserClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const { UserAttributes } = await getUser({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.FetchUserAttributes),\n    }, {\n        AccessToken: tokens.accessToken.toString(),\n    });\n    return toAuthUserAttribute(UserAttributes);\n};\n\nexport { fetchUserAttributes };\n","import { Amplify } from '@aws-amplify/core';\nimport { fetchUserAttributes as fetchUserAttributes$1 } from './internal/fetchUserAttributes.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Fetches the current user attributes while authenticated.\n *\n * @throws - {@link GetUserException} - Cognito service errors thrown when the service is not able to get the user.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nconst fetchUserAttributes = () => {\n    return fetchUserAttributes$1(Amplify);\n};\n\nexport { fetchUserAttributes };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst IdentityIdStorageKeys = {\n    identityId: 'identityId',\n};\n\nexport { IdentityIdStorageKeys };\n","import { ConsoleLogger } from '@aws-amplify/core';\nimport { assertIdentityPoolIdConfig } from '@aws-amplify/core/internals/utils';\nimport { getAuthStorageKeys } from '../tokenProvider/TokenStore.mjs';\nimport { IdentityIdStorageKeys } from './types.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('DefaultIdentityIdStore');\nclass DefaultIdentityIdStore {\n    setAuthConfig(authConfigParam) {\n        assertIdentityPoolIdConfig(authConfigParam.Cognito);\n        this.authConfig = authConfigParam;\n        this._authKeys = createKeysForAuthStorage('Cognito', authConfigParam.Cognito.identityPoolId);\n    }\n    constructor(keyValueStorage) {\n        this._authKeys = {};\n        this._hasGuestIdentityId = false;\n        this.keyValueStorage = keyValueStorage;\n    }\n    async loadIdentityId() {\n        assertIdentityPoolIdConfig(this.authConfig?.Cognito);\n        try {\n            if (this._primaryIdentityId) {\n                return {\n                    id: this._primaryIdentityId,\n                    type: 'primary',\n                };\n            }\n            else {\n                const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);\n                if (storedIdentityId) {\n                    this._hasGuestIdentityId = true;\n                    return {\n                        id: storedIdentityId,\n                        type: 'guest',\n                    };\n                }\n                return null;\n            }\n        }\n        catch (err) {\n            logger.log('Error getting stored IdentityId.', err);\n            return null;\n        }\n    }\n    async storeIdentityId(identity) {\n        assertIdentityPoolIdConfig(this.authConfig?.Cognito);\n        if (identity.type === 'guest') {\n            this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);\n            // Clear in-memory storage of primary identityId\n            this._primaryIdentityId = undefined;\n            this._hasGuestIdentityId = true;\n        }\n        else {\n            this._primaryIdentityId = identity.id;\n            // Clear locally stored guest id\n            if (this._hasGuestIdentityId) {\n                this.keyValueStorage.removeItem(this._authKeys.identityId);\n                this._hasGuestIdentityId = false;\n            }\n        }\n    }\n    async clearIdentityId() {\n        this._primaryIdentityId = undefined;\n        await this.keyValueStorage.removeItem(this._authKeys.identityId);\n    }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n    return getAuthStorageKeys(IdentityIdStorageKeys)(`com.amplify.${provider}`, identifier);\n};\n\nexport { DefaultIdentityIdStore };\n","import { decodeJWT } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction formLoginsMap(idToken) {\n    const issuer = decodeJWT(idToken).payload.iss;\n    const res = {};\n    if (!issuer) {\n        throw new AuthError({\n            name: 'InvalidIdTokenException',\n            message: 'Invalid Idtoken.',\n        });\n    }\n    const domainName = issuer.replace(/(^\\w+:|^)\\/\\//, '');\n    res[domainName] = idToken;\n    return res;\n}\n\nexport { formLoginsMap };\n","import { getId } from '@aws-amplify/core';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { getRegionFromIdentityPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { formLoginsMap } from './utils.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Provides a Cognito identityId\n *\n * @param tokens - The AuthTokens received after SignIn\n * @returns string\n * @throws configuration exceptions: `InvalidIdentityPoolIdException`\n *  - Auth errors that may arise from misconfiguration.\n * @throws service exceptions: {@link GetIdException }\n */\nasync function cognitoIdentityIdProvider({ tokens, authConfig, identityIdStore, }) {\n    identityIdStore.setAuthConfig({ Cognito: authConfig });\n    // will return null only if there is no identityId cached or if there is an error retrieving it\n    const identityId = await identityIdStore.loadIdentityId();\n    if (identityId) {\n        return identityId.id;\n    }\n    const logins = tokens?.idToken\n        ? formLoginsMap(tokens.idToken.toString())\n        : {};\n    const generatedIdentityId = await generateIdentityId(logins, authConfig);\n    // Store generated identityId\n    identityIdStore.storeIdentityId({\n        id: generatedIdentityId,\n        type: tokens ? 'primary' : 'guest',\n    });\n    return generatedIdentityId;\n}\nasync function generateIdentityId(logins, authConfig) {\n    const identityPoolId = authConfig?.identityPoolId;\n    const region = getRegionFromIdentityPoolId(identityPoolId);\n    // IdentityId is absent so get it using IdentityPoolId with Cognito's GetId API\n    let idResult;\n    // for a first-time user, this will return a brand new identity\n    // for a returning user, this will retrieve the previous identity assocaited with the logins\n    try {\n        idResult = (await getId({\n            region,\n        }, {\n            IdentityPoolId: identityPoolId,\n            Logins: logins,\n        })).IdentityId;\n    }\n    catch (e) {\n        assertServiceError(e);\n        throw new AuthError(e);\n    }\n    if (!idResult) {\n        throw new AuthError({\n            name: 'GetIdResponseException',\n            message: 'Received undefined response from getId operation',\n            recoverySuggestion: 'Make sure to pass a valid identityPoolId in the configuration.',\n        });\n    }\n    return idResult;\n}\n\nexport { cognitoIdentityIdProvider };\n","import { ConsoleLogger, getCredentialsForIdentity } from '@aws-amplify/core';\nimport { assertIdentityPoolIdConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { getRegionFromIdentityPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { assertIdTokenInAuthTokens } from '../utils/types.mjs';\nimport { cognitoIdentityIdProvider } from './IdentityIdProvider.mjs';\nimport { formLoginsMap } from './utils.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('CognitoCredentialsProvider');\nconst CREDENTIALS_TTL = 50 * 60 * 1000; // 50 min, can be modified on config if required in the future\nclass CognitoAWSCredentialsAndIdentityIdProvider {\n    constructor(identityIdStore) {\n        this._nextCredentialsRefresh = 0;\n        this._identityIdStore = identityIdStore;\n    }\n    async clearCredentialsAndIdentityId() {\n        logger.debug('Clearing out credentials and identityId');\n        this._credentialsAndIdentityId = undefined;\n        await this._identityIdStore.clearIdentityId();\n    }\n    async clearCredentials() {\n        logger.debug('Clearing out in-memory credentials');\n        this._credentialsAndIdentityId = undefined;\n    }\n    async getCredentialsAndIdentityId(getCredentialsOptions) {\n        const isAuthenticated = getCredentialsOptions.authenticated;\n        const { tokens } = getCredentialsOptions;\n        const { authConfig } = getCredentialsOptions;\n        try {\n            assertIdentityPoolIdConfig(authConfig?.Cognito);\n        }\n        catch {\n            // No identity pool configured, skipping\n            return;\n        }\n        if (!isAuthenticated && !authConfig.Cognito.allowGuestAccess) {\n            // TODO(V6): return partial result like Native platforms\n            return;\n        }\n        const { forceRefresh } = getCredentialsOptions;\n        const tokenHasChanged = this.hasTokenChanged(tokens);\n        const identityId = await cognitoIdentityIdProvider({\n            tokens,\n            authConfig: authConfig.Cognito,\n            identityIdStore: this._identityIdStore,\n        });\n        // Clear cached credentials when forceRefresh is true OR the cache token has changed\n        if (forceRefresh || tokenHasChanged) {\n            this.clearCredentials();\n        }\n        if (!isAuthenticated) {\n            return this.getGuestCredentials(identityId, authConfig.Cognito);\n        }\n        else {\n            assertIdTokenInAuthTokens(tokens);\n            return this.credsForOIDCTokens(authConfig.Cognito, tokens, identityId);\n        }\n    }\n    async getGuestCredentials(identityId, authConfig) {\n        // Return existing in-memory cached credentials only if it exists, is not past it's lifetime and is unauthenticated credentials\n        if (this._credentialsAndIdentityId &&\n            !this.isPastTTL() &&\n            this._credentialsAndIdentityId.isAuthenticatedCreds === false) {\n            logger.info('returning stored credentials as they neither past TTL nor expired.');\n            return this._credentialsAndIdentityId;\n        }\n        // Clear to discard if any authenticated credentials are set and start with a clean slate\n        this.clearCredentials();\n        const region = getRegionFromIdentityPoolId(authConfig.identityPoolId);\n        // use identityId to obtain guest credentials\n        // save credentials in-memory\n        // No logins params should be passed for guest creds:\n        // https://docs.aws.amazon.com/cognitoidentity/latest/APIReference/API_GetCredentialsForIdentity.html\n        let clientResult;\n        try {\n            clientResult = await getCredentialsForIdentity({ region }, {\n                IdentityId: identityId,\n            });\n        }\n        catch (e) {\n            assertServiceError(e);\n            throw new AuthError(e);\n        }\n        if (clientResult?.Credentials?.AccessKeyId &&\n            clientResult?.Credentials?.SecretKey) {\n            this._nextCredentialsRefresh = new Date().getTime() + CREDENTIALS_TTL;\n            const res = {\n                credentials: {\n                    accessKeyId: clientResult.Credentials.AccessKeyId,\n                    secretAccessKey: clientResult.Credentials.SecretKey,\n                    sessionToken: clientResult.Credentials.SessionToken,\n                    expiration: clientResult.Credentials.Expiration,\n                },\n                identityId,\n            };\n            if (clientResult.IdentityId) {\n                res.identityId = clientResult.IdentityId;\n                this._identityIdStore.storeIdentityId({\n                    id: clientResult.IdentityId,\n                    type: 'guest',\n                });\n            }\n            this._credentialsAndIdentityId = {\n                ...res,\n                isAuthenticatedCreds: false,\n            };\n            return res;\n        }\n        else {\n            throw new AuthError({\n                name: 'CredentialsNotFoundException',\n                message: `Cognito did not respond with either Credentials, AccessKeyId or SecretKey.`,\n            });\n        }\n    }\n    async credsForOIDCTokens(authConfig, authTokens, identityId) {\n        if (this._credentialsAndIdentityId &&\n            !this.isPastTTL() &&\n            this._credentialsAndIdentityId.isAuthenticatedCreds === true) {\n            logger.debug('returning stored credentials as they neither past TTL nor expired.');\n            return this._credentialsAndIdentityId;\n        }\n        // Clear to discard if any unauthenticated credentials are set and start with a clean slate\n        this.clearCredentials();\n        const logins = authTokens.idToken\n            ? formLoginsMap(authTokens.idToken.toString())\n            : {};\n        const region = getRegionFromIdentityPoolId(authConfig.identityPoolId);\n        let clientResult;\n        try {\n            clientResult = await getCredentialsForIdentity({ region }, {\n                IdentityId: identityId,\n                Logins: logins,\n            });\n        }\n        catch (e) {\n            assertServiceError(e);\n            throw new AuthError(e);\n        }\n        if (clientResult?.Credentials?.AccessKeyId &&\n            clientResult?.Credentials?.SecretKey) {\n            this._nextCredentialsRefresh = new Date().getTime() + CREDENTIALS_TTL;\n            const res = {\n                credentials: {\n                    accessKeyId: clientResult.Credentials.AccessKeyId,\n                    secretAccessKey: clientResult.Credentials.SecretKey,\n                    sessionToken: clientResult.Credentials.SessionToken,\n                    expiration: clientResult.Credentials.Expiration,\n                },\n                identityId,\n            };\n            if (clientResult.IdentityId) {\n                res.identityId = clientResult.IdentityId;\n                // note: the following call removes guest identityId from the persistent store (localStorage)\n                this._identityIdStore.storeIdentityId({\n                    id: clientResult.IdentityId,\n                    type: 'primary',\n                });\n            }\n            // Store the credentials in-memory along with the expiration\n            this._credentialsAndIdentityId = {\n                ...res,\n                isAuthenticatedCreds: true,\n                associatedIdToken: authTokens.idToken?.toString(),\n            };\n            return res;\n        }\n        else {\n            throw new AuthError({\n                name: 'CredentialsException',\n                message: `Cognito did not respond with either Credentials, AccessKeyId or SecretKey.`,\n            });\n        }\n    }\n    isPastTTL() {\n        return this._nextCredentialsRefresh === undefined\n            ? true\n            : this._nextCredentialsRefresh <= Date.now();\n    }\n    hasTokenChanged(tokens) {\n        return (!!tokens &&\n            !!this._credentialsAndIdentityId?.associatedIdToken &&\n            tokens.idToken?.toString() !==\n                this._credentialsAndIdentityId.associatedIdToken);\n    }\n}\n\nexport { CognitoAWSCredentialsAndIdentityIdProvider };\n","import { defaultStorage } from '@aws-amplify/core';\nimport { DefaultIdentityIdStore } from './IdentityIdStore.mjs';\nimport { CognitoAWSCredentialsAndIdentityIdProvider } from './credentialsProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Cognito specific implmentation of the CredentialsProvider interface\n * that manages setting and getting of AWS Credentials.\n *\n * @throws configuration expections: `InvalidIdentityPoolIdException`\n *  - Auth errors that may arise from misconfiguration.\n * @throws service expections: {@link GetCredentialsForIdentityException}, {@link GetIdException}\n *\n */\nconst cognitoCredentialsProvider = new CognitoAWSCredentialsAndIdentityIdProvider(new DefaultIdentityIdStore(defaultStorage));\n\nexport { CognitoAWSCredentialsAndIdentityIdProvider, DefaultIdentityIdStore, cognitoCredentialsProvider };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createGetUserAttributeVerificationCodeClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('GetUserAttributeVerificationCode'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createGetUserAttributeVerificationCodeClient };\n","import { Amplify, fetchAuthSession } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { assertAuthTokens } from '../utils/types.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../types/errors.mjs';\nimport { createGetUserAttributeVerificationCodeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserAttributeVerificationCodeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Resends user's confirmation code when updating attributes while authenticated.\n *\n * @param input - The SendUserAttributeVerificationCodeInput object\n * @returns SendUserAttributeVerificationCodeOutput\n * @throws - {@link GetUserAttributeVerificationException}\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nconst sendUserAttributeVerificationCode = async (input) => {\n    const { userAttributeKey, options } = input;\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    const clientMetadata = options?.clientMetadata;\n    assertTokenProviderConfig(authConfig);\n    const { userPoolEndpoint, userPoolId } = authConfig;\n    const { tokens } = await fetchAuthSession({ forceRefresh: false });\n    assertAuthTokens(tokens);\n    const getUserAttributeVerificationCode = createGetUserAttributeVerificationCodeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const { CodeDeliveryDetails } = await getUserAttributeVerificationCode({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.SendUserAttributeVerificationCode),\n    }, {\n        AccessToken: tokens.accessToken.toString(),\n        ClientMetadata: clientMetadata,\n        AttributeName: userAttributeKey,\n    });\n    const { DeliveryMedium, AttributeName, Destination } = {\n        ...CodeDeliveryDetails,\n    };\n    return {\n        destination: Destination,\n        deliveryMedium: DeliveryMedium,\n        attributeName: AttributeName,\n    };\n};\n\nexport { sendUserAttributeVerificationCode };\n","/* eslint-disable */\n// @ts-nocheck -> BigInteger is already a vended utility\n// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// All public methods have been removed except the following:\n//   new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)\n//   toString (only radix 2, 4, 8, 16 and 32 supported)\n//   negate\n//   abs\n//   compareTo\n//   bitLength\n//   mod\n//   equals\n//   add\n//   subtract\n//   multiply\n//   divide\n//   modPow\n/*\n * Copyright (c) 2003-2005  Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n// (public) Constructor\nfunction BigInteger(a, b) {\n    if (a != null)\n        this.fromString(a, b);\n}\n// return new, unset BigInteger\nfunction nbi() {\n    return new BigInteger(null, null);\n}\n// Bits per digit\nlet dbits;\n// JavaScript engine analysis\nconst canary = 0xdeadbeefcafe;\nconst j_lm = (canary & 0xffffff) === 0xefcafe;\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i, x, w, j, c, n) {\n    while (--n >= 0) {\n        const v = x * this[i++] + w[j] + c;\n        c = Math.floor(v / 0x4000000);\n        w[j++] = v & 0x3ffffff;\n    }\n    return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i, x, w, j, c, n) {\n    const xl = x & 0x7fff;\n    const xh = x >> 15;\n    while (--n >= 0) {\n        let l = this[i] & 0x7fff;\n        const h = this[i++] >> 15;\n        const m = xh * l + h * xl;\n        l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n        c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n        w[j++] = l & 0x3fffffff;\n    }\n    return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i, x, w, j, c, n) {\n    const xl = x & 0x3fff;\n    const xh = x >> 14;\n    while (--n >= 0) {\n        let l = this[i] & 0x3fff;\n        const h = this[i++] >> 14;\n        const m = xh * l + h * xl;\n        l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\n        c = (l >> 28) + (m >> 14) + xh * h;\n        w[j++] = l & 0xfffffff;\n    }\n    return c;\n}\nconst inBrowser = typeof navigator !== 'undefined';\nif (inBrowser && j_lm && navigator.appName === 'Microsoft Internet Explorer') {\n    BigInteger.prototype.am = am2;\n    dbits = 30;\n}\nelse if (inBrowser && j_lm && navigator.appName !== 'Netscape') {\n    BigInteger.prototype.am = am1;\n    dbits = 26;\n}\nelse {\n    // Mozilla/Netscape seems to prefer am3\n    BigInteger.prototype.am = am3;\n    dbits = 28;\n}\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = (1 << dbits) - 1;\nBigInteger.prototype.DV = 1 << dbits;\nconst BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2, BI_FP);\nBigInteger.prototype.F1 = BI_FP - dbits;\nBigInteger.prototype.F2 = 2 * dbits - BI_FP;\n// Digit conversions\nconst BI_RM = '0123456789abcdefghijklmnopqrstuvwxyz';\nconst BI_RC = [];\nlet rr, vv;\nrr = '0'.charCodeAt(0);\nfor (vv = 0; vv <= 9; ++vv)\n    BI_RC[rr++] = vv;\nrr = 'a'.charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv)\n    BI_RC[rr++] = vv;\nrr = 'A'.charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv)\n    BI_RC[rr++] = vv;\nfunction int2char(n) {\n    return BI_RM.charAt(n);\n}\nfunction intAt(s, i) {\n    const c = BI_RC[s.charCodeAt(i)];\n    return c == null ? -1 : c;\n}\n// (protected) copy this to r\nfunction bnpCopyTo(r) {\n    for (let i = this.t - 1; i >= 0; --i)\n        r[i] = this[i];\n    r.t = this.t;\n    r.s = this.s;\n}\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n    this.t = 1;\n    this.s = x < 0 ? -1 : 0;\n    if (x > 0)\n        this[0] = x;\n    else if (x < -1)\n        this[0] = x + this.DV;\n    else\n        this.t = 0;\n}\n// return bigint initialized to value\nfunction nbv(i) {\n    const r = nbi();\n    r.fromInt(i);\n    return r;\n}\n// (protected) set from string and radix\nfunction bnpFromString(s, b) {\n    let k;\n    if (b === 16)\n        k = 4;\n    else if (b === 8)\n        k = 3;\n    else if (b === 2)\n        k = 1;\n    else if (b === 32)\n        k = 5;\n    else if (b === 4)\n        k = 2;\n    else\n        throw new Error('Only radix 2, 4, 8, 16, 32 are supported');\n    this.t = 0;\n    this.s = 0;\n    let i = s.length;\n    let mi = false;\n    let sh = 0;\n    while (--i >= 0) {\n        const x = intAt(s, i);\n        if (x < 0) {\n            if (s.charAt(i) === '-')\n                mi = true;\n            continue;\n        }\n        mi = false;\n        if (sh === 0)\n            this[this.t++] = x;\n        else if (sh + k > this.DB) {\n            this[this.t - 1] |= (x & ((1 << (this.DB - sh)) - 1)) << sh;\n            this[this.t++] = x >> (this.DB - sh);\n        }\n        else\n            this[this.t - 1] |= x << sh;\n        sh += k;\n        if (sh >= this.DB)\n            sh -= this.DB;\n    }\n    this.clamp();\n    if (mi)\n        BigInteger.ZERO.subTo(this, this);\n}\n// (protected) clamp off excess high words\nfunction bnpClamp() {\n    const c = this.s & this.DM;\n    while (this.t > 0 && this[this.t - 1] == c)\n        --this.t;\n}\n// (public) return string representation in given radix\nfunction bnToString(b) {\n    if (this.s < 0)\n        return '-' + this.negate().toString(b);\n    let k;\n    if (b == 16)\n        k = 4;\n    else if (b === 8)\n        k = 3;\n    else if (b === 2)\n        k = 1;\n    else if (b === 32)\n        k = 5;\n    else if (b === 4)\n        k = 2;\n    else\n        throw new Error('Only radix 2, 4, 8, 16, 32 are supported');\n    const km = (1 << k) - 1;\n    let d;\n    let m = false;\n    let r = '';\n    let i = this.t;\n    let p = this.DB - ((i * this.DB) % k);\n    if (i-- > 0) {\n        if (p < this.DB && (d = this[i] >> p) > 0) {\n            m = true;\n            r = int2char(d);\n        }\n        while (i >= 0) {\n            if (p < k) {\n                d = (this[i] & ((1 << p) - 1)) << (k - p);\n                d |= this[--i] >> (p += this.DB - k);\n            }\n            else {\n                d = (this[i] >> (p -= k)) & km;\n                if (p <= 0) {\n                    p += this.DB;\n                    --i;\n                }\n            }\n            if (d > 0)\n                m = true;\n            if (m)\n                r += int2char(d);\n        }\n    }\n    return m ? r : '0';\n}\n// (public) -this\nfunction bnNegate() {\n    const r = nbi();\n    BigInteger.ZERO.subTo(this, r);\n    return r;\n}\n// (public) |this|\nfunction bnAbs() {\n    return this.s < 0 ? this.negate() : this;\n}\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n    let r = this.s - a.s;\n    if (r != 0)\n        return r;\n    let i = this.t;\n    r = i - a.t;\n    if (r != 0)\n        return this.s < 0 ? -r : r;\n    while (--i >= 0)\n        if ((r = this[i] - a[i]) != 0)\n            return r;\n    return 0;\n}\n// returns bit length of the integer x\nfunction nbits(x) {\n    let r = 1;\n    let t;\n    if ((t = x >>> 16) !== 0) {\n        x = t;\n        r += 16;\n    }\n    if ((t = x >> 8) !== 0) {\n        x = t;\n        r += 8;\n    }\n    if ((t = x >> 4) !== 0) {\n        x = t;\n        r += 4;\n    }\n    if ((t = x >> 2) !== 0) {\n        x = t;\n        r += 2;\n    }\n    if ((t = x >> 1) !== 0) {\n        x = t;\n        r += 1;\n    }\n    return r;\n}\n// (public) return the number of bits in \"this\"\nfunction bnBitLength() {\n    if (this.t <= 0)\n        return 0;\n    return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM));\n}\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n, r) {\n    let i;\n    for (i = this.t - 1; i >= 0; --i)\n        r[i + n] = this[i];\n    for (i = n - 1; i >= 0; --i)\n        r[i] = 0;\n    r.t = this.t + n;\n    r.s = this.s;\n}\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n, r) {\n    for (let i = n; i < this.t; ++i)\n        r[i - n] = this[i];\n    r.t = Math.max(this.t - n, 0);\n    r.s = this.s;\n}\n// (protected) r = this << n\nfunction bnpLShiftTo(n, r) {\n    const bs = n % this.DB;\n    const cbs = this.DB - bs;\n    const bm = (1 << cbs) - 1;\n    const ds = Math.floor(n / this.DB);\n    let c = (this.s << bs) & this.DM;\n    let i;\n    for (i = this.t - 1; i >= 0; --i) {\n        r[i + ds + 1] = (this[i] >> cbs) | c;\n        c = (this[i] & bm) << bs;\n    }\n    for (i = ds - 1; i >= 0; --i)\n        r[i] = 0;\n    r[ds] = c;\n    r.t = this.t + ds + 1;\n    r.s = this.s;\n    r.clamp();\n}\n// (protected) r = this >> n\nfunction bnpRShiftTo(n, r) {\n    r.s = this.s;\n    const ds = Math.floor(n / this.DB);\n    if (ds >= this.t) {\n        r.t = 0;\n        return;\n    }\n    const bs = n % this.DB;\n    const cbs = this.DB - bs;\n    const bm = (1 << bs) - 1;\n    r[0] = this[ds] >> bs;\n    for (let i = ds + 1; i < this.t; ++i) {\n        r[i - ds - 1] |= (this[i] & bm) << cbs;\n        r[i - ds] = this[i] >> bs;\n    }\n    if (bs > 0)\n        r[this.t - ds - 1] |= (this.s & bm) << cbs;\n    r.t = this.t - ds;\n    r.clamp();\n}\n// (protected) r = this - a\nfunction bnpSubTo(a, r) {\n    let i = 0;\n    let c = 0;\n    const m = Math.min(a.t, this.t);\n    while (i < m) {\n        c += this[i] - a[i];\n        r[i++] = c & this.DM;\n        c >>= this.DB;\n    }\n    if (a.t < this.t) {\n        c -= a.s;\n        while (i < this.t) {\n            c += this[i];\n            r[i++] = c & this.DM;\n            c >>= this.DB;\n        }\n        c += this.s;\n    }\n    else {\n        c += this.s;\n        while (i < a.t) {\n            c -= a[i];\n            r[i++] = c & this.DM;\n            c >>= this.DB;\n        }\n        c -= a.s;\n    }\n    r.s = c < 0 ? -1 : 0;\n    if (c < -1)\n        r[i++] = this.DV + c;\n    else if (c > 0)\n        r[i++] = c;\n    r.t = i;\n    r.clamp();\n}\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a, r) {\n    const x = this.abs();\n    const y = a.abs();\n    let i = x.t;\n    r.t = i + y.t;\n    while (--i >= 0)\n        r[i] = 0;\n    for (i = 0; i < y.t; ++i)\n        r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n    r.s = 0;\n    r.clamp();\n    if (this.s !== a.s)\n        BigInteger.ZERO.subTo(r, r);\n}\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n    const x = this.abs();\n    let i = (r.t = 2 * x.t);\n    while (--i >= 0)\n        r[i] = 0;\n    for (i = 0; i < x.t - 1; ++i) {\n        const c = x.am(i, x[i], r, 2 * i, 0, 1);\n        if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >=\n            x.DV) {\n            r[i + x.t] -= x.DV;\n            r[i + x.t + 1] = 1;\n        }\n    }\n    if (r.t > 0)\n        r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n    r.s = 0;\n    r.clamp();\n}\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m.  q or r may be null.\nfunction bnpDivRemTo(m, q, r) {\n    const pm = m.abs();\n    if (pm.t <= 0)\n        return;\n    const pt = this.abs();\n    if (pt.t < pm.t) {\n        if (q != null)\n            q.fromInt(0);\n        if (r != null)\n            this.copyTo(r);\n        return;\n    }\n    if (r === null)\n        r = nbi();\n    const y = nbi();\n    const ts = this.s;\n    const ms = m.s;\n    const nsh = this.DB - nbits(pm[pm.t - 1]);\n    // normalize modulus\n    if (nsh > 0) {\n        pm.lShiftTo(nsh, y);\n        pt.lShiftTo(nsh, r);\n    }\n    else {\n        pm.copyTo(y);\n        pt.copyTo(r);\n    }\n    const ys = y.t;\n    const y0 = y[ys - 1];\n    if (y0 === 0)\n        return;\n    const yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n    const d1 = this.FV / yt;\n    const d2 = (1 << this.F1) / yt;\n    const e = 1 << this.F2;\n    let i = r.t;\n    let j = i - ys;\n    const t = q === null ? nbi() : q;\n    y.dlShiftTo(j, t);\n    if (r.compareTo(t) >= 0) {\n        r[r.t++] = 1;\n        r.subTo(t, r);\n    }\n    BigInteger.ONE.dlShiftTo(ys, t);\n    t.subTo(y, y);\n    // \"negative\" y so we can replace sub with am later\n    while (y.t < ys)\n        y[y.t++] = 0;\n    while (--j >= 0) {\n        // Estimate quotient digit\n        let qd = r[--i] === y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n        if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n            // Try it out\n            y.dlShiftTo(j, t);\n            r.subTo(t, r);\n            while (r[i] < --qd)\n                r.subTo(t, r);\n        }\n    }\n    if (q !== null) {\n        r.drShiftTo(ys, q);\n        if (ts !== ms)\n            BigInteger.ZERO.subTo(q, q);\n    }\n    r.t = ys;\n    r.clamp();\n    if (nsh > 0)\n        r.rShiftTo(nsh, r);\n    // Denormalize remainder\n    if (ts < 0)\n        BigInteger.ZERO.subTo(r, r);\n}\n// (public) this mod a\nfunction bnMod(a) {\n    const r = nbi();\n    this.abs().divRemTo(a, null, r);\n    if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0)\n        a.subTo(r, r);\n    return r;\n}\n// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n//         xy == 1 (mod m)\n//         xy =  1+km\n//   xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n    if (this.t < 1)\n        return 0;\n    const x = this[0];\n    if ((x & 1) === 0)\n        return 0;\n    let y = x & 3;\n    // y == 1/x mod 2^2\n    y = (y * (2 - (x & 0xf) * y)) & 0xf;\n    // y == 1/x mod 2^4\n    y = (y * (2 - (x & 0xff) * y)) & 0xff;\n    // y == 1/x mod 2^8\n    y = (y * (2 - (((x & 0xffff) * y) & 0xffff))) & 0xffff;\n    // y == 1/x mod 2^16\n    // last step - calculate inverse mod DV directly;\n    // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n    y = (y * (2 - ((x * y) % this.DV))) % this.DV;\n    // y == 1/x mod 2^dbits\n    // we really want the negative inverse, and -DV < y < DV\n    return y > 0 ? this.DV - y : -y;\n}\nfunction bnEquals(a) {\n    return this.compareTo(a) === 0;\n}\n// (protected) r = this + a\nfunction bnpAddTo(a, r) {\n    let i = 0;\n    let c = 0;\n    const m = Math.min(a.t, this.t);\n    while (i < m) {\n        c += this[i] + a[i];\n        r[i++] = c & this.DM;\n        c >>= this.DB;\n    }\n    if (a.t < this.t) {\n        c += a.s;\n        while (i < this.t) {\n            c += this[i];\n            r[i++] = c & this.DM;\n            c >>= this.DB;\n        }\n        c += this.s;\n    }\n    else {\n        c += this.s;\n        while (i < a.t) {\n            c += a[i];\n            r[i++] = c & this.DM;\n            c >>= this.DB;\n        }\n        c += a.s;\n    }\n    r.s = c < 0 ? -1 : 0;\n    if (c > 0)\n        r[i++] = c;\n    else if (c < -1)\n        r[i++] = this.DV + c;\n    r.t = i;\n    r.clamp();\n}\n// (public) this + a\nfunction bnAdd(a) {\n    const r = nbi();\n    this.addTo(a, r);\n    return r;\n}\n// (public) this - a\nfunction bnSubtract(a) {\n    const r = nbi();\n    this.subTo(a, r);\n    return r;\n}\n// (public) this * a\nfunction bnMultiply(a) {\n    const r = nbi();\n    this.multiplyTo(a, r);\n    return r;\n}\n// (public) this / a\nfunction bnDivide(a) {\n    const r = nbi();\n    this.divRemTo(a, r, null);\n    return r;\n}\n// Montgomery reduction\nfunction Montgomery(m) {\n    this.m = m;\n    this.mp = m.invDigit();\n    this.mpl = this.mp & 0x7fff;\n    this.mph = this.mp >> 15;\n    this.um = (1 << (m.DB - 15)) - 1;\n    this.mt2 = 2 * m.t;\n}\n// xR mod m\nfunction montConvert(x) {\n    const r = nbi();\n    x.abs().dlShiftTo(this.m.t, r);\n    r.divRemTo(this.m, null, r);\n    if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0)\n        this.m.subTo(r, r);\n    return r;\n}\n// x/R mod m\nfunction montRevert(x) {\n    const r = nbi();\n    x.copyTo(r);\n    this.reduce(r);\n    return r;\n}\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n    while (x.t <= this.mt2)\n        // pad x so am has enough room later\n        x[x.t++] = 0;\n    for (let i = 0; i < this.m.t; ++i) {\n        // faster way of calculating u0 = x[i]*mp mod DV\n        let j = x[i] & 0x7fff;\n        const u0 = (j * this.mpl +\n            (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) &\n            x.DM;\n        // use am to combine the multiply-shift-add into one call\n        j = i + this.m.t;\n        x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n        // propagate carry\n        while (x[j] >= x.DV) {\n            x[j] -= x.DV;\n            x[++j]++;\n        }\n    }\n    x.clamp();\n    x.drShiftTo(this.m.t, x);\n    if (x.compareTo(this.m) >= 0)\n        x.subTo(this.m, x);\n}\n// r = \"x^2/R mod m\"; x != r\nfunction montSqrTo(x, r) {\n    x.squareTo(r);\n    this.reduce(r);\n}\n// r = \"xy/R mod m\"; x,y != r\nfunction montMulTo(x, y, r) {\n    x.multiplyTo(y, r);\n    this.reduce(r);\n}\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n// (public) this^e % m (HAC 14.85)\nfunction bnModPow(e, m, callback) {\n    let i = e.bitLength();\n    let k;\n    let r = nbv(1);\n    const z = new Montgomery(m);\n    if (i <= 0)\n        return r;\n    else if (i < 18)\n        k = 1;\n    else if (i < 48)\n        k = 3;\n    else if (i < 144)\n        k = 4;\n    else if (i < 768)\n        k = 5;\n    else\n        k = 6;\n    // precomputation\n    const g = [];\n    let n = 3;\n    const k1 = k - 1;\n    const km = (1 << k) - 1;\n    g[1] = z.convert(this);\n    if (k > 1) {\n        const g2 = nbi();\n        z.sqrTo(g[1], g2);\n        while (n <= km) {\n            g[n] = nbi();\n            z.mulTo(g2, g[n - 2], g[n]);\n            n += 2;\n        }\n    }\n    let j = e.t - 1;\n    let w;\n    let is1 = true;\n    let r2 = nbi();\n    let t;\n    i = nbits(e[j]) - 1;\n    while (j >= 0) {\n        if (i >= k1)\n            w = (e[j] >> (i - k1)) & km;\n        else {\n            w = (e[j] & ((1 << (i + 1)) - 1)) << (k1 - i);\n            if (j > 0)\n                w |= e[j - 1] >> (this.DB + i - k1);\n        }\n        n = k;\n        while ((w & 1) === 0) {\n            w >>= 1;\n            --n;\n        }\n        if ((i -= n) < 0) {\n            i += this.DB;\n            --j;\n        }\n        if (is1) {\n            // ret == 1, don't bother squaring or multiplying it\n            g[w].copyTo(r);\n            is1 = false;\n        }\n        else {\n            while (n > 1) {\n                z.sqrTo(r, r2);\n                z.sqrTo(r2, r);\n                n -= 2;\n            }\n            if (n > 0)\n                z.sqrTo(r, r2);\n            else {\n                t = r;\n                r = r2;\n                r2 = t;\n            }\n            z.mulTo(r2, g[w], r);\n        }\n        while (j >= 0 && (e[j] & (1 << i)) === 0) {\n            z.sqrTo(r, r2);\n            t = r;\n            r = r2;\n            r2 = t;\n            if (--i < 0) {\n                i = this.DB - 1;\n                --j;\n            }\n        }\n    }\n    const result = z.revert(r);\n    callback(null, result);\n    return result;\n}\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.addTo = bnpAddTo;\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.modPow = bnModPow;\n// \"constants\"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);\n\nexport { BigInteger as default };\n","const AuthTokenStorageKeys = {\n    accessToken: 'accessToken',\n    idToken: 'idToken',\n    oidcProvider: 'oidcProvider',\n    clockDrift: 'clockDrift',\n    refreshToken: 'refreshToken',\n    deviceKey: 'deviceKey',\n    randomPasswordKey: 'randomPasswordKey',\n    deviceGroupKey: 'deviceGroupKey',\n    signInDetails: 'signInDetails',\n    oauthMetadata: 'oauthMetadata',\n};\n\nexport { AuthTokenStorageKeys };\n","import { createAssertionFunction } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar TokenProviderErrorCode;\n(function (TokenProviderErrorCode) {\n    TokenProviderErrorCode[\"InvalidAuthTokens\"] = \"InvalidAuthTokens\";\n})(TokenProviderErrorCode || (TokenProviderErrorCode = {}));\nconst tokenValidationErrorMap = {\n    [TokenProviderErrorCode.InvalidAuthTokens]: {\n        message: 'Invalid tokens.',\n        recoverySuggestion: 'Make sure the tokens are valid.',\n    },\n};\nconst assert = createAssertionFunction(tokenValidationErrorMap);\n\nexport { TokenProviderErrorCode, assert };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst AUTH_KEY_PREFIX = 'CognitoIdentityServiceProvider';\n\nexport { AUTH_KEY_PREFIX };\n","import { decodeJWT, assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { AuthTokenStorageKeys } from './types.mjs';\nimport { assert, TokenProviderErrorCode } from './errorHelpers.mjs';\nimport { AUTH_KEY_PREFIX } from './constants.mjs';\n\nclass DefaultTokenStore {\n    getKeyValueStorage() {\n        if (!this.keyValueStorage) {\n            throw new AuthError({\n                name: 'KeyValueStorageNotFoundException',\n                message: 'KeyValueStorage was not found in TokenStore',\n            });\n        }\n        return this.keyValueStorage;\n    }\n    setKeyValueStorage(keyValueStorage) {\n        this.keyValueStorage = keyValueStorage;\n    }\n    setAuthConfig(authConfig) {\n        this.authConfig = authConfig;\n    }\n    async loadTokens() {\n        // TODO(v6): migration logic should be here\n        // Reading V5 tokens old format\n        try {\n            const authKeys = await this.getAuthKeys();\n            const accessTokenString = await this.getKeyValueStorage().getItem(authKeys.accessToken);\n            if (!accessTokenString) {\n                throw new AuthError({\n                    name: 'NoSessionFoundException',\n                    message: 'Auth session was not found. Make sure to call signIn.',\n                });\n            }\n            const accessToken = decodeJWT(accessTokenString);\n            const itString = await this.getKeyValueStorage().getItem(authKeys.idToken);\n            const idToken = itString ? decodeJWT(itString) : undefined;\n            const refreshToken = (await this.getKeyValueStorage().getItem(authKeys.refreshToken)) ??\n                undefined;\n            const clockDriftString = (await this.getKeyValueStorage().getItem(authKeys.clockDrift)) ?? '0';\n            const clockDrift = Number.parseInt(clockDriftString);\n            const signInDetails = await this.getKeyValueStorage().getItem(authKeys.signInDetails);\n            const tokens = {\n                accessToken,\n                idToken,\n                refreshToken,\n                deviceMetadata: (await this.getDeviceMetadata()) ?? undefined,\n                clockDrift,\n                username: await this.getLastAuthUser(),\n            };\n            if (signInDetails) {\n                tokens.signInDetails = JSON.parse(signInDetails);\n            }\n            return tokens;\n        }\n        catch (err) {\n            return null;\n        }\n    }\n    async storeTokens(tokens) {\n        assert(tokens !== undefined, TokenProviderErrorCode.InvalidAuthTokens);\n        const lastAuthUser = tokens.username;\n        await this.getKeyValueStorage().setItem(this.getLastAuthUserKey(), lastAuthUser);\n        const authKeys = await this.getAuthKeys();\n        await this.getKeyValueStorage().setItem(authKeys.accessToken, tokens.accessToken.toString());\n        if (tokens.idToken) {\n            await this.getKeyValueStorage().setItem(authKeys.idToken, tokens.idToken.toString());\n        }\n        else {\n            await this.getKeyValueStorage().removeItem(authKeys.idToken);\n        }\n        if (tokens.refreshToken) {\n            await this.getKeyValueStorage().setItem(authKeys.refreshToken, tokens.refreshToken);\n        }\n        else {\n            await this.getKeyValueStorage().removeItem(authKeys.refreshToken);\n        }\n        if (tokens.deviceMetadata) {\n            if (tokens.deviceMetadata.deviceKey) {\n                await this.getKeyValueStorage().setItem(authKeys.deviceKey, tokens.deviceMetadata.deviceKey);\n            }\n            if (tokens.deviceMetadata.deviceGroupKey) {\n                await this.getKeyValueStorage().setItem(authKeys.deviceGroupKey, tokens.deviceMetadata.deviceGroupKey);\n            }\n            await this.getKeyValueStorage().setItem(authKeys.randomPasswordKey, tokens.deviceMetadata.randomPassword);\n        }\n        if (tokens.signInDetails) {\n            await this.getKeyValueStorage().setItem(authKeys.signInDetails, JSON.stringify(tokens.signInDetails));\n        }\n        else {\n            await this.getKeyValueStorage().removeItem(authKeys.signInDetails);\n        }\n        await this.getKeyValueStorage().setItem(authKeys.clockDrift, `${tokens.clockDrift}`);\n    }\n    async clearTokens() {\n        const authKeys = await this.getAuthKeys();\n        // Not calling clear because it can remove data that is not managed by AuthTokenStore\n        await Promise.all([\n            this.getKeyValueStorage().removeItem(authKeys.accessToken),\n            this.getKeyValueStorage().removeItem(authKeys.idToken),\n            this.getKeyValueStorage().removeItem(authKeys.clockDrift),\n            this.getKeyValueStorage().removeItem(authKeys.refreshToken),\n            this.getKeyValueStorage().removeItem(authKeys.signInDetails),\n            this.getKeyValueStorage().removeItem(this.getLastAuthUserKey()),\n            this.getKeyValueStorage().removeItem(authKeys.oauthMetadata),\n        ]);\n    }\n    async getDeviceMetadata(username) {\n        const authKeys = await this.getAuthKeys(username);\n        const deviceKey = await this.getKeyValueStorage().getItem(authKeys.deviceKey);\n        const deviceGroupKey = await this.getKeyValueStorage().getItem(authKeys.deviceGroupKey);\n        const randomPassword = await this.getKeyValueStorage().getItem(authKeys.randomPasswordKey);\n        return randomPassword && deviceGroupKey && deviceKey\n            ? {\n                deviceKey,\n                deviceGroupKey,\n                randomPassword,\n            }\n            : null;\n    }\n    async clearDeviceMetadata(username) {\n        const authKeys = await this.getAuthKeys(username);\n        await Promise.all([\n            this.getKeyValueStorage().removeItem(authKeys.deviceKey),\n            this.getKeyValueStorage().removeItem(authKeys.deviceGroupKey),\n            this.getKeyValueStorage().removeItem(authKeys.randomPasswordKey),\n        ]);\n    }\n    async getAuthKeys(username) {\n        assertTokenProviderConfig(this.authConfig?.Cognito);\n        const lastAuthUser = username ?? (await this.getLastAuthUser());\n        return createKeysForAuthStorage(AUTH_KEY_PREFIX, `${this.authConfig.Cognito.userPoolClientId}.${lastAuthUser}`);\n    }\n    getLastAuthUserKey() {\n        assertTokenProviderConfig(this.authConfig?.Cognito);\n        const identifier = this.authConfig.Cognito.userPoolClientId;\n        return `${AUTH_KEY_PREFIX}.${identifier}.LastAuthUser`;\n    }\n    async getLastAuthUser() {\n        const lastAuthUser = (await this.getKeyValueStorage().getItem(this.getLastAuthUserKey())) ??\n            'username';\n        return lastAuthUser;\n    }\n    async setOAuthMetadata(metadata) {\n        const { oauthMetadata: oauthMetadataKey } = await this.getAuthKeys();\n        await this.getKeyValueStorage().setItem(oauthMetadataKey, JSON.stringify(metadata));\n    }\n    async getOAuthMetadata() {\n        const { oauthMetadata: oauthMetadataKey } = await this.getAuthKeys();\n        const oauthMetadata = await this.getKeyValueStorage().getItem(oauthMetadataKey);\n        return oauthMetadata && JSON.parse(oauthMetadata);\n    }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n    return getAuthStorageKeys(AuthTokenStorageKeys)(`${provider}`, identifier);\n};\nfunction getAuthStorageKeys(authKeys) {\n    const keys = Object.values({ ...authKeys });\n    return (prefix, identifier) => keys.reduce((acc, authKey) => ({\n        ...acc,\n        [authKey]: `${prefix}.${identifier}.${authKey}`,\n    }), {});\n}\n\nexport { DefaultTokenStore, createKeysForAuthStorage, getAuthStorageKeys };\n","import '../../../client/utils/store/autoSignInStore.mjs';\nimport { signInStore } from '../../../client/utils/store/signInStore.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction setActiveSignInUsername(username) {\n    const { dispatch } = signInStore;\n    dispatch({ type: 'SET_USERNAME', value: username });\n}\n\nexport { setActiveSignInUsername };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst MONTH_NAMES = [\n    'Jan',\n    'Feb',\n    'Mar',\n    'Apr',\n    'May',\n    'Jun',\n    'Jul',\n    'Aug',\n    'Sep',\n    'Oct',\n    'Nov',\n    'Dec',\n];\nconst WEEK_NAMES = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\nconst getNowString = () => {\n    const now = new Date();\n    const weekDay = WEEK_NAMES[now.getUTCDay()];\n    const month = MONTH_NAMES[now.getUTCMonth()];\n    const day = now.getUTCDate();\n    let hours = now.getUTCHours();\n    if (hours < 10) {\n        hours = `0${hours}`;\n    }\n    let minutes = now.getUTCMinutes();\n    if (minutes < 10) {\n        minutes = `0${minutes}`;\n    }\n    let seconds = now.getUTCSeconds();\n    if (seconds < 10) {\n        seconds = `0${seconds}`;\n    }\n    const year = now.getUTCFullYear();\n    // ddd MMM D HH:mm:ss UTC YYYY\n    const dateNow = `${weekDay} ${month} ${day} ${hours}:${minutes}:${seconds} UTC ${year}`;\n    return dateNow;\n};\n\nexport { getNowString };\n","import { deDupeAsyncFunction, assertTokenProviderConfig, decodeJWT } from '@aws-amplify/core/internals/utils';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { assertAuthTokensWithRefreshToken } from './types.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { createInitiateAuthClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../types/errors.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getUserContextData } from './userContextData.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst refreshAuthTokensFunction = async ({ tokens, authConfig, username, }) => {\n    assertTokenProviderConfig(authConfig?.Cognito);\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig.Cognito;\n    const region = getRegionFromUserPoolId(userPoolId);\n    assertAuthTokensWithRefreshToken(tokens);\n    const refreshTokenString = tokens.refreshToken;\n    const AuthParameters = {\n        REFRESH_TOKEN: refreshTokenString,\n    };\n    if (tokens.deviceMetadata?.deviceKey) {\n        AuthParameters.DEVICE_KEY = tokens.deviceMetadata.deviceKey;\n    }\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const initiateAuth = createInitiateAuthClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const { AuthenticationResult } = await initiateAuth({ region }, {\n        ClientId: userPoolClientId,\n        AuthFlow: 'REFRESH_TOKEN_AUTH',\n        AuthParameters,\n        UserContextData,\n    });\n    const accessToken = decodeJWT(AuthenticationResult?.AccessToken ?? '');\n    const idToken = AuthenticationResult?.IdToken\n        ? decodeJWT(AuthenticationResult.IdToken)\n        : undefined;\n    const { iat } = accessToken.payload;\n    // This should never happen. If it does, it's a bug from the service.\n    if (!iat) {\n        throw new AuthError({\n            name: 'iatNotFoundException',\n            message: 'iat not found in access token',\n        });\n    }\n    const clockDrift = iat * 1000 - new Date().getTime();\n    return {\n        accessToken,\n        idToken,\n        clockDrift,\n        refreshToken: refreshTokenString,\n        username,\n    };\n};\nconst refreshAuthTokens = deDupeAsyncFunction(refreshAuthTokensFunction);\nconst refreshAuthTokensWithoutDedupe = refreshAuthTokensFunction;\n\nexport { refreshAuthTokens, refreshAuthTokensWithoutDedupe };\n","import { Hub } from '@aws-amplify/core';\nimport { isBrowser, assertTokenProviderConfig, isTokenExpired, AMPLIFY_SYMBOL, AmplifyErrorCode } from '@aws-amplify/core/internals/utils';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { oAuthStore } from '../utils/oauth/oAuthStore.mjs';\nimport { addInflightPromise } from '../utils/oauth/inflightPromise.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass TokenOrchestrator {\n    constructor() {\n        this.waitForInflightOAuth = isBrowser()\n            ? async () => {\n                if (!(await oAuthStore.loadOAuthInFlight())) {\n                    return;\n                }\n                if (this.inflightPromise) {\n                    return this.inflightPromise;\n                }\n                // when there is valid oauth config and there is an inflight oauth flow, try\n                // to block async calls that require fetching tokens before the oauth flow completes\n                // e.g. getCurrentUser, fetchAuthSession etc.\n                this.inflightPromise = new Promise((resolve, _reject) => {\n                    addInflightPromise(resolve);\n                });\n                return this.inflightPromise;\n            }\n            : async () => {\n                // no-op for non-browser environments\n            };\n    }\n    setAuthConfig(authConfig) {\n        oAuthStore.setAuthConfig(authConfig.Cognito);\n        this.authConfig = authConfig;\n    }\n    setTokenRefresher(tokenRefresher) {\n        this.tokenRefresher = tokenRefresher;\n    }\n    setAuthTokenStore(tokenStore) {\n        this.tokenStore = tokenStore;\n    }\n    getTokenStore() {\n        if (!this.tokenStore) {\n            throw new AuthError({\n                name: 'EmptyTokenStoreException',\n                message: 'TokenStore not set',\n            });\n        }\n        return this.tokenStore;\n    }\n    getTokenRefresher() {\n        if (!this.tokenRefresher) {\n            throw new AuthError({\n                name: 'EmptyTokenRefresherException',\n                message: 'TokenRefresher not set',\n            });\n        }\n        return this.tokenRefresher;\n    }\n    async getTokens(options) {\n        let tokens;\n        try {\n            assertTokenProviderConfig(this.authConfig?.Cognito);\n        }\n        catch (_err) {\n            // Token provider not configured\n            return null;\n        }\n        await this.waitForInflightOAuth();\n        this.inflightPromise = undefined;\n        tokens = await this.getTokenStore().loadTokens();\n        const username = await this.getTokenStore().getLastAuthUser();\n        if (tokens === null) {\n            return null;\n        }\n        const idTokenExpired = !!tokens?.idToken &&\n            isTokenExpired({\n                expiresAt: (tokens.idToken?.payload?.exp ?? 0) * 1000,\n                clockDrift: tokens.clockDrift ?? 0,\n            });\n        const accessTokenExpired = isTokenExpired({\n            expiresAt: (tokens.accessToken?.payload?.exp ?? 0) * 1000,\n            clockDrift: tokens.clockDrift ?? 0,\n        });\n        if (options?.forceRefresh || idTokenExpired || accessTokenExpired) {\n            tokens = await this.refreshTokens({\n                tokens,\n                username,\n            });\n            if (tokens === null) {\n                return null;\n            }\n        }\n        return {\n            accessToken: tokens?.accessToken,\n            idToken: tokens?.idToken,\n            signInDetails: tokens?.signInDetails,\n        };\n    }\n    async refreshTokens({ tokens, username, }) {\n        try {\n            const { signInDetails } = tokens;\n            const newTokens = await this.getTokenRefresher()({\n                tokens,\n                authConfig: this.authConfig,\n                username,\n            });\n            newTokens.signInDetails = signInDetails;\n            await this.setTokens({ tokens: newTokens });\n            Hub.dispatch('auth', { event: 'tokenRefresh' }, 'Auth', AMPLIFY_SYMBOL);\n            return newTokens;\n        }\n        catch (err) {\n            return this.handleErrors(err);\n        }\n    }\n    handleErrors(err) {\n        assertServiceError(err);\n        if (err.name !== AmplifyErrorCode.NetworkError) {\n            // TODO(v6): Check errors on client\n            this.clearTokens();\n        }\n        Hub.dispatch('auth', {\n            event: 'tokenRefresh_failure',\n            data: { error: err },\n        }, 'Auth', AMPLIFY_SYMBOL);\n        if (err.name.startsWith('NotAuthorizedException')) {\n            return null;\n        }\n        throw err;\n    }\n    async setTokens({ tokens }) {\n        return this.getTokenStore().storeTokens(tokens);\n    }\n    async clearTokens() {\n        return this.getTokenStore().clearTokens();\n    }\n    getDeviceMetadata(username) {\n        return this.getTokenStore().getDeviceMetadata(username);\n    }\n    clearDeviceMetadata(username) {\n        return this.getTokenStore().clearDeviceMetadata(username);\n    }\n    setOAuthMetadata(metadata) {\n        return this.getTokenStore().setOAuthMetadata(metadata);\n    }\n    getOAuthMetadata() {\n        return this.getTokenStore().getOAuthMetadata();\n    }\n}\n\nexport { TokenOrchestrator };\n","import { defaultStorage } from '@aws-amplify/core';\nimport { refreshAuthTokens } from '../utils/refreshAuthTokens.mjs';\nimport { DefaultTokenStore } from './TokenStore.mjs';\nimport { TokenOrchestrator } from './TokenOrchestrator.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass CognitoUserPoolsTokenProvider {\n    constructor() {\n        this.authTokenStore = new DefaultTokenStore();\n        this.authTokenStore.setKeyValueStorage(defaultStorage);\n        this.tokenOrchestrator = new TokenOrchestrator();\n        this.tokenOrchestrator.setAuthTokenStore(this.authTokenStore);\n        this.tokenOrchestrator.setTokenRefresher(refreshAuthTokens);\n    }\n    getTokens({ forceRefresh } = { forceRefresh: false }) {\n        return this.tokenOrchestrator.getTokens({ forceRefresh });\n    }\n    setKeyValueStorage(keyValueStorage) {\n        this.authTokenStore.setKeyValueStorage(keyValueStorage);\n    }\n    setAuthConfig(authConfig) {\n        this.authTokenStore.setAuthConfig(authConfig);\n        this.tokenOrchestrator.setAuthConfig(authConfig);\n    }\n}\n\nexport { CognitoUserPoolsTokenProvider };\n","import { CognitoUserPoolsTokenProvider } from './CognitoUserPoolsTokenProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * The default provider for the JWT access token and ID token issued from the configured Cognito user pool. It manages\n * the refresh and storage of the tokens. It stores the tokens in `window.localStorage` if available, and falls back to\n * in-memory storage if not.\n */\nconst cognitoUserPoolsTokenProvider = new CognitoUserPoolsTokenProvider();\nconst { tokenOrchestrator } = cognitoUserPoolsTokenProvider;\n\nexport { cognitoUserPoolsTokenProvider, tokenOrchestrator };\n","import { getAmplifyUserAgent, Category } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getAuthUserAgentValue = (action, customUserAgentDetails) => getAmplifyUserAgent({\n    category: Category.Auth,\n    action,\n    ...customUserAgentDetails,\n});\n\nexport { getAuthUserAgentValue };\n","import { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { getAuthStorageKeys } from '../tokenProvider/TokenStore.mjs';\nimport { OAuthStorageKeys } from './types.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst V5_HOSTED_UI_KEY = 'amplify-signin-with-hostedUI';\nconst name = 'CognitoIdentityServiceProvider';\nclass DefaultOAuthStore {\n    constructor(keyValueStorage) {\n        this.keyValueStorage = keyValueStorage;\n    }\n    async clearOAuthInflightData() {\n        assertTokenProviderConfig(this.cognitoConfig);\n        const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n        await Promise.all([\n            this.keyValueStorage.removeItem(authKeys.inflightOAuth),\n            this.keyValueStorage.removeItem(authKeys.oauthPKCE),\n            this.keyValueStorage.removeItem(authKeys.oauthState),\n        ]);\n    }\n    async clearOAuthData() {\n        assertTokenProviderConfig(this.cognitoConfig);\n        const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n        await this.clearOAuthInflightData();\n        await this.keyValueStorage.removeItem(V5_HOSTED_UI_KEY); // remove in case a customer migrated an App from v5 to v6\n        return this.keyValueStorage.removeItem(authKeys.oauthSignIn);\n    }\n    loadOAuthState() {\n        assertTokenProviderConfig(this.cognitoConfig);\n        const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n        return this.keyValueStorage.getItem(authKeys.oauthState);\n    }\n    storeOAuthState(state) {\n        assertTokenProviderConfig(this.cognitoConfig);\n        const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n        return this.keyValueStorage.setItem(authKeys.oauthState, state);\n    }\n    loadPKCE() {\n        assertTokenProviderConfig(this.cognitoConfig);\n        const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n        return this.keyValueStorage.getItem(authKeys.oauthPKCE);\n    }\n    storePKCE(pkce) {\n        assertTokenProviderConfig(this.cognitoConfig);\n        const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n        return this.keyValueStorage.setItem(authKeys.oauthPKCE, pkce);\n    }\n    setAuthConfig(authConfigParam) {\n        this.cognitoConfig = authConfigParam;\n    }\n    async loadOAuthInFlight() {\n        assertTokenProviderConfig(this.cognitoConfig);\n        const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n        return ((await this.keyValueStorage.getItem(authKeys.inflightOAuth)) === 'true');\n    }\n    async storeOAuthInFlight(inflight) {\n        assertTokenProviderConfig(this.cognitoConfig);\n        const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n        await this.keyValueStorage.setItem(authKeys.inflightOAuth, `${inflight}`);\n    }\n    async loadOAuthSignIn() {\n        assertTokenProviderConfig(this.cognitoConfig);\n        const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n        const isLegacyHostedUISignIn = await this.keyValueStorage.getItem(V5_HOSTED_UI_KEY);\n        const [isOAuthSignIn, preferPrivateSession] = (await this.keyValueStorage.getItem(authKeys.oauthSignIn))?.split(',') ??\n            [];\n        return {\n            isOAuthSignIn: isOAuthSignIn === 'true' || isLegacyHostedUISignIn === 'true',\n            preferPrivateSession: preferPrivateSession === 'true',\n        };\n    }\n    async storeOAuthSignIn(oauthSignIn, preferPrivateSession = false) {\n        assertTokenProviderConfig(this.cognitoConfig);\n        const authKeys = createKeysForAuthStorage(name, this.cognitoConfig.userPoolClientId);\n        await this.keyValueStorage.setItem(authKeys.oauthSignIn, `${oauthSignIn},${preferPrivateSession}`);\n    }\n}\nconst createKeysForAuthStorage = (provider, identifier) => {\n    return getAuthStorageKeys(OAuthStorageKeys)(provider, identifier);\n};\n\nexport { DefaultOAuthStore };\n","import { AuthError } from '../../../errors/AuthError.mjs';\nimport { TOKEN_REFRESH_EXCEPTION, USER_UNAUTHENTICATED_EXCEPTION, DEVICE_METADATA_NOT_FOUND_EXCEPTION } from '../../../errors/constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction isTypeUserPoolConfig(authConfig) {\n    if (authConfig &&\n        authConfig.Cognito.userPoolId &&\n        authConfig.Cognito.userPoolClientId) {\n        return true;\n    }\n    return false;\n}\nfunction assertAuthTokens(tokens) {\n    if (!tokens || !tokens.accessToken) {\n        throw new AuthError({\n            name: USER_UNAUTHENTICATED_EXCEPTION,\n            message: 'User needs to be authenticated to call this API.',\n            recoverySuggestion: 'Sign in before calling this API again.',\n        });\n    }\n}\nfunction assertIdTokenInAuthTokens(tokens) {\n    if (!tokens || !tokens.idToken) {\n        throw new AuthError({\n            name: USER_UNAUTHENTICATED_EXCEPTION,\n            message: 'User needs to be authenticated to call this API.',\n            recoverySuggestion: 'Sign in before calling this API again.',\n        });\n    }\n}\nconst oAuthTokenRefreshException = new AuthError({\n    name: TOKEN_REFRESH_EXCEPTION,\n    message: `Token refresh is not supported when authenticated with the 'implicit grant' (token) oauth flow. \n\tPlease change your oauth configuration to use 'code grant' flow.`,\n    recoverySuggestion: `Please logout and change your Amplify configuration to use \"code grant\" flow. \n\tE.g { responseType: 'code' }`,\n});\nconst tokenRefreshException = new AuthError({\n    name: USER_UNAUTHENTICATED_EXCEPTION,\n    message: 'User needs to be authenticated to call this API.',\n    recoverySuggestion: 'Sign in before calling this API again.',\n});\nfunction assertAuthTokensWithRefreshToken(tokens) {\n    if (isAuthenticatedWithImplicitOauthFlow(tokens)) {\n        throw oAuthTokenRefreshException;\n    }\n    if (!isAuthenticatedWithRefreshToken(tokens)) {\n        throw tokenRefreshException;\n    }\n}\nfunction assertDeviceMetadata(deviceMetadata) {\n    if (!deviceMetadata ||\n        !deviceMetadata.deviceKey ||\n        !deviceMetadata.deviceGroupKey ||\n        !deviceMetadata.randomPassword) {\n        throw new AuthError({\n            name: DEVICE_METADATA_NOT_FOUND_EXCEPTION,\n            message: 'Either deviceKey, deviceGroupKey or secretPassword were not found during the sign-in process.',\n            recoverySuggestion: 'Make sure to not clear storage after calling the signIn API.',\n        });\n    }\n}\nconst OAuthStorageKeys = {\n    inflightOAuth: 'inflightOAuth',\n    oauthSignIn: 'oauthSignIn',\n    oauthPKCE: 'oauthPKCE',\n    oauthState: 'oauthState',\n};\nfunction isAuthenticated(tokens) {\n    return tokens?.accessToken || tokens?.idToken;\n}\nfunction isAuthenticatedWithRefreshToken(tokens) {\n    return isAuthenticated(tokens) && tokens?.refreshToken;\n}\nfunction isAuthenticatedWithImplicitOauthFlow(tokens) {\n    return isAuthenticated(tokens) && !tokens?.refreshToken;\n}\n\nexport { OAuthStorageKeys, assertAuthTokens, assertAuthTokensWithRefreshToken, assertDeviceMetadata, assertIdTokenInAuthTokens, isTypeUserPoolConfig, oAuthTokenRefreshException, tokenRefreshException };\n","import { Sha256 } from '@aws-crypto/sha256-js';\nimport { base64Encoder, base64Decoder } from '@aws-amplify/core/internals/utils';\nimport { textEncoder } from '../textEncoder/index.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getSignatureString = ({ userPoolName, username, challengeParameters, dateNow, hkdf, }) => {\n    const bufUPIDaToB = textEncoder.convert(userPoolName);\n    const bufUNaToB = textEncoder.convert(username);\n    const bufSBaToB = urlB64ToUint8Array(challengeParameters.SECRET_BLOCK);\n    const bufDNaToB = textEncoder.convert(dateNow);\n    const bufConcat = new Uint8Array(bufUPIDaToB.byteLength +\n        bufUNaToB.byteLength +\n        bufSBaToB.byteLength +\n        bufDNaToB.byteLength);\n    bufConcat.set(bufUPIDaToB, 0);\n    bufConcat.set(bufUNaToB, bufUPIDaToB.byteLength);\n    bufConcat.set(bufSBaToB, bufUPIDaToB.byteLength + bufUNaToB.byteLength);\n    bufConcat.set(bufDNaToB, bufUPIDaToB.byteLength + bufUNaToB.byteLength + bufSBaToB.byteLength);\n    const awsCryptoHash = new Sha256(hkdf);\n    awsCryptoHash.update(bufConcat);\n    const resultFromAWSCrypto = awsCryptoHash.digestSync();\n    const signatureString = base64Encoder.convert(resultFromAWSCrypto);\n    return signatureString;\n};\nconst urlB64ToUint8Array = (base64String) => {\n    const padding = '='.repeat((4 - (base64String.length % 4)) % 4);\n    const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/');\n    const rawData = base64Decoder.convert(base64);\n    const outputArray = new Uint8Array(rawData.length);\n    for (let i = 0; i < rawData.length; ++i) {\n        outputArray[i] = rawData.charCodeAt(i);\n    }\n    return outputArray;\n};\n\nexport { getSignatureString };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst openAuthSession = async (url) => {\n    if (!window?.location) {\n        return;\n    }\n    // enforce HTTPS\n    window.location.href = url.replace('http://', 'https://');\n};\n\nexport { openAuthSession };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar AuthValidationErrorCode;\n(function (AuthValidationErrorCode) {\n    AuthValidationErrorCode[\"EmptySignInUsername\"] = \"EmptySignInUsername\";\n    AuthValidationErrorCode[\"EmptySignInPassword\"] = \"EmptySignInPassword\";\n    AuthValidationErrorCode[\"CustomAuthSignInPassword\"] = \"CustomAuthSignInPassword\";\n    AuthValidationErrorCode[\"EmptySignUpUsername\"] = \"EmptySignUpUsername\";\n    AuthValidationErrorCode[\"EmptySignUpPassword\"] = \"EmptySignUpPassword\";\n    AuthValidationErrorCode[\"EmptyConfirmSignUpUsername\"] = \"EmptyConfirmSignUpUsername\";\n    AuthValidationErrorCode[\"EmptyConfirmSignUpCode\"] = \"EmptyConfirmSignUpCode\";\n    AuthValidationErrorCode[\"EmptyResendSignUpCodeUsername\"] = \"EmptyresendSignUpCodeUsername\";\n    AuthValidationErrorCode[\"EmptyChallengeResponse\"] = \"EmptyChallengeResponse\";\n    AuthValidationErrorCode[\"EmptyConfirmResetPasswordUsername\"] = \"EmptyConfirmResetPasswordUsername\";\n    AuthValidationErrorCode[\"EmptyConfirmResetPasswordNewPassword\"] = \"EmptyConfirmResetPasswordNewPassword\";\n    AuthValidationErrorCode[\"EmptyConfirmResetPasswordConfirmationCode\"] = \"EmptyConfirmResetPasswordConfirmationCode\";\n    AuthValidationErrorCode[\"EmptyResetPasswordUsername\"] = \"EmptyResetPasswordUsername\";\n    AuthValidationErrorCode[\"EmptyVerifyTOTPSetupCode\"] = \"EmptyVerifyTOTPSetupCode\";\n    AuthValidationErrorCode[\"EmptyConfirmUserAttributeCode\"] = \"EmptyConfirmUserAttributeCode\";\n    AuthValidationErrorCode[\"IncorrectMFAMethod\"] = \"IncorrectMFAMethod\";\n    AuthValidationErrorCode[\"EmptyUpdatePassword\"] = \"EmptyUpdatePassword\";\n})(AuthValidationErrorCode || (AuthValidationErrorCode = {}));\n\nexport { AuthValidationErrorCode };\n","import { AuthError } from '../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction getRegionFromUserPoolId(userPoolId) {\n    const region = userPoolId?.split('_')[0];\n    if (!userPoolId ||\n        userPoolId.indexOf('_') < 0 ||\n        !region ||\n        typeof region !== 'string')\n        throw new AuthError({\n            name: 'InvalidUserPoolId',\n            message: 'Invalid user pool id provided.',\n        });\n    return region;\n}\nfunction getRegionFromIdentityPoolId(identityPoolId) {\n    if (!identityPoolId || !identityPoolId.includes(':')) {\n        throw new AuthError({\n            name: 'InvalidIdentityPoolIdException',\n            message: 'Invalid identity pool id provided.',\n            recoverySuggestion: 'Make sure a valid identityPoolId is given in the config.',\n        });\n    }\n    return identityPoolId.split(':')[0];\n}\n\nexport { getRegionFromIdentityPoolId, getRegionFromUserPoolId };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction getUserContextData({ username, userPoolId, userPoolClientId, }) {\n    if (typeof window === 'undefined') {\n        return undefined;\n    }\n    const amazonCognitoAdvancedSecurityData = window\n        .AmazonCognitoAdvancedSecurityData;\n    if (typeof amazonCognitoAdvancedSecurityData === 'undefined') {\n        return undefined;\n    }\n    const advancedSecurityData = amazonCognitoAdvancedSecurityData.getData(username, userPoolId, userPoolClientId);\n    if (advancedSecurityData) {\n        const userContextData = {\n            EncodedData: advancedSecurityData,\n        };\n        return userContextData;\n    }\n    return {};\n}\n\nexport { getUserContextData };\n","import { syncSessionStorage } from '@aws-amplify/core';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// Minutes until stored session invalidates is defaulted to 3 minutes\n// to maintain parity with Amazon Cognito user pools API behavior\nconst MS_TO_EXPIRY = 3 * 60 * 1000;\nconst TGT_STATE = 'CognitoSignInState';\nconst SIGN_IN_STATE_KEYS = {\n    username: `${TGT_STATE}.username`,\n    challengeName: `${TGT_STATE}.challengeName`,\n    signInSession: `${TGT_STATE}.signInSession`,\n    expiry: `${TGT_STATE}.expiry`,\n};\nconst signInReducer = (state, action) => {\n    switch (action.type) {\n        case 'SET_SIGN_IN_SESSION':\n            persistSignInState({ signInSession: action.value });\n            return {\n                ...state,\n                signInSession: action.value,\n            };\n        case 'SET_SIGN_IN_STATE':\n            persistSignInState(action.value);\n            return {\n                ...action.value,\n            };\n        case 'SET_CHALLENGE_NAME':\n            persistSignInState({ challengeName: action.value });\n            return {\n                ...state,\n                challengeName: action.value,\n            };\n        case 'SET_USERNAME':\n            persistSignInState({ username: action.value });\n            return {\n                ...state,\n                username: action.value,\n            };\n        case 'SET_INITIAL_STATE':\n            return getInitialState();\n        case 'RESET_STATE':\n            clearPersistedSignInState();\n            return getDefaultState();\n        // this state is never reachable\n        default:\n            return state;\n    }\n};\nconst isExpired = (expiryDate) => {\n    const expiryTimestamp = Number(expiryDate);\n    const currentTimestamp = Date.now();\n    return expiryTimestamp <= currentTimestamp;\n};\nconst resetActiveSignInState = () => {\n    signInStore.dispatch({ type: 'RESET_STATE' });\n};\nconst clearPersistedSignInState = () => {\n    for (const stateKey of Object.values(SIGN_IN_STATE_KEYS)) {\n        syncSessionStorage.removeItem(stateKey);\n    }\n};\nconst getDefaultState = () => ({\n    username: undefined,\n    challengeName: undefined,\n    signInSession: undefined,\n});\n// Hydrate signInStore from syncSessionStorage if the session has not expired\nconst getInitialState = () => {\n    const expiry = syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.expiry);\n    if (!expiry || isExpired(expiry)) {\n        clearPersistedSignInState();\n        return getDefaultState();\n    }\n    const username = syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.username) ?? undefined;\n    const challengeName = (syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.challengeName) ?? undefined);\n    const signInSession = syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.signInSession) ?? undefined;\n    return {\n        username,\n        challengeName,\n        signInSession,\n    };\n};\nconst createStore = reducer => {\n    let currentState = reducer(getDefaultState(), { type: 'SET_INITIAL_STATE' });\n    return {\n        getState: () => currentState,\n        dispatch: action => {\n            currentState = reducer(currentState, action);\n        },\n    };\n};\nconst signInStore = createStore(signInReducer);\nfunction setActiveSignInState(state) {\n    signInStore.dispatch({\n        type: 'SET_SIGN_IN_STATE',\n        value: state,\n    });\n}\n// Save local state into Session Storage\nconst persistSignInState = ({ challengeName, signInSession, username, }) => {\n    username && syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.username, username);\n    challengeName &&\n        syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.challengeName, challengeName);\n    if (signInSession) {\n        syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.signInSession, signInSession);\n        // Updates expiry when session is passed\n        syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.expiry, String(Date.now() + MS_TO_EXPIRY));\n    }\n};\n\nexport { persistSignInState, resetActiveSignInState, setActiveSignInState, signInStore };\n","import { AuthError } from '../../../errors/AuthError.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../types/errors.mjs';\nimport { createRespondToAuthChallengeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport BigInteger from './srp/BigInteger/BigInteger.mjs';\nimport './srp/constants.mjs';\nimport '@aws-crypto/sha256-js';\nimport { getNowString } from './srp/getNowString.mjs';\nimport { getSignatureString } from './srp/getSignatureString.mjs';\nimport { getUserContextData } from './userContextData.mjs';\nimport { handleDeviceSRPAuth } from './handleDeviceSRPAuth.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nasync function handlePasswordVerifierChallenge(password, challengeParameters, clientMetadata, session, authenticationHelper, config, tokenOrchestrator) {\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    const userPoolName = userPoolId?.split('_')[1] || '';\n    const serverBValue = new BigInteger(challengeParameters?.SRP_B, 16);\n    const salt = new BigInteger(challengeParameters?.SALT, 16);\n    const username = challengeParameters?.USER_ID_FOR_SRP;\n    if (!username)\n        throw new AuthError({\n            name: 'EmptyUserIdForSRPException',\n            message: 'USER_ID_FOR_SRP was not found in challengeParameters',\n        });\n    const hkdf = await authenticationHelper.getPasswordAuthenticationKey({\n        username,\n        password,\n        serverBValue,\n        salt,\n    });\n    const dateNow = getNowString();\n    const challengeResponses = {\n        USERNAME: username,\n        PASSWORD_CLAIM_SECRET_BLOCK: challengeParameters?.SECRET_BLOCK,\n        TIMESTAMP: dateNow,\n        PASSWORD_CLAIM_SIGNATURE: getSignatureString({\n            username,\n            userPoolName,\n            challengeParameters,\n            dateNow,\n            hkdf,\n        }),\n    };\n    const deviceMetadata = await tokenOrchestrator.getDeviceMetadata(username);\n    if (deviceMetadata && deviceMetadata.deviceKey) {\n        challengeResponses.DEVICE_KEY = deviceMetadata.deviceKey;\n    }\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const jsonReqResponseChallenge = {\n        ChallengeName: 'PASSWORD_VERIFIER',\n        ChallengeResponses: challengeResponses,\n        ClientMetadata: clientMetadata,\n        Session: session,\n        ClientId: userPoolClientId,\n        UserContextData,\n    };\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const response = await respondToAuthChallenge({ region: getRegionFromUserPoolId(userPoolId) }, jsonReqResponseChallenge);\n    if (response.ChallengeName === 'DEVICE_SRP_AUTH')\n        return handleDeviceSRPAuth({\n            username,\n            config,\n            clientMetadata,\n            session: response.Session,\n            tokenOrchestrator,\n        });\n    return response;\n}\n\nexport { handlePasswordVerifierChallenge };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar AssociateSoftwareTokenException;\n(function (AssociateSoftwareTokenException) {\n    AssociateSoftwareTokenException[\"ConcurrentModificationException\"] = \"ConcurrentModificationException\";\n    AssociateSoftwareTokenException[\"ForbiddenException\"] = \"ForbiddenException\";\n    AssociateSoftwareTokenException[\"InternalErrorException\"] = \"InternalErrorException\";\n    AssociateSoftwareTokenException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    AssociateSoftwareTokenException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    AssociateSoftwareTokenException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    AssociateSoftwareTokenException[\"SoftwareTokenMFANotFoundException\"] = \"SoftwareTokenMFANotFoundException\";\n})(AssociateSoftwareTokenException || (AssociateSoftwareTokenException = {}));\nvar ChangePasswordException;\n(function (ChangePasswordException) {\n    ChangePasswordException[\"ForbiddenException\"] = \"ForbiddenException\";\n    ChangePasswordException[\"InternalErrorException\"] = \"InternalErrorException\";\n    ChangePasswordException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    ChangePasswordException[\"InvalidPasswordException\"] = \"InvalidPasswordException\";\n    ChangePasswordException[\"LimitExceededException\"] = \"LimitExceededException\";\n    ChangePasswordException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    ChangePasswordException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    ChangePasswordException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    ChangePasswordException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    ChangePasswordException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    ChangePasswordException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ChangePasswordException || (ChangePasswordException = {}));\nvar ConfirmDeviceException;\n(function (ConfirmDeviceException) {\n    ConfirmDeviceException[\"ForbiddenException\"] = \"ForbiddenException\";\n    ConfirmDeviceException[\"InternalErrorException\"] = \"InternalErrorException\";\n    ConfirmDeviceException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n    ConfirmDeviceException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    ConfirmDeviceException[\"InvalidPasswordException\"] = \"InvalidPasswordException\";\n    ConfirmDeviceException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n    ConfirmDeviceException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    ConfirmDeviceException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    ConfirmDeviceException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    ConfirmDeviceException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    ConfirmDeviceException[\"UsernameExistsException\"] = \"UsernameExistsException\";\n    ConfirmDeviceException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    ConfirmDeviceException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ConfirmDeviceException || (ConfirmDeviceException = {}));\nvar ConfirmForgotPasswordException;\n(function (ConfirmForgotPasswordException) {\n    ConfirmForgotPasswordException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n    ConfirmForgotPasswordException[\"ExpiredCodeException\"] = \"ExpiredCodeException\";\n    ConfirmForgotPasswordException[\"ForbiddenException\"] = \"ForbiddenException\";\n    ConfirmForgotPasswordException[\"InternalErrorException\"] = \"InternalErrorException\";\n    ConfirmForgotPasswordException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n    ConfirmForgotPasswordException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    ConfirmForgotPasswordException[\"InvalidPasswordException\"] = \"InvalidPasswordException\";\n    ConfirmForgotPasswordException[\"LimitExceededException\"] = \"LimitExceededException\";\n    ConfirmForgotPasswordException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    ConfirmForgotPasswordException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    ConfirmForgotPasswordException[\"TooManyFailedAttemptsException\"] = \"TooManyFailedAttemptsException\";\n    ConfirmForgotPasswordException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    ConfirmForgotPasswordException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n    ConfirmForgotPasswordException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n    ConfirmForgotPasswordException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    ConfirmForgotPasswordException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ConfirmForgotPasswordException || (ConfirmForgotPasswordException = {}));\nvar ConfirmSignUpException;\n(function (ConfirmSignUpException) {\n    ConfirmSignUpException[\"AliasExistsException\"] = \"AliasExistsException\";\n    ConfirmSignUpException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n    ConfirmSignUpException[\"ExpiredCodeException\"] = \"ExpiredCodeException\";\n    ConfirmSignUpException[\"ForbiddenException\"] = \"ForbiddenException\";\n    ConfirmSignUpException[\"InternalErrorException\"] = \"InternalErrorException\";\n    ConfirmSignUpException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n    ConfirmSignUpException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    ConfirmSignUpException[\"LimitExceededException\"] = \"LimitExceededException\";\n    ConfirmSignUpException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    ConfirmSignUpException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    ConfirmSignUpException[\"TooManyFailedAttemptsException\"] = \"TooManyFailedAttemptsException\";\n    ConfirmSignUpException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    ConfirmSignUpException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n    ConfirmSignUpException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n    ConfirmSignUpException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ConfirmSignUpException || (ConfirmSignUpException = {}));\nvar DeleteUserAttributesException;\n(function (DeleteUserAttributesException) {\n    DeleteUserAttributesException[\"ForbiddenException\"] = \"ForbiddenException\";\n    DeleteUserAttributesException[\"InternalErrorException\"] = \"InternalErrorException\";\n    DeleteUserAttributesException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    DeleteUserAttributesException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    DeleteUserAttributesException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    DeleteUserAttributesException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    DeleteUserAttributesException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    DeleteUserAttributesException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    DeleteUserAttributesException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(DeleteUserAttributesException || (DeleteUserAttributesException = {}));\nvar DeleteUserException;\n(function (DeleteUserException) {\n    DeleteUserException[\"ForbiddenException\"] = \"ForbiddenException\";\n    DeleteUserException[\"InternalErrorException\"] = \"InternalErrorException\";\n    DeleteUserException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    DeleteUserException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    DeleteUserException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    DeleteUserException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    DeleteUserException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    DeleteUserException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    DeleteUserException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(DeleteUserException || (DeleteUserException = {}));\nvar ForgetDeviceException;\n(function (ForgetDeviceException) {\n    ForgetDeviceException[\"ForbiddenException\"] = \"ForbiddenException\";\n    ForgetDeviceException[\"InternalErrorException\"] = \"InternalErrorException\";\n    ForgetDeviceException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    ForgetDeviceException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n    ForgetDeviceException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    ForgetDeviceException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    ForgetDeviceException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    ForgetDeviceException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    ForgetDeviceException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    ForgetDeviceException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ForgetDeviceException || (ForgetDeviceException = {}));\nvar ForgotPasswordException;\n(function (ForgotPasswordException) {\n    ForgotPasswordException[\"CodeDeliveryFailureException\"] = \"CodeDeliveryFailureException\";\n    ForgotPasswordException[\"ForbiddenException\"] = \"ForbiddenException\";\n    ForgotPasswordException[\"InternalErrorException\"] = \"InternalErrorException\";\n    ForgotPasswordException[\"InvalidEmailRoleAccessPolicyException\"] = \"InvalidEmailRoleAccessPolicyException\";\n    ForgotPasswordException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n    ForgotPasswordException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    ForgotPasswordException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n    ForgotPasswordException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n    ForgotPasswordException[\"LimitExceededException\"] = \"LimitExceededException\";\n    ForgotPasswordException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    ForgotPasswordException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    ForgotPasswordException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    ForgotPasswordException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n    ForgotPasswordException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n    ForgotPasswordException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ForgotPasswordException || (ForgotPasswordException = {}));\nvar GetUserException;\n(function (GetUserException) {\n    GetUserException[\"ForbiddenException\"] = \"ForbiddenException\";\n    GetUserException[\"InternalErrorException\"] = \"InternalErrorException\";\n    GetUserException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    GetUserException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    GetUserException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    GetUserException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    GetUserException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    GetUserException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    GetUserException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(GetUserException || (GetUserException = {}));\nvar GetIdException;\n(function (GetIdException) {\n    GetIdException[\"ExternalServiceException\"] = \"ExternalServiceException\";\n    GetIdException[\"InternalErrorException\"] = \"InternalErrorException\";\n    GetIdException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    GetIdException[\"LimitExceededException\"] = \"LimitExceededException\";\n    GetIdException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    GetIdException[\"ResourceConflictException\"] = \"ResourceConflictException\";\n    GetIdException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    GetIdException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n})(GetIdException || (GetIdException = {}));\nvar GetCredentialsForIdentityException;\n(function (GetCredentialsForIdentityException) {\n    GetCredentialsForIdentityException[\"ExternalServiceException\"] = \"ExternalServiceException\";\n    GetCredentialsForIdentityException[\"InternalErrorException\"] = \"InternalErrorException\";\n    GetCredentialsForIdentityException[\"InvalidIdentityPoolConfigurationException\"] = \"InvalidIdentityPoolConfigurationException\";\n    GetCredentialsForIdentityException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    GetCredentialsForIdentityException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    GetCredentialsForIdentityException[\"ResourceConflictException\"] = \"ResourceConflictException\";\n    GetCredentialsForIdentityException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    GetCredentialsForIdentityException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n})(GetCredentialsForIdentityException || (GetCredentialsForIdentityException = {}));\nvar GetUserAttributeVerificationException;\n(function (GetUserAttributeVerificationException) {\n    GetUserAttributeVerificationException[\"CodeDeliveryFailureException\"] = \"CodeDeliveryFailureException\";\n    GetUserAttributeVerificationException[\"ForbiddenException\"] = \"ForbiddenException\";\n    GetUserAttributeVerificationException[\"InternalErrorException\"] = \"InternalErrorException\";\n    GetUserAttributeVerificationException[\"InvalidEmailRoleAccessPolicyException\"] = \"InvalidEmailRoleAccessPolicyException\";\n    GetUserAttributeVerificationException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n    GetUserAttributeVerificationException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    GetUserAttributeVerificationException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n    GetUserAttributeVerificationException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n    GetUserAttributeVerificationException[\"LimitExceededException\"] = \"LimitExceededException\";\n    GetUserAttributeVerificationException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    GetUserAttributeVerificationException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    GetUserAttributeVerificationException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    GetUserAttributeVerificationException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    GetUserAttributeVerificationException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n    GetUserAttributeVerificationException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n    GetUserAttributeVerificationException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    GetUserAttributeVerificationException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(GetUserAttributeVerificationException || (GetUserAttributeVerificationException = {}));\nvar GlobalSignOutException;\n(function (GlobalSignOutException) {\n    GlobalSignOutException[\"ForbiddenException\"] = \"ForbiddenException\";\n    GlobalSignOutException[\"InternalErrorException\"] = \"InternalErrorException\";\n    GlobalSignOutException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    GlobalSignOutException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    GlobalSignOutException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    GlobalSignOutException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    GlobalSignOutException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    GlobalSignOutException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n})(GlobalSignOutException || (GlobalSignOutException = {}));\nvar InitiateAuthException;\n(function (InitiateAuthException) {\n    InitiateAuthException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    InitiateAuthException[\"ForbiddenException\"] = \"ForbiddenException\";\n    InitiateAuthException[\"InternalErrorException\"] = \"InternalErrorException\";\n    InitiateAuthException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n    InitiateAuthException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    InitiateAuthException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n    InitiateAuthException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n    InitiateAuthException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n    InitiateAuthException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    InitiateAuthException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    InitiateAuthException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    InitiateAuthException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n    InitiateAuthException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n    InitiateAuthException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    InitiateAuthException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(InitiateAuthException || (InitiateAuthException = {}));\nvar ResendConfirmationException;\n(function (ResendConfirmationException) {\n    ResendConfirmationException[\"CodeDeliveryFailureException\"] = \"CodeDeliveryFailureException\";\n    ResendConfirmationException[\"ForbiddenException\"] = \"ForbiddenException\";\n    ResendConfirmationException[\"InternalErrorException\"] = \"InternalErrorException\";\n    ResendConfirmationException[\"InvalidEmailRoleAccessPolicyException\"] = \"InvalidEmailRoleAccessPolicyException\";\n    ResendConfirmationException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n    ResendConfirmationException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    ResendConfirmationException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n    ResendConfirmationException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n    ResendConfirmationException[\"LimitExceededException\"] = \"LimitExceededException\";\n    ResendConfirmationException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    ResendConfirmationException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    ResendConfirmationException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    ResendConfirmationException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n    ResendConfirmationException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n    ResendConfirmationException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ResendConfirmationException || (ResendConfirmationException = {}));\nvar RespondToAuthChallengeException;\n(function (RespondToAuthChallengeException) {\n    RespondToAuthChallengeException[\"AliasExistsException\"] = \"AliasExistsException\";\n    RespondToAuthChallengeException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n    RespondToAuthChallengeException[\"ExpiredCodeException\"] = \"ExpiredCodeException\";\n    RespondToAuthChallengeException[\"ForbiddenException\"] = \"ForbiddenException\";\n    RespondToAuthChallengeException[\"InternalErrorException\"] = \"InternalErrorException\";\n    RespondToAuthChallengeException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n    RespondToAuthChallengeException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    RespondToAuthChallengeException[\"InvalidPasswordException\"] = \"InvalidPasswordException\";\n    RespondToAuthChallengeException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n    RespondToAuthChallengeException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n    RespondToAuthChallengeException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n    RespondToAuthChallengeException[\"MFAMethodNotFoundException\"] = \"MFAMethodNotFoundException\";\n    RespondToAuthChallengeException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    RespondToAuthChallengeException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    RespondToAuthChallengeException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    RespondToAuthChallengeException[\"SoftwareTokenMFANotFoundException\"] = \"SoftwareTokenMFANotFoundException\";\n    RespondToAuthChallengeException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    RespondToAuthChallengeException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n    RespondToAuthChallengeException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n    RespondToAuthChallengeException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    RespondToAuthChallengeException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(RespondToAuthChallengeException || (RespondToAuthChallengeException = {}));\nvar SetUserMFAPreferenceException;\n(function (SetUserMFAPreferenceException) {\n    SetUserMFAPreferenceException[\"ForbiddenException\"] = \"ForbiddenException\";\n    SetUserMFAPreferenceException[\"InternalErrorException\"] = \"InternalErrorException\";\n    SetUserMFAPreferenceException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    SetUserMFAPreferenceException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    SetUserMFAPreferenceException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    SetUserMFAPreferenceException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    SetUserMFAPreferenceException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    SetUserMFAPreferenceException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(SetUserMFAPreferenceException || (SetUserMFAPreferenceException = {}));\nvar SignUpException;\n(function (SignUpException) {\n    SignUpException[\"CodeDeliveryFailureException\"] = \"CodeDeliveryFailureException\";\n    SignUpException[\"InternalErrorException\"] = \"InternalErrorException\";\n    SignUpException[\"InvalidEmailRoleAccessPolicyException\"] = \"InvalidEmailRoleAccessPolicyException\";\n    SignUpException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n    SignUpException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    SignUpException[\"InvalidPasswordException\"] = \"InvalidPasswordException\";\n    SignUpException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n    SignUpException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n    SignUpException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    SignUpException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    SignUpException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    SignUpException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n    SignUpException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n    SignUpException[\"UsernameExistsException\"] = \"UsernameExistsException\";\n})(SignUpException || (SignUpException = {}));\nvar UpdateUserAttributesException;\n(function (UpdateUserAttributesException) {\n    UpdateUserAttributesException[\"AliasExistsException\"] = \"AliasExistsException\";\n    UpdateUserAttributesException[\"CodeDeliveryFailureException\"] = \"CodeDeliveryFailureException\";\n    UpdateUserAttributesException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n    UpdateUserAttributesException[\"ExpiredCodeException\"] = \"ExpiredCodeException\";\n    UpdateUserAttributesException[\"ForbiddenException\"] = \"ForbiddenException\";\n    UpdateUserAttributesException[\"InternalErrorException\"] = \"InternalErrorException\";\n    UpdateUserAttributesException[\"InvalidEmailRoleAccessPolicyException\"] = \"InvalidEmailRoleAccessPolicyException\";\n    UpdateUserAttributesException[\"InvalidLambdaResponseException\"] = \"InvalidLambdaResponseException\";\n    UpdateUserAttributesException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    UpdateUserAttributesException[\"InvalidSmsRoleAccessPolicyException\"] = \"InvalidSmsRoleAccessPolicyException\";\n    UpdateUserAttributesException[\"InvalidSmsRoleTrustRelationshipException\"] = \"InvalidSmsRoleTrustRelationshipException\";\n    UpdateUserAttributesException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    UpdateUserAttributesException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    UpdateUserAttributesException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    UpdateUserAttributesException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    UpdateUserAttributesException[\"UnexpectedLambdaException\"] = \"UnexpectedLambdaException\";\n    UpdateUserAttributesException[\"UserLambdaValidationException\"] = \"UserLambdaValidationException\";\n    UpdateUserAttributesException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    UpdateUserAttributesException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(UpdateUserAttributesException || (UpdateUserAttributesException = {}));\nvar VerifySoftwareTokenException;\n(function (VerifySoftwareTokenException) {\n    VerifySoftwareTokenException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n    VerifySoftwareTokenException[\"EnableSoftwareTokenMFAException\"] = \"EnableSoftwareTokenMFAException\";\n    VerifySoftwareTokenException[\"ForbiddenException\"] = \"ForbiddenException\";\n    VerifySoftwareTokenException[\"InternalErrorException\"] = \"InternalErrorException\";\n    VerifySoftwareTokenException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    VerifySoftwareTokenException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n    VerifySoftwareTokenException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    VerifySoftwareTokenException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    VerifySoftwareTokenException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    VerifySoftwareTokenException[\"SoftwareTokenMFANotFoundException\"] = \"SoftwareTokenMFANotFoundException\";\n    VerifySoftwareTokenException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    VerifySoftwareTokenException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    VerifySoftwareTokenException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(VerifySoftwareTokenException || (VerifySoftwareTokenException = {}));\nvar VerifyUserAttributeException;\n(function (VerifyUserAttributeException) {\n    VerifyUserAttributeException[\"AliasExistsException\"] = \"AliasExistsException\";\n    VerifyUserAttributeException[\"CodeMismatchException\"] = \"CodeMismatchException\";\n    VerifyUserAttributeException[\"ExpiredCodeException\"] = \"ExpiredCodeException\";\n    VerifyUserAttributeException[\"ForbiddenException\"] = \"ForbiddenException\";\n    VerifyUserAttributeException[\"InternalErrorException\"] = \"InternalErrorException\";\n    VerifyUserAttributeException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    VerifyUserAttributeException[\"LimitExceededException\"] = \"LimitExceededException\";\n    VerifyUserAttributeException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    VerifyUserAttributeException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    VerifyUserAttributeException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    VerifyUserAttributeException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    VerifyUserAttributeException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    VerifyUserAttributeException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(VerifyUserAttributeException || (VerifyUserAttributeException = {}));\nvar UpdateDeviceStatusException;\n(function (UpdateDeviceStatusException) {\n    UpdateDeviceStatusException[\"ForbiddenException\"] = \"ForbiddenException\";\n    UpdateDeviceStatusException[\"InternalErrorException\"] = \"InternalErrorException\";\n    UpdateDeviceStatusException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    UpdateDeviceStatusException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n    UpdateDeviceStatusException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    UpdateDeviceStatusException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    UpdateDeviceStatusException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    UpdateDeviceStatusException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    UpdateDeviceStatusException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    UpdateDeviceStatusException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(UpdateDeviceStatusException || (UpdateDeviceStatusException = {}));\nvar ListDevicesException;\n(function (ListDevicesException) {\n    ListDevicesException[\"ForbiddenException\"] = \"ForbiddenException\";\n    ListDevicesException[\"InternalErrorException\"] = \"InternalErrorException\";\n    ListDevicesException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n    ListDevicesException[\"InvalidUserPoolConfigurationException\"] = \"InvalidUserPoolConfigurationException\";\n    ListDevicesException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n    ListDevicesException[\"PasswordResetRequiredException\"] = \"PasswordResetRequiredException\";\n    ListDevicesException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n    ListDevicesException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n    ListDevicesException[\"UserNotConfirmedException\"] = \"UserNotConfirmedException\";\n    ListDevicesException[\"UserNotFoundException\"] = \"UserNotFoundException\";\n})(ListDevicesException || (ListDevicesException = {}));\nconst SETUP_TOTP_EXCEPTION = 'SetUpTOTPException';\n\nexport { AssociateSoftwareTokenException, ChangePasswordException, ConfirmDeviceException, ConfirmForgotPasswordException, ConfirmSignUpException, DeleteUserAttributesException, DeleteUserException, ForgetDeviceException, ForgotPasswordException, GetCredentialsForIdentityException, GetIdException, GetUserAttributeVerificationException, GetUserException, GlobalSignOutException, InitiateAuthException, ListDevicesException, ResendConfirmationException, RespondToAuthChallengeException, SETUP_TOTP_EXCEPTION, SetUserMFAPreferenceException, SignUpException, UpdateDeviceStatusException, UpdateUserAttributesException, VerifySoftwareTokenException, VerifyUserAttributeException };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst textEncoder = {\n    convert(input) {\n        return new TextEncoder().encode(input);\n    },\n};\n\nexport { textEncoder };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createConfirmForgotPasswordClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('ConfirmForgotPassword'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createConfirmForgotPasswordClient };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { getUserContextData } from '../utils/userContextData.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../types/errors.mjs';\nimport { createConfirmForgotPasswordClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmForgotPasswordClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Confirms the new password and verification code to reset the password.\n *\n * @param input -  The ConfirmResetPasswordInput object.\n * @throws -{@link ConfirmForgotPasswordException }\n * Thrown due to an invalid confirmation code or password.\n * @throws -{@link AuthValidationErrorCode }\n * Thrown due to an empty confirmation code, password or username.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmResetPassword(input) {\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const { userPoolClientId, userPoolId, userPoolEndpoint } = authConfig;\n    const { username, newPassword } = input;\n    assertValidationError(!!username, AuthValidationErrorCode.EmptyConfirmResetPasswordUsername);\n    assertValidationError(!!newPassword, AuthValidationErrorCode.EmptyConfirmResetPasswordNewPassword);\n    const code = input.confirmationCode;\n    assertValidationError(!!code, AuthValidationErrorCode.EmptyConfirmResetPasswordConfirmationCode);\n    const metadata = input.options?.clientMetadata;\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const confirmForgotPassword = createConfirmForgotPasswordClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    await confirmForgotPassword({\n        region: getRegionFromUserPoolId(authConfig.userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmResetPassword),\n    }, {\n        Username: username,\n        ConfirmationCode: code,\n        Password: newPassword,\n        ClientMetadata: metadata,\n        ClientId: authConfig.userPoolClientId,\n        UserContextData,\n    });\n}\n\nexport { confirmResetPassword };\n","import { HubInternal } from '@aws-amplify/core/internals/utils';\nimport { signIn } from '../apis/signIn.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { setAutoSignIn, resetAutoSignIn } from '../apis/autoSignIn.mjs';\nimport { AUTO_SIGN_IN_EXCEPTION } from '../../../errors/constants.mjs';\nimport { signInWithUserAuth } from '../apis/signInWithUserAuth.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst MAX_AUTOSIGNIN_POLLING_MS = 3 * 60 * 1000;\nfunction handleCodeAutoSignIn(signInInput) {\n    const stopHubListener = HubInternal.listen('auth-internal', async ({ payload }) => {\n        switch (payload.event) {\n            case 'confirmSignUp': {\n                const response = payload.data;\n                if (response?.isSignUpComplete) {\n                    HubInternal.dispatch('auth-internal', {\n                        event: 'autoSignIn',\n                    });\n                    setAutoSignIn(autoSignInWithCode(signInInput));\n                    stopHubListener();\n                }\n            }\n        }\n    });\n    // This will stop the listener if confirmSignUp is not resolved.\n    const timeOutId = setTimeout(() => {\n        stopHubListener();\n        clearTimeout(timeOutId);\n        resetAutoSignIn();\n    }, MAX_AUTOSIGNIN_POLLING_MS);\n}\nfunction debounce(fun, delay) {\n    let timer;\n    return (args) => {\n        if (!timer) {\n            fun(...args);\n        }\n        clearTimeout(timer);\n        timer = setTimeout(() => {\n            timer = undefined;\n        }, delay);\n    };\n}\nfunction handleAutoSignInWithLink(signInInput, resolve, reject) {\n    const start = Date.now();\n    const autoSignInPollingIntervalId = setInterval(async () => {\n        const elapsedTime = Date.now() - start;\n        const maxTime = MAX_AUTOSIGNIN_POLLING_MS;\n        if (elapsedTime > maxTime) {\n            clearInterval(autoSignInPollingIntervalId);\n            reject(new AuthError({\n                name: AUTO_SIGN_IN_EXCEPTION,\n                message: 'The account was not confirmed on time.',\n                recoverySuggestion: 'Try to verify your account by clicking the link sent your email or phone and then login manually.',\n            }));\n            resetAutoSignIn();\n        }\n        else {\n            try {\n                const signInOutput = await signIn(signInInput);\n                if (signInOutput.nextStep.signInStep !== 'CONFIRM_SIGN_UP') {\n                    resolve(signInOutput);\n                    clearInterval(autoSignInPollingIntervalId);\n                    resetAutoSignIn();\n                }\n            }\n            catch (error) {\n                clearInterval(autoSignInPollingIntervalId);\n                reject(error);\n                resetAutoSignIn();\n            }\n        }\n    }, 5000);\n}\nconst debouncedAutoSignInWithLink = debounce(handleAutoSignInWithLink, 300);\nconst debouncedAutoSignWithCodeOrUserConfirmed = debounce(handleAutoSignInWithCodeOrUserConfirmed, 300);\nfunction autoSignInWhenUserIsConfirmedWithLink(signInInput) {\n    return async () => {\n        return new Promise((resolve, reject) => {\n            debouncedAutoSignInWithLink([signInInput, resolve, reject]);\n        });\n    };\n}\nasync function handleAutoSignInWithCodeOrUserConfirmed(signInInput, resolve, reject) {\n    try {\n        const output = signInInput?.options?.authFlowType === 'USER_AUTH'\n            ? await signInWithUserAuth(signInInput)\n            : await signIn(signInInput);\n        resolve(output);\n        resetAutoSignIn();\n    }\n    catch (error) {\n        reject(error);\n        resetAutoSignIn();\n    }\n}\nfunction autoSignInWithCode(signInInput) {\n    return async () => {\n        return new Promise((resolve, reject) => {\n            debouncedAutoSignWithCodeOrUserConfirmed([signInInput, resolve, reject]);\n        });\n    };\n}\nconst autoSignInUserConfirmed = autoSignInWithCode;\n\nexport { autoSignInUserConfirmed, autoSignInWhenUserIsConfirmedWithLink, handleCodeAutoSignIn };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { parseJsonError, parseJsonBody } from '@aws-amplify/core/internals/aws-client-utils';\nimport { validationErrorMap } from '../../../../common/AuthErrorStrings.mjs';\nimport { AuthError } from '../../../../errors/AuthError.mjs';\nimport { AuthValidationErrorCode } from '../../../../errors/types/validation.mjs';\nimport { assertServiceError } from '../../../../errors/utils/assertServiceError.mjs';\nimport { SignUpException } from '../../../../providers/cognito/types/errors.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createSignUpClientDeserializer = () => async (response) => {\n    if (response.statusCode >= 300) {\n        const error = await parseJsonError(response);\n        assertServiceError(error);\n        if (\n        // Missing Password Error\n        // 1 validation error detected: Value at 'password'failed to satisfy constraint: Member must not be null\n        error.name === SignUpException.InvalidParameterException &&\n            /'password'/.test(error.message) &&\n            /Member must not be null/.test(error.message)) {\n            const name = AuthValidationErrorCode.EmptySignUpPassword;\n            const { message, recoverySuggestion } = validationErrorMap[name];\n            throw new AuthError({\n                name,\n                message,\n                recoverySuggestion,\n            });\n        }\n        throw new AuthError({ name: error.name, message: error.message });\n    }\n    return parseJsonBody(response);\n};\nconst createSignUpClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('SignUp'), createSignUpClientDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createSignUpClient, createSignUpClientDeserializer };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { toAttributeType } from '../utils/apiHelpers.mjs';\nimport { handleCodeAutoSignIn, autoSignInUserConfirmed, autoSignInWhenUserIsConfirmedWithLink } from '../utils/signUpHelpers.mjs';\nimport { getUserContextData } from '../utils/userContextData.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createSignUpClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { autoSignInStore } from '../../../client/utils/store/autoSignInStore.mjs';\nimport '../../../client/utils/store/signInStore.mjs';\nimport { setAutoSignIn } from './autoSignIn.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Creates a user\n *\n * @param input - The SignUpInput object\n * @returns SignUpOutput\n * @throws service: {@link SignUpException } - Cognito service errors thrown during the sign-up process.\n * @throws validation: {@link AuthValidationErrorCode } - Validation errors thrown either username or password\n *  are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signUp(input) {\n    const { username, password, options } = input;\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    const signUpVerificationMethod = authConfig?.signUpVerificationMethod ?? 'code';\n    const { clientMetadata, validationData, autoSignIn } = input.options ?? {};\n    assertTokenProviderConfig(authConfig);\n    assertValidationError(!!username, AuthValidationErrorCode.EmptySignUpUsername);\n    const signInServiceOptions = typeof autoSignIn !== 'boolean' ? autoSignIn : undefined;\n    const signInInput = {\n        username,\n        options: signInServiceOptions,\n    };\n    // if the authFlowType is 'CUSTOM_WITHOUT_SRP' then we don't include the password\n    if (signInServiceOptions?.authFlowType !== 'CUSTOM_WITHOUT_SRP') {\n        signInInput.password = password;\n    }\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig;\n    const signUpClient = createSignUpClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const signUpClientInput = {\n        Username: username,\n        Password: undefined,\n        UserAttributes: options?.userAttributes && toAttributeType(options?.userAttributes),\n        ClientMetadata: clientMetadata,\n        ValidationData: validationData && toAttributeType(validationData),\n        ClientId: userPoolClientId,\n        UserContextData: getUserContextData({\n            username,\n            userPoolId,\n            userPoolClientId,\n        }),\n    };\n    if (password) {\n        signUpClientInput.Password = password;\n    }\n    const { UserSub: userId, CodeDeliveryDetails: cdd, UserConfirmed: userConfirmed, Session: session, } = await signUpClient({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.SignUp),\n    }, signUpClientInput);\n    if (signInServiceOptions || autoSignIn === true) {\n        autoSignInStore.dispatch({ type: 'START' });\n        autoSignInStore.dispatch({ type: 'SET_USERNAME', value: username });\n        autoSignInStore.dispatch({ type: 'SET_SESSION', value: session });\n    }\n    const codeDeliveryDetails = {\n        destination: cdd?.Destination,\n        deliveryMedium: cdd?.DeliveryMedium,\n        attributeName: cdd?.AttributeName,\n    };\n    const isSignUpComplete = !!userConfirmed;\n    const isAutoSignInStarted = autoSignInStore.getState().active;\n    // Sign Up Complete\n    // No Confirm Sign In Step Required\n    if (isSignUpComplete) {\n        if (isAutoSignInStarted) {\n            setAutoSignIn(autoSignInUserConfirmed(signInInput));\n            return {\n                isSignUpComplete: true,\n                nextStep: {\n                    signUpStep: 'COMPLETE_AUTO_SIGN_IN',\n                },\n                userId,\n            };\n        }\n        return {\n            isSignUpComplete: true,\n            nextStep: {\n                signUpStep: 'DONE',\n            },\n            userId,\n        };\n    }\n    // Sign Up Not Complete\n    // Confirm Sign Up Step Required\n    if (isAutoSignInStarted) {\n        // Confirmation Via Link Occurs In Separate Context\n        // AutoSignIn Fn Will Initiate Polling Once Executed\n        if (signUpVerificationMethod === 'link') {\n            setAutoSignIn(autoSignInWhenUserIsConfirmedWithLink(signInInput));\n            return {\n                isSignUpComplete: false,\n                nextStep: {\n                    signUpStep: 'COMPLETE_AUTO_SIGN_IN',\n                    codeDeliveryDetails,\n                },\n                userId,\n            };\n        }\n        // Confirmation Via Code Occurs In Same Context\n        // AutoSignIn Next Step Will Be Returned From Confirm Sign Up\n        handleCodeAutoSignIn(signInInput);\n    }\n    return {\n        isSignUpComplete: false,\n        nextStep: {\n            signUpStep: 'CONFIRM_SIGN_UP',\n            codeDeliveryDetails,\n        },\n        userId,\n    };\n}\n\nexport { signUp };\n","import { validationErrorMap } from '../../common/AuthErrorStrings.mjs';\nimport { AuthError } from '../AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction assertValidationError(assertion, name) {\n    const { message, recoverySuggestion } = validationErrorMap[name];\n    if (!assertion) {\n        throw new AuthError({ name, message, recoverySuggestion });\n    }\n}\n\nexport { assertValidationError };\n","import { composeTransferHandler } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { unauthenticatedHandler } from '@aws-amplify/core/internals/aws-client-utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * A Cognito Identity-specific middleware that disables caching for all requests.\n */\nconst disableCacheMiddlewareFactory = () => (next, _) => async function disableCacheMiddleware(request) {\n    request.headers['cache-control'] = 'no-store';\n    return next(request);\n};\n/**\n * A Cognito Identity-specific transfer handler that does NOT sign requests, and\n * disables caching.\n *\n * @internal\n */\nconst cognitoUserPoolTransferHandler = composeTransferHandler(unauthenticatedHandler, [disableCacheMiddlewareFactory]);\n\nexport { cognitoUserPoolTransferHandler };\n","import { getRetryDecider, parseJsonError, jitteredBackoff } from '@aws-amplify/core/internals/aws-client-utils';\nimport { getAmplifyUserAgent } from '@aws-amplify/core/internals/utils';\nimport { COGNITO_IDP_SERVICE_NAME } from '../../../constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst DEFAULT_SERVICE_CLIENT_API_CONFIG = {\n    service: COGNITO_IDP_SERVICE_NAME,\n    retryDecider: getRetryDecider(parseJsonError),\n    computeDelay: jitteredBackoff,\n    userAgentValue: getAmplifyUserAgent(),\n    cache: 'no-store',\n};\n\nexport { DEFAULT_SERVICE_CLIENT_API_CONFIG };\n","import { invalidOriginException, invalidRedirectException, invalidPreferredRedirectUrlException } from '../../../../errors/constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/** @internal */\nfunction getRedirectUrl(redirects, preferredRedirectUrl) {\n    if (preferredRedirectUrl) {\n        const redirectUrl = redirects?.find(redirect => redirect === preferredRedirectUrl);\n        if (!redirectUrl) {\n            throw invalidPreferredRedirectUrlException;\n        }\n        return redirectUrl;\n    }\n    else {\n        const redirectUrlFromTheSameOrigin = redirects?.find(isSameOriginAndPathName) ??\n            redirects?.find(isTheSameDomain);\n        const redirectUrlFromDifferentOrigin = redirects?.find(isHttps) ?? redirects?.find(isHttp);\n        if (redirectUrlFromTheSameOrigin) {\n            return redirectUrlFromTheSameOrigin;\n        }\n        else if (redirectUrlFromDifferentOrigin) {\n            throw invalidOriginException;\n        }\n        throw invalidRedirectException;\n    }\n}\n// origin + pathname => https://example.com/app\nconst isSameOriginAndPathName = (redirect) => redirect.startsWith(\n// eslint-disable-next-line no-constant-binary-expression\nString(window.location.origin + window.location.pathname ?? '/'));\n// domain => outlook.live.com, github.com\nconst isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));\nconst isHttp = (redirect) => redirect.startsWith('http://');\nconst isHttps = (redirect) => redirect.startsWith('https://');\n\nexport { getRedirectUrl };\n","import { AmplifyErrorCode } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction assertServiceError(error) {\n    if (!error ||\n        error.name === 'Error' ||\n        error instanceof TypeError) {\n        throw new AuthError({\n            name: AmplifyErrorCode.Unknown,\n            message: 'An unknown error has occurred.',\n            underlyingError: error,\n        });\n    }\n}\n\nexport { assertServiceError };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst inflightPromises = [];\nconst addInflightPromise = (resolver) => {\n    inflightPromises.push(resolver);\n};\nconst resolveAndClearInflightPromises = () => {\n    while (inflightPromises.length) {\n        inflightPromises.pop()?.();\n    }\n};\n\nexport { addInflightPromise, resolveAndClearInflightPromises };\n","import { ConsoleLogger } from '@aws-amplify/core';\nimport { AuthErrorStrings } from './common/AuthErrorStrings.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// TODO: delete this module when the Auth class is removed.\nconst logger = new ConsoleLogger('AuthError');\nclass AuthError extends Error {\n    constructor(type) {\n        const { message, log } = authErrorMessages[type];\n        super(message);\n        // Hack for making the custom error class work when transpiled to es5\n        // TODO: Delete the following 2 lines after we change the build target to >= es2015\n        this.constructor = AuthError;\n        Object.setPrototypeOf(this, AuthError.prototype);\n        this.name = 'AuthError';\n        this.log = log || message;\n        logger.error(this.log);\n    }\n}\nclass NoUserPoolError extends AuthError {\n    constructor(type) {\n        super(type);\n        // Hack for making the custom error class work when transpiled to es5\n        // TODO: Delete the following 2 lines after we change the build target to >= es2015\n        this.constructor = NoUserPoolError;\n        Object.setPrototypeOf(this, NoUserPoolError.prototype);\n        this.name = 'NoUserPoolError';\n    }\n}\nconst authErrorMessages = {\n    oauthSignInError: {\n        message: AuthErrorStrings.OAUTH_ERROR,\n        log: 'Make sure Cognito Hosted UI has been configured correctly',\n    },\n    noConfig: {\n        message: AuthErrorStrings.DEFAULT_MSG,\n        log: `\n            Error: Amplify has not been configured correctly.\n            This error is typically caused by one of the following scenarios:\n\n            1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\n                See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\n            \n            2. There might be multiple conflicting versions of amplify packages in your node_modules.\n\t\t\t\tRefer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js)\n        `,\n    },\n    missingAuthConfig: {\n        message: AuthErrorStrings.DEFAULT_MSG,\n        log: `\n            Error: Amplify has not been configured correctly. \n            The configuration object is missing required auth properties.\n            This error is typically caused by one of the following scenarios:\n\n            1. Did you run \\`amplify push\\` after adding auth via \\`amplify add auth\\`?\n                See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\n\n            2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages.\n        `,\n    },\n    emptyUsername: {\n        message: AuthErrorStrings.EMPTY_USERNAME,\n    },\n    // TODO: should include a list of valid sign-in types\n    invalidUsername: {\n        message: AuthErrorStrings.INVALID_USERNAME,\n    },\n    emptyPassword: {\n        message: AuthErrorStrings.EMPTY_PASSWORD,\n    },\n    emptyCode: {\n        message: AuthErrorStrings.EMPTY_CODE,\n    },\n    signUpError: {\n        message: AuthErrorStrings.SIGN_UP_ERROR,\n        log: 'The first parameter should either be non-null string or object',\n    },\n    noMFA: {\n        message: AuthErrorStrings.NO_MFA,\n    },\n    invalidMFA: {\n        message: AuthErrorStrings.INVALID_MFA,\n    },\n    emptyChallengeResponse: {\n        message: AuthErrorStrings.EMPTY_CHALLENGE,\n    },\n    noUserSession: {\n        message: AuthErrorStrings.NO_USER_SESSION,\n    },\n    deviceConfig: {\n        message: AuthErrorStrings.DEVICE_CONFIG,\n    },\n    networkError: {\n        message: AuthErrorStrings.NETWORK_ERROR,\n    },\n    autoSignInError: {\n        message: AuthErrorStrings.AUTOSIGNIN_ERROR,\n    },\n    default: {\n        message: AuthErrorStrings.DEFAULT_MSG,\n    },\n};\n\nexport { AuthError, NoUserPoolError, authErrorMessages };\n","import { authErrorMessages } from '../../../../Errors.mjs';\nimport { AuthErrorCodes } from '../../../../common/AuthErrorStrings.mjs';\nimport { AuthError } from '../../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createOAuthError = (message, recoverySuggestion) => new AuthError({\n    message: message ?? 'An error has occurred during the oauth process.',\n    name: AuthErrorCodes.OAuthSignInError,\n    recoverySuggestion: recoverySuggestion ?? authErrorMessages.oauthSignInError.log,\n});\n\nexport { createOAuthError };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar AuthErrorTypes;\n(function (AuthErrorTypes) {\n    AuthErrorTypes[\"NoConfig\"] = \"noConfig\";\n    AuthErrorTypes[\"MissingAuthConfig\"] = \"missingAuthConfig\";\n    AuthErrorTypes[\"EmptyUsername\"] = \"emptyUsername\";\n    AuthErrorTypes[\"InvalidUsername\"] = \"invalidUsername\";\n    AuthErrorTypes[\"EmptyPassword\"] = \"emptyPassword\";\n    AuthErrorTypes[\"EmptyCode\"] = \"emptyCode\";\n    AuthErrorTypes[\"SignUpError\"] = \"signUpError\";\n    AuthErrorTypes[\"NoMFA\"] = \"noMFA\";\n    AuthErrorTypes[\"InvalidMFA\"] = \"invalidMFA\";\n    AuthErrorTypes[\"EmptyChallengeResponse\"] = \"emptyChallengeResponse\";\n    AuthErrorTypes[\"NoUserSession\"] = \"noUserSession\";\n    AuthErrorTypes[\"Default\"] = \"default\";\n    AuthErrorTypes[\"DeviceConfig\"] = \"deviceConfig\";\n    AuthErrorTypes[\"NetworkError\"] = \"networkError\";\n    AuthErrorTypes[\"AutoSignInError\"] = \"autoSignInError\";\n    AuthErrorTypes[\"OAuthSignInError\"] = \"oauthSignInError\";\n})(AuthErrorTypes || (AuthErrorTypes = {}));\n\nexport { AuthErrorTypes };\n","import { AuthError } from '../../../../errors/AuthError.mjs';\nimport { AuthErrorTypes } from '../../../../types/Auth.mjs';\nimport { oAuthStore } from './oAuthStore.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst flowCancelledMessage = '`signInWithRedirect` has been canceled.';\nconst validationFailedMessage = 'An error occurred while validating the state.';\nconst validationRecoverySuggestion = 'Try to initiate an OAuth flow from Amplify';\nconst validateState = async (state) => {\n    const savedState = await oAuthStore.loadOAuthState();\n    // This is because savedState only exists if the flow was initiated by Amplify\n    const validatedState = state === savedState ? savedState : undefined;\n    if (!validatedState) {\n        throw new AuthError({\n            name: AuthErrorTypes.OAuthSignInError,\n            message: state === null ? flowCancelledMessage : validationFailedMessage,\n            recoverySuggestion: state === null ? undefined : validationRecoverySuggestion,\n        });\n    }\n    return validatedState;\n};\n\nexport { flowCancelledMessage, validateState, validationFailedMessage, validationRecoverySuggestion };\n","import { AmplifyUrl, USER_AGENT_HEADER, urlSafeDecode, AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport { decodeJWT, Hub } from '@aws-amplify/core';\nimport { cacheCognitoTokens } from '../../tokenProvider/cacheTokens.mjs';\nimport { dispatchSignedInHubEvent } from '../dispatchSignedInHubEvent.mjs';\nimport '../refreshAuthTokens.mjs';\nimport '../../tokenProvider/errorHelpers.mjs';\nimport { oAuthStore } from './oAuthStore.mjs';\nimport { resolveAndClearInflightPromises } from './inflightPromise.mjs';\nimport { tokenOrchestrator } from '../../tokenProvider/tokenProvider.mjs';\nimport { createOAuthError } from './createOAuthError.mjs';\nimport { validateState } from './validateState.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst completeOAuthFlow = async ({ currentUrl, userAgentValue, clientId, redirectUri, responseType, domain, preferPrivateSession, }) => {\n    const urlParams = new AmplifyUrl(currentUrl);\n    const error = urlParams.searchParams.get('error');\n    const errorMessage = urlParams.searchParams.get('error_description');\n    if (error) {\n        throw createOAuthError(errorMessage ?? error);\n    }\n    if (responseType === 'code') {\n        return handleCodeFlow({\n            currentUrl,\n            userAgentValue,\n            clientId,\n            redirectUri,\n            domain,\n            preferPrivateSession,\n        });\n    }\n    return handleImplicitFlow({\n        currentUrl,\n        redirectUri,\n        preferPrivateSession,\n    });\n};\nconst handleCodeFlow = async ({ currentUrl, userAgentValue, clientId, redirectUri, domain, preferPrivateSession, }) => {\n    /* Convert URL into an object with parameters as keys\n{ redirect_uri: 'http://localhost:3000/', response_type: 'code', ...} */\n    const url = new AmplifyUrl(currentUrl);\n    const code = url.searchParams.get('code');\n    const state = url.searchParams.get('state');\n    // if `code` or `state` is not presented in the redirect url, most likely\n    // that the end user cancelled the inflight oauth flow by:\n    // 1. clicking the back button of browser\n    // 2. closing the provider hosted UI page and coming back to the app\n    if (!code || !state) {\n        throw createOAuthError('User cancelled OAuth flow.');\n    }\n    // may throw error is being caught in attemptCompleteOAuthFlow.ts\n    const validatedState = await validateState(state);\n    const oAuthTokenEndpoint = 'https://' + domain + '/oauth2/token';\n    // TODO(v6): check hub events\n    // dispatchAuthEvent(\n    // \t'codeFlow',\n    // \t{},\n    // \t`Retrieving tokens from ${oAuthTokenEndpoint}`\n    // );\n    const codeVerifier = await oAuthStore.loadPKCE();\n    const oAuthTokenBody = {\n        grant_type: 'authorization_code',\n        code,\n        client_id: clientId,\n        redirect_uri: redirectUri,\n        ...(codeVerifier ? { code_verifier: codeVerifier } : {}),\n    };\n    const body = Object.entries(oAuthTokenBody)\n        .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)\n        .join('&');\n    const { access_token, refresh_token: refreshToken, id_token, error, error_message: errorMessage, token_type, expires_in, } = await (await fetch(oAuthTokenEndpoint, {\n        method: 'POST',\n        headers: {\n            'Content-Type': 'application/x-www-form-urlencoded',\n            [USER_AGENT_HEADER]: userAgentValue,\n        },\n        body,\n    })).json();\n    if (error) {\n        // error is being caught in attemptCompleteOAuthFlow.ts\n        throw createOAuthError(errorMessage ?? error);\n    }\n    const username = (access_token && decodeJWT(access_token).payload.username) ?? 'username';\n    await cacheCognitoTokens({\n        username,\n        AccessToken: access_token,\n        IdToken: id_token,\n        RefreshToken: refreshToken});\n    return completeFlow({\n        redirectUri,\n        state: validatedState,\n        preferPrivateSession,\n    });\n};\nconst handleImplicitFlow = async ({ currentUrl, redirectUri, preferPrivateSession, }) => {\n    // hash is `null` if `#` doesn't exist on URL\n    const url = new AmplifyUrl(currentUrl);\n    const { id_token, access_token, state, token_type, expires_in, error_description, error, } = (url.hash ?? '#')\n        .substring(1) // Remove # from returned code\n        .split('&')\n        .map(pairings => pairings.split('='))\n        .reduce((accum, [k, v]) => ({ ...accum, [k]: v }), {\n        id_token: undefined,\n        access_token: undefined,\n        state: undefined,\n        token_type: undefined,\n        expires_in: undefined,\n        error_description: undefined,\n        error: undefined,\n    });\n    if (error) {\n        throw createOAuthError(error_description ?? error);\n    }\n    if (!access_token) {\n        // error is being caught in attemptCompleteOAuthFlow.ts\n        throw createOAuthError('No access token returned from OAuth flow.');\n    }\n    const validatedState = await validateState(state);\n    const username = (access_token && decodeJWT(access_token).payload.username) ?? 'username';\n    await cacheCognitoTokens({\n        username,\n        AccessToken: access_token,\n        IdToken: id_token});\n    return completeFlow({\n        redirectUri,\n        state: validatedState,\n        preferPrivateSession,\n    });\n};\nconst completeFlow = async ({ redirectUri, state, preferPrivateSession, }) => {\n    await tokenOrchestrator.setOAuthMetadata({\n        oauthSignIn: true,\n    });\n    await oAuthStore.clearOAuthData();\n    await oAuthStore.storeOAuthSignIn(true, preferPrivateSession);\n    // this should be called before any call that involves `fetchAuthSession`\n    // e.g. `getCurrentUser()` below, so it allows every inflight async calls to\n    //  `fetchAuthSession` can be resolved\n    resolveAndClearInflightPromises();\n    // clear history before sending out final Hub events\n    clearHistory(redirectUri);\n    if (isCustomState(state)) {\n        Hub.dispatch('auth', {\n            event: 'customOAuthState',\n            data: urlSafeDecode(getCustomState(state)),\n        }, 'Auth', AMPLIFY_SYMBOL);\n    }\n    Hub.dispatch('auth', { event: 'signInWithRedirect' }, 'Auth', AMPLIFY_SYMBOL);\n    await dispatchSignedInHubEvent();\n};\nconst isCustomState = (state) => {\n    return /-/.test(state);\n};\nconst getCustomState = (state) => {\n    return state.split('-').splice(1).join('-');\n};\nconst clearHistory = (redirectUri) => {\n    if (typeof window !== 'undefined' && typeof window.history !== 'undefined') {\n        window.history.replaceState(window.history.state, '', redirectUri);\n    }\n};\n\nexport { completeOAuthFlow };\n","import { Hub } from '@aws-amplify/core';\nimport { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport { oAuthStore } from './oAuthStore.mjs';\nimport { resolveAndClearInflightPromises } from './inflightPromise.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst handleFailure = async (error) => {\n    resolveAndClearInflightPromises();\n    await oAuthStore.clearOAuthInflightData();\n    Hub.dispatch('auth', { event: 'signInWithRedirect_failure', data: { error } }, 'Auth', AMPLIFY_SYMBOL);\n};\n\nexport { handleFailure };\n","import { assertTokenProviderConfig, assertOAuthConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { getAuthUserAgentValue } from '../../../../utils/getAuthUserAgentValue.mjs';\nimport { oAuthStore } from './oAuthStore.mjs';\nimport { completeOAuthFlow } from './completeOAuthFlow.mjs';\nimport { getRedirectUrl } from './getRedirectUrl.mjs';\nimport { handleFailure } from './handleFailure.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst attemptCompleteOAuthFlow = async (authConfig) => {\n    try {\n        assertTokenProviderConfig(authConfig);\n        assertOAuthConfig(authConfig);\n        oAuthStore.setAuthConfig(authConfig);\n    }\n    catch (_) {\n        // no-op\n        // This should not happen as Amplify singleton checks the oauth config key\n        // unless the oauth config object doesn't contain required properties\n        return;\n    }\n    // No inflight OAuth\n    if (!(await oAuthStore.loadOAuthInFlight())) {\n        return;\n    }\n    try {\n        const currentUrl = window.location.href;\n        const { loginWith, userPoolClientId } = authConfig;\n        const { domain, redirectSignIn, responseType } = loginWith.oauth;\n        const redirectUri = getRedirectUrl(redirectSignIn);\n        await completeOAuthFlow({\n            currentUrl,\n            clientId: userPoolClientId,\n            domain,\n            redirectUri,\n            responseType,\n            userAgentValue: getAuthUserAgentValue(AuthAction.SignInWithRedirect),\n        });\n    }\n    catch (err) {\n        await handleFailure(err);\n    }\n};\n\nexport { attemptCompleteOAuthFlow };\n","import { Amplify } from '@aws-amplify/core';\nimport { isBrowser, ADD_OAUTH_LISTENER } from '@aws-amplify/core/internals/utils';\nimport { attemptCompleteOAuthFlow } from './attemptCompleteOAuthFlow.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// attach the side effect for handling the completion of an inflight oauth flow\n// this side effect works only on Web\nisBrowser() &&\n    (() => {\n        // add the listener to the singleton for triggering\n        Amplify[ADD_OAUTH_LISTENER](attemptCompleteOAuthFlow);\n    })();\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst cognitoHostedUIIdentityProviderMap = {\n    Google: 'Google',\n    Facebook: 'Facebook',\n    Amazon: 'LoginWithAmazon',\n    Apple: 'SignInWithApple',\n};\n\nexport { cognitoHostedUIIdentityProviderMap };\n","import { Sha256 } from '@aws-crypto/sha256-js';\nimport { getCrypto, base64Encoder } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst CODE_VERIFIER_CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n/**\n *\n * @param length Desired length of the code verifier.\n *\n * **NOTE:** According to the [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636#section-4.1)\n * A code verifier must be with a length >= 43 and <= 128.\n *\n * @returns An object that contains the generated `codeVerifier` and a method\n * `toCodeChallenge` to generate the code challenge from the `codeVerifier`\n * following the spec of [RFC 7636](https://datatracker.ietf.org/doc/html/rfc7636#section-4.2).\n */\nconst generateCodeVerifier = (length) => {\n    const randomBytes = new Uint8Array(length);\n    getCrypto().getRandomValues(randomBytes);\n    let value = '';\n    let codeChallenge;\n    for (const byte of randomBytes) {\n        value += CODE_VERIFIER_CHARSET.charAt(byte % CODE_VERIFIER_CHARSET.length);\n    }\n    return {\n        value,\n        method: 'S256',\n        toCodeChallenge() {\n            if (codeChallenge) {\n                return codeChallenge;\n            }\n            codeChallenge = generateCodeChallenge(value);\n            return codeChallenge;\n        },\n    };\n};\nfunction generateCodeChallenge(codeVerifier) {\n    const awsCryptoHash = new Sha256();\n    awsCryptoHash.update(codeVerifier);\n    const codeChallenge = removePaddingChar(base64Encoder.convert(awsCryptoHash.digestSync(), { urlSafe: true }));\n    return codeChallenge;\n}\nfunction removePaddingChar(base64Encoded) {\n    return base64Encoded.replace(/=/g, '');\n}\n\nexport { generateCodeVerifier };\n","import { generateRandomString } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst generateState = () => {\n    return generateRandomString(32);\n};\n\nexport { generateState };\n","import { createOAuthError } from './createOAuthError.mjs';\nimport { handleFailure } from './handleFailure.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst listenForOAuthFlowCancellation = (store) => {\n    async function handleCancelOAuthFlow(event) {\n        const isBfcache = event.persisted;\n        if (isBfcache && (await store.loadOAuthInFlight())) {\n            const error = createOAuthError('User cancelled OAuth flow.');\n            await handleFailure(error);\n        }\n        window.removeEventListener('pageshow', handleCancelOAuthFlow);\n    }\n    window.addEventListener('pageshow', handleCancelOAuthFlow);\n};\n\nexport { listenForOAuthFlowCancellation };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, assertOAuthConfig, urlSafeEncode, isBrowser, AuthAction } from '@aws-amplify/core/internals/utils';\nimport '../utils/oauth/enableOAuthListener.mjs';\nimport { cognitoHostedUIIdentityProviderMap } from '../types/models.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { openAuthSession } from '../../../utils/openAuthSession.mjs';\nimport { assertUserNotAuthenticated } from '../utils/signInHelpers.mjs';\nimport { generateCodeVerifier } from '../utils/oauth/generateCodeVerifier.mjs';\nimport { generateState } from '../utils/oauth/generateState.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport { oAuthStore } from '../utils/oauth/oAuthStore.mjs';\nimport '../tokenProvider/tokenProvider.mjs';\nimport { getRedirectUrl } from '../utils/oauth/getRedirectUrl.mjs';\nimport { handleFailure } from '../utils/oauth/handleFailure.mjs';\nimport { completeOAuthFlow } from '../utils/oauth/completeOAuthFlow.mjs';\nimport '../../../types/Auth.mjs';\nimport { createOAuthError } from '../utils/oauth/createOAuthError.mjs';\nimport { listenForOAuthFlowCancellation } from '../utils/oauth/cancelOAuthFlow.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs in a user with OAuth. Redirects the application to an Identity Provider.\n *\n * @param input - The SignInWithRedirectInput object, if empty it will redirect to Cognito HostedUI\n *\n * @throws AuthTokenConfigException - Thrown when the user pool config is invalid.\n * @throws OAuthNotConfigureException - Thrown when the oauth config is invalid.\n */\nasync function signInWithRedirect(input) {\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    assertOAuthConfig(authConfig);\n    oAuthStore.setAuthConfig(authConfig);\n    await assertUserNotAuthenticated();\n    let provider = 'COGNITO'; // Default\n    if (typeof input?.provider === 'string') {\n        provider = cognitoHostedUIIdentityProviderMap[input.provider];\n    }\n    else if (input?.provider?.custom) {\n        provider = input.provider.custom;\n    }\n    return oauthSignIn({\n        oauthConfig: authConfig.loginWith.oauth,\n        clientId: authConfig.userPoolClientId,\n        provider,\n        customState: input?.customState,\n        preferPrivateSession: input?.options?.preferPrivateSession,\n        options: {\n            loginHint: input?.options?.loginHint,\n            lang: input?.options?.lang,\n            nonce: input?.options?.nonce,\n        },\n    });\n}\nconst oauthSignIn = async ({ oauthConfig, provider, clientId, customState, preferPrivateSession, options, }) => {\n    const { domain, redirectSignIn, responseType, scopes } = oauthConfig;\n    const { loginHint, lang, nonce } = options ?? {};\n    const randomState = generateState();\n    /* encodeURIComponent is not URL safe, use urlSafeEncode instead. Cognito\n    single-encodes/decodes url on first sign in and double-encodes/decodes url\n    when user already signed in. Using encodeURIComponent, Base32, Base64 add\n    characters % or = which on further encoding becomes unsafe. '=' create issue\n    for parsing query params.\n    Refer: https://github.com/aws-amplify/amplify-js/issues/5218 */\n    const state = customState\n        ? `${randomState}-${urlSafeEncode(customState)}`\n        : randomState;\n    const { value, method, toCodeChallenge } = generateCodeVerifier(128);\n    const redirectUri = getRedirectUrl(oauthConfig.redirectSignIn);\n    if (isBrowser())\n        oAuthStore.storeOAuthInFlight(true);\n    oAuthStore.storeOAuthState(state);\n    oAuthStore.storePKCE(value);\n    const queryString = Object.entries({\n        redirect_uri: redirectUri,\n        response_type: responseType,\n        client_id: clientId,\n        identity_provider: provider,\n        scope: scopes.join(' '),\n        // eslint-disable-next-line camelcase\n        ...(loginHint && { login_hint: loginHint }),\n        ...(lang && { lang }),\n        ...(nonce && { nonce }),\n        state,\n        ...(responseType === 'code' && {\n            code_challenge: toCodeChallenge(),\n            code_challenge_method: method,\n        }),\n    })\n        .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)\n        .join('&');\n    // TODO(v6): use URL object instead\n    const oAuthUrl = `https://${domain}/oauth2/authorize?${queryString}`;\n    // this will only take effect in the following scenarios:\n    // 1. the user cancels the OAuth flow on web via back button, and\n    // 2. when bfcache is enabled\n    listenForOAuthFlowCancellation(oAuthStore);\n    // the following is effective only in react-native as openAuthSession resolves only in react-native\n    const { type, error, url } = (await openAuthSession(oAuthUrl)) ??\n        {};\n    try {\n        if (type === 'error') {\n            throw createOAuthError(String(error));\n        }\n        if (type === 'success' && url) {\n            await completeOAuthFlow({\n                currentUrl: url,\n                clientId,\n                domain,\n                redirectUri,\n                responseType,\n                userAgentValue: getAuthUserAgentValue(AuthAction.SignInWithRedirect),\n                preferPrivateSession,\n            });\n        }\n    }\n    catch (err) {\n        await handleFailure(err);\n        // rethrow the error so it can be caught by `await signInWithRedirect()` in react-native\n        throw err;\n    }\n};\n\nexport { signInWithRedirect };\n","import { getDnsSuffix } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { COGNITO_IDP_SERVICE_NAME } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst cognitoUserPoolEndpointResolver = ({ region, }) => ({\n    url: new AmplifyUrl(`https://${COGNITO_IDP_SERVICE_NAME}.${region}.${getDnsSuffix(region)}`),\n});\n\nexport { cognitoUserPoolEndpointResolver };\n","import { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { cognitoUserPoolEndpointResolver } from '../../../foundation/cognitoUserPoolEndpointResolver.mjs';\n\nconst createCognitoUserPoolEndpointResolver = ({ endpointOverride }) => (input) => {\n    if (endpointOverride) {\n        return { url: new AmplifyUrl(endpointOverride) };\n    }\n    return cognitoUserPoolEndpointResolver(input);\n};\n\nexport { createCognitoUserPoolEndpointResolver };\n","import { AuthValidationErrorCode } from '../errors/types/validation.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst validationErrorMap = {\n    [AuthValidationErrorCode.EmptyChallengeResponse]: {\n        message: 'challengeResponse is required to confirmSignIn',\n    },\n    [AuthValidationErrorCode.EmptyConfirmResetPasswordUsername]: {\n        message: 'username is required to confirmResetPassword',\n    },\n    [AuthValidationErrorCode.EmptyConfirmSignUpCode]: {\n        message: 'code is required to confirmSignUp',\n    },\n    [AuthValidationErrorCode.EmptyConfirmSignUpUsername]: {\n        message: 'username is required to confirmSignUp',\n    },\n    [AuthValidationErrorCode.EmptyConfirmResetPasswordConfirmationCode]: {\n        message: 'confirmationCode is required to confirmResetPassword',\n    },\n    [AuthValidationErrorCode.EmptyConfirmResetPasswordNewPassword]: {\n        message: 'newPassword is required to confirmResetPassword',\n    },\n    [AuthValidationErrorCode.EmptyResendSignUpCodeUsername]: {\n        message: 'username is required to confirmSignUp',\n    },\n    [AuthValidationErrorCode.EmptyResetPasswordUsername]: {\n        message: 'username is required to resetPassword',\n    },\n    [AuthValidationErrorCode.EmptySignInPassword]: {\n        message: 'password is required to signIn',\n    },\n    [AuthValidationErrorCode.EmptySignInUsername]: {\n        message: 'username is required to signIn',\n    },\n    [AuthValidationErrorCode.EmptySignUpPassword]: {\n        message: 'password is required to signUp',\n    },\n    [AuthValidationErrorCode.EmptySignUpUsername]: {\n        message: 'username is required to signUp',\n    },\n    [AuthValidationErrorCode.CustomAuthSignInPassword]: {\n        message: 'A password is not needed when signing in with CUSTOM_WITHOUT_SRP',\n        recoverySuggestion: 'Do not include a password in your signIn call.',\n    },\n    [AuthValidationErrorCode.IncorrectMFAMethod]: {\n        message: 'Incorrect MFA method was chosen. It should be either SMS, TOTP, or EMAIL',\n        recoverySuggestion: 'Try to pass SMS, TOTP, or EMAIL as the challengeResponse',\n    },\n    [AuthValidationErrorCode.EmptyVerifyTOTPSetupCode]: {\n        message: 'code is required to verifyTotpSetup',\n    },\n    [AuthValidationErrorCode.EmptyUpdatePassword]: {\n        message: 'oldPassword and newPassword are required to changePassword',\n    },\n    [AuthValidationErrorCode.EmptyConfirmUserAttributeCode]: {\n        message: 'confirmation code is required to confirmUserAttribute',\n    },\n};\n// TODO: delete this code when the Auth class is removed.\nvar AuthErrorStrings;\n(function (AuthErrorStrings) {\n    AuthErrorStrings[\"DEFAULT_MSG\"] = \"Authentication Error\";\n    AuthErrorStrings[\"EMPTY_EMAIL\"] = \"Email cannot be empty\";\n    AuthErrorStrings[\"EMPTY_PHONE\"] = \"Phone number cannot be empty\";\n    AuthErrorStrings[\"EMPTY_USERNAME\"] = \"Username cannot be empty\";\n    AuthErrorStrings[\"INVALID_USERNAME\"] = \"The username should either be a string or one of the sign in types\";\n    AuthErrorStrings[\"EMPTY_PASSWORD\"] = \"Password cannot be empty\";\n    AuthErrorStrings[\"EMPTY_CODE\"] = \"Confirmation code cannot be empty\";\n    AuthErrorStrings[\"SIGN_UP_ERROR\"] = \"Error creating account\";\n    AuthErrorStrings[\"NO_MFA\"] = \"No valid MFA method provided\";\n    AuthErrorStrings[\"INVALID_MFA\"] = \"Invalid MFA type\";\n    AuthErrorStrings[\"EMPTY_CHALLENGE\"] = \"Challenge response cannot be empty\";\n    AuthErrorStrings[\"NO_USER_SESSION\"] = \"Failed to get the session because the user is empty\";\n    AuthErrorStrings[\"NETWORK_ERROR\"] = \"Network Error\";\n    AuthErrorStrings[\"DEVICE_CONFIG\"] = \"Device tracking has not been configured in this User Pool\";\n    AuthErrorStrings[\"AUTOSIGNIN_ERROR\"] = \"Please use your credentials to sign in\";\n    AuthErrorStrings[\"OAUTH_ERROR\"] = \"Couldn't finish OAuth flow, check your User Pool HostedUI settings\";\n})(AuthErrorStrings || (AuthErrorStrings = {}));\nvar AuthErrorCodes;\n(function (AuthErrorCodes) {\n    AuthErrorCodes[\"SignInException\"] = \"SignInException\";\n    AuthErrorCodes[\"OAuthSignInError\"] = \"OAuthSignInException\";\n})(AuthErrorCodes || (AuthErrorCodes = {}));\n\nexport { AuthErrorCodes, AuthErrorStrings, validationErrorMap };\n","import { AmplifyError } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass AuthError extends AmplifyError {\n    constructor(params) {\n        super(params);\n        // Hack for making the custom error class work when transpiled to es5\n        // TODO: Delete the following 2 lines after we change the build target to >= es2015\n        this.constructor = AuthError;\n        Object.setPrototypeOf(this, AuthError.prototype);\n    }\n}\n\nexport { AuthError };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createConfirmSignUpClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('ConfirmSignUp'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createConfirmSignUpClient };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction, HubInternal } from '@aws-amplify/core/internals/utils';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { getUserContextData } from '../utils/userContextData.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../types/errors.mjs';\nimport { createConfirmSignUpClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmSignUpClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { autoSignInStore } from '../../../client/utils/store/autoSignInStore.mjs';\nimport '../../../client/utils/store/signInStore.mjs';\nimport { resetAutoSignIn } from './autoSignIn.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Confirms a new user account.\n *\n * @param input -  The ConfirmSignUpInput object.\n * @returns ConfirmSignUpOutput\n * @throws -{@link ConfirmSignUpException }\n * Thrown due to an invalid confirmation code.\n * @throws -{@link AuthValidationErrorCode }\n * Thrown due to an empty confirmation code\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmSignUp(input) {\n    const { username, confirmationCode, options } = input;\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = authConfig;\n    const clientMetadata = options?.clientMetadata;\n    assertValidationError(!!username, AuthValidationErrorCode.EmptyConfirmSignUpUsername);\n    assertValidationError(!!confirmationCode, AuthValidationErrorCode.EmptyConfirmSignUpCode);\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const confirmSignUpClient = createConfirmSignUpClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const { Session: session } = await confirmSignUpClient({\n        region: getRegionFromUserPoolId(authConfig.userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignUp),\n    }, {\n        Username: username,\n        ConfirmationCode: confirmationCode,\n        ClientMetadata: clientMetadata,\n        ForceAliasCreation: options?.forceAliasCreation,\n        ClientId: authConfig.userPoolClientId,\n        UserContextData,\n    });\n    return new Promise((resolve, reject) => {\n        try {\n            const signUpOut = {\n                isSignUpComplete: true,\n                nextStep: {\n                    signUpStep: 'DONE',\n                },\n            };\n            const autoSignInStoreState = autoSignInStore.getState();\n            if (!autoSignInStoreState.active ||\n                autoSignInStoreState.username !== username) {\n                resolve(signUpOut);\n                resetAutoSignIn();\n                return;\n            }\n            autoSignInStore.dispatch({ type: 'SET_SESSION', value: session });\n            const stopListener = HubInternal.listen('auth-internal', ({ payload }) => {\n                switch (payload.event) {\n                    case 'autoSignIn':\n                        resolve({\n                            isSignUpComplete: true,\n                            nextStep: {\n                                signUpStep: 'COMPLETE_AUTO_SIGN_IN',\n                            },\n                        });\n                        stopListener();\n                }\n            });\n            HubInternal.dispatch('auth-internal', {\n                event: 'confirmSignUp',\n                data: signUpOut,\n            });\n        }\n        catch (error) {\n            reject(error);\n        }\n    });\n}\n\nexport { confirmSignUp };\n","import { parseJsonError, parseJsonBody } from '@aws-amplify/core/internals/aws-client-utils';\nimport { assertServiceError } from '../../../../../../errors/utils/assertServiceError.mjs';\nimport { AuthError } from '../../../../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createUserPoolDeserializer = () => async (response) => {\n    if (response.statusCode >= 300) {\n        const error = await parseJsonError(response);\n        assertServiceError(error);\n        throw new AuthError({\n            name: error.name,\n            message: error.message,\n            metadata: error.$metadata,\n        });\n    }\n    return parseJsonBody(response);\n};\n\nexport { createUserPoolDeserializer };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction defaultState() {\n    return {\n        active: false,\n    };\n}\nconst autoSignInReducer = (state, action) => {\n    switch (action.type) {\n        case 'SET_USERNAME':\n            return {\n                ...state,\n                username: action.value,\n            };\n        case 'SET_SESSION':\n            return {\n                ...state,\n                session: action.value,\n            };\n        case 'START':\n            return {\n                ...state,\n                active: true,\n            };\n        case 'RESET':\n            return defaultState();\n        default:\n            return state;\n    }\n};\nconst createAutoSignInStore = (reducer) => {\n    let currentState = reducer(defaultState(), { type: 'RESET' });\n    return {\n        getState: () => currentState,\n        dispatch: action => {\n            currentState = reducer(currentState, action);\n        },\n    };\n};\nconst autoSignInStore = createAutoSignInStore(autoSignInReducer);\n\nexport { autoSignInStore };\n","import { AuthAction } from '@aws-amplify/core/internals/utils';\nimport { getUserContextData } from '../../../providers/cognito/utils/userContextData.mjs';\nimport { createInitiateAuthClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport '../../../providers/cognito/types/errors.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../../../providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { handlePasswordSRP } from '../shared/handlePasswordSRP.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { setActiveSignInUsername } from '../../../providers/cognito/utils/setActiveSignInUsername.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Handles user authentication flow with configurable challenge preferences.\n * Supports AuthFactorType challenges through the USER_AUTH flow.\n *\n * @param {HandleUserAuthFlowInput} params - Authentication flow parameters\n * @param {string} params.username - The username for authentication\n * @param {Record<string, string>} [params.clientMetadata] - Optional metadata to pass to authentication service\n * @param {CognitoUserPoolConfig} params.config - Cognito User Pool configuration\n * @param {AuthTokenOrchestrator} params.tokenOrchestrator - Manages authentication tokens and device tracking\n * @param {AuthFactorType} [params.preferredChallenge] - Optional preferred authentication method\n * @param {string} [params.password] - Required when preferredChallenge is 'PASSWORD' or 'PASSWORD_SRP'\n *\n * @returns {Promise<InitiateAuthCommandOutput>} The authentication response from Cognito\n */\nasync function handleUserAuthFlow({ username, clientMetadata, config, tokenOrchestrator, preferredChallenge, password, session, }) {\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const authParameters = { USERNAME: username };\n    if (preferredChallenge) {\n        if (preferredChallenge === 'PASSWORD_SRP') {\n            assertValidationError(!!password, AuthValidationErrorCode.EmptySignInPassword);\n            return handlePasswordSRP({\n                username,\n                password,\n                clientMetadata,\n                config,\n                tokenOrchestrator,\n                authFlow: 'USER_AUTH',\n                preferredChallenge,\n            });\n        }\n        if (preferredChallenge === 'PASSWORD') {\n            assertValidationError(!!password, AuthValidationErrorCode.EmptySignInPassword);\n            authParameters.PASSWORD = password;\n        }\n        authParameters.PREFERRED_CHALLENGE = preferredChallenge;\n    }\n    const jsonReq = {\n        AuthFlow: 'USER_AUTH',\n        AuthParameters: authParameters,\n        ClientMetadata: clientMetadata,\n        ClientId: userPoolClientId,\n        UserContextData,\n    };\n    if (session) {\n        jsonReq.Session = session;\n    }\n    const initiateAuth = createInitiateAuthClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const response = await initiateAuth({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.SignIn),\n    }, jsonReq);\n    // Set the active username immediately after successful authentication attempt\n    // If a user starts a new sign-in while another sign-in is incomplete,\n    // this ensures we're tracking the correct user for subsequent auth challenges.\n    setActiveSignInUsername(username);\n    return response;\n}\n\nexport { handleUserAuthFlow };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { getActiveSignInUsername, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { autoSignInStore } from '../../../client/utils/store/autoSignInStore.mjs';\nimport { setActiveSignInState, resetActiveSignInState } from '../../../client/utils/store/signInStore.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { handleUserAuthFlow } from '../../../client/flows/userAuth/handleUserAuthFlow.mjs';\nimport { getNewDeviceMetadata } from '../utils/getNewDeviceMetadata.mjs';\nimport { resetAutoSignIn } from './autoSignIn.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in through a registered email or phone number without a password by by receiving and entering an OTP.\n *\n * @param input - The SignInWithUserAuthInput object\n * @returns SignInWithUserAuthOutput\n * @throws service: {@link InitiateAuthException }, {@link RespondToAuthChallengeException } - Cognito service errors\n * thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode  } - Validation errors thrown when either username or password -- needs to change\n *  are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signInWithUserAuth(input) {\n    const { username, password, options } = input;\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    const signInDetails = {\n        loginId: username,\n        authFlowType: 'USER_AUTH',\n    };\n    assertTokenProviderConfig(authConfig);\n    const clientMetaData = options?.clientMetadata;\n    const preferredChallenge = options?.preferredChallenge;\n    assertValidationError(!!username, AuthValidationErrorCode.EmptySignInUsername);\n    try {\n        const handleUserAuthFlowInput = {\n            username,\n            config: authConfig,\n            tokenOrchestrator,\n            clientMetadata: clientMetaData,\n            preferredChallenge,\n            password,\n        };\n        const autoSignInStoreState = autoSignInStore.getState();\n        if (autoSignInStoreState.active &&\n            autoSignInStoreState.username === username) {\n            handleUserAuthFlowInput.session = autoSignInStoreState.session;\n        }\n        const response = await handleUserAuthFlow(handleUserAuthFlowInput);\n        const activeUsername = getActiveSignInUsername(username);\n        setActiveSignInState({\n            signInSession: response.Session,\n            username: activeUsername,\n            challengeName: response.ChallengeName,\n            signInDetails,\n        });\n        if (response.AuthenticationResult) {\n            await cacheCognitoTokens({\n                username: activeUsername,\n                ...response.AuthenticationResult,\n                NewDeviceMetadata: await getNewDeviceMetadata({\n                    userPoolId: authConfig.userPoolId,\n                    userPoolEndpoint: authConfig.userPoolEndpoint,\n                    newDeviceMetadata: response.AuthenticationResult.NewDeviceMetadata,\n                    accessToken: response.AuthenticationResult.AccessToken,\n                }),\n                signInDetails,\n            });\n            resetActiveSignInState();\n            await dispatchSignedInHubEvent();\n            resetAutoSignIn();\n            return {\n                isSignedIn: true,\n                nextStep: { signInStep: 'DONE' },\n            };\n        }\n        return getSignInResult({\n            challengeName: response.ChallengeName,\n            challengeParameters: response.ChallengeParameters,\n            availableChallenges: 'AvailableChallenges' in response\n                ? response.AvailableChallenges\n                : undefined,\n        });\n    }\n    catch (error) {\n        resetActiveSignInState();\n        resetAutoSignIn();\n        assertServiceError(error);\n        const result = getSignInResultFromError(error.name);\n        if (result)\n            return result;\n        throw error;\n    }\n}\n\nexport { signInWithUserAuth };\n","import { autoSignInStore } from '../../../client/utils/store/autoSignInStore.mjs';\nimport '../../../client/utils/store/signInStore.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { AUTO_SIGN_IN_EXCEPTION } from '../../../errors/constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst initialAutoSignIn = async () => {\n    throw new AuthError({\n        name: AUTO_SIGN_IN_EXCEPTION,\n        message: 'The autoSignIn flow has not started, or has been cancelled/completed.',\n        recoverySuggestion: 'Please try to use the signIn API or log out before starting a new autoSignIn flow.',\n    });\n};\n/**\n * Signs a user in automatically after finishing the sign-up process.\n *\n * This API will automatically sign a user in if the autoSignIn flow has been completed in the following cases:\n * - User confirmed their account with a verification code sent to their phone or email (default option).\n * - User confirmed their account with a verification link sent to their phone or email. In order to\n * enable this option you need to go to the Amazon Cognito [console](https://aws.amazon.com/pm/cognito),\n * look for your userpool, then go to the `Messaging` tab and enable `link` mode inside the `Verification message` option.\n * Finally you need to define the `signUpVerificationMethod` in your `Auth` config.\n *\n * @example\n * ```typescript\n *  Amplify.configure({\n *    Auth: {\n *     Cognito: {\n *    ...cognitoConfig,\n *    signUpVerificationMethod: \"link\" // the default value is \"code\"\n *   }\n *\t}});\n * ```\n *\n * @throws AutoSignInException - Thrown when the autoSignIn flow has not started, or has been cancelled/completed.\n * @returns The signInOutput.\n *\n * @example\n * ```typescript\n *  // handleSignUp.ts\n * async function handleSignUp(\n *   username:string,\n *   password:string\n * ){\n *   try {\n *     const { nextStep } = await signUp({\n *       username,\n *       password,\n *       options: {\n *         userAttributes:{ email:'email@email.com'},\n *         autoSignIn: true // This enables the auto sign-in flow.\n *       },\n *     });\n *\n *     handleSignUpStep(nextStep);\n *\n *   } catch (error) {\n *     console.log(error);\n *   }\n * }\n *\n * // handleConfirmSignUp.ts\n * async function handleConfirmSignUp(username:string, confirmationCode:string) {\n *   try {\n *     const { nextStep } = await confirmSignUp({\n *       username,\n *       confirmationCode,\n *     });\n *\n *     handleSignUpStep(nextStep);\n *   } catch (error) {\n *     console.log(error);\n *   }\n * }\n *\n * // signUpUtils.ts\n * async function handleSignUpStep( step: SignUpOutput[\"nextStep\"]) {\n * switch (step.signUpStep) {\n *   case \"CONFIRM_SIGN_UP\":\n *\n *    // Redirect end-user to confirm-sign up screen.\n *\n *   case \"COMPLETE_AUTO_SIGN_IN\":\n *\t   const codeDeliveryDetails = step.codeDeliveryDetails;\n *     if (codeDeliveryDetails) {\n *      // Redirect user to confirm-sign-up with link screen.\n *     }\n *     const signInOutput = await autoSignIn();\n *   // handle sign-in steps\n * }\n *\n * ```\n */\n// TODO(Eslint): can this be refactored not using `let` on exported member?\n// eslint-disable-next-line import/no-mutable-exports\nlet autoSignIn = initialAutoSignIn;\n/**\n * Sets the context of autoSignIn at run time.\n * @internal\n */\nfunction setAutoSignIn(callback) {\n    autoSignIn = callback;\n}\n/**\n * Resets the context\n *\n * @internal\n */\nfunction resetAutoSignIn(resetCallback = true) {\n    if (resetCallback) {\n        autoSignIn = initialAutoSignIn;\n    }\n    autoSignInStore.dispatch({ type: 'RESET' });\n}\n\nexport { autoSignIn, resetAutoSignIn, setAutoSignIn };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createRespondToAuthChallengeClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('RespondToAuthChallenge'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createRespondToAuthChallengeClient };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport '../../../client/utils/store/autoSignInStore.mjs';\nimport { signInStore, setActiveSignInState, resetActiveSignInState } from '../../../client/utils/store/signInStore.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { handleChallengeName, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { AuthErrorCodes } from '../../../common/AuthErrorStrings.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\nimport { getNewDeviceMetadata } from '../utils/getNewDeviceMetadata.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Continues or completes the sign in process when required by the initial call to `signIn`.\n *\n * @param input -  The ConfirmSignInInput object\n * @returns ConfirmSignInOutput\n * @throws  -{@link VerifySoftwareTokenException }:\n * Thrown due to an invalid MFA token.\n * @throws  -{@link RespondToAuthChallengeException }:\n * Thrown due to an invalid auth challenge response.\n * @throws  -{@link AssociateSoftwareTokenException}:\n * Thrown due to a service error during the MFA setup process.\n * @throws  -{@link AuthValidationErrorCode }:\n * Thrown when `challengeResponse` is not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmSignIn(input) {\n    const { challengeResponse, options } = input;\n    const { username, challengeName, signInSession, signInDetails } = signInStore.getState();\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const clientMetaData = options?.clientMetadata;\n    assertValidationError(!!challengeResponse, AuthValidationErrorCode.EmptyChallengeResponse);\n    if (!username || !challengeName || !signInSession)\n        // TODO: remove this error message for production apps\n        throw new AuthError({\n            name: AuthErrorCodes.SignInException,\n            message: `\n\t\t\tAn error occurred during the sign in process.\n\n\t\t\tThis most likely occurred due to:\n\t\t\t1. signIn was not called before confirmSignIn.\n\t\t\t2. signIn threw an exception.\n\t\t\t3. page was refreshed during the sign in flow and session has expired.\n\t\t\t`,\n            recoverySuggestion: 'Make sure a successful call to signIn is made before calling confirmSignIn' +\n                'and that the session has not expired.',\n        });\n    try {\n        const { Session, ChallengeName: handledChallengeName, AuthenticationResult, ChallengeParameters: handledChallengeParameters, } = await handleChallengeName(username, challengeName, signInSession, challengeResponse, authConfig, tokenOrchestrator, clientMetaData, options);\n        // sets up local state used during the sign-in process\n        setActiveSignInState({\n            signInSession: Session,\n            username,\n            challengeName: handledChallengeName,\n            signInDetails,\n        });\n        if (AuthenticationResult) {\n            await cacheCognitoTokens({\n                username,\n                ...AuthenticationResult,\n                NewDeviceMetadata: await getNewDeviceMetadata({\n                    userPoolId: authConfig.userPoolId,\n                    userPoolEndpoint: authConfig.userPoolEndpoint,\n                    newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n                    accessToken: AuthenticationResult.AccessToken,\n                }),\n                signInDetails,\n            });\n            resetActiveSignInState();\n            await dispatchSignedInHubEvent();\n            return {\n                isSignedIn: true,\n                nextStep: { signInStep: 'DONE' },\n            };\n        }\n        return getSignInResult({\n            challengeName: handledChallengeName,\n            challengeParameters: handledChallengeParameters,\n        });\n    }\n    catch (error) {\n        assertServiceError(error);\n        const result = getSignInResultFromError(error.name);\n        if (result)\n            return result;\n        throw error;\n    }\n}\n\nexport { confirmSignIn };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createResendConfirmationCodeClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('ResendConfirmationCode'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createResendConfirmationCodeClient };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { getUserContextData } from '../utils/userContextData.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../types/errors.mjs';\nimport { createResendConfirmationCodeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createResendConfirmationCodeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Resend the confirmation code while signing up\n *\n * @param input -  The ResendSignUpCodeInput object\n * @returns ResendSignUpCodeOutput\n * @throws service: {@link ResendConfirmationException } - Cognito service errors thrown when resending the code.\n * @throws validation: {@link AuthValidationErrorCode } - Validation errors thrown either username are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function resendSignUpCode(input) {\n    const { username } = input;\n    assertValidationError(!!username, AuthValidationErrorCode.EmptySignUpUsername);\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const { userPoolClientId, userPoolId, userPoolEndpoint } = authConfig;\n    const clientMetadata = input.options?.clientMetadata;\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const resendConfirmationCode = createResendConfirmationCodeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const { CodeDeliveryDetails } = await resendConfirmationCode({\n        region: getRegionFromUserPoolId(authConfig.userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ResendSignUpCode),\n    }, {\n        Username: username,\n        ClientMetadata: clientMetadata,\n        ClientId: authConfig.userPoolClientId,\n        UserContextData,\n    });\n    const { DeliveryMedium, AttributeName, Destination } = {\n        ...CodeDeliveryDetails,\n    };\n    return {\n        destination: Destination,\n        deliveryMedium: DeliveryMedium,\n        attributeName: AttributeName\n            ? AttributeName\n            : undefined,\n    };\n}\n\nexport { resendSignUpCode };\n","import '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../types/errors.mjs';\nimport { createRespondToAuthChallengeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { assertDeviceMetadata } from './types.mjs';\nimport { getAuthenticationHelper } from './srp/getAuthenticationHelper.mjs';\nimport './srp/constants.mjs';\nimport { getNowString } from './srp/getNowString.mjs';\nimport { getSignatureString } from './srp/getSignatureString.mjs';\nimport BigInteger from './srp/BigInteger/BigInteger.mjs';\nimport { getUserContextData } from './userContextData.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nasync function handleDeviceSRPAuth({ username, config, clientMetadata, session, tokenOrchestrator, }) {\n    const { userPoolId, userPoolEndpoint } = config;\n    const clientId = config.userPoolClientId;\n    const deviceMetadata = await tokenOrchestrator?.getDeviceMetadata(username);\n    assertDeviceMetadata(deviceMetadata);\n    const authenticationHelper = await getAuthenticationHelper(deviceMetadata.deviceGroupKey);\n    const challengeResponses = {\n        USERNAME: username,\n        SRP_A: authenticationHelper.A.toString(16),\n        DEVICE_KEY: deviceMetadata.deviceKey,\n    };\n    const jsonReqResponseChallenge = {\n        ChallengeName: 'DEVICE_SRP_AUTH',\n        ClientId: clientId,\n        ChallengeResponses: challengeResponses,\n        ClientMetadata: clientMetadata,\n        Session: session,\n    };\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const { ChallengeParameters: respondedChallengeParameters, Session } = await respondToAuthChallenge({ region: getRegionFromUserPoolId(userPoolId) }, jsonReqResponseChallenge);\n    return handleDevicePasswordVerifier(username, respondedChallengeParameters, clientMetadata, Session, authenticationHelper, config, tokenOrchestrator);\n}\nasync function handleDevicePasswordVerifier(username, challengeParameters, clientMetadata, session, authenticationHelper, { userPoolId, userPoolClientId, userPoolEndpoint }, tokenOrchestrator) {\n    const deviceMetadata = await tokenOrchestrator?.getDeviceMetadata(username);\n    assertDeviceMetadata(deviceMetadata);\n    const serverBValue = new BigInteger(challengeParameters?.SRP_B, 16);\n    const salt = new BigInteger(challengeParameters?.SALT, 16);\n    const { deviceKey } = deviceMetadata;\n    const { deviceGroupKey } = deviceMetadata;\n    const hkdf = await authenticationHelper.getPasswordAuthenticationKey({\n        username: deviceMetadata.deviceKey,\n        password: deviceMetadata.randomPassword,\n        serverBValue,\n        salt,\n    });\n    const dateNow = getNowString();\n    const challengeResponses = {\n        USERNAME: challengeParameters?.USERNAME ?? username,\n        PASSWORD_CLAIM_SECRET_BLOCK: challengeParameters?.SECRET_BLOCK,\n        TIMESTAMP: dateNow,\n        PASSWORD_CLAIM_SIGNATURE: getSignatureString({\n            username: deviceKey,\n            userPoolName: deviceGroupKey,\n            challengeParameters,\n            dateNow,\n            hkdf,\n        }),\n        DEVICE_KEY: deviceKey,\n    };\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const jsonReqResponseChallenge = {\n        ChallengeName: 'DEVICE_PASSWORD_VERIFIER',\n        ClientId: userPoolClientId,\n        ChallengeResponses: challengeResponses,\n        Session: session,\n        ClientMetadata: clientMetadata,\n        UserContextData,\n    };\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    return respondToAuthChallenge({ region: getRegionFromUserPoolId(userPoolId) }, jsonReqResponseChallenge);\n}\n\nexport { handleDeviceSRPAuth };\n","import { defaultStorage } from '@aws-amplify/core';\nimport { DefaultOAuthStore } from '../signInWithRedirectStore.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst oAuthStore = new DefaultOAuthStore(defaultStorage);\n\nexport { oAuthStore };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createVerifySoftwareTokenClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('VerifySoftwareToken'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createVerifySoftwareTokenClient };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createAssociateSoftwareTokenClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('AssociateSoftwareToken'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createAssociateSoftwareTokenClient };\n","import { createAssertionFunction, AmplifyError, AmplifyErrorCode } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass PasskeyError extends AmplifyError {\n    constructor(params) {\n        super(params);\n        // Hack for making the custom error class work when transpiled to es5\n        // TODO: Delete the following 2 lines after we change the build target to >= es2015\n        this.constructor = PasskeyError;\n        Object.setPrototypeOf(this, PasskeyError.prototype);\n    }\n}\nvar PasskeyErrorCode;\n(function (PasskeyErrorCode) {\n    // not supported\n    PasskeyErrorCode[\"PasskeyNotSupported\"] = \"PasskeyNotSupported\";\n    // duplicate passkey\n    PasskeyErrorCode[\"PasskeyAlreadyExists\"] = \"PasskeyAlreadyExists\";\n    // misconfigurations\n    PasskeyErrorCode[\"InvalidPasskeyRegistrationOptions\"] = \"InvalidPasskeyRegistrationOptions\";\n    PasskeyErrorCode[\"InvalidPasskeyAuthenticationOptions\"] = \"InvalidPasskeyAuthenticationOptions\";\n    PasskeyErrorCode[\"RelyingPartyMismatch\"] = \"RelyingPartyMismatch\";\n    // failed credential creation / retrieval\n    PasskeyErrorCode[\"PasskeyRegistrationFailed\"] = \"PasskeyRegistrationFailed\";\n    PasskeyErrorCode[\"PasskeyRetrievalFailed\"] = \"PasskeyRetrievalFailed\";\n    // cancel / aborts\n    PasskeyErrorCode[\"PasskeyRegistrationCanceled\"] = \"PasskeyRegistrationCanceled\";\n    PasskeyErrorCode[\"PasskeyAuthenticationCanceled\"] = \"PasskeyAuthenticationCanceled\";\n    PasskeyErrorCode[\"PasskeyOperationAborted\"] = \"PasskeyOperationAborted\";\n})(PasskeyErrorCode || (PasskeyErrorCode = {}));\nconst notSupportedRecoverySuggestion = 'Passkeys may not be supported on this device. Ensure your application is running in a secure context (HTTPS) and Web Authentication API is supported.';\nconst abortOrCancelRecoverySuggestion = 'User may have canceled the ceremony or another interruption has occurred. Check underlying error for details.';\nconst misconfigurationRecoverySuggestion = 'Ensure your user pool is configured to support the WEB_AUTHN as an authentication factor.';\nconst passkeyErrorMap = {\n    [PasskeyErrorCode.PasskeyNotSupported]: {\n        message: 'Passkeys may not be supported on this device.',\n        recoverySuggestion: notSupportedRecoverySuggestion,\n    },\n    [PasskeyErrorCode.InvalidPasskeyRegistrationOptions]: {\n        message: 'Invalid passkey registration options.',\n        recoverySuggestion: misconfigurationRecoverySuggestion,\n    },\n    [PasskeyErrorCode.InvalidPasskeyAuthenticationOptions]: {\n        message: 'Invalid passkey authentication options.',\n        recoverySuggestion: misconfigurationRecoverySuggestion,\n    },\n    [PasskeyErrorCode.PasskeyRegistrationFailed]: {\n        message: 'Device failed to create passkey.',\n        recoverySuggestion: notSupportedRecoverySuggestion,\n    },\n    [PasskeyErrorCode.PasskeyRetrievalFailed]: {\n        message: 'Device failed to retrieve passkey.',\n        recoverySuggestion: 'Passkeys may not be available on this device. Try an alternative authentication factor like PASSWORD, EMAIL_OTP, or SMS_OTP.',\n    },\n    [PasskeyErrorCode.PasskeyAlreadyExists]: {\n        message: 'Passkey already exists in authenticator.',\n        recoverySuggestion: 'Proceed with existing passkey or try again after deleting the credential.',\n    },\n    [PasskeyErrorCode.PasskeyRegistrationCanceled]: {\n        message: 'Passkey registration ceremony has been canceled.',\n        recoverySuggestion: abortOrCancelRecoverySuggestion,\n    },\n    [PasskeyErrorCode.PasskeyAuthenticationCanceled]: {\n        message: 'Passkey authentication ceremony has been canceled.',\n        recoverySuggestion: abortOrCancelRecoverySuggestion,\n    },\n    [PasskeyErrorCode.PasskeyOperationAborted]: {\n        message: 'Passkey operation has been aborted.',\n        recoverySuggestion: abortOrCancelRecoverySuggestion,\n    },\n    [PasskeyErrorCode.RelyingPartyMismatch]: {\n        message: 'Relying party does not match current domain.',\n        recoverySuggestion: 'Ensure relying party identifier matches current domain.',\n    },\n};\nconst assertPasskeyError = createAssertionFunction(passkeyErrorMap, PasskeyError);\n/**\n * Handle Passkey Authentication Errors\n * https://w3c.github.io/webauthn/#sctn-get-request-exceptions\n *\n * @param err unknown\n * @returns PasskeyError\n */\nconst handlePasskeyAuthenticationError = (err) => {\n    if (err instanceof PasskeyError) {\n        return err;\n    }\n    if (err instanceof Error) {\n        if (err.name === 'NotAllowedError') {\n            const { message, recoverySuggestion } = passkeyErrorMap[PasskeyErrorCode.PasskeyAuthenticationCanceled];\n            return new PasskeyError({\n                name: PasskeyErrorCode.PasskeyAuthenticationCanceled,\n                message,\n                recoverySuggestion,\n                underlyingError: err,\n            });\n        }\n    }\n    return handlePasskeyError(err);\n};\n/**\n * Handle Passkey Registration Errors\n * https://w3c.github.io/webauthn/#sctn-create-request-exceptions\n *\n * @param err unknown\n * @returns PasskeyError\n */\nconst handlePasskeyRegistrationError = (err) => {\n    if (err instanceof PasskeyError) {\n        return err;\n    }\n    if (err instanceof Error) {\n        // Duplicate Passkey\n        if (err.name === 'InvalidStateError') {\n            const { message, recoverySuggestion } = passkeyErrorMap[PasskeyErrorCode.PasskeyAlreadyExists];\n            return new PasskeyError({\n                name: PasskeyErrorCode.PasskeyAlreadyExists,\n                message,\n                recoverySuggestion,\n                underlyingError: err,\n            });\n        }\n        // User Cancels Ceremony / Generic Catch All\n        if (err.name === 'NotAllowedError') {\n            const { message, recoverySuggestion } = passkeyErrorMap[PasskeyErrorCode.PasskeyRegistrationCanceled];\n            return new PasskeyError({\n                name: PasskeyErrorCode.PasskeyRegistrationCanceled,\n                message,\n                recoverySuggestion,\n                underlyingError: err,\n            });\n        }\n    }\n    return handlePasskeyError(err);\n};\n/**\n * Handles Overlapping Passkey Errors Between Registration & Authentication\n * https://w3c.github.io/webauthn/#sctn-create-request-exceptions\n * https://w3c.github.io/webauthn/#sctn-get-request-exceptions\n *\n * @param err unknown\n * @returns PasskeyError\n */\nconst handlePasskeyError = (err) => {\n    if (err instanceof Error) {\n        // Passkey Operation Aborted\n        if (err.name === 'AbortError') {\n            const { message, recoverySuggestion } = passkeyErrorMap[PasskeyErrorCode.PasskeyOperationAborted];\n            return new PasskeyError({\n                name: PasskeyErrorCode.PasskeyOperationAborted,\n                message,\n                recoverySuggestion,\n                underlyingError: err,\n            });\n        }\n        // Relying Party / Domain Mismatch\n        if (err.name === 'SecurityError') {\n            const { message, recoverySuggestion } = passkeyErrorMap[PasskeyErrorCode.RelyingPartyMismatch];\n            return new PasskeyError({\n                name: PasskeyErrorCode.RelyingPartyMismatch,\n                message,\n                recoverySuggestion,\n                underlyingError: err,\n            });\n        }\n    }\n    return new PasskeyError({\n        name: AmplifyErrorCode.Unknown,\n        message: 'An unknown error has occurred.',\n        underlyingError: err,\n    });\n};\n\nexport { PasskeyError, PasskeyErrorCode, assertPasskeyError, handlePasskeyAuthenticationError, handlePasskeyRegistrationError };\n","import { isBrowser } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Determines if passkey is supported in current context\n * Will return false if executed in non-secure context\n * @returns boolean\n */\nconst getIsPasskeySupported = () => {\n    return (isBrowser() &&\n        window.isSecureContext &&\n        'credentials' in navigator &&\n        typeof window.PublicKeyCredential === 'function');\n};\n\nexport { getIsPasskeySupported };\n","import { base64Encoder } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// https://datatracker.ietf.org/doc/html/rfc4648#page-7\n/**\n * Converts an ArrayBuffer to a base64url encoded string\n * @param buffer - the ArrayBuffer instance of a Uint8Array\n * @returns string - a base64url encoded string\n */\nconst convertArrayBufferToBase64Url = (buffer) => {\n    return base64Encoder.convert(new Uint8Array(buffer), {\n        urlSafe: true,\n        skipPadding: true,\n    });\n};\n\nexport { convertArrayBufferToBase64Url };\n","import { base64Decoder } from '@aws-amplify/core/internals/utils';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Converts a base64url encoded string to an ArrayBuffer\n * @param base64url - a base64url encoded string\n * @returns ArrayBuffer\n */\nconst convertBase64UrlToArrayBuffer = (base64url) => {\n    return Uint8Array.from(base64Decoder.convert(base64url, { urlSafe: true }), x => x.charCodeAt(0)).buffer;\n};\n\nexport { convertBase64UrlToArrayBuffer };\n","import { convertArrayBufferToBase64Url } from '../../../foundation/convert/base64url/convertArrayBufferToBase64Url.mjs';\nimport { convertBase64UrlToArrayBuffer } from '../../../foundation/convert/base64url/convertBase64UrlToArrayBuffer.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Deserializes Public Key Credential Creation Options JSON\n * @param input PasskeyCreateOptionsJson\n * @returns PublicKeyCredentialCreationOptions\n */\nconst deserializeJsonToPkcCreationOptions = (input) => {\n    const userIdBuffer = convertBase64UrlToArrayBuffer(input.user.id);\n    const challengeBuffer = convertBase64UrlToArrayBuffer(input.challenge);\n    const excludeCredentialsWithBuffer = (input.excludeCredentials || []).map(excludeCred => ({\n        ...excludeCred,\n        id: convertBase64UrlToArrayBuffer(excludeCred.id),\n    }));\n    return {\n        ...input,\n        excludeCredentials: excludeCredentialsWithBuffer,\n        challenge: challengeBuffer,\n        user: {\n            ...input.user,\n            id: userIdBuffer,\n        },\n    };\n};\n/**\n * Serializes a Public Key Credential With Attestation to JSON\n * @param input PasskeyCreateResult\n * @returns PasskeyCreateResultJson\n */\nconst serializePkcWithAttestationToJson = (input) => {\n    const response = {\n        clientDataJSON: convertArrayBufferToBase64Url(input.response.clientDataJSON),\n        attestationObject: convertArrayBufferToBase64Url(input.response.attestationObject),\n        transports: input.response.getTransports(),\n        publicKeyAlgorithm: input.response.getPublicKeyAlgorithm(),\n        authenticatorData: convertArrayBufferToBase64Url(input.response.getAuthenticatorData()),\n    };\n    const publicKey = input.response.getPublicKey();\n    if (publicKey) {\n        response.publicKey = convertArrayBufferToBase64Url(publicKey);\n    }\n    const resultJson = {\n        type: input.type,\n        id: input.id,\n        rawId: convertArrayBufferToBase64Url(input.rawId),\n        clientExtensionResults: input.getClientExtensionResults(),\n        response,\n    };\n    if (input.authenticatorAttachment) {\n        resultJson.authenticatorAttachment = input.authenticatorAttachment;\n    }\n    return resultJson;\n};\n/**\n * Deserializes Public Key Credential Get Options JSON\n * @param input PasskeyGetOptionsJson\n * @returns PublicKeyCredentialRequestOptions\n */\nconst deserializeJsonToPkcGetOptions = (input) => {\n    const challengeBuffer = convertBase64UrlToArrayBuffer(input.challenge);\n    const allowedCredentialsWithBuffer = (input.allowCredentials || []).map(allowedCred => ({\n        ...allowedCred,\n        id: convertBase64UrlToArrayBuffer(allowedCred.id),\n    }));\n    return {\n        ...input,\n        challenge: challengeBuffer,\n        allowCredentials: allowedCredentialsWithBuffer,\n    };\n};\n/**\n * Serializes a Public Key Credential With Attestation to JSON\n * @param input PasskeyGetResult\n * @returns PasskeyGetResultJson\n */\nconst serializePkcWithAssertionToJson = (input) => {\n    const response = {\n        clientDataJSON: convertArrayBufferToBase64Url(input.response.clientDataJSON),\n        authenticatorData: convertArrayBufferToBase64Url(input.response.authenticatorData),\n        signature: convertArrayBufferToBase64Url(input.response.signature),\n    };\n    if (input.response.userHandle) {\n        response.userHandle = convertArrayBufferToBase64Url(input.response.userHandle);\n    }\n    const resultJson = {\n        id: input.id,\n        rawId: convertArrayBufferToBase64Url(input.rawId),\n        type: input.type,\n        clientExtensionResults: input.getClientExtensionResults(),\n        response,\n    };\n    if (input.authenticatorAttachment) {\n        resultJson.authenticatorAttachment = input.authenticatorAttachment;\n    }\n    return resultJson;\n};\n\nexport { deserializeJsonToPkcCreationOptions, deserializeJsonToPkcGetOptions, serializePkcWithAssertionToJson, serializePkcWithAttestationToJson };\n","import { assertPasskeyError, PasskeyErrorCode } from '../errors.mjs';\nexport { assertValidCredentialCreationOptions } from './shared.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction assertCredentialIsPkcWithAuthenticatorAttestationResponse(credential) {\n    assertPasskeyError(credential &&\n        credential instanceof PublicKeyCredential &&\n        credential.response instanceof AuthenticatorAttestationResponse, PasskeyErrorCode.PasskeyRegistrationFailed);\n}\nfunction assertCredentialIsPkcWithAuthenticatorAssertionResponse(credential) {\n    assertPasskeyError(credential &&\n        credential instanceof PublicKeyCredential &&\n        credential.response instanceof AuthenticatorAssertionResponse, PasskeyErrorCode.PasskeyRetrievalFailed);\n}\n\nexport { assertCredentialIsPkcWithAuthenticatorAssertionResponse, assertCredentialIsPkcWithAuthenticatorAttestationResponse };\n","import { assertPasskeyError, PasskeyErrorCode, handlePasskeyAuthenticationError } from './errors.mjs';\nimport { getIsPasskeySupported } from './getIsPasskeySupported.mjs';\nimport { deserializeJsonToPkcGetOptions, serializePkcWithAssertionToJson } from './serde.mjs';\nimport { assertCredentialIsPkcWithAuthenticatorAssertionResponse } from './types/index.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getPasskey = async (input) => {\n    try {\n        const isPasskeySupported = getIsPasskeySupported();\n        assertPasskeyError(isPasskeySupported, PasskeyErrorCode.PasskeyNotSupported);\n        const passkeyGetOptions = deserializeJsonToPkcGetOptions(input);\n        const credential = await navigator.credentials.get({\n            publicKey: passkeyGetOptions,\n        });\n        assertCredentialIsPkcWithAuthenticatorAssertionResponse(credential);\n        return serializePkcWithAssertionToJson(credential);\n    }\n    catch (err) {\n        throw handlePasskeyAuthenticationError(err);\n    }\n};\n\nexport { getPasskey };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { AuthErrorCodes } from '../../../common/AuthErrorStrings.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../../../providers/cognito/types/errors.mjs';\nimport { createRespondToAuthChallengeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../../../providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { cacheCognitoTokens } from '../../../providers/cognito/tokenProvider/cacheTokens.mjs';\nimport { dispatchSignedInHubEvent } from '../../../providers/cognito/utils/dispatchSignedInHubEvent.mjs';\nimport '../../utils/store/autoSignInStore.mjs';\nimport { signInStore, setActiveSignInState } from '../../utils/store/signInStore.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { assertPasskeyError, PasskeyErrorCode } from '../../utils/passkey/errors.mjs';\nimport { getPasskey } from '../../utils/passkey/getPasskey.mjs';\nimport { getNewDeviceMetadata } from '../../../providers/cognito/utils/getNewDeviceMetadata.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nasync function handleWebAuthnSignInResult(challengeParameters) {\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const { username, signInSession, signInDetails, challengeName } = signInStore.getState();\n    if (challengeName !== 'WEB_AUTHN' || !username) {\n        throw new AuthError({\n            name: AuthErrorCodes.SignInException,\n            message: 'Unable to proceed due to invalid sign in state.',\n        });\n    }\n    const { CREDENTIAL_REQUEST_OPTIONS: credentialRequestOptions } = challengeParameters;\n    assertPasskeyError(!!credentialRequestOptions, PasskeyErrorCode.InvalidPasskeyAuthenticationOptions);\n    const cred = await getPasskey(JSON.parse(credentialRequestOptions));\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: authConfig.userPoolEndpoint,\n        }),\n    });\n    const { ChallengeName: nextChallengeName, ChallengeParameters: nextChallengeParameters, AuthenticationResult: authenticationResult, Session: nextSession, } = await respondToAuthChallenge({\n        region: getRegionFromUserPoolId(authConfig.userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n    }, {\n        ChallengeName: 'WEB_AUTHN',\n        ChallengeResponses: {\n            USERNAME: username,\n            CREDENTIAL: JSON.stringify(cred),\n        },\n        ClientId: authConfig.userPoolClientId,\n        Session: signInSession,\n    });\n    setActiveSignInState({\n        signInSession: nextSession,\n        username,\n        challengeName: nextChallengeName,\n        signInDetails,\n    });\n    if (authenticationResult) {\n        await cacheCognitoTokens({\n            ...authenticationResult,\n            username,\n            NewDeviceMetadata: await getNewDeviceMetadata({\n                userPoolId: authConfig.userPoolId,\n                userPoolEndpoint: authConfig.userPoolEndpoint,\n                newDeviceMetadata: authenticationResult.NewDeviceMetadata,\n                accessToken: authenticationResult.AccessToken,\n            }),\n            signInDetails,\n        });\n        signInStore.dispatch({ type: 'RESET_STATE' });\n        await dispatchSignedInHubEvent();\n        return {\n            isSignedIn: true,\n            nextStep: { signInStep: 'DONE' },\n        };\n    }\n    if (nextChallengeName === 'WEB_AUTHN') {\n        throw new AuthError({\n            name: AuthErrorCodes.SignInException,\n            message: 'Sequential WEB_AUTHN challenges returned from underlying service cannot be handled.',\n        });\n    }\n    return {\n        challengeName: nextChallengeName,\n        challengeParameters: nextChallengeParameters,\n    };\n}\n\nexport { handleWebAuthnSignInResult };\n","import { AuthAction } from '@aws-amplify/core/internals/utils';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../../../providers/cognito/types/errors.mjs';\nimport { createRespondToAuthChallengeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../../../providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Handles the SELECT_CHALLENGE response for authentication.\n * Initiates the selected authentication challenge based on user choice.\n *\n * @param {Object} params - The parameters for handling the selected challenge\n * @param {string} params.username - The username for authentication\n * @param {string} params.session - The current authentication session token\n * @param {string} params.selectedChallenge - The challenge type selected by the user\n * @param {CognitoUserPoolConfig} params.config - Cognito User Pool configuration\n * @param {ClientMetadata} [params.clientMetadata] - Optional metadata to be sent with auth requests\n *\n * @returns {Promise<RespondToAuthChallengeCommandOutput>} The challenge response\n */\nasync function initiateSelectedChallenge({ username, session, selectedChallenge, config, clientMetadata, }) {\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: config.userPoolEndpoint,\n        }),\n    });\n    return respondToAuthChallenge({\n        region: getRegionFromUserPoolId(config.userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n    }, {\n        ChallengeName: 'SELECT_CHALLENGE',\n        ChallengeResponses: {\n            USERNAME: username,\n            ANSWER: selectedChallenge,\n        },\n        ClientId: config.userPoolClientId,\n        Session: session,\n        ClientMetadata: clientMetadata,\n    });\n}\n\nexport { initiateSelectedChallenge };\n","import { AuthAction } from '@aws-amplify/core/internals/utils';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../../../providers/cognito/types/errors.mjs';\nimport { createRespondToAuthChallengeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../../../providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { getUserContextData } from '../../../providers/cognito/utils/userContextData.mjs';\nimport { setActiveSignInUsername } from '../../../providers/cognito/utils/setActiveSignInUsername.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Handles the SELECT_CHALLENGE response specifically for Password authentication.\n * This function combines the SELECT_CHALLENGE flow with standard password authentication.\n *\n * @param {string} username - The username for authentication\n * @param {string} password - The user's password\n * @param {ClientMetadata} [clientMetadata] - Optional metadata to be sent with auth requests\n * @param {CognitoUserPoolConfig} config - Cognito User Pool configuration\n * @param {string} session - The current authentication session token\n *\n * @returns {Promise<RespondToAuthChallengeCommandOutput>} The challenge response\n */\nasync function handleSelectChallengeWithPassword(username, password, clientMetadata, config, session) {\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    const authParameters = {\n        ANSWER: 'PASSWORD',\n        USERNAME: username,\n        PASSWORD: password,\n    };\n    const userContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const response = await respondToAuthChallenge({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n    }, {\n        ChallengeName: 'SELECT_CHALLENGE',\n        ChallengeResponses: authParameters,\n        ClientId: userPoolClientId,\n        ClientMetadata: clientMetadata,\n        Session: session,\n        UserContextData: userContextData,\n    });\n    const activeUsername = response.ChallengeParameters?.USERNAME ?? username;\n    setActiveSignInUsername(activeUsername);\n    return response;\n}\n\nexport { handleSelectChallengeWithPassword };\n","import { AuthAction } from '@aws-amplify/core/internals/utils';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../../../providers/cognito/types/errors.mjs';\nimport { createRespondToAuthChallengeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../../../providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { getAuthenticationHelper } from '../../../providers/cognito/utils/srp/getAuthenticationHelper.mjs';\nimport '../../../providers/cognito/utils/srp/constants.mjs';\nimport '@aws-crypto/sha256-js';\nimport { getUserContextData } from '../../../providers/cognito/utils/userContextData.mjs';\nimport { setActiveSignInUsername } from '../../../providers/cognito/utils/setActiveSignInUsername.mjs';\nimport { retryOnResourceNotFoundException } from '../../../providers/cognito/utils/retryOnResourceNotFoundException.mjs';\nimport { handlePasswordVerifierChallenge } from '../../../providers/cognito/utils/handlePasswordVerifierChallenge.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Handles the SELECT_CHALLENGE response specifically for Password SRP authentication.\n * This function combines the SELECT_CHALLENGE flow with Password SRP protocol.\n *\n * @param {string} username - The username for authentication\n * @param {string} password - The user's password\n * @param {ClientMetadata} [clientMetadata] - Optional metadata to be sent with auth requests\n * @param {CognitoUserPoolConfig} config - Cognito User Pool configuration\n * @param {string} session - The current authentication session token\n * @param {AuthTokenOrchestrator} tokenOrchestrator - Token orchestrator for managing auth tokens\n *\n * @returns {Promise<RespondToAuthChallengeCommandOutput>} The challenge response\n */\nasync function handleSelectChallengeWithPasswordSRP(username, password, clientMetadata, config, session, tokenOrchestrator) {\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    const userPoolName = userPoolId.split('_')[1] || '';\n    const authenticationHelper = await getAuthenticationHelper(userPoolName);\n    const authParameters = {\n        ANSWER: 'PASSWORD_SRP',\n        USERNAME: username,\n        SRP_A: authenticationHelper.A.toString(16),\n    };\n    const userContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const response = await respondToAuthChallenge({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n    }, {\n        ChallengeName: 'SELECT_CHALLENGE',\n        ChallengeResponses: authParameters,\n        ClientId: userPoolClientId,\n        ClientMetadata: clientMetadata,\n        Session: session,\n        UserContextData: userContextData,\n    });\n    const activeUsername = response.ChallengeParameters?.USERNAME ?? username;\n    setActiveSignInUsername(activeUsername);\n    if (response.ChallengeName === 'PASSWORD_VERIFIER') {\n        return retryOnResourceNotFoundException(handlePasswordVerifierChallenge, [\n            password,\n            response.ChallengeParameters,\n            clientMetadata,\n            response.Session,\n            authenticationHelper,\n            config,\n            tokenOrchestrator,\n        ], activeUsername, tokenOrchestrator);\n    }\n    return response;\n}\n\nexport { handleSelectChallengeWithPasswordSRP };\n","import { Amplify } from '@aws-amplify/core';\nimport { AuthAction, assertTokenProviderConfig, AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport { InitiateAuthException } from '../types/errors.mjs';\nimport { AuthErrorCodes } from '../../../common/AuthErrorStrings.mjs';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { USER_ALREADY_AUTHENTICATED_EXCEPTION } from '../../../errors/constants.mjs';\nimport { getCurrentUser } from '../apis/getCurrentUser.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { createInitiateAuthClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createRespondToAuthChallengeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.mjs';\nimport { createVerifySoftwareTokenClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createVerifySoftwareTokenClient.mjs';\nimport { createAssociateSoftwareTokenClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createAssociateSoftwareTokenClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { handleWebAuthnSignInResult } from '../../../client/flows/userAuth/handleWebAuthnSignInResult.mjs';\nimport { handlePasswordSRP } from '../../../client/flows/shared/handlePasswordSRP.mjs';\nimport { initiateSelectedChallenge } from '../../../client/flows/userAuth/handleSelectChallenge.mjs';\nimport { handleSelectChallengeWithPassword } from '../../../client/flows/userAuth/handleSelectChallengeWithPassword.mjs';\nimport { handleSelectChallengeWithPasswordSRP } from '../../../client/flows/userAuth/handleSelectChallengeWithPasswordSRP.mjs';\nimport '../../../client/utils/store/autoSignInStore.mjs';\nimport { signInStore } from '../../../client/utils/store/signInStore.mjs';\nimport { getAuthenticationHelper } from './srp/getAuthenticationHelper.mjs';\nimport './srp/constants.mjs';\nimport '@aws-crypto/sha256-js';\nimport { getUserContextData } from './userContextData.mjs';\nimport { handlePasswordVerifierChallenge } from './handlePasswordVerifierChallenge.mjs';\nimport { handleDeviceSRPAuth } from './handleDeviceSRPAuth.mjs';\nimport { retryOnResourceNotFoundException } from './retryOnResourceNotFoundException.mjs';\nimport { setActiveSignInUsername } from './setActiveSignInUsername.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst USER_ATTRIBUTES = 'userAttributes.';\nfunction isWebAuthnResultAuthSignInOutput(result) {\n    return 'isSignedIn' in result && 'nextStep' in result;\n}\nasync function handleCustomChallenge({ challengeResponse, clientMetadata, session, username, config, tokenOrchestrator, }) {\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    const challengeResponses = {\n        USERNAME: username,\n        ANSWER: challengeResponse,\n    };\n    const deviceMetadata = await tokenOrchestrator?.getDeviceMetadata(username);\n    if (deviceMetadata && deviceMetadata.deviceKey) {\n        challengeResponses.DEVICE_KEY = deviceMetadata.deviceKey;\n    }\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const jsonReq = {\n        ChallengeName: 'CUSTOM_CHALLENGE',\n        ChallengeResponses: challengeResponses,\n        Session: session,\n        ClientMetadata: clientMetadata,\n        ClientId: userPoolClientId,\n        UserContextData,\n    };\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const response = await respondToAuthChallenge({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n    }, jsonReq);\n    if (response.ChallengeName === 'DEVICE_SRP_AUTH') {\n        return handleDeviceSRPAuth({\n            username,\n            config,\n            clientMetadata,\n            session: response.Session,\n            tokenOrchestrator,\n        });\n    }\n    return response;\n}\nasync function handleMFASetupChallenge({ challengeResponse, username, clientMetadata, session, deviceName, config, }) {\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    if (challengeResponse === 'EMAIL') {\n        return {\n            ChallengeName: 'MFA_SETUP',\n            Session: session,\n            ChallengeParameters: {\n                MFAS_CAN_SETUP: '[\"EMAIL_OTP\"]',\n            },\n            $metadata: {},\n        };\n    }\n    if (challengeResponse === 'TOTP') {\n        return {\n            ChallengeName: 'MFA_SETUP',\n            Session: session,\n            ChallengeParameters: {\n                MFAS_CAN_SETUP: '[\"SOFTWARE_TOKEN_MFA\"]',\n            },\n            $metadata: {},\n        };\n    }\n    const challengeResponses = {\n        USERNAME: username,\n    };\n    const isTOTPCode = /^\\d+$/.test(challengeResponse);\n    if (isTOTPCode) {\n        const verifySoftwareToken = createVerifySoftwareTokenClient({\n            endpointResolver: createCognitoUserPoolEndpointResolver({\n                endpointOverride: userPoolEndpoint,\n            }),\n        });\n        const { Session } = await verifySoftwareToken({\n            region: getRegionFromUserPoolId(userPoolId),\n            userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n        }, {\n            UserCode: challengeResponse,\n            Session: session,\n            FriendlyDeviceName: deviceName,\n        });\n        signInStore.dispatch({\n            type: 'SET_SIGN_IN_SESSION',\n            value: Session,\n        });\n        const jsonReq = {\n            ChallengeName: 'MFA_SETUP',\n            ChallengeResponses: challengeResponses,\n            Session,\n            ClientMetadata: clientMetadata,\n            ClientId: userPoolClientId,\n        };\n        const respondToAuthChallenge = createRespondToAuthChallengeClient({\n            endpointResolver: createCognitoUserPoolEndpointResolver({\n                endpointOverride: userPoolEndpoint,\n            }),\n        });\n        return respondToAuthChallenge({\n            region: getRegionFromUserPoolId(userPoolId),\n            userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n        }, jsonReq);\n    }\n    const isEmail = challengeResponse.includes('@');\n    if (isEmail) {\n        challengeResponses.EMAIL = challengeResponse;\n        const jsonReq = {\n            ChallengeName: 'MFA_SETUP',\n            ChallengeResponses: challengeResponses,\n            Session: session,\n            ClientMetadata: clientMetadata,\n            ClientId: userPoolClientId,\n        };\n        const respondToAuthChallenge = createRespondToAuthChallengeClient({\n            endpointResolver: createCognitoUserPoolEndpointResolver({\n                endpointOverride: userPoolEndpoint,\n            }),\n        });\n        return respondToAuthChallenge({\n            region: getRegionFromUserPoolId(userPoolId),\n            userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n        }, jsonReq);\n    }\n    throw new AuthError({\n        name: AuthErrorCodes.SignInException,\n        message: `Cannot proceed with MFA setup using challengeResponse: ${challengeResponse}`,\n        recoverySuggestion: 'Try passing \"EMAIL\", \"TOTP\", a valid email, or OTP code as the challengeResponse.',\n    });\n}\nasync function handleSelectMFATypeChallenge({ challengeResponse, username, clientMetadata, session, config, }) {\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    assertValidationError(challengeResponse === 'TOTP' ||\n        challengeResponse === 'SMS' ||\n        challengeResponse === 'EMAIL', AuthValidationErrorCode.IncorrectMFAMethod);\n    const challengeResponses = {\n        USERNAME: username,\n        ANSWER: mapMfaType(challengeResponse),\n    };\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const jsonReq = {\n        ChallengeName: 'SELECT_MFA_TYPE',\n        ChallengeResponses: challengeResponses,\n        Session: session,\n        ClientMetadata: clientMetadata,\n        ClientId: userPoolClientId,\n        UserContextData,\n    };\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    return respondToAuthChallenge({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n    }, jsonReq);\n}\nasync function handleCompleteNewPasswordChallenge({ challengeResponse, clientMetadata, session, username, requiredAttributes, config, }) {\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    const challengeResponses = {\n        ...createAttributes(requiredAttributes),\n        NEW_PASSWORD: challengeResponse,\n        USERNAME: username,\n    };\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const jsonReq = {\n        ChallengeName: 'NEW_PASSWORD_REQUIRED',\n        ChallengeResponses: challengeResponses,\n        ClientMetadata: clientMetadata,\n        Session: session,\n        ClientId: userPoolClientId,\n        UserContextData,\n    };\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    return respondToAuthChallenge({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n    }, jsonReq);\n}\nasync function handleUserPasswordAuthFlow(username, password, clientMetadata, config, tokenOrchestrator) {\n    const { userPoolClientId, userPoolId, userPoolEndpoint } = config;\n    const authParameters = {\n        USERNAME: username,\n        PASSWORD: password,\n    };\n    const deviceMetadata = await tokenOrchestrator.getDeviceMetadata(username);\n    if (deviceMetadata && deviceMetadata.deviceKey) {\n        authParameters.DEVICE_KEY = deviceMetadata.deviceKey;\n    }\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const jsonReq = {\n        AuthFlow: 'USER_PASSWORD_AUTH',\n        AuthParameters: authParameters,\n        ClientMetadata: clientMetadata,\n        ClientId: userPoolClientId,\n        UserContextData,\n    };\n    const initiateAuth = createInitiateAuthClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const response = await initiateAuth({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.SignIn),\n    }, jsonReq);\n    const activeUsername = response.ChallengeParameters?.USERNAME ??\n        response.ChallengeParameters?.USER_ID_FOR_SRP ??\n        username;\n    setActiveSignInUsername(activeUsername);\n    if (response.ChallengeName === 'DEVICE_SRP_AUTH')\n        return handleDeviceSRPAuth({\n            username: activeUsername,\n            config,\n            clientMetadata,\n            session: response.Session,\n            tokenOrchestrator,\n        });\n    return response;\n}\nasync function handleUserSRPAuthFlow(username, password, clientMetadata, config, tokenOrchestrator) {\n    return handlePasswordSRP({\n        username,\n        password,\n        clientMetadata,\n        config,\n        tokenOrchestrator,\n        authFlow: 'USER_SRP_AUTH',\n    });\n}\nasync function handleCustomAuthFlowWithoutSRP(username, clientMetadata, config, tokenOrchestrator) {\n    const { userPoolClientId, userPoolId, userPoolEndpoint } = config;\n    const authParameters = {\n        USERNAME: username,\n    };\n    const deviceMetadata = await tokenOrchestrator.getDeviceMetadata(username);\n    if (deviceMetadata && deviceMetadata.deviceKey) {\n        authParameters.DEVICE_KEY = deviceMetadata.deviceKey;\n    }\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const jsonReq = {\n        AuthFlow: 'CUSTOM_AUTH',\n        AuthParameters: authParameters,\n        ClientMetadata: clientMetadata,\n        ClientId: userPoolClientId,\n        UserContextData,\n    };\n    const initiateAuth = createInitiateAuthClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const response = await initiateAuth({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.SignIn),\n    }, jsonReq);\n    const activeUsername = response.ChallengeParameters?.USERNAME ?? username;\n    setActiveSignInUsername(activeUsername);\n    if (response.ChallengeName === 'DEVICE_SRP_AUTH')\n        return handleDeviceSRPAuth({\n            username: activeUsername,\n            config,\n            clientMetadata,\n            session: response.Session,\n            tokenOrchestrator,\n        });\n    return response;\n}\nasync function handleCustomSRPAuthFlow(username, password, clientMetadata, config, tokenOrchestrator) {\n    assertTokenProviderConfig(config);\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    const userPoolName = userPoolId?.split('_')[1] || '';\n    const authenticationHelper = await getAuthenticationHelper(userPoolName);\n    const authParameters = {\n        USERNAME: username,\n        SRP_A: authenticationHelper.A.toString(16),\n        CHALLENGE_NAME: 'SRP_A',\n    };\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const jsonReq = {\n        AuthFlow: 'CUSTOM_AUTH',\n        AuthParameters: authParameters,\n        ClientMetadata: clientMetadata,\n        ClientId: userPoolClientId,\n        UserContextData,\n    };\n    const initiateAuth = createInitiateAuthClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const { ChallengeParameters: challengeParameters, Session: session } = await initiateAuth({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.SignIn),\n    }, jsonReq);\n    const activeUsername = challengeParameters?.USERNAME ?? username;\n    setActiveSignInUsername(activeUsername);\n    return retryOnResourceNotFoundException(handlePasswordVerifierChallenge, [\n        password,\n        challengeParameters,\n        clientMetadata,\n        session,\n        authenticationHelper,\n        config,\n        tokenOrchestrator,\n    ], activeUsername, tokenOrchestrator);\n}\nasync function getSignInResult(params) {\n    const { challengeName, challengeParameters, availableChallenges } = params;\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    switch (challengeName) {\n        case 'CUSTOM_CHALLENGE':\n            return {\n                isSignedIn: false,\n                nextStep: {\n                    signInStep: 'CONFIRM_SIGN_IN_WITH_CUSTOM_CHALLENGE',\n                    additionalInfo: challengeParameters,\n                },\n            };\n        case 'MFA_SETUP': {\n            const { signInSession, username } = signInStore.getState();\n            const mfaSetupTypes = getMFATypes(parseMFATypes(challengeParameters.MFAS_CAN_SETUP)) || [];\n            const allowedMfaSetupTypes = getAllowedMfaSetupTypes(mfaSetupTypes);\n            const isTotpMfaSetupAvailable = allowedMfaSetupTypes.includes('TOTP');\n            const isEmailMfaSetupAvailable = allowedMfaSetupTypes.includes('EMAIL');\n            if (isTotpMfaSetupAvailable && isEmailMfaSetupAvailable) {\n                return {\n                    isSignedIn: false,\n                    nextStep: {\n                        signInStep: 'CONTINUE_SIGN_IN_WITH_MFA_SETUP_SELECTION',\n                        allowedMFATypes: allowedMfaSetupTypes,\n                    },\n                };\n            }\n            if (isEmailMfaSetupAvailable) {\n                return {\n                    isSignedIn: false,\n                    nextStep: {\n                        signInStep: 'CONTINUE_SIGN_IN_WITH_EMAIL_SETUP',\n                    },\n                };\n            }\n            if (isTotpMfaSetupAvailable) {\n                const associateSoftwareToken = createAssociateSoftwareTokenClient({\n                    endpointResolver: createCognitoUserPoolEndpointResolver({\n                        endpointOverride: authConfig.userPoolEndpoint,\n                    }),\n                });\n                const { Session, SecretCode: secretCode } = await associateSoftwareToken({ region: getRegionFromUserPoolId(authConfig.userPoolId) }, {\n                    Session: signInSession,\n                });\n                signInStore.dispatch({\n                    type: 'SET_SIGN_IN_SESSION',\n                    value: Session,\n                });\n                return {\n                    isSignedIn: false,\n                    nextStep: {\n                        signInStep: 'CONTINUE_SIGN_IN_WITH_TOTP_SETUP',\n                        totpSetupDetails: getTOTPSetupDetails(secretCode, username),\n                    },\n                };\n            }\n            throw new AuthError({\n                name: AuthErrorCodes.SignInException,\n                message: `Cannot initiate MFA setup from available types: ${mfaSetupTypes}`,\n            });\n        }\n        case 'NEW_PASSWORD_REQUIRED':\n            return {\n                isSignedIn: false,\n                nextStep: {\n                    signInStep: 'CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED',\n                    missingAttributes: parseAttributes(challengeParameters.requiredAttributes),\n                },\n            };\n        case 'SELECT_MFA_TYPE':\n            return {\n                isSignedIn: false,\n                nextStep: {\n                    signInStep: 'CONTINUE_SIGN_IN_WITH_MFA_SELECTION',\n                    allowedMFATypes: getMFATypes(parseMFATypes(challengeParameters.MFAS_CAN_CHOOSE)),\n                },\n            };\n        case 'SMS_OTP':\n        case 'SMS_MFA':\n            return {\n                isSignedIn: false,\n                nextStep: {\n                    signInStep: 'CONFIRM_SIGN_IN_WITH_SMS_CODE',\n                    codeDeliveryDetails: {\n                        deliveryMedium: challengeParameters.CODE_DELIVERY_DELIVERY_MEDIUM,\n                        destination: challengeParameters.CODE_DELIVERY_DESTINATION,\n                    },\n                },\n            };\n        case 'SOFTWARE_TOKEN_MFA':\n            return {\n                isSignedIn: false,\n                nextStep: {\n                    signInStep: 'CONFIRM_SIGN_IN_WITH_TOTP_CODE',\n                },\n            };\n        case 'EMAIL_OTP':\n            return {\n                isSignedIn: false,\n                nextStep: {\n                    signInStep: 'CONFIRM_SIGN_IN_WITH_EMAIL_CODE',\n                    codeDeliveryDetails: {\n                        deliveryMedium: challengeParameters.CODE_DELIVERY_DELIVERY_MEDIUM,\n                        destination: challengeParameters.CODE_DELIVERY_DESTINATION,\n                    },\n                },\n            };\n        case 'WEB_AUTHN': {\n            const result = await handleWebAuthnSignInResult(challengeParameters);\n            if (isWebAuthnResultAuthSignInOutput(result)) {\n                return result;\n            }\n            return getSignInResult(result);\n        }\n        case 'PASSWORD':\n        case 'PASSWORD_SRP':\n            return {\n                isSignedIn: false,\n                nextStep: {\n                    signInStep: 'CONFIRM_SIGN_IN_WITH_PASSWORD',\n                },\n            };\n        case 'SELECT_CHALLENGE':\n            return {\n                isSignedIn: false,\n                nextStep: {\n                    signInStep: 'CONTINUE_SIGN_IN_WITH_FIRST_FACTOR_SELECTION',\n                    availableChallenges,\n                },\n            };\n    }\n    // TODO: remove this error message for production apps\n    throw new AuthError({\n        name: AuthErrorCodes.SignInException,\n        message: 'An error occurred during the sign in process. ' +\n            `${challengeName} challengeName returned by the underlying service was not addressed.`,\n    });\n}\nfunction getTOTPSetupDetails(secretCode, username) {\n    return {\n        sharedSecret: secretCode,\n        getSetupUri: (appName, accountName) => {\n            const totpUri = `otpauth://totp/${appName}:${accountName ?? username}?secret=${secretCode}&issuer=${appName}`;\n            return new AmplifyUrl(totpUri);\n        },\n    };\n}\nfunction getSignInResultFromError(errorName) {\n    if (errorName === InitiateAuthException.PasswordResetRequiredException) {\n        return {\n            isSignedIn: false,\n            nextStep: { signInStep: 'RESET_PASSWORD' },\n        };\n    }\n    else if (errorName === InitiateAuthException.UserNotConfirmedException) {\n        return {\n            isSignedIn: false,\n            nextStep: { signInStep: 'CONFIRM_SIGN_UP' },\n        };\n    }\n}\nfunction parseAttributes(attributes) {\n    if (!attributes)\n        return [];\n    const parsedAttributes = JSON.parse(attributes).map(att => att.includes(USER_ATTRIBUTES) ? att.replace(USER_ATTRIBUTES, '') : att);\n    return parsedAttributes;\n}\nfunction createAttributes(attributes) {\n    if (!attributes)\n        return {};\n    const newAttributes = {};\n    Object.entries(attributes).forEach(([key, value]) => {\n        if (value)\n            newAttributes[`${USER_ATTRIBUTES}${key}`] = value;\n    });\n    return newAttributes;\n}\nasync function handleChallengeName(username, challengeName, session, challengeResponse, config, tokenOrchestrator, clientMetadata, options) {\n    const userAttributes = options?.userAttributes;\n    const deviceName = options?.friendlyDeviceName;\n    switch (challengeName) {\n        case 'WEB_AUTHN':\n        case 'SELECT_CHALLENGE':\n            if (challengeResponse === 'PASSWORD_SRP' ||\n                challengeResponse === 'PASSWORD') {\n                return {\n                    ChallengeName: challengeResponse,\n                    Session: session,\n                    $metadata: {},\n                };\n            }\n            return initiateSelectedChallenge({\n                username,\n                session,\n                selectedChallenge: challengeResponse,\n                config,\n                clientMetadata,\n            });\n        case 'SELECT_MFA_TYPE':\n            return handleSelectMFATypeChallenge({\n                challengeResponse,\n                clientMetadata,\n                session,\n                username,\n                config,\n            });\n        case 'MFA_SETUP':\n            return handleMFASetupChallenge({\n                challengeResponse,\n                clientMetadata,\n                session,\n                username,\n                deviceName,\n                config,\n            });\n        case 'NEW_PASSWORD_REQUIRED':\n            return handleCompleteNewPasswordChallenge({\n                challengeResponse,\n                clientMetadata,\n                session,\n                username,\n                requiredAttributes: userAttributes,\n                config,\n            });\n        case 'CUSTOM_CHALLENGE':\n            return retryOnResourceNotFoundException(handleCustomChallenge, [\n                {\n                    challengeResponse,\n                    clientMetadata,\n                    session,\n                    username,\n                    config,\n                    tokenOrchestrator,\n                },\n            ], username, tokenOrchestrator);\n        case 'SMS_MFA':\n        case 'SOFTWARE_TOKEN_MFA':\n        case 'SMS_OTP':\n        case 'EMAIL_OTP':\n            return handleMFAChallenge({\n                challengeName,\n                challengeResponse,\n                clientMetadata,\n                session,\n                username,\n                config,\n            });\n        case 'PASSWORD':\n            return handleSelectChallengeWithPassword(username, challengeResponse, clientMetadata, config, session);\n        case 'PASSWORD_SRP':\n            return handleSelectChallengeWithPasswordSRP(username, challengeResponse, // This is the actual password\n            clientMetadata, config, session, tokenOrchestrator);\n    }\n    // TODO: remove this error message for production apps\n    throw new AuthError({\n        name: AuthErrorCodes.SignInException,\n        message: `An error occurred during the sign in process.\n\t\t${challengeName} challengeName returned by the underlying service was not addressed.`,\n    });\n}\nfunction mapMfaType(mfa) {\n    let mfaType = 'SMS_MFA';\n    if (mfa === 'TOTP')\n        mfaType = 'SOFTWARE_TOKEN_MFA';\n    if (mfa === 'EMAIL')\n        mfaType = 'EMAIL_OTP';\n    return mfaType;\n}\nfunction getMFAType(type) {\n    if (type === 'SMS_MFA')\n        return 'SMS';\n    if (type === 'SOFTWARE_TOKEN_MFA')\n        return 'TOTP';\n    if (type === 'EMAIL_OTP')\n        return 'EMAIL';\n    // TODO: log warning for unknown MFA type\n}\nfunction getMFATypes(types) {\n    if (!types)\n        return undefined;\n    return types.map(getMFAType).filter(Boolean);\n}\nfunction parseMFATypes(mfa) {\n    if (!mfa)\n        return [];\n    return JSON.parse(mfa);\n}\nfunction getAllowedMfaSetupTypes(availableMfaSetupTypes) {\n    return availableMfaSetupTypes.filter(authMfaType => authMfaType === 'EMAIL' || authMfaType === 'TOTP');\n}\nasync function assertUserNotAuthenticated() {\n    let authUser;\n    try {\n        authUser = await getCurrentUser();\n    }\n    catch (error) { }\n    if (authUser && authUser.userId && authUser.username) {\n        throw new AuthError({\n            name: USER_ALREADY_AUTHENTICATED_EXCEPTION,\n            message: 'There is already a signed in user.',\n            recoverySuggestion: 'Call signOut before calling signIn again.',\n        });\n    }\n}\nfunction getActiveSignInUsername(username) {\n    const state = signInStore.getState();\n    return state.username ?? username;\n}\nasync function handleMFAChallenge({ challengeName, challengeResponse, clientMetadata, session, username, config, }) {\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    const challengeResponses = {\n        USERNAME: username,\n    };\n    if (challengeName === 'EMAIL_OTP') {\n        challengeResponses.EMAIL_OTP_CODE = challengeResponse;\n    }\n    if (challengeName === 'SMS_MFA') {\n        challengeResponses.SMS_MFA_CODE = challengeResponse;\n    }\n    if (challengeName === 'SMS_OTP') {\n        challengeResponses.SMS_OTP_CODE = challengeResponse;\n    }\n    if (challengeName === 'SOFTWARE_TOKEN_MFA') {\n        challengeResponses.SOFTWARE_TOKEN_MFA_CODE = challengeResponse;\n    }\n    const userContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const jsonReq = {\n        ChallengeName: challengeName,\n        ChallengeResponses: challengeResponses,\n        Session: session,\n        ClientMetadata: clientMetadata,\n        ClientId: userPoolClientId,\n        UserContextData: userContextData,\n    };\n    const respondToAuthChallenge = createRespondToAuthChallengeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    return respondToAuthChallenge({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmSignIn),\n    }, jsonReq);\n}\n\nexport { assertUserNotAuthenticated, createAttributes, getActiveSignInUsername, getAllowedMfaSetupTypes, getMFAType, getMFATypes, getSignInResult, getSignInResultFromError, getTOTPSetupDetails, handleChallengeName, handleCompleteNewPasswordChallenge, handleCustomAuthFlowWithoutSRP, handleCustomChallenge, handleCustomSRPAuthFlow, handleMFAChallenge, handleMFASetupChallenge, handleSelectMFATypeChallenge, handleUserPasswordAuthFlow, handleUserSRPAuthFlow, mapMfaType, parseAttributes, parseMFATypes };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { handleCustomAuthFlowWithoutSRP, getActiveSignInUsername, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { setActiveSignInState, resetActiveSignInState } from '../../../client/utils/store/signInStore.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\nimport { retryOnResourceNotFoundException } from '../utils/retryOnResourceNotFoundException.mjs';\nimport { getNewDeviceMetadata } from '../utils/getNewDeviceMetadata.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in using a custom authentication flow without password\n *\n * @param input -  The SignInWithCustomAuthInput object\n * @returns AuthSignInResult\n * @throws service: {@link InitiateAuthException } - Cognito service errors thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode  } - Validation errors thrown when either username or password\n *  are not defined.\n * @throws SignInWithCustomAuthOutput - Thrown when the token provider config is invalid.\n */\nasync function signInWithCustomAuth(input) {\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const { username, password, options } = input;\n    const signInDetails = {\n        loginId: username,\n        authFlowType: 'CUSTOM_WITHOUT_SRP',\n    };\n    const metadata = options?.clientMetadata;\n    assertValidationError(!!username, AuthValidationErrorCode.EmptySignInUsername);\n    assertValidationError(!password, AuthValidationErrorCode.CustomAuthSignInPassword);\n    try {\n        const { ChallengeName: retriedChallengeName, ChallengeParameters: retiredChallengeParameters, AuthenticationResult, Session, } = await retryOnResourceNotFoundException(handleCustomAuthFlowWithoutSRP, [username, metadata, authConfig, tokenOrchestrator], username, tokenOrchestrator);\n        const activeUsername = getActiveSignInUsername(username);\n        // sets up local state used during the sign-in process\n        setActiveSignInState({\n            signInSession: Session,\n            username: activeUsername,\n            challengeName: retriedChallengeName,\n            signInDetails,\n        });\n        if (AuthenticationResult) {\n            await cacheCognitoTokens({\n                username: activeUsername,\n                ...AuthenticationResult,\n                NewDeviceMetadata: await getNewDeviceMetadata({\n                    userPoolId: authConfig.userPoolId,\n                    userPoolEndpoint: authConfig.userPoolEndpoint,\n                    newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n                    accessToken: AuthenticationResult.AccessToken,\n                }),\n                signInDetails,\n            });\n            resetActiveSignInState();\n            await dispatchSignedInHubEvent();\n            return {\n                isSignedIn: true,\n                nextStep: { signInStep: 'DONE' },\n            };\n        }\n        return getSignInResult({\n            challengeName: retriedChallengeName,\n            challengeParameters: retiredChallengeParameters,\n        });\n    }\n    catch (error) {\n        resetActiveSignInState();\n        assertServiceError(error);\n        const result = getSignInResultFromError(error.name);\n        if (result)\n            return result;\n        throw error;\n    }\n}\n\nexport { signInWithCustomAuth };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { handleCustomSRPAuthFlow, getActiveSignInUsername, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { setActiveSignInState, resetActiveSignInState } from '../../../client/utils/store/signInStore.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\nimport { getNewDeviceMetadata } from '../utils/getNewDeviceMetadata.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in using a custom authentication flow with SRP\n *\n * @param input -  The SignInWithCustomSRPAuthInput object\n * @returns SignInWithCustomSRPAuthOutput\n * @throws service: {@link InitiateAuthException }, {@link RespondToAuthChallengeException } - Cognito\n * service errors thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode  } - Validation errors thrown when either username or password\n *  are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signInWithCustomSRPAuth(input) {\n    const { username, password, options } = input;\n    const signInDetails = {\n        loginId: username,\n        authFlowType: 'CUSTOM_WITH_SRP',\n    };\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const metadata = options?.clientMetadata;\n    assertValidationError(!!username, AuthValidationErrorCode.EmptySignInUsername);\n    assertValidationError(!!password, AuthValidationErrorCode.EmptySignInPassword);\n    try {\n        const { ChallengeName: handledChallengeName, ChallengeParameters: handledChallengeParameters, AuthenticationResult, Session, } = await handleCustomSRPAuthFlow(username, password, metadata, authConfig, tokenOrchestrator);\n        const activeUsername = getActiveSignInUsername(username);\n        // sets up local state used during the sign-in process\n        setActiveSignInState({\n            signInSession: Session,\n            username: activeUsername,\n            challengeName: handledChallengeName,\n            signInDetails,\n        });\n        if (AuthenticationResult) {\n            await cacheCognitoTokens({\n                username: activeUsername,\n                ...AuthenticationResult,\n                NewDeviceMetadata: await getNewDeviceMetadata({\n                    userPoolId: authConfig.userPoolId,\n                    userPoolEndpoint: authConfig.userPoolEndpoint,\n                    newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n                    accessToken: AuthenticationResult.AccessToken,\n                }),\n                signInDetails,\n            });\n            resetActiveSignInState();\n            await dispatchSignedInHubEvent();\n            return {\n                isSignedIn: true,\n                nextStep: { signInStep: 'DONE' },\n            };\n        }\n        return getSignInResult({\n            challengeName: handledChallengeName,\n            challengeParameters: handledChallengeParameters,\n        });\n    }\n    catch (error) {\n        resetActiveSignInState();\n        assertServiceError(error);\n        const result = getSignInResultFromError(error.name);\n        if (result)\n            return result;\n        throw error;\n    }\n}\n\nexport { signInWithCustomSRPAuth };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { handleUserSRPAuthFlow, getActiveSignInUsername, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { setActiveSignInState, resetActiveSignInState } from '../../../client/utils/store/signInStore.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\nimport { getNewDeviceMetadata } from '../utils/getNewDeviceMetadata.mjs';\nimport { resetAutoSignIn } from './autoSignIn.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in\n *\n * @param input - The SignInWithSRPInput object\n * @returns SignInWithSRPOutput\n * @throws service: {@link InitiateAuthException }, {@link RespondToAuthChallengeException } - Cognito service errors\n * thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode  } - Validation errors thrown when either username or password\n *  are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signInWithSRP(input) {\n    const { username, password } = input;\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    const signInDetails = {\n        loginId: username,\n        authFlowType: 'USER_SRP_AUTH',\n    };\n    assertTokenProviderConfig(authConfig);\n    const clientMetaData = input.options?.clientMetadata;\n    assertValidationError(!!username, AuthValidationErrorCode.EmptySignInUsername);\n    assertValidationError(!!password, AuthValidationErrorCode.EmptySignInPassword);\n    try {\n        const { ChallengeName: handledChallengeName, ChallengeParameters: handledChallengeParameters, AuthenticationResult, Session, } = await handleUserSRPAuthFlow(username, password, clientMetaData, authConfig, tokenOrchestrator);\n        const activeUsername = getActiveSignInUsername(username);\n        // sets up local state used during the sign-in process\n        setActiveSignInState({\n            signInSession: Session,\n            username: activeUsername,\n            challengeName: handledChallengeName,\n            signInDetails,\n        });\n        if (AuthenticationResult) {\n            await cacheCognitoTokens({\n                username: activeUsername,\n                ...AuthenticationResult,\n                NewDeviceMetadata: await getNewDeviceMetadata({\n                    userPoolId: authConfig.userPoolId,\n                    userPoolEndpoint: authConfig.userPoolEndpoint,\n                    newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n                    accessToken: AuthenticationResult.AccessToken,\n                }),\n                signInDetails,\n            });\n            resetActiveSignInState();\n            await dispatchSignedInHubEvent();\n            resetAutoSignIn();\n            return {\n                isSignedIn: true,\n                nextStep: { signInStep: 'DONE' },\n            };\n        }\n        return getSignInResult({\n            challengeName: handledChallengeName,\n            challengeParameters: handledChallengeParameters,\n        });\n    }\n    catch (error) {\n        resetActiveSignInState();\n        resetAutoSignIn();\n        assertServiceError(error);\n        const result = getSignInResultFromError(error.name);\n        if (result)\n            return result;\n        throw error;\n    }\n}\n\nexport { signInWithSRP };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertServiceError } from '../../../errors/utils/assertServiceError.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { handleUserPasswordAuthFlow, getActiveSignInUsername, getSignInResult, getSignInResultFromError } from '../utils/signInHelpers.mjs';\nimport { setActiveSignInState, resetActiveSignInState } from '../../../client/utils/store/signInStore.mjs';\nimport { cacheCognitoTokens } from '../tokenProvider/cacheTokens.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport '../utils/types.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { dispatchSignedInHubEvent } from '../utils/dispatchSignedInHubEvent.mjs';\nimport { retryOnResourceNotFoundException } from '../utils/retryOnResourceNotFoundException.mjs';\nimport { getNewDeviceMetadata } from '../utils/getNewDeviceMetadata.mjs';\nimport { resetAutoSignIn } from './autoSignIn.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in using USER_PASSWORD_AUTH AuthFlowType\n *\n * @param input - The SignInWithUserPasswordInput object\n * @returns SignInWithUserPasswordOutput\n * @throws service: {@link InitiateAuthException } - Cognito service error thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode  } - Validation errors thrown when either username or password\n *  are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signInWithUserPassword(input) {\n    const { username, password, options } = input;\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    const signInDetails = {\n        loginId: username,\n        authFlowType: 'USER_PASSWORD_AUTH',\n    };\n    assertTokenProviderConfig(authConfig);\n    const metadata = options?.clientMetadata;\n    assertValidationError(!!username, AuthValidationErrorCode.EmptySignInUsername);\n    assertValidationError(!!password, AuthValidationErrorCode.EmptySignInPassword);\n    try {\n        const { ChallengeName: retiredChallengeName, ChallengeParameters: retriedChallengeParameters, AuthenticationResult, Session, } = await retryOnResourceNotFoundException(handleUserPasswordAuthFlow, [username, password, metadata, authConfig, tokenOrchestrator], username, tokenOrchestrator);\n        const activeUsername = getActiveSignInUsername(username);\n        // sets up local state used during the sign-in process\n        setActiveSignInState({\n            signInSession: Session,\n            username: activeUsername,\n            challengeName: retiredChallengeName,\n            signInDetails,\n        });\n        if (AuthenticationResult) {\n            await cacheCognitoTokens({\n                ...AuthenticationResult,\n                username: activeUsername,\n                NewDeviceMetadata: await getNewDeviceMetadata({\n                    userPoolId: authConfig.userPoolId,\n                    userPoolEndpoint: authConfig.userPoolEndpoint,\n                    newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n                    accessToken: AuthenticationResult.AccessToken,\n                }),\n                signInDetails,\n            });\n            resetActiveSignInState();\n            await dispatchSignedInHubEvent();\n            resetAutoSignIn();\n            return {\n                isSignedIn: true,\n                nextStep: { signInStep: 'DONE' },\n            };\n        }\n        return getSignInResult({\n            challengeName: retiredChallengeName,\n            challengeParameters: retriedChallengeParameters,\n        });\n    }\n    catch (error) {\n        resetActiveSignInState();\n        resetAutoSignIn();\n        assertServiceError(error);\n        const result = getSignInResultFromError(error.name);\n        if (result)\n            return result;\n        throw error;\n    }\n}\n\nexport { signInWithUserPassword };\n","import { assertUserNotAuthenticated } from '../utils/signInHelpers.mjs';\nimport { signInWithCustomAuth } from './signInWithCustomAuth.mjs';\nimport { signInWithCustomSRPAuth } from './signInWithCustomSRPAuth.mjs';\nimport { signInWithSRP } from './signInWithSRP.mjs';\nimport { signInWithUserPassword } from './signInWithUserPassword.mjs';\nimport { signInWithUserAuth } from './signInWithUserAuth.mjs';\nimport { resetAutoSignIn } from './autoSignIn.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Signs a user in\n *\n * @param input -  The SignInInput object\n * @returns SignInOutput\n * @throws service: {@link InitiateAuthException }, {@link RespondToAuthChallengeException }\n *  - Cognito service errors thrown during the sign-in process.\n * @throws validation: {@link AuthValidationErrorCode  } - Validation errors thrown when either username or password\n *  are not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signIn(input) {\n    // Here we want to reset the store but not reassign the callback.\n    // The callback is reset when the underlying promise resolves or rejects.\n    // With the advent of session based sign in, this guarantees that the signIn API initiates a new auth flow,\n    // regardless of whether it is called for a user currently engaged in an active auto sign in session.\n    resetAutoSignIn(false);\n    const authFlowType = input.options?.authFlowType;\n    await assertUserNotAuthenticated();\n    switch (authFlowType) {\n        case 'USER_SRP_AUTH':\n            return signInWithSRP(input);\n        case 'USER_PASSWORD_AUTH':\n            return signInWithUserPassword(input);\n        case 'CUSTOM_WITHOUT_SRP':\n            return signInWithCustomAuth(input);\n        case 'CUSTOM_WITH_SRP':\n            return signInWithCustomSRPAuth(input);\n        case 'USER_AUTH':\n            return signInWithUserAuth(input);\n        default:\n            return signInWithSRP(input);\n    }\n}\n\nexport { signIn };\n","import { AuthError } from '../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * It will retry the function if the error is a `ResourceNotFoundException` and\n * will clean the device keys stored in the storage mechanism.\n *\n */\nasync function retryOnResourceNotFoundException(func, args, username, tokenOrchestrator) {\n    try {\n        return await func(...args);\n    }\n    catch (error) {\n        if (error instanceof AuthError &&\n            error.name === 'ResourceNotFoundException' &&\n            error.message.includes('Device does not exist.')) {\n            await tokenOrchestrator.clearDeviceMetadata(username);\n            return func(...args);\n        }\n        throw error;\n    }\n}\n\nexport { retryOnResourceNotFoundException };\n","import { assertTokenProviderConfig } from '@aws-amplify/core/internals/utils';\nimport { assertAuthTokens } from '../../utils/types.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getCurrentUser = async (amplify) => {\n    const authConfig = amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const tokens = await amplify.Auth.getTokens({ forceRefresh: false });\n    assertAuthTokens(tokens);\n    const { 'cognito:username': username, sub } = tokens.idToken?.payload ?? {};\n    const authUser = {\n        username: username,\n        userId: sub,\n    };\n    const signInDetails = getSignInDetailsFromTokens(tokens);\n    if (signInDetails) {\n        authUser.signInDetails = signInDetails;\n    }\n    return authUser;\n};\nfunction getSignInDetailsFromTokens(tokens) {\n    return tokens?.signInDetails;\n}\n\nexport { getCurrentUser };\n","import { Amplify } from '@aws-amplify/core';\nimport { getCurrentUser as getCurrentUser$1 } from './internal/getCurrentUser.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Gets the current user from the idToken.\n *\n * @param input -  The GetCurrentUserInput object.\n * @returns GetCurrentUserOutput\n * @throws - {@link InitiateAuthException} - Thrown when the service fails to refresh the tokens.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nconst getCurrentUser = async () => {\n    return getCurrentUser$1(Amplify);\n};\n\nexport { getCurrentUser };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createUserPoolSerializer = (operation) => (input, endpoint) => {\n    const headers = getSharedHeaders(operation);\n    const body = JSON.stringify(input);\n    return buildHttpRpcRequest(endpoint, headers, body);\n};\nconst getSharedHeaders = (operation) => ({\n    'content-type': 'application/x-amz-json-1.1',\n    'x-amz-target': `AWSCognitoIdentityProviderService.${operation}`,\n});\nconst buildHttpRpcRequest = ({ url }, headers, body) => ({\n    headers,\n    url,\n    body,\n    method: 'POST',\n});\n\nexport { createUserPoolSerializer };\n","import { Hub } from '@aws-amplify/core';\nimport { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport { getCurrentUser } from '../apis/getCurrentUser.mjs';\nimport { USER_UNAUTHENTICATED_EXCEPTION, UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION } from '../../../errors/constants.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst ERROR_MESSAGE = 'Unable to get user session following successful sign-in.';\nconst dispatchSignedInHubEvent = async () => {\n    try {\n        Hub.dispatch('auth', {\n            event: 'signedIn',\n            data: await getCurrentUser(),\n        }, 'Auth', AMPLIFY_SYMBOL);\n    }\n    catch (error) {\n        if (error.name === USER_UNAUTHENTICATED_EXCEPTION) {\n            throw new AuthError({\n                name: UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION,\n                message: ERROR_MESSAGE,\n                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.',\n            });\n        }\n        throw error;\n    }\n};\n\nexport { ERROR_MESSAGE, dispatchSignedInHubEvent };\n","import { decodeJWT, AmplifyError } from '@aws-amplify/core/internals/utils';\nimport { tokenOrchestrator } from './tokenProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nasync function cacheCognitoTokens(AuthenticationResult) {\n    if (AuthenticationResult.AccessToken) {\n        const accessToken = decodeJWT(AuthenticationResult.AccessToken);\n        const accessTokenIssuedAtInMillis = (accessToken.payload.iat || 0) * 1000;\n        const currentTime = new Date().getTime();\n        const clockDrift = accessTokenIssuedAtInMillis > 0\n            ? accessTokenIssuedAtInMillis - currentTime\n            : 0;\n        let idToken;\n        let refreshToken;\n        let deviceMetadata;\n        if (AuthenticationResult.RefreshToken) {\n            refreshToken = AuthenticationResult.RefreshToken;\n        }\n        if (AuthenticationResult.IdToken) {\n            idToken = decodeJWT(AuthenticationResult.IdToken);\n        }\n        if (AuthenticationResult?.NewDeviceMetadata) {\n            deviceMetadata = AuthenticationResult.NewDeviceMetadata;\n        }\n        const tokens = {\n            accessToken,\n            idToken,\n            refreshToken,\n            clockDrift,\n            deviceMetadata,\n            username: AuthenticationResult.username,\n        };\n        if (AuthenticationResult?.signInDetails) {\n            tokens.signInDetails = AuthenticationResult.signInDetails;\n        }\n        await tokenOrchestrator.setTokens({\n            tokens,\n        });\n    }\n    else {\n        // This would be a service error\n        throw new AmplifyError({\n            message: 'Invalid tokens',\n            name: 'InvalidTokens',\n            recoverySuggestion: 'Check Cognito UserPool settings',\n        });\n    }\n}\n\nexport { cacheCognitoTokens };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createInitiateAuthClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('InitiateAuth'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createInitiateAuthClient };\n","import { HEX_TO_SHORT } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Converts a hexadecimal encoded string to a Uint8Array of bytes.\n *\n * @param encoded The hexadecimal encoded string\n */\nconst getBytesFromHex = (encoded) => {\n    if (encoded.length % 2 !== 0) {\n        throw new Error('Hex encoded strings must have an even number length');\n    }\n    const out = new Uint8Array(encoded.length / 2);\n    for (let i = 0; i < encoded.length; i += 2) {\n        const encodedByte = encoded.slice(i, i + 2).toLowerCase();\n        if (encodedByte in HEX_TO_SHORT) {\n            out[i / 2] = HEX_TO_SHORT[encodedByte];\n        }\n        else {\n            throw new Error(`Cannot decode unrecognized sequence ${encodedByte} as hexadecimal`);\n        }\n    }\n    return out;\n};\n\nexport { getBytesFromHex };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * The service name used to sign requests if the API requires authentication.\n */\nconst COGNITO_IDP_SERVICE_NAME = 'cognito-idp';\n\nexport { COGNITO_IDP_SERVICE_NAME };\n","import { clearCredentials, Hub } from '@aws-amplify/core';\nimport { AMPLIFY_SYMBOL } from '@aws-amplify/core/internals/utils';\nimport '../refreshAuthTokens.mjs';\nimport '../../tokenProvider/errorHelpers.mjs';\nimport '../types.mjs';\nimport { tokenOrchestrator } from '../../tokenProvider/tokenProvider.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst completeOAuthSignOut = async (store) => {\n    await store.clearOAuthData();\n    tokenOrchestrator.clearTokens();\n    await clearCredentials();\n    Hub.dispatch('auth', { event: 'signedOut' }, 'Auth', AMPLIFY_SYMBOL);\n};\n\nexport { completeOAuthSignOut };\n","import { assertOAuthConfig } from '@aws-amplify/core/internals/utils';\nimport { openAuthSession } from '../../../../utils/openAuthSession.mjs';\nimport { getRedirectUrl } from './getRedirectUrl.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst oAuthSignOutRedirect = async (authConfig, preferPrivateSession = false, redirectUrl) => {\n    assertOAuthConfig(authConfig);\n    const { loginWith, userPoolClientId } = authConfig;\n    const { domain, redirectSignOut } = loginWith.oauth;\n    const signoutUri = getRedirectUrl(redirectSignOut, redirectUrl);\n    const oAuthLogoutEndpoint = `https://${domain}/logout?${Object.entries({\n        client_id: userPoolClientId,\n        logout_uri: encodeURIComponent(signoutUri),\n    })\n        .map(([k, v]) => `${k}=${v}`)\n        .join('&')}`;\n    return openAuthSession(oAuthLogoutEndpoint);\n};\n\nexport { oAuthSignOutRedirect };\n","import { completeOAuthSignOut } from './completeOAuthSignOut.mjs';\nimport { oAuthSignOutRedirect } from './oAuthSignOutRedirect.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst handleOAuthSignOut = async (cognitoConfig, store, tokenOrchestrator, redirectUrl) => {\n    const { isOAuthSignIn } = await store.loadOAuthSignIn();\n    const oauthMetadata = await tokenOrchestrator.getOAuthMetadata();\n    // Clear everything before attempting to visted logout endpoint since the current application\n    // state could be wiped away on redirect\n    await completeOAuthSignOut(store);\n    // The isOAuthSignIn flag is propagated by the oAuthToken store which manages oauth keys in local storage only.\n    // These keys are used to determine if a user is in an inflight or signedIn oauth states.\n    // However, this behavior represents an issue when 2 apps share the same set of tokens in Cookie storage because the app that didn't\n    // start the OAuth will not have access to the oauth keys.\n    // A heuristic solution is to add oauth metadata to the tokenOrchestrator which will have access to the underlying\n    // storage mechanism that is used by Amplify.\n    if (isOAuthSignIn || oauthMetadata?.oauthSignIn) {\n        // On web, this will always end up being a void action\n        return oAuthSignOutRedirect(cognitoConfig, false, redirectUrl);\n    }\n};\n\nexport { handleOAuthSignOut };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createRevokeTokenClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('RevokeToken'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createRevokeTokenClient };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createGlobalSignOutClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('GlobalSignOut'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createGlobalSignOutClient };\n","import { ConsoleLogger, Amplify, clearCredentials, Hub, defaultStorage } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, assertOAuthConfig, AMPLIFY_SYMBOL, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport '../utils/refreshAuthTokens.mjs';\nimport { AuthError } from '../../../errors/AuthError.mjs';\nimport '../tokenProvider/errorHelpers.mjs';\nimport { DefaultOAuthStore } from '../utils/signInWithRedirectStore.mjs';\nimport { tokenOrchestrator } from '../tokenProvider/tokenProvider.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { assertAuthTokens, assertAuthTokensWithRefreshToken } from '../utils/types.mjs';\nimport '@aws-crypto/sha256-js';\nimport { handleOAuthSignOut } from '../utils/oauth/handleOAuthSignOut.mjs';\nimport { OAUTH_SIGNOUT_EXCEPTION } from '../../../errors/constants.mjs';\nimport '../../../Errors.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../types/Auth.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport { createRevokeTokenClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createRevokeTokenClient.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../types/errors.mjs';\nimport { createGlobalSignOutClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createGlobalSignOutClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('Auth');\n/**\n * Signs a user out\n *\n * @param input - The SignOutInput object\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function signOut(input) {\n    const cognitoConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(cognitoConfig);\n    if (input?.global) {\n        await globalSignOut(cognitoConfig);\n    }\n    else {\n        await clientSignOut(cognitoConfig);\n    }\n    let hasOAuthConfig;\n    try {\n        assertOAuthConfig(cognitoConfig);\n        hasOAuthConfig = true;\n    }\n    catch (err) {\n        hasOAuthConfig = false;\n    }\n    if (hasOAuthConfig) {\n        const oAuthStore = new DefaultOAuthStore(defaultStorage);\n        oAuthStore.setAuthConfig(cognitoConfig);\n        const { type } = (await handleOAuthSignOut(cognitoConfig, oAuthStore, tokenOrchestrator, input?.oauth?.redirectUrl)) ?? {};\n        if (type === 'error') {\n            throw new AuthError({\n                name: OAUTH_SIGNOUT_EXCEPTION,\n                message: `An error occurred when attempting to log out from OAuth provider.`,\n            });\n        }\n    }\n    else {\n        // complete sign out\n        tokenOrchestrator.clearTokens();\n        await clearCredentials();\n        Hub.dispatch('auth', { event: 'signedOut' }, 'Auth', AMPLIFY_SYMBOL);\n    }\n}\nasync function clientSignOut(cognitoConfig) {\n    try {\n        const { userPoolEndpoint, userPoolId, userPoolClientId } = cognitoConfig;\n        const authTokens = await tokenOrchestrator.getTokenStore().loadTokens();\n        assertAuthTokensWithRefreshToken(authTokens);\n        if (isSessionRevocable(authTokens.accessToken)) {\n            const revokeToken = createRevokeTokenClient({\n                endpointResolver: createCognitoUserPoolEndpointResolver({\n                    endpointOverride: userPoolEndpoint,\n                }),\n            });\n            await revokeToken({\n                region: getRegionFromUserPoolId(userPoolId),\n                userAgentValue: getAuthUserAgentValue(AuthAction.SignOut),\n            }, {\n                ClientId: userPoolClientId,\n                Token: authTokens.refreshToken,\n            });\n        }\n    }\n    catch (err) {\n        // this shouldn't throw\n        logger.debug('Client signOut error caught but will proceed with token removal');\n    }\n}\nasync function globalSignOut(cognitoConfig) {\n    try {\n        const { userPoolEndpoint, userPoolId } = cognitoConfig;\n        const authTokens = await tokenOrchestrator.getTokenStore().loadTokens();\n        assertAuthTokens(authTokens);\n        const globalSignOutClient = createGlobalSignOutClient({\n            endpointResolver: createCognitoUserPoolEndpointResolver({\n                endpointOverride: userPoolEndpoint,\n            }),\n        });\n        await globalSignOutClient({\n            region: getRegionFromUserPoolId(userPoolId),\n            userAgentValue: getAuthUserAgentValue(AuthAction.SignOut),\n        }, {\n            AccessToken: authTokens.accessToken.toString(),\n        });\n    }\n    catch (err) {\n        // it should not throw\n        logger.debug('Global signOut error caught but will proceed with token removal');\n    }\n}\nconst isSessionRevocable = (token) => !!token?.payload?.origin_jti;\n\nexport { signOut };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createConfirmDeviceClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('ConfirmDevice'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createConfirmDeviceClient };\n","import { base64Encoder, getDeviceName } from '@aws-amplify/core/internals/utils';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../types/errors.mjs';\nimport { createConfirmDeviceClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmDeviceClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthenticationHelper } from './srp/getAuthenticationHelper.mjs';\nimport { getBytesFromHex } from './srp/getBytesFromHex.mjs';\nimport '@aws-crypto/sha256-js';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * This function is used to kick off the device management flow.\n *\n * If an error is thrown while generating a hash device or calling the `ConfirmDevice`\n * client, then this API will ignore the error and return undefined. Otherwise the authentication\n * flow will not complete and the user won't be able to be signed in.\n *\n * @returns DeviceMetadata | undefined\n */\nasync function getNewDeviceMetadata({ userPoolId, userPoolEndpoint, newDeviceMetadata, accessToken, }) {\n    if (!newDeviceMetadata)\n        return undefined;\n    const userPoolName = userPoolId.split('_')[1] || '';\n    const authenticationHelper = await getAuthenticationHelper(userPoolName);\n    const deviceKey = newDeviceMetadata?.DeviceKey;\n    const deviceGroupKey = newDeviceMetadata?.DeviceGroupKey;\n    try {\n        await authenticationHelper.generateHashDevice(deviceGroupKey ?? '', deviceKey ?? '');\n    }\n    catch (errGenHash) {\n        // TODO: log error here\n        return undefined;\n    }\n    const deviceSecretVerifierConfig = {\n        Salt: base64Encoder.convert(getBytesFromHex(authenticationHelper.getSaltToHashDevices())),\n        PasswordVerifier: base64Encoder.convert(getBytesFromHex(authenticationHelper.getVerifierDevices())),\n    };\n    const randomPassword = authenticationHelper.getRandomPassword();\n    try {\n        const confirmDevice = createConfirmDeviceClient({\n            endpointResolver: createCognitoUserPoolEndpointResolver({\n                endpointOverride: userPoolEndpoint,\n            }),\n        });\n        await confirmDevice({ region: getRegionFromUserPoolId(userPoolId) }, {\n            AccessToken: accessToken,\n            DeviceName: await getDeviceName(),\n            DeviceKey: newDeviceMetadata?.DeviceKey,\n            DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n        });\n        return {\n            deviceKey,\n            deviceGroupKey,\n            randomPassword,\n        };\n    }\n    catch (error) {\n        // TODO: log error here\n        return undefined;\n    }\n}\n\nexport { getNewDeviceMetadata };\n","import { AuthAction } from '@aws-amplify/core/internals/utils';\nimport { getUserContextData } from '../../../providers/cognito/utils/userContextData.mjs';\nimport { getAuthenticationHelper } from '../../../providers/cognito/utils/srp/getAuthenticationHelper.mjs';\nimport '../../../providers/cognito/utils/srp/constants.mjs';\nimport '@aws-crypto/sha256-js';\nimport { createInitiateAuthClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '../../../providers/cognito/types/errors.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../../../providers/cognito/factories/createCognitoUserPoolEndpointResolver.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { handlePasswordVerifierChallenge } from '../../../providers/cognito/utils/handlePasswordVerifierChallenge.mjs';\nimport { retryOnResourceNotFoundException } from '../../../providers/cognito/utils/retryOnResourceNotFoundException.mjs';\nimport { setActiveSignInUsername } from '../../../providers/cognito/utils/setActiveSignInUsername.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Handles the Password SRP (Secure Remote Password) authentication flow.\n * This function can be used with both USER_SRP_AUTH and USER_AUTH flows.\n *\n * @param {Object} params - The parameters for the Password SRP authentication\n * @param {string} params.username - The username for authentication\n * @param {string} params.password - The user's password\n * @param {ClientMetadata} [params.clientMetadata] - Optional metadata to be sent with auth requests\n * @param {CognitoUserPoolConfig} params.config - Cognito User Pool configuration\n * @param {AuthTokenOrchestrator} params.tokenOrchestrator - Token orchestrator for managing auth tokens\n * @param {AuthFlowType} params.authFlow - The type of authentication flow ('USER_SRP_AUTH' or 'USER_AUTH')\n * @param {AuthFactorType} [params.preferredChallenge] - Optional preferred challenge type when using USER_AUTH flow\n *\n * @returns {Promise<RespondToAuthChallengeCommandOutput>} The authentication response\n */\nasync function handlePasswordSRP({ username, password, clientMetadata, config, tokenOrchestrator, authFlow, preferredChallenge, }) {\n    const { userPoolId, userPoolClientId, userPoolEndpoint } = config;\n    const userPoolName = userPoolId?.split('_')[1] || '';\n    const authenticationHelper = await getAuthenticationHelper(userPoolName);\n    const authParameters = {\n        USERNAME: username,\n        SRP_A: authenticationHelper.A.toString(16),\n    };\n    if (authFlow === 'USER_AUTH' && preferredChallenge) {\n        authParameters.PREFERRED_CHALLENGE = preferredChallenge;\n    }\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const jsonReq = {\n        AuthFlow: authFlow,\n        AuthParameters: authParameters,\n        ClientMetadata: clientMetadata,\n        ClientId: userPoolClientId,\n        UserContextData,\n    };\n    const initiateAuth = createInitiateAuthClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const resp = await initiateAuth({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.SignIn),\n    }, jsonReq);\n    const { ChallengeParameters: challengeParameters, Session: session } = resp;\n    const activeUsername = challengeParameters?.USERNAME ?? username;\n    setActiveSignInUsername(activeUsername);\n    if (resp.ChallengeName === 'PASSWORD_VERIFIER') {\n        return retryOnResourceNotFoundException(handlePasswordVerifierChallenge, [\n            password,\n            challengeParameters,\n            clientMetadata,\n            session,\n            authenticationHelper,\n            config,\n            tokenOrchestrator,\n        ], activeUsername, tokenOrchestrator);\n    }\n    return resp;\n}\n\nexport { handlePasswordSRP };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst INIT_N = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' +\n    '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' +\n    'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' +\n    'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' +\n    'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' +\n    'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' +\n    '83655D23DCA3AD961C62F356208552BB9ED529077096966D' +\n    '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' +\n    'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' +\n    'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' +\n    '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' +\n    'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' +\n    'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' +\n    'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' +\n    'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' +\n    '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';\nconst SHORT_TO_HEX = {};\nconst HEX_TO_SHORT = {};\nfor (let i = 0; i < 256; i++) {\n    let encodedByte = i.toString(16).toLowerCase();\n    if (encodedByte.length === 1) {\n        encodedByte = `0${encodedByte}`;\n    }\n    SHORT_TO_HEX[i] = encodedByte;\n    HEX_TO_SHORT[encodedByte] = i;\n}\n\nexport { HEX_TO_SHORT, INIT_N, SHORT_TO_HEX };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createForgotPasswordClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('ForgotPassword'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createForgotPasswordClient };\n","import { Amplify } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport { getUserContextData } from '../utils/userContextData.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../types/errors.mjs';\nimport { createForgotPasswordClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createForgotPasswordClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Resets a user's password.\n *\n * @param input -  The ResetPasswordInput object.\n * @returns ResetPasswordOutput\n * @throws -{@link ForgotPasswordException }\n * Thrown due to an invalid confirmation code or password.\n * @throws -{@link AuthValidationErrorCode }\n * Thrown due to an empty username.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n **/\nasync function resetPassword(input) {\n    const { username } = input;\n    assertValidationError(!!username, AuthValidationErrorCode.EmptyResetPasswordUsername);\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const { userPoolClientId, userPoolId, userPoolEndpoint } = authConfig;\n    const clientMetadata = input.options?.clientMetadata;\n    const UserContextData = getUserContextData({\n        username,\n        userPoolId,\n        userPoolClientId,\n    });\n    const forgotPassword = createForgotPasswordClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    const res = await forgotPassword({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ResetPassword),\n    }, {\n        Username: username,\n        ClientMetadata: clientMetadata,\n        ClientId: userPoolClientId,\n        UserContextData,\n    });\n    const codeDeliveryDetails = res.CodeDeliveryDetails;\n    return {\n        isPasswordReset: false,\n        nextStep: {\n            resetPasswordStep: 'CONFIRM_RESET_PASSWORD_WITH_CODE',\n            codeDeliveryDetails: {\n                deliveryMedium: codeDeliveryDetails?.DeliveryMedium,\n                destination: codeDeliveryDetails?.Destination,\n                attributeName: codeDeliveryDetails?.AttributeName,\n            },\n        },\n    };\n}\n\nexport { resetPassword };\n","import { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { cognitoUserPoolTransferHandler } from './shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport { createUserPoolSerializer } from './shared/serde/createUserPoolSerializer.mjs';\nimport { createUserPoolDeserializer } from './shared/serde/createUserPoolDeserializer.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '@aws-amplify/core/internals/utils';\nimport { DEFAULT_SERVICE_CLIENT_API_CONFIG } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createVerifyUserAttributeClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('VerifyUserAttribute'), createUserPoolDeserializer(), {\n    ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n    ...config,\n});\n\nexport { createVerifyUserAttributeClient };\n","import { Amplify, fetchAuthSession } from '@aws-amplify/core';\nimport { assertTokenProviderConfig, AuthAction } from '@aws-amplify/core/internals/utils';\nimport { AuthValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { getRegionFromUserPoolId } from '../../../foundation/parsers/regionParsers.mjs';\nimport { assertAuthTokens } from '../utils/types.mjs';\nimport { getAuthUserAgentValue } from '../../../utils/getAuthUserAgentValue.mjs';\nimport '@aws-amplify/core/internals/aws-client-utils/composers';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/shared/handler/cognitoUserPoolTransferHandler.mjs';\nimport '../../../foundation/factories/serviceClients/cognitoIdentityProvider/constants.mjs';\nimport '../../../common/AuthErrorStrings.mjs';\nimport '../types/errors.mjs';\nimport { createVerifyUserAttributeClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createVerifyUserAttributeClient.mjs';\nimport { createCognitoUserPoolEndpointResolver } from '../factories/createCognitoUserPoolEndpointResolver.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Confirms a user attribute with the confirmation code.\n *\n * @param input -  The ConfirmUserAttributeInput object\n * @throws  -{@link AuthValidationErrorCode } -\n * Thrown when `confirmationCode` is not defined.\n * @throws  -{@link VerifyUserAttributeException } - Thrown due to an invalid confirmation code or attribute.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmUserAttribute(input) {\n    const authConfig = Amplify.getConfig().Auth?.Cognito;\n    assertTokenProviderConfig(authConfig);\n    const { userPoolEndpoint, userPoolId } = authConfig;\n    const { confirmationCode, userAttributeKey } = input;\n    assertValidationError(!!confirmationCode, AuthValidationErrorCode.EmptyConfirmUserAttributeCode);\n    const { tokens } = await fetchAuthSession({ forceRefresh: false });\n    assertAuthTokens(tokens);\n    const verifyUserAttribute = createVerifyUserAttributeClient({\n        endpointResolver: createCognitoUserPoolEndpointResolver({\n            endpointOverride: userPoolEndpoint,\n        }),\n    });\n    await verifyUserAttribute({\n        region: getRegionFromUserPoolId(userPoolId),\n        userAgentValue: getAuthUserAgentValue(AuthAction.ConfirmUserAttribute),\n    }, {\n        AccessToken: tokens.accessToken.toString(),\n        AttributeName: userAttributeKey,\n        Code: confirmationCode,\n    });\n}\n\nexport { confirmUserAttribute };\n","import { AuthError } from './AuthError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst USER_UNAUTHENTICATED_EXCEPTION = 'UserUnAuthenticatedException';\nconst USER_ALREADY_AUTHENTICATED_EXCEPTION = 'UserAlreadyAuthenticatedException';\nconst DEVICE_METADATA_NOT_FOUND_EXCEPTION = 'DeviceMetadataNotFoundException';\nconst AUTO_SIGN_IN_EXCEPTION = 'AutoSignInException';\nconst INVALID_REDIRECT_EXCEPTION = 'InvalidRedirectException';\nconst INVALID_APP_SCHEME_EXCEPTION = 'InvalidAppSchemeException';\nconst INVALID_PREFERRED_REDIRECT_EXCEPTION = 'InvalidPreferredRedirectUrlException';\nconst invalidRedirectException = new AuthError({\n    name: INVALID_REDIRECT_EXCEPTION,\n    message: 'signInRedirect or signOutRedirect had an invalid format or was not found.',\n    recoverySuggestion: 'Please make sure the signIn/Out redirect in your oauth config is valid.',\n});\nconst invalidAppSchemeException = new AuthError({\n    name: INVALID_APP_SCHEME_EXCEPTION,\n    message: 'A valid non-http app scheme was not found in the config.',\n    recoverySuggestion: 'Please make sure a valid custom app scheme is present in the config.',\n});\nconst invalidPreferredRedirectUrlException = new AuthError({\n    name: INVALID_PREFERRED_REDIRECT_EXCEPTION,\n    message: 'The given preferredRedirectUrl does not match any items in the redirectSignOutUrls array from the config.',\n    recoverySuggestion: 'Please make sure a matching preferredRedirectUrl is provided.',\n});\nconst INVALID_ORIGIN_EXCEPTION = 'InvalidOriginException';\nconst invalidOriginException = new AuthError({\n    name: INVALID_ORIGIN_EXCEPTION,\n    message: 'redirect is coming from a different origin. The oauth flow needs to be initiated from the same origin',\n    recoverySuggestion: 'Please call signInWithRedirect from the same origin.',\n});\nconst OAUTH_SIGNOUT_EXCEPTION = 'OAuthSignOutException';\nconst TOKEN_REFRESH_EXCEPTION = 'TokenRefreshException';\nconst UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION = 'UnexpectedSignInInterruptionException';\n\nexport { AUTO_SIGN_IN_EXCEPTION, DEVICE_METADATA_NOT_FOUND_EXCEPTION, INVALID_APP_SCHEME_EXCEPTION, INVALID_ORIGIN_EXCEPTION, INVALID_PREFERRED_REDIRECT_EXCEPTION, INVALID_REDIRECT_EXCEPTION, OAUTH_SIGNOUT_EXCEPTION, TOKEN_REFRESH_EXCEPTION, UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION, USER_ALREADY_AUTHENTICATED_EXCEPTION, USER_UNAUTHENTICATED_EXCEPTION, invalidAppSchemeException, invalidOriginException, invalidPreferredRedirectUrlException, invalidRedirectException };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nconst calculateS = async ({ a, g, k, x, B, N, U, }) => {\n    return new Promise((resolve, reject) => {\n        g.modPow(x, N, (outerErr, outerResult) => {\n            if (outerErr) {\n                reject(outerErr);\n                return;\n            }\n            B.subtract(k.multiply(outerResult)).modPow(a.add(U.multiply(x)), N, (innerErr, innerResult) => {\n                if (innerErr) {\n                    reject(innerErr);\n                    return;\n                }\n                resolve(innerResult.mod(N));\n            });\n        });\n    });\n};\n\nexport { calculateS };\n","import { SHORT_TO_HEX } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Converts a Uint8Array of binary data to a hexadecimal encoded string.\n *\n * @param bytes The binary data to encode\n */\nconst getHexFromBytes = (bytes) => {\n    let out = '';\n    for (let i = 0; i < bytes.byteLength; i++) {\n        out += SHORT_TO_HEX[bytes[i]];\n    }\n    return out;\n};\n\nexport { getHexFromBytes };\n","import { Sha256 } from '@aws-crypto/sha256-js';\nimport { getHexFromBytes } from './getHexFromBytes.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Calculate a hash from a `SourceData`\n * @param {SourceData} data Value to hash.\n * @returns {string} Hex-encoded hash.\n * @private\n */\nconst getHashFromData = (data) => {\n    const sha256 = new Sha256();\n    sha256.update(data);\n    const hashedData = sha256.digestSync();\n    const hashHexFromUint8 = getHexFromBytes(hashedData);\n    return new Array(64 - hashHexFromUint8.length).join('0') + hashHexFromUint8;\n};\n\nexport { getHashFromData };\n","import { getBytesFromHex } from './getBytesFromHex.mjs';\nimport { getHashFromData } from './getHashFromData.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Calculate a hash from a hex string\n * @param {string} hexStr Value to hash.\n * @returns {string} Hex-encoded hash.\n * @private\n */\nconst getHashFromHex = (hexStr) => getHashFromData(getBytesFromHex(hexStr));\n\nexport { getHashFromHex };\n","import BigInteger from './BigInteger/BigInteger.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Tests if a hex string has it most significant bit set (case-insensitive regex)\n */\nconst HEX_MSB_REGEX = /^[89a-f]/i;\n/**\n * Returns an unambiguous, even-length hex string of the two's complement encoding of an integer.\n *\n * It is compatible with the hex encoding of Java's BigInteger's toByteArray(), wich returns a\n * byte array containing the two's-complement representation of a BigInteger. The array contains\n * the minimum number of bytes required to represent the BigInteger, including at least one sign bit.\n *\n * Examples showing how ambiguity is avoided by left padding with:\n * \t\"00\" (for positive values where the most-significant-bit is set)\n *  \"FF\" (for negative values where the most-significant-bit is set)\n *\n * padHex(bigInteger.fromInt(-236))  === \"FF14\"\n * padHex(bigInteger.fromInt(20))    === \"14\"\n *\n * padHex(bigInteger.fromInt(-200))  === \"FF38\"\n * padHex(bigInteger.fromInt(56))    === \"38\"\n *\n * padHex(bigInteger.fromInt(-20))   === \"EC\"\n * padHex(bigInteger.fromInt(236))   === \"00EC\"\n *\n * padHex(bigInteger.fromInt(-56))   === \"C8\"\n * padHex(bigInteger.fromInt(200))   === \"00C8\"\n *\n * @param {AuthBigInteger} bigInt Number to encode.\n * @returns {String} even-length hex string of the two's complement encoding.\n */\nconst getPaddedHex = (bigInt) => {\n    if (!(bigInt instanceof BigInteger)) {\n        throw new Error('Not a BigInteger');\n    }\n    const isNegative = bigInt.compareTo(BigInteger.ZERO) < 0;\n    /* Get a hex string for abs(bigInt) */\n    let hexStr = bigInt.abs().toString(16);\n    /* Pad hex to even length if needed */\n    hexStr = hexStr.length % 2 !== 0 ? `0${hexStr}` : hexStr;\n    /* Prepend \"00\" if the most significant bit is set */\n    hexStr = HEX_MSB_REGEX.test(hexStr) ? `00${hexStr}` : hexStr;\n    if (isNegative) {\n        /* Flip the bits of the representation */\n        const invertedNibbles = hexStr\n            .split('')\n            .map((x) => {\n            const invertedNibble = ~parseInt(x, 16) & 0xf;\n            return '0123456789ABCDEF'.charAt(invertedNibble);\n        })\n            .join('');\n        /* After flipping the bits, add one to get the 2's complement representation */\n        const flippedBitsBI = new BigInteger(invertedNibbles, 16).add(BigInteger.ONE);\n        hexStr = flippedBitsBI.toString(16);\n        /*\n        For hex strings starting with 'FF8', 'FF' can be dropped, e.g. 0xFFFF80=0xFF80=0x80=-128\n\n        Any sequence of '1' bits on the left can always be substituted with a single '1' bit\n        without changing the represented value.\n\n        This only happens in the case when the input is 80...00\n        */\n        if (hexStr.toUpperCase().startsWith('FF8')) {\n            hexStr = hexStr.substring(2);\n        }\n    }\n    return hexStr;\n};\n\nexport { getPaddedHex };\n","import BigInteger from '../BigInteger/BigInteger.mjs';\nimport { getHashFromHex } from '../getHashFromHex.mjs';\nimport { getPaddedHex } from '../getPaddedHex.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nconst calculateU = ({ A, B, }) => {\n    const U = new BigInteger(getHashFromHex(getPaddedHex(A) + getPaddedHex(B)), 16);\n    if (U.equals(BigInteger.ZERO)) {\n        throw new Error('U cannot be zero.');\n    }\n    return U;\n};\n\nexport { calculateU };\n","import { Sha256 } from '@aws-crypto/sha256-js';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Standard HKDF algorithm.\n *\n * @param {Uint8Array} ikm Input key material.\n * @param {Uint8Array} salt Salt value.\n * @param {Uint8Array} info Context and application specific info.\n *\n * @returns {Uint8Array} Strong key material.\n *\n * @internal\n */\nconst getHkdfKey = (ikm, salt, info) => {\n    const awsCryptoHash = new Sha256(salt);\n    awsCryptoHash.update(ikm);\n    const resultFromAWSCryptoPrk = awsCryptoHash.digestSync();\n    const awsCryptoHashHmac = new Sha256(resultFromAWSCryptoPrk);\n    awsCryptoHashHmac.update(info);\n    const resultFromAWSCryptoHmac = awsCryptoHashHmac.digestSync();\n    const hashHexFromAWSCrypto = resultFromAWSCryptoHmac;\n    return hashHexFromAWSCrypto.slice(0, 16);\n};\n\nexport { getHkdfKey };\n","import { WordArray } from '@aws-amplify/core/internals/utils';\nimport { getBytesFromHex } from './getBytesFromHex.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns a Uint8Array with a sequence of random nBytes\n *\n * @param {number} nBytes\n * @returns {Uint8Array} fixed-length sequence of random bytes\n */\nconst getRandomBytes = (nBytes) => {\n    const str = new WordArray().random(nBytes).toString();\n    return getBytesFromHex(str);\n};\n\nexport { getRandomBytes };\n","import { base64Encoder } from '@aws-amplify/core/internals/utils';\nimport { getRandomBytes } from './getRandomBytes.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Helper function to generate a random string\n * @returns {string} a random value.\n *\n * @internal\n */\nconst getRandomString = () => base64Encoder.convert(getRandomBytes(40));\n\nexport { getRandomString };\n","import { AuthError } from '../../../../../errors/AuthError.mjs';\nimport { textEncoder } from '../../textEncoder/index.mjs';\nimport BigInteger from '../BigInteger/BigInteger.mjs';\nimport { calculateS } from '../calculate/calculateS.mjs';\nimport { calculateU } from '../calculate/calculateU.mjs';\nimport { getBytesFromHex } from '../getBytesFromHex.mjs';\nimport { getHashFromData } from '../getHashFromData.mjs';\nimport { getHashFromHex } from '../getHashFromHex.mjs';\nimport { getHexFromBytes } from '../getHexFromBytes.mjs';\nimport { getHkdfKey } from '../getHkdfKey.mjs';\nimport { getPaddedHex } from '../getPaddedHex.mjs';\nimport { getRandomBytes } from '../getRandomBytes.mjs';\nimport { getRandomString } from '../getRandomString.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/** @class */\nclass AuthenticationHelper {\n    constructor({ userPoolName, a, g, A, N, }) {\n        this.encoder = textEncoder;\n        this.userPoolName = userPoolName;\n        this.a = a;\n        this.g = g;\n        this.A = A;\n        this.N = N;\n        this.k = new BigInteger(getHashFromHex(`${getPaddedHex(N)}${getPaddedHex(g)}`), 16);\n    }\n    /**\n     * @returns {string} Generated random value included in password hash.\n     */\n    getRandomPassword() {\n        if (!this.randomPassword) {\n            throw new AuthError({\n                name: 'EmptyBigIntegerRandomPassword',\n                message: 'random password is empty',\n            });\n        }\n        return this.randomPassword;\n    }\n    /**\n     * @returns {string} Generated random value included in devices hash.\n     */\n    getSaltToHashDevices() {\n        if (!this.saltToHashDevices) {\n            throw new AuthError({\n                name: 'EmptyBigIntegersaltToHashDevices',\n                message: 'saltToHashDevices is empty',\n            });\n        }\n        return this.saltToHashDevices;\n    }\n    /**\n     * @returns {string} Value used to verify devices.\n     */\n    getVerifierDevices() {\n        if (!this.verifierDevices) {\n            throw new AuthError({\n                name: 'EmptyBigIntegerVerifierDevices',\n                message: 'verifyDevices is empty',\n            });\n        }\n        return this.verifierDevices;\n    }\n    /**\n     * Generate salts and compute verifier.\n     *\n     * @param {string} deviceGroupKey Devices to generate verifier for.\n     * @param {string} username User to generate verifier for.\n     *\n     * @returns {Promise<void>}\n     */\n    async generateHashDevice(deviceGroupKey, username) {\n        this.randomPassword = getRandomString();\n        const combinedString = `${deviceGroupKey}${username}:${this.randomPassword}`;\n        const hashedString = getHashFromData(combinedString);\n        const hexRandom = getHexFromBytes(getRandomBytes(16));\n        // The random hex will be unambiguously represented as a postive integer\n        this.saltToHashDevices = getPaddedHex(new BigInteger(hexRandom, 16));\n        return new Promise((resolve, reject) => {\n            this.g.modPow(new BigInteger(getHashFromHex(this.saltToHashDevices + hashedString), 16), this.N, (err, result) => {\n                if (err) {\n                    reject(err);\n                    return;\n                }\n                this.verifierDevices = getPaddedHex(result);\n                resolve();\n            });\n        });\n    }\n    /**\n     * Calculates the final HKDF key based on computed S value, computed U value and the key\n     *\n     * @param {String} username Username.\n     * @param {String} password Password.\n     * @param {AuthBigInteger} B Server B value.\n     * @param {AuthBigInteger} salt Generated salt.\n     */\n    async getPasswordAuthenticationKey({ username, password, serverBValue, salt, }) {\n        if (serverBValue.mod(this.N).equals(BigInteger.ZERO)) {\n            throw new Error('B cannot be zero.');\n        }\n        const U = calculateU({\n            A: this.A,\n            B: serverBValue,\n        });\n        const usernamePassword = `${this.userPoolName}${username}:${password}`;\n        const usernamePasswordHash = getHashFromData(usernamePassword);\n        const x = new BigInteger(getHashFromHex(getPaddedHex(salt) + usernamePasswordHash), 16);\n        const S = await calculateS({\n            a: this.a,\n            g: this.g,\n            k: this.k,\n            x,\n            B: serverBValue,\n            N: this.N,\n            U,\n        });\n        const context = this.encoder.convert('Caldera Derived Key');\n        const spacer = this.encoder.convert(String.fromCharCode(1));\n        const info = new Uint8Array(context.byteLength + spacer.byteLength);\n        info.set(context, 0);\n        info.set(spacer, context.byteLength);\n        const hkdfKey = getHkdfKey(getBytesFromHex(getPaddedHex(S)), getBytesFromHex(getPaddedHex(U)), info);\n        return hkdfKey;\n    }\n}\n\nexport { AuthenticationHelper as default };\n","import BigInteger from '../BigInteger/BigInteger.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * @internal\n */\nconst calculateA = async ({ a, g, N, }) => {\n    return new Promise((resolve, reject) => {\n        g.modPow(a, N, (err, A) => {\n            if (err) {\n                reject(err);\n                return;\n            }\n            if (A.mod(N).equals(BigInteger.ZERO)) {\n                reject(new Error('Illegal parameter. A mod N cannot be 0.'));\n                return;\n            }\n            resolve(A);\n        });\n    });\n};\n\nexport { calculateA };\n","import AuthenticationHelper from './AuthenticationHelper/AuthenticationHelper.mjs';\nimport BigInteger from './BigInteger/BigInteger.mjs';\nimport { calculateA } from './calculate/calculateA.mjs';\nimport { INIT_N } from './constants.mjs';\nimport '@aws-crypto/sha256-js';\nimport { getHexFromBytes } from './getHexFromBytes.mjs';\nimport { getRandomBytes } from './getRandomBytes.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns a new {@link AuthenticationHelper} instance with randomly generated BigInteger seed\n *\n * @param userPoolName Cognito user pool name.\n * @returns An {@link AuthenticationHelper} instance.\n *\n * @internal\n */\nconst getAuthenticationHelper = async (userPoolName) => {\n    const N = new BigInteger(INIT_N, 16);\n    const g = new BigInteger('2', 16);\n    const a = generateRandomBigInteger();\n    const A = await calculateA({ a, g, N });\n    return new AuthenticationHelper({ userPoolName, a, g, A, N });\n};\n/**\n * Generates a random BigInteger.\n *\n * @returns {BigInteger} a random value.\n */\nconst generateRandomBigInteger = () => {\n    // This will be interpreted as a postive 128-bit integer\n    const hexRandom = getHexFromBytes(getRandomBytes(128));\n    // There is no need to do randomBigInt.mod(this.N - 1) as N (3072-bit) is > 128 bytes (1024-bit)\n    return new BigInteger(hexRandom, 16);\n};\n\nexport { getAuthenticationHelper };\n"],"names":["toAttributeType","attributes","key","value","toAuthUserAttribute","userAttributes","attribute","createGetUserClient","config","composeServiceApi","cognitoUserPoolTransferHandler","createUserPoolSerializer","createUserPoolDeserializer","fetchUserAttributes","amplify","authConfig","userPoolEndpoint","userPoolId","tokens","fetchAuthSession","getUser","createCognitoUserPoolEndpointResolver","UserAttributes","getAuthUserAgentValue","Amplify","IdentityIdStorageKeys","logger","ConsoleLogger","DefaultIdentityIdStore","authConfigParam","createKeysForAuthStorage","keyValueStorage","storedIdentityId","err","identity","provider","identifier","formLoginsMap","idToken","issuer","res","AuthError","domainName","cognitoIdentityIdProvider","identityIdStore","identityId","logins","generatedIdentityId","generateIdentityId","identityPoolId","region","idResult","getId","e","assertServiceError","CREDENTIALS_TTL","CognitoAWSCredentialsAndIdentityIdProvider","getCredentialsOptions","isAuthenticated","forceRefresh","tokenHasChanged","clientResult","getCredentialsForIdentity","authTokens","cognitoCredentialsProvider","createGetUserAttributeVerificationCodeClient","sendUserAttributeVerificationCode","input","userAttributeKey","options","clientMetadata","getUserAttributeVerificationCode","CodeDeliveryDetails","DeliveryMedium","AttributeName","Destination","BigInteger","a","b","nbi","dbits","j_lm","am1","i","x","w","j","c","n","v","am2","xl","xh","l","h","m","am3","inBrowser","BI_FP","BI_RM","BI_RC","rr","vv","int2char","intAt","s","bnpCopyTo","bnpFromInt","nbv","r","bnpFromString","k","mi","sh","bnpClamp","bnToString","km","d","p","bnNegate","bnAbs","bnCompareTo","nbits","t","bnBitLength","bnpDLShiftTo","bnpDRShiftTo","bnpLShiftTo","bs","cbs","bm","ds","bnpRShiftTo","bnpSubTo","bnpMultiplyTo","y","bnpSquareTo","bnpDivRemTo","q","pm","pt","ts","ms","nsh","ys","y0","yt","d1","d2","qd","bnMod","bnpInvDigit","bnEquals","bnpAddTo","bnAdd","bnSubtract","bnMultiply","bnDivide","Montgomery","montConvert","montRevert","montReduce","u0","montSqrTo","montMulTo","bnModPow","callback","z","g","k1","g2","is1","r2","result","AuthTokenStorageKeys","TokenProviderErrorCode","tokenValidationErrorMap","assert","createAssertionFunction","AUTH_KEY_PREFIX","DefaultTokenStore","authKeys","accessTokenString","accessToken","itString","refreshToken","clockDriftString","clockDrift","signInDetails","lastAuthUser","username","deviceKey","deviceGroupKey","randomPassword","metadata","oauthMetadataKey","oauthMetadata","getAuthStorageKeys","keys","prefix","acc","authKey","setActiveSignInUsername","dispatch","MONTH_NAMES","WEEK_NAMES","getNowString","now","weekDay","month","day","hours","minutes","seconds","year","refreshAuthTokensFunction","userPoolClientId","refreshTokenString","AuthParameters","UserContextData","initiateAuth","createInitiateAuthClient","AuthenticationResult","iat","refreshAuthTokens","deDupeAsyncFunction","refreshAuthTokensWithoutDedupe","TokenOrchestrator","isBrowser","oAuthStore","resolve","_reject","tokenRefresher","tokenStore","idTokenExpired","isTokenExpired","accessTokenExpired","newTokens","Hub","CognitoUserPoolsTokenProvider","cognitoUserPoolsTokenProvider","tokenOrchestrator","action","customUserAgentDetails","V5_HOSTED_UI_KEY","name","DefaultOAuthStore","state","pkce","inflight","isLegacyHostedUISignIn","isOAuthSignIn","preferPrivateSession","oauthSignIn","isTypeUserPoolConfig","assertAuthTokens","assertIdTokenInAuthTokens","oAuthTokenRefreshException","tokenRefreshException","assertAuthTokensWithRefreshToken","isAuthenticatedWithImplicitOauthFlow","isAuthenticatedWithRefreshToken","assertDeviceMetadata","deviceMetadata","OAuthStorageKeys","getSignatureString","userPoolName","challengeParameters","dateNow","hkdf","bufUPIDaToB","bufUNaToB","bufSBaToB","urlB64ToUint8Array","bufDNaToB","bufConcat","awsCryptoHash","resultFromAWSCrypto","base64String","padding","base64","rawData","outputArray","openAuthSession","url","AuthValidationErrorCode","getRegionFromUserPoolId","getRegionFromIdentityPoolId","getUserContextData","amazonCognitoAdvancedSecurityData","advancedSecurityData","MS_TO_EXPIRY","TGT_STATE","SIGN_IN_STATE_KEYS","signInReducer","persistSignInState","getInitialState","clearPersistedSignInState","getDefaultState","isExpired","expiryDate","expiryTimestamp","currentTimestamp","resetActiveSignInState","signInStore","stateKey","expiry","challengeName","signInSession","reducer","currentState","setActiveSignInState","handlePasswordVerifierChallenge","password","session","authenticationHelper","serverBValue","salt","challengeResponses","jsonReqResponseChallenge","response","AssociateSoftwareTokenException","ChangePasswordException","ConfirmDeviceException","ConfirmForgotPasswordException","ConfirmSignUpException","DeleteUserAttributesException","DeleteUserException","ForgetDeviceException","ForgotPasswordException","GetUserException","GetIdException","GetCredentialsForIdentityException","GetUserAttributeVerificationException","GlobalSignOutException","InitiateAuthException","ResendConfirmationException","RespondToAuthChallengeException","SetUserMFAPreferenceException","SignUpException","UpdateUserAttributesException","VerifySoftwareTokenException","VerifyUserAttributeException","UpdateDeviceStatusException","ListDevicesException","SETUP_TOTP_EXCEPTION","textEncoder","createConfirmForgotPasswordClient","confirmResetPassword","newPassword","assertValidationError","code","MAX_AUTOSIGNIN_POLLING_MS","handleCodeAutoSignIn","signInInput","stopHubListener","payload","autoSignInWithCode","timeOutId","debounce","fun","delay","timer","args","handleAutoSignInWithLink","reject","start","autoSignInPollingIntervalId","signInOutput","signIn","error","debouncedAutoSignInWithLink","debouncedAutoSignWithCodeOrUserConfirmed","handleAutoSignInWithCodeOrUserConfirmed","autoSignInWhenUserIsConfirmedWithLink","output","signInWithUserAuth","autoSignInUserConfirmed","createSignUpClientDeserializer","message","recoverySuggestion","createSignUpClient","signUp","signUpVerificationMethod","validationData","autoSignIn","signInServiceOptions","signUpClient","signUpClientInput","userId","cdd","userConfirmed","autoSignInStore","codeDeliveryDetails","isSignUpComplete","isAutoSignInStarted","assertion","disableCacheMiddlewareFactory","next","_","request","DEFAULT_SERVICE_CLIENT_API_CONFIG","getRedirectUrl","redirects","preferredRedirectUrl","redirectUrl","redirect","redirectUrlFromTheSameOrigin","isSameOriginAndPathName","isTheSameDomain","redirectUrlFromDifferentOrigin","isHttps","isHttp","inflightPromises","addInflightPromise","resolver","resolveAndClearInflightPromises","type","log","authErrorMessages","NoUserPoolError","AuthErrorStrings","createOAuthError","AuthErrorTypes","flowCancelledMessage","validationFailedMessage","validationRecoverySuggestion","validateState","savedState","validatedState","completeOAuthFlow","currentUrl","userAgentValue","clientId","redirectUri","responseType","domain","urlParams","errorMessage","handleCodeFlow","handleImplicitFlow","oAuthTokenEndpoint","codeVerifier","oAuthTokenBody","body","access_token","id_token","token_type","expires_in","completeFlow","error_description","pairings","accum","clearHistory","isCustomState","urlSafeDecode","getCustomState","dispatchSignedInHubEvent","handleFailure","attemptCompleteOAuthFlow","loginWith","redirectSignIn","cognitoHostedUIIdentityProviderMap","CODE_VERIFIER_CHARSET","generateCodeVerifier","length","randomBytes","codeChallenge","byte","generateCodeChallenge","removePaddingChar","base64Encoder","base64Encoded","generateState","generateRandomString","listenForOAuthFlowCancellation","store","handleCancelOAuthFlow","event","signInWithRedirect","oauthConfig","customState","scopes","loginHint","lang","nonce","randomState","urlSafeEncode","method","toCodeChallenge","queryString","oAuthUrl","cognitoUserPoolEndpointResolver","getDnsSuffix","endpointOverride","validationErrorMap","AuthErrorCodes","params","createConfirmSignUpClient","confirmSignUp","confirmationCode","confirmSignUpClient","signUpOut","autoSignInStoreState","stopListener","defaultState","handleUserAuthFlow","preferredChallenge","authParameters","handlePasswordSRP","jsonReq","clientMetaData","handleUserAuthFlowInput","activeUsername","getNewDeviceMetadata","initialAutoSignIn","setAutoSignIn","resetAutoSignIn","resetCallback","createRespondToAuthChallengeClient","confirmSignIn","challengeResponse","Session","handledChallengeName","handledChallengeParameters","createResendConfirmationCodeClient","resendSignUpCode","resendConfirmationCode","handleDeviceSRPAuth","respondToAuthChallenge","respondedChallengeParameters","handleDevicePasswordVerifier","createVerifySoftwareTokenClient","createAssociateSoftwareTokenClient","PasskeyError","AmplifyError","PasskeyErrorCode","notSupportedRecoverySuggestion","abortOrCancelRecoverySuggestion","misconfigurationRecoverySuggestion","passkeyErrorMap","handlePasskeyAuthenticationError","handlePasskeyError","handlePasskeyRegistrationError","getIsPasskeySupported","buffer","base64url","base64Decoder","deserializeJsonToPkcCreationOptions","userIdBuffer","challengeBuffer","excludeCredentialsWithBuffer","excludeCred","serializePkcWithAttestationToJson","publicKey","resultJson","deserializeJsonToPkcGetOptions","allowedCredentialsWithBuffer","allowedCred","serializePkcWithAssertionToJson","assertCredentialIsPkcWithAuthenticatorAttestationResponse","credential","assertCredentialIsPkcWithAuthenticatorAssertionResponse","getPasskey","isPasskeySupported","passkeyGetOptions","handleWebAuthnSignInResult","credentialRequestOptions","cred","nextChallengeName","nextChallengeParameters","authenticationResult","nextSession","initiateSelectedChallenge","selectedChallenge","handleSelectChallengeWithPassword","userContextData","handleSelectChallengeWithPasswordSRP","getAuthenticationHelper","retryOnResourceNotFoundException","USER_ATTRIBUTES","isWebAuthnResultAuthSignInOutput","handleCustomChallenge","handleMFASetupChallenge","deviceName","verifySoftwareToken","handleSelectMFATypeChallenge","mapMfaType","handleCompleteNewPasswordChallenge","requiredAttributes","createAttributes","handleUserPasswordAuthFlow","handleUserSRPAuthFlow","handleCustomAuthFlowWithoutSRP","handleCustomSRPAuthFlow","getSignInResult","availableChallenges","mfaSetupTypes","getMFATypes","parseMFATypes","allowedMfaSetupTypes","getAllowedMfaSetupTypes","isTotpMfaSetupAvailable","isEmailMfaSetupAvailable","associateSoftwareToken","secretCode","getTOTPSetupDetails","parseAttributes","appName","accountName","totpUri","getSignInResultFromError","errorName","att","newAttributes","handleChallengeName","handleMFAChallenge","mfa","mfaType","getMFAType","types","availableMfaSetupTypes","authMfaType","assertUserNotAuthenticated","authUser","getCurrentUser","getActiveSignInUsername","signInWithCustomAuth","retriedChallengeName","retiredChallengeParameters","signInWithCustomSRPAuth","signInWithSRP","signInWithUserPassword","retiredChallengeName","retriedChallengeParameters","authFlowType","func","sub","getSignInDetailsFromTokens","operation","endpoint","headers","getSharedHeaders","buildHttpRpcRequest","ERROR_MESSAGE","cacheCognitoTokens","accessTokenIssuedAtInMillis","currentTime","getBytesFromHex","encoded","out","encodedByte","COGNITO_IDP_SERVICE_NAME","completeOAuthSignOut","clearCredentials","oAuthSignOutRedirect","redirectSignOut","signoutUri","oAuthLogoutEndpoint","handleOAuthSignOut","cognitoConfig","createRevokeTokenClient","createGlobalSignOutClient","signOut","globalSignOut","clientSignOut","hasOAuthConfig","isSessionRevocable","token","createConfirmDeviceClient","newDeviceMetadata","deviceSecretVerifierConfig","getDeviceName","authFlow","resp","INIT_N","SHORT_TO_HEX","HEX_TO_SHORT","createForgotPasswordClient","resetPassword","createVerifyUserAttributeClient","confirmUserAttribute","USER_UNAUTHENTICATED_EXCEPTION","USER_ALREADY_AUTHENTICATED_EXCEPTION","DEVICE_METADATA_NOT_FOUND_EXCEPTION","AUTO_SIGN_IN_EXCEPTION","INVALID_REDIRECT_EXCEPTION","INVALID_APP_SCHEME_EXCEPTION","INVALID_PREFERRED_REDIRECT_EXCEPTION","invalidRedirectException","invalidAppSchemeException","invalidPreferredRedirectUrlException","INVALID_ORIGIN_EXCEPTION","invalidOriginException","OAUTH_SIGNOUT_EXCEPTION","TOKEN_REFRESH_EXCEPTION","UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION","calculateS","B","N","U","outerErr","outerResult","innerErr","innerResult","getHexFromBytes","bytes","getHashFromData","data","sha256","hashedData","hashHexFromUint8","getHashFromHex","hexStr","HEX_MSB_REGEX","getPaddedHex","bigInt","isNegative","invertedNibbles","invertedNibble","calculateU","A","getHkdfKey","ikm","info","resultFromAWSCryptoPrk","awsCryptoHashHmac","getRandomBytes","nBytes","str","WordArray","getRandomString","AuthenticationHelper","combinedString","hashedString","hexRandom","usernamePassword","usernamePasswordHash","S","context","spacer","calculateA","generateRandomBigInteger"],"sourceRoot":""}