1function calcularDiaEntrega(){const diasFestivos=["2024-01-01","2024-05-01","2024-08-15","2024-10-12","2024-11-01","2024-12-06","2024-12-25"],ahora=new Date,horaLimite=13;let minutosParaPedido;const tiempoEnvio=48;ahora.getHours()<horaLimite?minutosParaPedido=(horaLimite-ahora.getHours()-1)*60+(60-ahora.getMinutes()):minutosParaPedido=(24-ahora.getHours()+horaLimite-1)*60+(60-ahora.getMinutes());let horasParaPedido=Math.floor(minutosParaPedido/60);minutosParaPedido=minutosParaPedido%60;let fechaEnvio=new Date(ahora);fechaEnvio.setMinutes(fechaEnvio.getMinutes()+minutosParaPedido+horasParaPedido*60);let horasAgregadas=0;for(;horasAgregadas<tiempoEnvio;){fechaEnvio.setMinutes(fechaEnvio.getMinutes()+60);const diaSemana=fechaEnvio.getDay(),esFinDeSemana=diaSemana===0||diaSemana===6,esDiaFestivo=diasFestivos.includes(fechaEnvio.toISOString().split("T")[0]);!esFinDeSemana&&!esDiaFestivo&&horasAgregadas++}const opcionesFecha={weekday:"short",month:"short",day:"numeric",timeZone:"Europe/Madrid"},fechaEntrega=fechaEnvio.toLocaleDateString("es-ES",opcionesFecha),diaActual=ahora.getDay();return(fechaEnvio.getDate()===ahora.getDate()+1||ahora.getHours()>=horaLimite&&fechaEnvio.getDate()===ahora.getDate())&&diaActual>=1&&diaActual<=4?`Haz el pedido antes de <span>${horasParaPedido>0?horasParaPedido:""} ${horasParaPedido>1?"horas y":horasParaPedido==1?"hora y":""} ${minutosParaPedido} minutos</span> y rec\xEDbelo <span>ma\xF1ana.</span>`:`Haz el pedido antes de <span>${horasParaPedido>0?horasParaPedido:""} ${horasParaPedido>1?"horas y":horasParaPedido==1?"hora y":""} ${minutosParaPedido} minutos</span> y rec\xEDbelo antes del <span>${fechaEntrega}</span>.`}$(".entrega-item").each(function(){$(this).html(calcularDiaEntrega())}); 2//# sourceMappingURL=/cdn/shop/t/80/assets/envio-product.js.map?v=31188698505483955471774013247
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.