Partners7™Partners7™
Facebook
0 0 0 0
Visualizaciones
Servicio de Traslado VIP⚡

Servicio de Traslado VIP⚡

 

🚖 Traslados VIP
✕
Servicio de Traslados VIP

Seleccione fecha, hora y su ruta en el mapa

Detalles del Viaje

AgendarAhora
Fecha
Hora

Seleccione su Ruta

👉 o haga clic en el mapa para seleccionar el punto de origen y de destino o escriba las direcciones

Origen✕
Destino✕
Mi ubicación
✏️ Modificar ruta por calles🧹 Limpiar puntosPrimero seleccione el origen y el destino. Luego podrá escoger una ruta alterna o marcar calles específicas.
⛶
Ruta personalizada activa. Arrastre los puntos numerados para ajustar el recorrido o presiónelos para eliminarlos.
Origen:No seleccionado
Destino:No seleccionado

Resumen del Viaje

Distancia

0 km

Precio Total

0 Lps

Confirmar Viaje

Ingrese sus datos

👤
📱
Cancelar Enviar

Campos faltantes

Cerrar
`,className:'',iconSize:[28,28],iconAnchor:[14,14]});} function initMap() {map=L.map('map',{preferCanvas:true}).setView([14.0723,-87.1921],13);L.tileLayer(`https://mt1.google.com/vt/lyrs=m&x={x}&y={y}&z={z}&key=AIzaSyCONKyNnq2bKgvKSGWy75Q066QFv3z19Co`,{attribution:'© Google Maps',tileSize:256,zoomOffset:0,maxZoom:20}).addTo(map);map.whenReady(()=>{fixLeafletMapSize();});map.on('click',(e)=>{if (nextClickTarget==='origin') {setOrigin(e.latlng);nextClickTarget=null;return;} if (nextClickTarget==='destination') {setDestination(e.latlng);nextClickTarget=null;return;} if (waypointEditMode&&originLatLng&&destinationLatLng) {addRouteWaypoint(e.latlng);return;} if (!originLatLng) {setOrigin(e.latlng);} else if (!destinationLatLng) {setDestination(e.latlng);} else {setDestination(e.latlng);}});} function setOrigin(latlng) {originLatLng=latlng;if (originMarker) map.removeLayer(originMarker);originMarker=L.marker(latlng,{icon:originIcon}).addTo(map).bindPopup('Origen ✕').openPopup();setTimeout(()=>{const el=document.getElementById('popup-clear-origin');if(el) el.onclick=clearOrigin;},300);reverseGeocode(latlng,'origin');drawRoute();handleCompletedRouteAutoExit();} function setDestination(latlng) {destinationLatLng=latlng;if (destinationMarker) map.removeLayer(destinationMarker);destinationMarker=L.marker(latlng,{icon:destinationIcon}).addTo(map).bindPopup('Destino ✕').openPopup();setTimeout(()=>{const el=document.getElementById('popup-clear-destination');if(el) el.onclick=clearDestination;},300);reverseGeocode(latlng,'destination');drawRoute();handleCompletedRouteAutoExit();} function reverseGeocode(latlng,type) {const geocoder=new google.maps.Geocoder();geocoder.geocode({location:{lat:latlng.lat,lng:latlng.lng}},(results,status)=>{if (status==='OK'&&results[0]) {if (type==='origin') {document.getElementById('origin-input').value=results[0].formatted_address;document.getElementById('origin-text').textContent=results[0].formatted_address;} else {document.getElementById('destination-input').value=results[0].formatted_address;document.getElementById('destination-text').textContent=results[0].formatted_address;}}});} function clearDisplayedRoutes(){routeLines.forEach(line=>{if (line&&map&&map.hasLayer(line)) map.removeLayer(line);});routeLines=[];routeLine=null;routeAlternatives=[];const options=document.getElementById('route-options');if (options) {options.innerHTML='';options.classList.add('hidden');}} function getRouteTotals(route){return (route.legs||[]).reduce((total,leg)=>{total.distanceMeters+=leg.distance?leg.distance.value:0;total.durationSeconds+=leg.duration?leg.duration.value:0;return total;},{distanceMeters:0,durationSeconds:0});} function formatRouteDistance(meters){const km=meters/1000;return`${km.toLocaleString('es-HN', { minimumFractionDigits: km < 10 ? 1 : 0, maximumFractionDigits: 1 })} km`;} function formatRouteDuration(seconds){const totalMinutes=Math.max(1,Math.round(seconds/60));const hours=Math.floor(totalMinutes/60);const minutes=totalMinutes%60;if (hours>0) return`${hours} h ${minutes ? minutes + ' min' : ''}`.trim();return`${minutes} min`;} function updateRouteSummary(route){if (!route) return;const totals=getRouteTotals(route);const distanceKm=totals.distanceMeters/1000;document.getElementById('distance-text').textContent=formatRouteDistance(totals.distanceMeters);document.getElementById('price-text').textContent=`${calculatePrice(distanceKm)} Lps`;lastOverviewPolyline=route.overview_polyline?route.overview_polyline.points:null;} function renderRouteOptions(){const options=document.getElementById('route-options');if (!options) return;options.innerHTML='';if (routeWaypoints.length>0||routeAlternatives.length<=1) {options.classList.add('hidden');return;} routeAlternatives.forEach((route,index)=>{const totals=getRouteTotals(route);const button=document.createElement('button');button.type='button';button.className=`p7-route-option${index === selectedRouteIndex ? ' is-selected' : ''}`;const title=document.createElement('span');title.className='p7-route-option-title';title.textContent=index===0?'Ruta recomendada':`Ruta alterna ${index}`;const detail=document.createElement('span');detail.className='p7-route-option-detail';const summary=route.summary?` · ${route.summary}`:'';detail.textContent=`${formatRouteDistance(totals.distanceMeters)} · ${formatRouteDuration(totals.durationSeconds)}${summary}`;button.appendChild(title);button.appendChild(detail);button.addEventListener('click',()=>selectRoute(index,true));options.appendChild(button);});options.classList.remove('hidden');} function selectRoute(index,fitRoute=false){if (!routeAlternatives[index]||!routeLines[index]) return;selectedRouteIndex=index;routeLines.forEach((line,lineIndex)=>{const selected=lineIndex===index;line.setStyle({color:selected?'#2563eb':'#6b7280',weight:selected?7:4,opacity:selected?1:.68,dashArray:selected?null:'9 8'});if (selected) line.bringToFront();});routeLine=routeLines[index];updateRouteSummary(routeAlternatives[index]);renderRouteOptions();const status=document.getElementById('route-edit-status');if (status&&routeWaypoints.length===0) {status.textContent=routeAlternatives.length>1?`Ruta ${index + 1} seleccionada. También puede tocar otra línea del mapa o usar “Modificar ruta por calles”.`:'Ruta calculada. Use “Modificar ruta por calles” para obligarla a pasar por puntos específicos.';} if (fitRoute&&routeLine) {map.fitBounds(routeLine.getBounds(),{padding:[40,40]});}} function renderWaypointMarkers(){waypointMarkers.forEach(marker=>{if (marker&&map&&map.hasLayer(marker)) map.removeLayer(marker);});waypointMarkers=[];routeWaypoints.forEach((latlng,index)=>{const marker=L.marker(latlng,{draggable:true,icon:createWaypointIcon(index),zIndexOffset:900}).addTo(map);const popup=document.createElement('div');const text=document.createElement('div');text.textContent=`Punto de paso ${index + 1}`;text.style.fontWeight='700';text.style.marginBottom='6px';const removeButton=document.createElement('button');removeButton.type='button';removeButton.textContent='Eliminar punto';removeButton.style.cssText='border:0;border-radius:6px;background:#dc2626;color:#fff;padding:6px 9px;cursor:pointer;';removeButton.addEventListener('click',()=>removeRouteWaypoint(index));popup.appendChild(text);popup.appendChild(removeButton);marker.bindPopup(popup);marker.on('dragend',()=>{routeWaypoints[index]=marker.getLatLng();drawRoute();});waypointMarkers.push(marker);});const clearButton=document.getElementById('clear-waypoints-btn');const note=document.getElementById('custom-route-note');if (clearButton) clearButton.classList.toggle('hidden',routeWaypoints.length===0);if (note) note.classList.toggle('hidden',routeWaypoints.length===0);} function addRouteWaypoint(latlng){if (!originLatLng||!destinationLatLng) {showAlert('Seleccione primero el origen y el destino.');return;} if (routeWaypoints.length>=8) {showAlert('Puede agregar un máximo de 8 puntos para modificar la ruta.');return;} routeWaypoints.push(L.latLng(latlng.lat,latlng.lng));renderWaypointMarkers();drawRoute();const status=document.getElementById('route-edit-status');if (status) status.textContent=`Punto ${routeWaypoints.length} agregado. Toque otra calle, arrastre un punto o presiónelo para eliminarlo.`;} function removeRouteWaypoint(index){if (index<0||index>=routeWaypoints.length) return;routeWaypoints.splice(index,1);renderWaypointMarkers();drawRoute();const status=document.getElementById('route-edit-status');if (status) {status.textContent=routeWaypoints.length?`Quedan ${routeWaypoints.length} punto(s) de paso. Puede seguir ajustándolos.`:'Se eliminaron los puntos personalizados. Volverán a mostrarse las rutas alternas disponibles.';}} function clearRouteWaypoints(redraw=true){routeWaypoints=[];renderWaypointMarkers();if (redraw&&originLatLng&&destinationLatLng) drawRoute();} function setWaypointEditMode(enabled){const button=document.getElementById('route-edit-btn');const shell=document.getElementById('map-shell');const status=document.getElementById('route-edit-status');if (enabled&&(!originLatLng||!destinationLatLng)) {showAlert('Seleccione primero el origen y el destino.');return;} waypointEditMode=Boolean(enabled);if (button) {button.classList.toggle('is-active',waypointEditMode);button.textContent=waypointEditMode?'✓ Terminar modificación':'✏️ Modificar ruta por calles';} if (shell) shell.classList.toggle('p7-map-editing',waypointEditMode);if (status) {status.textContent=waypointEditMode?'Toque en el mapa una calle por donde desea que pase la ruta. Puede agregar varios puntos.':(routeWaypoints.length?'Ruta personalizada guardada. Puede arrastrar los puntos numerados para seguir ajustándola.':'Puede elegir una ruta alterna o activar la modificación por calles específicas.');}} function setupRouteControls(){const editButton=document.getElementById('route-edit-btn');const clearButton=document.getElementById('clear-waypoints-btn');if (editButton) {editButton.addEventListener('click',()=>setWaypointEditMode(!waypointEditMode));} if (clearButton) {clearButton.addEventListener('click',()=>{clearRouteWaypoints(true);setWaypointEditMode(false);});}} function drawRoute() {if (!originLatLng||!destinationLatLng) return;const currentRequest=++routeRequestSerial;const ds=new google.maps.DirectionsService();const hasCustomWaypoints=routeWaypoints.length>0;const request={origin:{lat:originLatLng.lat,lng:originLatLng.lng},destination:{lat:destinationLatLng.lat,lng:destinationLatLng.lng},travelMode:google.maps.TravelMode.DRIVING,provideRouteAlternatives:!hasCustomWaypoints,waypoints:routeWaypoints.map(point=>({location:{lat:point.lat,lng:point.lng},stopover:false})),optimizeWaypoints:false};ds.route(request,(response,status)=>{if (currentRequest!==routeRequestSerial) return;if (status==='OK'&&response.routes&&response.routes.length) {clearDisplayedRoutes();routeAlternatives=response.routes;selectedRouteIndex=0;response.routes.forEach((route,index)=>{const points=route.overview_path.map(point=>[point.lat(),point.lng()]);const line=L.polyline(points,{color:index===0?'#2563eb':'#6b7280',weight:index===0?7:4,opacity:index===0?1:.68,dashArray:index===0?null:'9 8',bubblingMouseEvents:false}).addTo(map);line.on('click',()=>selectRoute(index,false));routeLines.push(line);});selectRoute(0,false);const group=L.featureGroup([...routeLines,...waypointMarkers,...(originMarker?[originMarker]:[]),...(destinationMarker?[destinationMarker]:[])]);if (group.getLayers().length) {map.fitBounds(group.getBounds(),{padding:[40,40]});} renderRouteOptions();const statusText=document.getElementById('route-edit-status');if (statusText) {if (hasCustomWaypoints) {statusText.textContent=`Ruta personalizada con ${routeWaypoints.length} punto(s). Arrástrelos para cambiar las calles.`;} else if (routeAlternatives.length>1) {statusText.textContent=`Se encontraron ${routeAlternatives.length} rutas. Seleccione una tarjeta o toque una línea del mapa.`;} else {statusText.textContent='Solo se encontró una ruta. Puede modificarla agregando puntos sobre calles específicas.';}}} else {console.warn('DirectionsService status:',status);showAlert('No se pudo calcular la ruta con esos puntos. Mueva o elimine el último punto e intente nuevamente.');}});} function calculatePrice(km) {let price;if (km>=0.1&&km<=6) price=90;else if (km>=6.01&&km<=6.49) price=92;else if (km>=6.5&&km<=6.99) price=94;else if (km>=7.0&&km<=13.99) price=Math.round(km*13.6);else if (km>=14.0&&km<=15.99) price=Math.round(km*14.8);else if (km>=16.0&&km<=18.99) price=Math.round(km*15);else if (km>=19.0&&km<=25.99) price=Math.round(km*15.10);else if (km>=26.0&&km<=34.99) price=Math.round(km*15.20);else if (km>=35.0&&km<=44.99) price=Math.round(km*15.30);else if (km>=45.0&&km<=54.99) price=Math.round(km*15.40);else if (km>=55.0&&km<=64.99) price=Math.round(km*15.50);else if (km>=65.0&&km<=74.99) price=Math.round(km*15.60);else if (km>=75.0&&km<=84.99) price=Math.round(km*15.70);else if (km>=85.0&&km<=90.99) price=Math.round(km*15.90);else if (km>=91.0&&km<=99.99) price=Math.round(km*16);else price=Math.round(km*16.10);const t=(document.getElementById('time')?.value)||'';if (t) {const [h,m]=t.split(':').map(Number);const mins=h*60+m;if (mins>=1350||mins<360) {price+=60;}} return price;} function initAutocomplete(){const originInput=document.getElementById("origin-input"),destinationInput=document.getElementById("destination-input");["address","establishment","geocode"].forEach(type=>{const auto=new google.maps.places.Autocomplete(originInput,{types:[type],componentRestrictions:{country:"hn"}});auto.addListener("place_changed",()=>{const place=auto.getPlace();if(place&&place.geometry) setOrigin(L.latLng(place.geometry.location.lat(),place.geometry.location.lng()))});const autoDest=new google.maps.places.Autocomplete(destinationInput,{types:[type],componentRestrictions:{country:"hn"}});autoDest.addListener("place_changed",()=>{const place=autoDest.getPlace();if(place&&place.geometry) setDestination(L.latLng(place.geometry.location.lat(),place.geometry.location.lng()))});});} function setupNowToggle() {const toggle=document.getElementById('now-toggle');const datetime=document.getElementById('datetime-container');const dateInput=document.getElementById('date');const timeInput=document.getElementById('time');toggle.addEventListener('change',()=>{if (toggle.checked) {datetime.classList.remove('show');const now=new Date();const utc=new Date(now.getTime()+(now.getTimezoneOffset()*60000));const tg=new Date(utc.getTime()-(6*60*60*1000));dateInput.value=tg.toISOString().slice(0,10);const hh=String(tg.getHours()).padStart(2,'0'),mm=String(tg.getMinutes()).padStart(2,'0');timeInput.value=`${hh}:${mm}`;} else {const now=new Date();const utc=new Date(now.getTime()+(now.getTimezoneOffset()*60000));const tg=new Date(utc.getTime()+(6*60*60*1000));const future=new Date(tg.getTime()-11*60*60*1000);dateInput.value=future.toISOString().slice(0,10);const hh=String(future.getHours()).padStart(2,'0'),mm=String(future.getMinutes()).padStart(2,'0');timeInput.value=`${hh}:${mm}`;datetime.classList.add('show');}});} document.getElementById('my-location-btn').addEventListener('click',()=>{if (navigator.geolocation) {navigator.geolocation.getCurrentPosition((pos)=>{const latlng=L.latLng(pos.coords.latitude,pos.coords.longitude);setOrigin(latlng);map.setView(latlng,15);},()=>{showAlert('No se pudo obtener su ubicación');});} else {showAlert('Geolocalización no soportada');}});function resetRouteSelection(){clearDisplayedRoutes();clearRouteWaypoints(false);setWaypointEditMode(false);lastOverviewPolyline=null;selectedRouteIndex=0;document.getElementById('distance-text').textContent='0 km';document.getElementById('price-text').textContent='0 Lps';} function clearOrigin(){if(originMarker) map.removeLayer(originMarker);originMarker=null;originLatLng=null;document.getElementById("origin-input").value="";document.getElementById("origin-text").textContent="No seleccionado";resetRouteSelection();nextClickTarget="origin";} function clearDestination(){if(destinationMarker) map.removeLayer(destinationMarker);destinationMarker=null;destinationLatLng=null;document.getElementById("destination-input").value="";document.getElementById("destination-text").textContent="No seleccionado";resetRouteSelection();nextClickTarget="destination";} document.getElementById("clear-origin").addEventListener("click",clearOrigin);document.getElementById("clear-destination").addEventListener("click",clearDestination);function openModal(){const m=document.getElementById('user-modal');m.classList.remove('hidden');setTimeout(()=>{m.querySelector('.modal-bg').style.backgroundColor='rgba(0,0,0,0.45)';const inner=m.querySelector('div > div');if(inner) inner.classList.remove('translate-y-6','scale-95');const titulos=document.querySelectorAll('h2');titulos.forEach(h2=>{if (h2.textContent.trim()==='Detalles del Viaje') {const contenedor=h2.closest('.bg-white');if (contenedor) {contenedor.scrollIntoView({behavior:'smooth',block:'start'});}}});},10);} function closeModal(){const m=document.getElementById('user-modal');const inner=m.querySelector('div > div');if(inner) inner.classList.add('translate-y-6','scale-95');setTimeout(()=>{m.classList.add('hidden');},200);} document.getElementById('modal-cancel')?.addEventListener('click',closeModal);async function getShortUrl(longUrl){const controller=new AbortController();const timer=setTimeout(()=>controller.abort(),8000);try {const res=await fetch(`https://tinyurl.com/api-create.php?url=${encodeURIComponent(longUrl)}`,{signal:controller.signal,cache:'no-store'});if (!res.ok) throw new Error(`HTTP ${res.status}`);const shortUrl=(await res.text()).trim();return shortUrl||longUrl;} catch(e) {console.warn('No se pudo acortar la ruta; se utilizará el enlace completo:',e);return longUrl;} finally {clearTimeout(timer);}} async function getBase64ImageFromUrl(url){const res=await fetch(url);const blob=await res.blob();return new Promise((resolve,reject)=>{const reader=new FileReader();reader.onloadend=()=>resolve(reader.result);reader.onerror=reject;reader.readAsDataURL(blob);});} const P7_COUNTER_URL='https://script.google.com/macros/s/AKfycbwL-5COHGGr2dMMYwbRr18l5ii2dugGyhrzBH71FObQwSiaRr4SJ7D_4tlgM18wsH8cNw/exec';const P7_COUNTER_SERVICE='P7_TVIP_GLOBAL_V2_20260901';function getNextSolicitudCounter(){return new Promise((resolve,reject)=>{const callbackName='p7GlobalCounter_'+Date.now()+'_'+Math.random().toString(36).slice(2);const script=document.createElement('script');let finished=false;const timeout=setTimeout(()=>{cleanup();reject(new Error('El contador global tardó demasiado en responder.'));},20000);function cleanup(){if(finished)return;finished=true;clearTimeout(timeout);if(script.parentNode)script.parentNode.removeChild(script);try{delete window[callbackName];}catch(_){window[callbackName]=undefined;}}window[callbackName]=function(response){if(finished)return;if(!response||response.service!==P7_COUNTER_SERVICE){cleanup();reject(new Error('El Apps Script del contador todavía no está actualizado a la versión global.'));return;}const counter=Number(response.counter);if(response.ok===true&&Number.isInteger(counter)&&counter>=1){cleanup();resolve(counter);return;}cleanup();reject(new Error(response.error||'El contador global devolvió una respuesta inválida.'));};script.onerror=function(){if(finished)return;cleanup();reject(new Error('No fue posible conectarse con el contador global.'));};script.src=P7_COUNTER_URL+(P7_COUNTER_URL.includes('?')?'&':'?')+'action=next&source=compact&callback='+encodeURIComponent(callbackName)+'&nocache='+Date.now();script.async=true;document.head.appendChild(script);});} function isIphoneSafari(){const ua=navigator.userAgent||navigator.vendor||window.opera||'';const isIOS=/iPhone|iPad|iPod/i.test(ua);const isSafari=/^((?!chrome|android|crios|fxios|edgios).)*safari/i.test(ua);return isIOS&&isSafari;} function wait(ms){return new Promise(resolve=>setTimeout(resolve,ms));} function isDesktopDevice(){const ua=navigator.userAgent||'';const mobileUA=/Android|iPhone|iPad|iPod|IEMobile|Opera Mini|Mobile/i.test(ua);const coarsePointer=window.matchMedia&&window.matchMedia('(pointer: coarse)').matches;return!mobileUA&&!coarsePointer;} async function handlePdfDownload(doc,filename){if (isDesktopDevice()) {doc.save(filename);return;} if (isIphoneSafari()) {await wait(10000);const wantsPdf=window.confirm('¿Desea guardar el PDF en la app Archivos?');if (!wantsPdf) {window.location.href='https://www.partners7.com/productos/servicio-de-traslado-vip';return;} try {const pdfBlob=doc.output('blob');const pdfFile=new File([pdfBlob],filename,{type:'application/pdf'});if (navigator.canShare&&navigator.canShare({files:[pdfFile]})&&navigator.share) {await navigator.share({files:[pdfFile],title:filename,text:'Guardar PDF del traslado VIP'});return;}} catch (shareErr) {console.warn('No se pudo abrir el menú de Archivos en Safari iPhone:',shareErr);} doc.save(filename);return;} doc.save(filename);} let p7FormSubmitting=false;document.getElementById('user-form')?.addEventListener('submit',async (e)=>{e.preventDefault();if (p7FormSubmitting) return;const name=document.getElementById('modal-name').value.trim();const phone=document.getElementById('modal-phone').value.trim();if (!name.match(/^[A-Za-zÀ-ÿ\s]+$/)) {showAlert('Nombre inválido');return;} if (!/^\d{4}-\d{4}$/.test(phone)) {showAlert('Teléfono inválido. Use el formato 9999-9999');return;} const submitButton=document.getElementById('user-submit-btn');const originalButtonText=submitButton?submitButton.textContent:'Enviar';const shouldOpenWhatsappFirst=isIphoneSafari();let p7WhatsappWindow=null;let whatsappUrl='';let whatsappWasOpened=false;p7FormSubmitting=true;if (submitButton) {submitButton.disabled=true;submitButton.textContent='Procesando...';submitButton.style.opacity='0.7';submitButton.style.cursor='wait';} try {p7WhatsappWindow=window.open('about:blank','_blank');if (p7WhatsappWindow) {try {p7WhatsappWindow.document.title='Preparando WhatsApp';p7WhatsappWindow.document.body.innerHTML='

Preparando la solicitud de WhatsApp…

';} catch (_) {}} else if (shouldOpenWhatsappFirst) {throw new Error('Safari bloqueó la ventana de WhatsApp. Active las ventanas emergentes para este sitio e intente nuevamente.');} const date=document.getElementById('date').value;const time=document.getElementById('time').value;const nowToggle=document.getElementById('now-toggle').checked?'Ahora':'Agendar';const originText=document.getElementById('origin-text').textContent;const destinationText=document.getElementById('destination-text').textContent;const distanceText=document.getElementById('distance-text').textContent;const priceText=document.getElementById('price-text').textContent;const waypointParam=routeWaypoints.length?`&waypoints=${encodeURIComponent(routeWaypoints.map(point => `${point.lat},${point.lng}`).join('|'))}`:'';const mapsLink=`https://www.google.com/maps/dir/?api=1&origin=${encodeURIComponent(originText)}&destination=${encodeURIComponent(destinationText)}&travelmode=driving${waypointParam}`;const shortLink=await getShortUrl(mapsLink);const counter=await getNextSolicitudCounter();const pad=String(counter).padStart(2,'0');const solicitudLabel=`${pad}P7-TVIP`;const filename=`${pad}P7-TrasladoVIP.pdf`;const fechaHoraGeneracion=new Date().toLocaleString('es-HN');const staticMapShareUrl=lastOverviewPolyline?`https://maps.googleapis.com/maps/api/staticmap?size=640x360&maptype=roadmap&format=png&scale=2&path=color:0x0000ff|weight:6|enc:${encodeURIComponent(lastOverviewPolyline)}&markers=color:green|${encodeURIComponent(originText)}&markers=color:red|${encodeURIComponent(destinationText)}&key=AIzaSyCONKyNnq2bKgvKSGWy75Q066QFv3z19Co`:`https://maps.googleapis.com/maps/api/staticmap?size=640x360&maptype=roadmap&format=png&scale=2&markers=color:green|${encodeURIComponent(originText)}&markers=color:red|${encodeURIComponent(destinationText)}&path=color:0x0000ff|weight:6|${encodeURIComponent(originText)}|${encodeURIComponent(destinationText)}&key=AIzaSyCONKyNnq2bKgvKSGWy75Q066QFv3z19Co`;const message=`*Nuevo viaje solicitado:* *Traslados VIP* *Solicitud:* ${pad}P7-TrasladoVIP *Nombre:* ${name} *Teléfono:* ${phone} *Modo:* ${nowToggle} *Fecha:* ${date||'-'} *Hora:* ${time||'-'} *Origen:* ${originText} *Destino:* ${destinationText} *Distancia:* ${distanceText} *Precio:* ${priceText} *Tipo de ruta:* ${routeWaypoints.length ? `Personalizada con ${routeWaypoints.length} punto(s)` : `Alternativa ${selectedRouteIndex+1}`} *Ruta:* ${shortLink} (La Solicitud ${pad}P7-TrasladoVIP se descargó en su dispositivo la cual esta pendiente de pago) Transferencias BAC - 756184001 App Kash (#Partner7 / 3258-1457) Efectivo`;const waUrl=`https://wa.me/50432581457?text=${encodeURIComponent(message)}`;whatsappUrl=waUrl;if (p7WhatsappWindow&&!p7WhatsappWindow.closed) {p7WhatsappWindow.location.href=waUrl;whatsappWasOpened=true;} if (shouldOpenWhatsappFirst&&whatsappWasOpened) {await wait(900);} const {jsPDF}=window.jspdf;const doc=new jsPDF({unit:'pt',format:'a4'});doc.setFont('helvetica','bold');doc.setFontSize(22);doc.text('Traslados VIP Partner7™',40,60);doc.setLineWidth(0.8);doc.line(40,70,555,70);doc.setFontSize(10);doc.setFont('helvetica','bold');doc.text('Cliente',40,90);doc.setFont('helvetica','normal');doc.text(name||'-',40,106);doc.text(phone||'-',40,122);doc.setFont('helvetica','bold');doc.text('Solicitud N°',410,90);doc.setFont('helvetica','normal');doc.text(solicitudLabel,410,106);doc.text(fechaHoraGeneracion,410,122);doc.setLineWidth(1.6);doc.line(40,140,555,140);let imgData=null;try {if (lastOverviewPolyline) {const staticMapUrl=`https://maps.googleapis.com/maps/api/staticmap?size=640x360&maptype=roadmap&format=png&scale=2&path=color:0x0000ff|weight:6|enc:${encodeURIComponent(lastOverviewPolyline)}&markers=color:green|${encodeURIComponent(originText)}&markers=color:red|${encodeURIComponent(destinationText)}&key=AIzaSyCONKyNnq2bKgvKSGWy75Q066QFv3z19Co`;imgData=await getBase64ImageFromUrl(staticMapUrl);} else {const staticMapUrl=`https://maps.googleapis.com/maps/api/staticmap?size=640x360&maptype=roadmap&format=png&scale=2&markers=color:green|${encodeURIComponent(originText)}&markers=color:red|${encodeURIComponent(destinationText)}&path=color:0x0000ff|weight:6|${encodeURIComponent(originText)}|${encodeURIComponent(destinationText)}&key=AIzaSyCONKyNnq2bKgvKSGWy75Q066QFv3z19Co`;imgData=await getBase64ImageFromUrl(staticMapUrl);}} catch (imgErr) {console.warn('No se pudo obtener la miniatura del Static Map:',imgErr);imgData=null;} const imgX=40,imgY=155,imgW=515,imgH=230;if (imgData) {doc.addImage(imgData,'PNG',imgX,imgY,imgW,imgH);} else {doc.setFont('helvetica','italic');doc.text('(Miniatura del mapa no disponible)',40,170);} let afterMapY=imgY+imgH+10;doc.setFontSize(11);doc.setFont('helvetica','normal');doc.text(`Nombre: ${name}`,40,afterMapY);doc.text(`Teléfono: ${phone}`,40,afterMapY+14);doc.text(`Modo: ${nowToggle}`,40,afterMapY+28);doc.text(`Fecha: ${date || '-'}`,40,afterMapY+42);doc.text(`Hora: ${time || '-'}`,40,afterMapY+56);const originLines=doc.splitTextToSize(`Origen: ${originText}`,515);doc.text(originLines,40,afterMapY+70);const destLines=doc.splitTextToSize(`Destino: ${destinationText}`,515);doc.text(destLines,40,afterMapY+70+(originLines.length*12));const posAfterDest=afterMapY+70+(originLines.length*12)+(destLines.length*12);doc.text(`Distancia: ${distanceText}`,40,posAfterDest+6);doc.text(`Precio: ${priceText}`,40,posAfterDest+20);doc.text(`Ruta: ${shortLink}`,40,posAfterDest+34);const lineY=posAfterDest+50;doc.setLineWidth(1.6);doc.line(40,lineY,555,lineY);let condY=lineY+20;doc.setFont('helvetica','bold');doc.setFontSize(12);doc.text('Condiciones y Formas de Pago',40,condY);doc.setFont('helvetica','normal');doc.setFontSize(10);condY+=16;const condiciones=`Si en detalles de viaje selecciono "Agendar" el traslado será en la hora y punto de origen seleccionado. Si selecciono "Ahora" el traslado será de 15-20 Mins posterior de la emisión de esta solicitud. Los traslados son previa cancelación de pago salvo acuerdo mutuo de ambas partes y de disponibilidad de tiempo.`;doc.text(condiciones,40,condY,{maxWidth:515});condY+=80;doc.setFont('helvetica','bold');doc.text('Formas de Pago',40,condY);doc.setFont('helvetica','normal');condY+=14;doc.text('Transferencias BAC - 756184001',40,condY);condY+=12;doc.text('App Kash (#Partner7 / 3258-1457)',40,condY);condY+=12;doc.text('Efectivo',40,condY);condY+=18;doc.setFont('helvetica','bold');doc.text('Traslados VIP',40,condY+6);doc.text('POWERED BY: PARTNER7™',40,condY+20);doc.setFont('helvetica','normal');doc.text('+504 3258-1457',40,condY+34);doc.setLineWidth(0.6);doc.line(40,condY+44,555,condY+44);doc.text('WWW.PARTNERS7.COM',220,condY+58);closeModal();await handlePdfDownload(doc,filename);if (!whatsappWasOpened&&whatsappUrl) {window.location.href=whatsappUrl;}} catch (err) {console.error('Error procesando la solicitud:',err);if (p7WhatsappWindow&&!p7WhatsappWindow.closed&&!whatsappWasOpened) {try {p7WhatsappWindow.close();} catch (_) {}} showAlert(err?.message||'No se pudo procesar la solicitud. Intente nuevamente.');} finally {p7FormSubmitting=false;if (submitButton) {submitButton.disabled=false;submitButton.textContent=originalButtonText;submitButton.style.opacity='';submitButton.style.cursor='';}}});document.getElementById('confirm-btn').addEventListener('click',()=>{const originVal=document.getElementById('origin-input').value.trim();const destVal=document.getElementById('destination-input').value.trim();const nowToggle=document.getElementById('now-toggle').checked;const dateVal=document.getElementById('date').value.trim();const timeVal=document.getElementById('time').value.trim();['origin-input','destination-input','date','time'].forEach(id=>document.getElementById(id).classList.remove('input-error'));const missing=[];if (!originVal) {missing.push('Origen');document.getElementById('origin-input').classList.add('input-error');} if (!destVal) {missing.push('Destino');document.getElementById('destination-input').classList.add('input-error');} if (!nowToggle) {if (!dateVal) {missing.push('Fecha');document.getElementById('date').classList.add('input-error');} if (!timeVal) {missing.push('Hora');document.getElementById('time').classList.add('input-error');}} if (missing.length>0) {showAlert('Faltan los siguientes campos: '+missing.join(', '));return;} openModal();});['origin-input','destination-input','date','time'].forEach(id=>{const el=document.getElementById(id);if (el) el.addEventListener('input',()=>{document.getElementById(id).classList.remove('input-error');});});const phoneInput=document.getElementById('modal-phone');if (phoneInput) {phoneInput.addEventListener('input',(e)=>{let value=e.target.value.replace(/\D/g,'');if (value.length>4) {value=value.replace(/^(\d{4})(\d{0,5})/,'$1-$2');} value=value.slice(0,10);e.target.value=value;});} const alertModal=document.getElementById('alert-modal');const alertMessage=document.getElementById('alert-message');const alertClose=document.getElementById('alert-close');let lastAlertWasMissingFields=false;function scrollVipToHeading(headingText) {const widget=document.getElementById('p7-vip-widget');if (!widget) return;const headings=widget.querySelectorAll('h1, h2, h3');for (const heading of headings) {if (heading.textContent.trim().toLowerCase()===headingText.toLowerCase()) {const targetCard=heading.closest('.bg-white')||heading;targetCard.scrollIntoView({behavior:'smooth',block:'start'});setTimeout(()=>{if (map) map.invalidateSize(true);},450);return;}}} function showAlert(msg) {if (!alertModal) return alert(msg);lastAlertWasMissingFields=msg.toLowerCase().includes('faltan los siguientes campos');if (lastAlertWasMissingFields) {scrollVipToHeading('Detalles del Viaje');} alertMessage.textContent=msg;alertModal.classList.remove('hidden');setTimeout(()=>{alertModal.classList.remove('opacity-0');alertModal.style.opacity=1;alertModal.querySelector('div').classList.remove('translate-y-6','scale-95');},250);} function closeAlert() {if (!alertModal) return;alertModal.querySelector('div').classList.add('translate-y-6','scale-95');alertModal.classList.add('opacity-0');alertModal.style.opacity=0;setTimeout(()=>{alertModal.classList.add('hidden');if (lastAlertWasMissingFields) {scrollVipToHeading('Seleccione su Ruta');lastAlertWasMissingFields=false;}},300);} if (alertClose) alertClose.addEventListener('click',closeAlert);function initAll() {initMap();initAutocomplete();setupNowToggle();setupMapFullscreen();setupRouteControls();const now=new Date();const utc=new Date(now.getTime()+(now.getTimezoneOffset()*60000));const tegucigalpaNow=new Date(utc.getTime()-(6*60*60*1000));const dateEl=document.getElementById('date');const timeEl=document.getElementById('time');if (dateEl) dateEl.value=tegucigalpaNow.toISOString().slice(0,10);if (timeEl) {timeEl.addEventListener('input',()=>{if(originLatLng&&destinationLatLng) drawRoute();});document.getElementById('now-toggle').addEventListener('change',()=>{if(originLatLng&&destinationLatLng) setTimeout(drawRoute,50);});const hh=String(tegucigalpaNow.getHours()).padStart(2,'0');const mm=String(tegucigalpaNow.getMinutes()).padStart(2,'0');timeEl.value=`${hh}:${mm}`;}} document.getElementById('vip-btn').addEventListener('click',()=>{const wrapper=document.getElementById('vip-modal-wrapper');const modal=document.getElementById('vip-modal');wrapper.classList.remove('hidden');wrapper.style.display='block';modal.classList.remove('modal-closed');modal.classList.add('modal-open');wrapper.setAttribute('aria-hidden','false');document.body.style.overflow='hidden';if (!wrapper.dataset.inited) {initAll();wrapper.dataset.inited='1';} fixLeafletMapSize();});document.getElementById('close-vip').addEventListener('click',()=>{const wrapper=document.getElementById('vip-modal-wrapper');const modal=document.getElementById('vip-modal');modal.classList.remove('modal-open');modal.classList.add('modal-closed');wrapper.setAttribute('aria-hidden','true');document.body.style.overflow='';setTimeout(()=>{wrapper.classList.add('hidden');wrapper.style.display='none';},220);});document.getElementById('vip-modal-bg').addEventListener('click',(e)=>{const card=document.getElementById('vip-modal');if (!card.contains(e.target)) {document.getElementById('close-vip').click();}});document.getElementById('vip-modal').addEventListener('click',(e)=>{e.stopPropagation();});function showError(message) {const errorContainer=document.getElementById('error-container');const errorMessage=document.getElementById('error-message');errorMessage.textContent=message;errorContainer.style.display='block';setTimeout(()=>{errorContainer.style.display='none';},3000);}

L 186.00

Consultar por WhatsApp
✨ ¿Qué es Pre-Ordenar?
Pre-ordenar significa asegurar tu producto a un precio especial, recibiéndolo en 2–3 semanas directamente en la puerta de tu casa.🚚💻

🏦 Pagos en Cuotas
Financiamos tus productos / Servicios en cuotas mensuales, has clic en pagos en cuotas ó consulta al WhatsApp como obtenerlo!