1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[94453],{5257:(e,t,r)=>{r.d(t,{Z:()=>n});function n(e){return String(e??"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}},19985:(e,t,r)=>{r.d(t,{GoogleMapsKeyProvider:()=>i,h:()=>a});var n=r(95155),o=r(12115);let l=(0,o.createContext)("");function i({apiKey:e,children:t}){return(0,n.jsx)(l.Provider,{value:e,children:t})}function a(){return(0,o.useContext)(l)||"AIzaSyDnRCKqjZOpZc8-ki2DwWvFq-iWQXxSfX4"}},94453:(e,t,r)=>{r.r(t),r.d(t,{default:()=>c});var n=r(95155),o=r(12115),l=r(5257),i=r(19985);let a="gm-script",s="#0b5cff";function c({paradas:e,origen:t}){let r=(0,i.h)(),p=(0,o.useRef)(null),d=(0,o.useRef)(null),g=(0,o.useRef)([]),u=(0,o.useRef)(null),[f,h]=(0,o.useState)(null);function m(){let r=window?.google?.maps,n=d.current;if(!r||!n)return;for(let e of g.current)e.setMap&&e.setMap(null);g.current=[],u.current||(u.current=new r.InfoWindow);let o=e.filter(e=>null!=e.lat&&null!=e.lng&&!isNaN(e.lat)&&!isNaN(e.lng)),i=new r.LatLngBounds,a=!1;for(let e of o){let t={lat:e.lat,lng:e.lng},o=new r.Marker({position:t,map:n,icon:{url:function(e,t){let r=t?"#16a34a":s;return"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="32" height="40" viewBox="0 0 32 40"> 2 <path d="M16 1C8 1 1.5 7.4 1.5 15.4 1.5 26.2 16 39 16 39s14.5-12.8 14.5-23.6C30.5 7.4 24 1 16 1z" fill="${r}" stroke="white" stroke-width="2"/> 3 <circle cx="16" cy="15.5" r="9.5" fill="white" opacity=".95"/> 4 <text x="16" y="19.5" text-anchor="middle" font-family="Arial,sans-serif" font-size="10.5" font-weight="700" fill="${r}">${e}</text> 5 </svg>`)}(String(e.orden),e.done),scaledSize:new r.Size(32,40),anchor:new r.Point(16,39)},title:`${e.orden}. ${e.nombre}`}),c=`<a href="https://www.google.com/maps/dir/?api=1&destination=${t.lat},${t.lng}" target="_blank" rel="noreferrer" style="color:#1d4ed8;font-weight:600;font-size:11px">ð C\xf3mo llegar</a>`,p=`<div style="font-family:system-ui,sans-serif;min-width:180px"> 6 <p style="margin:0 0 3px;font-weight:700;font-size:13px;color:#111">${e.orden}. ${(0,l.Z)(e.nombre)}</p> 7 ${e.codigo?`<p style="margin:0 0 2px;font-size:11px;color:#64748b">C\xf3digo: <b>${(0,l.Z)(e.codigo)}</b></p>`:""} 8 ${e.ciudad?`<p style="margin:0 0 2px;font-size:11px;color:#64748b">${(0,l.Z)(e.ciudad)}</p>`:""} 9 ${e.done?'<p style="margin:0 0 3px;font-size:11px;color:#16a34a;font-weight:600">â Visitado</p>':""} 10 ${c} 11 </div>`;o.addListener("click",()=>{u.current.setContent(p),u.current.open(n,o)}),g.current.push(o),i.extend(t),a=!0}if(t&&Number.isFinite(t.lat)&&Number.isFinite(t.lng)){let e=new r.Marker({position:t,map:n,icon:{url:"data:image/svg+xml;charset=UTF-8,"+encodeURIComponent(`<svg xmlns="http://www.w3.org/2000/svg" width="26" height="26" viewBox="0 0 26 26"> 12 <circle cx="13" cy="13" r="11" fill="#111827" fill-opacity=".15" stroke="#111827" stroke-width="2"/> 13 <circle cx="13" cy="13" r="5" fill="#111827" stroke="white" stroke-width="2"/> 14 </svg>`),scaledSize:new r.Size(26,26),anchor:new r.Point(13,13)},title:"Inicio del recorrido",zIndex:999});g.current.push(e),i.extend(t),a=!0}let c=[...t?[{lat:t.lat,lng:t.lng}]:[],...o.map(e=>({lat:e.lat,lng:e.lng})),...t?[{lat:t.lat,lng:t.lng}]:[]];if(c.length>=2){let e=c.slice(1,-1);if(e.length<=23){let t=new r.DirectionsService,o=new r.DirectionsRenderer({suppressMarkers:!0,preserveViewport:!0,polylineOptions:{strokeColor:s,strokeOpacity:.8,strokeWeight:5}});o.setMap(n),g.current.push(o),t.route({origin:c[0],destination:c[c.length-1],waypoints:e.map(e=>({location:e,stopover:!0})),travelMode:r.TravelMode.DRIVING,optimizeWaypoints:!1},(e,t)=>{if("OK"===t)o.setDirections(e);else{let e=new r.Polyline({path:c,geodesic:!0,strokeColor:s,strokeOpacity:.7,strokeWeight:4});e.setMap(n),g.current.push(e)}})}else{let e=new r.Polyline({path:c,geodesic:!0,strokeColor:s,strokeOpacity:.7,strokeWeight:4});e.setMap(n),g.current.push(e)}}a&&(o.length+ +!!t===1?(n.setCenter(i.getCenter()),n.setZoom(14)):n.fitBounds(i,48))}return((0,o.useEffect)(()=>{let e=!1;return new Promise((e,t)=>
14{let n=window;if(n.google?.maps)return e();if(!r)return t(Error("NEXT_PUBLIC_GOOGLE_MAPS_API_KEY no configurada"));let o=document.getElementById(a);if(o){let r=setInterval(()=>{n.google?.maps&&(clearInterval(r),e())},100),l=setTimeout(()=>{clearInterval(r),t(Error("Google Maps timeout"))},15e3);o.addEventListener("load",()=>{clearInterval(r),clearTimeout(l),e()}),o.addEventListener("error",()=>{clearInterval(r),clearTimeout(l),t(Error("Google Maps load error"))});return}let l=document.createElement("script");l.id=a,l.src=`https://maps.googleapis.com/maps/api/js?key=${r}`,l.async=!0,l.onload=()=>e(),l.onerror=()=>t(Error("Google Maps load error")),document.head.appendChild(l)}).then(()=>{if(e||!p.current)return;let t=window.google.maps;d.current||(d.current=new t.Map(p.current,{center:{lat:-34.6,lng:-58.45},zoom:10,mapTypeId:"roadmap",mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!0})),h(null),m()}).catch(t=>{e||h(t instanceof Error?t.message:"No se pudo cargar el mapa")}),()=>{e=!0}},[]),(0,o.useEffect)(()=>{m()},[e,t]),f)?(0,n.jsx)("div",{style:{height:420,display:"grid",placeItems:"center",padding:24,textAlign:"center",color:"var(--ink-3)"},children:(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{style:{fontWeight:600,color:"var(--ink)"},children:"Mapa no disponible"}),(0,n.jsx)("p",{style:{fontSize:13,marginTop:4},children:f})]})}):(0,n.jsx)("div",{ref:p,style:{width:"100%",height:440,minHeight:360},"aria-label":"Mapa de la ruta del d\xeda"})}}}]);
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.