if(window.auth={remexAuth:null,env:document.querySelector('meta[name="app-env"]').content,analyticSent:{},defaultProfilePicture:"https://remesita.s3.amazonaws.com/cdn/blank-profile-picture.jpg",inizialized:!1,uiRendererd:!1,usingFirebase:"undefined"!=typeof firebase,authMethod:null,fingerprint:null,authFormCssSelector:"#remex-auth-container",locale:(window.currentLocale??navigator.language??navigator.userLanguage).split("-")[0].toLowerCase(),translate:{es:{},en:{"¿Deseas configurarlo ahora?":"Would you like to configure it now?","Tu sesión de usuario se a cambiado, debes recargar la página":"Your user session has been changed, you must reload the page","¿Te gustaría marcar este navegador como un dispositivo de confianza?":"Would you like to mark this browser as a trusted device?","Digita tu celular":"Type your cell phone","Tu sesión de usuario se ha desconectado":"Your user session has been disconnected", "Tu sesión de usuario se ha desconectado porque hemos actualizado la plataforma y necesitas recargar la página":"Your user session has been disconnected because we have updated the platform and you need to reload the page","Nueva actualización!":"New update!","Hemos actualizado la plataforma y necesitas recargar la página":"We have updated the platform and you need to reload the page","Tu cuenta se encuentra suspendida de forma indefinida":"Your account is suspended indefinitely","Tu cuenta se encuentra deshabilitada":"Your account is disabled","Tu cuenta se encuentra cerrada de forma definitiva":"Your account is closed permanently","ENVIAR CÓDIGO":"SEND CODE","Digita el código recibido":"Type the received code","Prefiero recibir el código via Telegram":"I prefer to receive the code via Telegram","Prefiero recibir el código via Whatsapp":"I prefer to receive the code via Whatsapp",VERIFICAR:"VERIFY",SIGUIENTE:"NEXT","Revisa tu bandeja de entrada o spam":"Check your inbox or spam", "Iniciar sesión con el celular":"Log in with your mobile",ESPERE:"WAITING","Debe escribir un celular válido":"You must write a valid cell phone",REENVIAR:"RESEND","Te enviaremos un código de seguridad para verificar tu identidad":"We will send you a security code to verify your identity","El código es incorrecto o ha caducado":"The code is incorrect or expired","Lo sentimos, has superado el máximo de intentos":"Sorry, you have exceeded the maximum attempts","Espere 30 min para volverlo a intentar":"Wait 30 min to try again","Completa tu registro de usuario":"Complete your user registration","Nombre y Apellidos":"Name and surname","Tal como aparece en tu documento de identidad":"As it appears on your identity document","Correo electrónico":"Email","También te enviaremos un código para verificar tu correo":"We will also send you a code to verify your email","Este correo electrónico ya esta en uso":"This email already in use", "Lo sentimos, ha ocurrido un error inesperado":"Sorry, an unexpected error has occurred","Lo sentimos!":"Sorry!","Inténtalo luego":"try again later","Podrás reenviar el código en __DURATION__":"You will be able to resend the code in __DURATION__","Reenviar código":"Resend code","Teléfono celular":"Celular number","Identifícate con tu teléfono celular":"Sign in with your cell phone",CANCELAR:"CANCEL",DESCONECTAR:"LOGOUT","Email not found in our system":"Email not found in our system","Phone not found in our system":"Phone not found in our system","Sorry we have a problem, please reload web page, and try again":"Sorry we have a problem, please reload web page, and try again",Desconectando:"Disconnecting","Estás conectado como":"You are logged in as","Revisa y completa tu información":"Review and complete your information","Usuario desconocido":"Unknown user","Estas usando tu cuenta de Google":"You are using your Google account", "Estas usando tu cuenta de Facebook":"You are using your Facebook account","Tu cuenta se encuentra suspendida de forma indefinida":"Your account is suspended indefinitely","Tu cuenta se encuentra deshabilitada":"Your account is disabled","Tu cuenta se encuentra cerrada de forma definitiva":"Your account is closed permanently"}},towfactorCount:0,verifyIntent:0,i18n:e=>window.auth.translate[window.auth.locale][e]??e,init:async()=>{const e=async()=>{window.auth.remexAuth=new window.RemexAuthComponentClass({i18n:{es:{"Reset Now":"Reiniciar Ahora","If you have accidentally uninstalled the authenticator app that generates the TOTP codes or you have lost your phone, you can disable the TOTP second-factor layer of security by resetting a new password.":"Si has desinstalado accidentalmente la aplicación de autenticación que genera los códigos TOTP o has perdido tu teléfono, puedes desactivar la capa de seguridad de doble factor TOTP restableciendo una nueva contraseña.", "What can I do if I have lost my TOTP?":"¿Qué puedo hacer si he perdido mi TOTP?","Invalid code":"Código inválido",Accept:"Aceptar",Deny:"Denegar","Disable TOTP layer.":"Desactivar seguridad de doble factor TOTP.","Customer ID":"ID de Cliente","This device is trusted":"Este dispositivo es confiable","This is not a reliable device?":"¿Este no es un dispositivo confiable?","Device is not trust, session disconnected by security":"Dispositivo no confiable, sesión desconectada por seguridad","Invalid Signature, session disconnected by security":"Firma inválida, sesión desconectada por seguridad","Now you can log back in with your new password.":"Ahora puedes iniciar sesión con tu nueva contraseña.","Password set successfully":"Contraseña establecida con éxito","User is not enabled or closed":"Usuario no habilitado o cuenta cerrada","Token was created from another device. Session disconnected by security":"El Token fue creado desde otro dispositivo. Sesión desconectada por seguridad", "Application updated, force reload required":"Aplicación actualizada, se requiere recarga forzada","Enter Password":"Introduce tu Contraseña",Authentication:"Autentícate","Password secirity _VALUE_ %":"Seguridad de la contraseña _VALUE_ %","Use minnimum 8 characters, uppercase, lowercase, numbers and special characters":"Usa mínimo 8 caracteres, mayúsculas, minúsculas, números y caracteres especiales",Cancel:"Cancelar","Invalid verification code. Please try again.":"Código de verificación inválido. Por favor inténtalo de nuevo.","Verify Your Email":"Verifica tu Correo Electrónico","Please enter the 6-digit code sent to your email.":"Por favor introduce el código de 6 dígitos enviado a tu correo electrónico.","Please login to your account.":"Por favor inicie sesión en su cuenta.",Email:"Correo Electrónico",Password:"Contraseña","Remember Me":"Recuérdame", "We will send you a verification code to your email and after validating that it is yours we will let you change the password.":"Te enviaremos un código de verificación a tu correo electrónico y después de validar que es tuyo te dejaremos estbalecer una nueva contraseña.",Login:"Iniciar Sesión","Sign in with Google":"Iniciar sesión con Google","Don't have an account yet?":"¿Aún no tienes una cuenta?","Sign Up":"Regístrate","You are logged in as":"Has iniciado sesión como",Register:"Crear una cuenta","Already have an account?":"¿Ya tienes una cuenta?","Forgot Password":"Crear nueva Contraseña","Back to Login":"Volver a Iniciar Sesión","Verify TOTP":"Verificar TOTP","Verify by TOTP code":"Verificar por medio de código TOTP","Generate a temporary code from your authentication application to secure access to your account.":"Genera un código temporal desde tu aplicación de autenticación para asegurar el acceso a tu cuenta.","Enter TOTP Code":"Introduce el código TOTP", "Update Profile":"Actualizar Perfil","Profile data":"Datos de Perfil",Fullname:"Nombre Completo",Update:"Actualizar",Male:"Masculino",Continue:"Continuar",Female:"Femenino",Gender:"Género","Select Country":"Seleccionar País",Country:"País de Residencia","Recovery Password":"Crear nueva Contraseña",Connecting:"Conectando","Your access password":"Tu contraseña de acceso","Are you new here?":"¿Eres nuevo por aquí?","Frequent Countries":"Paises más frecuentes","All Countries":"Todos los paises","Verify Your Email before set new passowrd":"Verifica tu correo electrónico antes de establecer una nueva contraseña","Complete your registration":"Completa tu registro","Invalid credentials. Please try again.":"Credenciales inválidas. Por favor inténtalo de nuevo.","There is no user in our system with this email":"No hay usuario en nuestro sistema con este correo","New Password":"Nueva Contraseña","User is disconnected":"Usuario desconectado", "Your new access password":"Tu nueva contraseña de acceso","Set password":"Establecer contraseña","Repeat password":"Repetir contraseña",Verify:"Verificar","Phone number":"Número de celular","Comeback to Login":"Volver al Inicio","Verify Your Celular before login":"Verifica tu celular antes de iniciar sesión","Please enter the 6-digit code sent to your phone.":"Por favor introduce el código de 6 dígitos enviado a tu celular.","Verify Your Celular before set new passowrd":"Verifica tu celular antes de establecer una nueva contraseña","Please enter the 6-digit code sent to your phone.":"Por favor introduce el código de 6 dígitos enviado a tu celular.",Logout:"Cerrar Sesión","In a few steps you will be registered.":"En pocos pasos te habrás dado de alta.","User not found with this phone":"Usuario no encontrado con este número de celular","User not found with this email":"Usuario no encontrado con este correo","User registration successful":"Registro de usuario exitoso", "Password must contain at least one uppercase letter.":"La contraseña debe contener al menos una letra mayúscula.","Password must be at least _minLength_ characters long.":"La contraseña debe tener al menos _minLength_ caracteres.","Password must not contain more than two consecutive identical numbers.":"La contraseña no debe contener más de dos números seguidos.","Congratulations _NAME_!, you are now a registered user and you can access safely with your email and password.":"Felicidades _NAME_!, ya eres un usuario registrado y puedes acceder de forma segura con tu correo y contraseña.","Phone already registered or in use bad account wsa desactivated":"Teléfono ya registrado o en uso mala cuenta fue desactivada","This is not a trusted device, your session will be disconnected in 30 minutes":"Este no es un dispositivo confiable, tu sesión se desconectará en 30 minutos"}},providers:{email:!0,sms:!1},popularCountries:["cu","us","mx","ec"], endpoint:`https://${"dev"==window.auth.env?"dev.":""}remesita.com`,defaultLanguage:window.auth.locale}),window.auth.remexAuth.addEventListener("RemexAuthLogout",(e=>{$("#remex-auth-container").removeClass("pt-5"),$(".transactional-reputation-container").remove(),$("#user-explain-loading").remove(),window.dispatchEvent(new CustomEvent("sessionDestroyed",{bubbles:!0})),$("#login-explain").show()})),window.auth.remexAuth.addEventListener("RemexAuthRendered",(e=>{window.dispatchEvent(new CustomEvent("afterAuthFormRender",{}))})),window.auth.remexAuth.addEventListener("RemexAuthReConnected",(e=>{window.auth.user&&window.auth.user.email==e.detail.email&&window.dispatchEvent(new CustomEvent("sessionRefreshed",{bubbles:!0,detail:window.auth.user}))})),window.auth.remexAuth.addEventListener("RemexAuthConnected",(async e=>{$("#form-loading").remove(),$("#remex-auth-container").addClass("pt-5"),window.auth.user=e.detail,window.dispatchEvent(new CustomEvent("sessionCreating",{bubbles:!0, detail:window.auth.user})),$("#login-explain").hide(),$("#user-explain-loading").remove(),$("#rightinfo").append('
\n
\n
\n
\n
\n
\n
');const a=await window.auth.remexAuth.getUserData(),o={token:$("script[lockuptoken]").attr("lockuptoken"),phone:a.phone,email:a.email,autoAuth:!0,fingerprint:window.auth.remexAuth.fingerprint,dim:$(window).width()+"x"+$(window).height()} ;JSON.stringify(o),$.ajax({type:"POST",url:window.location.origin+"/customer/discovery",dataType:"json",data:o,success:e=>{if(e.locked||e.disabled||e.closed){const a=window.auth.i18n(e.locked?window.auth.i18n("Tu cuenta se encuentra suspendida de forma indefinida"):e.disabled?window.auth.i18n("Tu cuenta se encuentra deshabilitada"):window.auth.i18n("Tu cuenta se encuentra cerrada de forma definitiva"));return window.dispatchEvent(new CustomEvent("sessionError",{bubbles:!0,detail:a})),window.auth.user=null,reject(a),window.auth.logout().then((()=>window.alertModal(window.auth.i18n("Lo sentimos!"),a,void 0,"lock","OK")??void 0)),!1}{const a=e;window.auth.user=a,window.localStorage.setItem("rmses",btoa(JSON.stringify(window.auth.user))),window.dispatchEvent(new CustomEvent("sessionCreated",{bubbles:!0,detail:window.auth.user})),window.auth.renderSessionInfo(),window.dispatchEvent(new CustomEvent("sessionRefreshed",{bubbles:!0,detail:window.auth.user}))}}})})), window.auth.remexAuth.addEventListener("RemexAuthFingerprint",(async e=>{window.auth.env,window.auth.fingerprint=e.detail.id,window.auth.deviceLabel=e.detail.label})),window.auth.remexAuth.addEventListener("RemexAuthInitialized",(async e=>{window.auth.env,window.auth.inizialized=!0,$(`${window.auth.authFormCssSelector}`).length&&window.auth.renderAuthForm(),window.auth.env}))};if(!window.RemexAuthComponentLoading)if(customElements.get("remex-auth"))await e();else{window.RemexAuthComponentLoading=!0;let o=document.querySelector('meta[name="x-cpl"]')?.getAttribute("content")||"1.0.0";var a=document.createElement("script");a.src=`/cdn/${o}/microfronts/authenticator/index.min.js`,a.async=!0,a.onload=async()=>{window.dispatchEvent(new CustomEvent("RemexAuthComponentLoaded",{})),window.RemexAuthComponentLoading=!1,await e()},document.head.appendChild(a)}},renderAuthForm:async e=>{if(!$(window.auth.authFormCssSelector).length||window.auth.uiRendererd)return;const a=setInterval((()=>{ !window.auth.inizialized||window.auth.remexAuth.rendered||window.auth.uiRendererd||(clearInterval(a),$(window.auth.authSessionInfoCssSelector).hide(),$(window.auth.authFormCssSelector).fadeIn(),window.dispatchEvent(new CustomEvent("beforeAuthFormRender",{})),window.auth.uiRenderer=!0,document.querySelector(window.auth.authFormCssSelector).appendChild(window.auth.remexAuth),e&&window.auth.remexAuth.addEventListener("RemexAuthLogged",(()=>{e()})))}),100)},windowIsFocused:!0,isConnected:()=>window.auth.remexAuth&&window.auth.remexAuth.isConnected(),checkUserIsLogged:()=>{let e=!1;if(null!=window.localStorage.getItem("rmses"))try{const a=JSON.parse(atob(window.localStorage.getItem("rmses")));null!=a&&(window.auth.setUserInSession(a),e=!0)}catch(e){}window.auth.user?window.auth.setUserInSession(window.auth.user):window.auth.renderAuthForm()},user:null,setUserInSession:async e=>{if(window.auth.user={id:e?.id??null,fullName:e?.fullName??e?.displayName??e?.name??"", photoURL:e?.photoURL??window.auth.defaultProfilePicture,email:e?.email??(e?.providerData?e?.providerData.email??e?.providerData[0].email??null:null),phone:e?.phone??e?.phoneNumber??null,firebaseId:e?.firebaseId??e?.uid??null,facebookId:e?.facebookId??(!e?.providerData||"facebook.com"!=e?.providerData.providerId&&"facebook.com"!=e?.providerData[0].providerId?null:e?.providerData.uid||e?.providerData[0].uid),authMethod:window.authMethod??(e?.providerData?e?.providerData.providerId??e?.providerData[0].providerId??"email":"email").replace(".com",""),commissions:e?.commissions??null,balance:e?.balance??null,dateOfBirth:e?.dateOfBirth??null,identificationNumber:e?.identificationNumber??null,address:e?.address??null,countReferralsN1:e?.countReferralsN1??"?",countReferralsN2:e?.countReferralsN2??"?",countReferralsN3:e?.countReferralsN3??"?",countRecipients:e?.countRecipients??null,countOrders:e?.countOrders??null,countCompletedOrders:e?.countCompletedOrders??null, verificationStatus:e?.verificationStatus??null,referCode:e?.referCode??null,token:e?.token??!1,level:e?.level??null,sex:e?.sex??null,risk:e?.risk??null,walletEnabled:e?.walletEnabled??!1,wasReferred:e?.wasReferred??!1,fingerprint:null,totp:e?.totp??window.auth?.user?.totp??!1},window.authMethod=window.auth.user.authMethod,(window.auth.user?.token??"").length&&window.localStorage.setItem("rmses",btoa(JSON.stringify(window.auth.user))),null!=window.localStorage.getItem("rmses"))try{const e=JSON.parse(atob(window.localStorage.getItem("rmses")));null!=e&&(window.auth.user=e)}catch(e){}/:0$/.test(window.auth.user.token)&&localStorage.setItem("RemexAuthToken",`${window.auth.user.token}:${btoa(JSON.stringify({id:window.auth.user.id,name:window.auth.user.fullName,pictire:window.auth.user.photoURL,email:window.auth.user.email,phone:window.auth.user.phone}))}`)},showTOTPForceDialog:e=>{ window.confirmModal(`
${e}
${window.auth.i18n("¿Deseas configurarlo ahora?")}`,(()=>{$("#secutiryModal").length?$("#secutiryModal").modal("show"):window.location.href="/customer/profile"}),(()=>0),"+"+moment.now())},_lockupPromises:{},renderSessionInfo:()=>{const e=window.auth.user?.photoURL||window.auth.user?.pictireUrl||window.auth.defaultProfilePicture;if(window.auth.defaultProfilePicture!=e){const a=new Image;a.onload=()=>$("#session-picture").attr("src",e),a.src=e}$(".transactional-reputation-container").remove(),$("#level-explanation").before('
'),$("#left-box").append('
'),$(".auth-form-logged .customer-picture").css({"border-radius":"50%","margin-top":"-60px",width:"80px", height:"80px"}),$(".auth-form-logged").height($("body").hasClass("device-mobile")?"auto":$("#customer-data-items").height()-40),$(`${window.auth.authSessionInfoCssSelector}`).show(),window.auth.loadTransactionalReputation(),window.dispatchEvent(new CustomEvent("sessionInfoRendered",{bubbles:!0,detail:window.auth.user}))},_transactionalReputationHtml:null,loadTransactionalReputation:()=>{null!=window.auth._transactionalReputationHtml?$(".transactional-reputation-container").html(window.auth._transactionalReputationHtml):$.ajax({type:"GET",url:"/customer/reputation",headers:{token:window.auth.user?.token},success:e=>{window.auth._transactionalReputationHtml=e.trim(),$(".transactional-reputation-container").html(e.trim())}})},logout:()=>new Promise((async(e,a)=>{await window.auth.remexAuth.handleLogout(),window.auth.user=null,window.fspt=!1,window.localStorage.removeItem("rmses"),window.logouting||(window.logouting=!0,window.fspt=!1, window.dispatchEvent(new CustomEvent("sessionDestroyed",{bubbles:!0})),$("#user-explain-loading").remove(),e())})),refreshing:!1,clearCacheAndReload:()=>{setTimeout((()=>window.location.reload(!0)),1e3),navigator.serviceWorker.getRegistrations().then((function(e){for(let a of e)a.unregister()})),caches.keys().then((function(e){for(let a of e)caches.delete(a)}))}},window.waitDefinition=e=>new Promise((a=>{const o=setInterval((()=>{void 0!==window[e]&&(clearInterval(o),a())}),250)})),window._networkSpeed=0,window.waitDefinition("jQuery").then((()=>{$(document).ready((()=>{setTimeout((()=>window.auth.init()),1e3)}))})),window.setNetworkPropertieToBody=()=>{},"connection"in navigator&&(window.setNetworkPropertieToBody=()=>{$("body").addClass(`network-${navigator.connection.effectiveType}`).data("net_type",navigator.connection.effectiveType).data("net_max_mbps",navigator.connection.downlink).data("net_rtt",navigator.connection.rtt).data("net_speed",window._networkSpeed)}, window.setNetworkPropertieToBody(),navigator.connection.addEventListener("change",window.setNetworkPropertieToBody)),"undefined"==typeof moment){var script=document.createElement("script");script.src="/assets/moment/moment-with-locales.min.js",script.async=!0,document.head.appendChild(script)}!function(){const e=XMLHttpRequest;XMLHttpRequest=function(){const a=new e,o=a.open;return a.open=function(e,t,n,i,r){o.call(this,e,t,n,i,r),window.auth&&window.auth.user&&window.auth.user.token&&("dev"==window.auth.env?this.setRequestHeader("Token",`${window.auth.user.token}`):this.setRequestHeader("Authorization",`Bearer ${window.auth.user.token}`),a.setRequestHeader("rmatk","remesita-atk-unit-time:"+Date.now()+":"+window.auth.user?.token+":"+Date.now()),window.auth?.remexAuth?.inizialized&&a.setRequestHeader("x-cpl",$('meta[name="x-cpl"]')?.attr("content")??window.auth.remexAuth.cookies.fetch("x-cpl")??"1.0.0"),window.auth&&window.auth.fingerprint&&(window.fspt=window.auth.fingerprint, a.setRequestHeader("fingerprint",window.auth.fingerprint),a.setRequestHeader("x-device",window.auth.deviceLabel??""))),a.onreadystatechange=function(){if(4===a.readyState&&window.auth?.remexAuth?.inizialized)try{const o=a.getAllResponseHeaders().split("\n").find((e=>"x-cpl"==e.split(":")[0])),t=$('meta[name="x-cpl"]')?.attr("content")??window.auth.remexAuth.cookies.fetch("x-cpl")??"1.0.0";if(window.serverCompilation=o?o.replace("x-cpl:","").trim()??t:t,null!=window.serverCompilation&&""!=window.serverCompilation){var e=window.auth.remexAuth.cookies.fetch("x-cpl")??window.auth.remexAuth.cookies.fetch("vcompilation")??window.auth.remexAuth.cookies.fetch("v-compilation")??"1.0.0";""!=e&&null!=e||(e="1.0.0"),window.serverCompilation!=e&&(/\/request|\/payme/.test(window.location.pathname)||$("#forcereloadbar button").off("click").on("click",(()=>{window.auth.remexAuth.cookies.store("x-cpl",window.serverCompilation,365), $("#forcereloadbar").html(`${window.wallet.i18n("Estamos limpiando cache para actualizar la página")}...`),window.auth.clearCacheAndReload()})))}}catch(e){}}},a}}();