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GAAK,OAAUA,EAAI,OAC5BA,EAAa,IAAN,KAAFA,GAAYsG,EAAwB,KAApBkF,EAAIxP,WAAW6D,KAIpCwkD,GADAA,GADAA,GADAA,EAAKA,IAAI,EAAKzB,EAA0B,KAAtByB,GAAK,IAAMrkD,GAAG,EAAG,QAC1B,EAAK4iD,EAA2B,KAAvByB,GAAK,IAAMrkD,GAAG,EAAG,SAC1B,EAAK4iD,EAAsC,KAAlCyB,GAAK,IAAM/9C,GAAG,EAAG,IAAQ,EAAFtG,IAAM,QACtC,EAAK4iD,EAAsB,KAAlByB,GAAK,IAAO,GAAF/9C,MAI5B+9C,GADAA,GADAA,EAAKA,IAAI,EAAKzB,EAA4B,KAAxByB,GAAK,IAAMrkD,GAAG,GAAI,SAC3B,EAAK4iD,EAA2B,KAAvByB,GAAK,IAAMrkD,GAAG,EAAG,SAC1B,EAAK4iD,EAAsB,KAAlByB,GAAK,IAAO,GAAFrkD,KAG9B,OAAQqkD,CACT,CAQA,CAzGGp+D,QAFQy+D,kBAAsB,IAEtBC,GAWO,CAAC","names":["getReservationsByUser","gql","getReservationById","getCheckInByUser","searchReservationByNumber","searchReservationByLocator","updateReservationUser","AppSyncService","_AppSyncService","constructor","authService","apollo","httpLink","http","this","initAppSyncClient","getUserInfo","then","user","use","query","variables","userId","attributes","sub","pipe","map","changes","data","toPromise","_this","_asyncToGenerator","cache","InMemoryCache","uri","awsmobile","aws_appsync_graphqlEndpoint","token","getJwtToken","headers","HttpHeaders","Authorization","aws_appsync_apiKey","opcionAppSync","link","create","createNamed","id","reservationId","checkin","checkout","reservationNumber","locator","linkReservationToUser","updateReservationUserInput","_id","mutate","mutation","input","singInGuestService","params","post","environment","MICRO_GS_LOGIN_APP","getHeaderToken","localStorage","getItem","getDataBillinStatement","get","i0","i1","i2","i3","i4","factory","ɵfac","providedIn","getAuthUserAgentValue","action","customUserAgentDetails","getAmplifyUserAgent","category","Category","Auth","urlSafeDecode","hex","match","char","String","fromCharCode","parseInt","join","cacheCognitoTokens","_x","_cacheCognitoTokens","apply","arguments","AuthenticationResult","AccessToken","AmplifyError","message","name","recoverySuggestion","accessToken","decodeJWT","accessTokenIssuedAtInMillis","payload","iat","currentTime","Date","getTime","clockDrift","idToken","refreshToken","deviceMetadata","RefreshToken","IdToken","NewDeviceMetadata","tokens","username","signInDetails","tokenOrchestrator","setTokens","getCurrentUser","_ref","amplify","authConfig","getConfig","Cognito","assertTokenProviderConfig","getTokens","forceRefresh","assertAuthTokens","authUser","getSignInDetailsFromTokens","getCurrentUser$1","Amplify","dispatchSignedInHubEvent","Hub","dispatch","event","AMPLIFY_SYMBOL","error","USER_UNAUTHENTICATED_EXCEPTION","AuthError","UNEXPECTED_SIGN_IN_INTERRUPTION_EXCEPTION","AuthValidationErrorCode","EmptySignInUsername","EmptySignInPassword","CustomAuthSignInPassword","EmptySignUpUsername","EmptySignUpPassword","EmptyConfirmSignUpUsername","EmptyConfirmSignUpCode","EmptyResendSignUpCodeUsername","EmptyChallengeResponse","EmptyConfirmResetPasswordUsername","EmptyConfirmResetPasswordNewPassword","EmptyConfirmResetPasswordConfirmationCode","EmptyResetPasswordUsername","EmptyVerifyTOTPSetupCode","EmptyConfirmUserAttributeCode","IncorrectMFAMethod","EmptyUpdatePassword","validationErrorMap","AuthErrorStrings","DEFAULT_MSG","EMPTY_EMAIL","EMPTY_PHONE","EMPTY_USERNAME","INVALID_USERNAME","EMPTY_PASSWORD","EMPTY_CODE","SIGN_UP_ERROR","NO_MFA","INVALID_MFA","EMPTY_CHALLENGE","NO_USER_SESSION","NETWORK_ERROR","DEVICE_CONFIG","AUTOSIGNIN_ERROR","OAUTH_ERROR","AuthErrorCodes","SignInException","OAuthSignInError","ConsoleLogger","Error","authErrorMessages","log","createOAuthError","AuthErrorTypes","NoConfig","MissingAuthConfig","EmptyUsername","InvalidUsername","EmptyPassword","EmptyCode","SignUpError","NoMFA","InvalidMFA","NoUserSession","Default","DeviceConfig","NetworkError","AutoSignInError","validateState","state","savedState","oAuthStore","loadOAuthState","validatedState","undefined","completeOAuthFlow","currentUrl","userAgentValue","clientId","redirectUri","responseType","domain","preferPrivateSession","urlParams","AmplifyUrl","searchParams","errorMessage","handleCodeFlow","handleImplicitFlow","_ref2","url","code","oAuthTokenEndpoint","codeVerifier","loadPKCE","oAuthTokenBody","grant_type","client_id","redirect_uri","code_verifier","body","Object","entries","k","v","encodeURIComponent","access_token","refresh_token","id_token","error_message","token_type","expires_in","fetch","method","USER_AGENT_HEADER","json","TokenType","ExpiresIn","completeFlow","_x2","_ref3","error_description","hash","substring","split","pairings","reduce","accum","_x3","_ref4","setOAuthMetadata","oauthSignIn","clearOAuthData","storeOAuthSignIn","resolveAndClearInflightPromises","isCustomState","getCustomState","clearHistory","_x4","test","splice","window","history","replaceState","getRedirectUrl","redirects","preferredRedirectUrl","redirectUrl","find","redirect","invalidPreferredRedirectUrlException","redirectUrlFromTheSameOrigin","isSameOriginAndPathName","isTheSameDomain","redirectUrlFromDifferentOrigin","isHttps","isHttp","invalidOriginException","invalidRedirectException","startsWith","location","origin","pathname","includes","hostname","handleFailure","clearOAuthInflightData","attemptCompleteOAuthFlow","assertOAuthConfig","setAuthConfig","loadOAuthInFlight","href","loginWith","userPoolClientId","redirectSignIn","oauth","AuthAction","SignInWithRedirect","err","isBrowser","ADD_OAUTH_LISTENER","cognitoHostedUIIdentityProviderMap","Google","Facebook","Amazon","Apple","openAuthSession","replace","InitiateAuthException","PasswordResetRequiredException","ForbiddenException","InternalErrorException","InvalidLambdaResponseException","InvalidParameterException","InvalidSmsRoleAccessPolicyException","InvalidSmsRoleTrustRelationshipException","InvalidUserPoolConfigurationException","NotAuthorizedException","ResourceNotFoundException","TooManyRequestsException","UnexpectedLambdaException","UserLambdaValidationException","UserNotConfirmedException","UserNotFoundException","SignUpException","CodeDeliveryFailureException","InvalidEmailRoleAccessPolicyException","InvalidPasswordException","UsernameExistsException","assertValidationError","assertion","createRespondToAuthChallengeClient","config","composeServiceApi","cognitoUserPoolTransferHandler","createUserPoolSerializer","createUserPoolDeserializer","DEFAULT_SERVICE_CLIENT_API_CONFIG","createVerifySoftwareTokenClient","createAssociateSoftwareTokenClient","TGT_STATE","SIGN_IN_STATE_KEYS","challengeName","signInSession","expiry","resetActiveSignInState","signInStore","type","clearPersistedSignInState","stateKey","values","syncSessionStorage","removeItem","reducer","currentState","getDefaultState","getState","signInReducer","persistSignInState","value","getInitialState","expiryDate","Number","now","isExpired","setActiveSignInState","setItem","PasskeyError","super","setPrototypeOf","prototype","PasskeyErrorCode","PasskeyNotSupported","PasskeyAlreadyExists","InvalidPasskeyRegistrationOptions","InvalidPasskeyAuthenticationOptions","RelyingPartyMismatch","PasskeyRegistrationFailed","PasskeyRetrievalFailed","PasskeyRegistrationCanceled","PasskeyAuthenticationCanceled","PasskeyOperationAborted","notSupportedRecoverySuggestion","abortOrCancelRecoverySuggestion","misconfigurationRecoverySuggestion","passkeyErrorMap","assertPasskeyError","createAssertionFunction","base64Encoder","convert","options","urlSafe","skipPadding","inputStr","bytesToString","Array","from","byte","fromCodePoint","encodedStr","getBtoa","convertArrayBufferToBase64Url","buffer","Uint8Array","convertBase64UrlToArrayBuffer","base64url","base64Decoder","x","charCodeAt","getPasskey","isPasskeySupported","getIsPasskeySupported","isSecureContext","navigator","PublicKeyCredential","passkeyGetOptions","challengeBuffer","challenge","allowedCredentialsWithBuffer","allowCredentials","allowedCred","deserializeJsonToPkcGetOptions","credential","credentials","publicKey","assertCredentialIsPkcWithAuthenticatorAssertionResponse","response","AuthenticatorAssertionResponse","clientDataJSON","authenticatorData","signature","userHandle","resultJson","rawId","clientExtensionResults","getClientExtensionResults","authenticatorAttachment","serializePkcWithAssertionToJson","underlyingError","AmplifyErrorCode","Unknown","handlePasskeyError","handlePasskeyAuthenticationError","getDeviceName","userAgentData","userAgent","platform","platformVersion","model","architecture","fullVersionList","getHighEntropyValues","brand","version","filter","createConfirmDeviceClient","textEncoder","TextEncoder","encode","BigInteger","a","b","fromString","nbi","dbits","inBrowser","appName","am","am2","i","w","j","c","n","xl","xh","l","h","m","am1","Math","floor","am3","DB","DM","DV","FV","pow","F1","F2","BI_RC","rr","vv","int2char","charAt","intAt","s","nbv","r","fromInt","nbits","t","Montgomery","mp","invDigit","mpl","mph","um","mt2","montConvert","abs","dlShiftTo","divRemTo","compareTo","ZERO","subTo","revert","montRevert","copyTo","montReduce","u0","clamp","drShiftTo","mulTo","montMulTo","y","multiplyTo","sqrTo","montSqrTo","squareTo","bnpCopyTo","bnpFromInt","bnpFromString","length","mi","sh","bnpClamp","bnpDLShiftTo","bnpDRShiftTo","max","lShiftTo","bnpLShiftTo","bs","cbs","bm","ds","rShiftTo","bnpRShiftTo","bnpSubTo","min","bnpMultiplyTo","bnpSquareTo","bnpDivRemTo","q","pm","pt","ts","ms","nsh","ys","y0","yt","d1","d2","e","ONE","qd","bnpInvDigit","addTo","bnpAddTo","toString","bnToString","negate","km","d","p","bnNegate","bnAbs","bnCompareTo","bitLength","bnBitLength","mod","bnMod","equals","bnEquals","add","bnAdd","subtract","bnSubtract","multiply","bnMultiply","divide","bnDivide","modPow","bnModPow","callback","z","g","k1","g2","is1","r2","result","calculateS","B","N","U","Promise","resolve","reject","outerErr","outerResult","innerErr","innerResult","SHORT_TO_HEX","HEX_TO_SHORT","encodedByte","toLowerCase","getBytesFromHex","encoded","out","slice","getHexFromBytes","bytes","byteLength","getHashFromData","sha256","Sha256","update","hashedData","digestSync","hashHexFromUint8","getHashFromHex","hexStr","HEX_MSB_REGEX","getPaddedHex","bigInt","isNegative","invertedNibbles","invertedNibble","toUpperCase","WordArray","words","sigBytes","Words","random","nBytes","push","getCrypto","getRandomValues","Uint32Array","hexStringify","wordArray","hexChars","bite","getRandomBytes","str","AuthenticationHelper","userPoolName","A","encoder","getRandomPassword","randomPassword","getSaltToHashDevices","saltToHashDevices","getVerifierDevices","verifierDevices","generateHashDevice","deviceGroupKey","hashedString","hexRandom","getPasswordAuthenticationKey","password","serverBValue","salt","_this2","calculateU","usernamePasswordHash","S","context","spacer","info","set","getHkdfKey","ikm","awsCryptoHash","resultFromAWSCryptoPrk","awsCryptoHashHmac","calculateA","getAuthenticationHelper","generateRandomBigInteger","getNewDeviceMetadata","_getNewDeviceMetadata","userPoolId","userPoolEndpoint","newDeviceMetadata","authenticationHelper","deviceKey","DeviceKey","DeviceGroupKey","deviceSecretVerifierConfig","Salt","PasswordVerifier","endpointResolver","createCognitoUserPoolEndpointResolver","endpointOverride","region","getRegionFromUserPoolId","DeviceName","DeviceSecretVerifierConfig","_handleWebAuthnSignInResult","challengeParameters","CREDENTIAL_REQUEST_OPTIONS","credentialRequestOptions","cred","JSON","parse","respondToAuthChallenge","ChallengeName","nextChallengeName","ChallengeParameters","nextChallengeParameters","authenticationResult","Session","nextSession","ConfirmSignIn","ChallengeResponses","USERNAME","CREDENTIAL","stringify","ClientId","isSignedIn","nextStep","signInStep","MONTH_NAMES","WEEK_NAMES","getNowString","weekDay","getUTCDay","month","getUTCMonth","day","getUTCDate","hours","getUTCHours","minutes","getUTCMinutes","seconds","getUTCSeconds","getUTCFullYear","getSignatureString","dateNow","hkdf","bufUPIDaToB","bufUNaToB","bufSBaToB","urlB64ToUint8Array","SECRET_BLOCK","bufDNaToB","bufConcat","resultFromAWSCrypto","base64String","base64","repeat","rawData","outputArray","handleDeviceSRPAuth","_handleDeviceSRPAuth","clientMetadata","session","getDeviceMetadata","assertDeviceMetadata","jsonReqResponseChallenge","SRP_A","DEVICE_KEY","ClientMetadata","respondedChallengeParameters","handleDevicePasswordVerifier","_x5","_x6","_x7","_x8","_handleDevicePasswordVerifier","SRP_B","SALT","PASSWORD_CLAIM_SECRET_BLOCK","TIMESTAMP","PASSWORD_CLAIM_SIGNATURE","UserContextData","getUserContextData","handlePasswordVerifierChallenge","_handlePasswordVerifierChallenge","USER_ID_FOR_SRP","challengeResponses","retryOnResourceNotFoundException","_retryOnResourceNotFoundException","func","args","clearDeviceMetadata","setActiveSignInUsername","handlePasswordSRP","_handlePasswordSRP","authFlow","preferredChallenge","authParameters","PREFERRED_CHALLENGE","jsonReq","AuthFlow","AuthParameters","resp","createInitiateAuthClient","SignIn","activeUsername","_initiateSelectedChallenge","selectedChallenge","ANSWER","_handleSelectChallengeWithPassword","PASSWORD","userContextData","_handleSelectChallengeWithPasswordSRP","USER_ATTRIBUTES","handleCustomChallenge","_handleCustomChallenge","challengeResponse","_handleMFASetupChallenge","deviceName","MFAS_CAN_SETUP","$metadata","verifySoftwareToken","UserCode","FriendlyDeviceName","EMAIL","_handleSelectMFATypeChallenge","mapMfaType","_handleCompleteNewPasswordChallenge","requiredAttributes","createAttributes","NEW_PASSWORD","handleUserPasswordAuthFlow","_x9","_handleUserPasswordAuthFlow","_handleUserSRPAuthFlow","handleCustomAuthFlowWithoutSRP","_x15","_x16","_x17","_x18","_handleCustomAuthFlowWithoutSRP","_handleCustomSRPAuthFlow","CHALLENGE_NAME","initiateAuth","getSignInResult","_x24","_getSignInResult","availableChallenges","additionalInfo","mfaSetupTypes","getMFATypes","parseMFATypes","allowedMfaSetupTypes","getAllowedMfaSetupTypes","availableMfaSetupTypes","authMfaType","isTotpMfaSetupAvailable","isEmailMfaSetupAvailable","allowedMFATypes","associateSoftwareToken","SecretCode","secretCode","totpSetupDetails","getTOTPSetupDetails","missingAttributes","parseAttributes","MFAS_CAN_CHOOSE","codeDeliveryDetails","deliveryMedium","CODE_DELIVERY_DELIVERY_MEDIUM","destination","CODE_DELIVERY_DESTINATION","handleWebAuthnSignInResult","isWebAuthnResultAuthSignInOutput","sharedSecret","getSetupUri","accountName","getSignInResultFromError","errorName","att","newAttributes","forEach","key","_handleChallengeName","userAttributes","friendlyDeviceName","initiateSelectedChallenge","handleSelectMFATypeChallenge","handleMFASetupChallenge","handleCompleteNewPasswordChallenge","handleMFAChallenge","_x33","_handleMFAChallenge","handleSelectChallengeWithPassword","handleSelectChallengeWithPasswordSRP","mfa","mfaType","getMFAType","types","Boolean","assertUserNotAuthenticated","_assertUserNotAuthenticated","USER_ALREADY_AUTHENTICATED_EXCEPTION","getActiveSignInUsername","EMAIL_OTP_CODE","SMS_MFA_CODE","SMS_OTP_CODE","SOFTWARE_TOKEN_MFA_CODE","listenForOAuthFlowCancellation","store","handleCancelOAuthFlow","_handleCancelOAuthFlow","persisted","removeEventListener","addEventListener","_signInWithRedirect","provider","custom","oauthConfig","customState","loginHint","lang","nonce","scopes","randomState","randomNums","num","STATE_CHARSET","generateRandomString","urlSafeEncode","padStart","toCodeChallenge","randomBytes","codeChallenge","CODE_VERIFIER_CHARSET","generateCodeChallenge","removePaddingChar","base64Encoded","generateCodeVerifier","storeOAuthInFlight","storeOAuthState","storePKCE","oAuthUrl","response_type","identity_provider","scope","login_hint","code_challenge","code_challenge_method","_confirmSignIn","clientMetaData","handledChallengeName","handledChallengeParameters","handleChallengeName","_x25","_x26","_x27","_x28","_x29","_x30","_x31","_x32","assertServiceError","fetchAuthSession","toAttributeType","Name","Value","fetchUserAttributes","getUser","createGetUserClient","UserAttributes","FetchUserAttributes","toAuthUserAttribute","attribute","fetchUserAttributes$1","fetchAuthSession$1","updateUserAttributes","updateUserAttributesClient","createUpdateUserAttributesClient","CodeDeliveryDetailsList","UpdateUserAttributes","getConfirmedAttributes","getUnConfirmedAttributes","confirmedAttributes","keys","isUpdated","updateAttributeStep","codeDeliveryDetailsList","unConfirmedAttributes","AttributeName","DeliveryMedium","Destination","attributeName","_resetPassword","createForgotPasswordClient","ResetPassword","Username","CodeDeliveryDetails","isPasswordReset","resetPasswordStep","_confirmResetPassword","newPassword","confirmationCode","metadata","createConfirmForgotPasswordClient","ConfirmResetPassword","ConfirmationCode","Password","_signInWithCustomAuth","loginId","authFlowType","retriedChallengeName","retiredChallengeParameters","_signInWithCustomSRPAuth","handleCustomSRPAuthFlow","_x19","_x20","_x21","_x22","_x23","autoSignInStore","active","autoSignInReducer","initialAutoSignIn","AUTO_SIGN_IN_EXCEPTION","autoSignIn","setAutoSignIn","resetAutoSignIn","resetCallback","_signInWithSRP","handleUserSRPAuthFlow","_x10","_x11","_x12","_x13","_x14","_signInWithUserPassword","retiredChallengeName","retriedChallengeParameters","_handleUserAuthFlow","signInWithUserAuth","_signInWithUserAuth","handleUserAuthFlowInput","tokenProvider","o","autoSignInStoreState","handleUserAuthFlow","AvailableChallenges","signIn","_signIn","signInWithSRP","signInWithUserPassword","signInWithCustomAuth","signInWithCustomSRPAuth","debounce","fun","delay","timer","clearTimeout","setTimeout","debouncedAutoSignInWithLink","handleAutoSignInWithLink","signInInput","start","autoSignInPollingIntervalId","setInterval","clearInterval","signInOutput","debouncedAutoSignWithCodeOrUserConfirmed","handleAutoSignInWithCodeOrUserConfirmed","_handleAutoSignInWithCodeOrUserConfirmed","autoSignInWithCode","autoSignInUserConfirmed","createSignUpClientDeserializer","statusCode","parseJsonError","parseJsonBody","_signUp","signUpVerificationMethod","validationData","signInServiceOptions","signUpClient","createSignUpClient","signUpClientInput","ValidationData","UserSub","cdd","UserConfirmed","userConfirmed","SignUp","isSignUpComplete","isAutoSignInStarted","signUpStep","autoSignInWhenUserIsConfirmedWithLink","handleCodeAutoSignIn","stopHubListener","HubInternal","listen","timeOutId","clearCredentials","completeOAuthSignOut","clearTokens","oAuthSignOutRedirect","redirectSignOut","signoutUri","oAuthLogoutEndpoint","logout_uri","handleOAuthSignOut","cognitoConfig","isOAuthSignIn","loadOAuthSignIn","oauthMetadata","getOAuthMetadata","createRevokeTokenClient","createGlobalSignOutClient","logger","_signOut","hasOAuthConfig","global","globalSignOut","_globalSignOut","clientSignOut","_clientSignOut","DefaultOAuthStore","defaultStorage","OAUTH_SIGNOUT_EXCEPTION","authTokens","getTokenStore","loadTokens","assertAuthTokensWithRefreshToken","isSessionRevocable","SignOut","Token","debug","origin_jti","StorageValidationErrorCode","NoCredentials","NoIdentityId","NoKey","NoSourceKey","NoDestinationKey","NoSourcePath","NoDestinationPath","NoBucket","NoRegion","InvalidStorageBucket","InvalidCopyOperationStorageBucket","InvalidStorageOperationPrefixInput","InvalidStorageOperationInput","InvalidAWSAccountID","InvalidStoragePathInput","InvalidUploadSource","ObjectIsTooLarge","UrlExpirationMaxLimitExceed","InvalidLocationCredentialsCacheSize","LocationCredentialsStoreDestroyed","InvalidS3Uri","InvalidCustomEndpoint","ForcePathStyleEndpointNotSupported","DnsIncompatibleBucketName","AMZ_DATE_QUERY_PARAM","TOKEN_QUERY_PARAM","HOST_HEADER","AMZ_DATE_HEADER","TOKEN_HEADER","KEY_TYPE_IDENTIFIER","SHA256_ALGORITHM_IDENTIFIER","EMPTY_HASH","getSigningValues","signingDate","signingRegion","signingService","uriEscapePath","accessKeyId","secretAccessKey","sessionToken","longDate","shortDate","date","toISOString","getFormattedDates","credentialScope","getCredentialScope","service","getHashedData","getHashedDataAsHex","toHex","getCanonicalHeaders","trim","sort","entry","getCanonicalQueryString","keyA","valA","keyB","valB","val","escapeUri","hexEncode","getCanonicalUri","getHashedPayload","isSourceData","ArrayBuffer","isView","isArrayBuffer","arg","call","getSignedHeaders","getSignature","request","canonicalRequest","getCanonicalRequest","stringToSign","getStringToSign","hashedRequest","getSigningKey","dateKey","regionKey","serviceKey","NETWORK_ERROR_MESSAGE","ABORT_ERROR_MESSAGE","CONTENT_SHA256_HEADER","getSkewCorrectedDate","systemClockOffset","StorageError","CanceledError","convertToTransferProgressEvent","transferredBytes","loaded","totalBytes","lengthComputable","total","FORBIDDEN_HEADERS","s3TransferHandler","composeTransferHandler","xhrTransferHandler","onDownloadProgress","onUploadProgress","abortSignal","xhr","XMLHttpRequest","open","header","setRequestHeader","upload","networkError","aborted","buildHandlerError","readyState","DONE","onloadend","responseHeaders","xhrHeaders","headerMap","line","parts","shift","convertResponseHeaders","getAllResponseHeaders","loadEndResponseType","responseBlob","responseText","bodyMixIn","blob","text","withMemoization","reader","FileReader","onerror","readAsText","readBlobAsText","status","assign","onCanceled","canceledError","abort","ReadableStream","send","contentSha256MiddlewareFactory","next","_contentSha256Middleware","contentSha256Middleware","userAgentMiddlewareFactory","retryMiddlewareFactory","signingMiddlewareFactory","currentSystemClockOffset","_signingMiddleware","signRequestOptions","isCredentialsExpired","signedRequest","signRequest","signingValues","host","requestToSign","credentialEntry","signedHeadersEntry","dateString","getDateHeader","getUpdatedSystemClockOffset","clockTimeInMilliseconds","isClockSkewed","clockOffsetInMilliseconds","signingMiddleware","obj","instructions","instruction","accessor","deserializer","isArray","hasOwnProperty","deserializeNumber","deserializeBoolean","deserializeTimestamp","emptyArrayGuard","deserializeMetadata","objectMetadataHeaderPrefix","deserialized","acc","buildStorageServiceError","storageError","deserializeCompletedPartList","item","PartNumber","ETag","ChecksumCRC32","extendedEncodeURIComponent","assignStringVariables","queryParams","serializeObjectConfigsToHeaders","ACL","CacheControl","ContentDisposition","ContentLanguage","ContentEncoding","ContentType","expires","Expires","toUTCString","Tagging","serializeMetadata","Metadata","suffix","serializePathnameObjectKey","validateS3RequiredParameter","paramName","TypeError","IntegrityError","validateObjectUrl","bucketName","objectURL","bucketWithDots","encodedBucketName","encodedKey","isPathStyleUrl","isSubdomainUrl","parser","xmlStr","xml","DOMParser","parseFromString","parsedObj","parseXmlNode","node","isDocumentNode","documentElement","nodeName","nodeType","Node","TEXT_NODE","nodeValue","isElementNode","isTextOnlyElementNode","childNodes","attr","isNamespaceAttributeName","children","child","childValue","childName","ELEMENT_NODE","DOCUMENT_NODE","hasOnlyNamespaceAttributes","firstChild","parseXmlBody","INVALID_TOKEN_ERROR_CODES","LOCAL_TESTING_S3_ENDPOINT","DEFAULT_PART_SIZE","UPLOADS_STORAGE_KEY","STORAGE_INPUT_KEY","DOMAIN_PATTERN","IP_ADDRESS_PATTERN","DOTS_PATTERN","parseXmlError","createXmlErrorParser","noErrorWrapping","errorLocation","Code","Message","parseMetadata","retryDecider","errorParser","middlewareContext","defaultRetryDecision","getRetryDecider","retryable","parsedError","isCredentialsExpiredError","errorCode","isExpiredTokenError","isExpiredSignatureError","defaultConfig","apiInput","useAccelerateEndpoint","customEndpoint","forcePathStyle","endpoint","getDnsSuffix","Bucket","isDnsCompatibleBucketName","computeDelay","jitteredBackoff","getObjectSerializer","Key","Range","ExpectedBucketOwner","getObjectDeserializer","DeleteMarker","AcceptRanges","Expiration","Restore","LastModified","ContentLength","ChecksumCRC32C","ChecksumSHA1","ChecksumSHA256","MissingMeta","VersionId","ContentRange","WebsiteRedirectLocation","ServerSideEncryption","SSECustomerAlgorithm","SSECustomerKeyMD5","SSEKMSKeyId","BucketKeyEnabled","StorageClass","RequestCharged","ReplicationStatus","PartsCount","TagCount","ObjectLockMode","ObjectLockRetainUntilDate","ObjectLockLegalHoldStatus","Body","getPresignedGetObjectUrl","getObject","append","EMPTY_SHA256_HASH","userAgentHeader","ResponseContentType","ResponseContentDisposition","headerName","key1","key2","localeCompare","presignUrl","expiration","presignedUrl","sr","co","resolvePrefix","accessLevel","targetIdentityId","resolveS3ConfigAndInput","apiOptions","identityId","credentialsProvider","isLocationCredentialsProvider","assertStorageInput","locationCredentialsProvider","bucket","defaultBucket","defaultRegion","dangerouslyConnectToHttpEndpointForTesting","buckets","Storage","S3","resolveBucketConfig","defaultAccessLevel","prefixResolver","isObjectLockEnabled","libraryOptions","keyPrefix","s3Config","isInputWithKey","isInputWithPrefix","isInputWithCopySourceOrDestination","isDeprecatedInput","path","source","isInputWithCallbackPath","prefix","bucketConfig","VALID_AWS_ACCOUNT_ID_PATTERN","validateBucketOwnerID","accountID","resolveIdentityId","validateStorageOperationInput","isInputWithPath","objectKey","inputType","constructContentDisposition","contentDisposition","filename","headObjectSerializer","headObjectDeserializer","contents","headObject","getStorageUserAgentValue","getProperties","expectedBucketOwner","finalKey","StorageAction","GetProperties","contentType","size","eTag","lastModified","versionId","getUrl","getUrlOptions","validateObjectExistence","GetUrl","urlExpirationInSec","expiresIn","resolvedCredential","awsCredExpiration","awsCredExpirationInSec","MAX_URL_EXPIRATION","expiresAt","createUploadTask","job","onCancel","onResume","onPause","isMultipartUpload","cancellableTask","createCancellableTask","canceledErrorMessage","cancelableTask","cancel","taskState","wrappedJobPromise","isCancelError","uploadTask","pause","resume","INIT","Md5","reset","sourceData","isEmptyData","finished","convertToBuffer","fromUtf8","byteOffset","BYTES_PER_ELEMENT","position","bytesHashed","setUint8","bufferLength","hashBuffer","digest","undecoratedLength","bitsHashed","BLOCK_SIZE","setUint32","DataView","ff","getUint32","gg","hh","ii","cmn","toBase64","bytesToBase64","base64Str","btoa","readFile","file","onload","onabort","readAsArrayBuffer","calculateContentMd5","content","hasher","Blob","putObjectSerializer","ContentMD5","IfNoneMatch","putObjectDeserializer","putObject","hexToUint8Array","hexString","hexToArrayBuffer","hexToBase64","calculateContentCRC32","seed","internalSeed","uint8Array","offset","end","chunk","crc32","arrayBuffer","checksumArrayBuffer","checksum","putObjectJob","uploadDataInput","totalLength","uploadDataOptions","contentEncoding","preventOverwrite","checksumAlgorithm","onProgress","checksumCRC32","contentMD5","UploadData","isObject","isEqual","object","other","every","ix","objectKeys","otherKeys","INVALID_PARAMETER_ERROR_MSG","completeMultipartUploadSerializer","UploadId","search","AmplifyUrlSearchParams","uploadId","MultipartUpload","serializeCompletedMultipartUpload","validateMultipartUploadXML","Parts","parsedXML","mappedCompletedMultipartUpload","serializeCompletedPartList","parseXmlBodyOrThrow","parsed","completeMultipartUploadDeserializer","Location","retryWhenErrorWith200StatusCode","completeMultipartUpload","abortMultipartUploadDeserializer","abortMultipartUpload","abortMultipartUploadSerializer","uploadPartSerializer","partNumber","uploadPartDeserializer","uploadPart","uploadPartExecutor","dataChunkerGenerator","completedPartNumberSet","onPartUploadCompletion","useCRC32Checksum","has","currentPartTransferredBytes","listPartsSerializer","listPartsDeserializer","listParts","findCachedUploadParts","resumableUploadsCache","cacheKey","cachedUploads","listCachedUploadTasks","lastTouched","cachedUpload","finalCrc32","removeCachedUpload","getUploadsCacheKey","optionsHash","levelStr","baseId","cacheMultipartUpload","fileMetadata","createMultipartUploadSerializer","ChecksumAlgorithm","createMultipartUploadDeserializer","createMultipartUpload","calculatePartSize","totalSize","partSize","partsCount","ceil","getDataChunker","helper","startByte","endByte","getCombinedCrc32","crc32List","dataChunker","checkData","combinedArray","crc32Hash","loadOrCreateMultipartUpload","uploadCacheKey","File","cachedUploadParts","cachedParts","fileName","getMultipartUploadHandlers","resolveCallback","rejectCallback","inProgressUpload","resolvedS3Config","abortController","resolvedAccessLevel","resolvedBucket","resolvedKeyPrefix","resolvedIdentityId","isAbortSignalFromPause","startUpload","resolvedS3Options","AbortController","resolveAccessLevel","serializeUploadOptions","unserializableOptionProperties","serializableOptions","fromEntries","signal","completedParts","Set","concurrentUploadsProgressTracker","getConcurrentUploadsProgressTracker","transferredBytesPerListener","getOnProgressListener","listenerIndex","concurrentUploadPartExecutors","index","all","validateCompletedParts","sortUploadParts","uploadedObjectSize","startUploadWithResumability","catch","multipartUploadJob","DEFAULT_ACCESS_LEVEL","partsExpected","validPartCount","validPartNumbers","part","partA","partB","deleteObjectDeserializer","deleteObject","deleteObjectSerializer","remove","Remove","AuthService","_AuthService","httpOptions","signUp","email","given_name","firstName","family_name","lastName","phone_number","phone","nickname","nickName","mapKey","loggedIn","signOut","socialSignIn","returnURL","Cache","signInWithRedirect","autoLogIn","confirmSignIn","signInUser","authenticationFlowType","updateReservation","userInfo","console","API_COGNITO","userLoggedIn","validTokenBookin","res","identities","providerType","picture","getUrl$1","pictureURL","currentUserData","fetchAuthData","updateUserPhoto","lastIndexOf","uploadData","dataByteLength","uploadData$1","deleteUserPhoto","remove$1","sendConfirmationCode","resetPassword","recoverPasswordUsingCode","confirmResetPassword","SIGN_IN","SIGN_OUT","FACEBOOK","GOOGLE","AccordionTabComponent","_AccordionTabComponent","ngOnInit","selectors","contentQueries","rf","ctx","dirIndex","TemplateRef","i_r2","_r1","reference_r3","ctx_r3","onAccordionTabClick","AccordionComponent_div_1_ng_container_1_ng_container_7_Template","_c0","accordionTabs","accordionTab_r5","title","selectedTab","AccordionComponent_div_1_ng_container_1_Template","i_r7","_r6","reference_r8","AccordionComponent_ng_container_2_ng_container_2_ng_container_8_Template","accordionTab_r9","AccordionComponent_ng_container_2_ng_container_2_Template","i_r11","_r10","reference_r12","AccordionComponent_ng_container_3_ng_container_1_ng_container_8_Template","icon","accordionTab_r13","AccordionComponent_ng_container_3_ng_container_1_Template","AccordionComponent","_AccordionComponent","accordionType","el","isInViewPort","scrollIntoView","behavior","rect","getBoundingClientRect","top","left","bottom","innerHeight","document","clientHeight","right","innerWidth","clientWidth","AccordionComponent_div_1_Template","AccordionComponent_ng_container_2_Template","AccordionComponent_ng_container_3_Template","trigger","style","height","transition","animate","transform","loc_r2","$implicit","ctx_r2","changeLocale","label","IconLangComponent","_IconLangComponent","localeService","appHotelService","listLocaleAll","cod","flag","codLocale","getLocale","arr","subscriptionHotel","subscribe","rta","init","locale","home","languages","_a","listHotelLanguage","lan","listLocale","setLocale","decls","vars","consts","template","IconLangComponent_li_6_Template","ctx_r0","darkThemeEnabled","logoUrl_dark","logoUrl_light","_r2","toggleMenu","optionMenu_r3","routerLink","_r4","_r5","routeHotel","option_r6","MenuToggleComponent_li_19_ng_container_4_ng_template_4_a_0_Template","MenuToggleComponent_li_19_ng_container_4_ng_template_4_Template","MenuToggleComponent_li_19_ng_container_1_Template","MenuToggleComponent_li_19_ng_container_2_Template","MenuToggleComponent_li_19_div_3_Template","MenuToggleComponent_li_19_ng_container_4_Template","MenuToggleComponent_li_19_div_5_Template","web","divider","appHotelData","RNTCode","tmp_1_0","CompanyIdentificationNumber","MenuToggleComponent","_MenuToggleComponent","router","activatedRoute","homeDataStorageService","menuDataStorageService","menuAbierto","versionAPP","APP_CONSTANTS","contact","navText","_b","city","Country","slug","_c","menuList","optionsMenu","ngOnDestroy","unsubscribe","SetMenuHome","hotelMenu","SOCIAL_NETWORKS_GHL","setMenuHotel","loadSocialMedia","rnt","Logo","Logo_Dark","getMenu","EventRooms","hotel_plans","plansEnabled","today","plan","InitialDate","FinalDate","offers","offersEnabled","offer","InitialEffectiveDate","FinalEffectiveDate","getSocialMedia","SocialMedia","SocialMediaType","Instagram","Twitter","navigate","menuItem","i5","inputs","MenuToggleComponent_div_12_Template","MenuToggleComponent_div_13_Template","MenuToggleComponent_li_19_Template","MenuToggleComponent_ng_container_28_Template","MenuToggleComponent_ng_container_29_Template","ModalPageType","modal","center","detailsContainerStyles","detailsContainerclass","ModalPageComponent","_ModalPageComponent","menuHeight","newValue","_menuHeight","ready","windowResize","width","modalActive","openModal","cd","InstallService","modalPageType","menuWidth","margin","allowedToInstall","detectChanges","closeModal","hostBindings","ModalPageComponent_div_0_Template","_c1","PreloaderComponent","_PreloaderComponent","fullPage","color","spinnerClass","SocialNetworksComponent","_SocialNetworksComponent","ngAfterViewInit","socialNetworks","nativeElement","querySelectorAll","classList","viewQuery","SocialNetworksComponent_a_2_Template","SocialNetworksComponent_a_3_Template","SocialNetworksComponent_a_4_Template","SocialNetworksComponent_a_5_Template","PageHeightDirective","_PageHeightDirective","calculateHeight","isHeaderClear","parentElement","contains","currentHeight","valid","hostVars","ToggleThemeDirective","_ToggleThemeDirective","switchTheme","ToggleTheme","toggleTheme","LocationAppService","_LocationAppService","CRC32","T0","signed_crc_table","table","Int32Array","TT","slice_by_16_tables","T","subarray","T1","T2","T3","T4","T5","T6","T7","T8","T9","Ta","Tb","Tc","Td","Te","Tf","bstr","crc32_bstr","C","L","buf","crc32_buf","crc32_str","DO_NOT_EXPORT_CRC","exports"],"ignoreList":[],"sourceRoot":"webpack:///","sources":["./src/app/modules/ghlplus/queries/appsync.queries.ts","./src/app/modules/ghlplus/muations/appsync.mutations.ts","./src/app/modules/ghlplus/services/app-sync.service.ts","./node_modules/@aws-amplify/auth/dist/esm/utils/getAuthUserAgentValue.mjs","./node_modules/@aws-amplify/core/dist/esm/utils/urlSafeDecode.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/tokenProvider/cacheTokens.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/providers/cognito/utils/dispatchSignedInHubEvent.mjs","./node_modules/@aws-amplify/auth/dist/esm/errors/types/validation.mjs","./node_modules/@aws-amplify/auth/dist/esm/common/AuthErrorStrings.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/getRedirectUrl.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/utils/openAuthSession.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/types/errors.mjs","./node_modules/@aws-amplify/auth/dist/esm/errors/utils/assertValidationError.mjs","./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.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/store/signInStore.mjs","./node_modules/@aws-amplify/auth/dist/esm/client/utils/passkey/errors.mjs","./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/base64Encoder.mjs","./node_modules/@aws-amplify/core/dist/esm/utils/convert/base64/bytesToString.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/getPasskey.mjs","./node_modules/@aws-amplify/auth/dist/esm/client/utils/passkey/getIsPasskeySupported.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/core/dist/esm/utils/deviceName/getDeviceName.mjs","./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmDeviceClient.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/textEncoder/index.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/BigInteger/BigInteger.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/constants.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getBytesFromHex.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/core/dist/esm/utils/WordArray.mjs","./node_modules/@aws-amplify/core/dist/esm/utils/cryptoSecureRandomInt.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/AuthenticationHelper/AuthenticationHelper.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/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/calculate/calculateA.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getAuthenticationHelper.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/getNewDeviceMetadata.mjs","./node_modules/@aws-amplify/auth/dist/esm/client/flows/userAuth/handleWebAuthnSignInResult.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getNowString.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/srp/getSignatureString.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/handleDeviceSRPAuth.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/handlePasswordVerifierChallenge.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/retryOnResourceNotFoundException.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/setActiveSignInUsername.mjs","./node_modules/@aws-amplify/auth/dist/esm/client/flows/shared/handlePasswordSRP.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/utils/oauth/generateCodeVerifier.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/core/dist/esm/utils/generateRandomString.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/utils/oauth/generateState.mjs","./node_modules/@aws-amplify/core/dist/esm/utils/urlSafeEncode.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/confirmSignIn.mjs","./node_modules/@aws-amplify/core/dist/esm/singleton/apis/internal/fetchAuthSession.mjs","./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/core/dist/esm/singleton/apis/fetchAuthSession.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/updateUserAttributes.mjs","./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createUpdateUserAttributesClient.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/resetPassword.mjs","./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createForgotPasswordClient.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/confirmResetPassword.mjs","./node_modules/@aws-amplify/auth/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmForgotPasswordClient.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/client/utils/store/autoSignInStore.mjs","./node_modules/@aws-amplify/auth/dist/esm/providers/cognito/apis/autoSignIn.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/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/signIn.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/core/dist/esm/singleton/apis/clearCredentials.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/storage/dist/esm/errors/types/validation.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/constants.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getSigningValues.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getFormattedDates.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getCredentialScope.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/dataHashHelpers.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalHeaders.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalQueryString.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalUri.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getHashedPayload.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getSignedHeaders.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getSignature.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getCanonicalRequest.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getStringToSign.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/utils/getSigningKey.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/constants.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/signRequest.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/utils/getSkewCorrectedDate.mjs","./node_modules/@aws-amplify/storage/dist/esm/errors/StorageError.mjs","./node_modules/@aws-amplify/storage/dist/esm/errors/CanceledError.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/xhrTransferHandler.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/s3TransferHandler/xhr.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/contentSha256middleware.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/middleware.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/utils/getUpdatedSystemClockOffset.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/utils/isClockSkewed.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/utils/deserializeHelpers.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/utils/extendedEncodeURIComponent.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/utils/serializeHelpers.mjs","./node_modules/@aws-amplify/storage/dist/esm/errors/IntegrityError.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/validateObjectUrl.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/xmlParser/dom.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/utils/parsePayload.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/utils/createRetryDecider.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/constants.mjs","./node_modules/@aws-amplify/storage/dist/esm/errors/utils/assertValidationError.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/base.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/getObject.mjs","./node_modules/@aws-amplify/core/dist/esm/clients/middleware/signing/signer/signatureV4/presignUrl.mjs","./node_modules/@aws-amplify/storage/dist/esm/utils/resolvePrefix.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/resolveS3ConfigAndInput.mjs","./node_modules/@aws-amplify/storage/dist/esm/errors/constants.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/validateBucketOwnerID.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/resolveIdentityId.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/validateStorageOperationInput.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/isInputWithPath.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/constructContentDisposition.mjs","./node_modules/@aws-amplify/storage/dist/esm/utils/logger.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/headObject.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/userAgent.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/getProperties.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/getUrl.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/transferTask.mjs","./node_modules/@smithy/md5-js/dist-es/constants.js","./node_modules/@smithy/md5-js/dist-es/index.js","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/runtime/base64/index.browser.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/readFile.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/md5.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/putObject.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/hexUtils.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/crc32.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/uploadData/putObjectJob.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/utils/integrityHelpers.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/completeMultipartUpload.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/validateMultipartUploadXML.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/abortMultipartUpload.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/uploadPart.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadPartExecutor.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/listParts.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadCache.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/createMultipartUpload.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/uploadData/multipart/calculatePartSize.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/uploadData/multipart/getDataChunker.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/getCombinedCrc32.native.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/uploadData/multipart/initialUpload.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/uploadData/multipart/uploadHandlers.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/uploadData/multipart/progressTracker.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/utils/client/s3data/deleteObject.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/remove.mjs","./src/app/modules/ghlplus/services/auth.service.ts","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/getUrl.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/uploadData.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/uploadData/index.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/internal/uploadData/byteLength.mjs","./node_modules/@aws-amplify/storage/dist/esm/providers/s3/apis/remove.mjs","./src/app/modules/shared/components/accordion-tab/accordion-tab.component.ts","./src/app/modules/shared/components/accordion/accordion.component.html","./src/app/modules/shared/components/accordion/accordion.component.ts","./src/app/modules/shared/components/icon-lang/icon-lang.component.html","./src/app/modules/shared/components/icon-lang/icon-lang.component.ts","./src/app/modules/shared/components/menu-toggle/menu-toggle.component.html","./src/app/modules/shared/components/menu-toggle/menu-toggle.component.ts","./src/app/modules/shared/enums/modal-page-type.enum.ts","./src/app/modules/shared/components/modal-page/modal-page.component.html","./src/app/modules/shared/components/modal-page/modal-page.component.ts","./src/app/modules/shared/components/preloader/preloader.component.ts","./src/app/modules/shared/components/preloader/preloader.component.html","./src/app/modules/shared/components/social-networks/social-networks.component.html","./src/app/modules/shared/components/social-networks/social-networks.component.ts","./src/app/modules/shared/directives/page-height.directive.ts","./src/app/modules/shared/directives/toggle-theme.directive.ts","./src/app/modules/shared/services/location-app.service.ts","./node_modules/crc-32/crc32.js"],"sourcesContent":["import {gql} from 'apollo-angular';\n\nexport const getReservationsByUser = gql`query getReservationsByUser($userId: String!){\n getReservationsByUser(userId:$userId){\n ReservationData{\n idHotel\n State\n ArriveDate\n ReservationDate\n DepartureDate\n RoomType\n }\n _id\n }\n}`;\n\nexport const getReservationById = gql`query getReservationById($reservationId: String!){\n getReservationById(reservationId:$reservationId){\n ReservationData{\n idHotel\n ReservationDate\n ReservationNumber\n OriginCity\n CompanyName\n AdultsNumber\n KidsNumber\n State\n ArriveDate\n DepartureDate\n RoomType\n }\n _id\n }\n}`;\n\nexport const getCheckInByUser = gql`query getCheckInByUser($userId: String!){\n getCheckInByUser(userId:$userId){\n InHouseData{\n idHotel\n ArriveDate\n DepartureDate\n RoomNumber\n PhoneNumber\n }\n PersonalData{\n GuestName\n }\n _id\n }\n}`;\n\nexport const searchReservationByNumber = gql`query searchReservationByNumber($checkin: String!, $checkout: String!, $reservationNumber: String!){\n searchReservationByNumber(checkin:$checkin, checkout:$checkout, reservationNumber:$reservationNumber){\n ReservationData{\n idHotel\n State\n ArriveDate\n ReservationDate\n DepartureDate\n RoomType\n }\n _id\n }\n}`;\n\nexport const searchReservationByLocator = gql`query searchReservationByLocator($checkin: String!, $locator: String!){\n searchReservationByLocator( checkin:$checkin, locator:$locator){\n ReservationData{\n idHotel\n State\n ArriveDate\n ReservationDate\n DepartureDate\n RoomType\n }\n _id\n }\n}`;","import {gql} from 'apollo-angular';\n\nexport const updateReservationUser = gql`mutation updateReservationUser($input: UpdateReservationUserInput!){\n updateReservationUser(input:$input){\n _id\n }\n}`;\n","import { Injectable } from '@angular/core';\nimport { Apollo } from 'apollo-angular';\nimport { AuthService } from './auth.service';\n// import AWSAppSyncClient from 'aws-appsync';\nimport { awsmobile } from '../config/aws-exports';\nimport { getCheckInByUser, getReservationById, getReservationsByUser, searchReservationByLocator, searchReservationByNumber } from '../queries/appsync.queries';\nimport {\n GetCheckInByUserQuery,\n GetReservationByIdQuery,\n GetReservationsByUserQuery,\n SearchReservationByLocatorQuery,\n SearchReservationByNumberQuery,\n UpdateReservationUserInput,\n UpdateReservationUserMutation\n} from 'src/app/generatedGQLTypes';\nimport { map } from 'rxjs/operators';\nimport { InMemoryCache } from '@apollo/client/core';\nimport { updateReservationUser } from '../muations/appsync.mutations';\nimport { setContext } from '@apollo/client/link/context';\nimport { HttpLink } from 'apollo-angular/http';\nimport { ApolloLink } from '@apollo/client/core';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { environment } from 'src/environments/environment';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AppSyncService {\n\n constructor(\n private authService: AuthService,\n private apollo: Apollo,\n private httpLink:HttpLink,\n private http:HttpClient\n ) { }\n\n getReservationsByUser(): Promise {\n this.initAppSyncClient();\n return this.authService.getUserInfo().then(\n user => this.apollo.use('appSync').query({\n query: getReservationsByUser,\n variables: {\n userId: user?.attributes?.sub\n }\n }).pipe(map(changes => changes.data.getReservationsByUser)).toPromise(),\n )\n }\n\n async initAppSyncClient() {\n if (!this.apollo.use('appSync')) {\n\n const cache = new InMemoryCache();\n const uri = awsmobile.aws_appsync_graphqlEndpoint;\n const token = (await this.authService.getJwtToken())\n const headers = new HttpHeaders({ Authorization: `JWT ${token}`, \"x-api-key\": awsmobile.aws_appsync_apiKey })\n const link = this.httpLink.create({ uri: uri, headers });\n const opcionAppSync = {\n link,\n cache\n }\n this.apollo.createNamed('appSync', opcionAppSync)\n\n\n // const appsyncClient = new AWSAppSyncClient({\n // url: awsmobile.aws_appsync_graphqlEndpoint,\n // region: awsmobile.aws_appsync_region,\n // auth: {\n // type: awsmobile.aws_appsync_authenticationType,\n // apiKey: awsmobile.aws_appsync_apiKey,\n // jwtToken: async () => (await this.authService.getJwtToken())\n // },\n // disableOffline: true,\n // }, { cache });\n // this.apollo.createNamed('appSync', appsyncClient)\n }\n }\n\n getReservationById(id: string): Promise {\n this.initAppSyncClient();\n return this.authService.getUserInfo().then(\n user => this.apollo.use('appSync').query({\n query: getReservationById,\n variables: {\n reservationId: id\n }\n }).pipe(map(changes => changes.data.getReservationById)).toPromise(),\n )\n }\n\n getCheckInByUser(): Promise {\n this.initAppSyncClient();\n return this.authService.getUserInfo().then(\n user => this.apollo.use('appSync').query({\n query: getCheckInByUser,\n variables: {\n userId: user?.attributes?.sub\n }\n }).pipe(map(changes => changes.data.getCheckInByUser)).toPromise(),\n )\n }\n\n searchReservationByNumber(checkin: string, checkout: string, reservationNumber: string): Promise {\n this.initAppSyncClient();\n return this.apollo.use('appSync').query({\n query: searchReservationByNumber,\n variables: {\n checkin: checkin,\n checkout: checkout,\n reservationNumber: reservationNumber\n }\n }).pipe(map(changes => changes.data.searchReservationByNumber)).toPromise()\n }\n\n searchReservationByLocator(locator: string, checkin: string): Promise {\n this.initAppSyncClient();\n return this.apollo.use('appSync').query({\n query: searchReservationByLocator,\n variables: {\n checkin: checkin,\n locator: locator\n }\n }).pipe(map(changes => changes.data.searchReservationByLocator)).toPromise()\n }\n\n linkReservationToUser(reservationId: string): Promise {\n this.initAppSyncClient();\n return this.authService.getUserInfo().then(\n user => {\n let updateReservationUserInput: UpdateReservationUserInput = {\n _id: reservationId,\n userId: user?.sub\n }\n return this.apollo.use('appSync').mutate({\n mutation: updateReservationUser,\n variables: { input: updateReservationUserInput }\n }).pipe(map(changes => changes.data.updateReservationUser)).toPromise();\n }\n )\n }\n\n singInGuestService(params:any){\n let url = `${environment.MICRO_GS_LOGIN_APP}singInApp`;\n return this.http.post(url, params);\n }\n\n getHeaderToken(){\n const token = localStorage.getItem('hash_guest_service');\n return {\n 'Authorization': `Bearer ${token}`\n };\n }\n\n getDataBillinStatement(){\n let url = `${environment.MICRO_GS_LOGIN_APP}getBillingStatement`;\n return this.http.get(url, {\n headers:this.getHeaderToken()\n });\n }\n}\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","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction urlSafeDecode(hex) {\n const matchArr = hex.match(/.{2}/g) || [];\n return matchArr.map(char => String.fromCharCode(parseInt(char, 16))).join('');\n}\n\nexport { urlSafeDecode };\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 { 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","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","// 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 { 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 { 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 TokenType: token_type,\n ExpiresIn: expires_in,\n });\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 TokenType: token_type,\n ExpiresIn: expires_in,\n });\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 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 clearHistory(redirectUri);\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 { invalidPreferredRedirectUrlException, invalidOriginException, invalidRedirectException } 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 { 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","// 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 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","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 { 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 { 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 { 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 { 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 { getBtoa } from '../../globalHelpers/index.mjs';\nimport { bytesToString } from './bytesToString.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst base64Encoder = {\n /**\n * Convert input to base64-encoded string\n * @param input - string to convert to base64\n * @param options - encoding options that can optionally produce a base64url string\n * @returns base64-encoded string\n */\n convert(input, options = {\n urlSafe: false,\n skipPadding: false,\n }) {\n const inputStr = typeof input === 'string' ? input : bytesToString(input);\n let encodedStr = getBtoa()(inputStr);\n // urlSafe char replacement and skipPadding options conform to the base64url spec\n // https://datatracker.ietf.org/doc/html/rfc4648#section-5\n if (options.urlSafe) {\n encodedStr = encodedStr.replace(/\\+/g, '-').replace(/\\//g, '_');\n }\n if (options.skipPadding) {\n encodedStr = encodedStr.replace(/=/g, '');\n }\n return encodedStr;\n },\n};\n\nexport { base64Encoder };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction bytesToString(input) {\n return Array.from(input, byte => String.fromCodePoint(byte)).join('');\n}\n\nexport { bytesToString };\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 { 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 { 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 { 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","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Retrieves the device name using the User-Agent Client Hints API if available,\n * falling back to the traditional userAgent string if not.\n *\n * @returns {Promise} A promise that resolves with a string representing the device name.\n *\n * Example Output:\n * navigator.userAgentData:\n * 'macOS 14.2.1 arm macOS Not A(Brand/99.0.0.0;Google Chrome/121.0.6167.160;Chromium/121.0.6167.160'\n * navigator.userAgent:\n * 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:109.0) Gecko/20100101 Firefox/115.0'\n */\nconst getDeviceName = async () => {\n const { userAgentData } = navigator;\n if (!userAgentData)\n return navigator.userAgent;\n const { platform = '', platformVersion = '', model = '', architecture = '', fullVersionList = [], } = await userAgentData.getHighEntropyValues([\n 'platform',\n 'platformVersion',\n 'architecture',\n 'model',\n 'fullVersionList',\n ]);\n const versionList = fullVersionList\n .map((v) => `${v.brand}/${v.version}`)\n .join(';');\n const deviceName = [\n platform,\n platformVersion,\n architecture,\n model,\n platform,\n versionList,\n ]\n .filter(value => value)\n .join(' ');\n return deviceName || navigator.userAgent;\n};\n\nexport { getDeviceName };\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","// 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","/* 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","// 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","// 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 { 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","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 { cryptoSecureRandomInt } from './cryptoSecureRandomInt.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Hex encoding strategy.\n * Converts a word array to a hex string.\n * @param {WordArray} wordArray The word array.\n * @return {string} The hex string.\n * @static\n */\nfunction hexStringify(wordArray) {\n // Shortcuts\n const { words } = wordArray;\n const { sigBytes } = wordArray;\n // Convert\n const hexChars = [];\n for (let i = 0; i < sigBytes; i++) {\n const bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\n hexChars.push((bite >>> 4).toString(16));\n hexChars.push((bite & 0x0f).toString(16));\n }\n return hexChars.join('');\n}\nclass WordArray {\n constructor(words, sigBytes) {\n this.words = [];\n let Words = words;\n Words = this.words = Words || [];\n if (sigBytes !== undefined) {\n this.sigBytes = sigBytes;\n }\n else {\n this.sigBytes = Words.length * 4;\n }\n }\n random(nBytes) {\n const words = [];\n for (let i = 0; i < nBytes; i += 4) {\n words.push(cryptoSecureRandomInt());\n }\n return new WordArray(words, nBytes);\n }\n toString() {\n return hexStringify(this);\n }\n}\n\nexport { WordArray };\n","import { getCrypto } from './globalHelpers/index.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/*\n * Cryptographically secure pseudorandom number generator\n * As Math.random() is cryptographically not safe to use\n */\nfunction cryptoSecureRandomInt() {\n const crypto = getCrypto();\n const randomResult = crypto.getRandomValues(new Uint32Array(1))[0];\n return randomResult;\n}\n\nexport { cryptoSecureRandomInt };\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 { 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}\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 { 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 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 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","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 { 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","// 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 { 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","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 { 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","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 '../../../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","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} 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","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} 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} 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} 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 { 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 { 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 { getCrypto } from './globalHelpers/index.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst generateRandomString = (length) => {\n const STATE_CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const result = [];\n const randomNums = new Uint8Array(length);\n getCrypto().getRandomValues(randomNums);\n for (const num of randomNums) {\n result.push(STATE_CHARSET[num % STATE_CHARSET.length]);\n }\n return result.join('');\n};\n\nexport { generateRandomString };\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","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction urlSafeEncode(str) {\n return str\n .split('')\n .map(char => char.charCodeAt(0).toString(16).padStart(2, '0'))\n .join('');\n}\n\nexport { urlSafeEncode };\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","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst fetchAuthSession = (amplify, options) => {\n return amplify.Auth.fetchAuthSession(options);\n};\n\nexport { fetchAuthSession };\n","// 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","import { Amplify } from '../Amplify.mjs';\nimport { fetchAuthSession as fetchAuthSession$1 } from './internal/fetchAuthSession.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Fetch the auth session including the tokens and credentials if they are available. By default it\n * does not refresh the auth tokens or credentials if they are loaded in storage already. You can force a refresh\n * with `{ forceRefresh: true }` input.\n *\n * @param options - Options configuring the fetch behavior.\n * @throws {@link AuthError} - Throws error when session information cannot be refreshed.\n * @returns Promise\n */\nconst fetchAuthSession = (options) => {\n return fetchAuthSession$1(Amplify, options);\n};\n\nexport { fetchAuthSession };\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 { toAttributeType } 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 { createUpdateUserAttributesClient } from '../../../foundation/factories/serviceClients/cognitoIdentityProvider/createUpdateUserAttributesClient.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 * Updates user's attributes while authenticated.\n *\n * @param input - The UpdateUserAttributesInput object\n * @returns UpdateUserAttributesOutput\n * @throws - {@link UpdateUserAttributesException}\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nconst updateUserAttributes = async (input) => {\n const { userAttributes, 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 updateUserAttributesClient = createUpdateUserAttributesClient({\n endpointResolver: createCognitoUserPoolEndpointResolver({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { CodeDeliveryDetailsList } = await updateUserAttributesClient({\n region: getRegionFromUserPoolId(userPoolId),\n userAgentValue: getAuthUserAgentValue(AuthAction.UpdateUserAttributes),\n }, {\n AccessToken: tokens.accessToken.toString(),\n ClientMetadata: clientMetadata,\n UserAttributes: toAttributeType(userAttributes),\n });\n return {\n ...getConfirmedAttributes(userAttributes),\n ...getUnConfirmedAttributes(CodeDeliveryDetailsList),\n };\n};\nfunction getConfirmedAttributes(attributes) {\n const confirmedAttributes = {};\n Object.keys(attributes)?.forEach(key => {\n confirmedAttributes[key] = {\n isUpdated: true,\n nextStep: {\n updateAttributeStep: 'DONE',\n },\n };\n });\n return confirmedAttributes;\n}\nfunction getUnConfirmedAttributes(codeDeliveryDetailsList) {\n const unConfirmedAttributes = {};\n codeDeliveryDetailsList?.forEach(codeDeliveryDetails => {\n const { AttributeName, DeliveryMedium, Destination } = codeDeliveryDetails;\n if (AttributeName)\n unConfirmedAttributes[AttributeName] = {\n isUpdated: false,\n nextStep: {\n updateAttributeStep: 'CONFIRM_ATTRIBUTE_WITH_CODE',\n codeDeliveryDetails: {\n attributeName: AttributeName,\n deliveryMedium: DeliveryMedium,\n destination: Destination,\n },\n },\n };\n });\n return unConfirmedAttributes;\n}\n\nexport { updateUserAttributes };\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 createUpdateUserAttributesClient = (config) => composeServiceApi(cognitoUserPoolTransferHandler, createUserPoolSerializer('UpdateUserAttributes'), createUserPoolDeserializer(), {\n ...DEFAULT_SERVICE_CLIENT_API_CONFIG,\n ...config,\n});\n\nexport { createUpdateUserAttributesClient };\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 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 { 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 { 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 } 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","// 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 { 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 { 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 { 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} [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} 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 { 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 { 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 { autoSignInUserConfirmed, autoSignInWhenUserIsConfirmedWithLink, handleCodeAutoSignIn } 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 { Amplify } from '../Amplify.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction clearCredentials() {\n return Amplify.Auth.clearCredentials();\n}\n\nexport { clearCredentials };\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 { assertAuthTokensWithRefreshToken, assertAuthTokens } 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","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar StorageValidationErrorCode;\n(function (StorageValidationErrorCode) {\n StorageValidationErrorCode[\"NoCredentials\"] = \"NoCredentials\";\n StorageValidationErrorCode[\"NoIdentityId\"] = \"NoIdentityId\";\n StorageValidationErrorCode[\"NoKey\"] = \"NoKey\";\n StorageValidationErrorCode[\"NoSourceKey\"] = \"NoSourceKey\";\n StorageValidationErrorCode[\"NoDestinationKey\"] = \"NoDestinationKey\";\n StorageValidationErrorCode[\"NoSourcePath\"] = \"NoSourcePath\";\n StorageValidationErrorCode[\"NoDestinationPath\"] = \"NoDestinationPath\";\n StorageValidationErrorCode[\"NoBucket\"] = \"NoBucket\";\n StorageValidationErrorCode[\"NoRegion\"] = \"NoRegion\";\n StorageValidationErrorCode[\"InvalidStorageBucket\"] = \"InvalidStorageBucket\";\n StorageValidationErrorCode[\"InvalidCopyOperationStorageBucket\"] = \"InvalidCopyOperationStorageBucket\";\n StorageValidationErrorCode[\"InvalidStorageOperationPrefixInput\"] = \"InvalidStorageOperationPrefixInput\";\n StorageValidationErrorCode[\"InvalidStorageOperationInput\"] = \"InvalidStorageOperationInput\";\n StorageValidationErrorCode[\"InvalidAWSAccountID\"] = \"InvalidAWSAccountID\";\n StorageValidationErrorCode[\"InvalidStoragePathInput\"] = \"InvalidStoragePathInput\";\n StorageValidationErrorCode[\"InvalidUploadSource\"] = \"InvalidUploadSource\";\n StorageValidationErrorCode[\"ObjectIsTooLarge\"] = \"ObjectIsTooLarge\";\n StorageValidationErrorCode[\"UrlExpirationMaxLimitExceed\"] = \"UrlExpirationMaxLimitExceed\";\n StorageValidationErrorCode[\"InvalidLocationCredentialsCacheSize\"] = \"InvalidLocationCredentialsCacheSize\";\n StorageValidationErrorCode[\"LocationCredentialsStoreDestroyed\"] = \"LocationCredentialsStoreDestroyed\";\n StorageValidationErrorCode[\"InvalidS3Uri\"] = \"InvalidS3Uri\";\n StorageValidationErrorCode[\"InvalidCustomEndpoint\"] = \"InvalidCustomEndpoint\";\n StorageValidationErrorCode[\"ForcePathStyleEndpointNotSupported\"] = \"ForcePathStyleEndpointNotSupported\";\n StorageValidationErrorCode[\"DnsIncompatibleBucketName\"] = \"DnsIncompatibleBucketName\";\n})(StorageValidationErrorCode || (StorageValidationErrorCode = {}));\nconst validationErrorMap = {\n [StorageValidationErrorCode.NoCredentials]: {\n message: 'Credentials should not be empty.',\n },\n [StorageValidationErrorCode.NoIdentityId]: {\n message: 'Missing identity ID when accessing objects in protected or private access level.',\n },\n [StorageValidationErrorCode.NoKey]: {\n message: 'Missing key in api call.',\n },\n [StorageValidationErrorCode.NoSourceKey]: {\n message: 'Missing source key in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationKey]: {\n message: 'Missing destination key in copy api call.',\n },\n [StorageValidationErrorCode.NoSourcePath]: {\n message: 'Missing source path in copy api call.',\n },\n [StorageValidationErrorCode.NoDestinationPath]: {\n message: 'Missing destination path in copy api call.',\n },\n [StorageValidationErrorCode.NoBucket]: {\n message: 'Missing bucket name while accessing object.',\n },\n [StorageValidationErrorCode.NoRegion]: {\n message: 'Missing region while accessing object.',\n },\n [StorageValidationErrorCode.UrlExpirationMaxLimitExceed]: {\n message: 'Url Expiration can not be greater than 7 Days.',\n },\n [StorageValidationErrorCode.ObjectIsTooLarge]: {\n message: 'Object size cannot not be greater than 5TB.',\n },\n [StorageValidationErrorCode.InvalidUploadSource]: {\n message: 'Upload source type can only be a `Blob`, `File`, `ArrayBuffer`, or `string`.',\n },\n [StorageValidationErrorCode.InvalidStorageOperationInput]: {\n message: 'Path or key parameter must be specified in the input. Both can not be specified at the same time.',\n },\n [StorageValidationErrorCode.InvalidAWSAccountID]: {\n message: 'Invalid AWS account ID was provided.',\n },\n [StorageValidationErrorCode.InvalidStorageOperationPrefixInput]: {\n message: 'Both path and prefix can not be specified at the same time.',\n },\n [StorageValidationErrorCode.InvalidStoragePathInput]: {\n message: 'Input `path` does not allow a leading slash (/).',\n },\n [StorageValidationErrorCode.InvalidLocationCredentialsCacheSize]: {\n message: 'locationCredentialsCacheSize must be a positive integer.',\n },\n [StorageValidationErrorCode.LocationCredentialsStoreDestroyed]: {\n message: `Location-specific credentials store has been destroyed.`,\n },\n [StorageValidationErrorCode.InvalidS3Uri]: {\n message: 'Invalid S3 URI.',\n },\n [StorageValidationErrorCode.InvalidStorageBucket]: {\n message: 'Unable to lookup bucket from provided name in Amplify configuration.',\n },\n [StorageValidationErrorCode.InvalidCopyOperationStorageBucket]: {\n message: 'Missing bucket option in either source or destination.',\n },\n [StorageValidationErrorCode.InvalidCustomEndpoint]: {\n message: 'Invalid S3 custom endpoint.',\n },\n [StorageValidationErrorCode.ForcePathStyleEndpointNotSupported]: {\n message: 'Path style URLs are not supported with S3 Transfer Acceleration.',\n },\n [StorageValidationErrorCode.DnsIncompatibleBucketName]: {\n message: `The bucket name isn't DNS compatible.`,\n },\n};\n\nexport { StorageValidationErrorCode, validationErrorMap };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// query params\nconst ALGORITHM_QUERY_PARAM = 'X-Amz-Algorithm';\nconst AMZ_DATE_QUERY_PARAM = 'X-Amz-Date';\nconst CREDENTIAL_QUERY_PARAM = 'X-Amz-Credential';\nconst EXPIRES_QUERY_PARAM = 'X-Amz-Expires';\nconst REGION_SET_PARAM = 'X-Amz-Region-Set';\nconst SIGNATURE_QUERY_PARAM = 'X-Amz-Signature';\nconst SIGNED_HEADERS_QUERY_PARAM = 'X-Amz-SignedHeaders';\nconst TOKEN_QUERY_PARAM = 'X-Amz-Security-Token';\n// headers\nconst AUTH_HEADER = 'authorization';\nconst HOST_HEADER = 'host';\nconst AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();\nconst TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();\n// identifiers\nconst KEY_TYPE_IDENTIFIER = 'aws4_request';\nconst SHA256_ALGORITHM_IDENTIFIER = 'AWS4-HMAC-SHA256';\nconst SIGNATURE_IDENTIFIER = 'AWS4';\n// preset values\nconst EMPTY_HASH = 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855';\nconst UNSIGNED_PAYLOAD = 'UNSIGNED-PAYLOAD';\n\nexport { ALGORITHM_QUERY_PARAM, AMZ_DATE_HEADER, AMZ_DATE_QUERY_PARAM, AUTH_HEADER, CREDENTIAL_QUERY_PARAM, EMPTY_HASH, EXPIRES_QUERY_PARAM, HOST_HEADER, KEY_TYPE_IDENTIFIER, REGION_SET_PARAM, SHA256_ALGORITHM_IDENTIFIER, SIGNATURE_IDENTIFIER, SIGNATURE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, TOKEN_HEADER, TOKEN_QUERY_PARAM, UNSIGNED_PAYLOAD };\n","import { getCredentialScope } from './getCredentialScope.mjs';\nimport { getFormattedDates } from './getFormattedDates.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Extracts common values used for signing both requests and urls.\n *\n * @param options `SignRequestOptions` object containing values used to construct the signature.\n * @returns Common `SigningValues` used for signing.\n *\n * @internal\n */\nconst getSigningValues = ({ credentials, signingDate = new Date(), signingRegion, signingService, uriEscapePath = true, }) => {\n // get properties from credentials\n const { accessKeyId, secretAccessKey, sessionToken } = credentials;\n // get formatted dates for signing\n const { longDate, shortDate } = getFormattedDates(signingDate);\n // copy header and set signing properties\n const credentialScope = getCredentialScope(shortDate, signingRegion, signingService);\n return {\n accessKeyId,\n credentialScope,\n longDate,\n secretAccessKey,\n sessionToken,\n shortDate,\n signingRegion,\n signingService,\n uriEscapePath,\n };\n};\n\nexport { getSigningValues };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns expected date strings to be used in signing.\n *\n * @param date JavaScript `Date` object.\n * @returns `FormattedDates` object containing the following:\n * - longDate: A date string in 'YYYYMMDDThhmmssZ' format\n * - shortDate: A date string in 'YYYYMMDD' format\n *\n * @internal\n */\nconst getFormattedDates = (date) => {\n const longDate = date.toISOString().replace(/[:-]|\\.\\d{3}/g, '');\n return {\n longDate,\n shortDate: longDate.slice(0, 8),\n };\n};\n\nexport { getFormattedDates };\n","import { KEY_TYPE_IDENTIFIER } from '../constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns the credential scope which restricts the resulting signature to the specified region and service.\n *\n * @param date Current date in the format 'YYYYMMDD'.\n * @param region AWS region in which the service resides.\n * @param service Service to which the signed request is being sent.\n *\n * @returns A string representing the credential scope with format 'YYYYMMDD/region/service/aws4_request'.\n *\n * @internal\n */\nconst getCredentialScope = (date, region, service) => `${date}/${region}/${service}/${KEY_TYPE_IDENTIFIER}`;\n\nexport { getCredentialScope };\n","import { Sha256 } from '@aws-crypto/sha256-js';\nimport { toHex } from '@smithy/util-hex-encoding';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// TODO: V6 update to different crypto dependency?\n/**\n * Returns the hashed data a `Uint8Array`.\n *\n * @param key `SourceData` to be used as hashing key.\n * @param data Hashable `SourceData`.\n * @returns `Uint8Array` created from the data as input to a hash function.\n */\nconst getHashedData = (key, data) => {\n const sha256 = new Sha256(key ?? undefined);\n sha256.update(data);\n // TODO: V6 flip to async digest\n const hashedData = sha256.digestSync();\n return hashedData;\n};\n/**\n * Returns the hashed data as a hex string.\n *\n * @param key `SourceData` to be used as hashing key.\n * @param data Hashable `SourceData`.\n * @returns String using lowercase hexadecimal characters created from the data as input to a hash function.\n *\n * @internal\n */\nconst getHashedDataAsHex = (key, data) => {\n const hashedData = getHashedData(key, data);\n return toHex(hashedData);\n};\n\nexport { getHashedData, getHashedDataAsHex };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns canonical headers.\n *\n * @param headers Headers from the request.\n * @returns Request headers that will be signed, and their values, separated by newline characters. Header names must\n * use lowercase characters, must appear in alphabetical order, and must be followed by a colon (:). For the values,\n * trim any leading or trailing spaces, convert sequential spaces to a single space, and separate the values\n * for a multi-value header using commas.\n *\n * @internal\n */\nconst getCanonicalHeaders = (headers) => Object.entries(headers)\n .map(([key, value]) => ({\n key: key.toLowerCase(),\n value: value?.trim().replace(/\\s+/g, ' ') ?? '',\n}))\n .sort((a, b) => (a.key < b.key ? -1 : 1))\n .map(entry => `${entry.key}:${entry.value}\\n`)\n .join('');\n\nexport { getCanonicalHeaders };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns a canonical query string.\n *\n * @param searchParams `searchParams` from the request url.\n * @returns URL-encoded query string parameters, separated by ampersands (&). Percent-encode reserved characters,\n * including the space character. Encode names and values separately. If there are empty parameters, append the equals\n * sign to the parameter name before encoding. After encoding, sort the parameters alphabetically by key name. If there\n * is no query string, use an empty string (\"\").\n *\n * @internal\n */\nconst getCanonicalQueryString = (searchParams) => Array.from(searchParams)\n .sort(([keyA, valA], [keyB, valB]) => {\n if (keyA === keyB) {\n return valA < valB ? -1 : 1;\n }\n return keyA < keyB ? -1 : 1;\n})\n .map(([key, val]) => `${escapeUri(key)}=${escapeUri(val)}`)\n .join('&');\nconst escapeUri = (uri) => encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);\nconst hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;\n\nexport { getCanonicalQueryString };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns a canonical uri.\n *\n * @param pathname `pathname` from request url.\n * @param uriEscapePath Whether to uri encode the path as part of canonical uri. It's used for S3 only where the\n * pathname is already uri encoded, and the signing process is not expected to uri encode it again. Defaults to true.\n * @returns URI-encoded version of the absolute path component URL (everything between the host and the question mark\n * character (?) that starts the query string parameters). If the absolute path is empty, a forward slash character (/).\n *\n * @internal\n */\nconst getCanonicalUri = (pathname, uriEscapePath = true) => pathname\n ? uriEscapePath\n ? encodeURIComponent(pathname).replace(/%2F/g, '/')\n : pathname\n : '/';\n\nexport { getCanonicalUri };\n","import { EMPTY_HASH, UNSIGNED_PAYLOAD } from '../constants.mjs';\nimport { getHashedDataAsHex } from './dataHashHelpers.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns the hashed payload.\n *\n * @param body `body` (payload) from the request.\n * @returns String created using the payload in the body of the HTTP request as input to a hash function. This string\n * uses lowercase hexadecimal characters. If the payload is empty, return precalculated result of an empty hash.\n *\n * @internal\n */\nconst getHashedPayload = (body) => {\n // return precalculated empty hash if body is undefined or null\n if (body == null) {\n return EMPTY_HASH;\n }\n if (isSourceData(body)) {\n const hashedData = getHashedDataAsHex(null, body);\n return hashedData;\n }\n // Defined body is not signable. Return unsigned payload which may or may not be accepted by the service.\n return UNSIGNED_PAYLOAD;\n};\nconst isSourceData = (body) => typeof body === 'string' || ArrayBuffer.isView(body) || isArrayBuffer(body);\nconst isArrayBuffer = (arg) => (typeof ArrayBuffer === 'function' && arg instanceof ArrayBuffer) ||\n Object.prototype.toString.call(arg) === '[object ArrayBuffer]';\n\nexport { getHashedPayload };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns signed headers.\n *\n * @param headers `headers` from the request.\n * @returns List of headers included in canonical headers, separated by semicolons (;). This indicates which headers\n * are part of the signing process. Header names must use lowercase characters and must appear in alphabetical order.\n *\n * @internal\n */\nconst getSignedHeaders = (headers) => Object.keys(headers)\n .map(key => key.toLowerCase())\n .sort()\n .join(';');\n\nexport { getSignedHeaders };\n","import { getHashedDataAsHex } from './dataHashHelpers.mjs';\nimport { getCanonicalRequest } from './getCanonicalRequest.mjs';\nimport { getSigningKey } from './getSigningKey.mjs';\nimport { getStringToSign } from './getStringToSign.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Calculates and returns an AWS API Signature.\n * https://docs.aws.amazon.com/IAM/latest/UserGuide/create-signed-request.html\n *\n * @param request `HttpRequest` to be signed.\n * @param signRequestOptions `SignRequestOptions` object containing values used to construct the signature.\n * @returns AWS API Signature to sign a request or url with.\n *\n * @internal\n */\nconst getSignature = (request, { credentialScope, longDate, secretAccessKey, shortDate, signingRegion, signingService, uriEscapePath, }) => {\n // step 1: create a canonical request\n const canonicalRequest = getCanonicalRequest(request, uriEscapePath);\n // step 2: create a hash of the canonical request\n const hashedRequest = getHashedDataAsHex(null, canonicalRequest);\n // step 3: create a string to sign\n const stringToSign = getStringToSign(longDate, credentialScope, hashedRequest);\n // step 4: calculate the signature\n const signature = getHashedDataAsHex(getSigningKey(secretAccessKey, shortDate, signingRegion, signingService), stringToSign);\n return signature;\n};\n\nexport { getSignature };\n","import { getCanonicalHeaders } from './getCanonicalHeaders.mjs';\nimport { getCanonicalQueryString } from './getCanonicalQueryString.mjs';\nimport { getCanonicalUri } from './getCanonicalUri.mjs';\nimport { getHashedPayload } from './getHashedPayload.mjs';\nimport { getSignedHeaders } from './getSignedHeaders.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns a canonical request.\n *\n * @param request `HttpRequest` from which to create the canonical request from.\n * @param uriEscapePath Whether to uri encode the path as part of canonical uri. It's used for S3 only where the\n * pathname is already uri encoded, and the signing process is not expected to uri encode it again. Defaults to true.\n * @returns String created by by concatenating the following strings, separated by newline characters:\n * - HTTPMethod\n * - CanonicalUri\n * - CanonicalQueryString\n * - CanonicalHeaders\n * - SignedHeaders\n * - HashedPayload\n *\n * @internal\n */\nconst getCanonicalRequest = ({ body, headers, method, url }, uriEscapePath = true) => [\n method,\n getCanonicalUri(url.pathname, uriEscapePath),\n getCanonicalQueryString(url.searchParams),\n getCanonicalHeaders(headers),\n getSignedHeaders(headers),\n getHashedPayload(body),\n].join('\\n');\n\nexport { getCanonicalRequest };\n","import { SHA256_ALGORITHM_IDENTIFIER } from '../constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns a string to be signed.\n *\n * @param date Current date in the format 'YYYYMMDDThhmmssZ'.\n * @param credentialScope String representing the credential scope with format 'YYYYMMDD/region/service/aws4_request'.\n * @param hashedRequest Hashed canonical request.\n *\n * @returns A string created by by concatenating the following strings, separated by newline characters:\n * - Algorithm\n * - RequestDateTime\n * - CredentialScope\n * - HashedCanonicalRequest\n *\n * @internal\n */\nconst getStringToSign = (date, credentialScope, hashedRequest) => [SHA256_ALGORITHM_IDENTIFIER, date, credentialScope, hashedRequest].join('\\n');\n\nexport { getStringToSign };\n","import { KEY_TYPE_IDENTIFIER, SIGNATURE_IDENTIFIER } from '../constants.mjs';\nimport { getHashedData } from './dataHashHelpers.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns a signing key to be used for signing requests.\n *\n * @param secretAccessKey AWS secret access key from credentials.\n * @param date Current date in the format 'YYYYMMDD'.\n * @param region AWS region in which the service resides.\n * @param service Service to which the signed request is being sent.\n *\n * @returns `Uint8Array` calculated from its composite parts.\n *\n * @internal\n */\nconst getSigningKey = (secretAccessKey, date, region, service) => {\n const key = `${SIGNATURE_IDENTIFIER}${secretAccessKey}`;\n const dateKey = getHashedData(key, date);\n const regionKey = getHashedData(dateKey, region);\n const serviceKey = getHashedData(regionKey, service);\n const signingKey = getHashedData(serviceKey, KEY_TYPE_IDENTIFIER);\n return signingKey;\n};\n\nexport { getSigningKey };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst SEND_UPLOAD_PROGRESS_EVENT = 'sendUploadProgress';\nconst SEND_DOWNLOAD_PROGRESS_EVENT = 'sendDownloadProgress';\nconst NETWORK_ERROR_MESSAGE = 'Network Error';\nconst NETWORK_ERROR_CODE = 'ERR_NETWORK';\nconst ABORT_ERROR_MESSAGE = 'Request aborted';\nconst ABORT_ERROR_CODE = 'ERR_ABORTED';\nconst CANCELED_ERROR_MESSAGE = 'canceled';\nconst CANCELED_ERROR_CODE = 'ERR_CANCELED';\nconst CONTENT_SHA256_HEADER = 'x-amz-content-sha256';\n\nexport { ABORT_ERROR_CODE, ABORT_ERROR_MESSAGE, CANCELED_ERROR_CODE, CANCELED_ERROR_MESSAGE, CONTENT_SHA256_HEADER, NETWORK_ERROR_CODE, NETWORK_ERROR_MESSAGE, SEND_DOWNLOAD_PROGRESS_EVENT, SEND_UPLOAD_PROGRESS_EVENT };\n","import { getSignedHeaders } from './utils/getSignedHeaders.mjs';\nimport { getSigningValues } from './utils/getSigningValues.mjs';\nimport { HOST_HEADER, AMZ_DATE_HEADER, TOKEN_HEADER, AUTH_HEADER, SHA256_ALGORITHM_IDENTIFIER } from './constants.mjs';\nimport { getSignature } from './utils/getSignature.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Given a `HttpRequest`, returns a Signature Version 4 signed `HttpRequest`.\n *\n * @param request `HttpRequest` to be signed.\n * @param signRequestOptions `SignRequestOptions` object containing values used to construct the signature.\n * @returns A `HttpRequest` with authentication headers which can grant temporary access to AWS resources.\n */\nconst signRequest = (request, options) => {\n const signingValues = getSigningValues(options);\n const { accessKeyId, credentialScope, longDate, sessionToken } = signingValues;\n // create the request to sign\n const headers = { ...request.headers };\n headers[HOST_HEADER] = request.url.host;\n headers[AMZ_DATE_HEADER] = longDate;\n if (sessionToken) {\n headers[TOKEN_HEADER] = sessionToken;\n }\n const requestToSign = { ...request, headers };\n // calculate and add the signature to the request\n const signature = getSignature(requestToSign, signingValues);\n const credentialEntry = `Credential=${accessKeyId}/${credentialScope}`;\n const signedHeadersEntry = `SignedHeaders=${getSignedHeaders(headers)}`;\n const signatureEntry = `Signature=${signature}`;\n headers[AUTH_HEADER] =\n `${SHA256_ALGORITHM_IDENTIFIER} ${credentialEntry}, ${signedHeadersEntry}, ${signatureEntry}`;\n return requestToSign;\n};\n\nexport { signRequest };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns a `Date` that is corrected for clock skew.\n *\n * @param systemClockOffset The offset of the system clock in milliseconds.\n *\n * @returns `Date` representing the current time adjusted by the system clock offset.\n *\n * @internal\n */\nconst getSkewCorrectedDate = (systemClockOffset) => new Date(Date.now() + systemClockOffset);\n\nexport { getSkewCorrectedDate };\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 StorageError extends AmplifyError {\n constructor(params) {\n super(params);\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = StorageError;\n Object.setPrototypeOf(this, StorageError.prototype);\n }\n}\n\nexport { StorageError };\n","import { StorageError } from './StorageError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Internal-only class for CanceledError thrown by XHR handler or multipart upload when cancellation is invoked\n * without overwriting behavior.\n *\n * @internal\n */\nclass CanceledError extends StorageError {\n constructor(params = {}) {\n super({\n name: 'CanceledError',\n message: 'Upload is canceled by user',\n ...params,\n });\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = CanceledError;\n Object.setPrototypeOf(this, CanceledError.prototype);\n }\n}\n/**\n * Check if an error is caused by user calling `cancel()` on a upload/download task. If an overwriting error is\n * supplied to `task.cancel(errorOverwrite)`, this function will return `false`.\n * @param {unknown} error The unknown exception to be checked.\n * @returns - A boolean indicating if the error was from an upload cancellation\n */\nconst isCancelError = (error) => !!error && error instanceof CanceledError;\n\nexport { CanceledError, isCancelError };\n","import { withMemoization } from '@aws-amplify/core/internals/aws-client-utils';\nimport { ConsoleLogger } from '@aws-amplify/core';\nimport { CanceledError } from '../../../../../errors/CanceledError.mjs';\nimport { StorageError } from '../../../../../errors/StorageError.mjs';\nimport { NETWORK_ERROR_MESSAGE, NETWORK_ERROR_CODE, ABORT_ERROR_MESSAGE, ABORT_ERROR_CODE, CANCELED_ERROR_CODE, CANCELED_ERROR_MESSAGE } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('xhr-http-handler');\n/**\n * Base transfer handler implementation using XMLHttpRequest to support upload and download progress events.\n *\n * @param request - The request object.\n * @param options - The request options.\n * @returns A promise that will be resolved with the response object.\n *\n * @internal\n */\nconst xhrTransferHandler = (request, options) => {\n const { url, method, headers, body } = request;\n const { onDownloadProgress, onUploadProgress, responseType, abortSignal } = options;\n return new Promise((resolve, reject) => {\n let xhr = new XMLHttpRequest();\n xhr.open(method.toUpperCase(), url.toString());\n Object.entries(headers)\n .filter(([header]) => !FORBIDDEN_HEADERS.includes(header))\n .forEach(([header, value]) => {\n xhr.setRequestHeader(header, value);\n });\n xhr.responseType = responseType;\n if (onDownloadProgress) {\n xhr.addEventListener('progress', event => {\n onDownloadProgress(convertToTransferProgressEvent(event));\n logger.debug(event);\n });\n }\n if (onUploadProgress) {\n xhr.upload.addEventListener('progress', event => {\n onUploadProgress(convertToTransferProgressEvent(event));\n logger.debug(event);\n });\n }\n xhr.addEventListener('error', () => {\n const networkError = new StorageError({\n message: NETWORK_ERROR_MESSAGE,\n name: NETWORK_ERROR_CODE,\n });\n logger.error(NETWORK_ERROR_MESSAGE);\n reject(networkError);\n xhr = null; // clean up request\n });\n // Handle browser request cancellation (as opposed to a manual cancellation)\n xhr.addEventListener('abort', () => {\n // The abort event can be triggered after the error or load event. So we need to check if the xhr is null.\n // When request is aborted by AbortSignal, the promise is rejected in the abortSignal's 'abort' event listener.\n if (!xhr || abortSignal?.aborted)\n return;\n // Handle abort request caused by browser instead of AbortController\n // see: https://github.com/axios/axios/issues/537\n const error = buildHandlerError(ABORT_ERROR_MESSAGE, ABORT_ERROR_CODE);\n logger.error(ABORT_ERROR_MESSAGE);\n reject(error);\n xhr = null; // clean up request\n });\n // Skip handling timeout error since we don't have a timeout\n xhr.addEventListener('readystatechange', () => {\n if (!xhr || xhr.readyState !== xhr.DONE) {\n return;\n }\n const onloadend = () => {\n // The load event is triggered after the error/abort/load event. So we need to check if the xhr is null.\n if (!xhr)\n return;\n const responseHeaders = convertResponseHeaders(xhr.getAllResponseHeaders());\n const { responseType: loadEndResponseType } = xhr;\n const responseBlob = xhr.response;\n const responseText = loadEndResponseType === 'text' ? xhr.responseText : '';\n const bodyMixIn = {\n blob: () => Promise.resolve(responseBlob),\n text: withMemoization(() => loadEndResponseType === 'blob'\n ? readBlobAsText(responseBlob)\n : Promise.resolve(responseText)),\n json: () => Promise.reject(\n // S3 does not support JSON response. So fail-fast here with nicer error message.\n new Error('Parsing response to JSON is not implemented. Please use response.text() instead.')),\n };\n const response = {\n statusCode: xhr.status,\n headers: responseHeaders,\n // The xhr.responseType is only set to 'blob' for streaming binary S3 object data. The streaming data is\n // exposed via public interface of Storage.get(). So we need to return the response as a Blob object for\n // backward compatibility. In other cases, the response payload is only used internally, we return it is\n // {@link ResponseBodyMixin}\n body: (xhr.responseType === 'blob'\n ? Object.assign(responseBlob, bodyMixIn)\n : bodyMixIn),\n };\n resolve(response);\n xhr = null; // clean up request\n };\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n // @see https://github.com/axios/axios/blob/9588fcdec8aca45c3ba2f7968988a5d03f23168c/lib/adapters/xhr.js#L98-L99\n setTimeout(onloadend);\n });\n if (abortSignal) {\n const onCanceled = () => {\n // The abort event is triggered after the error or load event. So we need to check if the xhr is null.\n if (!xhr) {\n return;\n }\n const canceledError = new CanceledError({\n name: CANCELED_ERROR_CODE,\n message: CANCELED_ERROR_MESSAGE,\n });\n reject(canceledError);\n xhr.abort();\n xhr = null;\n };\n abortSignal.aborted\n ? onCanceled()\n : abortSignal.addEventListener('abort', onCanceled);\n }\n if (typeof ReadableStream === 'function' &&\n body instanceof ReadableStream) {\n // This does not matter as previous implementation uses Axios which does not support ReadableStream anyway.\n throw new Error('ReadableStream request payload is not supported.');\n }\n xhr.send(body ?? null);\n });\n};\nconst convertToTransferProgressEvent = (event) => ({\n transferredBytes: event.loaded,\n totalBytes: event.lengthComputable ? event.total : undefined,\n});\nconst buildHandlerError = (message, name) => {\n const error = new Error(message);\n error.name = name;\n return error;\n};\n/**\n * Convert xhr.getAllResponseHeaders() string to a Record. Note that modern browser already returns\n * header names in lowercase.\n * @param xhrHeaders - string of headers returned from xhr.getAllResponseHeaders()\n */\nconst convertResponseHeaders = (xhrHeaders) => {\n if (!xhrHeaders) {\n return {};\n }\n return xhrHeaders\n .split('\\r\\n')\n .reduce((headerMap, line) => {\n const parts = line.split(': ');\n const header = parts.shift();\n const value = parts.join(': ');\n headerMap[header.toLowerCase()] = value;\n return headerMap;\n }, {});\n};\nconst readBlobAsText = (blob) => {\n const reader = new FileReader();\n return new Promise((resolve, reject) => {\n reader.onloadend = () => {\n if (reader.readyState !== FileReader.DONE) {\n return;\n }\n resolve(reader.result);\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n reader.readAsText(blob);\n });\n};\n// To add more forbidden headers as found set by S3. Intentionally NOT list all of them here to save bundle size.\n// https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name\nconst FORBIDDEN_HEADERS = ['host'];\n\nexport { xhrTransferHandler };\n","import { userAgentMiddlewareFactory, retryMiddlewareFactory, signingMiddlewareFactory } from '@aws-amplify/core/internals/aws-client-utils';\nimport { composeTransferHandler } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { contentSha256MiddlewareFactory } from '../contentSha256middleware.mjs';\nimport { xhrTransferHandler } from '../xhrTransferHandler.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * S3 transfer handler for browser and React Native based on XHR. On top of basic transfer handler, it also supports\n * x-amz-content-sha256 header, and request&response process tracking.\n *\n * @internal\n */\nconst s3TransferHandler = composeTransferHandler(xhrTransferHandler, [\n contentSha256MiddlewareFactory,\n userAgentMiddlewareFactory,\n retryMiddlewareFactory,\n signingMiddlewareFactory,\n]);\n\nexport { s3TransferHandler };\n","import { getHashedPayload } from '@aws-amplify/core/internals/aws-client-utils';\nimport { CONTENT_SHA256_HEADER } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * A middleware that adds the x-amz-content-sha256 header to the request if it is not already present.\n * It's required for S3 requests in browsers where the request body is sent in 1 chunk.\n * @see https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html\n *\n * @internal\n */\nconst contentSha256MiddlewareFactory = () => (next) => async function contentSha256Middleware(request) {\n if (request.headers[CONTENT_SHA256_HEADER]) {\n return next(request);\n }\n else {\n const hash = await getHashedPayload(request.body);\n request.headers[CONTENT_SHA256_HEADER] = hash;\n return next(request);\n }\n};\n\nexport { contentSha256MiddlewareFactory };\n","import { signRequest } from './signer/signatureV4/signRequest.mjs';\nimport '@aws-crypto/sha256-js';\nimport '@smithy/util-hex-encoding';\nimport { getSkewCorrectedDate } from './utils/getSkewCorrectedDate.mjs';\nimport { getUpdatedSystemClockOffset } from './utils/getUpdatedSystemClockOffset.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Middleware that SigV4 signs request with AWS credentials, and correct system clock offset.\n * This middleware is expected to be placed after retry middleware.\n */\nconst signingMiddlewareFactory = ({ credentials, region, service, uriEscapePath = true, }) => {\n let currentSystemClockOffset;\n return (next, context) => async function signingMiddleware(request) {\n currentSystemClockOffset = currentSystemClockOffset ?? 0;\n const signRequestOptions = {\n credentials: typeof credentials === 'function'\n ? await credentials({\n forceRefresh: !!context?.isCredentialsExpired,\n })\n : credentials,\n signingDate: getSkewCorrectedDate(currentSystemClockOffset),\n signingRegion: region,\n signingService: service,\n uriEscapePath,\n };\n const signedRequest = await signRequest(request, signRequestOptions);\n const response = await next(signedRequest);\n // Update system clock offset if response contains date header, regardless of the status code.\n // non-2xx response will still be returned from next handler instead of thrown, because it's\n // only thrown by the retry middleware.\n const dateString = getDateHeader(response);\n if (dateString) {\n currentSystemClockOffset = getUpdatedSystemClockOffset(Date.parse(dateString), currentSystemClockOffset);\n }\n return response;\n };\n};\nconst getDateHeader = ({ headers } = {}) => headers?.date ?? headers?.Date ?? headers?.['x-amz-date'];\n\nexport { signingMiddlewareFactory };\n","import { isClockSkewed } from './isClockSkewed.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Returns the difference between clock time and the current system time if clock is skewed.\n *\n * @param clockTimeInMilliseconds Clock time in milliseconds.\n * @param currentSystemClockOffset Current system clock offset in milliseconds.\n *\n * @internal\n */\nconst getUpdatedSystemClockOffset = (clockTimeInMilliseconds, currentSystemClockOffset) => {\n if (isClockSkewed(clockTimeInMilliseconds, currentSystemClockOffset)) {\n return clockTimeInMilliseconds - Date.now();\n }\n return currentSystemClockOffset;\n};\n\nexport { getUpdatedSystemClockOffset };\n","import { getSkewCorrectedDate } from './getSkewCorrectedDate.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// 5 mins in milliseconds. Ref: https://github.com/aws/aws-sdk-js-v3/blob/6c0f44fab30a1bb2134af47362a31332abc3666b/packages/middleware-signing/src/utils/isClockSkewed.ts#L10\nconst SKEW_WINDOW = 5 * 60 * 1000;\n/**\n * Checks if the provided date is within the skew window of 5 minutes.\n *\n * @param clockTimeInMilliseconds Time to check for skew in milliseconds.\n * @param clockOffsetInMilliseconds Offset to check clock against in milliseconds.\n *\n * @returns True if skewed. False otherwise.\n *\n * @internal\n */\nconst isClockSkewed = (clockTimeInMilliseconds, clockOffsetInMilliseconds) => Math.abs(getSkewCorrectedDate(clockOffsetInMilliseconds).getTime() -\n clockTimeInMilliseconds) >= SKEW_WINDOW;\n\nexport { isClockSkewed };\n","import { StorageError } from '../../../../../errors/StorageError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Maps an object to a new object using the provided instructions.\n * The instructions are a map of the returning mapped object's property names to a single instruction of how to map the\n * value from the original object to the new object. There are two types of instructions:\n *\n * 1. A string representing the property name of the original object to map to the new object. The value mapped from\n * the original object will be the same as the value in the new object, and it can ONLY be string.\n *\n * 2. An array of two elements. The first element is the property name of the original object to map to the new object.\n * The second element is a function that takes the value from the original object and returns the value to be mapped to\n * the new object. The function can return any type.\n *\n * Example:\n * ```typescript\n * const input = {\n * Foo: 'foo',\n * BarList: [{value: 'bar1'}, {value: 'bar2'}]\n * }\n * const output = map(input, {\n * someFoo: 'Foo',\n * bar: ['BarList', (barList) => barList.map(bar => bar.value)]\n * baz: 'Baz' // Baz does not exist in input, so it will not be in the output.\n * });\n * // output = { someFoo: 'foo', bar: ['bar1', 'bar2'] }\n * ```\n *\n * @param obj The object containing the data to compose mapped object.\n * @param instructions The instructions mapping the object values to the new object.\n * @returns A new object with the mapped values.\n *\n * @internal\n */\nconst map = (obj, instructions) => {\n const result = {};\n for (const [key, instruction] of Object.entries(instructions)) {\n const [accessor, deserializer] = Array.isArray(instruction)\n ? instruction\n : [instruction];\n if (Object.prototype.hasOwnProperty.call(obj, accessor)) {\n result[key] = deserializer\n ? deserializer(obj[accessor])\n : String(obj[accessor]);\n }\n }\n return result;\n};\n/**\n * Deserializes a string to a number. Returns undefined if input is undefined.\n *\n * @internal\n */\nconst deserializeNumber = (value) => value ? Number(value) : undefined;\n/**\n * Deserializes a string to a boolean. Returns undefined if input is undefined. Returns true if input is 'true',\n * otherwise false.\n *\n * @internal\n */\nconst deserializeBoolean = (value) => {\n return value ? value === 'true' : undefined;\n};\n/**\n * Deserializes a string to a Date. Returns undefined if input is undefined.\n * It supports epoch timestamp; rfc3339(cannot have a UTC, fractional precision supported); rfc7231(section 7.1.1.1)\n *\n * @see https://www.epoch101.com/\n * @see https://datatracker.ietf.org/doc/html/rfc3339.html#section-5.6\n * @see https://datatracker.ietf.org/doc/html/rfc7231.html#section-7.1.1.1\n *\n * @note For bundle size consideration, we use Date constructor to parse the timestamp string. There might be slight\n * difference among browsers.\n *\n * @internal\n */\nconst deserializeTimestamp = (value) => {\n return value ? new Date(value) : undefined;\n};\n/**\n * Create a function deserializing a string to an enum value. If the string is not a valid enum value, it throws a\n * StorageError.\n *\n * @example\n * ```typescript\n * const deserializeStringEnum = createStringEnumDeserializer(['a', 'b', 'c'] as const, 'FieldName');\n * const deserializedArray = ['a', 'b', 'c'].map(deserializeStringEnum);\n * // deserializedArray = ['a', 'b', 'c']\n *\n * const invalidValue = deserializeStringEnum('d');\n * // Throws InvalidFieldName: Invalid FieldName: d\n * ```\n *\n * @internal\n */\nconst createStringEnumDeserializer = (enumValues, fieldName) => {\n const deserializeStringEnum = (value) => {\n const parsedEnumValue = value\n ? enumValues.find(enumValue => enumValue === value)\n : undefined;\n if (!parsedEnumValue) {\n throw new StorageError({\n name: `Invalid${fieldName}`,\n message: `Invalid ${fieldName}: ${value}`,\n recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',\n });\n }\n return parsedEnumValue;\n };\n return deserializeStringEnum;\n};\n/**\n * Function that makes sure the deserializer receives non-empty array.\n *\n * @internal\n */\nconst emptyArrayGuard = (value, deserializer) => {\n if (value === '') {\n return [];\n }\n const valueArray = (Array.isArray(value) ? value : [value]).filter(e => e != null);\n return deserializer(valueArray);\n};\n/**\n * @internal\n */\nconst deserializeMetadata = (headers) => {\n const objectMetadataHeaderPrefix = 'x-amz-meta-';\n const deserialized = Object.keys(headers)\n .filter(header => header.startsWith(objectMetadataHeaderPrefix))\n .reduce((acc, header) => {\n acc[header.replace(objectMetadataHeaderPrefix, '')] = headers[header];\n return acc;\n }, {});\n return Object.keys(deserialized).length > 0 ? deserialized : undefined;\n};\n/**\n * Internal-only method to create a new StorageError from a service error.\n *\n * @internal\n */\nconst buildStorageServiceError = (error, statusCode) => {\n const storageError = new StorageError({\n name: error.name,\n message: error.message,\n });\n if (statusCode === 404) {\n storageError.recoverySuggestion =\n 'Please add the object with this key to the bucket as the key is not found.';\n }\n return storageError;\n};\n/**\n * Internal-only method used for deserializing the parts of a multipart upload.\n *\n * @internal\n */\nconst deserializeCompletedPartList = (input) => input.map(item => map(item, {\n PartNumber: ['PartNumber', deserializeNumber],\n ETag: 'ETag',\n ChecksumCRC32: 'ChecksumCRC32',\n}));\n\nexport { buildStorageServiceError, createStringEnumDeserializer, deserializeBoolean, deserializeCompletedPartList, deserializeMetadata, deserializeNumber, deserializeTimestamp, emptyArrayGuard, map };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Wraps encodeURIComponent to encode additional characters to fully adhere to RFC 3986.\n * @see https://github.com/aws/aws-sdk-js-v3/blob/86b432c464150069678b25ff88d57c2ca26e75a2/packages/smithy-client/src/extended-encode-uri-component.ts#L7\n *\n * @param uri URI string to encode\n * @returns RFC 3986 encoded string\n *\n * @internal\n */\nconst extendedEncodeURIComponent = (uri) => {\n // Match characters normally not encoded by `encodeURIComponent`\n const extendedCharacters = /[!'()*]/g;\n return encodeURIComponent(uri).replace(extendedCharacters, hexEncode);\n};\nconst hexEncode = (c) => `%${c.charCodeAt(0).toString(16).toUpperCase()}`;\n\nexport { extendedEncodeURIComponent };\n","import { extendedEncodeURIComponent } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyErrorCode } from '@aws-amplify/core/internals/utils';\nimport { StorageError } from '../../../../../errors/StorageError.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 assignStringVariables = (values) => {\n const queryParams = {};\n for (const [key, value] of Object.entries(values)) {\n if (value != null) {\n queryParams[key] = value.toString();\n }\n }\n return queryParams;\n};\n/**\n * Serailize the parameters for configuring the S3 object. Currently used by\n * `putObject` and `createMultipartUpload` API.\n *\n * @internal\n */\nconst serializeObjectConfigsToHeaders = async (input) => ({\n ...assignStringVariables({\n 'x-amz-acl': input.ACL,\n 'cache-control': input.CacheControl,\n 'content-disposition': input.ContentDisposition,\n 'content-language': input.ContentLanguage,\n 'content-encoding': input.ContentEncoding,\n 'content-type': input.ContentType,\n expires: input.Expires?.toUTCString(),\n 'x-amz-tagging': input.Tagging,\n ...serializeMetadata(input.Metadata),\n }),\n});\nconst serializeMetadata = (metadata = {}) => Object.keys(metadata).reduce((acc, suffix) => {\n acc[`x-amz-meta-${suffix.toLowerCase()}`] = metadata[suffix];\n return acc;\n}, {});\n/**\n * Serialize the object key to a URL pathname.\n * @see https://github.com/aws/aws-sdk-js-v3/blob/7ed7101dcc4e81038b6c7f581162b959e6b33a04/clients/client-s3/src/protocols/Aws_restXml.ts#L1108\n *\n * @internal\n */\nconst serializePathnameObjectKey = (url, key) => {\n return (url.pathname.replace(/\\/$/, '') +\n `/${key.split('/').map(extendedEncodeURIComponent).join('/')}`);\n};\nfunction validateS3RequiredParameter(assertion, paramName) {\n if (!assertion) {\n throw new StorageError({\n name: AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n underlyingError: new TypeError(`Expected a non-null value for S3 parameter ${paramName}`),\n recoverySuggestion: 'This is likely to be a bug. Please reach out to library authors.',\n });\n }\n}\n\nexport { assignStringVariables, serializeObjectConfigsToHeaders, serializePathnameObjectKey, validateS3RequiredParameter };\n","import { AmplifyErrorCode } from '@aws-amplify/core/internals/utils';\nimport { StorageError } from './StorageError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nclass IntegrityError extends StorageError {\n constructor(params = {\n name: AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n recoverySuggestion: 'This may be a bug. Please reach out to library authors.',\n }) {\n super(params);\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n this.constructor = IntegrityError;\n Object.setPrototypeOf(this, IntegrityError.prototype);\n }\n}\n\nexport { IntegrityError };\n","import { extendedEncodeURIComponent } from '@aws-amplify/core/internals/aws-client-utils';\nimport { IntegrityError } from '../../../errors/IntegrityError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction validateObjectUrl({ bucketName, key, objectURL, }) {\n if (!bucketName || !key || !objectURL) {\n throw new IntegrityError();\n }\n const bucketWithDots = bucketName.includes('.');\n const encodedBucketName = extendedEncodeURIComponent(bucketName);\n const encodedKey = key.split('/').map(extendedEncodeURIComponent).join('/');\n const isPathStyleUrl = objectURL.pathname === `/${encodedBucketName}/${encodedKey}`;\n const isSubdomainUrl = objectURL.hostname.startsWith(`${encodedBucketName}.`) &&\n objectURL.pathname === `/${encodedKey}`;\n if (!(isPathStyleUrl || (!bucketWithDots && isSubdomainUrl))) {\n throw new IntegrityError();\n }\n}\n\nexport { validateObjectUrl };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Drop-in replacement for fast-xml-parser's XmlParser class used in the AWS SDK S3 client XML deserializer. This\n * implementation is not tested against the full xml conformance test suite. It is only tested against the XML responses\n * from S3. This implementation requires the `DOMParser` class in the runtime.\n */\nconst parser = {\n parse: (xmlStr) => {\n const domParser = new DOMParser();\n const xml = domParser.parseFromString(xmlStr, 'text/xml');\n const parsedObj = parseXmlNode(xml);\n const rootKey = Object.keys(parsedObj)[0];\n return parsedObj[rootKey];\n },\n};\nconst parseXmlNode = (node) => {\n if (isDocumentNode(node)) {\n return {\n [node.documentElement.nodeName]: parseXmlNode(node.documentElement),\n };\n }\n if (node.nodeType === Node.TEXT_NODE) {\n return node.nodeValue?.trim();\n }\n if (isElementNode(node)) {\n // Node like foo will be converted to { Location: 'foo' }\n // instead of { Location: { '#text': 'foo' } }.\n if (isTextOnlyElementNode(node)) {\n return node.childNodes[0].nodeValue;\n }\n const nodeValue = {};\n // convert attributes\n for (const attr of node.attributes) {\n if (!isNamespaceAttributeName(attr.nodeName)) {\n nodeValue[attr.nodeName] = attr.nodeValue;\n }\n }\n // convert child nodes\n if (node.children.length > 0) {\n for (const child of node.children) {\n const childValue = parseXmlNode(child);\n if (childValue === undefined) {\n continue;\n }\n const childName = child.nodeName;\n if (nodeValue[childName] === undefined) {\n nodeValue[childName] = childValue;\n }\n else if (Array.isArray(nodeValue[childName])) {\n nodeValue[childName].push(childValue);\n }\n else {\n nodeValue[childName] = [nodeValue[childName], childValue];\n }\n }\n }\n // Return empty element node as empty string instead of `{}`, which is the default behavior of fast-xml-parser.\n return Object.keys(nodeValue).length === 0 ? '' : nodeValue;\n }\n};\nconst isElementNode = (node) => node.nodeType === Node.ELEMENT_NODE;\nconst isDocumentNode = (node) => node.nodeType === Node.DOCUMENT_NODE;\nconst isTextOnlyElementNode = (node) => hasOnlyNamespaceAttributes(node) &&\n node.children.length === 0 &&\n node.firstChild?.nodeType === Node.TEXT_NODE;\nconst hasOnlyNamespaceAttributes = (node) => {\n for (const attr of node.attributes) {\n if (!isNamespaceAttributeName(attr.nodeName)) {\n return false;\n }\n }\n return true;\n};\nconst isNamespaceAttributeName = (name) => name === 'xmlns' || name.startsWith('xmlns:');\n\nexport { parser };\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport '../runtime/s3TransferHandler/fetch.mjs';\nimport { parser } from '../runtime/xmlParser/pureJs.mjs';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Factory creating a parser that parses the JS Error object from the XML\n * response payload.\n *\n * @param input Input object\n * @param input.noErrorWrapping Whether the error code and message are located\n * directly in the root XML element, or in a nested `` element.\n * See: https://smithy.io/2.0/aws/protocols/aws-restxml-protocol.html#restxml-errors\n *\n * Default to false.\n *\n * @internal\n */\nconst createXmlErrorParser = ({ noErrorWrapping = false, } = {}) => async (response) => {\n if (!response || response.statusCode < 300) {\n return;\n }\n const { statusCode } = response;\n const body = await parseXmlBody(response);\n const errorLocation = noErrorWrapping ? body : body.Error;\n const code = errorLocation?.Code\n ? errorLocation.Code\n : statusCode === 404\n ? 'NotFound'\n : statusCode.toString();\n const message = errorLocation?.message ?? errorLocation?.Message ?? code;\n const error = new Error(message);\n return Object.assign(error, {\n name: code,\n $metadata: parseMetadata(response),\n });\n};\nconst parseXmlBody = async (response) => {\n if (!response.body) {\n // S3 can return 200 without a body indicating failure.\n throw new Error('S3 aborted request.');\n }\n const data = await response.body.text();\n if (data?.length > 0) {\n try {\n return parser.parse(data);\n }\n catch (error) {\n throw new Error(`Failed to parse XML response: ${error}`);\n }\n }\n return {};\n};\n\nexport { createXmlErrorParser, parseXmlBody };\n","import { getRetryDecider } 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 * Factory of a {@link RetryDecider} function.\n *\n * @param errorParser function to parse HTTP response wth XML payload to JS\n * \tError instance.\n * @returns A structure indicating if the response is retryable; And if it is a\n * \tCredentialsExpiredError\n */\nconst createRetryDecider = (errorParser) => async (response, error, middlewareContext) => {\n const defaultRetryDecider = getRetryDecider(errorParser);\n const defaultRetryDecision = await defaultRetryDecider(response, error);\n if (!response) {\n return { retryable: defaultRetryDecision.retryable };\n }\n const parsedError = await errorParser(response);\n const errorCode = parsedError?.name;\n const errorMessage = parsedError?.message;\n const isCredentialsExpired = isCredentialsExpiredError(errorCode, errorMessage);\n return {\n retryable: defaultRetryDecision.retryable ||\n // If we know the previous retry attempt sets isCredentialsExpired in the\n // middleware context, we don't want to retry anymore.\n !!(isCredentialsExpired && !middlewareContext?.isCredentialsExpired),\n isCredentialsExpiredError: isCredentialsExpired,\n };\n};\n// Ref: https://github.com/aws/aws-sdk-js/blob/54829e341181b41573c419bd870dd0e0f8f10632/lib/event_listeners.js#L522-L541\nconst INVALID_TOKEN_ERROR_CODES = [\n 'RequestExpired',\n 'ExpiredTokenException',\n 'ExpiredToken',\n];\n/**\n * Given an error code, returns true if it is related to invalid credentials.\n *\n * @param errorCode String representation of some error.\n * @returns True if given error indicates the credentials used to authorize request\n * are invalid.\n */\nconst isCredentialsExpiredError = (errorCode, errorMessage) => {\n const isExpiredTokenError = !!errorCode && INVALID_TOKEN_ERROR_CODES.includes(errorCode);\n // Ref: https://github.com/aws/aws-sdk-js/blob/54829e341181b41573c419bd870dd0e0f8f10632/lib/event_listeners.js#L536-L539\n const isExpiredSignatureError = !!errorCode &&\n !!errorMessage &&\n errorCode.includes('Signature') &&\n errorMessage.includes('expired');\n return isExpiredTokenError || isExpiredSignatureError;\n};\n\nexport { createRetryDecider };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst LOCAL_TESTING_S3_ENDPOINT = 'http://localhost:20005';\nconst DEFAULT_ACCESS_LEVEL = 'guest';\nconst DEFAULT_PRESIGN_EXPIRATION = 900;\nconst MAX_URL_EXPIRATION = 7 * 24 * 60 * 60 * 1000;\nconst MiB = 1024 * 1024;\nconst GiB = 1024 * MiB;\nconst TiB = 1024 * GiB;\n/**\n * Default part size in MB that is used to determine if an upload task is single part or multi part.\n */\nconst DEFAULT_PART_SIZE = 5 * MiB;\nconst MAX_OBJECT_SIZE = 5 * TiB;\nconst MAX_PARTS_COUNT = 10000;\nconst DEFAULT_QUEUE_SIZE = 4;\nconst UPLOADS_STORAGE_KEY = '__uploadInProgress';\nconst STORAGE_INPUT_PREFIX = 'prefix';\nconst STORAGE_INPUT_KEY = 'key';\nconst STORAGE_INPUT_PATH = 'path';\nconst DEFAULT_DELIMITER = '/';\nconst CHECKSUM_ALGORITHM_CRC32 = 'crc-32';\n\nexport { CHECKSUM_ALGORITHM_CRC32, DEFAULT_ACCESS_LEVEL, DEFAULT_DELIMITER, DEFAULT_PART_SIZE, DEFAULT_PRESIGN_EXPIRATION, DEFAULT_QUEUE_SIZE, LOCAL_TESTING_S3_ENDPOINT, MAX_OBJECT_SIZE, MAX_PARTS_COUNT, MAX_URL_EXPIRATION, STORAGE_INPUT_KEY, STORAGE_INPUT_PATH, STORAGE_INPUT_PREFIX, UPLOADS_STORAGE_KEY };\n","import { validationErrorMap } from '../types/validation.mjs';\nimport { StorageError } from '../StorageError.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 StorageError({ name, message, recoverySuggestion });\n }\n}\n\nexport { assertValidationError };\n","import { getAmplifyUserAgent, AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { jitteredBackoff, getDnsSuffix } from '@aws-amplify/core/internals/aws-client-utils';\nimport { createXmlErrorParser } from '../utils/parsePayload.mjs';\nimport '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { createRetryDecider } from '../utils/createRetryDecider.mjs';\nimport { LOCAL_TESTING_S3_ENDPOINT } from '../../constants.mjs';\nimport { assertValidationError } from '../../../../../errors/utils/assertValidationError.mjs';\nimport { StorageValidationErrorCode } 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 DOMAIN_PATTERN = /^[a-z0-9][a-z0-9.-]{1,61}[a-z0-9]$/;\nconst IP_ADDRESS_PATTERN = /(\\d+\\.){3}\\d+/;\nconst DOTS_PATTERN = /\\.\\./;\n/**\n * The service name used to sign requests if the API requires authentication.\n */\nconst SERVICE_NAME = 's3';\n/**\n * The endpoint resolver function that returns the endpoint URL for a given region, and input parameters.\n */\nconst endpointResolver = (options, apiInput) => {\n const { region, useAccelerateEndpoint, customEndpoint, forcePathStyle } = options;\n let endpoint;\n // 1. get base endpoint\n if (customEndpoint) {\n if (customEndpoint === LOCAL_TESTING_S3_ENDPOINT) {\n endpoint = new AmplifyUrl(customEndpoint);\n }\n assertValidationError(!customEndpoint.includes('://'), StorageValidationErrorCode.InvalidCustomEndpoint);\n endpoint = new AmplifyUrl(`https://${customEndpoint}`);\n }\n else if (useAccelerateEndpoint) {\n // this ErrorCode isn't expose yet since forcePathStyle param isn't publicly exposed\n assertValidationError(!forcePathStyle, StorageValidationErrorCode.ForcePathStyleEndpointNotSupported);\n endpoint = new AmplifyUrl(`https://s3-accelerate.${getDnsSuffix(region)}`);\n }\n else {\n endpoint = new AmplifyUrl(`https://s3.${region}.${getDnsSuffix(region)}`);\n }\n // 2. inject bucket name\n if (apiInput?.Bucket) {\n assertValidationError(isDnsCompatibleBucketName(apiInput.Bucket), StorageValidationErrorCode.DnsIncompatibleBucketName);\n if (forcePathStyle || apiInput.Bucket.includes('.')) {\n endpoint.pathname = `/${apiInput.Bucket}`;\n }\n else {\n endpoint.host = `${apiInput.Bucket}.${endpoint.host}`;\n }\n }\n return { url: endpoint };\n};\n/**\n * Determines whether a given string is DNS compliant per the rules outlined by\n * S3. Length, capitaization, and leading dot restrictions are enforced by the\n * DOMAIN_PATTERN regular expression.\n * @internal\n *\n * @see https://github.com/aws/aws-sdk-js-v3/blob/f2da6182298d4d6b02e84fb723492c07c27469a8/packages/middleware-bucket-endpoint/src/bucketHostnameUtils.ts#L39-L48\n * @see https://docs.aws.amazon.com/AmazonS3/latest/dev/BucketRestrictions.html\n */\nconst isDnsCompatibleBucketName = (bucketName) => DOMAIN_PATTERN.test(bucketName) &&\n !IP_ADDRESS_PATTERN.test(bucketName) &&\n !DOTS_PATTERN.test(bucketName);\n/**\n * Error parser for the XML payload of S3 data plane error response. The error's\n * `Code` and `Message` locates directly at the XML root element.\n *\n * @example\n * ```\n * \n * \t\n * \t\tNoSuchKey\n * \t\tThe resource you requested does not exist\n * \t\t/mybucket/myfoto.jpg\n * \t\t4442587FB7D0A2F9\n * \t\n * \t```\n *\n * @internal\n */\nconst parseXmlError = createXmlErrorParser({ noErrorWrapping: true });\n/**\n * @internal\n */\nconst retryDecider = createRetryDecider(parseXmlError);\n/**\n * @internal\n */\nconst defaultConfig = {\n service: SERVICE_NAME,\n endpointResolver,\n retryDecider,\n computeDelay: jitteredBackoff,\n userAgentValue: getAmplifyUserAgent(),\n useAccelerateEndpoint: false,\n uriEscapePath: false, // Required by S3. See https://github.com/aws/aws-sdk-js-v3/blob/9ba012dfa3a3429aa2db0f90b3b0b3a7a31f9bc3/packages/signature-v4/src/SignatureV4.ts#L76-L83\n};\n\nexport { SERVICE_NAME, defaultConfig, isDnsCompatibleBucketName, parseXmlError, retryDecider };\n","import { parseMetadata, EMPTY_SHA256_HASH, presignUrl } from '@aws-amplify/core/internals/aws-client-utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { CONTENT_SHA256_HEADER } from '../runtime/constants.mjs';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError, map, deserializeBoolean, deserializeTimestamp, deserializeNumber, deserializeMetadata } from '../utils/deserializeHelpers.mjs';\nimport { validateS3RequiredParameter, serializePathnameObjectKey, assignStringVariables } from '../utils/serializeHelpers.mjs';\nimport { validateObjectUrl } from '../../validateObjectUrl.mjs';\nimport { defaultConfig, parseXmlError } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst USER_AGENT_HEADER = 'x-amz-user-agent';\nconst getObjectSerializer = async (input, endpoint) => {\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n return {\n method: 'GET',\n headers: {\n ...(input.Range && { Range: input.Range }),\n ...assignStringVariables({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n }),\n },\n url,\n };\n};\nconst getObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n return {\n ...map(response.headers, {\n DeleteMarker: ['x-amz-delete-marker', deserializeBoolean],\n AcceptRanges: 'accept-ranges',\n Expiration: 'x-amz-expiration',\n Restore: 'x-amz-restore',\n LastModified: ['last-modified', deserializeTimestamp],\n ContentLength: ['content-length', deserializeNumber],\n ETag: 'etag',\n ChecksumCRC32: 'x-amz-checksum-crc32',\n ChecksumCRC32C: 'x-amz-checksum-crc32c',\n ChecksumSHA1: 'x-amz-checksum-sha1',\n ChecksumSHA256: 'x-amz-checksum-sha256',\n MissingMeta: ['x-amz-missing-meta', deserializeNumber],\n VersionId: 'x-amz-version-id',\n CacheControl: 'cache-control',\n ContentDisposition: 'content-disposition',\n ContentEncoding: 'content-encoding',\n ContentLanguage: 'content-language',\n ContentRange: 'content-range',\n ContentType: 'content-type',\n Expires: ['expires', deserializeTimestamp],\n WebsiteRedirectLocation: 'x-amz-website-redirect-location',\n ServerSideEncryption: 'x-amz-server-side-encryption',\n SSECustomerAlgorithm: 'x-amz-server-side-encryption-customer-algorithm',\n SSECustomerKeyMD5: 'x-amz-server-side-encryption-customer-key-md5',\n SSEKMSKeyId: 'x-amz-server-side-encryption-aws-kms-key-id',\n BucketKeyEnabled: [\n 'x-amz-server-side-encryption-bucket-key-enabled',\n deserializeBoolean,\n ],\n StorageClass: 'x-amz-storage-class',\n RequestCharged: 'x-amz-request-charged',\n ReplicationStatus: 'x-amz-replication-status',\n PartsCount: ['x-amz-mp-parts-count', deserializeNumber],\n TagCount: ['x-amz-tagging-count', deserializeNumber],\n ObjectLockMode: 'x-amz-object-lock-mode',\n ObjectLockRetainUntilDate: [\n 'x-amz-object-lock-retain-until-date',\n deserializeTimestamp,\n ],\n ObjectLockLegalHoldStatus: 'x-amz-object-lock-legal-hold',\n }),\n Metadata: deserializeMetadata(response.headers),\n $metadata: parseMetadata(response),\n // @ts-expect-error The body is a CompatibleHttpResponse type because the lower-level handler is XHR instead of\n // fetch, which represents payload in Blob instread of ReadableStream.\n Body: response.body,\n };\n }\n};\nconst getObject = composeServiceApi(s3TransferHandler, getObjectSerializer, getObjectDeserializer, { ...defaultConfig, responseType: 'blob' });\n/**\n * Get a presigned URL for the `getObject` API.\n *\n * @internal\n */\nconst getPresignedGetObjectUrl = async (config, input) => {\n const endpoint = defaultConfig.endpointResolver(config, input);\n const { url, headers, method } = await getObjectSerializer(input, endpoint);\n // TODO: set content sha256 query parameter with value of UNSIGNED-PAYLOAD instead of empty hash.\n // It requires changes in presignUrl. Without this change, the generated url still works,\n // but not the same as other tools like AWS SDK and CLI.\n url.searchParams.append(CONTENT_SHA256_HEADER, EMPTY_SHA256_HASH);\n if (config.userAgentValue) {\n url.searchParams.append(config.userAgentHeader ?? USER_AGENT_HEADER, config.userAgentValue);\n }\n if (input.ResponseContentType) {\n url.searchParams.append('response-content-type', input.ResponseContentType);\n }\n if (input.ResponseContentDisposition) {\n url.searchParams.append('response-content-disposition', input.ResponseContentDisposition);\n }\n for (const [headerName, value] of Object.entries(headers).sort(([key1], [key2]) => key1.localeCompare(key2))) {\n url.searchParams.append(headerName, value);\n }\n return presignUrl({ method, url, body: undefined }, {\n signingService: defaultConfig.service,\n signingRegion: config.region,\n ...defaultConfig,\n ...config,\n });\n};\n\nexport { getObject, getPresignedGetObjectUrl };\n","import { AmplifyUrl } from '../../../../../utils/amplifyUrl/index.mjs';\nimport { ALGORITHM_QUERY_PARAM, SHA256_ALGORITHM_IDENTIFIER, CREDENTIAL_QUERY_PARAM, AMZ_DATE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, HOST_HEADER, EXPIRES_QUERY_PARAM, TOKEN_QUERY_PARAM, SIGNATURE_QUERY_PARAM } from './constants.mjs';\nimport { getSigningValues } from './utils/getSigningValues.mjs';\nimport { getSignature } from './utils/getSignature.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Given a `Presignable` object, returns a Signature Version 4 presigned `URL` object.\n *\n * @param presignable `Presignable` object containing at least a url to be presigned with authentication query params.\n * @param presignUrlOptions `PresignUrlOptions` object containing values used to construct the signature.\n * @returns A `URL` with authentication query params which can grant temporary access to AWS resources.\n */\nconst presignUrl = ({ body, method = 'GET', url }, { expiration, ...options }) => {\n const signingValues = getSigningValues(options);\n const { accessKeyId, credentialScope, longDate, sessionToken } = signingValues;\n // create the request to sign\n const presignedUrl = new AmplifyUrl(url);\n Object.entries({\n [ALGORITHM_QUERY_PARAM]: SHA256_ALGORITHM_IDENTIFIER,\n [CREDENTIAL_QUERY_PARAM]: `${accessKeyId}/${credentialScope}`,\n [AMZ_DATE_QUERY_PARAM]: longDate,\n [SIGNED_HEADERS_QUERY_PARAM]: HOST_HEADER,\n ...(expiration && { [EXPIRES_QUERY_PARAM]: expiration.toString() }),\n ...(sessionToken && { [TOKEN_QUERY_PARAM]: sessionToken }),\n }).forEach(([key, value]) => {\n presignedUrl.searchParams.append(key, value);\n });\n const requestToSign = {\n body,\n headers: { [HOST_HEADER]: url.host },\n method,\n url: presignedUrl,\n };\n // calculate and add the signature to the url\n const signature = getSignature(requestToSign, signingValues);\n presignedUrl.searchParams.append(SIGNATURE_QUERY_PARAM, signature);\n return presignedUrl;\n};\n\nexport { presignUrl };\n","import { assertValidationError } from '../errors/utils/assertValidationError.mjs';\nimport { StorageValidationErrorCode } 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 resolvePrefix = ({ accessLevel, targetIdentityId, }) => {\n if (accessLevel === 'private') {\n assertValidationError(!!targetIdentityId, StorageValidationErrorCode.NoIdentityId);\n return `private/${targetIdentityId}/`;\n }\n else if (accessLevel === 'protected') {\n assertValidationError(!!targetIdentityId, StorageValidationErrorCode.NoIdentityId);\n return `protected/${targetIdentityId}/`;\n }\n else {\n return 'public/';\n }\n};\n\nexport { resolvePrefix };\n","import { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { StorageValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { resolvePrefix } from '../../../utils/resolvePrefix.mjs';\nimport { StorageError } from '../../../errors/StorageError.mjs';\nimport { INVALID_STORAGE_INPUT } from '../../../errors/constants.mjs';\nimport { DEFAULT_ACCESS_LEVEL, LOCAL_TESTING_S3_ENDPOINT } from './constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * resolve the common input options for S3 API handlers from Amplify configuration and library options.\n *\n * @param {AmplifyClassV6} amplify The Amplify instance.\n * @param {S3ApiOptions} apiOptions The input options for S3 provider.\n * @returns {Promise} The resolved common input options for S3 API handlers.\n * @throws A `StorageError` with `error.name` from `StorageValidationErrorCode` indicating invalid\n * configurations or Amplify library options.\n *\n * @internal\n */\nconst resolveS3ConfigAndInput = async (amplify, apiInput) => {\n const { options: apiOptions } = apiInput ?? {};\n /**\n * IdentityId is always cached in memory so we can safely make calls here. It\n * should be stable even for unauthenticated users, regardless of credentials.\n */\n const { identityId } = await amplify.Auth.fetchAuthSession();\n /**\n * A credentials provider function instead of a static credentials object is\n * used because the long-running tasks like multipart upload may span over the\n * credentials expiry. Auth.fetchAuthSession() automatically refreshes the\n * credentials if they are expired.\n *\n * The optional forceRefresh option is set when the S3 service returns expired\n * tokens error in the previous API call attempt.\n */\n const credentialsProvider = async (options) => {\n if (isLocationCredentialsProvider(apiOptions)) {\n assertStorageInput(apiInput);\n }\n // TODO: forceRefresh option of fetchAuthSession would refresh both tokens and\n // AWS credentials. So we do not support forceRefreshing from the Auth until\n // we support refreshing only the credentials.\n const { credentials } = isLocationCredentialsProvider(apiOptions)\n ? await apiOptions.locationCredentialsProvider(options)\n : await amplify.Auth.fetchAuthSession();\n assertValidationError(!!credentials, StorageValidationErrorCode.NoCredentials);\n return credentials;\n };\n const { bucket: defaultBucket, region: defaultRegion, dangerouslyConnectToHttpEndpointForTesting, buckets, } = amplify.getConfig()?.Storage?.S3 ?? {};\n const { bucket = defaultBucket, region = defaultRegion } = (apiOptions?.bucket && resolveBucketConfig(apiOptions, buckets)) || {};\n assertValidationError(!!bucket, StorageValidationErrorCode.NoBucket);\n assertValidationError(!!region, StorageValidationErrorCode.NoRegion);\n const { defaultAccessLevel, prefixResolver = resolvePrefix, isObjectLockEnabled, } = amplify.libraryOptions?.Storage?.S3 ?? {};\n const accessLevel = apiOptions?.accessLevel ?? defaultAccessLevel ?? DEFAULT_ACCESS_LEVEL;\n const targetIdentityId = accessLevel === 'protected'\n ? (apiOptions?.targetIdentityId ?? identityId)\n : identityId;\n const keyPrefix = await prefixResolver({ accessLevel, targetIdentityId });\n return {\n s3Config: {\n credentials: credentialsProvider,\n region,\n useAccelerateEndpoint: apiOptions?.useAccelerateEndpoint,\n ...(apiOptions?.customEndpoint\n ? { customEndpoint: apiOptions.customEndpoint }\n : {}),\n ...(dangerouslyConnectToHttpEndpointForTesting\n ? {\n customEndpoint: LOCAL_TESTING_S3_ENDPOINT,\n forcePathStyle: true,\n }\n : {}),\n },\n bucket,\n keyPrefix,\n identityId,\n isObjectLockEnabled,\n };\n};\nconst isLocationCredentialsProvider = (options) => {\n return !!options?.locationCredentialsProvider;\n};\nconst isInputWithCallbackPath = (input) => {\n return ((input?.path &&\n typeof input.path === 'function') ||\n (input?.destination?.path &&\n typeof input.destination?.path === 'function') ||\n (input?.source?.path &&\n typeof input.source?.path === 'function'));\n};\nconst isDeprecatedInput = (input) => {\n return (isInputWithKey(input) ||\n isInputWithPrefix(input) ||\n isInputWithCopySourceOrDestination(input));\n};\nconst assertStorageInput = (input) => {\n if (isDeprecatedInput(input) || isInputWithCallbackPath(input)) {\n throw new StorageError({\n name: INVALID_STORAGE_INPUT,\n message: 'The input needs to have a path as a string value.',\n recoverySuggestion: 'Please provide a valid path as a string value for the input.',\n });\n }\n};\nconst isInputWithKey = (input) => {\n return !!(typeof input.key === 'string');\n};\nconst isInputWithPrefix = (input) => {\n return !!(typeof input.prefix === 'string');\n};\nconst isInputWithCopySourceOrDestination = (input) => {\n return !!(typeof input.source?.key === 'string' ||\n typeof input.destination?.key === 'string');\n};\nconst resolveBucketConfig = (apiOptions, buckets) => {\n if (typeof apiOptions.bucket === 'string') {\n const bucketConfig = buckets?.[apiOptions.bucket];\n assertValidationError(!!bucketConfig, StorageValidationErrorCode.InvalidStorageBucket);\n return { bucket: bucketConfig.bucketName, region: bucketConfig.region };\n }\n if (typeof apiOptions.bucket === 'object') {\n return {\n bucket: apiOptions.bucket.bucketName,\n region: apiOptions.bucket.region,\n };\n }\n};\n\nexport { resolveS3ConfigAndInput };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst INVALID_STORAGE_INPUT = 'InvalidStorageInput';\n\nexport { INVALID_STORAGE_INPUT };\n","import { StorageValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst VALID_AWS_ACCOUNT_ID_PATTERN = /^\\d{12}/;\nconst validateBucketOwnerID = (accountID) => {\n if (accountID === undefined) {\n return;\n }\n assertValidationError(VALID_AWS_ACCOUNT_ID_PATTERN.test(accountID), StorageValidationErrorCode.InvalidAWSAccountID);\n};\n\nexport { validateBucketOwnerID };\n","import { StorageValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst resolveIdentityId = (identityId) => {\n assertValidationError(!!identityId, StorageValidationErrorCode.NoIdentityId);\n return identityId;\n};\n\nexport { resolveIdentityId };\n","import { assertValidationError } from '../../../errors/utils/assertValidationError.mjs';\nimport { StorageValidationErrorCode } from '../../../errors/types/validation.mjs';\nimport { isInputWithPath } from './isInputWithPath.mjs';\nimport { STORAGE_INPUT_PATH, STORAGE_INPUT_KEY } from './constants.mjs';\nimport { resolveIdentityId } from './resolveIdentityId.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst validateStorageOperationInput = (input, identityId) => {\n assertValidationError(\n // Key present without a path\n (!!input.key && !input.path) ||\n // Path present without a key\n (!input.key && !!input.path), StorageValidationErrorCode.InvalidStorageOperationInput);\n if (isInputWithPath(input)) {\n const { path } = input;\n const objectKey = typeof path === 'string'\n ? path\n : path({ identityId: resolveIdentityId(identityId) });\n assertValidationError(!objectKey.startsWith('/'), StorageValidationErrorCode.InvalidStoragePathInput);\n return {\n inputType: STORAGE_INPUT_PATH,\n objectKey,\n };\n }\n else {\n return { inputType: STORAGE_INPUT_KEY, objectKey: input.key };\n }\n};\n\nexport { validateStorageOperationInput };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst isInputWithPath = (input) => {\n return input.path !== undefined;\n};\n\nexport { isInputWithPath };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst constructContentDisposition = (contentDisposition) => {\n if (!contentDisposition)\n return undefined;\n if (typeof contentDisposition === 'string')\n return contentDisposition;\n const { type, filename } = contentDisposition;\n return filename !== undefined ? `${type}; filename=\"${filename}\"` : type;\n};\n\nexport { constructContentDisposition };\n","import { ConsoleLogger } from '@aws-amplify/core';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst logger = new ConsoleLogger('Storage');\n\nexport { logger };\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError, map, deserializeNumber, deserializeTimestamp, deserializeMetadata } from '../utils/deserializeHelpers.mjs';\nimport { validateS3RequiredParameter, serializePathnameObjectKey, assignStringVariables } from '../utils/serializeHelpers.mjs';\nimport { validateObjectUrl } from '../../validateObjectUrl.mjs';\nimport { defaultConfig, parseXmlError } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst headObjectSerializer = async (input, endpoint) => {\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n const headers = assignStringVariables({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n });\n return {\n method: 'HEAD',\n headers,\n url,\n };\n};\nconst headObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n const contents = {\n ...map(response.headers, {\n ContentLength: ['content-length', deserializeNumber],\n ContentType: 'content-type',\n ETag: 'etag',\n LastModified: ['last-modified', deserializeTimestamp],\n VersionId: 'x-amz-version-id',\n }),\n Metadata: deserializeMetadata(response.headers),\n };\n return {\n $metadata: parseMetadata(response),\n ...contents,\n };\n }\n};\nconst headObject = composeServiceApi(s3TransferHandler, headObjectSerializer, headObjectDeserializer, { ...defaultConfig, responseType: 'text' });\n\nexport { headObject };\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\nfunction getStorageUserAgentValue(action) {\n return getAmplifyUserAgent({\n category: Category.Storage,\n action,\n });\n}\n\nexport { getStorageUserAgentValue };\n","import { StorageAction } from '@aws-amplify/core/internals/utils';\nimport '@smithy/md5-js';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../utils/client/runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../../utils/client/runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { resolveS3ConfigAndInput } from '../../utils/resolveS3ConfigAndInput.mjs';\nimport '../../../../errors/types/validation.mjs';\nimport { logger } from '../../../../utils/logger.mjs';\nimport { validateBucketOwnerID } from '../../utils/validateBucketOwnerID.mjs';\nimport { validateStorageOperationInput } from '../../utils/validateStorageOperationInput.mjs';\nimport { STORAGE_INPUT_KEY } from '../../utils/constants.mjs';\nimport '../../utils/client/s3data/base.mjs';\nimport '../../utils/client/s3data/getObject.mjs';\nimport '../../utils/client/s3data/listObjectsV2.mjs';\nimport '../../utils/client/s3data/putObject.mjs';\nimport '../../utils/client/s3data/createMultipartUpload.mjs';\nimport '../../utils/client/s3data/uploadPart.mjs';\nimport '../../utils/client/s3data/completeMultipartUpload.mjs';\nimport '../../utils/client/s3data/listParts.mjs';\nimport '../../utils/client/s3data/abortMultipartUpload.mjs';\nimport '../../utils/client/s3data/copyObject.mjs';\nimport { headObject } from '../../utils/client/s3data/headObject.mjs';\nimport '../../utils/client/s3data/deleteObject.mjs';\nimport { getStorageUserAgentValue } from '../../utils/userAgent.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getProperties = async (amplify, input, action) => {\n const { s3Config, bucket, keyPrefix, identityId } = await resolveS3ConfigAndInput(amplify, input);\n const { inputType, objectKey } = validateStorageOperationInput(input, identityId);\n validateBucketOwnerID(input.options?.expectedBucketOwner);\n const finalKey = inputType === STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n logger.debug(`get properties of ${objectKey} from ${finalKey}`);\n const response = await headObject({\n ...s3Config,\n userAgentValue: getStorageUserAgentValue(action ?? StorageAction.GetProperties),\n }, {\n Bucket: bucket,\n Key: finalKey,\n ExpectedBucketOwner: input.options?.expectedBucketOwner,\n });\n const result = {\n contentType: response.ContentType,\n size: response.ContentLength,\n eTag: response.ETag,\n lastModified: response.LastModified,\n metadata: response.Metadata,\n versionId: response.VersionId,\n };\n return inputType === STORAGE_INPUT_KEY\n ? { key: objectKey, ...result }\n : { path: objectKey, ...result };\n};\n\nexport { getProperties };\n","import { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { StorageValidationErrorCode } from '../../../../errors/types/validation.mjs';\nimport '../../utils/client/s3data/base.mjs';\nimport { getPresignedGetObjectUrl } from '../../utils/client/s3data/getObject.mjs';\nimport '../../utils/client/s3data/listObjectsV2.mjs';\nimport '../../utils/client/s3data/putObject.mjs';\nimport '../../utils/client/s3data/createMultipartUpload.mjs';\nimport '../../utils/client/s3data/uploadPart.mjs';\nimport '../../utils/client/s3data/completeMultipartUpload.mjs';\nimport '../../utils/client/s3data/listParts.mjs';\nimport '../../utils/client/s3data/abortMultipartUpload.mjs';\nimport '../../utils/client/s3data/copyObject.mjs';\nimport '../../utils/client/s3data/headObject.mjs';\nimport '../../utils/client/s3data/deleteObject.mjs';\nimport '@smithy/md5-js';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../utils/client/runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../../utils/client/runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { resolveS3ConfigAndInput } from '../../utils/resolveS3ConfigAndInput.mjs';\nimport { assertValidationError } from '../../../../errors/utils/assertValidationError.mjs';\nimport '../../../../utils/logger.mjs';\nimport { validateBucketOwnerID } from '../../utils/validateBucketOwnerID.mjs';\nimport { validateStorageOperationInput } from '../../utils/validateStorageOperationInput.mjs';\nimport { DEFAULT_PRESIGN_EXPIRATION, STORAGE_INPUT_KEY, MAX_URL_EXPIRATION } from '../../utils/constants.mjs';\nimport { constructContentDisposition } from '../../utils/constructContentDisposition.mjs';\nimport { getProperties } from './getProperties.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getUrl = async (amplify, input) => {\n const { options: getUrlOptions } = input;\n const { s3Config, keyPrefix, bucket, identityId } = await resolveS3ConfigAndInput(amplify, input);\n const { inputType, objectKey } = validateStorageOperationInput(input, identityId);\n validateBucketOwnerID(getUrlOptions?.expectedBucketOwner);\n const finalKey = inputType === STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n if (getUrlOptions?.validateObjectExistence) {\n await getProperties(amplify, input, StorageAction.GetUrl);\n }\n let urlExpirationInSec = getUrlOptions?.expiresIn ?? DEFAULT_PRESIGN_EXPIRATION;\n const resolvedCredential = typeof s3Config.credentials === 'function'\n ? await s3Config.credentials()\n : s3Config.credentials;\n const awsCredExpiration = resolvedCredential.expiration;\n if (awsCredExpiration) {\n const awsCredExpirationInSec = Math.floor((awsCredExpiration.getTime() - Date.now()) / 1000);\n urlExpirationInSec = Math.min(awsCredExpirationInSec, urlExpirationInSec);\n }\n const maxUrlExpirationInSec = MAX_URL_EXPIRATION / 1000;\n assertValidationError(urlExpirationInSec <= maxUrlExpirationInSec, StorageValidationErrorCode.UrlExpirationMaxLimitExceed);\n // expiresAt is the minimum of credential expiration and url expiration\n return {\n url: await getPresignedGetObjectUrl({\n ...s3Config,\n credentials: resolvedCredential,\n expiration: urlExpirationInSec,\n }, {\n Bucket: bucket,\n Key: finalKey,\n ...(getUrlOptions?.contentDisposition && {\n ResponseContentDisposition: constructContentDisposition(getUrlOptions.contentDisposition),\n }),\n ...(getUrlOptions?.contentType && {\n ResponseContentType: getUrlOptions.contentType,\n }),\n ExpectedBucketOwner: getUrlOptions?.expectedBucketOwner,\n }),\n expiresAt: new Date(Date.now() + urlExpirationInSec * 1000),\n };\n};\n\nexport { getUrl };\n","import { isCancelError } from '../../../errors/CanceledError.mjs';\nimport '../../../errors/types/validation.mjs';\nimport '@aws-amplify/core/internals/utils';\nimport { logger } from '../../../utils/logger.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createCancellableTask = ({ job, onCancel, }) => {\n const state = 'IN_PROGRESS';\n let canceledErrorMessage;\n const cancelableTask = {\n cancel: (message) => {\n const { state: taskState } = cancelableTask;\n if (taskState === 'CANCELED' ||\n taskState === 'ERROR' ||\n taskState === 'SUCCESS') {\n logger.debug(`This task cannot be canceled. State: ${taskState}`);\n return;\n }\n cancelableTask.state = 'CANCELED';\n canceledErrorMessage = message;\n onCancel(canceledErrorMessage);\n },\n state,\n };\n const wrappedJobPromise = (async () => {\n try {\n const result = await job();\n cancelableTask.state = 'SUCCESS';\n return result;\n }\n catch (e) {\n if (isCancelError(e)) {\n cancelableTask.state = 'CANCELED';\n e.message = canceledErrorMessage ?? e.message;\n }\n cancelableTask.state = 'ERROR';\n throw e;\n }\n })();\n return Object.assign(cancelableTask, {\n result: wrappedJobPromise,\n });\n};\nconst createDownloadTask = createCancellableTask;\nconst createUploadTask = ({ job, onCancel, onResume, onPause, isMultipartUpload, }) => {\n const cancellableTask = createCancellableTask({\n job,\n onCancel,\n });\n const uploadTask = Object.assign(cancellableTask, {\n pause: () => {\n const { state } = uploadTask;\n if (!isMultipartUpload || state !== 'IN_PROGRESS') {\n logger.debug(`This task cannot be paused. State: ${state}`);\n return;\n }\n // TODO(eslint): remove this linter suppression.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n uploadTask.state = 'PAUSED';\n onPause?.();\n },\n resume: () => {\n const { state } = uploadTask;\n if (!isMultipartUpload || state !== 'PAUSED') {\n logger.debug(`This task cannot be resumed. State: ${state}`);\n return;\n }\n // TODO(eslint): remove this linter suppression.\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n uploadTask.state = 'IN_PROGRESS';\n onResume?.();\n },\n });\n return uploadTask;\n};\n\nexport { createDownloadTask, createUploadTask };\n","export const BLOCK_SIZE = 64;\nexport const DIGEST_LENGTH = 16;\nexport const INIT = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476];\n","import { fromUtf8 } from \"@smithy/util-utf8\";\nimport { BLOCK_SIZE, DIGEST_LENGTH, INIT } from \"./constants\";\nexport class Md5 {\n constructor() {\n this.reset();\n }\n update(sourceData) {\n if (isEmptyData(sourceData)) {\n return;\n }\n else if (this.finished) {\n throw new Error(\"Attempted to update an already finished hash.\");\n }\n const data = convertToBuffer(sourceData);\n let position = 0;\n let { byteLength } = data;\n this.bytesHashed += byteLength;\n while (byteLength > 0) {\n this.buffer.setUint8(this.bufferLength++, data[position++]);\n byteLength--;\n if (this.bufferLength === BLOCK_SIZE) {\n this.hashBuffer();\n this.bufferLength = 0;\n }\n }\n }\n async digest() {\n if (!this.finished) {\n const { buffer, bufferLength: undecoratedLength, bytesHashed } = this;\n const bitsHashed = bytesHashed * 8;\n buffer.setUint8(this.bufferLength++, 0b10000000);\n if (undecoratedLength % BLOCK_SIZE >= BLOCK_SIZE - 8) {\n for (let i = this.bufferLength; i < BLOCK_SIZE; i++) {\n buffer.setUint8(i, 0);\n }\n this.hashBuffer();\n this.bufferLength = 0;\n }\n for (let i = this.bufferLength; i < BLOCK_SIZE - 8; i++) {\n buffer.setUint8(i, 0);\n }\n buffer.setUint32(BLOCK_SIZE - 8, bitsHashed >>> 0, true);\n buffer.setUint32(BLOCK_SIZE - 4, Math.floor(bitsHashed / 0x100000000), true);\n this.hashBuffer();\n this.finished = true;\n }\n const out = new DataView(new ArrayBuffer(DIGEST_LENGTH));\n for (let i = 0; i < 4; i++) {\n out.setUint32(i * 4, this.state[i], true);\n }\n return new Uint8Array(out.buffer, out.byteOffset, out.byteLength);\n }\n hashBuffer() {\n const { buffer, state } = this;\n let a = state[0], b = state[1], c = state[2], d = state[3];\n a = ff(a, b, c, d, buffer.getUint32(0, true), 7, 0xd76aa478);\n d = ff(d, a, b, c, buffer.getUint32(4, true), 12, 0xe8c7b756);\n c = ff(c, d, a, b, buffer.getUint32(8, true), 17, 0x242070db);\n b = ff(b, c, d, a, buffer.getUint32(12, true), 22, 0xc1bdceee);\n a = ff(a, b, c, d, buffer.getUint32(16, true), 7, 0xf57c0faf);\n d = ff(d, a, b, c, buffer.getUint32(20, true), 12, 0x4787c62a);\n c = ff(c, d, a, b, buffer.getUint32(24, true), 17, 0xa8304613);\n b = ff(b, c, d, a, buffer.getUint32(28, true), 22, 0xfd469501);\n a = ff(a, b, c, d, buffer.getUint32(32, true), 7, 0x698098d8);\n d = ff(d, a, b, c, buffer.getUint32(36, true), 12, 0x8b44f7af);\n c = ff(c, d, a, b, buffer.getUint32(40, true), 17, 0xffff5bb1);\n b = ff(b, c, d, a, buffer.getUint32(44, true), 22, 0x895cd7be);\n a = ff(a, b, c, d, buffer.getUint32(48, true), 7, 0x6b901122);\n d = ff(d, a, b, c, buffer.getUint32(52, true), 12, 0xfd987193);\n c = ff(c, d, a, b, buffer.getUint32(56, true), 17, 0xa679438e);\n b = ff(b, c, d, a, buffer.getUint32(60, true), 22, 0x49b40821);\n a = gg(a, b, c, d, buffer.getUint32(4, true), 5, 0xf61e2562);\n d = gg(d, a, b, c, buffer.getUint32(24, true), 9, 0xc040b340);\n c = gg(c, d, a, b, buffer.getUint32(44, true), 14, 0x265e5a51);\n b = gg(b, c, d, a, buffer.getUint32(0, true), 20, 0xe9b6c7aa);\n a = gg(a, b, c, d, buffer.getUint32(20, true), 5, 0xd62f105d);\n d = gg(d, a, b, c, buffer.getUint32(40, true), 9, 0x02441453);\n c = gg(c, d, a, b, buffer.getUint32(60, true), 14, 0xd8a1e681);\n b = gg(b, c, d, a, buffer.getUint32(16, true), 20, 0xe7d3fbc8);\n a = gg(a, b, c, d, buffer.getUint32(36, true), 5, 0x21e1cde6);\n d = gg(d, a, b, c, buffer.getUint32(56, true), 9, 0xc33707d6);\n c = gg(c, d, a, b, buffer.getUint32(12, true), 14, 0xf4d50d87);\n b = gg(b, c, d, a, buffer.getUint32(32, true), 20, 0x455a14ed);\n a = gg(a, b, c, d, buffer.getUint32(52, true), 5, 0xa9e3e905);\n d = gg(d, a, b, c, buffer.getUint32(8, true), 9, 0xfcefa3f8);\n c = gg(c, d, a, b, buffer.getUint32(28, true), 14, 0x676f02d9);\n b = gg(b, c, d, a, buffer.getUint32(48, true), 20, 0x8d2a4c8a);\n a = hh(a, b, c, d, buffer.getUint32(20, true), 4, 0xfffa3942);\n d = hh(d, a, b, c, buffer.getUint32(32, true), 11, 0x8771f681);\n c = hh(c, d, a, b, buffer.getUint32(44, true), 16, 0x6d9d6122);\n b = hh(b, c, d, a, buffer.getUint32(56, true), 23, 0xfde5380c);\n a = hh(a, b, c, d, buffer.getUint32(4, true), 4, 0xa4beea44);\n d = hh(d, a, b, c, buffer.getUint32(16, true), 11, 0x4bdecfa9);\n c = hh(c, d, a, b, buffer.getUint32(28, true), 16, 0xf6bb4b60);\n b = hh(b, c, d, a, buffer.getUint32(40, true), 23, 0xbebfbc70);\n a = hh(a, b, c, d, buffer.getUint32(52, true), 4, 0x289b7ec6);\n d = hh(d, a, b, c, buffer.getUint32(0, true), 11, 0xeaa127fa);\n c = hh(c, d, a, b, buffer.getUint32(12, true), 16, 0xd4ef3085);\n b = hh(b, c, d, a, buffer.getUint32(24, true), 23, 0x04881d05);\n a = hh(a, b, c, d, buffer.getUint32(36, true), 4, 0xd9d4d039);\n d = hh(d, a, b, c, buffer.getUint32(48, true), 11, 0xe6db99e5);\n c = hh(c, d, a, b, buffer.getUint32(60, true), 16, 0x1fa27cf8);\n b = hh(b, c, d, a, buffer.getUint32(8, true), 23, 0xc4ac5665);\n a = ii(a, b, c, d, buffer.getUint32(0, true), 6, 0xf4292244);\n d = ii(d, a, b, c, buffer.getUint32(28, true), 10, 0x432aff97);\n c = ii(c, d, a, b, buffer.getUint32(56, true), 15, 0xab9423a7);\n b = ii(b, c, d, a, buffer.getUint32(20, true), 21, 0xfc93a039);\n a = ii(a, b, c, d, buffer.getUint32(48, true), 6, 0x655b59c3);\n d = ii(d, a, b, c, buffer.getUint32(12, true), 10, 0x8f0ccc92);\n c = ii(c, d, a, b, buffer.getUint32(40, true), 15, 0xffeff47d);\n b = ii(b, c, d, a, buffer.getUint32(4, true), 21, 0x85845dd1);\n a = ii(a, b, c, d, buffer.getUint32(32, true), 6, 0x6fa87e4f);\n d = ii(d, a, b, c, buffer.getUint32(60, true), 10, 0xfe2ce6e0);\n c = ii(c, d, a, b, buffer.getUint32(24, true), 15, 0xa3014314);\n b = ii(b, c, d, a, buffer.getUint32(52, true), 21, 0x4e0811a1);\n a = ii(a, b, c, d, buffer.getUint32(16, true), 6, 0xf7537e82);\n d = ii(d, a, b, c, buffer.getUint32(44, true), 10, 0xbd3af235);\n c = ii(c, d, a, b, buffer.getUint32(8, true), 15, 0x2ad7d2bb);\n b = ii(b, c, d, a, buffer.getUint32(36, true), 21, 0xeb86d391);\n state[0] = (a + state[0]) & 0xffffffff;\n state[1] = (b + state[1]) & 0xffffffff;\n state[2] = (c + state[2]) & 0xffffffff;\n state[3] = (d + state[3]) & 0xffffffff;\n }\n reset() {\n this.state = Uint32Array.from(INIT);\n this.buffer = new DataView(new ArrayBuffer(BLOCK_SIZE));\n this.bufferLength = 0;\n this.bytesHashed = 0;\n this.finished = false;\n }\n}\nfunction cmn(q, a, b, x, s, t) {\n a = (((a + q) & 0xffffffff) + ((x + t) & 0xffffffff)) & 0xffffffff;\n return (((a << s) | (a >>> (32 - s))) + b) & 0xffffffff;\n}\nfunction ff(a, b, c, d, x, s, t) {\n return cmn((b & c) | (~b & d), a, b, x, s, t);\n}\nfunction gg(a, b, c, d, x, s, t) {\n return cmn((b & d) | (c & ~d), a, b, x, s, t);\n}\nfunction hh(a, b, c, d, x, s, t) {\n return cmn(b ^ c ^ d, a, b, x, s, t);\n}\nfunction ii(a, b, c, d, x, s, t) {\n return cmn(c ^ (b | ~d), a, b, x, s, t);\n}\nfunction isEmptyData(data) {\n if (typeof data === \"string\") {\n return data.length === 0;\n }\n return data.byteLength === 0;\n}\nfunction convertToBuffer(data) {\n if (typeof data === \"string\") {\n return fromUtf8(data);\n }\n if (ArrayBuffer.isView(data)) {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n }\n return new Uint8Array(data);\n}\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction bytesToBase64(bytes) {\n const base64Str = Array.from(bytes, x => String.fromCodePoint(x)).join('');\n return btoa(base64Str);\n}\nfunction toBase64(input) {\n if (typeof input === 'string') {\n return bytesToBase64(new TextEncoder().encode(input));\n }\n return bytesToBase64(new Uint8Array(input.buffer, input.byteOffset, input.byteLength));\n}\n\nexport { toBase64 };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst readFile = (file) => new Promise((resolve, reject) => {\n const reader = new FileReader();\n reader.onload = () => {\n resolve(reader.result);\n };\n reader.onabort = () => {\n reject(new Error('Read aborted'));\n };\n reader.onerror = () => {\n reject(reader.error);\n };\n reader.readAsArrayBuffer(file);\n});\n\nexport { readFile };\n","import { Md5 } from '@smithy/md5-js';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport './client/runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport './client/runtime/s3TransferHandler/xhr.mjs';\nimport { toBase64 } from './client/runtime/base64/index.native.mjs';\nimport '@aws-amplify/core/internals/utils';\nimport { readFile } from './readFile.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst calculateContentMd5 = async (content) => {\n const hasher = new Md5();\n const buffer = content instanceof Blob ? await readFile(content) : content;\n hasher.update(buffer);\n const digest = await hasher.digest();\n return toBase64(digest);\n};\n\nexport { calculateContentMd5 };\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError, map } from '../utils/deserializeHelpers.mjs';\nimport { serializeObjectConfigsToHeaders, assignStringVariables, validateS3RequiredParameter, serializePathnameObjectKey } from '../utils/serializeHelpers.mjs';\nimport { validateObjectUrl } from '../../validateObjectUrl.mjs';\nimport { defaultConfig, parseXmlError } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst putObjectSerializer = async (input, endpoint) => {\n const headers = {\n ...(await serializeObjectConfigsToHeaders({\n ...input,\n ContentType: input.ContentType ?? 'application/octet-stream',\n })),\n ...assignStringVariables({\n 'content-md5': input.ContentMD5,\n 'x-amz-checksum-crc32': input.ChecksumCRC32,\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n 'If-None-Match': input.IfNoneMatch,\n }),\n };\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n return {\n method: 'PUT',\n headers,\n url,\n body: input.Body,\n };\n};\nconst putObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n return {\n ...map(response.headers, {\n ETag: 'etag',\n VersionId: 'x-amz-version-id',\n }),\n $metadata: parseMetadata(response),\n };\n }\n};\nconst putObject = composeServiceApi(s3TransferHandler, putObjectSerializer, putObjectDeserializer, { ...defaultConfig, responseType: 'text' });\n\nexport { putObject };\n","import './client/runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport './client/runtime/s3TransferHandler/xhr.mjs';\nimport { toBase64 } from './client/runtime/base64/index.native.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst hexToUint8Array = (hexString) => new Uint8Array((hexString.match(/\\w{2}/g) ?? []).map(h => parseInt(h, 16)));\nconst hexToArrayBuffer = (hexString) => hexToUint8Array(hexString).buffer;\nconst hexToBase64 = (hexString) => toBase64(hexToUint8Array(hexString));\n\nexport { hexToArrayBuffer, hexToBase64, hexToUint8Array };\n","import crc32 from 'crc-32';\nimport { hexToArrayBuffer, hexToBase64 } from './hexUtils.mjs';\nimport { readFile } from './readFile.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst CHUNK_SIZE = 1024 * 1024; // 1MB chunks\nconst calculateContentCRC32 = async (content, seed = 0) => {\n let internalSeed = seed;\n if (content instanceof ArrayBuffer || ArrayBuffer.isView(content)) {\n let uint8Array;\n if (content instanceof ArrayBuffer) {\n uint8Array = new Uint8Array(content);\n }\n else {\n uint8Array = new Uint8Array(content.buffer, content.byteOffset, content.byteLength);\n }\n let offset = 0;\n while (offset < uint8Array.length) {\n const end = Math.min(offset + CHUNK_SIZE, uint8Array.length);\n const chunk = uint8Array.slice(offset, end);\n internalSeed = crc32.buf(chunk, internalSeed) >>> 0;\n offset = end;\n }\n }\n else {\n let blob;\n if (content instanceof Blob) {\n blob = content;\n }\n else {\n blob = new Blob([content]);\n }\n let offset = 0;\n while (offset < blob.size) {\n const end = Math.min(offset + CHUNK_SIZE, blob.size);\n const chunk = blob.slice(offset, end);\n const arrayBuffer = await readFile(chunk);\n const uint8Array = new Uint8Array(arrayBuffer);\n internalSeed = crc32.buf(uint8Array, internalSeed) >>> 0;\n offset = end;\n }\n }\n const hex = internalSeed.toString(16).padStart(8, '0');\n return {\n checksumArrayBuffer: hexToArrayBuffer(hex),\n checksum: hexToBase64(hex),\n seed: internalSeed,\n };\n};\n\nexport { calculateContentCRC32 };\n","import { Amplify } from '@aws-amplify/core';\nimport { StorageAction } from '@aws-amplify/core/internals/utils';\nimport { calculateContentMd5 } from '../../../utils/md5.mjs';\nimport { resolveS3ConfigAndInput } from '../../../utils/resolveS3ConfigAndInput.mjs';\nimport '../../../../../errors/types/validation.mjs';\nimport '../../../../../utils/logger.mjs';\nimport { validateBucketOwnerID } from '../../../utils/validateBucketOwnerID.mjs';\nimport { validateStorageOperationInput } from '../../../utils/validateStorageOperationInput.mjs';\nimport { CHECKSUM_ALGORITHM_CRC32, STORAGE_INPUT_KEY } from '../../../utils/constants.mjs';\nimport '../../../utils/client/s3data/base.mjs';\nimport '../../../utils/client/s3data/getObject.mjs';\nimport '../../../utils/client/s3data/listObjectsV2.mjs';\nimport { putObject } from '../../../utils/client/s3data/putObject.mjs';\nimport '../../../utils/client/s3data/createMultipartUpload.mjs';\nimport '../../../utils/client/s3data/uploadPart.mjs';\nimport '../../../utils/client/s3data/completeMultipartUpload.mjs';\nimport '../../../utils/client/s3data/listParts.mjs';\nimport '../../../utils/client/s3data/abortMultipartUpload.mjs';\nimport '../../../utils/client/s3data/copyObject.mjs';\nimport '../../../utils/client/s3data/headObject.mjs';\nimport '../../../utils/client/s3data/deleteObject.mjs';\nimport { getStorageUserAgentValue } from '../../../utils/userAgent.mjs';\nimport { calculateContentCRC32 } from '../../../utils/crc32.mjs';\nimport { constructContentDisposition } from '../../../utils/constructContentDisposition.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Get a function the returns a promise to call putObject API to S3.\n *\n * @internal\n */\nconst putObjectJob = (uploadDataInput, abortSignal, totalLength) => async () => {\n const { options: uploadDataOptions, data } = uploadDataInput;\n const { bucket, keyPrefix, s3Config, isObjectLockEnabled, identityId } = await resolveS3ConfigAndInput(Amplify, uploadDataInput);\n const { inputType, objectKey } = validateStorageOperationInput(uploadDataInput, identityId);\n validateBucketOwnerID(uploadDataOptions?.expectedBucketOwner);\n const finalKey = inputType === STORAGE_INPUT_KEY ? keyPrefix + objectKey : objectKey;\n const { contentDisposition, contentEncoding, contentType = 'application/octet-stream', preventOverwrite, metadata, checksumAlgorithm, onProgress, expectedBucketOwner, } = uploadDataOptions ?? {};\n const checksumCRC32 = checksumAlgorithm === CHECKSUM_ALGORITHM_CRC32\n ? await calculateContentCRC32(data)\n : undefined;\n const contentMD5 = \n // check if checksum exists. ex: should not exist in react native\n !checksumCRC32 && isObjectLockEnabled\n ? await calculateContentMd5(data)\n : undefined;\n const { ETag: eTag, VersionId: versionId } = await putObject({\n ...s3Config,\n abortSignal,\n onUploadProgress: onProgress,\n userAgentValue: getStorageUserAgentValue(StorageAction.UploadData),\n }, {\n Bucket: bucket,\n Key: finalKey,\n Body: data,\n ContentType: contentType,\n ContentDisposition: constructContentDisposition(contentDisposition),\n ContentEncoding: contentEncoding,\n Metadata: metadata,\n ContentMD5: contentMD5,\n ChecksumCRC32: checksumCRC32?.checksum,\n ExpectedBucketOwner: expectedBucketOwner,\n IfNoneMatch: preventOverwrite ? '*' : undefined,\n });\n const result = {\n eTag,\n versionId,\n contentType,\n metadata,\n size: totalLength,\n };\n return inputType === STORAGE_INPUT_KEY\n ? { key: objectKey, ...result }\n : { path: objectKey, ...result };\n};\n\nexport { putObjectJob };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst isNil = (value) => {\n return value === undefined || value === null;\n};\nconst bothNilOrEqual = (original, output) => {\n return (isNil(original) && isNil(output)) || original === output;\n};\n/**\n * This function is used to determine if a value is an object.\n * It excludes arrays and null values.\n *\n * @param value\n * @returns\n */\nconst isObject = (value) => {\n return value != null && typeof value === 'object' && !Array.isArray(value);\n};\n/**\n * This function is used to compare two objects and determine if they are equal.\n * It handles nested objects and arrays as well.\n * Array order is not taken into account.\n *\n * @param object\n * @param other\n * @returns\n */\nconst isEqual = (object, other) => {\n if (Array.isArray(object) && !Array.isArray(other)) {\n return false;\n }\n if (!Array.isArray(object) && Array.isArray(other)) {\n return false;\n }\n if (Array.isArray(object) && Array.isArray(other)) {\n return (object.length === other.length &&\n object.every((val, ix) => isEqual(val, other[ix])));\n }\n if (!isObject(object) || !isObject(other)) {\n return object === other;\n }\n const objectKeys = Object.keys(object);\n const otherKeys = Object.keys(other);\n if (objectKeys.length !== otherKeys.length) {\n return false;\n }\n return objectKeys.every(key => {\n return (otherKeys.includes(key) &&\n isEqual(object[key], other[key]));\n });\n};\n\nexport { bothNilOrEqual, isEqual, isNil, isObject };\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyUrl, AmplifyUrlSearchParams } from '@aws-amplify/core/internals/utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { parseXmlBody } from '../utils/parsePayload.mjs';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError, map } from '../utils/deserializeHelpers.mjs';\nimport { assignStringVariables, validateS3RequiredParameter, serializePathnameObjectKey } from '../utils/serializeHelpers.mjs';\nimport { validateObjectUrl } from '../../validateObjectUrl.mjs';\nimport { validateMultipartUploadXML } from '../../validateMultipartUploadXML.mjs';\nimport { defaultConfig, parseXmlError, retryDecider } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst INVALID_PARAMETER_ERROR_MSG = 'Invalid parameter for CompleteMultipartUpload API';\nconst MISSING_ETAG_ERROR_MSG = 'ETag missing from multipart upload';\nconst MISSING_ETAG_ERROR_SUGGESTION = 'Please ensure S3 bucket CORS configuration includes ETag as part of its `ExposeHeaders` element';\nconst completeMultipartUploadSerializer = async (input, endpoint) => {\n const headers = {\n 'content-type': 'application/xml',\n ...assignStringVariables({\n 'x-amz-checksum-crc32': input.ChecksumCRC32,\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n 'If-None-Match': input.IfNoneMatch,\n }),\n };\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n validateS3RequiredParameter(!!input.UploadId, 'UploadId');\n url.search = new AmplifyUrlSearchParams({\n uploadId: input.UploadId,\n }).toString();\n validateS3RequiredParameter(!!input.MultipartUpload, 'MultipartUpload');\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n const xml = serializeCompletedMultipartUpload(input.MultipartUpload);\n validateMultipartUploadXML(input.MultipartUpload, xml);\n return {\n method: 'POST',\n headers,\n url,\n body: '' + xml,\n };\n};\nconst serializeCompletedMultipartUpload = (input) => {\n if (!input.Parts?.length) {\n throw new Error(`${INVALID_PARAMETER_ERROR_MSG}: ${JSON.stringify(input)}`);\n }\n return `${input.Parts.map(serializeCompletedPartList).join('')}`;\n};\nconst serializeCompletedPartList = (input) => {\n if (input.PartNumber == null) {\n throw new Error(`${INVALID_PARAMETER_ERROR_MSG}: ${JSON.stringify(input)}`);\n }\n if (!input.ETag) {\n throw new Error(`${MISSING_ETAG_ERROR_MSG}: ${JSON.stringify(input)}. ${MISSING_ETAG_ERROR_SUGGESTION}`);\n }\n const eTag = `${input.ETag}`;\n const partNumber = `${input.PartNumber}`;\n const checksumCRC32 = input.ChecksumCRC32\n ? `${input.ChecksumCRC32}`\n : '';\n return `${eTag}${partNumber}${checksumCRC32}`;\n};\n/**\n * Parse CompleteMultipartUpload API response payload, which may be empty or error indicating internal\n * server error, even when the status code is 200.\n *\n * Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html#API_CompleteMultipartUpload_Example_4\n */\nconst parseXmlBodyOrThrow = async (response) => {\n const parsed = await parseXmlBody(response); // Handles empty body case\n if (parsed.Code !== undefined && parsed.Message !== undefined) {\n const error = (await parseXmlError({\n ...response,\n statusCode: 500, // To workaround the >=300 status code check common to other APIs.\n }));\n throw buildStorageServiceError(error, response.statusCode);\n }\n return parsed;\n};\nconst completeMultipartUploadDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n const parsed = await parseXmlBodyOrThrow(response);\n const contents = map(parsed, {\n ETag: 'ETag',\n Key: 'Key',\n Location: 'Location',\n });\n return {\n $metadata: parseMetadata(response),\n ...contents,\n };\n }\n};\n// CompleteMultiPartUpload API returns 200 status code with empty body or error message.\n// This indicates internal server error after the response has been sent to the client.\n// Ref: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html#API_CompleteMultipartUpload_Example_4\nconst retryWhenErrorWith200StatusCode = async (response, error, middlewareContext) => {\n if (!response) {\n return { retryable: false };\n }\n if (response.statusCode === 200) {\n if (!response.body) {\n return { retryable: true };\n }\n const parsed = await parseXmlBody(response);\n if (parsed.Code !== undefined && parsed.Message !== undefined) {\n return { retryable: true };\n }\n return { retryable: false };\n }\n return retryDecider(response, error, middlewareContext);\n};\nconst completeMultipartUpload = composeServiceApi(s3TransferHandler, completeMultipartUploadSerializer, completeMultipartUploadDeserializer, {\n ...defaultConfig,\n responseType: 'text',\n retryDecider: retryWhenErrorWith200StatusCode,\n});\n\nexport { completeMultipartUpload };\n","import { IntegrityError } from '../../../errors/IntegrityError.mjs';\nimport './client/runtime/s3TransferHandler/fetch.mjs';\nimport { parser } from './client/runtime/xmlParser/pureJs.mjs';\nimport './client/runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport { map, emptyArrayGuard, deserializeCompletedPartList } from './client/utils/deserializeHelpers.mjs';\nimport '@aws-amplify/core/internals/utils';\nimport { isEqual } from './client/utils/integrityHelpers.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction validateMultipartUploadXML(input, xml) {\n if (!input.Parts) {\n throw new IntegrityError();\n }\n const parsedXML = parser.parse(xml);\n const mappedCompletedMultipartUpload = map(parsedXML, {\n Parts: [\n 'Part',\n value => emptyArrayGuard(value, deserializeCompletedPartList),\n ],\n });\n if (!isEqual(input, mappedCompletedMultipartUpload)) {\n throw new IntegrityError();\n }\n}\n\nexport { validateMultipartUploadXML };\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { AmplifyUrl, AmplifyUrlSearchParams } from '@aws-amplify/core/internals/utils';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError } from '../utils/deserializeHelpers.mjs';\nimport { validateS3RequiredParameter, serializePathnameObjectKey, assignStringVariables } from '../utils/serializeHelpers.mjs';\nimport { validateObjectUrl } from '../../validateObjectUrl.mjs';\nimport { defaultConfig, parseXmlError } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst abortMultipartUploadSerializer = (input, endpoint) => {\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n validateS3RequiredParameter(!!input.UploadId, 'UploadId');\n url.search = new AmplifyUrlSearchParams({\n uploadId: input.UploadId,\n }).toString();\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n const headers = {\n ...assignStringVariables({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n }),\n };\n return {\n method: 'DELETE',\n headers,\n url,\n };\n};\nconst abortMultipartUploadDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n return {\n $metadata: parseMetadata(response),\n };\n }\n};\nconst abortMultipartUpload = composeServiceApi(s3TransferHandler, abortMultipartUploadSerializer, abortMultipartUploadDeserializer, { ...defaultConfig, responseType: 'text' });\n\nexport { abortMultipartUpload };\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyUrl, AmplifyUrlSearchParams } from '@aws-amplify/core/internals/utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError, map } from '../utils/deserializeHelpers.mjs';\nimport { assignStringVariables, validateS3RequiredParameter, serializePathnameObjectKey } from '../utils/serializeHelpers.mjs';\nimport { validateObjectUrl } from '../../validateObjectUrl.mjs';\nimport { defaultConfig, parseXmlError } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst uploadPartSerializer = async (input, endpoint) => {\n const headers = {\n ...assignStringVariables({\n 'x-amz-checksum-crc32': input.ChecksumCRC32,\n 'content-md5': input.ContentMD5,\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n }),\n 'content-type': 'application/octet-stream',\n };\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n validateS3RequiredParameter(!!input.PartNumber, 'PartNumber');\n validateS3RequiredParameter(!!input.UploadId, 'UploadId');\n url.search = new AmplifyUrlSearchParams({\n partNumber: input.PartNumber + '',\n uploadId: input.UploadId,\n }).toString();\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n return {\n method: 'PUT',\n headers,\n url,\n body: input.Body,\n };\n};\nconst uploadPartDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n return {\n ...map(response.headers, {\n ETag: 'etag',\n }),\n $metadata: parseMetadata(response),\n };\n }\n};\nconst uploadPart = composeServiceApi(s3TransferHandler, uploadPartSerializer, uploadPartDeserializer, { ...defaultConfig, responseType: 'text' });\n\nexport { uploadPart };\n","import '../../../../utils/client/s3data/base.mjs';\nimport '../../../../utils/client/s3data/getObject.mjs';\nimport '../../../../utils/client/s3data/listObjectsV2.mjs';\nimport '../../../../utils/client/s3data/putObject.mjs';\nimport '../../../../utils/client/s3data/createMultipartUpload.mjs';\nimport { uploadPart } from '../../../../utils/client/s3data/uploadPart.mjs';\nimport '../../../../utils/client/s3data/completeMultipartUpload.mjs';\nimport '../../../../utils/client/s3data/listParts.mjs';\nimport '../../../../utils/client/s3data/abortMultipartUpload.mjs';\nimport '../../../../utils/client/s3data/copyObject.mjs';\nimport '../../../../utils/client/s3data/headObject.mjs';\nimport '../../../../utils/client/s3data/deleteObject.mjs';\nimport '../../../../../../errors/types/validation.mjs';\nimport '@aws-amplify/core/internals/utils';\nimport { logger } from '../../../../../../utils/logger.mjs';\nimport { calculateContentCRC32 } from '../../../../utils/crc32.mjs';\nimport { calculateContentMd5 } from '../../../../utils/md5.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst uploadPartExecutor = async ({ dataChunkerGenerator, completedPartNumberSet, s3Config, abortSignal, bucket, finalKey, uploadId, onPartUploadCompletion, onProgress, isObjectLockEnabled, useCRC32Checksum, expectedBucketOwner, }) => {\n let transferredBytes = 0;\n for (const { data, partNumber, size } of dataChunkerGenerator) {\n if (abortSignal.aborted) {\n logger.debug('upload executor aborted.');\n break;\n }\n if (completedPartNumberSet.has(partNumber)) {\n logger.debug(`part ${partNumber} already uploaded.`);\n transferredBytes += size;\n onProgress?.({\n transferredBytes,\n });\n }\n else {\n // handle cancel error\n let checksumCRC32;\n if (useCRC32Checksum) {\n checksumCRC32 = await calculateContentCRC32(data);\n }\n const contentMD5 = \n // check if checksum exists. ex: should not exist in react native\n !checksumCRC32 && isObjectLockEnabled\n ? await calculateContentMd5(data)\n : undefined;\n const { ETag: eTag } = await uploadPart({\n ...s3Config,\n abortSignal,\n onUploadProgress: (event) => {\n const { transferredBytes: currentPartTransferredBytes } = event;\n onProgress?.({\n transferredBytes: transferredBytes + currentPartTransferredBytes,\n });\n },\n }, {\n Bucket: bucket,\n Key: finalKey,\n UploadId: uploadId,\n Body: data,\n PartNumber: partNumber,\n ChecksumCRC32: checksumCRC32?.checksum,\n ContentMD5: contentMD5,\n ExpectedBucketOwner: expectedBucketOwner,\n });\n transferredBytes += size;\n // eTag will always be set even the S3 model interface marks it as optional.\n onPartUploadCompletion(partNumber, eTag, checksumCRC32?.checksum);\n }\n }\n};\n\nexport { uploadPartExecutor };\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyUrl, AmplifyUrlSearchParams } from '@aws-amplify/core/internals/utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { parseXmlBody } from '../utils/parsePayload.mjs';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError, map, emptyArrayGuard, deserializeCompletedPartList } from '../utils/deserializeHelpers.mjs';\nimport { validateS3RequiredParameter, serializePathnameObjectKey } from '../utils/serializeHelpers.mjs';\nimport { defaultConfig, parseXmlError } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst listPartsSerializer = async (input, endpoint) => {\n const headers = {};\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n validateS3RequiredParameter(!!input.UploadId, 'UploadId');\n url.search = new AmplifyUrlSearchParams({\n uploadId: input.UploadId,\n }).toString();\n return {\n method: 'GET',\n headers,\n url,\n };\n};\nconst listPartsDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n const parsed = await parseXmlBody(response);\n const contents = map(parsed, {\n UploadId: 'UploadId',\n Parts: [\n 'Part',\n value => emptyArrayGuard(value, deserializeCompletedPartList),\n ],\n });\n return {\n $metadata: parseMetadata(response),\n ...contents,\n };\n }\n};\nconst listParts = composeServiceApi(s3TransferHandler, listPartsSerializer, listPartsDeserializer, { ...defaultConfig, responseType: 'text' });\n\nexport { listParts };\n","import { UPLOADS_STORAGE_KEY } from '../../../../utils/constants.mjs';\nimport '../../../../utils/client/s3data/base.mjs';\nimport '../../../../utils/client/s3data/getObject.mjs';\nimport '../../../../utils/client/s3data/listObjectsV2.mjs';\nimport '../../../../utils/client/s3data/putObject.mjs';\nimport '../../../../utils/client/s3data/createMultipartUpload.mjs';\nimport '../../../../utils/client/s3data/uploadPart.mjs';\nimport '../../../../utils/client/s3data/completeMultipartUpload.mjs';\nimport { listParts } from '../../../../utils/client/s3data/listParts.mjs';\nimport '../../../../utils/client/s3data/abortMultipartUpload.mjs';\nimport '../../../../utils/client/s3data/copyObject.mjs';\nimport '../../../../utils/client/s3data/headObject.mjs';\nimport '../../../../utils/client/s3data/deleteObject.mjs';\nimport '../../../../../../errors/types/validation.mjs';\nimport '@aws-amplify/core/internals/utils';\nimport { logger } from '../../../../../../utils/logger.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst ONE_HOUR = 1000 * 60 * 60;\n/**\n * Find the cached multipart upload id and get the parts that have been uploaded\n * with ListParts API. If the cached upload is expired(1 hour), return null.\n */\nconst findCachedUploadParts = async ({ resumableUploadsCache, cacheKey, s3Config, bucket, finalKey, }) => {\n const cachedUploads = await listCachedUploadTasks(resumableUploadsCache);\n if (!cachedUploads[cacheKey] ||\n cachedUploads[cacheKey].lastTouched < Date.now() - ONE_HOUR // Uploads are cached for 1 hour\n ) {\n return null;\n }\n const cachedUpload = cachedUploads[cacheKey];\n cachedUpload.lastTouched = Date.now();\n await resumableUploadsCache.setItem(UPLOADS_STORAGE_KEY, JSON.stringify(cachedUploads));\n try {\n const { Parts = [] } = await listParts(s3Config, {\n Bucket: bucket,\n Key: finalKey,\n UploadId: cachedUpload.uploadId,\n });\n return {\n parts: Parts,\n uploadId: cachedUpload.uploadId,\n finalCrc32: cachedUpload.finalCrc32,\n };\n }\n catch (e) {\n logger.debug('failed to list cached parts, removing cached upload.');\n await removeCachedUpload(resumableUploadsCache, cacheKey);\n return null;\n }\n};\nconst listCachedUploadTasks = async (resumableUploadsCache) => {\n try {\n return JSON.parse((await resumableUploadsCache.getItem(UPLOADS_STORAGE_KEY)) ?? '{}');\n }\n catch (e) {\n logger.debug('failed to parse cached uploads record.');\n return {};\n }\n};\n/**\n * Serialize the uploadData API options to string so it can be hashed.\n */\nconst serializeUploadOptions = (options = {}) => {\n const unserializableOptionProperties = [\n 'onProgress',\n 'resumableUploadsCache',\n 'locationCredentialsProvider', // Internally injected implementation not set by customers\n ];\n const serializableOptions = Object.fromEntries(Object.entries(options).filter(([key]) => !unserializableOptionProperties.includes(key)));\n return JSON.stringify(serializableOptions);\n};\n/**\n * Get the cache key of a multipart upload. Data source cached by different: size, content type, bucket, access level,\n * key. If the data source is a File instance, the upload is additionally indexed by file name and last modified time.\n * So the library always created a new multipart upload if the file is modified.\n */\nconst getUploadsCacheKey = ({ file, size, contentType, bucket, accessLevel, key, optionsHash, }) => {\n let levelStr;\n const resolvedContentType = contentType ?? file?.type ?? 'application/octet-stream';\n // If no access level is defined, we're using custom gen2 access rules\n if (accessLevel === undefined) {\n levelStr = 'custom';\n }\n else {\n levelStr = accessLevel === 'guest' ? 'public' : accessLevel;\n }\n const baseId = `${optionsHash}_${size}_${resolvedContentType}_${bucket}_${levelStr}_${key}`;\n if (file) {\n return `${file.name}_${file.lastModified}_${baseId}`;\n }\n else {\n return baseId;\n }\n};\nconst cacheMultipartUpload = async (resumableUploadsCache, cacheKey, fileMetadata) => {\n const cachedUploads = await listCachedUploadTasks(resumableUploadsCache);\n cachedUploads[cacheKey] = {\n ...fileMetadata,\n lastTouched: Date.now(),\n };\n await resumableUploadsCache.setItem(UPLOADS_STORAGE_KEY, JSON.stringify(cachedUploads));\n};\nconst removeCachedUpload = async (resumableUploadsCache, cacheKey) => {\n const cachedUploads = await listCachedUploadTasks(resumableUploadsCache);\n delete cachedUploads[cacheKey];\n await resumableUploadsCache.setItem(UPLOADS_STORAGE_KEY, JSON.stringify(cachedUploads));\n};\n\nexport { cacheMultipartUpload, findCachedUploadParts, getUploadsCacheKey, removeCachedUpload, serializeUploadOptions };\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { parseXmlBody } from '../utils/parsePayload.mjs';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError, map } from '../utils/deserializeHelpers.mjs';\nimport { serializeObjectConfigsToHeaders, assignStringVariables, validateS3RequiredParameter, serializePathnameObjectKey } from '../utils/serializeHelpers.mjs';\nimport { validateObjectUrl } from '../../validateObjectUrl.mjs';\nimport { defaultConfig, parseXmlError } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst createMultipartUploadSerializer = async (input, endpoint) => {\n const headers = {\n ...(await serializeObjectConfigsToHeaders(input)),\n ...assignStringVariables({\n 'x-amz-checksum-algorithm': input.ChecksumAlgorithm,\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n }),\n };\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n url.search = 'uploads';\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n return {\n method: 'POST',\n headers,\n url,\n };\n};\nconst createMultipartUploadDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n const parsed = await parseXmlBody(response);\n const contents = map(parsed, {\n UploadId: 'UploadId',\n });\n return {\n $metadata: parseMetadata(response),\n ...contents,\n };\n }\n};\nconst createMultipartUpload = composeServiceApi(s3TransferHandler, createMultipartUploadSerializer, createMultipartUploadDeserializer, { ...defaultConfig, responseType: 'text' });\n\nexport { createMultipartUpload };\n","import { DEFAULT_PART_SIZE, MAX_PARTS_COUNT } from '../../../../utils/constants.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst calculatePartSize = (totalSize) => {\n if (!totalSize) {\n return DEFAULT_PART_SIZE;\n }\n let partSize = DEFAULT_PART_SIZE;\n let partsCount = Math.ceil(totalSize / partSize);\n while (partsCount > MAX_PARTS_COUNT) {\n partSize *= 2;\n partsCount = Math.ceil(totalSize / partSize);\n }\n return partSize;\n};\n\nexport { calculatePartSize };\n","import { StorageValidationErrorCode, validationErrorMap } from '../../../../../../errors/types/validation.mjs';\nimport { StorageError } from '../../../../../../errors/StorageError.mjs';\nimport { calculatePartSize } from './calculatePartSize.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst getDataChunker = (data, totalSize) => {\n const partSize = calculatePartSize(totalSize);\n if (data instanceof Blob) {\n return helper(data, 0, data.size, partSize);\n }\n else if (ArrayBuffer.isView(data)) {\n return helper(data.buffer, data.byteOffset, data.byteLength, partSize);\n }\n else if (data instanceof ArrayBuffer) {\n return helper(data, 0, data.byteLength, partSize);\n }\n else if (typeof data === 'string') {\n const blob = new Blob([data]);\n return getDataChunker(blob, blob.size);\n }\n else {\n throw new StorageError({\n name: StorageValidationErrorCode.InvalidUploadSource,\n ...validationErrorMap[StorageValidationErrorCode.InvalidUploadSource],\n });\n }\n};\nconst helper = function* (buffer, byteOffset, byteLength, partSize) {\n let partNumber = 1;\n let startByte = byteOffset;\n let endByte = byteOffset + Math.min(partSize, byteLength);\n while (endByte < byteLength + byteOffset) {\n yield {\n partNumber,\n data: buffer.slice(startByte, endByte),\n size: partSize,\n };\n partNumber += 1;\n startByte = endByte;\n endByte = startByte + partSize;\n }\n yield {\n partNumber,\n data: buffer.slice(startByte, byteLength + byteOffset),\n size: byteLength + byteOffset - startByte,\n };\n};\n\nexport { getDataChunker };\n","import { getDataChunker } from '../apis/internal/uploadData/multipart/getDataChunker.mjs';\nimport { calculateContentCRC32 } from './crc32.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Calculates a combined CRC32 checksum for the given data.\n *\n * This function chunks the input data, calculates CRC32 for each chunk,\n * and then combines these checksums into a single value.\n *\n * @async\n * @param {StorageUploadDataPayload} data - The data to calculate the checksum for.\n * @param {number | undefined} size - The size of each chunk. If undefined, a default chunk size will be used.\n * @returns {Promise} A promise that resolves to a string containing the combined CRC32 checksum\n * and the number of chunks, separated by a hyphen.\n */\nconst getCombinedCrc32 = async (data, size) => {\n const crc32List = [];\n const dataChunker = getDataChunker(data, size);\n let totalLength = 0;\n for (const { data: checkData } of dataChunker) {\n const checksum = new Uint8Array((await calculateContentCRC32(checkData)).checksumArrayBuffer);\n totalLength += checksum.length;\n crc32List.push(checksum);\n }\n // Combine all Uint8Arrays into a single Uint8Array\n const combinedArray = new Uint8Array(totalLength);\n let offset = 0;\n for (const crc32Hash of crc32List) {\n combinedArray.set(crc32Hash, offset);\n offset += crc32Hash.length;\n }\n return `${(await calculateContentCRC32(combinedArray.buffer)).checksum}-${crc32List.length}`;\n};\n\nexport { getCombinedCrc32 };\n","import '../../../../utils/client/s3data/base.mjs';\nimport '../../../../utils/client/s3data/getObject.mjs';\nimport '../../../../utils/client/s3data/listObjectsV2.mjs';\nimport '../../../../utils/client/s3data/putObject.mjs';\nimport { createMultipartUpload } from '../../../../utils/client/s3data/createMultipartUpload.mjs';\nimport '../../../../utils/client/s3data/uploadPart.mjs';\nimport '../../../../utils/client/s3data/completeMultipartUpload.mjs';\nimport '../../../../utils/client/s3data/listParts.mjs';\nimport '../../../../utils/client/s3data/abortMultipartUpload.mjs';\nimport '../../../../utils/client/s3data/copyObject.mjs';\nimport '../../../../utils/client/s3data/headObject.mjs';\nimport '../../../../utils/client/s3data/deleteObject.mjs';\nimport '../../../../../../errors/types/validation.mjs';\nimport '@aws-amplify/core/internals/utils';\nimport { logger } from '../../../../../../utils/logger.mjs';\nimport { constructContentDisposition } from '../../../../utils/constructContentDisposition.mjs';\nimport { CHECKSUM_ALGORITHM_CRC32 } from '../../../../utils/constants.mjs';\nimport { getCombinedCrc32 } from '../../../../utils/getCombinedCrc32.native.mjs';\nimport { getUploadsCacheKey, findCachedUploadParts, cacheMultipartUpload } from './uploadCache.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Load the in-progress multipart upload from local storage or async storage(RN) if it exists, or create a new multipart\n * upload.\n *\n * @internal\n */\nconst loadOrCreateMultipartUpload = async ({ s3Config, data, size, contentType, bucket, accessLevel, keyPrefix, key, contentDisposition, contentEncoding, metadata, abortSignal, checksumAlgorithm, optionsHash, resumableUploadsCache, expectedBucketOwner, }) => {\n const finalKey = keyPrefix !== undefined ? keyPrefix + key : key;\n let cachedUpload;\n if (!resumableUploadsCache) {\n logger.debug('uploaded cache instance cannot be determined, skipping cache.');\n cachedUpload = undefined;\n }\n else {\n const uploadCacheKey = getUploadsCacheKey({\n size,\n contentType,\n file: data instanceof File ? data : undefined,\n bucket,\n accessLevel,\n key,\n optionsHash,\n });\n const cachedUploadParts = await findCachedUploadParts({\n s3Config,\n cacheKey: uploadCacheKey,\n bucket,\n finalKey,\n resumableUploadsCache,\n });\n cachedUpload = cachedUploadParts\n ? { ...cachedUploadParts, uploadCacheKey }\n : undefined;\n }\n if (cachedUpload) {\n return {\n uploadId: cachedUpload.uploadId,\n cachedParts: cachedUpload.parts,\n finalCrc32: cachedUpload.finalCrc32,\n };\n }\n else {\n const finalCrc32 = checksumAlgorithm === CHECKSUM_ALGORITHM_CRC32\n ? await getCombinedCrc32(data, size)\n : undefined;\n const { UploadId } = await createMultipartUpload({\n ...s3Config,\n abortSignal,\n }, {\n Bucket: bucket,\n Key: finalKey,\n ContentType: contentType,\n ContentDisposition: constructContentDisposition(contentDisposition),\n ContentEncoding: contentEncoding,\n Metadata: metadata,\n ChecksumAlgorithm: finalCrc32 ? 'CRC32' : undefined,\n ExpectedBucketOwner: expectedBucketOwner,\n });\n if (resumableUploadsCache) {\n const uploadCacheKey = getUploadsCacheKey({\n size,\n contentType,\n file: data instanceof File ? data : undefined,\n bucket,\n accessLevel,\n key,\n optionsHash,\n });\n await cacheMultipartUpload(resumableUploadsCache, uploadCacheKey, {\n uploadId: UploadId,\n bucket,\n key,\n finalCrc32,\n fileName: data instanceof File ? data.name : '',\n });\n }\n return {\n uploadId: UploadId,\n cachedParts: [],\n finalCrc32,\n };\n }\n};\n\nexport { loadOrCreateMultipartUpload };\n","import { Amplify } from '@aws-amplify/core';\nimport { StorageAction } from '@aws-amplify/core/internals/utils';\nimport '@smithy/md5-js';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../../utils/client/runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../../../../utils/client/runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { StorageError } from '../../../../../../errors/StorageError.mjs';\nimport { resolveS3ConfigAndInput } from '../../../../utils/resolveS3ConfigAndInput.mjs';\nimport { CanceledError } from '../../../../../../errors/CanceledError.mjs';\nimport '../../../../../../errors/types/validation.mjs';\nimport { logger } from '../../../../../../utils/logger.mjs';\nimport { validateStorageOperationInput } from '../../../../utils/validateStorageOperationInput.mjs';\nimport { STORAGE_INPUT_KEY, DEFAULT_QUEUE_SIZE, DEFAULT_ACCESS_LEVEL } from '../../../../utils/constants.mjs';\nimport '../../../../utils/client/s3data/base.mjs';\nimport '../../../../utils/client/s3data/getObject.mjs';\nimport '../../../../utils/client/s3data/listObjectsV2.mjs';\nimport '../../../../utils/client/s3data/putObject.mjs';\nimport '../../../../utils/client/s3data/createMultipartUpload.mjs';\nimport '../../../../utils/client/s3data/uploadPart.mjs';\nimport { completeMultipartUpload } from '../../../../utils/client/s3data/completeMultipartUpload.mjs';\nimport '../../../../utils/client/s3data/listParts.mjs';\nimport { abortMultipartUpload } from '../../../../utils/client/s3data/abortMultipartUpload.mjs';\nimport '../../../../utils/client/s3data/copyObject.mjs';\nimport { headObject } from '../../../../utils/client/s3data/headObject.mjs';\nimport '../../../../utils/client/s3data/deleteObject.mjs';\nimport { getStorageUserAgentValue } from '../../../../utils/userAgent.mjs';\nimport { calculateContentCRC32 } from '../../../../utils/crc32.mjs';\nimport { IntegrityError } from '../../../../../../errors/IntegrityError.mjs';\nimport { uploadPartExecutor } from './uploadPartExecutor.mjs';\nimport { serializeUploadOptions, getUploadsCacheKey, removeCachedUpload } from './uploadCache.mjs';\nimport { getConcurrentUploadsProgressTracker } from './progressTracker.mjs';\nimport { loadOrCreateMultipartUpload } from './initialUpload.mjs';\nimport { getDataChunker } from './getDataChunker.mjs';\nimport { calculatePartSize } from './calculatePartSize.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Create closure hiding the multipart upload implementation details and expose the upload job and control functions(\n * onPause, onResume, onCancel).\n *\n * @internal\n */\nconst getMultipartUploadHandlers = (uploadDataInput, size) => {\n let resolveCallback;\n let rejectCallback;\n let inProgressUpload;\n let resolvedS3Config;\n let abortController;\n let resolvedAccessLevel;\n let resolvedBucket;\n let resolvedKeyPrefix;\n let resolvedIdentityId;\n let uploadCacheKey;\n let finalKey;\n let expectedBucketOwner;\n // Special flag that differentiates HTTP requests abort error caused by pause() from ones caused by cancel().\n // The former one should NOT cause the upload job to throw, but cancels any pending HTTP requests.\n // This should be replaced by a special abort reason. However,the support of this API is lagged behind.\n let isAbortSignalFromPause = false;\n const { resumableUploadsCache } = uploadDataInput.options ?? {};\n const startUpload = async () => {\n const { options: uploadDataOptions, data } = uploadDataInput;\n const resolvedS3Options = await resolveS3ConfigAndInput(Amplify, uploadDataInput);\n abortController = new AbortController();\n isAbortSignalFromPause = false;\n resolvedS3Config = resolvedS3Options.s3Config;\n resolvedBucket = resolvedS3Options.bucket;\n resolvedIdentityId = resolvedS3Options.identityId;\n expectedBucketOwner = uploadDataOptions?.expectedBucketOwner;\n const { inputType, objectKey } = validateStorageOperationInput(uploadDataInput, resolvedIdentityId);\n const { contentDisposition, contentEncoding, contentType = 'application/octet-stream', metadata, preventOverwrite, onProgress, } = uploadDataOptions ?? {};\n finalKey = objectKey;\n // Resolve \"key\" specific options\n if (inputType === STORAGE_INPUT_KEY) {\n const accessLevel = uploadDataOptions\n ?.accessLevel;\n resolvedKeyPrefix = resolvedS3Options.keyPrefix;\n finalKey = resolvedKeyPrefix + objectKey;\n resolvedAccessLevel = resolveAccessLevel(accessLevel);\n }\n const { checksum: optionsHash } = await calculateContentCRC32(serializeUploadOptions(uploadDataOptions));\n if (!inProgressUpload) {\n const { uploadId, cachedParts, finalCrc32 } = await loadOrCreateMultipartUpload({\n s3Config: resolvedS3Config,\n accessLevel: resolvedAccessLevel,\n bucket: resolvedBucket,\n keyPrefix: resolvedKeyPrefix,\n key: objectKey,\n contentType,\n contentDisposition,\n contentEncoding,\n metadata,\n data,\n size,\n abortSignal: abortController.signal,\n checksumAlgorithm: uploadDataOptions?.checksumAlgorithm,\n optionsHash,\n resumableUploadsCache,\n expectedBucketOwner,\n });\n inProgressUpload = {\n uploadId,\n completedParts: cachedParts,\n finalCrc32,\n };\n }\n uploadCacheKey = size\n ? getUploadsCacheKey({\n file: data instanceof File ? data : undefined,\n accessLevel: resolvedAccessLevel,\n contentType: uploadDataOptions?.contentType,\n bucket: resolvedBucket,\n size,\n key: objectKey,\n optionsHash,\n })\n : undefined;\n const dataChunker = getDataChunker(data, size);\n const completedPartNumberSet = new Set(inProgressUpload.completedParts.map(({ PartNumber }) => PartNumber));\n const onPartUploadCompletion = (partNumber, eTag, crc32) => {\n inProgressUpload?.completedParts.push({\n PartNumber: partNumber,\n ETag: eTag,\n // TODO: crc32 can always be added once RN also has an implementation\n ...(crc32 ? { ChecksumCRC32: crc32 } : {}),\n });\n };\n const concurrentUploadsProgressTracker = getConcurrentUploadsProgressTracker({\n size,\n onProgress,\n });\n const concurrentUploadPartExecutors = [];\n for (let index = 0; index < DEFAULT_QUEUE_SIZE; index++) {\n concurrentUploadPartExecutors.push(uploadPartExecutor({\n dataChunkerGenerator: dataChunker,\n completedPartNumberSet,\n s3Config: resolvedS3Config,\n abortSignal: abortController.signal,\n bucket: resolvedBucket,\n finalKey,\n uploadId: inProgressUpload.uploadId,\n onPartUploadCompletion,\n onProgress: concurrentUploadsProgressTracker.getOnProgressListener(),\n isObjectLockEnabled: resolvedS3Options.isObjectLockEnabled,\n useCRC32Checksum: Boolean(inProgressUpload.finalCrc32),\n expectedBucketOwner,\n }));\n }\n await Promise.all(concurrentUploadPartExecutors);\n validateCompletedParts(inProgressUpload.completedParts, size);\n const { ETag: eTag } = await completeMultipartUpload({\n ...resolvedS3Config,\n abortSignal: abortController.signal,\n userAgentValue: getStorageUserAgentValue(StorageAction.UploadData),\n }, {\n Bucket: resolvedBucket,\n Key: finalKey,\n UploadId: inProgressUpload.uploadId,\n ChecksumCRC32: inProgressUpload.finalCrc32,\n IfNoneMatch: preventOverwrite ? '*' : undefined,\n MultipartUpload: {\n Parts: sortUploadParts(inProgressUpload.completedParts),\n },\n ExpectedBucketOwner: expectedBucketOwner,\n });\n if (size) {\n const { ContentLength: uploadedObjectSize } = await headObject(resolvedS3Config, {\n Bucket: resolvedBucket,\n Key: finalKey,\n ExpectedBucketOwner: expectedBucketOwner,\n });\n if (uploadedObjectSize && uploadedObjectSize !== size) {\n throw new StorageError({\n name: 'Error',\n message: `Upload failed. Expected object size ${size}, but got ${uploadedObjectSize}.`,\n });\n }\n }\n if (resumableUploadsCache && uploadCacheKey) {\n await removeCachedUpload(resumableUploadsCache, uploadCacheKey);\n }\n const result = {\n eTag,\n contentType,\n metadata,\n };\n return inputType === STORAGE_INPUT_KEY\n ? { key: objectKey, ...result }\n : { path: objectKey, ...result };\n };\n const startUploadWithResumability = () => startUpload()\n .then(resolveCallback)\n .catch(error => {\n const abortSignal = abortController?.signal;\n if (abortSignal?.aborted && isAbortSignalFromPause) {\n logger.debug('upload paused.');\n }\n else {\n // Uncaught errors should be exposed to the users.\n rejectCallback(error);\n }\n });\n const multipartUploadJob = () => new Promise((resolve, reject) => {\n resolveCallback = resolve;\n rejectCallback = reject;\n startUploadWithResumability();\n });\n const onPause = () => {\n isAbortSignalFromPause = true;\n abortController?.abort();\n };\n const onResume = () => {\n startUploadWithResumability();\n };\n const onCancel = (message) => {\n // 1. abort in-flight API requests\n abortController?.abort(message);\n const cancelUpload = async () => {\n // 2. clear upload cache.\n if (uploadCacheKey && resumableUploadsCache) {\n await removeCachedUpload(resumableUploadsCache, uploadCacheKey);\n }\n // 3. clear multipart upload on server side.\n await abortMultipartUpload(resolvedS3Config, {\n Bucket: resolvedBucket,\n Key: finalKey,\n UploadId: inProgressUpload?.uploadId,\n ExpectedBucketOwner: expectedBucketOwner,\n });\n };\n cancelUpload().catch(e => {\n logger.debug('error when cancelling upload task.', e);\n });\n rejectCallback(\n // Internal error that should not be exposed to the users. They should use isCancelError() to check if\n // the error is caused by cancel().\n new CanceledError(message ? { message } : undefined));\n };\n return {\n multipartUploadJob,\n onPause,\n onResume,\n onCancel,\n };\n};\nconst resolveAccessLevel = (accessLevel) => accessLevel ??\n Amplify.libraryOptions.Storage?.S3?.defaultAccessLevel ??\n DEFAULT_ACCESS_LEVEL;\nconst validateCompletedParts = (completedParts, size) => {\n const partsExpected = Math.ceil(size / calculatePartSize(size));\n const validPartCount = completedParts.length === partsExpected;\n const sorted = sortUploadParts(completedParts);\n const validPartNumbers = sorted.every((part, index) => part.PartNumber === index + 1);\n if (!validPartCount || !validPartNumbers) {\n throw new IntegrityError();\n }\n};\nconst sortUploadParts = (parts) => {\n return [...parts].sort((partA, partB) => partA.PartNumber - partB.PartNumber);\n};\n\nexport { getMultipartUploadHandlers };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Track the progress from multiple concurrent uploads, and invoke the onProgress callback.\n *\n * @internal\n */\nconst getConcurrentUploadsProgressTracker = ({ size, onProgress, }) => {\n const transferredBytesPerListener = [];\n const getTransferredBytes = () => transferredBytesPerListener.reduce((acc, transferredBytes) => acc + transferredBytes, 0);\n return {\n getOnProgressListener: () => {\n transferredBytesPerListener.push(0);\n const listenerIndex = transferredBytesPerListener.length - 1;\n return (event) => {\n const { transferredBytes } = event;\n transferredBytesPerListener[listenerIndex] = transferredBytes;\n onProgress?.({\n transferredBytes: getTransferredBytes(),\n totalBytes: size,\n });\n };\n },\n };\n};\n\nexport { getConcurrentUploadsProgressTracker };\n","import { parseMetadata } from '@aws-amplify/core/internals/aws-client-utils';\nimport { AmplifyUrl } from '@aws-amplify/core/internals/utils';\nimport { composeServiceApi } from '@aws-amplify/core/internals/aws-client-utils/composers';\nimport { s3TransferHandler } from '../runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { buildStorageServiceError, map, deserializeBoolean } from '../utils/deserializeHelpers.mjs';\nimport { validateS3RequiredParameter, serializePathnameObjectKey, assignStringVariables } from '../utils/serializeHelpers.mjs';\nimport { validateObjectUrl } from '../../validateObjectUrl.mjs';\nimport { defaultConfig, parseXmlError } from './base.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst deleteObjectSerializer = (input, endpoint) => {\n const url = new AmplifyUrl(endpoint.url.toString());\n validateS3RequiredParameter(!!input.Key, 'Key');\n url.pathname = serializePathnameObjectKey(url, input.Key);\n validateObjectUrl({\n bucketName: input.Bucket,\n key: input.Key,\n objectURL: url,\n });\n const headers = assignStringVariables({\n 'x-amz-expected-bucket-owner': input.ExpectedBucketOwner,\n });\n return {\n method: 'DELETE',\n headers,\n url,\n };\n};\nconst deleteObjectDeserializer = async (response) => {\n if (response.statusCode >= 300) {\n // error is always set when statusCode >= 300\n const error = (await parseXmlError(response));\n throw buildStorageServiceError(error, response.statusCode);\n }\n else {\n const content = map(response.headers, {\n DeleteMarker: ['x-amz-delete-marker', deserializeBoolean],\n VersionId: 'x-amz-version-id',\n RequestCharged: 'x-amz-request-charged',\n });\n return {\n ...content,\n $metadata: parseMetadata(response),\n };\n }\n};\nconst deleteObject = composeServiceApi(s3TransferHandler, deleteObjectSerializer, deleteObjectDeserializer, { ...defaultConfig, responseType: 'text' });\n\nexport { deleteObject };\n","import { StorageAction } from '@aws-amplify/core/internals/utils';\nimport '@smithy/md5-js';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../utils/client/runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../../utils/client/runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport { resolveS3ConfigAndInput } from '../../utils/resolveS3ConfigAndInput.mjs';\nimport '../../../../errors/types/validation.mjs';\nimport { logger } from '../../../../utils/logger.mjs';\nimport { validateBucketOwnerID } from '../../utils/validateBucketOwnerID.mjs';\nimport { validateStorageOperationInput } from '../../utils/validateStorageOperationInput.mjs';\nimport { STORAGE_INPUT_KEY } from '../../utils/constants.mjs';\nimport '../../utils/client/s3data/base.mjs';\nimport '../../utils/client/s3data/getObject.mjs';\nimport '../../utils/client/s3data/listObjectsV2.mjs';\nimport '../../utils/client/s3data/putObject.mjs';\nimport '../../utils/client/s3data/createMultipartUpload.mjs';\nimport '../../utils/client/s3data/uploadPart.mjs';\nimport '../../utils/client/s3data/completeMultipartUpload.mjs';\nimport '../../utils/client/s3data/listParts.mjs';\nimport '../../utils/client/s3data/abortMultipartUpload.mjs';\nimport '../../utils/client/s3data/copyObject.mjs';\nimport '../../utils/client/s3data/headObject.mjs';\nimport { deleteObject } from '../../utils/client/s3data/deleteObject.mjs';\nimport { getStorageUserAgentValue } from '../../utils/userAgent.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst remove = async (amplify, input) => {\n const { s3Config, keyPrefix, bucket, identityId } = await resolveS3ConfigAndInput(amplify, input);\n const { inputType, objectKey } = validateStorageOperationInput(input, identityId);\n validateBucketOwnerID(input.options?.expectedBucketOwner);\n let finalKey;\n if (inputType === STORAGE_INPUT_KEY) {\n finalKey = `${keyPrefix}${objectKey}`;\n logger.debug(`remove \"${objectKey}\" from \"${finalKey}\".`);\n }\n else {\n finalKey = objectKey;\n logger.debug(`removing object in path \"${finalKey}\"`);\n }\n await deleteObject({\n ...s3Config,\n userAgentValue: getStorageUserAgentValue(StorageAction.Remove),\n }, {\n Bucket: bucket,\n Key: finalKey,\n ExpectedBucketOwner: input.options?.expectedBucketOwner,\n });\n return inputType === STORAGE_INPUT_KEY\n ? {\n key: objectKey,\n }\n : {\n path: objectKey,\n };\n};\n\nexport { remove };\n","import { Injectable } from '@angular/core';\nimport { confirmResetPassword, confirmSignIn, fetchUserAttributes, getCurrentUser, resetPassword, signInWithRedirect, updateUserAttributes } from '@aws-amplify/auth';\nimport { signIn, signOut, signUp } from 'aws-amplify/auth';\nimport { NewUser } from '../../ghlplus/models/new_user';\nimport { Cache } from 'aws-amplify/utils';\nimport { HttpClient, HttpHeaders } from '@angular/common/http';\nimport { environment } from 'src/environments/environment';\nimport { AuthProvider } from '@aws-amplify/auth/dist/esm/types/inputs';\nimport { fetchAuthSession } from 'aws-amplify/auth';\nimport { getUrl, remove, uploadData } from 'aws-amplify/storage';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthService {\n public loggedIn: boolean;\n // private _authState: Subject = new Subject();\n // authState: Observable = this._authState.asObservable();\n\n public static SIGN_IN = 'signIn';\n public static SIGN_OUT = 'signOut';\n public static FACEBOOK = \"Facebook\";\n public static GOOGLE = \"Google\";\n httpOptions = {\n headers: new HttpHeaders({\n 'Content-Type': 'application/json'\n })\n }\n constructor(private http: HttpClient) {\n }\n\n signUp(user: NewUser): Promise {\n let attributes = {\n \"email\": user.email,\n \"given_name\": user.firstName,\n \"family_name\": user.lastName,\n \"phone_number\": user.phone,\n \"nickname\": user.nickName\n };\n if (user.mapKey) {\n attributes['custom:mapKey'] = user.mapKey;\n }\n return signUp({\n \"username\": user.nickName,\n \"password\": user.password,\n \"options\":{\n userAttributes:attributes\n }\n });\n }\n\n signIn(username: string, password: string): Promise {\n\n return new Promise((resolve, reject) => {\n signIn({username, password})\n .then((user:any) => {\n this.loggedIn = true;\n resolve(user);\n }).catch((error: any) => reject(error));\n });\n }\n\n signOut(): Promise {\n return signOut()\n .then(() => this.loggedIn = false)\n }\n\n socialSignIn(provider: AuthProvider, returnURL?: string): Promise {\n if (returnURL) {\n Cache.setItem('returnURL', returnURL);\n }\n return signInWithRedirect({\n 'provider': provider,\n });\n }\n\n autoLogIn(email: string, code: string): Promise {\n const challengeResponse = 'the answer for the challenge';\n return signIn({username:email}).then(async user => {\n return await confirmSignIn({challengeResponse}).then(async signInUser =>{\n const {\n username,\n signInDetails\n } = await getCurrentUser();\n const {\n tokens: session\n } = await fetchAuthSession();\n return {\n username,\n session,\n authenticationFlowType: signInDetails.authFlowType\n };\n })\n })\n }\n\n async updateReservation(mapKey: string) {\n return await fetchUserAttributes().then((userInfo) => {\n console.log(userInfo.attributes.sub);\n Cache.removeItem('mapKey');\n return this.http.post(`${environment.API_COGNITO}users/map-reservation`, {\n userId: userInfo.attributes.sub,\n mapKey: mapKey\n }, this.httpOptions).toPromise();\n }).catch((error) => {\n console.log('[ERROR]: ', error);\n });\n }\n\n userLoggedIn(): Promise {\n // return Auth.currentAuthenticatedUser().then(() => {\n // }, error => {\n // });\n return new Promise( (resolve)=>{\n resolve(this.validTokenBookin())\n });\n }\n\n validTokenBookin(){\n const hashGuestService = localStorage.getItem('hash_guest_service');\n if(hashGuestService){\n return true;\n }else{\n return false;\n }\n }\n\n async getUserInfo() {\n return fetchUserAttributes().then(res => {\n if (res != null) {\n if (res?.identities) {\n res.identities = JSON.parse(res.identities)\n if (res.identities.length > 0 && res.providerType == 'Facebook') {//facebook\n res.provider = 'Facebook'\n res.picture = `https://graph.facebook.com/${res.userId}/picture?type=large`\n return res\n }\n }\n if (res?.picture) {\n return getUrl({key:res.picture}).then(pictureURL => {\n res.picture = pictureURL.url.toString();\n return res\n })\n } else {\n res.picture = 'null'\n }\n } else {\n\n // throw 'User no found';\n }\n return res\n })\n }\n\n getJwtToken(): Promise {\n return fetchAuthSession().then(\n res => res.tokens?.accessToken,\n err => null\n )\n }\n\n async updateUserAttributes(attributes: any) {\n const currentUserData = await getCurrentUser();\n \n const fetchAuthData= await fetchAuthSession();\n\n return await updateUserAttributes({\n userAttributes:{...attributes,...currentUserData,...fetchAuthData}\n });\n }\n\n updateUserPhoto(file: File) {\n return this.getUserInfo().then(async user => {\n let path = 'profilePic_' + user.attributes.sub;\n let fileExtension = file.type.substring(file.type.lastIndexOf('/') + 1);\n path += ('.' + fileExtension)\n const uploadTask = uploadData(\n { path, \n data:file,\n options:{ \n contentType: file.type,\n }});\n \n return await uploadTask.result.then((result: any) => {\n return this.updateUserAttributes({ picture: result.key }).then(res => result)\n })\n })\n }\n \n deleteUserPhoto() {\n return fetchUserAttributes().then(user => {\n let key = user.picture;\n return remove(\n {path:key}).then(\n res => {\n return this.updateUserAttributes({ picture: '' });\n })\n })\n }\n\n sendConfirmationCode(username: string) {\n return resetPassword({username})\n }\n\n recoverPasswordUsingCode(username: string, confirmationCode: string, newPassword: string) {\n return confirmResetPassword({username, confirmationCode, newPassword})\n }\n}\n","import { Amplify } from '@aws-amplify/core';\nimport { getUrl as getUrl$1 } from './internal/getUrl.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction getUrl(input) {\n return getUrl$1(Amplify, input);\n}\n\nexport { getUrl };\n","import { defaultStorage } from '@aws-amplify/core';\nimport { uploadData as uploadData$1 } from './internal/uploadData/index.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction uploadData(input) {\n return uploadData$1({\n ...input,\n options: {\n ...input?.options,\n // This option enables caching in-progress multipart uploads.\n // It's ONLY needed for client-side API.\n resumableUploadsCache: defaultStorage,\n },\n });\n}\n\nexport { uploadData };\n","import '@smithy/md5-js';\nimport '@aws-amplify/core/internals/aws-client-utils';\nimport '../../../utils/client/runtime/s3TransferHandler/fetch.mjs';\nimport 'fast-xml-parser';\nimport '../../../utils/client/runtime/s3TransferHandler/xhr.mjs';\nimport 'buffer';\nimport '@aws-amplify/core/internals/utils';\nimport { assertValidationError } from '../../../../../errors/utils/assertValidationError.mjs';\nimport { StorageValidationErrorCode } from '../../../../../errors/types/validation.mjs';\nimport { MAX_OBJECT_SIZE, DEFAULT_PART_SIZE } from '../../../utils/constants.mjs';\nimport { createUploadTask } from '../../../utils/transferTask.mjs';\nimport { byteLength } from './byteLength.mjs';\nimport { putObjectJob } from './putObjectJob.mjs';\nimport { getMultipartUploadHandlers } from './multipart/uploadHandlers.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst uploadData = (input) => {\n const { data } = input;\n const dataByteLength = byteLength(data);\n // Using InvalidUploadSource error code because the input data must NOT be any\n // of permitted Blob, string, ArrayBuffer(View) if byteLength could not be determined.\n assertValidationError(dataByteLength !== undefined, StorageValidationErrorCode.InvalidUploadSource);\n assertValidationError(dataByteLength <= MAX_OBJECT_SIZE, StorageValidationErrorCode.ObjectIsTooLarge);\n if (dataByteLength <= DEFAULT_PART_SIZE) {\n // Single part upload\n const abortController = new AbortController();\n return createUploadTask({\n isMultipartUpload: false,\n job: putObjectJob(input, abortController.signal, dataByteLength),\n onCancel: (message) => {\n abortController.abort(message);\n },\n });\n }\n else {\n // Multipart upload\n const { multipartUploadJob, onPause, onResume, onCancel } = getMultipartUploadHandlers(input, dataByteLength);\n return createUploadTask({\n isMultipartUpload: true,\n job: multipartUploadJob,\n onCancel: (message) => {\n onCancel(message);\n },\n onPause,\n onResume,\n });\n }\n};\n\nexport { uploadData };\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Calculate the total size of the data to be uploaded. The total size is not required for multipart upload, as it's\n * only used in progress report.\n */\nconst byteLength = (input) => {\n if (input === null || input === undefined)\n return 0;\n if (typeof input === 'string') {\n const blob = new Blob([input]);\n return blob.size;\n }\n else if (typeof input.byteLength === 'number') {\n // handles Uint8Array, ArrayBuffer, Buffer, and ArrayBufferView\n return input.byteLength;\n }\n else if (typeof input.size === 'number') {\n // handles browser File object\n return input.size;\n }\n return undefined;\n};\n\nexport { byteLength };\n","import { Amplify } from '@aws-amplify/core';\nimport { remove as remove$1 } from './internal/remove.mjs';\n\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nfunction remove(input) {\n return remove$1(Amplify, input);\n}\n\nexport { remove };\n","import { Component, OnInit, Input, ContentChild, TemplateRef } from '@angular/core';\n\n@Component({\n selector: 'accordion-tab',\n template: '',\n})\nexport class AccordionTabComponent implements OnInit {\n\n @Input() title: string;\n @ContentChild(TemplateRef) content: TemplateRef;\n\n constructor() { }\n\n ngOnInit(): void {\n }\n\n}\n","\n
\n \n \n {{accordionTab.title|| ' '}}\n \n \n
\n
\n \n
\n
\n
\n
\n \n
\n \n \n {{accordionTab.title|| ' '}}\n \n \n
\n
\n \n
\n
\n
\n
\n
\n\n \n \n \n
\n {{accordionTab.title|| ' '}}\n
\n \n
\n
\n \n
\n
\n\n
\n\n
\n","import { Component, OnInit, ContentChildren, QueryList, Input } from '@angular/core';\nimport { state, style, transition, animate, trigger } from '@angular/animations';\nimport { AccordionTabComponent } from '../accordion-tab/accordion-tab.component';\n\n@Component({\n selector: 'accordion',\n templateUrl: './accordion.component.html',\n styleUrls: ['./accordion.component.scss'],\n animations: [\n trigger('openClose', [\n state('open', style({ height: '*', })),\n state('closed', style({ height: '0', })),\n transition('open <=> closed', animate('200ms ease-in-out'))\n ]),\n\n trigger('rotateIcon', [\n state('1', style({ transform: 'rotate(180deg)' })),\n state('0', style({ transform: 'rotate(0deg)' })),\n transition('1 <=> 0', animate('200ms ease-in-out'))\n ])\n ]\n})\nexport class AccordionComponent implements OnInit {\n\n @Input() selectedTab: number;\n @Input() accordionType: number = 1;\n @Input() icon: string;\n @ContentChildren(AccordionTabComponent) accordionTabs: QueryList;\n\n constructor() { }\n\n ngOnInit(): void { }\n\n onAccordionTabClick(index: number, el: HTMLElement) {\n if (index === this.selectedTab) this.selectedTab = null;\n else {\n this.selectedTab = index\n setTimeout(() => {\n if (!this.isInViewPort(el)) el.scrollIntoView({ behavior: \"smooth\" });\n }, 200);\n };\n }\n\n isInViewPort(el: HTMLElement) {\n const rect = el.getBoundingClientRect();\n return (\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth)\n );\n }\n\n}\n"," \n\n
\n
\n

{{'toggleMenu.languages'|translate}}

\n \n
\n
\n\n \n \n","import { Component, OnInit } from '@angular/core';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { LocaleService } from '../../services/locale.service';\nimport { LocationAppService } from '../../services/location-app.service';\nimport { AppHotelService } from 'src/app/modules/app-hotel/services/app-hotel.service';\n\nexport interface LanguageDto {\n cod:string,\n flag:string,\n text:string,\n label:string,\n}\n\n@Component({\n selector: 'app-icon-lang',\n templateUrl: './icon-lang.component.html',\n styleUrls: ['./icon-lang.component.scss']\n})\nexport class IconLangComponent implements OnInit {\n\n locale:LanguageDto;\n listLocaleAll:Array = [\n { cod:'es', flag:'/assets/flags/es.png', text:'ESP', label:'ESPAÑOL' } as LanguageDto,\n { cod:'en', flag:'/assets/flags/en.png', text:'ENG', label:'ENGLISH' } as LanguageDto,\n { cod:'pt', flag:'/assets/flags/pt.png', text:'PT', label:'PORTUGUÉS' } as LanguageDto,\n ];\n\n listHotelLanguage:Array;\n subscriptionHotel: Subscription;\n \n constructor(private localeService:LocaleService,\n private appHotelService: AppHotelService,\n private location: LocationAppService\n ) {\n\n const codLocale = this.localeService.getLocale();\n const languages = this.appHotelService.value?.languages;\n const arr = this.listLocaleAll.filter(x=>x.cod == codLocale) ;\n this.subscriptionHotel = this.appHotelService.subscribe( rta=>{\n this.init();\n })\n \n if(arr.length > 0){\n this.locale = arr[0];\n }else{\n this.locale = this.listLocaleAll[0];\n }\n\n }\n\n init(){\n if(!this.location.home() && this.appHotelService.value ){\n const languages = this.appHotelService.value?.languages;\n this.listHotelLanguage = this.listLocaleAll.filter(x=> languages.find(lan=> lan.Code == x.cod) );\n }\n }\n\n\n get listLocale(){\n return !this.location.home() ? this.listHotelLanguage : this.listLocaleAll;\n }\n\n\n ngOnInit(): void {\n }\n\n changeLocale(event:LanguageDto){\n if(event.cod != this.locale.cod){\n this.locale = event;\n this.localeService.setLocale(event.cod);\n }\n }\n\n}\n","
\n
\n \n
","import { Component, Input, OnDestroy, OnInit } from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { Subscription } from 'rxjs';\nimport { GetHotelIdBySlugQueryDto } from 'src/app/generatedGQLTypesDto';\nimport { AppHotelService } from 'src/app/modules/app-hotel/services/app-hotel.service';\nimport { APP_CONSTANTS, SOCIAL_NETWORKS_GHL } from 'src/environments/appConstants';\nimport { LocationAppService } from '../../services/location-app.service';\nimport { HomeDataStorageService } from 'src/app/modules/home/services/home-data-storage.service';\nimport { Contact } from '../../models/contact.model';\nimport { MenuDataStorageService } from 'src/app/modules/menu/services/menu-data-storage.service';\n\n@Component({\n selector: 'app-menu-toggle',\n templateUrl: './menu-toggle.component.html',\n styleUrls: ['./menu-toggle.component.scss']\n})\nexport class MenuToggleComponent implements OnInit, OnDestroy {\n\n @Input() routeHotel: string;\n appHotelData: GetHotelIdBySlugQueryDto['hotels'][0];\n rnt: string;\n navText: string;\n menuAbierto = false;\n menuList: Array;\n subscriptionHotel: Subscription;\n logoUrl_light: string;\n logoUrl_dark: string;\n versionAPP: string = APP_CONSTANTS.versionAPP;\n hotelMenu: boolean;\n contact: Contact = {};\n\n constructor(\n private router: Router,\n private activatedRoute: ActivatedRoute,\n public appHotelService: AppHotelService,\n private location: LocationAppService,\n private homeDataStorageService: HomeDataStorageService,\n private menuDataStorageService: MenuDataStorageService,\n ) {\n this.navText = \"Buscador de hoteles\";\n }\n\n ngOnInit(): void {\n this.subscriptionHotel = this.appHotelService.subscribe(rta => {\n this.appHotelData = this.appHotelService.value\n if (this.appHotelData) {\n this.routeHotel = !this.routeHotel ? this.appHotelData.city?.Country?.slug + '/' + this.appHotelData.city?.slug + '/' + this.appHotelData.slug : this.routeHotel;\n }\n this.menuList=[];\n if(this.home || this.appHotelData){\n this.optionsMenu();\n }\n });\n\n }\n\n ngOnDestroy(): void {\n this.subscriptionHotel.unsubscribe()\n }\n\n SetMenuHome() {\n this.hotelMenu = false;\n this.contact = SOCIAL_NETWORKS_GHL;\n this.menuList = [\n {\n title: 'toggleMenu.hotelsTitle',\n icon: 'fa-solid fa-star',\n routerLink: '/hoteles/search',\n },\n {\n title: 'toggleMenu.hotelsRestaurants',\n icon: 'fa-solid fa-building-circle-check',\n routerLink: '/hoteles/search-restaurant',\n },\n {\n title: 'toggleMenu.hotelsInterest',\n icon: 'fa-solid fa-mountain-sun',\n routerLink: '/hoteles/search-places',\n },\n {\n title: 'toggleMenu.FAQS',\n icon: 'fa-solid fa-comment-dots',\n routerLink: '/hoteles/faqs-ghlhoteles',\n },\n {\n title: 'toggleMenu.navigateOurSite',\n icon: 'fa-solid fa-globe',\n routerLink: SOCIAL_NETWORKS_GHL.web,\n web: true\n }\n ]\n }\n\n async setMenuHotel() {\n this.hotelMenu = true;\n this.loadSocialMedia();\n this.rnt = this.appHotelData?.RNTCode;\n this.logoUrl_light = this.appHotelData?.Logo?.url;\n this.logoUrl_dark = this.appHotelData?.Logo_Dark[0]?.url;\n this.menuList = [\n {\n title: 'toggleMenu.hotel.information',\n icon: 'fa-solid fa-circle-info',\n options: [\n {\n title: 'toggleMenu.hotel.generalInformation',\n icon: 'fa-solid fa-circle-info',\n routerLink: 'sobre-nosotros',\n },\n {\n title: 'toggleMenu.hotel.photos',\n icon: 'fa-solid fa-file-image',\n routerLink: 'fotos',\n }\n ]\n },\n {\n title: 'toggleMenu.hotel.services',\n icon: 'fa-regular fa-comment-dots',\n options: [\n {\n title: 'toggleMenu.hotel.servicesDirectory',\n icon: 'fa-solid fa-address-book',\n routerLink: 'directorio-de-servicios',\n }\n ],\n divider: true\n },\n {\n title: 'toggleMenu.hotelsInterest',\n icon: 'fa-solid fa-mountain-sun',\n routerLink: this.routeHotel + '/sitios-de-interes',\n },\n {\n title: 'toggleMenu.FAQS',\n icon: 'fa-solid fa-comment-dots',\n routerLink: this.routeHotel + '/faqs',\n },\n {\n title: 'toggleMenu.home',\n icon: 'fa-solid fa-hotel',\n routerLink: '/',\n }\n ];\n this.menuDataStorageService.getMenu().then(\n async res => {\n if (res && this.menuList[1].options.length == 1) {\n //eventos\n if (res.event?.EventRooms?.length > 0) {\n this.menuList[1].options.push({\n title: 'toggleMenu.hotel.events',\n icon: 'fa-solid fa-circle-info',\n routerLink: 'eventos',\n })\n }\n\n // Planes\n if (res.hotel_plans?.length > 0) {\n let plansEnabled = false\n let today = new Date();\n\n for (let i = 0; i < res.hotel_plans.length && !plansEnabled; i++) {\n const plan = res.hotel_plans[i];\n let init = new Date(plan.InitialDate);\n let end = plan.FinalDate ? new Date(plan.FinalDate) : null;\n if ((init <= today && end >= today) || end == null) plansEnabled = true\n }\n\n \n if (plansEnabled)\n this.menuList[1].options.push({\n title: 'toggleMenu.hotel.plans',\n icon: 'fa-solid fa-tag',\n routerLink: 'planes',\n }\n )\n }\n\n // Ofertas\n if (res.offers?.length > 0) {\n let offersEnabled = false\n let today = new Date();\n\n for (let i = 0; i < res.offers.length && !offersEnabled; i++) {\n const offer = res.offers[i];\n let init = new Date(offer.InitialEffectiveDate);\n let end = offer.FinalEffectiveDate ? new Date(offer.FinalEffectiveDate) : null;\n if ((init <= today && end >= today) || end == null) offersEnabled = true\n }\n\n if (offersEnabled)\n this.menuList[1].options.push({\n title: 'toggleMenu.hotel.promotions',\n icon: 'fa-solid fa-money-check-pen',\n routerLink: 'ofertas',\n }\n )\n }\n }\n });\n\n }\n\n loadSocialMedia() {\n this.homeDataStorageService.getSocialMedia().then(\n res => {\n if (res) {\n res.SocialMedia.forEach(\n item => {\n switch (Number(item.SocialMediaType.id)) {\n case 1:\n this.contact.Facebook = item.Value;\n break;\n case 2:\n this.contact.Instagram = item.Value;\n break;\n case 3:\n this.contact.Twitter = item.Value;\n break;\n case 4:\n this.contact.phone = item.Value;\n break;\n }\n }\n )\n }\n }\n )\n }\n\n toggleMenu() {\n this.menuAbierto = !this.menuAbierto;\n }\n\n optionsMenu() {\n this.contact = {};\n this.home ? this.SetMenuHome() : this.setMenuHotel()\n }\n\n navigate(menuItem: any) {\n if (menuItem.routerLink) {\n if (this.home) {\n this.router.navigate([menuItem.routerLink])\n }\n else {\n this.router.navigate(['./', this.routeHotel, menuItem.routerLink]);\n }\n }\n }\n\n get home() {\n return this.location.home();\n }\n\n}\n","export enum ModalPageType {\n left = 'left',\n right = 'right',\n bottom = 'bottom',\n top = 'top',\n modal = 'modal',\n center = 'center'\n}\n","
\n \n
\n\n
","import { Component, OnInit, Input, ChangeDetectorRef, HostListener } from '@angular/core';\nimport { ModalPageType } from '../../enums/modal-page-type.enum';\nimport { InstallService } from '../../../../services/install.service';\n\n@Component({\n selector: 'modal-page',\n templateUrl: './modal-page.component.html',\n styleUrls: ['./modal-page.component.scss']\n})\nexport class ModalPageComponent implements OnInit {\n\n @Input() type: ModalPageType = ModalPageType.modal;\n @Input() modalPageType: 'allPage' | 'modal' = 'allPage';\n @Input() set menuHeight(newValue: string) {\n this._menuHeight = newValue;\n if (this.ready) this.ngOnInit();\n }\n @Input() menuWidth: string;\n\n @HostListener('window:resize') windowResize() {\n if (this.type == 'bottom') {\n this.detailsContainerStyles['width'] = `${document.body.clientWidth - 30}px`\n if (this.modalActive) this.openModal();\n }\n }\n\n detailsContainerStyles: any;\n detailsContainerclass: any = { 'menu-box': true, 'menu-ready': true };\n modalActive: boolean = false;\n ready = false;\n\n private _menuHeight: string;\n\n constructor(\n private cd: ChangeDetectorRef,\n private InstallService: InstallService\n ) {\n }\n\n ngOnInit(): void {\n switch (this.modalPageType) {\n case 'modal':\n this._menuHeight = this._menuHeight || '360px';\n this.menuWidth = this.menuWidth || '300px';\n this.detailsContainerclass['round-medium'] = true;\n break;\n\n default:\n this.menuWidth = '100%';\n this._menuHeight = '100%';\n break;\n }\n\n switch (this.type) {\n case 'left':\n this.detailsContainerStyles = { \"width\": this.menuWidth, \"height\": \"auto\", \"transform\": \"translateX(-100%)\" };\n break;\n case 'right':\n this.detailsContainerStyles = { \"width\": this.menuWidth, \"height\": \"auto\", \"transform\": \"translateX(100%)\" };\n break;\n case 'bottom':\n this.detailsContainerStyles = { \"height\": this._menuHeight, \"width\": `${document.body.clientWidth - 30}px`, \"transform\": `translate(${(window.innerWidth - document.body.clientWidth) / 2 + 15}px,100%)` };\n break;\n case 'top':\n this.detailsContainerStyles = { \"height\": this._menuHeight, \"width\": \"auto\", \"transform\": \"translateY(-100%)\", \"margin\": \"auto\" };\n break;\n case 'center':\n this.detailsContainerStyles = { \"height\": this._menuHeight, \"max-height\": \"85%\", \"width\": \"95%\", \"transform\": \"translateY(100%) !important\", \"margin\": \"auto\" };\n break;\n case 'modal':\n default:\n this.detailsContainerStyles = { \"width\": this.menuWidth, \"height\": this._menuHeight };\n break;\n }\n this.ready = true;\n\n if(this.type == 'center'){\n this.type = \"modal\" as ModalPageType;\n }\n }\n\n openModal() {\n switch (this.type) {\n case 'left':\n this.detailsContainerStyles['transform'] = `translateX(${(window.innerWidth - document.body.clientWidth) / 2}px)`\n break;\n case 'right':\n this.detailsContainerStyles['transform'] = `translateX(-${(window.innerWidth - document.body.clientWidth) / 2}px)`\n break;\n case 'bottom':\n this.detailsContainerStyles['transform'] = `translate(${(window.innerWidth - document.body.clientWidth) / 2 + 15}px,-15px)`\n break;\n\n default:\n this.detailsContainerclass['menu-active'] = true;\n break;\n }\n this.modalActive = true;\n this.InstallService.allowedToInstall = false;\n this.cd.detectChanges();\n };\n\n closeModal() {\n switch (this.type) {\n case 'left':\n this.detailsContainerStyles['transform'] = `translateX(-100%)`;\n break;\n case 'right':\n this.detailsContainerStyles['transform'] = `translateX(100%)`;\n break;\n case 'bottom':\n this.detailsContainerStyles['transform'] = `translate(${(window.innerWidth - document.body.clientWidth) / 2 + 15}px,100%)`\n break;\n default:\n this.detailsContainerclass['menu-active'] = false;\n break;\n }\n this.modalActive = false;\n this.InstallService.allowedToInstall = true;\n\n }\n\n}\n","import { Component, OnInit, Input } from '@angular/core';\n\n@Component({\n selector: 'preloader',\n templateUrl: './preloader.component.html',\n styleUrls: ['./preloader.component.scss']\n})\nexport class PreloaderComponent implements OnInit {\n\n @Input() fullPage: Boolean = false;\n @Input() color: string = 'highlight';\n @Input() size: string;\n @Input() position: string;\n\n @Input() style:any = {'position': 'relative'};\n \n\n public spinnerClass: any = { 'preload-spinner': true };\n\n constructor() { }\n\n ngOnInit(): void {\n if (this.color !== undefined && this.color !== null) {\n this.spinnerClass['border-' + this.color] = true;\n }\n\n if (this.size !== undefined && this.size !== null) {\n this.spinnerClass['preload-' + this.size] = true;\n }\n\n if(this.position !== undefined && this.position !== null){\n this.style = {'position': this.position};\n }\n }\n\n}\n","
\n
\n
","
\n \n \n \n \n \n
\n","import { AfterViewInit, Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core';\nimport { Contact } from '../../models/contact.model';\n\n@Component({\n selector: 'social-networks',\n templateUrl: './social-networks.component.html',\n styleUrls: ['./social-networks.component.scss']\n})\nexport class SocialNetworksComponent implements OnInit,AfterViewInit {\n\n @Input() contact: Contact;\n @Input() size:string = null; \n @ViewChild('socialNetworks') socialNetworks: ElementRef;\n\n constructor() { }\n\n ngAfterViewInit(): void {\n if(this.size){\n const socialNetworksElement: HTMLElement = this.socialNetworks.nativeElement;\n \n const icons = socialNetworksElement.querySelectorAll('i');\n\n icons.forEach(icon => {\n icon.classList.add('fa-'+this.size);\n });\n }\n }\n\n ngOnInit(): void {\n\n }\n\n}\n","import { Directive, HostBinding, ElementRef, OnInit, HostListener } from '@angular/core';\nimport { AppHotelService } from '../../app-hotel/services/app-hotel.service';\n\n@Directive({\n selector: '.page-content'\n})\nexport class PageHeightDirective implements OnInit {\n @HostBinding('style.minHeight') valid: string;\n\n @HostListener('window:resize') calculateHeight() {\n let isHeaderClear = this.el.nativeElement.parentElement?.classList.contains('header-clear');\n let currentHeight = Number(this.valid?.replace('px', ''))\n if (isHeaderClear) {\n if (currentHeight != window.innerHeight - 55) this.valid = (window.innerHeight - 55) + 'px'\n } else {\n if (currentHeight != window.innerHeight) this.valid = (window.innerHeight - 123) + 'px'\n }\n }\n\n constructor(public el: ElementRef) { }\n\n ngOnInit(): void {\n this.calculateHeight()\n }\n\n\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { AppHotelService } from '../../app-hotel/services/app-hotel.service';\n\n@Directive({\n selector: '[ToggleTheme]'\n})\nexport class ToggleThemeDirective {\n\n @HostListener('click') switchTheme() {\n if (this.ToggleTheme) {\n this.appHotelService.toggleTheme();\n }\n }\n\n constructor(\n private appHotelService: AppHotelService,\n ) { }\n\n @Input() ToggleTheme: boolean = true;\n\n}\n","import { Injectable } from '@angular/core';\nimport { Router } from '@angular/router';\n\n/**\n * Servicio para gestionar la ubicación de la aplicación.\n *\n * @export\n * @class LocationAppService\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class LocationAppService {\n\n /**\n * Crea una instancia de LocationAppService.\n * \n * @param {Router} router - El enrutador de Angular para obtener la URL actual.\n * @memberof LocationAppService\n */\n constructor(private router: Router) { }\n\n /**\n * Comprueba si la aplicación se encuentra en la página de inicio.\n * \n * Este método verifica la URL actual contra un patrón específico y determina\n * si la aplicación está en una página que no es la página de inicio.\n *\n * @returns {boolean} - `true` si la aplicación está en la página de inicio, `false` de lo contrario.\n * @memberof LocationAppService\n */\n home(): boolean {\n const url = this.router.url;\n const regex = /^\\/hoteles\\/[^\\/]+\\/[^\\/]+\\/.*$/;\n return !regex.test(url);\n }\n}\n","/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */\n/* vim: set ts=2: */\n/*exported CRC32 */\nvar CRC32;\n(function (factory) {\n\t/*jshint ignore:start */\n\t/*eslint-disable */\n\tif(typeof DO_NOT_EXPORT_CRC === 'undefined') {\n\t\tif('object' === typeof exports) {\n\t\t\tfactory(exports);\n\t\t} else if ('function' === typeof define && define.amd) {\n\t\t\tdefine(function () {\n\t\t\t\tvar module = {};\n\t\t\t\tfactory(module);\n\t\t\t\treturn module;\n\t\t\t});\n\t\t} else {\n\t\t\tfactory(CRC32 = {});\n\t\t}\n\t} else {\n\t\tfactory(CRC32 = {});\n\t}\n\t/*eslint-enable */\n\t/*jshint ignore:end */\n}(function(CRC32) {\nCRC32.version = '1.2.2';\n/*global Int32Array */\nfunction signed_crc_table() {\n\tvar c = 0, table = new Array(256);\n\n\tfor(var n =0; n != 256; ++n){\n\t\tc = n;\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\tc = ((c&1) ? (-306674912 ^ (c >>> 1)) : (c >>> 1));\n\t\ttable[n] = c;\n\t}\n\n\treturn typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;\n}\n\nvar T0 = signed_crc_table();\nfunction slice_by_16_tables(T) {\n\tvar c = 0, v = 0, n = 0, table = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ;\n\n\tfor(n = 0; n != 256; ++n) table[n] = T[n];\n\tfor(n = 0; n != 256; ++n) {\n\t\tv = T[n];\n\t\tfor(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF];\n\t}\n\tvar out = [];\n\tfor(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256);\n\treturn out;\n}\nvar TT = slice_by_16_tables(T0);\nvar T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4];\nvar T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9];\nvar Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14];\nfunction crc32_bstr(bstr, seed) {\n\tvar C = seed ^ -1;\n\tfor(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF];\n\treturn ~C;\n}\n\nfunction crc32_buf(B, seed) {\n\tvar C = seed ^ -1, L = B.length - 15, i = 0;\n\tfor(; i < L;) C =\n\t\tTf[B[i++] ^ (C & 255)] ^\n\t\tTe[B[i++] ^ ((C >> 8) & 255)] ^\n\t\tTd[B[i++] ^ ((C >> 16) & 255)] ^\n\t\tTc[B[i++] ^ (C >>> 24)] ^\n\t\tTb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^\n\t\tT7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^\n\t\tT3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]];\n\tL += 15;\n\twhile(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF];\n\treturn ~C;\n}\n\nfunction crc32_str(str, seed) {\n\tvar C = seed ^ -1;\n\tfor(var i = 0, L = str.length, c = 0, d = 0; i < L;) {\n\t\tc = str.charCodeAt(i++);\n\t\tif(c < 0x80) {\n\t\t\tC = (C>>>8) ^ T0[(C^c)&0xFF];\n\t\t} else if(c < 0x800) {\n\t\t\tC = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];\n\t\t} else if(c >= 0xD800 && c < 0xE000) {\n\t\t\tc = (c&1023)+64; d = str.charCodeAt(i++)&1023;\n\t\t\tC = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF];\n\t\t} else {\n\t\t\tC = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF];\n\t\t\tC = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];\n\t\t}\n\t}\n\treturn ~C;\n}\nCRC32.table = T0;\n// $FlowIgnore\nCRC32.bstr = crc32_bstr;\n// $FlowIgnore\nCRC32.buf = crc32_buf;\n// $FlowIgnore\nCRC32.str = crc32_str;\n}));\n"],"x_google_ignoreList":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,188,189,190,191,192,210]}