(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[700],{1199:(e,t,o)=>{Promise.resolve().then(o.bind(o,4390)),Promise.resolve().then(o.t.bind(o,1356,23))},4390:(e,t,o)=>{"use strict";o.d(t,{TripRouteMap:()=>l});var n=o(5155),r=o(2115);function l(e){let{route:t}=e,o=function(){let[e,t]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{var e;if(null==(e=window.google)?void 0:e.maps)return void t(!0);let o=document.getElementById("google-maps-script");if(o)return void o.addEventListener("load",()=>t(!0),{once:!0});let n=document.createElement("script");n.id="google-maps-script",n.async=!0,n.src="https://maps.googleapis.com/maps/api/js?key=".concat("AIzaSyA_Cz8BnncMwbpodA8XWNSaoEliz52kEAI"),n.onload=()=>t(!0),document.body.appendChild(n)},[]),e}(),l=(0,r.useRef)(null),s=(0,r.useRef)(null);return((0,r.useEffect)(()=>{if(!o||!l.current||!window.google||0===t.length)return;let e=t[0];s.current=new window.google.maps.Map(l.current,{center:{lat:e.latitude,lng:e.longitude},zoom:11,mapTypeControl:!1,streetViewControl:!1});let n=t.map(e=>({lat:e.latitude,lng:e.longitude})),r=new window.google.maps.LatLngBounds;n.forEach(e=>r.extend(e)),new window.google.maps.Polyline({map:s.current,path:n,strokeColor:"#38bdf8",strokeOpacity:.9,strokeWeight:4}),new window.google.maps.Marker({map:s.current,position:n[0],label:"I"}),new window.google.maps.Marker({map:s.current,position:n[n.length-1],label:"F"}),s.current.fitBounds(r,60)},[o,t]),0===t.length)?(0,n.jsx)("div",{className:"flex h-[360px] items-center justify-center rounded-3xl border border-dashed border-border bg-slate-950/60 text-sm text-muted-foreground",children:"Este viaje no tiene ruta disponible."}):(0,n.jsx)("div",{className:"h-[360px] rounded-3xl",ref:l})}}},e=>{e.O(0,[356,441,255,358],()=>e(e.s=1199)),_N_E=e.O()}]);