1"use strict";(self.webpackChunkprestamo_365_client=self.webpackChunkprestamo_365_client||[]).push([[805],{13765(e,r,n){n.d(r,{U:()=>y});var t=n(89379),a=n(10467),i=n(65043),o=n(54268),l=n(483),s=n(74600),u=n(11906),d=n(18674),m=n(42676),c=n(73216),v=n(40901),f=n(35746),h=n(97),p=n(26148),g=n(28779),_=n(30201),x=n(11948),b=n(70579),y=e=>{var r,n,{data:y}=e,[A,D]=(0,i.useState)(""),[C,E]=(0,i.useState)(),[F,j]=(0,i.useState)(!1),I=(0,c.Zp)(),S=(0,p.j)(),{userInfo:k}=(0,p.G)(g.mB);(0,i.useEffect)(()=>{try{var e,r=JSON.parse((0,d.$E)(m.gD));if(E(r),r.value)D(r.value);else D(null!==(e=null===k||void 0===k?void 0:k.phone_number)&&void 0!==e?e:"")}catch(t){var n;D(null!==(n=null===k||void 0===k?void 0:k.phone_number)&&void 0!==n?n:"")}},[]);var N=(0,d.V7)(null===(r=y.duplicate)||void 0===r||null===(n=r.origin_info)||void 0===n?void 0:n.last_phone_digits),w=function(){var e=(0,a.A)(function*(){var e,r;j(!0),(0,d.ni)(m.gD,JSON.stringify((0,t.A)((0,t.A)({},C),{},{valuemx:null===(e=y.duplicate)||void 0===e||null===(r=e.origin_info)||void 0===r?void 0:r.last_phone_digits})));var n=(0,d.V7)(A),a=()=>{j(!1),I(v.f.Login,{replace:!0})};try{var i=yield(0,f.r)("sms");(0,_.$k)(n,i),(0,x.MR)("sms"),S((0,g.Ve)({user:{otp_sender_channel:"sms"}})),a()}catch(o){if((0,_.nM)(o,n,"sms"))return(0,x.AV)(A,"sms"),S((0,g.Ve)({user:{otp_sender_channel:"sms"}})),void a();j(!1)}});return function(){return e.apply(this,arguments)}}(),M=function(){var e=(0,a.A)(function*(){j(!0);try{var{data:e}=yield(0,f.fj)();j(!1),(0,d.fl)(m.gD),I((0,h.b)(e.step_name))}catch(r){j(!1)}});return function(){return e.apply(this,arguments)}}();return(0,b.jsx)(o.I,{open:!!y,title:(0,b.jsxs)("span",{children:["\xbfTienes acceso al ",(0,b.jsxs)("span",{style:{whiteSpace:"nowrap"},children:[N,"?"]})]}),subtitle:"El usuario con este DNI fue previamente registrado y no podemos crear dos cuentas con el mismo DNI y diferentes n\xfameros celulares. Qu\xe9 n\xfamero prefiere usar para esta cuenta?",maxWidth:"md",buttonsChildren:(0,b.jsxs)(s.A,{sx:{width:"100%",gap:"10px"},children:[(0,b.jsx)(l.q,{loading:F,form:"change-dni-form",type:"submit",label:"Entrar con ".concat(N),size:"medium",onClick:w}),(0,b.jsxs)(u.A,{loading:F,type:"submit",size:"medium",variant:"text",onClick:M,children:["Seguir con ",(0,d.V7)(A)]})]})})}},62029(e,r,n){n.r(r),n.d(r,{default:()=>ue});var t=n(89379),a=n(20454),i=n(10467),o=n(65043),l=n(73216),s=n(24858),u=n(74600),d=n(85865),m=n(81e3),c=n(8738),v=n(18403),f=n(60446),h=n.n(f),p=n(35746),g=n(40901),_=n(18674),x=n(21541),b=n(83275),y=n(29355),A=n(42676),D=n(6024),C=n(80899),E=n(36e3),F=e=>{var r,n,t,a,i,l=null===e||void 0===e?void 0:e.registration_type;return{schema:(0,o.useMemo)(()=>{var r=(r,n,t)=>{((e,r,n,t,a)=>{var i;(0,_.sb)({event:"error_data",label:"sign_up",registration:e,stage:"personal_data",field_name:n,field_value:(i=a,null==i?"":String(i)),error_text:t,UID:r})})(l,null===e||void 0===e?void 0:e.user_uuid,r,n,t)};return C.Ik({dni_number:C.Yj().trim().required(e=>{var{value:n}=e;return r("dni_number","error_frontend: DNI number field is required",n),x.errors.requiredField}).test("is-length-9-or-8",x.errors.DNIInvalid,e=>{if(!e)return!1;var n=e.replace(/-/,"");return 8===n.length||9===n.length||(r("dni_number","error_frontend: DNI should have 9 or 8 digits",e),!1)}),father_surname:C.Yj().trim().required(e=>{var{value:n}=e;return r("father_surname","error_frontend: Father surname field is required",n),x.errors.requiredField}).transform(e=>null===e||void 0===e?void 0:e.replace(/\s+/g," ")).matches(/^[A-Za-z\xC1\xC9\xCD\xD1\xD3\xDA\xDC\xE1\xE9\xED\xF1\xF3\xFA\xFC\u017F\u212A]+(( |-|\. ?)[A-Za-z\xC1\xC9\xCD\xD1\xD3\xDA\xDC\xE1\xE9\xED\xF1\xF3\xFA\xFC\u017F\u212A]+)*$/gim,e=>{var{value:n}=e;return!n||(r("father_surname","error_frontend: Invalid father surname",n),x.errors.invalidSurname)}).max(50,e=>{var{value:n}=e;return!n||(r("father_surname","error_frontend: This field must have no more than 50 characters",n),x.errors.nameLength)}),mother_surname:C.Yj().trim().transform(e=>null===e||void 0===e?void 0:e.replace(/\s+/g," ")).required(e=>{var{value:n}=e;return r("mother_surname","error_frontend: Mother surname field is required",n),x.errors.requiredField}).matches(/^[A-Za-z\xC1\xC9\xCD\xD1\xD3\xDA\xDC\xE1\xE9\xED\xF1\xF3\xFA\xFC\u017F\u212A]+(( |-|\. ?)[A-Za-z\xC1\xC9\xCD\xD1\xD3\xDA\xDC\xE1\xE9\xED\xF1\xF3\xFA\xFC\u017F\u212A]+)*$/gim,e=>{var{value:n}=e;return!n||(r("mother_surname","error_frontend: Invalid mother surname",n),x.errors.invalidSurname)}
1).max(50,e=>{var{value:n}=e;return!n||(r("mother_surname","error_frontend: This field must have at least one and no more than 50 characters",n),x.errors.nameLength)}),first_name:C.Yj().trim().transform(e=>null===e||void 0===e?void 0:e.replace(/\s+/g," ")).required(e=>{var{value:n}=e;return r("first_name","error_frontend: First name field is required",n),x.errors.requiredField}).matches(/^[A-Za-z\xC1\xC9\xCD\xD1\xD3\xDA\xDC\xE1\xE9\xED\xF1\xF3\xFA\xFC\u017F\u212A]+(( |-|\. ?)[A-Za-z\xC1\xC9\xCD\xD1\xD3\xDA\xDC\xE1\xE9\xED\xF1\xF3\xFA\xFC\u017F\u212A]+)*$/gim,e=>{var{value:n}=e;return!n||(r("first_name","error_frontend: Invalid first name",n),x.errors.invalidMiddleNames)}).max(50,e=>{var{value:n}=e;return!n||(r("first_name","error_frontend: This field must have at least one and no more than 50 characters",n),x.errors.invalidLength)}),birthday:C.Yj().required(e=>{var{value:n}=e;return r("birthday","error_frontend: Birthday field is required",n),x.errors.requiredField}).test("birthday-default",e=>{var{value:n}=e;return r("birthday","error_frontend: Birthday field is required",n),x.errors.requiredField},e=>"//"!==e).test("birthday",e=>{var{value:n}=e;return r("birthday","error_frontend: Birthday field is incorect",n),x.errors.incorrectDate},e=>!e||"//"===e||(0,E.Ay)(e,"DD/MM/YYYY",!0).isValid()).test("birthday",e=>{var{value:n}=e;return r("birthday","error_frontend: Birthday field is before",n),x.errors.incorrectDate},e=>"//"===e||!/^\d{2}\/\d{2}\/\d{4}$/.test(e)||(0,E.Ay)(e,"DD/MM/YYYY").isBefore((0,E.Ay)())).test("birthday-max-age",e=>{var{value:n}=e;return r("birthday","error_frontend: Birthday is more than 100 years ago",n),x.errors.incorrectDate},e=>"//"===e||!/^\d{2}\/\d{2}\/\d{4}$/.test(e)||(0,E.Ay)(e,"DD/MM/YYYY").isAfter((0,E.Ay)().subtract(100,"year")))})},[null===e||void 0===e?void 0:e.user_uuid,l]),defaultValue:{dni_number:null!==(r=(0,_.$E)("dni_number")||(null===e||void 0===e?void 0:e.dni_number))&&void 0!==r?r:"",father_surname:null!==(n=(0,_.$E)("father_surname")||(null===e||void 0===e?void 0:e.father_surname))&&void 0!==n?n:"",mother_surname:null!==(t=(0,_.$E)("mother_surname")||(null===e||void 0===e?void 0:e.mother_surname))&&void 0!==t?t:"",first_name:null!==(a=(0,_.$E)("first_name")||(null===e||void 0===e?void 0:e.first_name))&&void 0!==a?a:"",birthday:null!==(i=(0,_.$E)("birthday")||(null===e||void 0===e?void 0:e.birthday))&&void 0!==i?i:""}}},j=n(62678),I=n(92823),S=n(97),k=n(51292),N=n(81673),w=n(67784),M=n(84511),B=n(51640),V=(0,B.A)(w.A)(()=>({"& .MuiInputBase-root":{height:"auto !important",borderRadius:0,border:"none"},"& .MuiFilledInput-input":{padding:"0 !important",textAlign:"left",borderRadius:0}})),Y=(0,B.A)(m.A)(()=>({position:"relative",width:"100%",border:"1px solid #D4D8E3",fontSize:"14px",fontWeight:"400",height:"60px",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"center",borderRadius:"10px","&:hover":{borderColor:"#939DB8"}})),q=((0,B.A)(M.A)(()=>({width:"100%","&.MuiToggleButton-root":{backgroundColor:"#fff",border:"1px solid #D4D8E3","&:hover":{color:"#6948EB",borderColor:"#6948EB",backgroundColor:"#fff"},"&.Mui-selected":{color:"#6948EB",borderColor:"#6948EB",backgroundColor:"#fff","&:hover":{color:"#6948EB",borderColor:"#6948EB",backgroundColor:"#fff"}}}})),n(26240)),P=n(30203),R=(e,r)=>
1e?e.includes("11")?"1.5ch":e.includes("1")?"1.8ch":"calc(2ch + 3px)":r,T=function(e){var r,n,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];(null===(r=e.current)||void 0===r||r.focus(),t)&&(null===(n=e.current)||void 0===n||n.select())},L=e=>{var r,n,t=null!==(r=null===(n=e.current)||void 0===n?void 0:n.value.length)&&void 0!==r?r:0;T(e),requestAnimationFrame(()=>{var r;null===(r=e.current)||void 0===r||r.setSelectionRange(t,t)})},$=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:26,n="string"===typeof e?parseInt(e,10):e;return isNaN(n)||n<0||n>99?"string"===typeof e?e:String(e):String(n<=r?2e3+n:1900+n)},O=e=>{var r="string"===typeof e?parseInt(e,10):e;return isNaN(r)||r<0||r>99?"string"===typeof e?e:String(e):String(2e3+r)},W=n(70579),z=o.forwardRef(function(e,r){var n=(0,q.A)(),a=(0,P.A)(n.breakpoints.up("sm")),[i,l]=(0,o.useState)({day:"",month:"",year:""});(0,o.useEffect)(()=>{if(e.value){var r=e.value.split("/"),n=r[2]||"";l({day:r[0],month:r[1],year:n}),m.current=n.length}},[]),(0,o.useEffect)(()=>{i.day&&(e.onInputChange(i),(0,_.ni)(e.name,"".concat(i.day,"/").concat(i.month,"/").concat(i.year)))},[i]);var s=(0,o.useRef)(null),u=(0,o.useRef)(null),d=(0,o.useRef)(null),m=(0,o.useRef)(0);(0,o.useImperativeHandle)(r,()=>({focusField:()=>{""===i.day?T(s,!0):""===i.month?T(u,!0):T(d,!0)}}));var c=(r,n)=>{var a=r.target.value;if(!isNaN(Number(a))){if("day"===n)(+a>31||2===a.length)&&(a=+a>=32?"31":a,T(u));else if("month"===n)(+a>12||2===a.length)&&(a=+a>=13?"12":a,T(d));else if("year"===n){var i=a.length,o=m.current,s="birthday"===e.name,c="dni_expire_at"===e.name;2===i&&i>o&&!isNaN(Number(a))?s?"19"!==a&&"20"!==a?(a=$(a),m.current=a.length):m.current=i:c&&"20"!==a?(a=O(a),m.current=a.length):m.current=i:m.current=i}l(e=>(0,t.A)((0,t.A)({},e),{},{[n]:a}))}},v=(r,n)=>{var a=r.target.value;if("day"===n||"month"===n)""===a?l(e=>(0,t.A)((0,t.A)({},e),{},{[n]:a})):2!==a.length&&l(e=>(0,t.A)((0,t.A)({},e),{},{[n]:"0"+a}));else if("year"===n){var i="birthday"===e.name,o="dni_expire_at"===e.name;""===a?(l(e=>(0,t.A)((0,t.A)({},e),{},{[n]:a})),m.current=0):2===a.length?(i?a=$(a):o&&(a=O(a)),l(e=>(0,t.A)((0,t.A)({},e),{},{[n]:a})),m.current=a.length):4!==a.length&&a.length>0&&(a="0".repeat(4-a.length)+a.slice(-4),l(e=>(0,t.A)((0,t.A)({},e),{},{[n]:a})),m.current=a.length)}},f=(e,r)=>{var n,t,a=r.key,i=r.target,o=null!==(n=i.selectionStart)&&void 0!==n?n:0,l=null!==(t=i.selectionEnd)&&void 0!==t?t:0,m=0===o&&0===l;if("ArrowLeft"===a||"Backspace"===a){if("month"===e){if(i.value&&!m)return;return r.preventDefault(),void L(s)}if("year"===e){if(i.value&&!m)return;return r.preventDefault(),void L(u)}}if("ArrowRight"===a){if("day"===e){if(i.value&&(0===i.selectionStart||1===i.selectionStart))return;T(u)}if("month"===e){if(i.value&&(0===i.selectionStart||1===i.selectionStart))return;T(d)}}},h=()=>("birthday"===e.name||"dni_expire_at"===e.name)&&""===i.day&&""===i.month&&""===i.year,p=e=>{h()&&(e.preventDefault(),T(s,!0))};return(0,W.jsxs)("div",{style:{display:"flex",alignItems:"center",marginTop:"16px",marginLeft:"16px"},children:[(0,W.jsx)(V,{inputRef:s,type:"text",value:i.day,onChange:e=>{c(e,"day")},placeholder:"DD",variant:"filled",sx:{width:R(i.day,a?"21px":"23px"),"& .MuiInputBase-input":{backgroundColor:e.disabled?"#EEEFF4":"inherit"}},onBlur:e=>{v(e,"day")},inputProps:{pattern:"[0-9]*",maxLength:2,inputMode:"numeric"},onKeyDown:e=>{f("day",e)}}),(0,W.jsx)("span",{children:"/"}),(0,W.jsx)(V,{inputRef:u,type:"text",value:i.month,onChange:e=>{c(e,"month")},placeholder:"MM",variant:"filled",sx:{width:R(i.month,a?"26px":"30px"),"& .MuiInputBase-input":{backgroundColor:e.disabled?"#EEEFF4":"inherit"}},inputProps:{pattern:"[0-9]*",maxLength:2,inputMode:"numeric"},onBlur:e=>{v(e,"month")},onKeyDown:e=>{f("month",e)},onMouseDown:p}),(0,W.jsx)("span",{children:"/"}),(0,W.jsx)(V,{inputRef:d,type:"text",value:i.year,onChange:e=>{c(e,"year")},placeholder:"AAAA",variant:"filled",inputProps:{pattern:"[0-9]*",maxLength:4,inputMode:"numeric"},onBlur:e=>{v(e,"year")},sx:{width:i.year?"calc(4ch + 6px)":a?"40px":"45px","& .MuiFilledInput-input":{textAlign:"left",backgroundColor:e.disabled?"#EEEFF4":"inherit"}},onKeyDown:e=>{f("year",e)},onMouseDown:p})]})});const G=e=>{var{name:r,label:n,value:a,onInputChange:i,error:l,helperText:s,disabled:u,riskSealFieldName:d,riskSealFieldCategory:m}=e,[c,v]=(0,o.useState)(!1),f=(0,o.useRef)(null);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(Y,(0,t.A)((0,t.A)((0,t.A)({sx:{borderColor:l?"#E02727":u?"#EEEFF4":c?"#6948EB":"#D4D8E3",pointerEvents:u?"none":"auto",backgroundColor:u?"#EEEFF4":"inherit"},onClick:e=>{var r;(v(!0),e.target.classList.contains("MuiBox-root"))&&(null===(r=f.current)||void 0===r||r.focusField())},onFocus:()=>{v(!0)},onBlur:()=>
1{v(!1)}},d?{"data-rs-field":d}:{}),m?{"data-rs-field-category":m}:{}),{},{children:[(0,W.jsx)(k.A,{className:"date-custom-label",onClick:e=>{var r;u||(e.preventDefault(),v(!0),null===(r=f.current)||void 0===r||r.focusField())},sx:{cursor:u?"default":"pointer"},children:n}),(0,W.jsx)(z,{name:r,ref:f,value:a,onInputChange:e=>{i("".concat(e.day,"/").concat(e.month,"/").concat(e.year))},disabled:u}),l&&(0,W.jsx)(y.kg,{show:l,styles:{position:"absolute",right:"12px"}})]})),(0,W.jsx)(N.A,{error:!0,sx:{alignSelf:"flex-start",marginTop:"3px !important"},children:s})]})};var U,Z,K=n(26148),H=n(28779),J=n(52045),Q=["title","titleId"];function X(){return X=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var t in n)({}).hasOwnProperty.call(n,t)&&(e[t]=n[t])}return e},X.apply(null,arguments)}function ee(e,r){var{title:n,titleId:t}=e,a=function(e,r){if(null==e)return{};var n,t,a=function(e,r){if(null==e)return{};var n={};for(var t in e)if({}.hasOwnProperty.call(e,t)){if(-1!==r.indexOf(t))continue;n[t]=e[t]}return n}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t<i.length;t++)n=i[t],-1===r.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}(e,Q);return o.createElement("svg",X({width:24,height:24,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:r,"aria-labelledby":t},a),n?o.createElement("title",{id:t},n):null,U||(U=o.createElement("path",{d:"M11.1663 11.3333H11.9997L11.9997 14.8333M18.1663 12C18.1663 15.4058 15.4054 18.1667 11.9997 18.1667C8.59392 18.1667 5.83301 15.4058 5.83301 12C5.83301 8.59425 8.59392 5.83334 11.9997 5.83334C15.4054 5.83334 18.1663 8.59425 18.1663 12Z",stroke:"#525E7E",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),Z||(Z=o.createElement("rect",{x:11.542,y:8.875,width:.916667,height:.916667,rx:.458333,fill:"#525E7E",stroke:"#525E7E",strokeWidth:.25})))}var re=o.forwardRef(ee);n.p;const ne=n.p+"static/media/dni-example.d47c208db837f87fae39.png";var te=n(483),ae=n(54268),ie=n(12604),oe=e=>{var r,n,{open:a,defaultValue:i,onClose:l,onPropagateSubmit:u}=e,[d,m]=(0,o.useState)(!1),{userInfo:c}=(0,K.G)(H.mB),{schema:f}=(e=>{var r,n=null===e||void 0===e?void 0:e.registration_type;return{schema:(0,o.useMemo)(()=>C.Ik({dni_number:C.Yj().trim().required(()=>((0,_.sb)({event:"error_data",label:"sign_up",registration:n,stage:"personal_data",field_name:"dni_number",error_text:"error_frontend: DNI number field is required",UID:null===e||void 0===e?void 0:e.user_uuid}),x.errors.requiredField)).test("is-length-9-or-8",x.errors.DNIInvalid,r=>{if(!r)return!1;var t=r.replace(/-/,"");return 8===t.length||9===t.length||((0,_.sb)({event:"error_data",label:"sign_up",registration:n,stage:"personal_data",field_name:"dni_number",error_text:"error_frontend: DNI should have 9 or 8 digits",UID:null===e||void 0===e?void 0:e.user_uuid}),!1)})}),[null===e||void 0===e?void 0:e.user_uuid]),defaultValue:{dni_number:null!==(r=null===e||void 0===e?void 0:e.dni_number)&&void 0!==r?r:""}}})(null!==c&&void 0!==c?c:null),{register:h,formState:{errors:p},handleSubmit:g,clearErrors:b,getValues:E}=(0,s.mN)({mode:"onSubmit",reValidateMode:"onSubmit",resolver:(0,v.t)(f),criteriaMode:"all",defaultValues:{dni_number:i}});return(0,W.jsx)(ae.I,{open:a,title:"Este DNI ya ha sido registrado",subtitle:"Por favor, revisa el n\xfamero ingresado",maxWidth:"md",onClose:l,bodyChildren:(0,W.jsx)(ie.A,{id:"change-dni-form",component:"form",onSubmit:g(e=>{m(!0),u(e)}),sx:{width:"100%"},"data-rs-form":"edit_front_dni_dialog","data-rs-final-submit":"true",children:(0,W.jsx)(D.w,(0,t.A)((0,t.A)({},h("dni_number",{onChange:()=>{b("dni_number")}})),{}
1,{id:"".concat(_.iG,"_change_dni_number"),defaultValue:i,label:x.registration.DNINumber,type:"text",helperText:null!==(r=null===p||void 0===p||null===(n=p.dni_number)||void 0===n?void 0:n.message)&&void 0!==r?r:x.errors.enter8Digits,fullWidth:!0,placeholder:A.WF,InputProps:{inputComponent:y.lo,autoFocus:!0,inputProps:{isShrinked:!E("dni_number")||!i,"data-rs-field":"dni_number","data-rs-field-category":"sensitive"}},InputLabelProps:{shrink:!!i||!!E("dni_number")}}))}),buttonsChildren:(0,W.jsx)(te.q,{loading:d,form:"change-dni-form",type:"submit",label:x.save,size:"medium","data-rs-final-submit":"true"})})},le=n(13765),se=n(27676);const ue=()=>{var e,r,n,f,C,k,N,w=(0,o.useRef)({}),[M,B]=(0,o.useState)(!1),[V,Y]=(0,o.useState)(!1),[q,P]=(0,o.useState)(!1),[R,T]=(0,o.useState)(null),[L,$]=(0,o.useState)(!1),[O,z]=(0,o.useState)(!1),[U,Z]=(0,o.useState)(null),Q=(0,K.j)(),X=(0,l.Zp)(),{userInfo:ee}=(0,K.G)(H.mB),{schema:ae,defaultValue:ie}=F(null!==ee&&void 0!==ee?ee:null);(0,I.$k)({stepTag:"frontal_dni"}),(0,o.useEffect)(()=>{window.scrollTo(0,0)},[]),(0,o.useEffect)(()=>{w.current=ee,"need_dni_confirmation"===ee.registration_block_reason&&z(!0),"need_select_phone_number"===ee.registration_block_reason&&(z(!1),Z(ee))},[ee]);var{register:ue,formState:{errors:de},handleSubmit:me,setError:ce,control:ve,clearErrors:fe,getValues:he}=(0,s.mN)({mode:"onSubmit",reValidateMode:"onSubmit",resolver:(0,v.t)(ae),criteriaMode:"all"}),pe=function(){var e=(0,i.A)(function*(e){var r,n=Object.assign({},((0,a.A)(e),e)),i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"form";Y(!0);var o="".concat(n.first_name," ").concat(n.father_surname," ").concat(n.mother_surname),l=null!==(r=ee.registration_type)&&void 0!==r?r:(0,_.Km)(),s=10===n.dni_number.length?n.dni_number.replace(/-/,"").slice(0,-1):n.dni_number,u="form"===i?(0,t.A)((0,t.A)({},n),{},{dni_number:s,birthday:h()(n.birthday,"DD/MM/YYYY").format("YYYY-MM-DD")}):(0,t.A)((0,t.A)({},w.current),{},{dni_number:s});try{var d=yield(0,p.OW)({step_name:A.V2.EditFrontDNI,step_data:u});(0,_.sb)({event:"personal_data",label:"sign_up",registration:l,UID:ee.user_uuid}),(0,_.MS)(u),Y(!1),Q((0,H.Ve)({user:(0,t.A)({},d.step_data)}));var m=(0,_.sV)();if((0,_.lx)(m,o),"need_dni_confirmation"===(null===d||void 0===d?void 0:d.registration_block_reason))w.current="form"===i?u:{},z(!0),Q((0,H.Ve)({user:{registration_block_reason:null===d||void 0===d?void 0:d.registration_block_reason}}));else if("need_select_phone_number"===(null===d||void 0===d?void 0:d.registration_block_reason)){var c,v;Q((0,H.Ve)({user:{registration_block_reason:null===d||void 0===d?void 0:d.registration_block_reason,duplicate:{origin_info:{last_phone_digits:null!==(c=null===d||void 0===d||null===(v=d.duplicate)||void 0===v?void 0:v.origin_info.last_phone_digits)&&void 0!==c?c:""}}}})),z(!1),Z(d)}else z(!1),Z(null),Q((0,H.Ve)({user:{registration_block_reason:null}}
1)),X((0,S.b)(d.step_name),{replace:!0})}catch(b){var f,g;Y(!1);var x=null===b||void 0===b||null===(f=b.response)||void 0===f||null===(g=f.data)||void 0===g?void 0:g.errors;(null===x||void 0===x?void 0:x.length)>0?x.forEach(e=>{var r=e.path,n=(0,_.GW)(e.message),t=he(r);(0,_.sb)({event:"error_data",label:"sign_up",stage:"personal_data",field_name:r,field_value:null==t?"":String(t),registration:l,error_text:"error_backend: ".concat(e.message),UID:ee.user_uuid}),ce(r,{type:"custom",message:J.M[n]},{shouldFocus:!0})}):(ce("root.serverError",{type:"custom"}),B(!0))}});return function(r){return e.apply(this,arguments)}}();return(0,b.h)((0,W.jsxs)(y.ff,{children:[(0,W.jsxs)(u.A,{sx:{width:{xs:"100%",sm:"445px"}},gap:c.Fr?2.5:3,children:[(0,W.jsx)(y.f6,{leftSegmentValue:20}),(0,W.jsxs)(u.A,{gap:1.5,children:[(0,W.jsx)(se.l,{children:x.registration.frontalDNI}),(0,W.jsx)(d.A,{variant:"subtitle1",children:" Los datos deben coincidir con el DNI"})]}),(0,W.jsx)(m.A,{component:"form",onSubmit:me(e=>{pe(e,"form")}),sx:{width:"100%"},"data-rs-form":"edit_front_dni_data","data-rs-final-submit":"true",children:(0,W.jsxs)(u.A,{spacing:1.5,alignItems:"center",children:[(0,W.jsx)(D.w,(0,t.A)((0,t.A)({},ue("dni_number",{onBlur:e=>{P(!1),(0,_.ni)("dni_number",e.target.value)},onChange:()=>{fe("dni_number")}})),{},{id:"".concat(_.iG,"_registration_dni_number"),defaultValue:ie.dni_number,label:x.registration.DNINumber,type:"text",error:Boolean(null===de||void 0===de?void 0:de.dni_number),helperText:null!==(e=null===de||void 0===de||null===(r=de.dni_number)||void 0===r?void 0:r.message)&&void 0!==e?e:x.errors.enter8Digits,fullWidth:!0,placeholder:A.WF,onFocus:()=>{P(!0)},InputProps:{inputComponent:j.l,autoFocus:!0,endAdornment:(0,W.jsx)(re,{cursor:"pointer",onClick:e=>{T(e.currentTarget),$(!0)}}),inputProps:{isShrinked:q&&!he("dni_number")&&!ie.dni_number,"data-rs-field":"dni_number","data-rs-field-category":"sensitive"}},InputLabelProps:{shrink:!!ie.dni_number||!!he("dni_number")||q}})),(0,W.jsx)(D.w,(0,t.A)((0,t.A)({},ue("father_surname",{onBlur:e=>{(0,_.ni)("father_surname",e.target.value)},onChange:e=>{e.target.value=(0,_.$I)(e),fe("father_surname")}})),{},{id:"".concat(_.iG,"_registration_father_name"),defaultValue:ie.father_surname,label:x.registration.fatherName,type:"text",error:Boolean(null===de||void 0===de?void 0:de.father_surname),helperText:null===de||void 0===de||null===(n=de.father_surname)||void 0===n?void 0:n.message,fullWidth:!0,inputProps:{"aria-label":x.registration.fatherName,"data-rs-field":"father_surname","data-rs-field-category":"personal"}})),(0,W.jsx)(D.w,(0,t.A)((0,t.A)({},ue("mother_surname",{onBlur:e=>{(0,_.ni)("mother_surname",e.target.value)},onChange:e=>{e.target.value=(0,_.$I)(e),fe("mother_surname")}})),{},{id:"".concat(_.iG,"_registration_mother_name"),defaultValue:ie.mother_surname,label:x.registration.motherName,type:"text",error:Boolean(null===de||void 0===de?void 0:de.mother_surname),helperText:null===de||void 0===de||null===(f=de.mother_surname)||void 0===f?void 0:f.message,fullWidth:!0,inputProps:{"aria-label":x.registration.motherName,"data-rs-field":"mother_surname","data-rs-field-category":"personal"}})),(0,W.jsx)(D.w,(0,t.A)((0,t.A)({},ue("first_name",{onBlur:e=>{(0,_.ni)("first_name",e.target.value)},onChange:e=>{e.target.value=(0,_.$I)(e),fe("first_name")}})),{},{id:"".concat(_.iG,"_registration_first_name"),defaultValue:ie.first_name,label:x.registration.firstName,type:"text",error:Boolean(null===de||void 0===de?void 0:de.first_name),helperText:null===de||void 0===de||null===(C=de.first_name)||void 0===C?void 0:C.message,fullWidth:!0,inputProps:{"aria-label":x.registration.firstName,"data-rs-field":"first_name","data-rs-field-category":"personal"}})),(0,W.jsx)(s.xI,{name:"birthday",control:ve,defaultValue:null!==(k=(0,E.pU)(ie.birthday))&&void 0!==k?k:"",render:e=>{var r,{field:n,fieldState:t}=e;return(0,W.jsx)(G,{name:"birthday",label:x.registration.birthday,value:n.value,onInputChange:e=>{n.onChange(e),fe("birthday")},error:t.invalid,helperText:null===de||void 0===de||null===(r=de.birthday)||void 0===r?void 0:r.message,riskSealFieldName:"birthday",riskSealFieldCategory:"sensitive"})}}),M&&(0,W.jsx)(y.U0,{onAlertClose:()=>{B(!1)}}),(0,W.jsxs)(u.A,{gap:2,sx:{width:"100%",mt:"20px !important"},children:[!!Object.keys(de).length&&(0,W.jsx)(d.A,{variant:"body1",sx:{textAlign:"center"},children:"Por favor, completar los campos para continuar"}),(0,W.jsx)(te.q,{loading:V,type:"submit",disabled:U,"data-rs-final-submit":"true"})]})]})})]}),(0,W.jsx)(y.gD,{anchorEl:R,open:L,onClose:()=>{$(!1)},title:"DNI",children:(0,W.jsx)("img",{src:ne,alt:x.registration.DNINumber,loading:"lazy"})}),O&&(0,W.jsx)(oe,{open:O,defaultValue:null!==(N=he("dni_number"))&&void 0!==N?N:ee.dni_number,onClose:()=>{z(!1)},onPropagateSubmit:e=>{pe(e,"change")}}),U&&(0,W.jsx)(le.U,{data:U})]}),g.f.FrontalDNI)}}}]); 2//# sourceMappingURL=805.1223f88b.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.