1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[440],{2838:function(e,l){l.Z={src:"/_next/static/media/revision1.ac1d9973.png",height:69,width:69,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAQAAABuBnYAAAAAfklEQVR42h3LsQrCMBRA0fc7ye92URQHsSCITiqCLsnk4qSDFltjskcc85bb0u1y4ArSmOCiRg2+sYi8bMgNJ868GcpI6yP7UlFxKYnWyUe/bJkx5UCiU+k0cRtgwZ04ggs8Ss2GZwl0Xv7G5QnzcbrmnxVkadd+pbXu3NEgPUXPZT8+L5OlAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8}},1440:function(e,l,s){s.r(l),s.d(l,{default:function(){return L}});var t=s(5893),a=s(6100),r=s(6303),n=s(8045),o=s(5),i=s(3344),d=s(9919),c=s(2063),u=s(7294),x=e=>{let[l,s]=(0,u.useState)(!1),{user:t}=(0,d.CG)(e=>e.auth),{onChange:a,formData:{password:r,confirPassword:n,newPassword:x}}=(0,o.Z)({password:"",confirPassword:"",newPassword:""});return{loading:l,handleSubmit:async l=>{if(null==l||l.preventDefault(),console.log(n,x),!(null==t?void 0:t.email))return(0,c.kw)(e("error_in_user_email"));if(n!==x)return(0,c.kw)(e("passwords_do_not_match"));if(r==n||r===x)return(0,c.kw)(e("error_passwords_must_not_be_he_same"));s(!0);try{let l=await i.ZP.passwordRecovery(t.email);console.log(l);let s=await i.ZP.resetPasswordPerfil(l.codigo,x,l.id,r);console.log(s),(0,c.ah)(e("password_changed"))}catch(e){(0,c.kw)("Error - ".concat(null==e?void 0:e.response.data))}finally{s(!1)}},onChange:a,password:r,confirPassword:n,newPassword:x}};let m="xs:text-[#6B6B6B] text-sm leading-[18px] xs:pl-2 font-bold",p="xs:text-[#6B6B6B] xs:bg-[#FAFAFA] rounded-[10px] text-sm leading-[18px] xs:px-3 xs:py-3 border border-[#EBF0ED]";var h=()=>{let{t:e}=(0,n.$G)("common"),{loading:l,handleSubmit:s,onChange:o,password:i,confirPassword:d,newPassword:c}=x(e);return(0,t.jsxs)("div",{className:"my-5",children:[(0,t.jsx)("h3",{className:"text-lg md:text-2xl text-[#18120F] py-2 font-bold my-1 mt-3",children:e("update_password")}),(0,t.jsx)("div",{className:"rounded-[18px] md:px-3",children:(0,t.jsx)("form",{onSubmit:s,className:"formEdit h-auto flex flex-col items-center justify-center bg-white w-full rounded-[18px] border-[#EBF0ED] border ",children:(0,t.jsxs)("div",{className:" grid grid-cols-1 md:grid-cols-2 w-full md:gap-x-[1vw] gap-y-5 sm:gap-y-2 p-4 items-start",children:[(0,t.jsx)("div",{className:" flex items-start ",children:(0,t.jsx)(r.Z,{className:"w-full relative",name:"password",placeholder:e("current_password"),label:e("current_password"),required:!0,type:"password",value:i,onChange:o,labelClass:m,inputClass:p,showEye:!0,heightIcon:"mt-[38px]"})}),(0,t.jsx)("div",{className:"",children:(0,t.jsx)(r.Z,{className:"w-full relative",label:e("new_password"),placeholder:e("new_password"),required:!0,name:"confirPassword",type:"password",inputClass:p,labelClass:m,value:d,onChange:o,showEye:!0,heightIcon:"mt-[24px]"})}),(0,t.jsx)("div",{className:"",children:(0,t.jsx)(r.Z,{className:"w-full relative ",heightIcon:"mt-[24px]",placeholder:e("repeat_new_password"),label:e("repeat_new_password"),required:!0,showEye:!0,name:"newPassword",inputClass:p,labelClass:m,value:c,onChange:o,type:"password"})}),(0,t.jsx)("div",{className:"flex justify-end self-end mt-6 ",children:(0,t.jsx)(a.Z,{type:"submit",className:"w-full sm:w-auto ",pill:!0,loading:l,children:e("update_password")})})]})})})]})},f=s(7556),b=s(1179),g=s(2838),v=s(691),w=s(6650),j=s(7955),y=s(9473),N=s(4362),C=s(4832),E=s(5159),k=s(6183),_=()=>{let{user:e}=(0,d.CG)(e=>e.auth),{corporate:l}=(0,d.CG)(e=>e.corporate),{handleLogout:s}=(0,E.Z)({}),[t,a]=(0,u.useState)(!1),[r,n]=(0,u.useState)(null),[i,x]=(0,u.useState)(!1),[m,p]=(0,u.useState)(0),h=(0,y.I0)(),{onChange:f,formData:b}=(0,o.Z)({nombre:null==e?void 0:e.nombre,apellidos:null==e?void 0:e.apellidos,codigoPostal:null==e?void 0:e.codigoPostal,ciudad:null==e?void 0:e.ciudad,rfc:null==e?void 0:e.rfc,telefono:null==e?void 0:e.telefono,curp:null==e?void 0:e.curp});console.log(e);let g=async l=>{if(l.preventDefault(),a(!0),!(null==e?void 0:e.id))return null;try{let l=Object.fromEntries(Object.entries(b).filter(e=>{let[l,s]=e;return void 0!==s}));h((0,N.av)({...e,nombre:l.nombre,apellidos:l.apellidos})),await (0,k.eN)(null==e?void 0:e.id,l),(0,c.ah)("Usuario actualizado")}catch(e){(0,C.e$)(e)}finally{a(!1)}},v=e=>{if(e)return!(e.size>2097152)||((0,c.kw)("El archivo debe ser menor a 2MB."),n(null),!1)};return{loading:t,handleImageChange:e=>{let l=e.target.files[0];l&&(n(l),v(l))},handleUpload:async()=>
1{if(!r||!(null==e?void 0:e.id))return;let s=(0,w.iH)(j.tO,"Usuarios/".concat(e.id,"/Perfil/").concat(l.id)),t=(0,w.B0)(s,r);t.on("state_changed",e=>{p(e.bytesTransferred/e.totalBytes*100),x(!0)},e=>{console.error("Error uploading image: ",e),x(!1)},async()=>{let s=await (0,w.Jt)(t.snapshot.ref);try{let t={fotoPerfil:{[l.id]:{idMedia:s}}};h((0,N.av)({...e,fotoPerfil:t.fotoPerfil})),await (0,k.eN)(null==e?void 0:e.id,t),x(!1),alert("Imagen subida y URL guardada en Firestore")}catch(e){console.error("Error saving URL to Firestore: ",e),x(!1)}})},uploading:i,progress:m,onChange:f,formData:b,handleSummit:g,desactivarUser:async()=>{if(a(!0),!(null==e?void 0:e.id))return null;try{h((0,N.av)({...e,esUsuarioMarketplace:!1})),await (0,k.eN)(null==e?void 0:e.id,{roles:{}}),(0,c.ah)("Usuario Eliminado"),s()}catch(e){(0,C.e$)(e)}finally{a(!1)}}}},F=e=>{let{onClose:l}=e,{handleImageChange:s,handleUpload:r,loading:o}=_(),{t:i}=(0,n.$G)("common"),d=async()=>{await r(),l()};return(0,t.jsxs)(v.Z,{onClose:l,classBody:"",modalClass:"lg:w-[50%]",children:[(0,t.jsxs)("div",{className:"relative flex-col border-dotted h-48 rounded-lg border-2 border-blue-700 bg-gray-100 flex justify-center items-center",children:[(0,t.jsx)("div",{className:"absolute",children:(0,t.jsx)("div",{className:"flex flex-col items-center",children:o?(0,t.jsx)("div",{className:"loader"}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("i",{className:"fa fa-folder-open fa-4x text-blue-700"}),(0,t.jsx)("span",{className:"block text-gray-400 font-normal cursor-pointer",children:(0,t.jsx)("p",{children:i("drag_your_file_or_click")})})]})})}),(0,t.jsx)("div",{className:"",children:(0,t.jsx)("input",{disabled:o,type:"file",className:"h-full w-full opacity-0 ",onChange:s})})]}),(0,t.jsx)("div",{className:"my-5 mx-auto w-full flex justify-center",children:(0,t.jsx)(a.Z,{onClick:d,className:"mx-auto",children:"Subir imagen"})})]})},A=()=>{var e;let{showModal:l,isModalVisible:s,closeModal:a}=(0,b.Z)(),{t:r}=(0,n.$G)("common"),{user:o}=(0,d.CG)(e=>e.auth),i=(null==o?void 0:o.fotoPerfil)&&(null==o?void 0:null===(e=o.fotoPerfil[f.q])||void 0===e?void 0:e.idMedia)||"";return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h3",{className:"text-lg md:text-2xl text-[#18120F] pt-0 pb-2 sm:py-2 font-bold my-1",children:r("data")}),(0,t.jsxs)("div",{className:"rounded-2xl p-4 border border-[#76848C26]",children:[(0,t.jsxs)("div",{className:"flex py-3 items-center relative",children:[(0,t.jsx)("img",{src:i||g.Z.src,className:"h-auto rounded-full",width:80,alt:"Foto"}),(0,t.jsx)("div",{className:"absolute left-14 bottom-2",children:(0,t.jsx)("img",{src:"/_next/static/media/Editfoto.d6961f22.svg",className:"h-auto cursor-pointer",onClick:l,width:30,alt:"Foto"})}),(0,t.jsxs)("div",{className:"pl-4",children:[(0,t.jsxs)("h2",{className:"text-lg sm:text-xl text-[#18120F] font-medium",children:[null==o?void 0:o.nombre," ",null==o?void 0:o.apellidos]}),(0,t.jsx)("p",{className:"text-sm text-[#76848C]",children:"Usuario principal"})]})]}),(0,t.jsx)("div",{children:(0,t.jsxs)("div",{className:"contenido font-medium",children:[(0,t.jsxs)("p",{className:"flex justify-between text-sm font-bold text-[#76848C] px-2 py-4 border-b border-[#EBF0ED]",children:[r("full_name"),":",(0,t.jsxs)("span",{className:"text-[#18120F] text-sm",children:[null==o?void 0:o.nombre," ",null==o?void 0:o.apellidos]})]}),(0,t.jsxs)("p",{className:"flex justify-between text-sm font-bold text-[#76848C] px-2 py-4 border-b border-[#EBF0ED]",children:[r("phone"),": ",(0,t.jsxs)("span",{className:"text-[#18120F] text-sm",children:[" ",null==o?void 0:o.telefono]})]}),(0,t.jsxs)("p",{className:"flex justify-between text-sm font-bold text-[#76848C] px-2 py-4 border-b border-[#EBF0ED]",children:["E-mail: ",(0,t.jsxs)("span",{className:"text-[#18120F] text-sm",children:[" ",null==o?void 0:o.email]})]}),(0,t.jsxs)("p",{className:"flex justify-between text-sm font-bold text-[#76848C] px-2 py-4 border-b border-[#EBF0ED]",children:[r("location"),":",(0,t.jsxs)("span",{className:"text-[#18120F] text-sm",children:[" ",null==o?void 0:o.ciudad]})]})]})}),s&&(0,t.jsx)(F,{onClose:a})]})]})};let Z="xs:text-[#6B6B6B] text-sm leading-[18px] xs:pl-2 font-bold",B="xs:text-[#6B6B6B] xs:bg-[#FAFAFA] rounded-[10px] text-sm leading-[18px] xs:px-3 xs:py-3 border border-[#
1EBF0ED]";var P=()=>{let{t:e}=(0,n.$G)("common"),{user:l}=(0,d.CG)(e=>e.auth),{onChange:s,formData:o,handleSummit:i,loading:c}=_(),{nombre:u,apellidos:x,codigoPostal:m,ciudad:p,rfc:h,telefono:f,curp:b}=o;return console.log(o),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("h3",{className:"text-lg md:text-2xl text-[#18120F] py-2 font-bold my-1 sm:mt-0 mt-3",children:e("edit_information")}),(0,t.jsx)("div",{className:"rounded-[18px] md:px-3",children:(0,t.jsxs)("form",{onSubmit:i,className:"formEdit h-auto flex flex-col items-center justify-center bg-white mt-2 w-full rounded-[18px] border-[#EBF0ED] border",children:[(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-x-4 w-full md:gap-x-6 p-6 gap-y-2",children:[(0,t.jsx)(r.Z,{inputClass:B,required:!0,type:"text",label:e("name")+"(s)",name:"nombre",value:u,onChange:s,labelClass:Z}),(0,t.jsx)(r.Z,{inputClass:B,required:!0,type:"text",placeholder:"",label:e("surname"),name:"apellidos",value:x,onChange:s,labelClass:Z}),(0,t.jsx)(r.Z,{inputClass:B,type:"text",placeholder:"",label:e("phone"),name:"telefono",value:f,onChange:s,labelClass:Z}),(0,t.jsx)(r.Z,{label:"E-mail",value:null==l?void 0:l.email,required:!0,disabled:!0,inputClass:B,labelClass:Z}),(0,t.jsx)(r.Z,{inputClass:B,type:"text",placeholder:"",label:"RFC",name:"rfc",value:h,onChange:s,labelClass:Z}),(0,t.jsx)(r.Z,{inputClass:B,type:"text",placeholder:"",label:"CURP",value:b,onChange:s,name:"curp",labelClass:Z}),(0,t.jsx)(r.Z,{inputClass:B,type:"text",placeholder:"",label:e("city"),name:"ciudad",onChange:s,value:p,labelClass:Z}),(0,t.jsx)(r.Z,{inputClass:B,type:"text",placeholder:"",label:e("postal_code"),value:m,onChange:s,name:"codigoPostal",labelClass:Z})]}),(0,t.jsx)("div",{className:"flex w-full justify-end pb-4 px-4",children:(0,t.jsx)(a.Z,{type:"submit",className:"w-full sm:w-auto ",pill:!0,loading:c,children:e("update_information")})})]})})]})},L=()=>(0,t.jsxs)("div",{className:"flex md:flex-row flex-col gap-2 sm:gap-4 mx-auto w-[90%] lg:w-[90%] max-w-[1400px] mb-8 sm:mb-16 mt-4",children:[(0,t.jsx)("div",{className:"w-full sm:w-1/3",children:(0,t.jsx)(A,{})}),(0,t.jsxs)("div",{className:"w-full sm:w-2/3",children:[(0,t.jsx)(P,{}),(0,t.jsx)(h,{})]})]})},3403:function(e,l,s){var t=s(5893);l.Z=()=>(0,t.jsxs)("svg",{width:"21",height:"20",viewBox:"0 0 21 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("path",{d:"M10.0837 17.4998C14.4559 17.4998 18.0003 13.9554 18.0003 9.58317C18.0003 5.21092 14.4559 1.6665 10.0837 1.6665C5.7114 1.6665 2.16699 5.21092 2.16699 9.58317C2.16699 13.9554 5.7114 17.4998 10.0837 17.4998Z",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,t.jsx)("path",{d:"M18.8337 18.3332L17.167 16.6665",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})},6303:function(e,l,s){s.d(l,{Z:function(){return x}});var t=s(5893),a=s(5152),r=s.n(a),n=s(7294),o=e=>{let{maxValue:l,minValue:s,onChange:t,type:a,name:r}=e,n=e=>({target:{value:e,name:r}});return{handleChange:e=>{if("number"!==a||void 0===s&&void 0===l)return t&&t(e);let r=Number(e.target.value);if(r<=Number(s))return t&&t(n(s));if(r>=Number(l))return t&&t(n(l));let o=n("0"===e.target.value.toString().split("")[0]?e.target.value.slice(1,e.target.value.length):e.target.value);t&&t(o)},getFormEventData:n}},i={src:"/_next/static/media/password_eye.c8c8ea69.svg"},d={src:"/_next/static/media/eyePassword.7a44be6d.svg"},c=s(3403);let u=r()(()=>s.e(450).then(s.bind(s,450)),{loadableGenerated:{webpack:()=>[450]}});var x=n.forwardRef((e,l)=>{let{label:s,name:a,className:r,onChange:x,type:m,inputClass:p,validate:h=!1,disabled:f=!1,minValue:b,maxValue:g,value:v,labelClass:w,placeholder:j,showEye:y,heightIcon:N="mt-[1px]",...C}=e,[E,k]=(0,n.useState)(!1),{handleChange:_}=o(e);return(0,t.jsxs)("div",{className:r||"relative ",children:[s&&(0,t.jsx)(u,{className:"".concat(p&&" my-4"," ").concat(w),htmlFor:a,children:s}),(0,t.jsx)("input",{...C,name:a,ref:l,value:v,onChange:_,disabled:f,placeholder:j,className:" ".concat("search"!=m?"placeholder:text-sm bg-transparent text-sm":""," ").concat(p||"border-[#DFDFDF] px-2 py-3"," \n border rounded w-full px-2 py-3"),type:E?"text":m}),"search"==m&&(0,t.jsx)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2",children:(0,t.jsx)(c.Z,{})}),"password"==m&&y&&(0,t.jsx)("button",{type:"button",onClick:()=>k(!E),className:"".concat(N," absolute inset-y-0 right-3 items-center text-gray-500 hover:text-gray-700"),children:(0,t.jsx)("img",{src:E?i.src:d.src,className:"h-[20px] w-auto"})})]})})}
1,691:function(e,l,s){s.d(l,{Z:function(){return i}});var t=s(5893),a=s(7294),r=s(3935),n=e=>{let[l,s]=(0,a.useState)(!1),t=l=>{let{key:t}=l;t===e&&s(!0)},r=l=>{let{key:t}=l;t===e&&s(!1)};return(0,a.useEffect)(()=>(window.addEventListener("keydown",t),window.addEventListener("keyup",r),()=>{window.removeEventListener("keydown",t),window.removeEventListener("keyup",r)}),[]),l};let o={lg:"w-screen",md:"w-6-12",sm:"w-6-12",xl:""};var i=e=>{let{title:l,onClose:s,children:i,height:c="responsive",size:u="lg",estilo:x="pt-1 lg:px-3 xs:px-2",background:m="#fff",titleClass:p="xs:text-lg lg:text-2xl font-semibold capitalize",modalClass:h,backgroundClose:f,mxheight:b="80vh",backgroundOpacity:g="bg-opacity-40 ",classBody:v="",cotizacion:w}=e,j=document.querySelector("#modal"),y=n("Escape");return(0,a.useEffect)(()=>{y&&s&&s()},[y]),(0,r.createPortal)((0,t.jsx)("div",{className:"justify-center items-center flex overflow-x-hidden overflow-y-auto fixed inset-0 outline-none focus:outline-none bg-black ".concat(g," z-[1000]"),children:(0,t.jsx)("div",{className:"".concat(h," relative xs:w-[90%] ").concat({xl:" "}[u]||"lg:w-3/5"," my-6 rounded-xl overflow-hidden"),children:(0,t.jsxs)("div",{className:" ".concat(o[u]," border-0 shadow-lg relative flex flex-col outline-none focus:outline-none h-full sm:h-[").concat(c,"]"),style:{maxWidth:"100%",maxHeight:b,background:m},children:[(0,t.jsxs)("div",{className:"flex justify-between pt-5 ".concat(x," items-center"),children:[(0,t.jsx)("h3",{className:"xs:text-lg lg:text-2xl font-semibold capitalize ".concat(p),children:l}),(0,t.jsx)("div",{className:"flex",children:s&&(0,t.jsx)(d,{onClose:s,backgroundClose:f})})]}),(0,t.jsx)("div",{className:" relative overflow-y-auto h-full ".concat(v),children:i})]})})}),j)};let d=e=>{let{onClose:l,backgroundClose:s}=e;return(0,t.jsx)("button",{type:"button",onClick:l,style:{background:s},className:"".concat(!s&&"rounded-lg text-gray-400"," bg-transparent hover:bg-orange-200 hover:text-gray-900 text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-orange-400 dark:hover:text-white"),"data-modal-toggle":"small-modal",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{fillRule:"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",clipRule:"evenodd"})})})}}}]);
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.