1"use strict";(self.webpackChunkmy_app=self.webpackChunkmy_app||[]).push([[437],{82437:function(e,r,t){t.r(r);var n=t(74165),o=t(15861),u=t(29439),a=t(72791),s=t(11087),i=t(57689),c=t(87705),l=t(61889),d=t(35527),f=t(67414),p=t(20890),h=t(94070),y=t(13967),m=t(39709),x=t(54995),v=t(66732),g=t(66579),Z=t(62485),w=t(73015),b=t(80184),j=(0,a.lazy)((function(){return t.e(352).then(t.bind(t,15482))}));r.default=function(){var e=(0,y.Z)(),r=(0,i.s0)(),t=(0,g.C)(Z.uo),P=(0,a.useState)(null),k=(0,u.Z)(P,2),q=k[0],S=k[1],T=(0,x.YA)(),C=(0,u.Z)(T,2),F=C[0],V=C[1].isLoading,A=(0,c.cI)({mode:"all",reValidateMode:"onChange"}),E=A.control,L=A.handleSubmit,M=function(){var e=(0,o.Z)((0,n.Z)().mark((function e(o){return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,F(o).unwrap();case 3:t&&r(t),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),(0,w.A)(e.t0)&&401===e.t0.status?S("Username or password wrong."):(0,w.A)(e.t0)&&429===e.t0.status?S("Too many requests. Please try again later."):S("Unexpected error. Please try again later.");case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(r){return e.apply(this,arguments)}}();return(0,b.jsx)(l.ZP,{container:!0,alignContent:"center",justifyContent:"center",sx:{height:"100%",padding:"30px"},children:(0,b.jsx)(l.ZP,{item:!0,lg:3,md:6,xs:12,children:(0,b.jsx)(d.Z,{sx:{p:4},children:(0,b.jsx)("form",{noValidate:!0,onSubmit:L(M),children:(0,b.jsxs)(f.Z,{spacing:3,children:[(0,b.jsx)(j,{opacity:1}),(0,b.jsx)(p.Z,{variant:"h3",component:"div",color:"primary",children:"Login"}),q&&(0,b.jsx)(h.Z,{"data-cy":"alert-error",severity:"error",children:q}),(0,b.jsx)(v.G,{name:"username","data-cy":"username",control:E,defaultValue:"",rules:{required:"Username is required"},textFieldProps:{label:"Username"}}),(0,b.jsx)(v.G,{name:"password","data-cy":"password",control:E,defaultValue:"",rules:{required:"Password is required"},textFieldProps:{label:"Password",type:"password"}}),(0,b.jsx)(m.Z,{loading:V,type:"submit",color:"primary",variant:"contained",children:"Log in"}),(0,b.jsx)(s.rU,{to:"/forgot-password/",style:{color:e.palette.text.secondary},children:(0,b.jsx)(p.Z,{variant:"body2",component:"div",children:"Forgot password"})})]})})})})})}},54995:function(e,r,t){t.d(r,{YA:function(){return c},_y:function(){return p},nn:function(){return d},x_:function(){return f},zN:function(){return l}});var n=t(74165),o=t(15861),u=t(62485),a=t(1238),s=t(39110),i=s.u.injectEndpoints({endpoints:function(e){return{login:e.mutation({query:function(e){return{url:"/auth/token",method:"POST",body:e}},onQueryStarted:function(e,r){return(0,o.Z)((0,n.Z)().mark((function e(){var t,o,a,s,i,c;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.dispatch,o=r.queryFulfilled,e.prev=1,e.next=4,o;case 4:a=e.sent,s=a.data,i=s.user,c=s.token,localStorage.setItem("accessToken",c),t((0,u.av)(i)),t((0,u.BF)(!0)),e.next=15;break;case 13:e.prev=13,e.t0=e.catch(1);case 15:case"end":return e.stop()}}),e,null,[[1,13]])})))()}}),forgotPassword:e.mutation({query:function(e){return{url:"/auth/password/recover",method:"POST",body:e}}}),verifyToken:e.query({query:function(e){return"/auth/password/verify-token/".concat(e)}}),passwordReset:e.mutation({query:function(e){return{url:"/auth/password/reset",method:"PUT",body:e}}}),logout:e.mutation({query:function(){return{url:"/auth/logout",method:"POST"}},onQueryStarted:function(e,r){return(0,o.Z)((0,n.Z)().mark((function e(){var t,o;return(0,n.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.dispatch,o=r.queryFulfilled,e.prev=1,e.next=4,o;case 4:localStorage.removeItem("accessToken"),t((0,u.BF)(!1)),a.m.push("/login"),t(s.u.util.resetApiState()),e.next=12;break;case 10:e.prev=10,e.t0=e.catch(1);case 12:case"end":return e.stop()}}),e,null,[[1,10]])})))()}})}},overrideExisting:!1}),c=i.useLoginMutation,l=i.useForgotPasswordMutation,d=i.useVerifyTokenQuery,f=i.usePasswordResetMutation,p=i.useLogoutMutation},66732:function(e,r,t){t.d(r,{G:function(){return c}});var n=t(1413),o=t(45987),u=(t(72791),t(87705)),a=t(48550),s=t(80184),i=["textFieldProps","control","rules","defaultValue","disabled"];function c(e){var r=e.textFieldProps,t=e.control,c=e.rules,l=e.defaultValue,d=e.disabled,f=(0,o.Z)(e,i);return(0,s.jsx)(u.Qr,(0,n.Z)((0,n.Z)({control:t,rules:c,defaultValue:l},f),{},{render:function(e){var t=e.field,o=e.fieldState.error;return(0,s.jsx)(a.Z,(0,n.Z)((0,n.Z)((0,n.Z)({},r),t),{},{disabled:d,onChange:t.onChange,defaultValue:l,required:c&&"required"in c&&!1!==c.required,error:!!o,helperText:o?o.message:null},f))}}))}},73015:function(e,r,t){var n;function o(e){return"object"===typeof e&&null!=e&&"status"in e&&"number"===typeof e.status}t.d(r,{A:function(){return o},Y:function(){return n}}),function(e){e.ADD="add",e.REMOVE="remove",e.REPLACE="replace"}(n||(n={}))},66579:function(e,r,t){t.d(r,{C:function(){return u},T:function(){return o}});var n=t(12978),o=function(){return(0,n.I0)()},u=n.v9}}]); 2//# sourceMappingURL=437.af710ce0.chunk.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.