"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[3818],{49294:(C,m,t)=>{t.r(m),t.d(m,{SendResetMailPage:()=>g,default:()=>E});var n=t(74848),s=t(67293),x=t(22803),f=t(96540),u=t(49785),a=t(28082),p=t(29675),y=t(19550),c=t(54594),h=t(99178),d=t(86489),o=t(34128),e=t(48583),l=t(88023),i=t(11817);const j=r=>(0,x.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,f.useState)(!1),B=(0,p.of)(j),M=`${l.Ay.appSubUrl}/login`,{handleSubmit:D,register:I,formState:{errors:S}}=(0,u.mN)(),O=async P=>{await(0,a.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)(y.mc,{margin:"md"}),(0,n.jsx)(c.z9,{variant:"primary",href:M,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)(h.s,{children:(0,n.jsx)(i.x6,{i18nKey:"forgot-password.reset-password-header",children:"Reset password"})}),(0,n.jsx)(d.D,{label:"User",description:"Enter your information to get a reset link sent to you",invalid:!!S.userOrEmail,error:S?.userOrEmail?.message,children:(0,n.jsx)(o.p,{id:"user-input",placeholder:"Email or username",...I("userOrEmail",{required:"Email or username is required"})})}),(0,n.jsxs)(e.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:M,children:(0,n.jsx)(i.x6,{i18nKey:"forgot-password.back-button",children:"Back to login"})})]}),(0,n.jsx)("p",{className:B,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)(s.GU,{children:(0,n.jsx)(s.qm,{children:(0,n.jsx)(v,{})})}),E=g},67293:(C,m,t)=>{t.d(m,{GU:()=>c,YO:()=>d,qm:()=>y});var n=t(74848),s=t(22803),x=t(96540),f=t(29675),u=t(11817),a=t(77455),p=t(50363);const y=({children:o,enterAnimation:e=!0})=>{const l=(0,f.of)(d);return(0,n.jsx)("div",{className:(0,s.cx)(l.loginInnerBox,e&&l.enterAnimation),children:o})},c=({children:o,branding:e,isChangingPassword:l})=>{const i=(0,f.of)(d),[j,v]=(0,x.useState)(!1),g=e?.loginSubtitle??a.M.GetLoginSubTitle(),E=e?.loginTitle??a.M.LoginTitle,r=e?.loginBoxBackground||a.M.LoginBoxBackground(),L=e?.loginLogo,B=e?.hideEdition??a.M.HideEdition;return(0,x.useEffect)(()=>v(!0),[]),(0,n.jsxs)(a.M.LoginBackground,{className:(0,s.cx)(i.container,j&&i.loginAnim,e?.loginBackground),children:[(0,n.jsx)("div",{className:i.loginMain,children:(0,n.jsxs)("div",{className:(0,s.cx)(i.loginContent,r,"login-content-box"),children:[(0,n.jsxs)("div",{className:i.loginLogoWrapper,children:[(0,n.jsx)(a.M.LoginLogo,{className:i.loginLogo,logo:L}),(0,n.jsx)("div",{className:i.titleWrapper,children:l?(0,n.jsx)("h1",{className:i.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:i.mainTitle,children:E}),g&&(0,n.jsx)("h3",{className:i.subTitle,children:g})]})})]}),(0,n.jsx)("div",{className:i.loginOuterBox,children:o})]})}),e?.hideFooter?(0,n.jsx)(n.Fragment,{}):(0,n.jsx)(p.wi,{hideEdition:B,customLinks:e?.footerLinks})]})},h=(0,s.keyframes)`
from{
  opacity: 0;
  transform: translate(-60px, 0px);
}

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

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