{"version":3,"sources":["../src/hooks/useGoogleMaps.ts","../src/hooks/useMap.ts","../src/hooks/useMarkers.ts","../src/hooks/useGeocoding.ts","../src/hooks/usePlaces.ts","../src/hooks/usePlacesNew.ts","../src/hooks/useGeocodingService.ts","../src/hooks/useStreetView.ts","../src/hooks/useBicycling.ts","../src/hooks/useClustering.ts","../src/hooks/useDirections.ts","../src/hooks/useDistanceMatrix.ts","../src/hooks/useElevation.ts","../src/hooks/useGeometry.ts","../src/hooks/useHeatmap.ts","../src/hooks/useInfoWindows.ts","../src/hooks/useMapEvents.ts","../src/hooks/useMaxZoom.ts","../src/hooks/useTraffic.ts","../src/hooks/useTransit.ts","../src/components/Map.tsx","../src/components/Marker.tsx","../src/components/InfoWindow.tsx","../src/index.ts"],"sourcesContent":["import { useState, useEffect } from 'react';\nimport { loadGoogleMaps, isGoogleMapsLoaded } from '@gmaps-kit/core';\n\nexport interface UseGoogleMapsOptions {\n  apiKey: string;\n  libraries?: string[];\n  onLoad?: () => void;\n  onError?: (error: Error) => void;\n}\n\nexport interface UseGoogleMapsReturn {\n  isLoaded: boolean;\n  isLoading: boolean;\n  error: Error | null;\n  load: () => Promise<void>;\n}\n\nexport function useGoogleMaps(\n  options: UseGoogleMapsOptions\n): UseGoogleMapsReturn {\n  const [isLoaded, setIsLoaded] = useState(false);\n  const [isLoading, setIsLoading] = useState(false);\n  const [error, setError] = useState<Error | null>(null);\n\n  const load = async () => {\n    if (isLoaded || isLoading) return;\n\n    setIsLoading(true);\n    setError(null);\n\n    try {\n      await loadGoogleMaps({\n        apiKey: options.apiKey,\n        libraries: options.libraries || ['places', 'geometry'],\n      });\n\n      setIsLoaded(true);\n      options.onLoad?.();\n    } catch (err) {\n      const error =\n        err instanceof Error ? err : new Error('Failed to load Google Maps');\n      setError(error);\n      options.onError?.(error);\n    } finally {\n      setIsLoading(false);\n    }\n  };\n\n  useEffect(() => {\n    if (isGoogleMapsLoaded()) {\n      setIsLoaded(true);\n    }\n  }, []);\n\n  return {\n    isLoaded,\n    isLoading,\n    error,\n    load,\n  };\n}\n","import { useState, useEffect, useCallback, useMemo } from 'react';\nimport {\n  createMap,\n  getMapCenter,\n  setMapCenter,\n  getMapZoom,\n  setMapZoom,\n  panTo,\n  fitMapToMarkers,\n  MapInstance,\n} from '@gmaps-kit/core';\n\nexport interface UseMapOptions {\n  center?: google.maps.LatLngLiteral;\n  zoom?: number;\n  mapTypeId?: google.maps.MapTypeId;\n  mapId?: string;\n  onMapReady?: (map: MapInstance) => void;\n}\n\nexport interface UseMapReturn {\n  mapInstance: MapInstance | null;\n  isReady: boolean;\n  center: google.maps.LatLngLiteral | null;\n  zoom: number | null;\n  setCenter: (center: google.maps.LatLngLiteral) => void;\n  setZoom: (zoom: number) => void;\n  panTo: (center: google.maps.LatLngLiteral, zoom?: number) => void;\n  fitToMarkers: (markers: google.maps.Marker[]) => void;\n}\n\nexport function useMap(\n  containerId: string,\n  options: UseMapOptions = {}\n): UseMapReturn {\n  const [mapInstance, setMapInstance] = useState<MapInstance | null>(null);\n  const [isReady, setIsReady] = useState(false);\n  const [center, setCenterState] = useState<google.maps.LatLngLiteral | null>(\n    null\n  );\n  const [zoom, setZoomState] = useState<number | null>(null);\n\n  // Memoize options to prevent unnecessary re-renders\n  const memoizedOptions = useMemo(\n    () => options,\n    [\n      options.center?.lat,\n      options.center?.lng,\n      options.zoom,\n      options.mapTypeId,\n      options.mapId,\n      options.onMapReady,\n    ]\n  );\n\n  const initializeMap = useCallback(() => {\n    if (!containerId || mapInstance) return; // Prevent re-initialization\n\n    try {\n      const mapOptions = {\n        center: memoizedOptions.center || { lat: 40.7128, lng: -74.006 },\n        zoom: memoizedOptions.zoom || 10,\n        mapTypeId: memoizedOptions.mapTypeId,\n        mapId: memoizedOptions.mapId,\n      };\n\n      const map = createMap(containerId, mapOptions);\n\n      setMapInstance(map);\n      setIsReady(true);\n      setCenterState(getMapCenter(map.map));\n      setZoomState(getMapZoom(map.map));\n      memoizedOptions.onMapReady?.(map);\n    } catch (error) {\n      console.error('Failed to initialize map:', error);\n    }\n  }, [containerId, memoizedOptions, mapInstance]);\n\n  useEffect(() => {\n    initializeMap();\n  }, [initializeMap]);\n\n  const setCenter = useCallback(\n    (newCenter: google.maps.LatLngLiteral) => {\n      if (mapInstance) {\n        setMapCenter(mapInstance.map, newCenter);\n        setCenterState(newCenter);\n      }\n    },\n    [mapInstance]\n  );\n\n  const setZoom = useCallback(\n    (newZoom: number) => {\n      if (mapInstance) {\n        setMapZoom(mapInstance.map, newZoom);\n        setZoomState(newZoom);\n      }\n    },\n    [mapInstance]\n  );\n\n  const panToLocation = useCallback(\n    (newCenter: google.maps.LatLngLiteral, newZoom?: number) => {\n      if (mapInstance) {\n        panTo(mapInstance.map, newCenter, newZoom);\n        setCenterState(newCenter);\n        if (newZoom !== undefined) {\n          setZoomState(newZoom);\n        }\n      }\n    },\n    [mapInstance]\n  );\n\n  const fitToMarkers = useCallback(\n    (markers: google.maps.Marker[]) => {\n      if (mapInstance) {\n        fitMapToMarkers(mapInstance.map, markers);\n      }\n    },\n    [mapInstance]\n  );\n\n  return {\n    mapInstance,\n    isReady,\n    center,\n    zoom,\n    setCenter,\n    setZoom,\n    panTo: panToLocation,\n    fitToMarkers,\n  };\n}\n","import { useState, useCallback, useEffect } from 'react';\nimport {\n  addMarker,\n  removeMarker,\n  updateMarkerPosition,\n  updateMarkerContent,\n  getMarkerPosition,\n  setMarkerDraggable,\n  addMarkerClickListener,\n  addMarkerDragListener,\n  addMarkerDragEndListener,\n} from '@gmaps-kit/core';\nimport { MapInstance } from '@gmaps-kit/core';\n\nexport interface MarkerOptions {\n  position: google.maps.LatLngLiteral;\n  title?: string;\n  content?: HTMLElement;\n  draggable?: boolean;\n  clickable?: boolean;\n  zIndex?: number;\n  onClick?: () => void;\n  onDrag?: () => void;\n  onDragEnd?: () => void;\n}\n\nexport interface UseMarkersReturn {\n  markers: google.maps.marker.AdvancedMarkerElement[];\n  addMarker: (\n    options: MarkerOptions\n  ) => google.maps.marker.AdvancedMarkerElement;\n  removeMarker: (marker: google.maps.marker.AdvancedMarkerElement) => void;\n  updateMarker: (\n    marker: google.maps.marker.AdvancedMarkerElement,\n    options: Partial<MarkerOptions>\n  ) => void;\n  clearAllMarkers: () => void;\n  getMarkerPosition: (\n    marker: google.maps.marker.AdvancedMarkerElement\n  ) => google.maps.LatLngLiteral | null;\n}\n\nexport function useMarkers(mapInstance: MapInstance | null): UseMarkersReturn {\n  const [markers, setMarkers] = useState<\n    google.maps.marker.AdvancedMarkerElement[]\n  >([]);\n\n  const addMarkerToMap = useCallback(\n    (options: MarkerOptions): google.maps.marker.AdvancedMarkerElement => {\n      if (!mapInstance) {\n        throw new Error('Map instance is not available');\n      }\n\n      const marker = addMarker(mapInstance.map, {\n        position: options.position,\n        title: options.title,\n        content: options.content,\n        draggable: options.draggable,\n        clickable: options.clickable,\n        zIndex: options.zIndex,\n      });\n\n      // Add event listeners\n      if (options.onClick) {\n        addMarkerClickListener(marker, options.onClick);\n      }\n      if (options.onDrag) {\n        addMarkerDragListener(marker, options.onDrag);\n      }\n      if (options.onDragEnd) {\n        addMarkerDragEndListener(marker, options.onDragEnd);\n      }\n\n      setMarkers((prev) => [...prev, marker]);\n      return marker;\n    },\n    [mapInstance]\n  );\n\n  const removeMarkerFromMap = useCallback(\n    (marker: google.maps.marker.AdvancedMarkerElement) => {\n      removeMarker(marker);\n      setMarkers((prev) => prev.filter((m) => m !== marker));\n    },\n    []\n  );\n\n  const updateMarkerOnMap = useCallback(\n    (\n      marker: google.maps.marker.AdvancedMarkerElement,\n      options: Partial<MarkerOptions>\n    ) => {\n      if (options.position) {\n        updateMarkerPosition(marker, options.position);\n      }\n      if (options.content) {\n        updateMarkerContent(marker, options.content);\n      }\n      if (options.draggable !== undefined) {\n        setMarkerDraggable(marker, options.draggable);\n      }\n      // Note: setMarkerVisibility is not available in the core package\n      // You can use marker.visible directly if needed\n    },\n    []\n  );\n\n  const clearAllMarkersFromMap = useCallback(() => {\n    // Clear markers from the map by setting their map property to null\n    markers.forEach((marker) => {\n      marker.map = null;\n    });\n    setMarkers([]);\n  }, [markers]);\n\n  const getMarkerPositionFromMap = useCallback(\n    (marker: google.maps.marker.AdvancedMarkerElement) => {\n      return getMarkerPosition(marker);\n    },\n    []\n  );\n\n  // Clear markers when mapInstance becomes null\n  useEffect(() => {\n    if (!mapInstance) {\n      setMarkers([]);\n    }\n  }, [mapInstance]);\n\n  return {\n    markers,\n    addMarker: addMarkerToMap,\n    removeMarker: removeMarkerFromMap,\n    updateMarker: updateMarkerOnMap,\n    clearAllMarkers: clearAllMarkersFromMap,\n    getMarkerPosition: getMarkerPositionFromMap,\n  };\n}\n","import { useState, useCallback } from 'react';\nimport {\n  geocodeAsync,\n  reverseGeocodeAsync,\n  geocodeFirst,\n  reverseGeocodeFirst,\n  geocodeWithComponents,\n  geocodeWithBounds,\n  geocodeWithRegion,\n} from '@gmaps-kit/core';\n\nexport interface GeocodingResult {\n  address: string;\n  location: google.maps.LatLngLiteral;\n  placeId?: string;\n}\n\nexport interface UseGeocodingReturn {\n  isLoading: boolean;\n  error: Error | null;\n  geocode: (address: string) => Promise<GeocodingResult[]>;\n  geocodeFirst: (address: string) => Promise<GeocodingResult | null>;\n  reverseGeocode: (\n    location: google.maps.LatLngLiteral\n  ) => Promise<GeocodingResult[]>;\n  reverseGeocodeFirst: (\n    location: google.maps.LatLngLiteral\n  ) => Promise<GeocodingResult | null>;\n  geocodeWithComponents: (\n    address: string,\n    components: google.maps.GeocoderComponentRestrictions\n  ) => Promise<GeocodingResult[]>;\n  geocodeWithBounds: (\n    address: string,\n    bounds: google.maps.LatLngBounds\n  ) => Promise<GeocodingResult[]>;\n  geocodeWithRegion: (\n    address: string,\n    region: string\n  ) => Promise<GeocodingResult[]>;\n}\n\nexport function useGeocoding(): UseGeocodingReturn {\n  const [isLoading, setIsLoading] = useState(false);\n  const [error, setError] = useState<Error | null>(null);\n\n  const handleAsyncOperation = useCallback(\n    async <T>(operation: () => Promise<T>): Promise<T> => {\n      setIsLoading(true);\n      setError(null);\n\n      try {\n        const result = await operation();\n        return result;\n      } catch (err) {\n        const error =\n          err instanceof Error ? err : new Error('Geocoding operation failed');\n        setError(error);\n        throw error;\n      } finally {\n        setIsLoading(false);\n      }\n    },\n    []\n  );\n\n  const geocode = useCallback(\n    async (address: string): Promise<GeocodingResult[]> => {\n      return handleAsyncOperation(async () => {\n        const results = await geocodeAsync(address);\n        return results.map((result) => ({\n          address: result.address,\n          location: result.location,\n          placeId: result.placeId,\n        }));\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const geocodeFirstResult = useCallback(\n    async (address: string): Promise<GeocodingResult | null> => {\n      return handleAsyncOperation(async () => {\n        const result = await geocodeFirst(address);\n        if (!result) return null;\n\n        return {\n          address: result.address,\n          location: result.location,\n          placeId: result.placeId,\n        };\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const reverseGeocode = useCallback(\n    async (location: google.maps.LatLngLiteral): Promise<GeocodingResult[]> => {\n      return handleAsyncOperation(async () => {\n        const results = await reverseGeocodeAsync(location);\n        return results.map((result) => ({\n          address: result.address,\n          location: result.location,\n          placeId: result.placeId,\n        }));\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const reverseGeocodeFirstResult = useCallback(\n    async (\n      location: google.maps.LatLngLiteral\n    ): Promise<GeocodingResult | null> => {\n      return handleAsyncOperation(async () => {\n        const result = await reverseGeocodeFirst(location);\n        if (!result) return null;\n\n        return {\n          address: result.address,\n          location: result.location,\n          placeId: result.placeId,\n        };\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const geocodeWithComponentsResult = useCallback(\n    async (\n      address: string,\n      components: google.maps.GeocoderComponentRestrictions\n    ): Promise<GeocodingResult[]> => {\n      return handleAsyncOperation(async () => {\n        await geocodeWithComponents(address, components, () => {});\n        // Note: geocodeWithComponents returns void, so we need to use geocodeAsync instead\n        const results = await geocodeAsync(address);\n        return results.map((result) => ({\n          address: result.address,\n          location: result.location,\n          placeId: result.placeId,\n        }));\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const geocodeWithBoundsResult = useCallback(\n    async (\n      address: string,\n      bounds: google.maps.LatLngBounds\n    ): Promise<GeocodingResult[]> => {\n      return handleAsyncOperation(async () => {\n        await geocodeWithBounds(address, bounds, () => {});\n        // Note: geocodeWithBounds returns void, so we need to use geocodeAsync instead\n        const results = await geocodeAsync(address);\n        return results.map((result) => ({\n          address: result.address,\n          location: result.location,\n          placeId: result.placeId,\n        }));\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const geocodeWithRegionResult = useCallback(\n    async (address: string, region: string): Promise<GeocodingResult[]> => {\n      return handleAsyncOperation(async () => {\n        await geocodeWithRegion(address, region, () => {});\n        // Note: geocodeWithRegion returns void, so we need to use geocodeAsync instead\n        const results = await geocodeAsync(address);\n        return results.map((result) => ({\n          address: result.address,\n          location: result.location,\n          placeId: result.placeId,\n        }));\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  return {\n    isLoading,\n    error,\n    geocode,\n    geocodeFirst: geocodeFirstResult,\n    reverseGeocode,\n    reverseGeocodeFirst: reverseGeocodeFirstResult,\n    geocodeWithComponents: geocodeWithComponentsResult,\n    geocodeWithBounds: geocodeWithBoundsResult,\n    geocodeWithRegion: geocodeWithRegionResult,\n  };\n}\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type {\n  PlacesClientOptions,\n  PlacesFindPlaceRequest,\n  PlacesFindPlaceResponse,\n  PlacesTextSearchRequest,\n  PlacesTextSearchResponse,\n  PlacesNearbySearchRequest,\n  PlacesNearbySearchResponse,\n  PlacesDetailsRequest,\n  PlacesDetailsResponse,\n  PlacesAutocompleteRequest,\n  PlacesAutocompleteResponse,\n  PlacesQueryAutocompleteRequest,\n  PlacesQueryAutocompleteResponse,\n  PlacesPhotoOptions,\n} from '@gmaps-kit/core';\nimport { PlacesClient } from '@gmaps-kit/core';\nimport type { PlacesApiError } from '@gmaps-kit/core';\n\ntype PlacesOperationName =\n  | 'findPlaceFromText'\n  | 'textSearch'\n  | 'nearbySearch'\n  | 'placeDetails'\n  | 'autocomplete'\n  | 'queryAutocomplete'\n  | 'textSearchNextPage'\n  | 'nearbySearchNextPage';\n\nexport interface UsePlacesOptions extends PlacesClientOptions {}\n\ninterface PlacesHookState {\n  isLoading: boolean;\n  lastOperation: PlacesOperationName | null;\n  error: Error | null;\n}\n\nexport interface UsePlacesReturn {\n  client: PlacesClient;\n  isLoading: boolean;\n  error: Error | null;\n  lastOperation: PlacesOperationName | null;\n  findPlaceFromText: (\n    request: PlacesFindPlaceRequest\n  ) => Promise<PlacesFindPlaceResponse>;\n  textSearch: (\n    request: PlacesTextSearchRequest\n  ) => Promise<PlacesTextSearchResponse>;\n  nearbySearch: (\n    request: PlacesNearbySearchRequest\n  ) => Promise<PlacesNearbySearchResponse>;\n  placeDetails: (\n    request: PlacesDetailsRequest\n  ) => Promise<PlacesDetailsResponse>;\n  autocomplete: (\n    request: PlacesAutocompleteRequest\n  ) => Promise<PlacesAutocompleteResponse>;\n  queryAutocomplete: (\n    request: PlacesQueryAutocompleteRequest\n  ) => Promise<PlacesQueryAutocompleteResponse>;\n  textSearchNextPage: (\n    pagetoken: string,\n    delayMs?: number\n  ) => Promise<PlacesTextSearchResponse>;\n  nearbySearchNextPage: (\n    pagetoken: string,\n    delayMs?: number\n  ) => Promise<PlacesNearbySearchResponse>;\n  buildPhotoUrl: (\n    photoReference: string,\n    options?: PlacesPhotoOptions\n  ) => string;\n}\n\n/**\n * React hook that exposes a typed interface for the Google Places Web Service.\n * Consumers provide an API key and optionally a custom fetch implementation for server-side usage.\n */\nexport function usePlaces(options: UsePlacesOptions): UsePlacesReturn {\n  const { apiKey, baseUrl, fetchImpl, language, region, requestInit } = options;\n\n  const client = useMemo(\n    () =>\n      new PlacesClient({\n        apiKey,\n        baseUrl,\n        fetchImpl,\n        language,\n        region,\n        requestInit,\n      }),\n    [apiKey, baseUrl, fetchImpl, language, region, requestInit]\n  );\n\n  const isMountedRef = useRef(true);\n  useEffect(() => {\n    return () => {\n      isMountedRef.current = false;\n    };\n  }, []);\n\n  const [state, setState] = useState<PlacesHookState>({\n    isLoading: false,\n    lastOperation: null,\n    error: null,\n  });\n\n  const pendingCountRef = useRef(0);\n\n  const runWithState = useCallback(\n    async <T>(\n      operation: PlacesOperationName,\n      executor: () => Promise<T>\n    ): Promise<T> => {\n      pendingCountRef.current += 1;\n      if (isMountedRef.current) {\n        setState((previous) => ({\n          isLoading: true,\n          lastOperation: previous.lastOperation,\n          error: null,\n        }));\n      }\n\n      let capturedError: Error | null = null;\n\n      try {\n        return await executor();\n      } catch (error) {\n        capturedError = error as Error;\n        throw error;\n      } finally {\n        pendingCountRef.current = Math.max(0, pendingCountRef.current - 1);\n        if (isMountedRef.current) {\n          setState({\n            isLoading: pendingCountRef.current > 0,\n            lastOperation: operation,\n            error: capturedError,\n          });\n        }\n      }\n    },\n    []\n  );\n\n  const findPlaceFromText = useCallback(\n    (request: PlacesFindPlaceRequest) =>\n      runWithState('findPlaceFromText', () =>\n        client.findPlaceFromText(request)\n      ),\n    [client, runWithState]\n  );\n\n  const textSearch = useCallback(\n    (request: PlacesTextSearchRequest) =>\n      runWithState('textSearch', () => client.textSearch(request)),\n    [client, runWithState]\n  );\n\n  const nearbySearch = useCallback(\n    (request: PlacesNearbySearchRequest) =>\n      runWithState('nearbySearch', () => client.nearbySearch(request)),\n    [client, runWithState]\n  );\n\n  const placeDetails = useCallback(\n    (request: PlacesDetailsRequest) =>\n      runWithState('placeDetails', () => client.placeDetails(request)),\n    [client, runWithState]\n  );\n\n  const autocomplete = useCallback(\n    (request: PlacesAutocompleteRequest) =>\n      runWithState('autocomplete', () => client.autocomplete(request)),\n    [client, runWithState]\n  );\n\n  const queryAutocomplete = useCallback(\n    (request: PlacesQueryAutocompleteRequest) =>\n      runWithState('queryAutocomplete', () =>\n        client.queryAutocomplete(request)\n      ),\n    [client, runWithState]\n  );\n\n  const textSearchNextPage = useCallback(\n    (pagetoken: string, delayMs?: number) =>\n      runWithState('textSearchNextPage', () =>\n        client.textSearchNextPage(pagetoken, delayMs)\n      ),\n    [client, runWithState]\n  );\n\n  const nearbySearchNextPage = useCallback(\n    (pagetoken: string, delayMs?: number) =>\n      runWithState('nearbySearchNextPage', () =>\n        client.nearbySearchNextPage(pagetoken, delayMs)\n      ),\n    [client, runWithState]\n  );\n\n  const buildPhotoUrl = useCallback<UsePlacesReturn['buildPhotoUrl']>(\n    (photoReference, photoOptions) =>\n      client.buildPhotoUrl(photoReference, photoOptions),\n    [client]\n  );\n\n  return {\n    client,\n    isLoading: state.isLoading,\n    error: state.error,\n    lastOperation: state.lastOperation,\n    findPlaceFromText,\n    textSearch,\n    nearbySearch,\n    placeDetails,\n    autocomplete,\n    queryAutocomplete,\n    textSearchNextPage,\n    nearbySearchNextPage,\n    buildPhotoUrl,\n  };\n}\n\nexport type PlacesHookError = PlacesApiError;\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type {\n  PlacesNewClientOptions,\n  PlacesNewTextSearchRequest,\n  PlacesNewTextSearchResponse,\n  PlacesNewNearbySearchRequest,\n  PlacesNewNearbySearchResponse,\n  PlacesNewPlaceDetailsRequest,\n  PlacesNewPlaceDetailsResponse,\n  PlacesNewAutocompleteRequest,\n  PlacesNewAutocompleteResponse,\n  PlacesNewPhotoRequest,\n  PlacesNewPhotoResponse,\n} from '@gmaps-kit/core';\nimport { PlacesNewClient } from '@gmaps-kit/core';\nimport type { PlacesNewApiError } from '@gmaps-kit/core';\n\ntype PlacesNewOperationName =\n  | 'textSearch'\n  | 'nearbySearch'\n  | 'placeDetails'\n  | 'autocomplete'\n  | 'getPhoto';\n\nexport interface UsePlacesNewOptions extends PlacesNewClientOptions {}\n\ninterface PlacesNewHookState {\n  isLoading: boolean;\n  lastOperation: PlacesNewOperationName | null;\n  error: Error | null;\n}\n\nexport interface UsePlacesNewReturn {\n  client: PlacesNewClient;\n  isLoading: boolean;\n  error: Error | null;\n  lastOperation: PlacesNewOperationName | null;\n  textSearch: (\n    request: PlacesNewTextSearchRequest\n  ) => Promise<PlacesNewTextSearchResponse>;\n  nearbySearch: (\n    request: PlacesNewNearbySearchRequest\n  ) => Promise<PlacesNewNearbySearchResponse>;\n  placeDetails: (\n    request: PlacesNewPlaceDetailsRequest\n  ) => Promise<PlacesNewPlaceDetailsResponse>;\n  autocomplete: (\n    request: PlacesNewAutocompleteRequest\n  ) => Promise<PlacesNewAutocompleteResponse>;\n  getPhoto: (request: PlacesNewPhotoRequest) => Promise<PlacesNewPhotoResponse>;\n  buildPhotoUrl: (\n    photoName: string,\n    options?: { maxWidthPx?: number; maxHeightPx?: number }\n  ) => string;\n}\n\n/**\n * React hook that exposes a typed interface for the Google Places API (New).\n * This hook provides better CORS support and modern API features compared to the legacy Places API.\n * Consumers provide an API key and optionally a custom fetch implementation for server-side usage.\n */\nexport function usePlacesNew(options: UsePlacesNewOptions): UsePlacesNewReturn {\n  const { apiKey, baseUrl, fetchImpl, languageCode, regionCode, requestInit } =\n    options;\n\n  const client = useMemo(\n    () =>\n      new PlacesNewClient({\n        apiKey,\n        baseUrl,\n        fetchImpl,\n        languageCode,\n        regionCode,\n        requestInit,\n      }),\n    [apiKey, baseUrl, fetchImpl, languageCode, regionCode, requestInit]\n  );\n\n  const isMountedRef = useRef(true);\n  useEffect(() => {\n    return () => {\n      isMountedRef.current = false;\n    };\n  }, []);\n\n  const [state, setState] = useState<PlacesNewHookState>({\n    isLoading: false,\n    lastOperation: null,\n    error: null,\n  });\n\n  const pendingCountRef = useRef(0);\n\n  const runWithState = useCallback(\n    async <T>(\n      operation: PlacesNewOperationName,\n      executor: () => Promise<T>\n    ): Promise<T> => {\n      pendingCountRef.current += 1;\n      if (isMountedRef.current) {\n        setState((previous) => ({\n          isLoading: true,\n          lastOperation: previous.lastOperation,\n          error: null,\n        }));\n      }\n\n      let capturedError: Error | null = null;\n\n      try {\n        return await executor();\n      } catch (error) {\n        capturedError = error as Error;\n        throw error;\n      } finally {\n        pendingCountRef.current = Math.max(0, pendingCountRef.current - 1);\n        if (isMountedRef.current) {\n          setState({\n            isLoading: pendingCountRef.current > 0,\n            lastOperation: operation,\n            error: capturedError,\n          });\n        }\n      }\n    },\n    []\n  );\n\n  const textSearch = useCallback(\n    (request: PlacesNewTextSearchRequest) =>\n      runWithState('textSearch', () => client.textSearch(request)),\n    [client, runWithState]\n  );\n\n  const nearbySearch = useCallback(\n    (request: PlacesNewNearbySearchRequest) =>\n      runWithState('nearbySearch', () => client.nearbySearch(request)),\n    [client, runWithState]\n  );\n\n  const placeDetails = useCallback(\n    (request: PlacesNewPlaceDetailsRequest) =>\n      runWithState('placeDetails', () => client.placeDetails(request)),\n    [client, runWithState]\n  );\n\n  const autocomplete = useCallback(\n    (request: PlacesNewAutocompleteRequest) =>\n      runWithState('autocomplete', () => client.autocomplete(request)),\n    [client, runWithState]\n  );\n\n  const getPhoto = useCallback(\n    (request: PlacesNewPhotoRequest) =>\n      runWithState('getPhoto', () => client.getPhoto(request)),\n    [client, runWithState]\n  );\n\n  const buildPhotoUrl = useCallback<UsePlacesNewReturn['buildPhotoUrl']>(\n    (photoName, photoOptions) => client.buildPhotoUrl(photoName, photoOptions),\n    [client]\n  );\n\n  return {\n    client,\n    isLoading: state.isLoading,\n    error: state.error,\n    lastOperation: state.lastOperation,\n    textSearch,\n    nearbySearch,\n    placeDetails,\n    autocomplete,\n    getPhoto,\n    buildPhotoUrl,\n  };\n}\n\nexport type PlacesNewHookError = PlacesNewApiError;\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type {\n  GeocodingClientOptions,\n  GeocodeRequest,\n  ReverseGeocodeRequest,\n  GeocodingResponse,\n} from '@gmaps-kit/core';\nimport { GeocodingClient } from '@gmaps-kit/core';\nimport type { GeocodingApiError } from '@gmaps-kit/core';\n\ntype GeocodingOperation = 'geocode' | 'reverseGeocode';\n\nexport interface UseGeocodingServiceOptions extends GeocodingClientOptions {}\n\ninterface GeocodingServiceState {\n  isLoading: boolean;\n  lastOperation: GeocodingOperation | null;\n  error: Error | null;\n}\n\nexport interface UseGeocodingServiceReturn {\n  client: GeocodingClient;\n  isLoading: boolean;\n  error: Error | null;\n  lastOperation: GeocodingOperation | null;\n  geocode: (request: GeocodeRequest) => Promise<GeocodingResponse>;\n  reverseGeocode: (\n    request: ReverseGeocodeRequest\n  ) => Promise<GeocodingResponse>;\n}\n\nexport function useGeocodingService(\n  options: UseGeocodingServiceOptions\n): UseGeocodingServiceReturn {\n  const {\n    apiKey,\n    baseUrl,\n    fetchImpl,\n    language,\n    region,\n    channel,\n    timeoutMs,\n    requestInit,\n    retryConfig,\n  } = options;\n\n  const client = useMemo(\n    () =>\n      new GeocodingClient({\n        apiKey,\n        baseUrl,\n        fetchImpl,\n        language,\n        region,\n        channel,\n        timeoutMs,\n        requestInit,\n        retryConfig,\n      }),\n    [\n      apiKey,\n      baseUrl,\n      fetchImpl,\n      language,\n      region,\n      channel,\n      timeoutMs,\n      requestInit,\n      retryConfig?.retries,\n      retryConfig?.delayMs,\n      retryConfig?.backoffFactor,\n      retryConfig?.retryStatuses && retryConfig.retryStatuses.join(','),\n    ]\n  );\n\n  const isMountedRef = useRef(true);\n  useEffect(() => {\n    return () => {\n      isMountedRef.current = false;\n    };\n  }, []);\n\n  const [state, setState] = useState<GeocodingServiceState>({\n    isLoading: false,\n    lastOperation: null,\n    error: null,\n  });\n\n  const runWithState = useCallback(\n    async (\n      operation: GeocodingOperation,\n      executor: () => Promise<GeocodingResponse>\n    ): Promise<GeocodingResponse> => {\n      if (isMountedRef.current) {\n        setState({ isLoading: true, lastOperation: operation, error: null });\n      }\n\n      try {\n        const result = await executor();\n        if (isMountedRef.current) {\n          setState({ isLoading: false, lastOperation: operation, error: null });\n        }\n        return result;\n      } catch (error) {\n        if (isMountedRef.current) {\n          setState({\n            isLoading: false,\n            lastOperation: operation,\n            error: error as Error,\n          });\n        }\n        throw error;\n      }\n    },\n    []\n  );\n\n  const geocode = useCallback(\n    (request: GeocodeRequest) =>\n      runWithState('geocode', () => client.geocode(request)),\n    [client, runWithState]\n  );\n\n  const reverseGeocode = useCallback(\n    (request: ReverseGeocodeRequest) =>\n      runWithState('reverseGeocode', () => client.reverseGeocode(request)),\n    [client, runWithState]\n  );\n\n  return {\n    client,\n    isLoading: state.isLoading,\n    error: state.error,\n    lastOperation: state.lastOperation,\n    geocode,\n    reverseGeocode,\n  };\n}\n\nexport type GeocodingServiceHookError = GeocodingApiError;\n","import { useCallback, useEffect, useMemo, useState } from 'react';\nimport {\n  createStreetViewPanorama,\n  setStreetViewPosition,\n  getStreetViewPosition,\n  setStreetViewPov,\n  getStreetViewPov,\n  setStreetViewVisibility,\n  isStreetViewVisible,\n} from '@gmaps-kit/core';\nimport type {\n  StreetViewOptions,\n  StreetViewEventHandlers,\n  StreetViewInstance,\n} from '@gmaps-kit/core';\n\nexport interface UseStreetViewOptions extends StreetViewOptions {\n  eventHandlers?: StreetViewEventHandlers;\n}\n\nexport interface UseStreetViewReturn {\n  instance: StreetViewInstance | null;\n  isReady: boolean;\n  setPosition: (position: google.maps.LatLngLiteral) => void;\n  getPosition: () => google.maps.LatLngLiteral | null;\n  setPov: (pov: google.maps.StreetViewPov) => void;\n  getPov: () => google.maps.StreetViewPov | null;\n  setVisible: (visible: boolean) => void;\n  isVisible: () => boolean;\n}\n\nexport function useStreetView(\n  containerId: string,\n  options: UseStreetViewOptions = {}\n): UseStreetViewReturn {\n  const [instance, setInstance] = useState<StreetViewInstance | null>(null);\n  const [isReady, setReady] = useState(false);\n\n  const memoizedHandlers = useMemo(\n    () => options.eventHandlers,\n    [options.eventHandlers]\n  );\n\n  const initialize = useCallback(() => {\n    if (!containerId || instance) return;\n\n    try {\n      const panorama = createStreetViewPanorama(\n        containerId,\n        options,\n        memoizedHandlers\n      );\n      setInstance(panorama);\n      setReady(true);\n    } catch (error) {\n      console.error('Failed to initialize Street View panorama:', error);\n    }\n  }, [containerId, instance, options, memoizedHandlers]);\n\n  useEffect(() => {\n    initialize();\n  }, [initialize]);\n\n  const setPosition = useCallback(\n    (position: google.maps.LatLngLiteral) => {\n      if (instance) {\n        setStreetViewPosition(instance.panorama, position);\n      }\n    },\n    [instance]\n  );\n\n  const getPosition = useCallback(() => {\n    if (!instance) return null;\n    return getStreetViewPosition(instance.panorama);\n  }, [instance]);\n\n  const setPov = useCallback(\n    (pov: google.maps.StreetViewPov) => {\n      if (instance) {\n        setStreetViewPov(instance.panorama, pov);\n      }\n    },\n    [instance]\n  );\n\n  const getPov = useCallback(() => {\n    if (!instance) return null;\n    return getStreetViewPov(instance.panorama);\n  }, [instance]);\n\n  const setVisible = useCallback(\n    (visible: boolean) => {\n      if (instance) {\n        setStreetViewVisibility(instance.panorama, visible);\n      }\n    },\n    [instance]\n  );\n\n  const isVisible = useCallback(() => {\n    if (!instance) return false;\n    return isStreetViewVisible(instance.panorama);\n  }, [instance]);\n\n  return {\n    instance,\n    isReady,\n    setPosition,\n    getPosition,\n    setPov,\n    getPov,\n    setVisible,\n    isVisible,\n  };\n}\n","import { useState, useCallback, useEffect } from 'react';\n\nexport interface BicyclingOptions {\n  map?: google.maps.Map;\n  autoRefresh?: boolean;\n  autoRefreshInterval?: number;\n}\n\nexport interface UseBicyclingReturn {\n  isLoading: boolean;\n  error: Error | null;\n  bicyclingLayer: google.maps.BicyclingLayer | null;\n  isVisible: boolean;\n  createBicyclingLayer: (\n    options?: BicyclingOptions\n  ) => google.maps.BicyclingLayer;\n  showBicycling: () => void;\n  hideBicycling: () => void;\n  toggleBicycling: () => void;\n  refreshBicycling: () => void;\n  removeBicyclingLayer: () => void;\n}\n\nexport function useBicycling(): UseBicyclingReturn {\n  const [isLoading] = useState(false);\n  const [error] = useState<Error | null>(null);\n  const [bicyclingLayer, setBicyclingLayer] =\n    useState<google.maps.BicyclingLayer | null>(null);\n  const [isVisible, setIsVisible] = useState(false);\n\n  const createBicyclingLayer = useCallback(\n    (options?: BicyclingOptions): google.maps.BicyclingLayer => {\n      const bicycling = new google.maps.BicyclingLayer();\n\n      if (options?.map) {\n        bicycling.setMap(options.map);\n        setIsVisible(true);\n      }\n\n      setBicyclingLayer(bicycling);\n      return bicycling;\n    },\n    []\n  );\n\n  const showBicycling = useCallback(() => {\n    if (bicyclingLayer) {\n      bicyclingLayer.setMap(bicyclingLayer.getMap());\n      setIsVisible(true);\n    }\n  }, [bicyclingLayer]);\n\n  const hideBicycling = useCallback(() => {\n    if (bicyclingLayer) {\n      bicyclingLayer.setMap(null);\n      setIsVisible(false);\n    }\n  }, [bicyclingLayer]);\n\n  const toggleBicycling = useCallback(() => {\n    if (isVisible) {\n      hideBicycling();\n    } else {\n      showBicycling();\n    }\n  }, [isVisible, showBicycling, hideBicycling]);\n\n  const refreshBicycling = useCallback(() => {\n    if (bicyclingLayer) {\n      // Bicycling layer automatically refreshes, but we can trigger a refresh\n      // by temporarily hiding and showing it\n      const currentMap = bicyclingLayer.getMap();\n      if (currentMap) {\n        bicyclingLayer.setMap(null);\n        setTimeout(() => {\n          bicyclingLayer.setMap(currentMap);\n        }, 100);\n      }\n    }\n  }, [bicyclingLayer]);\n\n  const removeBicyclingLayer = useCallback(() => {\n    if (bicyclingLayer) {\n      bicyclingLayer.setMap(null);\n      setBicyclingLayer(null);\n      setIsVisible(false);\n    }\n  }, [bicyclingLayer]);\n\n  // Cleanup on unmount\n  useEffect(() => {\n    return () => {\n      if (bicyclingLayer) {\n        bicyclingLayer.setMap(null);\n      }\n    };\n  }, [bicyclingLayer]);\n\n  return {\n    isLoading,\n    error,\n    bicyclingLayer,\n    isVisible,\n    createBicyclingLayer,\n    showBicycling,\n    hideBicycling,\n    toggleBicycling,\n    refreshBicycling,\n    removeBicyclingLayer,\n  };\n}\n","import { useState, useCallback, useEffect } from 'react';\nimport { MapInstance } from '@gmaps-kit/core';\n\n// Type definitions for MarkerClusterer (external library)\ndeclare global {\n  namespace google.maps {\n    interface MarkerClustererOptions {\n      gridSize?: number;\n      maxZoom?: number;\n      minimumClusterSize?: number;\n      averageCenter?: boolean;\n      ignoreHidden?: boolean;\n      enableRetinaIcons?: boolean;\n      styles?: ClusterIconStyle[];\n      imagePath?: string;\n      imageExtension?: string;\n      zoomOnClick?: boolean;\n    }\n\n    interface ClusterIconStyle {\n      url: string;\n      height: number;\n      width: number;\n      anchor?: number[] | google.maps.Point;\n      textColor?: string;\n      textSize?: number;\n      backgroundPosition?: string;\n    }\n\n    class MarkerClusterer {\n      constructor(\n        map: google.maps.Map,\n        markers?: google.maps.Marker[],\n        options?: MarkerClustererOptions\n      );\n      addMarker(marker: google.maps.Marker): void;\n      addMarkers(markers: google.maps.Marker[]): void;\n      removeMarker(marker: google.maps.Marker): void;\n      removeMarkers(markers: google.maps.Marker[]): void;\n      clearMarkers(): void;\n      redraw(): void;\n      getMarkers(): google.maps.Marker[];\n      getTotalMarkers(): number;\n      getTotalClusters(): number;\n    }\n  }\n}\n\nexport interface ClusterOptions {\n  gridSize?: number;\n  maxZoom?: number;\n  minimumClusterSize?: number;\n  averageCenter?: boolean;\n  ignoreHidden?: boolean;\n  enableRetinaIcons?: boolean;\n  styles?: google.maps.ClusterIconStyle[];\n  imagePath?: string;\n  imageExtension?: string;\n  zoomOnClick?: boolean;\n}\n\nexport interface ClusterMarker {\n  position: google.maps.LatLngLiteral;\n  title?: string;\n  data?: any;\n}\n\nexport interface UseClusteringReturn {\n  clusterer: google.maps.MarkerClusterer | null;\n  isReady: boolean;\n  createClusterer: (\n    mapInstance: MapInstance,\n    markers: google.maps.Marker[],\n    options?: ClusterOptions\n  ) => google.maps.MarkerClusterer;\n  addMarkersToCluster: (markers: google.maps.Marker[]) => void;\n  removeMarkersFromCluster: (markers: google.maps.Marker[]) => void;\n  clearCluster: () => void;\n  redrawCluster: () => void;\n  getClusterer: () => google.maps.MarkerClusterer | null;\n  getTotalMarkers: () => number;\n  getTotalClusters: () => number;\n  getMarkers: () => google.maps.Marker[];\n}\n\n/**\n * Check if MarkerClusterer library is loaded\n */\nexport function isMarkerClustererLoaded(): boolean {\n  return typeof (google.maps as any).MarkerClusterer !== 'undefined';\n}\n\nexport function useClustering(): UseClusteringReturn {\n  const [clusterer, setClusterer] =\n    useState<google.maps.MarkerClusterer | null>(null);\n  const [isReady, setIsReady] = useState(false);\n\n  const createClusterer = useCallback(\n    (\n      mapInstance: MapInstance,\n      markers: google.maps.Marker[],\n      options: ClusterOptions = {}\n    ): google.maps.MarkerClusterer => {\n      // Check if MarkerClusterer is available\n      if (!isMarkerClustererLoaded()) {\n        throw new Error(\n          'MarkerClusterer library is not loaded. Please include the markerclusterer library from https://github.com/googlemaps/js-markerclusterer.'\n        );\n      }\n\n      const clustererOptions: google.maps.MarkerClustererOptions = {\n        gridSize: options.gridSize || 60,\n        maxZoom: options.maxZoom || 15,\n        minimumClusterSize: options.minimumClusterSize || 2,\n        averageCenter: options.averageCenter || false,\n        ignoreHidden: options.ignoreHidden || false,\n        enableRetinaIcons: options.enableRetinaIcons || false,\n        styles: options.styles,\n        imagePath: options.imagePath,\n        imageExtension: options.imageExtension || 'png',\n        zoomOnClick: options.zoomOnClick !== false,\n      };\n\n      const newClusterer = new (google.maps as any).MarkerClusterer(\n        mapInstance.map,\n        markers,\n        clustererOptions\n      );\n\n      setClusterer(newClusterer);\n      setIsReady(true);\n\n      return newClusterer;\n    },\n    []\n  );\n\n  const addMarkersToCluster = useCallback(\n    (markers: google.maps.Marker[]) => {\n      if (!clusterer) {\n        throw new Error('Clusterer is not initialized');\n      }\n\n      clusterer.addMarkers(markers);\n    },\n    [clusterer]\n  );\n\n  const removeMarkersFromCluster = useCallback(\n    (markers: google.maps.Marker[]) => {\n      if (!clusterer) {\n        throw new Error('Clusterer is not initialized');\n      }\n\n      clusterer.removeMarkers(markers);\n    },\n    [clusterer]\n  );\n\n  const clearCluster = useCallback(() => {\n    if (!clusterer) {\n      throw new Error('Clusterer is not initialized');\n    }\n\n    clusterer.clearMarkers();\n  }, [clusterer]);\n\n  const redrawCluster = useCallback(() => {\n    if (!clusterer) {\n      throw new Error('Clusterer is not initialized');\n    }\n\n    clusterer.redraw();\n  }, [clusterer]);\n\n  const getClusterer = useCallback((): google.maps.MarkerClusterer | null => {\n    return clusterer;\n  }, [clusterer]);\n\n  const getTotalMarkers = useCallback((): number => {\n    if (!clusterer) {\n      return 0;\n    }\n    return clusterer.getTotalMarkers();\n  }, [clusterer]);\n\n  const getTotalClusters = useCallback((): number => {\n    if (!clusterer) {\n      return 0;\n    }\n    return clusterer.getTotalClusters();\n  }, [clusterer]);\n\n  const getMarkers = useCallback((): google.maps.Marker[] => {\n    if (!clusterer) {\n      return [];\n    }\n    return clusterer.getMarkers();\n  }, [clusterer]);\n\n  // Cleanup on unmount\n  useEffect(() => {\n    return () => {\n      if (clusterer) {\n        clusterer.clearMarkers();\n      }\n    };\n  }, [clusterer]);\n\n  return {\n    clusterer,\n    isReady,\n    createClusterer,\n    addMarkersToCluster,\n    removeMarkersFromCluster,\n    clearCluster,\n    redrawCluster,\n    getClusterer,\n    getTotalMarkers,\n    getTotalClusters,\n    getMarkers,\n  };\n}\n","import { useState, useCallback } from 'react';\nimport {\n  getTotalDistance,\n  getTotalDuration,\n  getDirectionsBounds,\n  fitMapToRoute,\n  createDirectionsRenderer,\n} from '@gmaps-kit/core';\nimport { MapInstance } from '@gmaps-kit/core';\n\nexport interface DirectionsRequest {\n  origin: string | google.maps.LatLngLiteral;\n  destination: string | google.maps.LatLngLiteral;\n  travelMode?: google.maps.TravelMode;\n  waypoints?: google.maps.DirectionsWaypoint[];\n  optimizeWaypoints?: boolean;\n  avoidHighways?: boolean;\n  avoidTolls?: boolean;\n  region?: string;\n}\n\nexport interface DirectionsResult {\n  directions: google.maps.DirectionsResult | null;\n  distance: number; // in meters\n  duration: number; // in seconds\n  bounds: google.maps.LatLngBounds | null;\n  renderer: google.maps.DirectionsRenderer | null;\n}\n\nexport interface UseDirectionsReturn {\n  isLoading: boolean;\n  error: Error | null;\n  result: DirectionsResult | null;\n  getDirections: (request: DirectionsRequest) => Promise<DirectionsResult>;\n  renderDirections: (mapInstance: MapInstance) => void;\n  clearDirectionsFromMap: () => void;\n  fitMapToRoute: (mapInstance: MapInstance) => void;\n}\n\nexport function useDirections(): UseDirectionsReturn {\n  const [isLoading, setIsLoading] = useState(false);\n  const [error, setError] = useState<Error | null>(null);\n  const [result, setResult] = useState<DirectionsResult | null>(null);\n\n  const handleAsyncOperation = useCallback(\n    async <T>(operation: () => Promise<T>): Promise<T> => {\n      setIsLoading(true);\n      setError(null);\n\n      try {\n        const data = await operation();\n        return data;\n      } catch (err) {\n        const error =\n          err instanceof Error ? err : new Error('Directions operation failed');\n        setError(error);\n        throw error;\n      } finally {\n        setIsLoading(false);\n      }\n    },\n    []\n  );\n\n  const getDirections = useCallback(\n    async (request: DirectionsRequest): Promise<DirectionsResult> => {\n      return handleAsyncOperation(async () => {\n        // Create a custom request that includes region if provided\n        const directionsRequest: google.maps.DirectionsRequest = {\n          origin: request.origin,\n          destination: request.destination,\n          travelMode: request.travelMode || google.maps.TravelMode.DRIVING,\n          waypoints: request.waypoints,\n          optimizeWaypoints: request.optimizeWaypoints,\n          avoidHighways: request.avoidHighways,\n          avoidTolls: request.avoidTolls,\n          ...(request.region && { region: request.region }),\n        };\n\n        // Use the DirectionsService directly to support region parameter\n        const directionsService = new google.maps.DirectionsService();\n        const directions = await new Promise<google.maps.DirectionsResult>(\n          (resolve, reject) => {\n            directionsService.route(directionsRequest, (result, status) => {\n              if (status === google.maps.DirectionsStatus.OK && result) {\n                resolve(result);\n              } else {\n                reject(new Error(`Directions request failed: ${status}`));\n              }\n            });\n          }\n        );\n\n        const distance = getTotalDistance(directions);\n        const duration = getTotalDuration(directions);\n        const bounds = getDirectionsBounds(directions);\n        // Note: renderer will be created when needed with mapInstance\n        const renderer = null;\n\n        const directionsResult: DirectionsResult = {\n          directions,\n          distance,\n          duration,\n          bounds,\n          renderer,\n        };\n\n        setResult(directionsResult);\n        return directionsResult;\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const renderDirectionsOnMap = useCallback(\n    (mapInstance: MapInstance) => {\n      if (!result?.directions) {\n        throw new Error('No directions result available');\n      }\n\n      const renderer = createDirectionsRenderer(mapInstance);\n      renderer.setDirections(result.directions);\n    },\n    [result]\n  );\n\n  const clearDirectionsFromMap = useCallback(() => {\n    // Note: This would need to be called with the specific renderer instance\n    // For now, this is a placeholder function\n    console.log('Clear directions from map - renderer needs to be passed');\n  }, []);\n\n  const fitMapToRouteBounds = useCallback(\n    (mapInstance: MapInstance) => {\n      if (!result?.directions) {\n        throw new Error('No directions result available');\n      }\n\n      fitMapToRoute(mapInstance.map, result.directions);\n    },\n    [result]\n  );\n\n  return {\n    isLoading,\n    error,\n    result,\n    getDirections,\n    renderDirections: renderDirectionsOnMap,\n    clearDirectionsFromMap,\n    fitMapToRoute: fitMapToRouteBounds,\n  };\n}\n","import { useState, useCallback } from 'react';\nimport {\n  getDistanceMatrixAsync,\n  createDistanceMatrixService,\n  DistanceMatrixOptions,\n  DistanceMatrixResult as CoreDistanceMatrixResult,\n  MapInstance,\n} from '@gmaps-kit/core';\n\nexport interface DistanceMatrixRequest extends DistanceMatrixOptions {\n  // Extended interface for React hook\n}\n\nexport interface DistanceMatrixResult {\n  results: CoreDistanceMatrixResult[];\n  origins: (string | google.maps.LatLngLiteral)[];\n  destinations: (string | google.maps.LatLngLiteral)[];\n  service: google.maps.DistanceMatrixService | null;\n}\n\nexport interface UseDistanceMatrixReturn {\n  isLoading: boolean;\n  error: Error | null;\n  result: DistanceMatrixResult | null;\n  getDistanceMatrix: (\n    request: DistanceMatrixRequest\n  ) => Promise<DistanceMatrixResult>;\n  createService: (\n    mapInstance: MapInstance\n  ) => google.maps.DistanceMatrixService;\n}\n\nexport function useDistanceMatrix(): UseDistanceMatrixReturn {\n  const [isLoading, setIsLoading] = useState(false);\n  const [error, setError] = useState<Error | null>(null);\n  const [result, setResult] = useState<DistanceMatrixResult | null>(null);\n\n  const handleAsyncOperation = useCallback(\n    async <T>(operation: () => Promise<T>): Promise<T> => {\n      setIsLoading(true);\n      setError(null);\n\n      try {\n        const data = await operation();\n        return data;\n      } catch (err) {\n        const error =\n          err instanceof Error\n            ? err\n            : new Error('Distance matrix operation failed');\n        setError(error);\n        throw error;\n      } finally {\n        setIsLoading(false);\n      }\n    },\n    []\n  );\n\n  const getDistanceMatrix = useCallback(\n    async (request: DistanceMatrixRequest): Promise<DistanceMatrixResult> => {\n      return handleAsyncOperation(async () => {\n        const results = await getDistanceMatrixAsync({\n          origins: request.origins,\n          destinations: request.destinations,\n          travelMode: request.travelMode,\n          avoidHighways: request.avoidHighways,\n          avoidTolls: request.avoidTolls,\n          unitSystem: request.unitSystem,\n        });\n\n        const distanceMatrixResult: DistanceMatrixResult = {\n          results,\n          origins: request.origins,\n          destinations: request.destinations,\n          service: null,\n        };\n\n        setResult(distanceMatrixResult);\n        return distanceMatrixResult;\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const createService = useCallback(\n    (mapInstance: MapInstance): google.maps.DistanceMatrixService => {\n      return createDistanceMatrixService(mapInstance);\n    },\n    []\n  );\n\n  return {\n    isLoading,\n    error,\n    result,\n    getDistanceMatrix,\n    createService,\n  };\n}\n","import { useState, useCallback } from 'react';\n\nexport interface ElevationRequest {\n  locations: google.maps.LatLngLiteral[] | google.maps.LatLng[];\n  path?: google.maps.LatLngLiteral[] | google.maps.LatLng[];\n  samples?: number;\n}\n\nexport interface ElevationResult {\n  elevation: number;\n  resolution: number;\n  location: google.maps.LatLngLiteral;\n}\n\nexport interface UseElevationReturn {\n  isLoading: boolean;\n  error: Error | null;\n  results: ElevationResult[] | null;\n  getElevationForLocations: (\n    request: ElevationRequest\n  ) => Promise<ElevationResult[]>;\n  getElevationAlongPath: (\n    request: ElevationRequest\n  ) => Promise<ElevationResult[]>;\n  createElevationService: () => google.maps.ElevationService;\n}\n\nexport function useElevation(): UseElevationReturn {\n  const [isLoading, setIsLoading] = useState(false);\n  const [error, setError] = useState<Error | null>(null);\n  const [results, setResults] = useState<ElevationResult[] | null>(null);\n\n  const handleAsyncOperation = useCallback(\n    async <T>(operation: () => Promise<T>): Promise<T> => {\n      setIsLoading(true);\n      setError(null);\n\n      try {\n        const data = await operation();\n        return data;\n      } catch (err) {\n        const error =\n          err instanceof Error ? err : new Error('Elevation operation failed');\n        setError(error);\n        throw error;\n      } finally {\n        setIsLoading(false);\n      }\n    },\n    []\n  );\n\n  const getElevationForLocations = useCallback(\n    async (request: ElevationRequest): Promise<ElevationResult[]> => {\n      return handleAsyncOperation(async () => {\n        const elevationService = new google.maps.ElevationService();\n\n        const elevationRequest: google.maps.LocationElevationRequest = {\n          locations: request.locations,\n        };\n\n        const results = await new Promise<google.maps.ElevationResult[]>(\n          (resolve, reject) => {\n            elevationService.getElevationForLocations(\n              elevationRequest,\n              (results, status) => {\n                if (status === google.maps.ElevationStatus.OK && results) {\n                  resolve(results);\n                } else {\n                  reject(new Error(`Elevation request failed: ${status}`));\n                }\n              }\n            );\n          }\n        );\n\n        const elevationResults: ElevationResult[] = results.map((result) => ({\n          elevation: result.elevation,\n          resolution: result.resolution,\n          location: {\n            lat: result.location?.lat() || 0,\n            lng: result.location?.lng() || 0,\n          },\n        }));\n\n        setResults(elevationResults);\n        return elevationResults;\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const getElevationAlongPath = useCallback(\n    async (request: ElevationRequest): Promise<ElevationResult[]> => {\n      return handleAsyncOperation(async () => {\n        if (!request.path) {\n          throw new Error('Path is required for elevation along path');\n        }\n\n        const elevationService = new google.maps.ElevationService();\n\n        const elevationRequest: google.maps.PathElevationRequest = {\n          path: request.path,\n          samples: request.samples || 256,\n        };\n\n        const results = await new Promise<google.maps.ElevationResult[]>(\n          (resolve, reject) => {\n            elevationService.getElevationAlongPath(\n              elevationRequest,\n              (results, status) => {\n                if (status === google.maps.ElevationStatus.OK && results) {\n                  resolve(results);\n                } else {\n                  reject(new Error(`Elevation request failed: ${status}`));\n                }\n              }\n            );\n          }\n        );\n\n        const elevationResults: ElevationResult[] = results.map((result) => ({\n          elevation: result.elevation,\n          resolution: result.resolution,\n          location: {\n            lat: result.location?.lat() || 0,\n            lng: result.location?.lng() || 0,\n          },\n        }));\n\n        setResults(elevationResults);\n        return elevationResults;\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const createElevationService =\n    useCallback((): google.maps.ElevationService => {\n      return new google.maps.ElevationService();\n    }, []);\n\n  return {\n    isLoading,\n    error,\n    results,\n    getElevationForLocations,\n    getElevationAlongPath,\n    createElevationService,\n  };\n}\n","import { useState, useCallback } from 'react';\n\nexport interface GeometryCalculation {\n  distance: number;\n  bearing: number;\n  heading: number;\n  area: number;\n  perimeter: number;\n}\n\nexport interface UseGeometryReturn {\n  isLoading: boolean;\n  error: Error | null;\n  results: GeometryCalculation | null;\n  computeDistanceBetween: (\n    from: google.maps.LatLngLiteral,\n    to: google.maps.LatLngLiteral\n  ) => number;\n  computeHeading: (\n    from: google.maps.LatLngLiteral,\n    to: google.maps.LatLngLiteral\n  ) => number;\n  computeOffset: (\n    from: google.maps.LatLngLiteral,\n    distance: number,\n    heading: number\n  ) => google.maps.LatLngLiteral;\n  computeOffsetOrigin: (\n    to: google.maps.LatLngLiteral,\n    distance: number,\n    heading: number\n  ) => google.maps.LatLngLiteral;\n  computeLength: (path: google.maps.LatLngLiteral[]) => number;\n  computeArea: (path: google.maps.LatLngLiteral[]) => number;\n  computeBounds: (\n    path: google.maps.LatLngLiteral[]\n  ) => google.maps.LatLngBounds;\n  computeCenter: (\n    path: google.maps.LatLngLiteral[]\n  ) => google.maps.LatLngLiteral;\n  isLocationOnEdge: (\n    point: google.maps.LatLngLiteral,\n    polyline: google.maps.LatLngLiteral[],\n    tolerance?: number\n  ) => boolean;\n  encodePath: (path: google.maps.LatLngLiteral[]) => string;\n  decodePath: (encodedPath: string) => google.maps.LatLngLiteral[];\n  spherical: typeof google.maps.geometry.spherical;\n  encoding: typeof google.maps.geometry.encoding;\n  poly: typeof google.maps.geometry.poly;\n}\n\nexport function useGeometry(): UseGeometryReturn {\n  const [isLoading] = useState(false);\n  const [error] = useState<Error | null>(null);\n  const [results] = useState<GeometryCalculation | null>(null);\n\n  const computeDistanceBetween = useCallback(\n    (\n      from: google.maps.LatLngLiteral,\n      to: google.maps.LatLngLiteral\n    ): number => {\n      return google.maps.geometry.spherical.computeDistanceBetween(\n        new google.maps.LatLng(from.lat, from.lng),\n        new google.maps.LatLng(to.lat, to.lng)\n      );\n    },\n    []\n  );\n\n  const computeHeading = useCallback(\n    (\n      from: google.maps.LatLngLiteral,\n      to: google.maps.LatLngLiteral\n    ): number => {\n      return google.maps.geometry.spherical.computeHeading(\n        new google.maps.LatLng(from.lat, from.lng),\n        new google.maps.LatLng(to.lat, to.lng)\n      );\n    },\n    []\n  );\n\n  const computeOffset = useCallback(\n    (\n      from: google.maps.LatLngLiteral,\n      distance: number,\n      heading: number\n    ): google.maps.LatLngLiteral => {\n      const offset = google.maps.geometry.spherical.computeOffset(\n        new google.maps.LatLng(from.lat, from.lng),\n        distance,\n        heading\n      );\n      return { lat: offset.lat(), lng: offset.lng() };\n    },\n    []\n  );\n\n  const computeOffsetOrigin = useCallback(\n    (\n      to: google.maps.LatLngLiteral,\n      distance: number,\n      heading: number\n    ): google.maps.LatLngLiteral => {\n      const origin = google.maps.geometry.spherical.computeOffsetOrigin(\n        new google.maps.LatLng(to.lat, to.lng),\n        distance,\n        heading\n      );\n      if (!origin) {\n        throw new Error('Could not compute offset origin');\n      }\n      return { lat: origin.lat(), lng: origin.lng() };\n    },\n    []\n  );\n\n  const computeLength = useCallback(\n    (path: google.maps.LatLngLiteral[]): number => {\n      const latLngPath = path.map(\n        (point) => new google.maps.LatLng(point.lat, point.lng)\n      );\n      return google.maps.geometry.spherical.computeLength(latLngPath);\n    },\n    []\n  );\n\n  const computeArea = useCallback(\n    (path: google.maps.LatLngLiteral[]): number => {\n      const latLngPath = path.map(\n        (point) => new google.maps.LatLng(point.lat, point.lng)\n      );\n      return google.maps.geometry.spherical.computeArea(latLngPath);\n    },\n    []\n  );\n\n  const computeBounds = useCallback(\n    (path: google.maps.LatLngLiteral[]): google.maps.LatLngBounds => {\n      if (path.length === 0) {\n        return new google.maps.LatLngBounds();\n      }\n\n      const bounds = new google.maps.LatLngBounds();\n      path.forEach((point) => {\n        bounds.extend(new google.maps.LatLng(point.lat, point.lng));\n      });\n      return bounds;\n    },\n    []\n  );\n\n  const computeCenter = useCallback(\n    (path: google.maps.LatLngLiteral[]): google.maps.LatLngLiteral => {\n      if (path.length === 0) {\n        return { lat: 0, lng: 0 };\n      }\n\n      if (path.length === 1) {\n        return path[0];\n      }\n\n      // Compute average of all points\n      const avgLat =\n        path.reduce((sum, point) => sum + point.lat, 0) / path.length;\n      const avgLng =\n        path.reduce((sum, point) => sum + point.lng, 0) / path.length;\n      return { lat: avgLat, lng: avgLng };\n    },\n    []\n  );\n\n  const isLocationOnEdge = useCallback(\n    (\n      point: google.maps.LatLngLiteral,\n      polyline: google.maps.LatLngLiteral[],\n      tolerance?: number\n    ): boolean => {\n      const pointLatLng = new google.maps.LatLng(point.lat, point.lng);\n      const polylineLatLng = polyline.map(\n        (p) => new google.maps.LatLng(p.lat, p.lng)\n      );\n      // Create a temporary polyline for the geometry check\n      const tempPolyline = new google.maps.Polyline({\n        path: polylineLatLng,\n      });\n      return google.maps.geometry.poly.isLocationOnEdge(\n        pointLatLng,\n        tempPolyline,\n        tolerance\n      );\n    },\n    []\n  );\n\n  const encodePath = useCallback(\n    (path: google.maps.LatLngLiteral[]): string => {\n      const latLngPath = path.map(\n        (point) => new google.maps.LatLng(point.lat, point.lng)\n      );\n      return google.maps.geometry.encoding.encodePath(latLngPath);\n    },\n    []\n  );\n\n  const decodePath = useCallback(\n    (encodedPath: string): google.maps.LatLngLiteral[] => {\n      const latLngPath = google.maps.geometry.encoding.decodePath(encodedPath);\n      return latLngPath.map((point) => ({\n        lat: point.lat(),\n        lng: point.lng(),\n      }));\n    },\n    []\n  );\n\n  return {\n    isLoading,\n    error,\n    results,\n    computeDistanceBetween,\n    computeHeading,\n    computeOffset,\n    computeOffsetOrigin,\n    computeLength,\n    computeArea,\n    computeBounds,\n    computeCenter,\n    isLocationOnEdge,\n    encodePath,\n    decodePath,\n    spherical: google.maps.geometry.spherical,\n    encoding: google.maps.geometry.encoding,\n    poly: google.maps.geometry.poly,\n  };\n}\n","import { useState, useCallback, useEffect } from 'react';\n\nexport interface HeatmapData {\n  location: google.maps.LatLngLiteral;\n  weight?: number;\n}\n\nexport interface HeatmapOptions {\n  data: HeatmapData[];\n  map?: google.maps.Map;\n  radius?: number;\n  opacity?: number;\n  maxIntensity?: number;\n  gradient?: string[];\n  dissipating?: boolean;\n}\n\nexport interface UseHeatmapReturn {\n  isLoading: boolean;\n  error: Error | null;\n  heatmapLayer: google.maps.visualization.HeatmapLayer | null;\n  createHeatmap: (\n    options: HeatmapOptions\n  ) => google.maps.visualization.HeatmapLayer;\n  updateHeatmapData: (data: HeatmapData[]) => void;\n  setHeatmapOptions: (options: Partial<HeatmapOptions>) => void;\n  showHeatmap: (map?: google.maps.Map) => void;\n  hideHeatmap: () => void;\n  removeHeatmap: () => void;\n}\n\nexport function useHeatmap(): UseHeatmapReturn {\n  const [isLoading] = useState(false);\n  const [error] = useState<Error | null>(null);\n  const [heatmapLayer, setHeatmapLayer] =\n    useState<google.maps.visualization.HeatmapLayer | null>(null);\n\n  const createHeatmap = useCallback(\n    (options: HeatmapOptions): google.maps.visualization.HeatmapLayer => {\n      try {\n        const heatmapData: google.maps.visualization.WeightedLocation[] =\n          options.data.map((point) => ({\n            location: new google.maps.LatLng(\n              point.location.lat,\n              point.location.lng\n            ),\n            weight: point.weight || 1,\n          }));\n\n        const heatmapOptions: google.maps.visualization.HeatmapLayerOptions = {\n          data: heatmapData,\n          map: options.map,\n          radius: options.radius || 20,\n          opacity: options.opacity || 0.6,\n          maxIntensity: options.maxIntensity || 1,\n          gradient: options.gradient,\n          dissipating: options.dissipating !== false,\n        };\n\n        const heatmap = new google.maps.visualization.HeatmapLayer(\n          heatmapOptions\n        );\n        setHeatmapLayer(heatmap);\n        return heatmap;\n      } catch (err) {\n        const error =\n          err instanceof Error ? err : new Error('Heatmap creation failed');\n        throw error;\n      }\n    },\n    []\n  );\n\n  const updateHeatmapData = useCallback(\n    (data: HeatmapData[]) => {\n      if (heatmapLayer) {\n        const heatmapData: google.maps.visualization.WeightedLocation[] =\n          data.map((point) => ({\n            location: new google.maps.LatLng(\n              point.location.lat,\n              point.location.lng\n            ),\n            weight: point.weight || 1,\n          }));\n        heatmapLayer.setData(heatmapData);\n      }\n    },\n    [heatmapLayer]\n  );\n\n  const setHeatmapOptions = useCallback(\n    (options: Partial<HeatmapOptions>) => {\n      if (heatmapLayer) {\n        if (options.radius !== undefined) {\n          heatmapLayer.set('radius', options.radius);\n        }\n        if (options.opacity !== undefined) {\n          heatmapLayer.set('opacity', options.opacity);\n        }\n        if (options.maxIntensity !== undefined) {\n          heatmapLayer.set('maxIntensity', options.maxIntensity);\n        }\n        if (options.gradient !== undefined) {\n          heatmapLayer.set('gradient', options.gradient);\n        }\n        if (options.dissipating !== undefined) {\n          heatmapLayer.set('dissipating', options.dissipating);\n        }\n      }\n    },\n    [heatmapLayer]\n  );\n\n  const showHeatmap = useCallback(\n    (map?: google.maps.Map) => {\n      if (heatmapLayer) {\n        if (map) {\n          heatmapLayer.setMap(map);\n        } else {\n          const currentMap = heatmapLayer.getMap();\n          if (currentMap) {\n            heatmapLayer.setMap(currentMap);\n          }\n        }\n      }\n    },\n    [heatmapLayer]\n  );\n\n  const hideHeatmap = useCallback(() => {\n    if (heatmapLayer) {\n      heatmapLayer.setMap(null);\n    }\n  }, [heatmapLayer]);\n\n  const removeHeatmap = useCallback(() => {\n    if (heatmapLayer) {\n      heatmapLayer.setMap(null);\n      setHeatmapLayer(null);\n    }\n  }, [heatmapLayer]);\n\n  // Cleanup on unmount\n  useEffect(() => {\n    return () => {\n      if (heatmapLayer) {\n        heatmapLayer.setMap(null);\n      }\n    };\n  }, [heatmapLayer]);\n\n  return {\n    isLoading,\n    error,\n    heatmapLayer,\n    createHeatmap,\n    updateHeatmapData,\n    setHeatmapOptions,\n    showHeatmap,\n    hideHeatmap,\n    removeHeatmap,\n  };\n}\n","import { useState, useCallback, useEffect } from 'react';\nimport {\n  createInfoWindow,\n  openInfoWindow,\n  closeInfoWindow,\n} from '@gmaps-kit/core';\nimport { MapInstance } from '@gmaps-kit/core';\n\nexport interface InfoWindowOptions {\n  content: string | HTMLElement;\n  position?: google.maps.LatLngLiteral;\n  maxWidth?: number;\n  pixelOffset?: google.maps.Size;\n  zIndex?: number;\n}\n\nexport interface InfoWindowInstance {\n  infoWindow: google.maps.InfoWindow;\n  id: string;\n  isOpen: boolean;\n  content: string | HTMLElement;\n  position?: google.maps.LatLngLiteral;\n}\n\nexport interface UseInfoWindowsReturn {\n  infoWindows: InfoWindowInstance[];\n  activeInfoWindow: InfoWindowInstance | null;\n  createInfoWindowInstance: (options: InfoWindowOptions) => InfoWindowInstance;\n  openInfoWindowInstance: (\n    infoWindow: InfoWindowInstance,\n    marker?: google.maps.marker.AdvancedMarkerElement,\n    mapInstance?: MapInstance\n  ) => void;\n  closeInfoWindowInstance: (infoWindow: InfoWindowInstance) => void;\n  closeAllInfoWindows: () => void;\n  updateInfoWindowContent: (\n    infoWindow: InfoWindowInstance,\n    content: string | HTMLElement\n  ) => void;\n  removeInfoWindow: (infoWindow: InfoWindowInstance) => void;\n}\n\nexport function useInfoWindows(): UseInfoWindowsReturn {\n  const [infoWindows, setInfoWindows] = useState<InfoWindowInstance[]>([]);\n  const [activeInfoWindow, setActiveInfoWindow] =\n    useState<InfoWindowInstance | null>(null);\n\n  const createInfoWindowInstance = useCallback(\n    (options: InfoWindowOptions): InfoWindowInstance => {\n      // Convert HTMLElement to string if needed\n      const contentString =\n        typeof options.content === 'string'\n          ? options.content\n          : options.content.outerHTML;\n\n      const infoWindow = createInfoWindow({\n        content: contentString,\n        position: options.position,\n        maxWidth: options.maxWidth,\n        pixelOffset: options.pixelOffset,\n        disableAutoPan: false,\n      });\n\n      const infoWindowInstance: InfoWindowInstance = {\n        infoWindow,\n        id: `infowindow-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`,\n        isOpen: false,\n        content: options.content,\n        position: options.position,\n      };\n\n      setInfoWindows((prev) => [...prev, infoWindowInstance]);\n      return infoWindowInstance;\n    },\n    []\n  );\n\n  const openInfoWindowInstance = useCallback(\n    (\n      infoWindowInstance: InfoWindowInstance,\n      marker?: google.maps.marker.AdvancedMarkerElement,\n      mapInstance?: MapInstance\n    ) => {\n      if (!mapInstance) {\n        throw new Error('Map instance is required to open InfoWindow');\n      }\n\n      // Close any currently open InfoWindow\n      if (activeInfoWindow) {\n        closeInfoWindow(activeInfoWindow.infoWindow);\n      }\n\n      if (marker) {\n        openInfoWindow(infoWindowInstance.infoWindow, marker, mapInstance.map);\n      } else if (infoWindowInstance.position) {\n        // For position-based InfoWindows, we need to open them directly on the map\n        infoWindowInstance.infoWindow.setPosition(infoWindowInstance.position);\n        infoWindowInstance.infoWindow.open(mapInstance.map);\n      } else {\n        throw new Error('Either marker or position must be provided');\n      }\n\n      // Update the InfoWindow instance state\n      setInfoWindows((prev) =>\n        prev.map((iw) =>\n          iw.id === infoWindowInstance.id\n            ? { ...iw, isOpen: true }\n            : { ...iw, isOpen: false }\n        )\n      );\n\n      setActiveInfoWindow({ ...infoWindowInstance, isOpen: true });\n    },\n    [activeInfoWindow]\n  );\n\n  const closeInfoWindowInstance = useCallback(\n    (infoWindowInstance: InfoWindowInstance) => {\n      closeInfoWindow(infoWindowInstance.infoWindow);\n\n      setInfoWindows((prev) =>\n        prev.map((iw) =>\n          iw.id === infoWindowInstance.id ? { ...iw, isOpen: false } : iw\n        )\n      );\n\n      if (activeInfoWindow?.id === infoWindowInstance.id) {\n        setActiveInfoWindow(null);\n      }\n    },\n    [activeInfoWindow]\n  );\n\n  const closeAllInfoWindows = useCallback(() => {\n    infoWindows.forEach((infoWindowInstance) => {\n      closeInfoWindow(infoWindowInstance.infoWindow);\n    });\n\n    setInfoWindows((prev) => prev.map((iw) => ({ ...iw, isOpen: false })));\n\n    setActiveInfoWindow(null);\n  }, [infoWindows]);\n\n  const updateInfoWindowContent = useCallback(\n    (infoWindowInstance: InfoWindowInstance, content: string | HTMLElement) => {\n      infoWindowInstance.infoWindow.setContent(content);\n\n      setInfoWindows((prev) =>\n        prev.map((iw) =>\n          iw.id === infoWindowInstance.id ? { ...iw, content } : iw\n        )\n      );\n\n      if (activeInfoWindow?.id === infoWindowInstance.id) {\n        setActiveInfoWindow({ ...infoWindowInstance, content });\n      }\n    },\n    [activeInfoWindow]\n  );\n\n  const removeInfoWindow = useCallback(\n    (infoWindowInstance: InfoWindowInstance) => {\n      // Close the InfoWindow if it's open\n      if (infoWindowInstance.isOpen) {\n        closeInfoWindow(infoWindowInstance.infoWindow);\n      }\n\n      setInfoWindows((prev) =>\n        prev.filter((iw) => iw.id !== infoWindowInstance.id)\n      );\n\n      if (activeInfoWindow?.id === infoWindowInstance.id) {\n        setActiveInfoWindow(null);\n      }\n    },\n    [activeInfoWindow]\n  );\n\n  // Cleanup on unmount\n  useEffect(() => {\n    return () => {\n      infoWindows.forEach((infoWindowInstance) => {\n        if (infoWindowInstance.isOpen) {\n          closeInfoWindow(infoWindowInstance.infoWindow);\n        }\n      });\n    };\n  }, [infoWindows]);\n\n  return {\n    infoWindows,\n    activeInfoWindow,\n    createInfoWindowInstance,\n    openInfoWindowInstance,\n    closeInfoWindowInstance,\n    closeAllInfoWindows,\n    updateInfoWindowContent,\n    removeInfoWindow,\n  };\n}\n","import { useState, useCallback, useEffect } from 'react';\nimport { MapInstance } from '@gmaps-kit/core';\n\nexport interface MapEventHandlers {\n  onClick?: (event: google.maps.MapMouseEvent) => void;\n  onRightClick?: (event: google.maps.MapMouseEvent) => void;\n  onDoubleClick?: (event: google.maps.MapMouseEvent) => void;\n  onDrag?: () => void;\n  onDragStart?: () => void;\n  onDragEnd?: () => void;\n  onZoomChanged?: () => void;\n  onCenterChanged?: () => void;\n  onBoundsChanged?: () => void;\n  onIdle?: () => void;\n  onTilesLoaded?: () => void;\n  onHeadingChanged?: () => void;\n  onTiltChanged?: () => void;\n}\n\nexport interface MapEventState {\n  isDragging: boolean;\n  isZooming: boolean;\n  lastClickPosition: google.maps.LatLngLiteral | null;\n  lastRightClickPosition: google.maps.LatLngLiteral | null;\n  currentZoom: number | null;\n  currentCenter: google.maps.LatLngLiteral | null;\n  currentBounds: google.maps.LatLngBounds | null;\n}\n\nexport interface UseMapEventsReturn {\n  eventState: MapEventState;\n  addEventListeners: (\n    mapInstance: MapInstance,\n    handlers: MapEventHandlers\n  ) => void;\n  removeEventListeners: (mapInstance: MapInstance) => void;\n  getCurrentMapState: (mapInstance: MapInstance) => MapEventState;\n}\n\nexport function useMapEvents(): UseMapEventsReturn {\n  const [eventState, setEventState] = useState<MapEventState>({\n    isDragging: false,\n    isZooming: false,\n    lastClickPosition: null,\n    lastRightClickPosition: null,\n    currentZoom: null,\n    currentCenter: null,\n    currentBounds: null,\n  });\n\n  const [listeners, setListeners] = useState<google.maps.MapsEventListener[]>(\n    []\n  );\n\n  const addEventListeners = useCallback(\n    (mapInstance: MapInstance, handlers: MapEventHandlers) => {\n      const map = mapInstance.map;\n      const newListeners: google.maps.MapsEventListener[] = [];\n\n      // Click events\n      if (handlers.onClick) {\n        const clickListener = map.addListener(\n          'click',\n          (event: google.maps.MapMouseEvent) => {\n            if (event.latLng) {\n              setEventState((prev) => ({\n                ...prev,\n                lastClickPosition: {\n                  lat: event.latLng!.lat(),\n                  lng: event.latLng!.lng(),\n                },\n              }));\n            }\n            handlers.onClick?.(event);\n          }\n        );\n        newListeners.push(clickListener);\n      }\n\n      if (handlers.onRightClick) {\n        const rightClickListener = map.addListener(\n          'rightclick',\n          (event: google.maps.MapMouseEvent) => {\n            if (event.latLng) {\n              setEventState((prev) => ({\n                ...prev,\n                lastRightClickPosition: {\n                  lat: event.latLng!.lat(),\n                  lng: event.latLng!.lng(),\n                },\n              }));\n            }\n            handlers.onRightClick?.(event);\n          }\n        );\n        newListeners.push(rightClickListener);\n      }\n\n      if (handlers.onDoubleClick) {\n        const doubleClickListener = map.addListener(\n          'dblclick',\n          handlers.onDoubleClick\n        );\n        newListeners.push(doubleClickListener);\n      }\n\n      // Drag events\n      if (handlers.onDrag) {\n        const dragListener = map.addListener('drag', () => {\n          setEventState((prev) => ({ ...prev, isDragging: true }));\n          handlers.onDrag?.();\n        });\n        newListeners.push(dragListener);\n      }\n\n      if (handlers.onDragStart) {\n        const dragStartListener = map.addListener('dragstart', () => {\n          setEventState((prev) => ({ ...prev, isDragging: true }));\n          handlers.onDragStart?.();\n        });\n        newListeners.push(dragStartListener);\n      }\n\n      if (handlers.onDragEnd) {\n        const dragEndListener = map.addListener('dragend', () => {\n          setEventState((prev) => ({ ...prev, isDragging: false }));\n          handlers.onDragEnd?.();\n        });\n        newListeners.push(dragEndListener);\n      }\n\n      // Zoom events\n      if (handlers.onZoomChanged) {\n        const zoomListener = map.addListener('zoom_changed', () => {\n          setEventState((prev) => ({\n            ...prev,\n            currentZoom: map.getZoom() || null,\n            isZooming: true,\n          }));\n          handlers.onZoomChanged?.();\n        });\n        newListeners.push(zoomListener);\n      }\n\n      // Center events\n      if (handlers.onCenterChanged) {\n        const centerListener = map.addListener('center_changed', () => {\n          const center = map.getCenter();\n          setEventState((prev) => ({\n            ...prev,\n            currentCenter: center\n              ? { lat: center.lat(), lng: center.lng() }\n              : null,\n          }));\n          handlers.onCenterChanged?.();\n        });\n        newListeners.push(centerListener);\n      }\n\n      // Bounds events\n      if (handlers.onBoundsChanged) {\n        const boundsListener = map.addListener('bounds_changed', () => {\n          setEventState((prev) => ({\n            ...prev,\n            currentBounds: map.getBounds() || null,\n          }));\n          handlers.onBoundsChanged?.();\n        });\n        newListeners.push(boundsListener);\n      }\n\n      // Idle events\n      if (handlers.onIdle) {\n        const idleListener = map.addListener('idle', () => {\n          setEventState((prev) => ({\n            ...prev,\n            isDragging: false,\n            isZooming: false,\n          }));\n          handlers.onIdle?.();\n        });\n        newListeners.push(idleListener);\n      }\n\n      // Other events\n      if (handlers.onTilesLoaded) {\n        const tilesListener = map.addListener(\n          'tilesloaded',\n          handlers.onTilesLoaded\n        );\n        newListeners.push(tilesListener);\n      }\n\n      if (handlers.onHeadingChanged) {\n        const headingListener = map.addListener(\n          'heading_changed',\n          handlers.onHeadingChanged\n        );\n        newListeners.push(headingListener);\n      }\n\n      if (handlers.onTiltChanged) {\n        const tiltListener = map.addListener(\n          'tilt_changed',\n          handlers.onTiltChanged\n        );\n        newListeners.push(tiltListener);\n      }\n\n      setListeners((prev) => [...prev, ...newListeners]);\n    },\n    []\n  );\n\n  const removeEventListeners = useCallback(\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n    (_mapInstance: MapInstance) => {\n      listeners.forEach((listener) => {\n        google.maps.event.removeListener(listener);\n      });\n      setListeners([]);\n    },\n    [listeners]\n  );\n\n  const getCurrentMapState = useCallback(\n    (mapInstance: MapInstance): MapEventState => {\n      const map = mapInstance.map;\n      const center = map.getCenter();\n      const bounds = map.getBounds();\n      const zoom = map.getZoom();\n\n      return {\n        isDragging: false,\n        isZooming: false,\n        lastClickPosition: eventState.lastClickPosition,\n        lastRightClickPosition: eventState.lastRightClickPosition,\n        currentZoom: zoom || null,\n        currentCenter: center ? { lat: center.lat(), lng: center.lng() } : null,\n        currentBounds: bounds || null,\n      };\n    },\n    [eventState.lastClickPosition, eventState.lastRightClickPosition]\n  );\n\n  // Cleanup on unmount\n  useEffect(() => {\n    return () => {\n      listeners.forEach((listener) => {\n        google.maps.event.removeListener(listener);\n      });\n    };\n  }, [listeners]);\n\n  return {\n    eventState,\n    addEventListeners,\n    removeEventListeners,\n    getCurrentMapState,\n  };\n}\n","import { useState, useCallback } from 'react';\n\nexport interface MaxZoomRequest {\n  location: google.maps.LatLngLiteral;\n}\n\nexport interface MaxZoomResult {\n  maxZoom: number;\n  location: google.maps.LatLngLiteral;\n}\n\nexport interface UseMaxZoomReturn {\n  isLoading: boolean;\n  error: Error | null;\n  result: MaxZoomResult | null;\n  getMaxZoom: (request: MaxZoomRequest) => Promise<MaxZoomResult>;\n  createMaxZoomService: () => google.maps.MaxZoomService;\n}\n\nexport function useMaxZoom(): UseMaxZoomReturn {\n  const [isLoading, setIsLoading] = useState(false);\n  const [error, setError] = useState<Error | null>(null);\n  const [result, setResult] = useState<MaxZoomResult | null>(null);\n\n  const handleAsyncOperation = useCallback(\n    async <T>(operation: () => Promise<T>): Promise<T> => {\n      setIsLoading(true);\n      setError(null);\n\n      try {\n        const data = await operation();\n        return data;\n      } catch (err) {\n        const error =\n          err instanceof Error ? err : new Error('Max Zoom operation failed');\n        setError(error);\n        throw error;\n      } finally {\n        setIsLoading(false);\n      }\n    },\n    []\n  );\n\n  const getMaxZoom = useCallback(\n    async (request: MaxZoomRequest): Promise<MaxZoomResult> => {\n      return handleAsyncOperation(async () => {\n        const maxZoomService = new google.maps.MaxZoomService();\n\n        const result = await new Promise<google.maps.MaxZoomResult>(\n          (resolve, reject) => {\n            maxZoomService.getMaxZoomAtLatLng(\n              request.location,\n              (result: google.maps.MaxZoomResult) => {\n                if (result && result.status === google.maps.MaxZoomStatus.OK) {\n                  resolve(result);\n                } else {\n                  reject(\n                    new Error(\n                      `Max Zoom request failed: ${result?.status || 'Unknown error'}`\n                    )\n                  );\n                }\n              }\n            );\n          }\n        );\n\n        const maxZoomResult: MaxZoomResult = {\n          maxZoom: result.zoom,\n          location: {\n            lat: request.location.lat,\n            lng: request.location.lng,\n          },\n        };\n\n        setResult(maxZoomResult);\n        return maxZoomResult;\n      });\n    },\n    [handleAsyncOperation]\n  );\n\n  const createMaxZoomService = useCallback((): google.maps.MaxZoomService => {\n    return new google.maps.MaxZoomService();\n  }, []);\n\n  return {\n    isLoading,\n    error,\n    result,\n    getMaxZoom,\n    createMaxZoomService,\n  };\n}\n","import { useState, useCallback, useEffect } from 'react';\n\nexport interface TrafficOptions {\n  map?: google.maps.Map;\n  autoRefresh?: boolean;\n  autoRefreshInterval?: number;\n}\n\nexport interface UseTrafficReturn {\n  isLoading: boolean;\n  error: Error | null;\n  trafficLayer: google.maps.TrafficLayer | null;\n  isVisible: boolean;\n  createTrafficLayer: (options?: TrafficOptions) => google.maps.TrafficLayer;\n  showTraffic: () => void;\n  hideTraffic: () => void;\n  toggleTraffic: () => void;\n  refreshTraffic: () => void;\n  removeTrafficLayer: () => void;\n}\n\nexport function useTraffic(): UseTrafficReturn {\n  const [isLoading] = useState(false);\n  const [error] = useState<Error | null>(null);\n  const [trafficLayer, setTrafficLayer] =\n    useState<google.maps.TrafficLayer | null>(null);\n  const [isVisible, setIsVisible] = useState(false);\n\n  const createTrafficLayer = useCallback(\n    (options?: TrafficOptions): google.maps.TrafficLayer => {\n      try {\n        const traffic = new google.maps.TrafficLayer();\n\n        if (options?.map) {\n          traffic.setMap(options.map);\n          setIsVisible(true);\n        }\n\n        setTrafficLayer(traffic);\n        return traffic;\n      } catch (err) {\n        const error =\n          err instanceof Error\n            ? err\n            : new Error('Traffic layer creation failed');\n        throw error;\n      }\n    },\n    []\n  );\n\n  const showTraffic = useCallback(() => {\n    if (trafficLayer) {\n      trafficLayer.setMap(trafficLayer.getMap());\n      setIsVisible(true);\n    }\n  }, [trafficLayer]);\n\n  const hideTraffic = useCallback(() => {\n    if (trafficLayer) {\n      trafficLayer.setMap(null);\n      setIsVisible(false);\n    }\n  }, [trafficLayer]);\n\n  const toggleTraffic = useCallback(() => {\n    if (isVisible) {\n      hideTraffic();\n    } else {\n      showTraffic();\n    }\n  }, [isVisible, showTraffic, hideTraffic]);\n\n  const refreshTraffic = useCallback(() => {\n    if (trafficLayer) {\n      // Traffic layer automatically refreshes, but we can trigger a refresh\n      // by temporarily hiding and showing it\n      const currentMap = trafficLayer.getMap();\n      if (currentMap) {\n        trafficLayer.setMap(null);\n        setTimeout(() => {\n          trafficLayer.setMap(currentMap);\n        }, 100);\n      }\n    }\n  }, [trafficLayer]);\n\n  const removeTrafficLayer = useCallback(() => {\n    if (trafficLayer) {\n      trafficLayer.setMap(null);\n      setTrafficLayer(null);\n      setIsVisible(false);\n    }\n  }, [trafficLayer]);\n\n  // Cleanup on unmount\n  useEffect(() => {\n    return () => {\n      if (trafficLayer) {\n        trafficLayer.setMap(null);\n      }\n    };\n  }, [trafficLayer]);\n\n  return {\n    isLoading,\n    error,\n    trafficLayer,\n    isVisible,\n    createTrafficLayer,\n    showTraffic,\n    hideTraffic,\n    toggleTraffic,\n    refreshTraffic,\n    removeTrafficLayer,\n  };\n}\n","import { useState, useCallback, useEffect } from 'react';\n\nexport interface TransitOptions {\n  map?: google.maps.Map;\n  autoRefresh?: boolean;\n  autoRefreshInterval?: number;\n}\n\nexport interface UseTransitReturn {\n  isLoading: boolean;\n  error: Error | null;\n  transitLayer: google.maps.TransitLayer | null;\n  isVisible: boolean;\n  createTransitLayer: (options?: TransitOptions) => google.maps.TransitLayer;\n  showTransit: () => void;\n  hideTransit: () => void;\n  toggleTransit: () => void;\n  refreshTransit: () => void;\n  removeTransitLayer: () => void;\n}\n\nexport function useTransit(): UseTransitReturn {\n  const [isLoading] = useState(false);\n  const [error] = useState<Error | null>(null);\n  const [transitLayer, setTransitLayer] =\n    useState<google.maps.TransitLayer | null>(null);\n  const [isVisible, setIsVisible] = useState(false);\n\n  const createTransitLayer = useCallback(\n    (options?: TransitOptions): google.maps.TransitLayer => {\n      try {\n        const transit = new google.maps.TransitLayer();\n\n        if (options?.map) {\n          transit.setMap(options.map);\n          setIsVisible(true);\n        }\n\n        setTransitLayer(transit);\n        return transit;\n      } catch (err) {\n        const error =\n          err instanceof Error\n            ? err\n            : new Error('Transit layer creation failed');\n        throw error;\n      }\n    },\n    []\n  );\n\n  const showTransit = useCallback(() => {\n    if (transitLayer) {\n      transitLayer.setMap(transitLayer.getMap());\n      setIsVisible(true);\n    }\n  }, [transitLayer]);\n\n  const hideTransit = useCallback(() => {\n    if (transitLayer) {\n      transitLayer.setMap(null);\n      setIsVisible(false);\n    }\n  }, [transitLayer]);\n\n  const toggleTransit = useCallback(() => {\n    if (isVisible) {\n      hideTransit();\n    } else {\n      showTransit();\n    }\n  }, [isVisible, showTransit, hideTransit]);\n\n  const refreshTransit = useCallback(() => {\n    if (transitLayer) {\n      // Transit layer automatically refreshes, but we can trigger a refresh\n      // by temporarily hiding and showing it\n      const currentMap = transitLayer.getMap();\n      if (currentMap) {\n        transitLayer.setMap(null);\n        setTimeout(() => {\n          transitLayer.setMap(currentMap);\n        }, 100);\n      }\n    }\n  }, [transitLayer]);\n\n  const removeTransitLayer = useCallback(() => {\n    if (transitLayer) {\n      transitLayer.setMap(null);\n      setTransitLayer(null);\n      setIsVisible(false);\n    }\n  }, [transitLayer]);\n\n  // Cleanup on unmount\n  useEffect(() => {\n    return () => {\n      if (transitLayer) {\n        transitLayer.setMap(null);\n      }\n    };\n  }, [transitLayer]);\n\n  return {\n    isLoading,\n    error,\n    transitLayer,\n    isVisible,\n    createTransitLayer,\n    showTransit,\n    hideTransit,\n    toggleTransit,\n    refreshTransit,\n    removeTransitLayer,\n  };\n}\n","import React, { useEffect, useRef } from 'react';\nimport { useMap, UseMapOptions } from '../hooks/useMap';\nimport { MapInstance } from '@gmaps-kit/core';\n\nexport interface MapProps extends UseMapOptions {\n  id: string;\n  className?: string;\n  style?: React.CSSProperties;\n  children?: React.ReactNode;\n  onMapReady?: (map: MapInstance) => void;\n}\n\nexport const Map: React.FC<MapProps> = ({\n  id,\n  className,\n  style,\n  children,\n  onMapReady,\n  ...mapOptions\n}) => {\n  const containerRef = useRef<HTMLDivElement>(null);\n  useMap(id, { ...mapOptions, onMapReady });\n\n  useEffect(() => {\n    if (containerRef.current && !containerRef.current.id) {\n      containerRef.current.id = id;\n    }\n  }, [id]);\n\n  return (\n    <div ref={containerRef} id={id} className={className} style={style}>\n      {children}\n    </div>\n  );\n};\n","import React, { useEffect, useRef } from 'react';\nimport { useMarkers, MarkerOptions } from '../hooks/useMarkers';\nimport { MapInstance } from '@gmaps-kit/core';\n\nexport interface MarkerProps extends MarkerOptions {\n  mapInstance: MapInstance | null;\n  onMarkerCreated?: (marker: google.maps.marker.AdvancedMarkerElement) => void;\n}\n\nexport const Marker: React.FC<MarkerProps> = ({\n  mapInstance,\n  onMarkerCreated,\n  ...markerOptions\n}) => {\n  const { addMarker, removeMarker } = useMarkers(mapInstance);\n  const markerRef = useRef<google.maps.marker.AdvancedMarkerElement | null>(\n    null\n  );\n\n  useEffect(() => {\n    if (!mapInstance) return;\n\n    // Remove existing marker if it exists\n    if (markerRef.current) {\n      removeMarker(markerRef.current);\n    }\n\n    // Add new marker\n    const marker = addMarker(markerOptions);\n    markerRef.current = marker;\n    onMarkerCreated?.(marker);\n\n    // Cleanup function\n    return () => {\n      if (markerRef.current) {\n        removeMarker(markerRef.current);\n        markerRef.current = null;\n      }\n    };\n  }, [\n    mapInstance,\n    markerOptions.position.lat,\n    markerOptions.position.lng,\n    markerOptions.title,\n    markerOptions.content,\n    markerOptions.draggable,\n    markerOptions.clickable,\n    markerOptions.zIndex,\n    markerOptions.onClick,\n    markerOptions.onDrag,\n    markerOptions.onDragEnd,\n    addMarker,\n    removeMarker,\n    onMarkerCreated,\n  ]);\n\n  return null; // Marker is rendered on the map, not as a DOM element\n};\n","import React, { useEffect, useRef } from 'react';\nimport {\n  createInfoWindow,\n  openInfoWindow,\n  closeInfoWindow,\n} from '@gmaps-kit/core';\nimport { MapInstance } from '@gmaps-kit/core';\n\nexport interface InfoWindowProps {\n  mapInstance: MapInstance | null;\n  marker?: google.maps.marker.AdvancedMarkerElement;\n  content: string | React.ReactNode;\n  position?: google.maps.LatLngLiteral;\n  isOpen?: boolean;\n  onClose?: () => void;\n}\n\nexport const InfoWindow: React.FC<InfoWindowProps> = ({\n  mapInstance,\n  marker,\n  content,\n  position,\n  isOpen = false,\n  onClose,\n}) => {\n  const infoWindowRef = useRef<google.maps.InfoWindow | null>(null);\n\n  useEffect(() => {\n    if (!mapInstance) return;\n\n    // Create InfoWindow if it doesn't exist\n    if (!infoWindowRef.current) {\n      const infoWindow = createInfoWindow({\n        content: typeof content === 'string' ? content : '',\n      });\n      infoWindowRef.current = infoWindow;\n\n      // Add close listener\n      infoWindow.addListener('closeclick', () => {\n        onClose?.();\n      });\n    }\n\n    // Update content if it changed\n    if (infoWindowRef.current) {\n      infoWindowRef.current.setContent(\n        typeof content === 'string' ? content : ''\n      );\n    }\n  }, [content, onClose]);\n\n  useEffect(() => {\n    if (!mapInstance || !infoWindowRef.current) return;\n\n    if (isOpen) {\n      if (marker) {\n        openInfoWindow(infoWindowRef.current, marker, mapInstance.map);\n      } else if (position) {\n        // For position without marker, we need to create a temporary marker\n        const tempMarker = new google.maps.marker.AdvancedMarkerElement({\n          position: position,\n          map: mapInstance.map,\n        });\n        openInfoWindow(infoWindowRef.current, tempMarker, mapInstance.map);\n        // Clean up the temporary marker after a short delay\n        setTimeout(() => {\n          tempMarker.map = null;\n        }, 100);\n      }\n    } else {\n      closeInfoWindow(infoWindowRef.current);\n    }\n  }, [mapInstance, marker, position, isOpen]);\n\n  // Cleanup\n  useEffect(() => {\n    return () => {\n      if (infoWindowRef.current) {\n        closeInfoWindow(infoWindowRef.current);\n      }\n    };\n  }, []);\n\n  return null; // InfoWindow is rendered on the map, not as a DOM element\n};\n","// Hooks\nexport { useGoogleMaps } from './hooks/useGoogleMaps';\nexport type {\n  UseGoogleMapsOptions,\n  UseGoogleMapsReturn,\n} from './hooks/useGoogleMaps';\n\nexport { useMap } from './hooks/useMap';\nexport type { UseMapOptions, UseMapReturn } from './hooks/useMap';\n\nexport { useMarkers } from './hooks/useMarkers';\nexport type { MarkerOptions, UseMarkersReturn } from './hooks/useMarkers';\n\nexport { useGeocoding } from './hooks/useGeocoding';\nexport type { GeocodingResult, UseGeocodingReturn } from './hooks/useGeocoding';\n\nexport { usePlaces } from './hooks/usePlaces';\nexport type {\n  UsePlacesOptions,\n  UsePlacesReturn,\n  PlacesHookError,\n} from './hooks/usePlaces';\n\nexport { usePlacesNew } from './hooks/usePlacesNew';\nexport type {\n  UsePlacesNewOptions,\n  UsePlacesNewReturn,\n  PlacesNewHookError,\n} from './hooks/usePlacesNew';\n\nexport { useGeocodingService } from './hooks/useGeocodingService';\nexport type {\n  UseGeocodingServiceOptions,\n  UseGeocodingServiceReturn,\n  GeocodingServiceHookError,\n} from './hooks/useGeocodingService';\n\nexport { useStreetView } from './hooks/useStreetView';\nexport type {\n  UseStreetViewOptions,\n  UseStreetViewReturn,\n} from './hooks/useStreetView';\n\nexport { useBicycling } from './hooks/useBicycling';\nexport type {\n  BicyclingOptions,\n  UseBicyclingReturn,\n} from './hooks/useBicycling';\n\nexport { useClustering, isMarkerClustererLoaded } from './hooks/useClustering';\nexport type {\n  ClusterOptions,\n  ClusterMarker,\n  UseClusteringReturn,\n} from './hooks/useClustering';\n\nexport { useDirections } from './hooks/useDirections';\nexport type {\n  DirectionsRequest,\n  DirectionsResult,\n  UseDirectionsReturn,\n} from './hooks/useDirections';\n\nexport { useDistanceMatrix } from './hooks/useDistanceMatrix';\nexport type {\n  DistanceMatrixRequest,\n  DistanceMatrixResult,\n  UseDistanceMatrixReturn,\n} from './hooks/useDistanceMatrix';\n\nexport { useElevation } from './hooks/useElevation';\nexport type {\n  ElevationRequest,\n  ElevationResult,\n  UseElevationReturn,\n} from './hooks/useElevation';\n\nexport { useGeometry } from './hooks/useGeometry';\nexport type {\n  GeometryCalculation,\n  UseGeometryReturn,\n} from './hooks/useGeometry';\n\nexport { useHeatmap } from './hooks/useHeatmap';\nexport type {\n  HeatmapData,\n  HeatmapOptions,\n  UseHeatmapReturn,\n} from './hooks/useHeatmap';\n\nexport { useInfoWindows } from './hooks/useInfoWindows';\nexport type {\n  InfoWindowOptions,\n  UseInfoWindowsReturn,\n} from './hooks/useInfoWindows';\n\nexport { useMapEvents } from './hooks/useMapEvents';\nexport type {\n  MapEventHandlers,\n  MapEventState,\n  UseMapEventsReturn,\n} from './hooks/useMapEvents';\n\nexport { useMaxZoom } from './hooks/useMaxZoom';\nexport type {\n  MaxZoomRequest,\n  MaxZoomResult,\n  UseMaxZoomReturn,\n} from './hooks/useMaxZoom';\n\nexport { useTraffic } from './hooks/useTraffic';\nexport type { TrafficOptions, UseTrafficReturn } from './hooks/useTraffic';\n\nexport { useTransit } from './hooks/useTransit';\nexport type { TransitOptions, UseTransitReturn } from './hooks/useTransit';\n\n// Components\nexport { Map } from './components/Map';\nexport type { MapProps } from './components/Map';\n\nexport { Marker } from './components/Marker';\nexport type { MarkerProps } from './components/Marker';\n\nexport { InfoWindow } from './components/InfoWindow';\nexport type { InfoWindowProps } from './components/InfoWindow';\n\n// Re-export core utilities for convenience\nexport * from '@gmaps-kit/core';\n"],"mappings":"AAAA,OAAS,YAAAA,EAAU,aAAAC,OAAiB,QACpC,OAAS,kBAAAC,GAAgB,sBAAAC,OAA0B,kBAgB5C,SAASC,GACdC,EACqB,CACrB,GAAM,CAACC,EAAUC,CAAW,EAAIP,EAAS,EAAK,EACxC,CAACQ,EAAWC,CAAY,EAAIT,EAAS,EAAK,EAC1C,CAACU,EAAOC,CAAQ,EAAIX,EAAuB,IAAI,EAE/CY,EAAO,SAAY,CACvB,GAAI,EAAAN,GAAYE,GAEhB,CAAAC,EAAa,EAAI,EACjBE,EAAS,IAAI,EAEb,GAAI,CACF,MAAMT,GAAe,CACnB,OAAQG,EAAQ,OAChB,UAAWA,EAAQ,WAAa,CAAC,SAAU,UAAU,CACvD,CAAC,EAEDE,EAAY,EAAI,EAChBF,EAAQ,SAAS,CACnB,OAASQ,EAAK,CACZ,IAAMH,EACJG,aAAe,MAAQA,EAAM,IAAI,MAAM,4BAA4B,EACrEF,EAASD,CAAK,EACdL,EAAQ,UAAUK,CAAK,CACzB,QAAE,CACAD,EAAa,EAAK,CACpB,EACF,EAEA,OAAAR,GAAU,IAAM,CACVE,GAAmB,GACrBI,EAAY,EAAI,CAEpB,EAAG,CAAC,CAAC,EAEE,CACL,SAAAD,EACA,UAAAE,EACA,MAAAE,EACA,KAAAE,CACF,CACF,CC5DA,OAAS,YAAA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,sBAAsB,CAC9D,SAAUL,EACV,IAAKH,EAAY,GACnB,CAAC,EACDH,GAAeS,EAAc,QAASE,EAAYR,EAAY,GAAG,EAEjE,WAAW,IAAM,CACfQ,EAAW,IAAM,IACnB,EAAG,GAAG,CACR,OAEAV,GAAgBQ,EAAc,OAAO,CAEzC,EAAG,CAACN,EAAaC,EAAQE,EAAUC,CAAM,CAAC,EAG1CV,GAAU,IACD,IAAM,CACPY,EAAc,SAChBR,GAAgBQ,EAAc,OAAO,CAEzC,EACC,CAAC,CAAC,EAEE,IACT,EC2CA,WAAc","names":["useState","useEffect","loadGoogleMaps","isGoogleMapsLoaded","useGoogleMaps","options","isLoaded","setIsLoaded","isLoading","setIsLoading","error","setError","load","err","useState","useEffect","useCallback","useMemo","createMap","getMapCenter","setMapCenter","getMapZoom","setMapZoom","panTo","fitMapToMarkers","useMap","containerId","options","mapInstance","setMapInstance","isReady","setIsReady","center","setCenterState","zoom","setZoomState","memoizedOptions","initializeMap","mapOptions","map","error","setCenter","newCenter","setZoom","newZoom","panToLocation","fitToMarkers","markers","useState","useCallback","useEffect","addMarker","removeMarker","updateMarkerPosition","updateMarkerContent","getMarkerPosition","setMarkerDraggable","addMarkerClickListener","addMarkerDragListener","addMarkerDragEndListener","useMarkers","mapInstance","markers","setMarkers","addMarkerToMap","options","marker","prev","removeMarkerFromMap","m","updateMarkerOnMap","clearAllMarkersFromMap","getMarkerPositionFromMap","useState","useCallback","geocodeAsync","reverseGeocodeAsync","geocodeFirst","reverseGeocodeFirst","geocodeWithComponents","geocodeWithBounds","geocodeWithRegion","useGeocoding","isLoading","setIsLoading","error","setError","handleAsyncOperation","operation","err","geocode","address","result","geocodeFirstResult","reverseGeocode","location","reverseGeocodeFirstResult","geocodeWithComponentsResult","components","geocodeWithBoundsResult","bounds","geocodeWithRegionResult","region","useCallback","useEffect","useMemo","useRef","useState","PlacesClient","usePlaces","options","apiKey","baseUrl","fetchImpl","language","region","requestInit","client","isMountedRef","state","setState","pendingCountRef","runWithState","operation","executor","previous","capturedError","error","findPlaceFromText","request","textSearch","nearbySearch","placeDetails","autocomplete","queryAutocomplete","textSearchNextPage","pagetoken","delayMs","nearbySearchNextPage","buildPhotoUrl","photoReference","photoOptions","useCallback","useEffect","useMemo","useRef","useState","PlacesNewClient","usePlacesNew","options","apiKey","baseUrl","fetchImpl","languageCode","regionCode","requestInit","client","isMountedRef","state","setState","pendingCountRef","runWithState","operation","executor","previous","capturedError","error","textSearch","request","nearbySearch","placeDetails","autocomplete","getPhoto","buildPhotoUrl","photoName","photoOptions","useCallback","useEffect","useMemo","useRef","useState","GeocodingClient","useGeocodingService","options","apiKey","baseUrl","fetchImpl","language","region","channel","timeoutMs","requestInit","retryConfig","client","isMountedRef","state","setState","runWithState","operation","executor","result","error","geocode","request","reverseGeocode","useCallback","useEffect","useMemo","useState","createStreetViewPanorama","setStreetViewPosition","getStreetViewPosition","setStreetViewPov","getStreetViewPov","setStreetViewVisibility","isStreetViewVisible","useStreetView","containerId","options","instance","setInstance","isReady","setReady","memoizedHandlers","initialize","panorama","error","setPosition","position","getPosition","setPov","pov","getPov","setVisible","visible","isVisible","useState","useCallback","useEffect","useBicycling","isLoading","error","bicyclingLayer","setBicyclingLayer","isVisible","setIsVisible","createBicyclingLayer","options","bicycling","showBicycling","hideBicycling","toggleBicycling","refreshBicycling","currentMap","removeBicyclingLayer","useState","useCallback","useEffect","isMarkerClustererLoaded","useClustering","clusterer","setClusterer","isReady","setIsReady","createClusterer","mapInstance","markers","options","clustererOptions","newClusterer","addMarkersToCluster","removeMarkersFromCluster","clearCluster","redrawCluster","getClusterer","getTotalMarkers","getTotalClusters","getMarkers","useState","useCallback","getTotalDistance","getTotalDuration","getDirectionsBounds","fitMapToRoute","createDirectionsRenderer","useDirections","isLoading","setIsLoading","error","setError","result","setResult","handleAsyncOperation","operation","err","getDirections","request","directionsRequest","directionsService","directions","resolve","reject","status","distance","duration","bounds","directionsResult","renderDirectionsOnMap","mapInstance","clearDirectionsFromMap","fitMapToRouteBounds","useState","useCallback","getDistanceMatrixAsync","createDistanceMatrixService","useDistanceMatrix","isLoading","setIsLoading","error","setError","result","setResult","handleAsyncOperation","operation","err","getDistanceMatrix","request","distanceMatrixResult","createService","mapInstance","useState","useCallback","useElevation","isLoading","setIsLoading","error","setError","results","setResults","handleAsyncOperation","operation","err","getElevationForLocations","request","elevationService","elevationRequest","elevationResults","resolve","reject","status","result","getElevationAlongPath","createElevationService","useState","useCallback","useGeometry","isLoading","error","results","computeDistanceBetween","from","to","computeHeading","computeOffset","distance","heading","offset","computeOffsetOrigin","origin","computeLength","path","latLngPath","point","computeArea","computeBounds","bounds","computeCenter","avgLat","sum","avgLng","isLocationOnEdge","polyline","tolerance","pointLatLng","polylineLatLng","p","tempPolyline","encodePath","decodePath","encodedPath","useState","useCallback","useEffect","useHeatmap","isLoading","error","heatmapLayer","setHeatmapLayer","createHeatmap","options","heatmapOptions","point","heatmap","err","updateHeatmapData","data","heatmapData","setHeatmapOptions","showHeatmap","map","currentMap","hideHeatmap","removeHeatmap","useState","useCallback","useEffect","createInfoWindow","openInfoWindow","closeInfoWindow","useInfoWindows","infoWindows","setInfoWindows","activeInfoWindow","setActiveInfoWindow","createInfoWindowInstance","options","contentString","infoWindowInstance","prev","openInfoWindowInstance","marker","mapInstance","iw","closeInfoWindowInstance","closeAllInfoWindows","updateInfoWindowContent","content","removeInfoWindow","useState","useCallback","useEffect","useMapEvents","eventState","setEventState","listeners","setListeners","addEventListeners","mapInstance","handlers","map","newListeners","clickListener","event","prev","rightClickListener","doubleClickListener","dragListener","dragStartListener","dragEndListener","zoomListener","centerListener","center","boundsListener","idleListener","tilesListener","headingListener","tiltListener","removeEventListeners","_mapInstance","listener","getCurrentMapState","bounds","zoom","useState","useCallback","useMaxZoom","isLoading","setIsLoading","error","setError","result","setResult","handleAsyncOperation","operation","err","getMaxZoom","request","maxZoomService","maxZoomResult","resolve","reject","createMaxZoomService","useState","useCallback","useEffect","useTraffic","isLoading","error","trafficLayer","setTrafficLayer","isVisible","setIsVisible","createTrafficLayer","options","traffic","err","showTraffic","hideTraffic","toggleTraffic","refreshTraffic","currentMap","removeTrafficLayer","useState","useCallback","useEffect","useTransit","isLoading","error","transitLayer","setTransitLayer","isVisible","setIsVisible","createTransitLayer","options","transit","err","showTransit","hideTransit","toggleTransit","refreshTransit","currentMap","removeTransitLayer","useEffect","useRef","jsx","Map","id","className","style","children","onMapReady","mapOptions","containerRef","useRef","useMap","useEffect","useEffect","useRef","Marker","mapInstance","onMarkerCreated","markerOptions","addMarker","removeMarker","useMarkers","markerRef","useRef","useEffect","marker","useEffect","useRef","createInfoWindow","openInfoWindow","closeInfoWindow","InfoWindow","mapInstance","marker","content","position","isOpen","onClose","infoWindowRef","infoWindow","tempMarker"]}