1(this["webpackJsonplofty-dashboard"]=this["webpackJsonplofty-dashboard"]||[]).push([[88],{243:function(e,r,t){"use strict";t.d(r,"a",function(){return w});var n=t(2),o=t(29),s=t(187),a=t(11),c=t(229),d=t(16),i=t(228),l=t(230),u=t(234);function w(e,r){!1!==globalThis.__DEV__&&Object(u.a)(r||{},"ignoreResults","useMutation","If you don't want to synchronize component state with the mutation, please use the `useApolloClient` hook to get the client instance and call `client.mutate` directly.");var t=Object(i.a)(null===r||void 0===r?void 0:r.client);Object(c.b)(e,c.a.Mutation);var w=o.useState({called:!1,loading:!1,client:t}),j=w[0],b=w[1],f=o.useRef({result:j,mutationId:0,isMounted:!0,client:t,mutation:e,options:r});Object(l.a)(function(){Object.assign(f.current,{client:t,options:r,mutation:e})});var h=o.useCallback(function(e){void 0===e&&(e={});var r=f.current,t=r.options,o=r.mutation,c=Object(n.a)(Object(n.a)({},t),{mutation:o}),i=e.client||f.current.client;f.current.result.loading||c.ignoreResults||!f.current.isMounted||b(f.current.result={loading:!0,error:void 0,data:void 0,called:!0,client:i});var l=++f.current.mutationId,u=Object(s.a)(c,e);return i.mutate(u).then(function(r){var t,n,o=r.data,s=r.errors,c=s&&s.length>0?new d.a({graphQLErrors:s}):void 0,w=e.onError||(null===(t=f.current.options)||void 0===t?void 0:t.onError);if(c&&w&&w(c,u),l===f.current.mutationId&&!u.ignoreResults){var j={called:!0,loading:!1,data:o,error:c,client:i};f.current.isMounted&&!Object(a.b)(f.current.result,j)&&b(f.current.result=j)}var h=e.onCompleted||(null===(n=f.current.options)||void 0===n?void 0:n.onCompleted);return c||null===h||void 0===h||h(r.data,u),r},function(r){var t;if(l===f.current.mutationId&&f.current.isMounted){var n={loading:!1,error:r,data:void 0,called:!0,client:i};Object(a.b)(f.current.result,n)||b(f.current.result=n)}var o=e.onError||(null===(t=f.current.options)||void 0===t?void 0:t.onError);if(o)return o(r,u),{data:void 0,errors:r};throw r})},[]),v=o.useCallback(function(){if(f.current.isMounted){var e={called:!1,loading:!1,client:f.current.client};Object.assign(f.current,{mutationId:0,result:e}),b(e)}},[]);return o.useEffect(function(){var e=f.current;return e.isMounted=!0,function(){e.isMounted=!1}},[]),[h,Object(n.a)({reset:v},j)]}},907:function(e,r,t){"use strict";t.r(r);var n,o,s,a=t(243),c=t(1),d=t(194),i=t(71),l=t(12),u=t(58),w=t(214),j=t(255);const b=j.default.div(n||(n=Object(w.a)(["\n display: flex;\n justify-content: center;
1\n"]))),f=Object(j.default)(u.g)(o||(o=Object(w.a)(["\n width: 480px;\n"]))),h=Object(j.default)(u.o)(s||(s=Object(w.a)(["\n padding: 1.5rem;\n text-align: center;\n"])));var v=t(15);var O=e=>{const{onSubmit:r}=e,[t,n]=Object(c.useState)({oldPassword:"",newPassword:"",confirmPassword:""}),[o,s]=Object(c.useState)({oldPassword:"",newPassword:"",confirmPassword:""}),a=e=>{const{name:r,value:o}=e.target;n(Object(l.a)(Object(l.a)({},t),{},{[r]:o}))},d=(e,r)=>e?e.length<8?"".concat(r," must be at least 8 characters"):e.length>16?"".concat(r," can be at most 16 characters"):void 0:"Please input your ".concat(r.toLowerCase());return Object(v.jsx)(b,{children:Object(v.jsxs)(f,{children:[Object(v.jsx)(h,{children:"Change Password"}),Object(v.jsx)(u.h,{children:Object(v.jsxs)(u.v,{children:[Object(v.jsxs)(u.x,{floating:!0,children:[Object(v.jsx)(u.z,{type:"password",name:"oldPassword",placeholder:"Old password",invalid:!!o.oldPassword,value:t.oldPassword,onChange:a}),Object(v.jsx)(u.C,{for:"oldPassword",children:"Old password"}),Object(v.jsx)(u.w,{children:o.oldPassword})]}),Object(v.jsxs)(u.x,{floating:!0,children:[Object(v.jsx)(u.z,{type:"password",name:"newPassword",placeholder:"New password",invalid:!!o.newPassword,value:t.newPassword,onChange:a}),Object(v.jsx)(u.C,{for:"newPassword",children:"New password"}),Object(v.jsx)(u.w,{children:o.newPassword})]}),Object(v.jsxs)(u.x,{floating:!0,children:[Object(v.jsx)(u.z,{type:"password",name:"confirmPassword",placeholder:"Confirm password",invalid:!!o.confirmPassword,value:t.confirmPassword,onChange:a}),Object(v.jsx)(u.C,{for:"confirmPassword",children:"Confirm password"}),Object(v.jsx)(u.w,{children:o.confirmPassword})]}),Object(v.jsx)(u.x,{className:"text-center",children:Object(v.jsx)(u.e,{color:"primary",onClick:async e=>{e.preventDefault(),console.log(t);const{oldPassword:o,newPassword:a,confirmPassword:c}=t,i={oldPassword:d(o,"Old password"),newPassword:d(a,"New password"),confirmPassword:d(c,"Confirm password")};if(a!==c&&(i.confirmPassword="Confirm password not match"),s(i),i.oldPassword||i.newPassword||i.confirmPassword)return;await r(o,a)&&n({oldPassword:"",newPassword:"",confirmPassword:""})},children:"Submit"})})]})})]})})};r.default=()=>{const[e]=Object(a.a)(d.o);return Object(v.jsx)(O,{onSubmit:async(r,t)=>{try{return await e({variables:{oldPassword:r,newPassword:t}}),i.b.success("Your password has been changed"),!0}catch(c){var n,o,s,a;console.error(JSON.stringify(c));const e=(null===(n=c.networkError)||void 0===n||null===(o=n.result)||void 0===o||null===(s=o.errors)||void 0===s||null===(a=s[0])||void 0===a?void 0:a.message)||"An error has occurred. Please try again.";return i.b.error(e),!1}}})}}}]); 2//# sourceMappingURL=88.f4f578aa.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.