"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[133],{"./public/app/core/components/ForgottenPassword/SendResetMailPage.tsx":(e,s,r)=>{r.r(s),r.d(s,{SendResetMailPage:()=>j,default:()=>f});var n,a,i,t,o=r("./node_modules/react/index.js"),l=r("./public/app/core/components/Login/LoginLayout.tsx"),d=r("./packages/grafana-ui/src/index.ts"),c=r("./packages/grafana-runtime/src/index.ts"),u=r("./node_modules/@emotion/css/dist/emotion-css.esm.js"),p=r("./public/app/core/config.ts"),m=r("./node_modules/react/jsx-runtime.js");const g=e=>u.css`
  color: ${e.colors.formDescription};
  font-size: ${e.typography.size.sm};
  font-weight: ${e.typography.weight.regular};
  margin-top: ${e.spacing.sm};
  display: block;
`,h=()=>{var e,s;const[r,l]=(0,o.useState)(!1),u=(0,d.useStyles)(g),h=`${p.ZP.appSubUrl}/login`;return r?(0,m.jsxs)("div",{children:[n||(n=(0,m.jsx)("p",{children:"An email with a reset link has been sent to the email address. You should receive it shortly."})),a||(a=(0,m.jsx)(d.Container,{margin:"md"})),(0,m.jsx)(d.LinkButton,{variant:"primary",href:h,children:"Back to login"})]}):(0,m.jsx)(d.Form,{onSubmit:async e=>{await(0,c.getBackendSrv)().post("/api/user/password/send-reset-email",e)&&l(!0)},children:({register:r,errors:n})=>{var a;return(0,m.jsxs)(m.Fragment,{children:[i||(i=(0,m.jsx)(d.Legend,{children:"Reset password"})),(0,m.jsx)(d.Field,{label:"User",description:"Enter your information to get a reset link sent to you",invalid:!!n.userOrEmail,error:null==n||null===(a=n.userOrEmail)||void 0===a?void 0:a.message,children:(0,m.jsx)(d.Input,Object.assign({id:"user-input",placeholder:"Email or username"},r("userOrEmail",{required:"Email or username is required"})))}),e||(e=(0,m.jsxs)(d.HorizontalGroup,{children:[t||(t=(0,m.jsx)(d.Button,{children:"Send reset email"})),(0,m.jsx)(d.LinkButton,{fill:"text",href:h,children:"Back to login"})]})),s||(s=(0,m.jsx)("p",{className:u,children:"Did you forget your username or email? Contact your Grafana administrator."}))]})}})};var x;const j=()=>x||(x=(0,m.jsx)(l.dd,{children:(0,m.jsx)(l.$s,{children:(0,m.jsx)(h,{})})})),f=j}}]);
//# sourceMappingURL=SendResetMailPage.8128b05ac04b15cbf98d.js.map