(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,4528,e=>{"use strict";var r=e.i(83901),t=e.i(13157);let s=(e,s)=>(0,r.getAmplifyUserAgent)({category:t.Category.Auth,action:e,...s});e.s(["getAuthUserAgentValue",()=>s])},89914,79613,9488,20093,e=>{"use strict";(t=o||(o={})).EmptySignInUsername="EmptySignInUsername",t.EmptySignInPassword="EmptySignInPassword",t.CustomAuthSignInPassword="CustomAuthSignInPassword",t.EmptySignUpUsername="EmptySignUpUsername",t.EmptySignUpPassword="EmptySignUpPassword",t.EmptyConfirmSignUpUsername="EmptyConfirmSignUpUsername",t.EmptyConfirmSignUpCode="EmptyConfirmSignUpCode",t.EmptyResendSignUpCodeUsername="EmptyresendSignUpCodeUsername",t.EmptyChallengeResponse="EmptyChallengeResponse",t.EmptyConfirmResetPasswordUsername="EmptyConfirmResetPasswordUsername",t.EmptyConfirmResetPasswordNewPassword="EmptyConfirmResetPasswordNewPassword",t.EmptyConfirmResetPasswordConfirmationCode="EmptyConfirmResetPasswordConfirmationCode",t.EmptyResetPasswordUsername="EmptyResetPasswordUsername",t.EmptyVerifyTOTPSetupCode="EmptyVerifyTOTPSetupCode",t.EmptyConfirmUserAttributeCode="EmptyConfirmUserAttributeCode",t.IncorrectMFAMethod="IncorrectMFAMethod",t.EmptyUpdatePassword="EmptyUpdatePassword",t.InvalidPreferredChallenge="InvalidPreferredChallenge",e.s(["AuthValidationErrorCode",()=>o],79613);let r={[o.EmptyChallengeResponse]:{message:"challengeResponse is required to confirmSignIn"},[o.EmptyConfirmResetPasswordUsername]:{message:"username is required to confirmResetPassword"},[o.EmptyConfirmSignUpCode]:{message:"code is required to confirmSignUp"},[o.EmptyConfirmSignUpUsername]:{message:"username is required to confirmSignUp"},[o.EmptyConfirmResetPasswordConfirmationCode]:{message:"confirmationCode is required to confirmResetPassword"},[o.EmptyConfirmResetPasswordNewPassword]:{message:"newPassword is required to confirmResetPassword"},[o.EmptyResendSignUpCodeUsername]:{message:"username is required to confirmSignUp"},[o.EmptyResetPasswordUsername]:{message:"username is required to resetPassword"},[o.EmptySignInPassword]:{message:"password is required to signIn"},[o.EmptySignInUsername]:{message:"username is required to signIn"},[o.EmptySignUpPassword]:{message:"password is required to signUp"},[o.EmptySignUpUsername]:{message:"username is required to signUp"},[o.CustomAuthSignInPassword]:{message:"A password is not needed when signing in with CUSTOM_WITHOUT_SRP",recoverySuggestion:"Do not include a password in your signIn call."},[o.IncorrectMFAMethod]:{message:"Incorrect MFA method was chosen. It should be either SMS, TOTP, or EMAIL",recoverySuggestion:"Try to pass SMS, TOTP, or EMAIL as the challengeResponse"},[o.EmptyVerifyTOTPSetupCode]:{message:"code is required to verifyTotpSetup"},[o.EmptyUpdatePassword]:{message:"oldPassword and newPassword are required to changePassword"},[o.EmptyConfirmUserAttributeCode]:{message:"confirmation code is required to confirmUserAttribute"},[o.InvalidPreferredChallenge]:{message:"The preferred challenge is not enabled in your backend configuration",recoverySuggestion:"Ensure the authentication method is enabled in your Amplify backend configuration"}};(s=i||(i={})).DEFAULT_MSG="Authentication Error",s.EMPTY_EMAIL="Email cannot be empty",s.EMPTY_PHONE="Phone number cannot be empty",s.EMPTY_USERNAME="Username cannot be empty",s.INVALID_USERNAME="The username should either be a string or one of the sign in types",s.EMPTY_PASSWORD="Password cannot be empty",s.EMPTY_CODE="Confirmation code cannot be empty",s.SIGN_UP_ERROR="Error creating account",s.NO_MFA="No valid MFA method provided",s.INVALID_MFA="Invalid MFA type",s.EMPTY_CHALLENGE="Challenge response cannot be empty",s.NO_USER_SESSION="Failed to get the session because the user is empty",s.NETWORK_ERROR="Network Error",s.DEVICE_CONFIG="Device tracking has not been configured in this User Pool",s.AUTOSIGNIN_ERROR="Please use your credentials to sign in",s.OAUTH_ERROR="Couldn't finish OAuth flow, check your User Pool HostedUI settings",(n=a||(a={})).SignInException="SignInException",n.OAuthSignInError="OAuthSignInException",e.s(["AuthErrorCodes",()=>a,"validationErrorMap",()=>r],9488);var t,s,n,o,i,a,d=e.i(44440);function m(e,t){let{message:s,recoverySuggestion:n}=r[t];if(!e)throw new d.AuthError({name:t,message:s,recoverySuggestion:n})}function E({username:e,userPoolId:r,userPoolClientId:t}){if("u"m],89914),e.s(["getUserContextData",()=>E],20093)},30605,e=>{"use strict";var r=e.i(74860),t=e.i(78475),s=e.i(13157),n=e.i(79613),o=e.i(89914),i=e.i(70095),a=e.i(4528),d=e.i(20093),m=e.i(7348),E=e.i(21089),p=e.i(38025),u=e.i(39615),g=e.i(75585),l=e.i(26399);async function c(e){let c,{username:S}=e;(0,o.assertValidationError)(!!S,n.AuthValidationErrorCode.EmptyResetPasswordUsername);let y=r.Amplify.getConfig().Auth?.Cognito;(0,t.assertTokenProviderConfig)(y);let{userPoolClientId:C,userPoolId:P,userPoolEndpoint:U}=y,A=e.options?.clientMetadata,f=(0,d.getUserContextData)({username:S,userPoolId:P,userPoolClientId:C}),h=(c={endpointResolver:(0,l.createCognitoUserPoolEndpointResolver)({endpointOverride:U})},(0,m.composeServiceApi)(E.cognitoUserPoolTransferHandler,(0,p.createUserPoolSerializer)("ForgotPassword"),(0,u.createUserPoolDeserializer)(),{...g.DEFAULT_SERVICE_CLIENT_API_CONFIG,...c})),R=(await h({region:(0,i.getRegionFromUserPoolId)(P),userAgentValue:(0,a.getAuthUserAgentValue)(s.AuthAction.ResetPassword)},{Username:S,ClientMetadata:A,ClientId:C,UserContextData:f})).CodeDeliveryDetails;return{isPasswordReset:!1,nextStep:{resetPasswordStep:"CONFIRM_RESET_PASSWORD_WITH_CODE",codeDeliveryDetails:{deliveryMedium:R?.DeliveryMedium,destination:R?.Destination,attributeName:R?.AttributeName}}}}e.s(["resetPassword",()=>c],30605)},91341,e=>{"use strict";var r=e.i(43476),t=e.i(71645),s=e.i(30605),n=e.i(91882),o=e.i(69437),i=e.i(34251),a=e.i(66796),d=e.i(76552),m=e.i(3974),E=e.i(18566),p=e.i(65052),u=e.i(72422);let g=u.config.env.supportCenterName;function l(){let[e,l]=(0,t.useState)(""),[c,S]=(0,t.useState)(""),y=(0,E.useRouter)(),C=u.config.env.loginIdType,P=async()=>{try{await (0,s.resetPassword)({username:e}),sessionStorage.setItem("username",e),y.push("/pub/forgotPassword/confirm")}catch(e){if(e instanceof Error)if("NotAuthorizedException"===e.name)return S(p.MESSAGES.ERROR.NOT_AUTHORIZED);else if("LimitExceededException"===e.name)return S(p.MESSAGES.ERROR.LIMIT_EXCEEDED);else if("UserNotFoundException"===e.name||"InvalidParameterException"===e.name)return S(p.MESSAGES.ERROR.USER_NOT_FOUND);else return S(`${p.MESSAGES.ERROR.DOWNLOAD_BODY(g)} ${e.message}`)}},U=async e=>{"Enter"===e.key&&(e.preventDefault(),await P())};return(0,r.jsx)(n.Container,{maxWidth:"sm",children:(0,r.jsxs)(d.Box,{sx:{mt:8,p:4,boxShadow:3,borderRadius:2},children:[(0,r.jsx)(a.Typography,{variant:"h5",gutterBottom:!0,children:p.MESSAGES.RESET_PASSWORD_TITLE}),(0,r.jsx)(m.Alert,{severity:"info",children:p.MESSAGES.INFO.RESET_PASSWORD(C)}),(0,r.jsx)(o.TextField,{label:p.MESSAGES.USERNAME(C),sx:{autocomplete:"username"},fullWidth:!0,margin:"normal",onChange:e=>l(e.target.value),onKeyDown:U}),c&&(0,r.jsx)(m.Alert,{severity:"error",children:c}),(0,r.jsx)(i.Button,{variant:"contained",color:"primary",fullWidth:!0,disabled:!e,sx:{mt:2},onClick:P,children:p.MESSAGES.RESET_PASSWORD}),(0,r.jsx)(i.Button,{variant:"outlined",color:"primary",fullWidth:!0,sx:{mt:2},onClick:()=>y.push("/"),children:p.MESSAGES.BACK})]})})}e.s(["default",()=>l])}]);