text: "use strict";(self.webpackChunkzignaly_webapp=self.webpackChunkzignaly_webapp||[]).push([[3164],{81282:function(e,t,a){a.d(t,{Z:function(){return s}});var n=a(67294),r=a(82245),l=a(60454),i=a(93178),m=a(80951),c=a(8987),s=function(e){var t=e.code,a=e.form,s=(0,n.useState)(!1),o=s[0],u=s[1];return n.createElement(r.Z,{alignItems:"center",className:"resetForm",display:"flex",flexDirection:"column",justifyContent:"center"},o?n.createElement(r.Z,{alignItems:"center",className:"errorBox",display:"flex",flexDirection:"column"},n.createElement(l.Z,{variant:"h3"},n.createElement(m.Z,{id:"recover.error"})),n.createElement(c.Z,{className:"loginLink",to:"/login"},n.createElement(m.Z,{id:"backtologin.text"}))):n.createElement(n.Fragment,null,n.createElement("img",{alt:"TheBull",className:"logo",src:i.Z}),n.createElement(a,{code:t,setExpired:u})))}},90917:function(e,t,a){a.r(t),a.d(t,{default:function(){return N}});var n=a(67294),r=a(65186),l=a(66735),i=(a(17727),a(82245)),m=a(48110),c=a(60454),s=a(8474),o=a(82825),u=a(45850),f=a(19199),E=a(66718),d=a(25444),g=a(80951),p=a(34141),y=function(e){var t=e.code,a=(0,n.useState)(!1),r=a[0],y=a[1],Z=(0,n.useState)(!1),N=Z[0],x=Z[1],h=(0,l.Z)(),v=(0,o.cI)({mode:"onChange"}),w=v.errors,b=v.handleSubmit,k=v.register,C=(0,f.I0)(),I=function(e){if(e.confirmNewEmail===e.newEmail){y(!0);var a={token:t,email:e.newEmail};u.Z.changeEmailConfirm(a).then((function(){C((0,E.O7)("","alert.changeemail.confirm.body")),(0,d.navigate)("/login")})).catch((function(e){C((0,E.jx)(e))})).finally((function(){y(!1)}))}else x(!0)};return n.createElement("form",{method:"post",onSubmit:b(I)},n.createElement(i.Z,{alignItems:"center",className:"resetPasswordForm",display:"flex",flexDirection:"column",justifyContent:"center"},n.createElement(c.Z,{variant:"h3"},n.createElement(g.Z,{id:"changeemail.form.title"})),n.createElement(i.Z,{alignItems:"start",className:"inputBox",display:"flex",flexDirection:"column",justifyContent:"start"},n.createElement("label",{className:"customLabel"},n.createElement(g.Z,{id:"security.newemail"})),n.createElement(m.Z,{className:"customInput",error:!!w.newEmail,fullWidth:!0,inputRef:k({required:h.formatMessage({id:"security.email.error.empty"}),pattern:{value:p.HN,message:h.formatMessage({id:"security.email.error.invalid"})}}),name:"newEmail",onBlur:function(){return x(!1)},onPaste:function(e){return e.preventDefault()},type:"email",variant:"outlined"}),w.newEmail&&n.createElement("span",{className:"errorText"},w.newEmail.message)),n.createElement(i.Z,{alignItems:"start",className:"inputBox",display:"flex",flexDirection:"column",justifyContent:"start"},n.createElement("label",{className:"customLabel"},n.createElement(g.Z,{id:"security.confirmnewemail"})),n.createElement(m.Z,{className:"customInput",error:!!w.newEmail,fullWidth:!0,inputRef:k({required:h.formatMessage({id:"security.email.error.empty"}),pattern:{value:p.HN,message:h.formatMessage({id:"security.email.error.invalid"})}}),name:"confirmNewEmail",onBlur:function(){return x(!1)},onPaste:function(e){return e.preventDefault()},type:"email",variant:"outlined"}),w.confirmNewEmail&&n.createElement("span",{className:"errorText"},w.confirmNewEmail.message),N&&n.createElement("span",{className:"errorText"},n.createElement(g.Z,{id:"security.email.match.error"}))),n.createElement(i.Z,{className:"inputBox"},n.createElement(s.Z,{className:"full submitButton",loading:r,onClick:function(){b(I)},type:"submit"},n.createElement(g.Z,{id:"action.changeemail"})))))},Z=a(81282),N=function(e){var t=e.token,a=(0,l.Z)();return n.createElement(n.Fragment,null,n.createElement(r.q,null,n.createElement("title",null,a.formatMessage({id:"changeemail.title"})+" | "+a.formatMessage({id:"product"}))),n.createElement(Z.Z,{code:t,form:y}))}}}]);
  //# sourceMappingURL=component---src-pages-change-email-index-js-851cca9b2e1144c487bf.js.map