"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[3818],{39058(C,x,t){t.r(x),t.d(x,{SendResetMailPage:()=>g,default:()=>E});var n=t(74848),o=t(8041),m=t(22803),u=t(96540),f=t(49785),i=t(52358),p=t(29318),y=t(49439),h=t(40994),c=t(45270),d=t(13214),s=t(49669),a=t(16244),l=t(68763),e=t(63075);const j=r=>(0,m.css)({color:r.colors.text.secondary,fontSize:r.typography.bodySmall.fontSize,fontWeight:r.typography.fontWeightRegular,marginTop:r.spacing(1),display:"block"}),v=()=>{const[r,L]=(0,u.useState)(!1),M=(0,y.of)(j),B=`${e.Ay.appSubUrl}/login`,{handleSubmit:D,register:I,formState:{errors:S}}=(0,f.mN)(),O=async P=>{await(0,p.AI)().post("/api/user/password/send-reset-email",P)&&L(!0)};return r?(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{children:(0,n.jsx)(i.x6,{i18nKey:"forgot-password.email-sent",children:"An email with a reset link has been sent to the email address. You should receive it shortly."})}),(0,n.jsx)(h.mc,{margin:"md"}),(0,n.jsx)(c.z9,{variant:"primary",href:B,children:(0,n.jsx)(i.x6,{i18nKey:"forgot-password.back-button",children:"Back to login"})})]}):(0,n.jsxs)("form",{onSubmit:D(O),children:[(0,n.jsx)(d.s,{children:(0,n.jsx)(i.x6,{i18nKey:"forgot-password.reset-password-header",children:"Reset password"})}),(0,n.jsx)(s.D,{label:(0,i.t)("forgot-password.user-field-label","User"),description:(0,i.t)("forgot-password.user-field-description","Enter your information to get a reset link sent to you"),invalid:!!S.userOrEmail,error:S?.userOrEmail?.message,children:(0,n.jsx)(a.p,{id:"user-input",placeholder:(0,i.t)("forgot-password.user-field-placeholder","Email or username"),...I("userOrEmail",{required:"Email or username is required"})})}),(0,n.jsxs)(l.B,{children:[(0,n.jsx)(c.$n,{type:"submit",children:(0,n.jsx)(i.x6,{i18nKey:"forgot-password.send-email-button",children:"Send reset email"})}),(0,n.jsx)(c.z9,{fill:"text",href:B,children:(0,n.jsx)(i.x6,{i18nKey:"forgot-password.back-button",children:"Back to login"})})]}),(0,n.jsx)("p",{className:M,children:(0,n.jsx)(i.x6,{i18nKey:"forgot-password.contact-admin",children:"Did you forget your username or email? Contact your Grafana administrator."})})]})},g=()=>(0,n.jsx)(o.GU,{children:(0,n.jsx)(o.qm,{children:(0,n.jsx)(v,{})})}),E=g},8041(C,x,t){t.d(x,{GU:()=>h,YO:()=>d,qm:()=>y});var n=t(74848),o=t(22803),m=t(96540),u=t(52358),f=t(49439),i=t(44363),p=t(96167);const y=({children:s,enterAnimation:a=!0})=>{const l=(0,f.of)(d);return(0,n.jsx)("div",{className:(0,o.cx)(l.loginInnerBox,a&&l.enterAnimation),children:s})},h=({children:s,branding:a,isChangingPassword:l})=>{const e=(0,f.of)(d),[j,v]=(0,m.useState)(!1),g=a?.loginSubtitle??i.M.GetLoginSubTitle(),E=a?.loginTitle??i.M.LoginTitle,r=a?.loginBoxBackground||i.M.LoginBoxBackground(),L=a?.loginLogo,M=a?.hideEdition??i.M.HideEdition;return(0,m.useEffect)(()=>v(!0),[]),(0,n.jsxs)(i.M.LoginBackground,{className:(0,o.cx)(e.container,j&&e.loginAnim,a?.loginBackground),children:[(0,n.jsx)("div",{className:e.loginMain,children:(0,n.jsxs)("div",{className:(0,o.cx)(e.loginContent,r,"login-content-box"),children:[(0,n.jsxs)("div",{className:e.loginLogoWrapper,children:[(0,n.jsx)(i.M.LoginLogo,{className:e.loginLogo,logo:L}),(0,n.jsx)("div",{className:e.titleWrapper,children:l?(0,n.jsx)("h1",{className:e.mainTitle,children:(0,n.jsx)(u.x6,{i18nKey:"login.layout.update-password",children:"Update your password"})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("h1",{className:e.mainTitle,children:E}),g&&(0,n.jsx)("h3",{className:e.subTitle,children:g})]})})]}),(0,n.jsx)("div",{className:e.loginOuterBox,children:s})]})}),a?.hideFooter?(0,n.jsx)(n.Fragment,{}):(0,n.jsx)(p.wi,{hideEdition:M,customLinks:a?.footerLinks})]})},c=(0,o.keyframes)`
from{
  opacity: 0;
  transform: translate(-60px, 0px);
}

to{
  opacity: 1;
  transform: translate(0px, 0px);
}`,d=s=>({loginMain:(0,o.css)({flexGrow:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minWidth:"100%"}),container:(0,o.css)({minHeight:"100%",backgroundPosition:"center",backgroundRepeat:"no-repeat",flex:1,minWidth:"100%",marginLeft:0,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"}),loginAnim:(0,o.css)({"&:before":{opacity:1},".login-content-box":{opacity:1}}),submitButton:(0,o.css)({justifyContent:"center",width:"100%"}),loginLogo:(0,o.css)({width:"100%",maxWidth:60,marginBottom:s.spacing(2),[s.breakpoints.up("sm")]:{maxWidth:100}}),loginLogoWrapper:(0,o.css)({display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",padding:s.spacing(3)}),titleWrapper:(0,o.css)({textAlign:"center"}),mainTitle:(0,o.css)({fontSize:22,[s.breakpoints.up("sm")]:{fontSize:32}}),subTitle:(0,o.css)({fontSize:s.typography.size.md,color:s.colors.text.secondary}),loginContent:(0,o.css)({maxWidth:478,width:"calc(100% - 2rem)",display:"flex",alignItems:"stretch",flexDirection:"column",position:"relative",justifyContent:"flex-start",zIndex:1,minHeight:320,borderRadius:s.shape.radius.lg,padding:s.spacing(2,0),opacity:0,[s.transitions.handleMotion("no-preference")]:{transition:"opacity 0.5s ease-in-out"},[s.transitions.handleMotion("reduce")]:{opacity:1},[s.breakpoints.up("sm")]:{minHeight:s.spacing(40),justifyContent:"center"}}),loginOuterBox:(0,o.css)({display:"flex",overflowY:"hidden",alignItems:"center",justifyContent:"center"}),loginInnerBox:(0,o.css)({padding:s.spacing(0,2,2,2),display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,maxWidth:415,width:"100%",transform:"translate(0px, 0px)",[s.transitions.handleMotion("no-preference")]:{transition:"0.25s ease"}}),enterAnimation:(0,o.css)({[s.transitions.handleMotion("no-preference")]:{animation:`${c} ease-out 0.2s`}})})}}]);

//# sourceMappingURL=SendResetMailPage.d45b2bf6a92463c13b3b.js.map