{"version":3,"sources":["../src/client.ts","../src/services/directions.ts","../src/services/matrix.ts","../src/services/isochrones.ts","../src/services/geocoding.ts","../src/services/pois.ts","../src/services/optimization.ts","../src/services/elevation.ts","../src/services/snap.ts","../src/services/export.ts","../src/openrouteservice.ts"],"names":["OpenRouteServiceError","message","statusCode","response","rateLimitInfo","OpenRouteServiceClient","_OpenRouteServiceClient","config","apiVersion","endpoint","options","method","params","body","headers","url","searchParams","key","value","queryString","controller","timeoutId","errorMessage","responseData","responseText","error","apiKey","endpointMap","now","lastRequestTime","timeSinceLastRequest","delayNeeded","resolve","API_VERSION","DirectionsService","profile","request","MatrixService","IsochronesService","GeocodingService","POIService","OptimizationService","ElevationService","SnapService","ExportService","OpenRouteService","services","mostRecentInfo","mostRecentTime","service","info"],"mappings":";AAGO,IAAMA,EAAN,cAAoC,KAAM,CAC9C,WAAA,CAAYC,EAAwBC,CAAAA,CAA4BC,CAAAA,CAA2BC,CAAAA,CAAqE,CAC7J,MAAMH,CAAO,CAAA,CADoB,IAAA,CAAA,UAAA,CAAAC,CAAAA,CAA4B,cAAAC,CAAAA,CAA2B,IAAA,CAAA,aAAA,CAAAC,CAAAA,CAExF,IAAA,CAAK,KAAO,wBACf,CAGA,YAAA,EAAwB,CACrB,OAAO,IAAA,CAAK,UAAA,GAAe,GAC9B,CACA,YAAsB,CACnB,OAAO,IAAA,CAAK,UAAA,GAAe,GAC9B,CACA,kBAAA,EAA8B,CAC3B,OAAO,KAAK,UAAA,GAAe,GAC9B,CACA,iBAAA,EAA6B,CAC1B,OAAO,IAAA,CAAK,UAAA,GAAe,GAC9B,CACA,aAAA,EAAyB,CACtB,OAAO,IAAA,CAAK,aAAe,GAC9B,CACA,aAAA,EAAyB,CACtB,OAAO,IAAA,CAAK,UAAA,GAAe,GAC9B,CACA,kBAA4B,CACzB,OAAO,IAAA,CAAK,UAAA,GAAe,GAC9B,CACA,oBAAA,EAAgC,CAC7B,OAAO,KAAK,UAAA,GAAe,GAC9B,CAEA,gB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K,UAAA,CAAW,MAAA,EAC1B,CAKA,sBAAuB,CACpB,IAAMuC,CAAAA,CAAW,CAAC,KAAK,UAAA,CAAY,IAAA,CAAK,MAAA,CAAQ,IAAA,CAAK,WAAY,IAAA,CAAK,SAAA,CAAW,IAAA,CAAK,IAAA,CAAM,KAAK,YAAA,CAAc,IAAA,CAAK,SAAA,CAAW,IAAA,CAAK,KAAM,IAAA,CAAK,MAAM,CAAA,CAEjJC,CAAAA,CAAiB,KACjBC,CAAAA,CAAiB,IAAI,IAAA,CAAK,CAAC,EAE/B,IAAA,IAAWC,CAAAA,IAAWH,CAAAA,CAAU,CAC7B,IAAMI,CAAAA,CAAOD,CAAAA,CAAQ,oBAAA,EAAqB,CACtCC,GAAQA,CAAAA,CAAK,gBAAA,CAAmBF,CAAAA,GACjCD,CAAAA,CAAiBG,EACjBF,CAAAA,CAAiBE,CAAAA,CAAK,kBAE5B,CAEA,OAAOH,CACV,CACH","file":"index.cjs","sourcesContent":["import type { ClientConfig } from \"./types/common.js\";\n\n// Custom error class so you can catch ORS-specific errors easily\nexport class OpenRouteServiceError extends Error {\n   constructor(message: string, public statusCode?: number, public response?: unknown, public rateLimitInfo?: { limit: number; remaining: number; reset: number }) {\n      super(message);\n      this.name = \"OpenRouteServiceError\";\n   }\n\n   // Quick checks for common error types - way easier than checking status codes manually\n   isBadRequest(): boolean {\n      return this.statusCode === 400;\n   }\n   isNotFound(): boolean {\n      return this.statusCode === 404;\n   }\n   isMethodNotAllowed(): boolean {\n      return this.statusCode === 405;\n   }\n   isPayloadTooLarge(): boolean {\n      return this.statusCode === 413;\n   }\n   isRateLimited(): boolean {\n      return this.statusCode === 429;\n   }\n   isServerError(): boolean {\n      return this.statusCode === 500;\n   }\n   isNotImplemented(): boolean {\n      return this.statusCode === 501;\n   }\n   isServiceUnavailable(): boolean {\n      return this.statusCode === 503;\n   }\n\n   getRateLimitInfo() {\n      return this.rateLimitInfo;\n   }\n   getRemainingRequests(): number {\n      return this.rateLimitInfo?.remaining || 0;\n   }\n}\n\n// Base client that handles all the HTTP stuff - you probably won't use this directly\nexport class OpenRouteServiceClient {\n   private readonly config: Required<ClientConfig>;\n   private readonly baseHeaders: Record<string, string>;\n   protected readonly baseUrl: string;\n   private lastRateLimitInfo?: { limit: number; remaining: number; reset: Date; requestTimestamp: Date };\n\n   // Throttling for individual geocoding endpoints (each endpoint gets its own throttle per API key)\n   // Structure: Map<apiKey, Map<endpoint, timestamp>>\n   private static lastGeocodingRequests: Map<string, Map<string, number>> = new Map();\n   private static readonly GEOCODING_THROTTLE_MS = 300; // ~3.33 requests/second per endpoint\n\n   constructor(config: ClientConfig, apiVersion: number = 2) {\n      // Make sure they actually gave us an API key\n      if (!config.apiKey || config.apiKey.trim() === \"\") {\n         throw new OpenRouteServiceError(\"API key is required. Get one for free at https://openrouteservice.org/sign-up/\");\n      }\n\n      // Catch the common mistake of leaving the placeholder in there\n      if (config.apiKey.toLocaleLowerCase() === \"your-api-key-here\") {\n         throw new OpenRouteServiceError(\"Please replace the placeholder API key with your actual OpenRouteService API key. Get one for free at https://openrouteservice.org/sign-up/\");\n      }\n\n      this.config = { baseUrl: \"https://api.openrouteservice.org/v2\", timeout: 30000, headers: {}, ...config };\n\n      // Different API versions have different base URLs - v1 is special\n      if (apiVersion === 1) {\n         this.baseUrl = \"https://api.openrouteservice.org\";\n      } else {\n         this.baseUrl = `https://api.openrouteservice.org/v${apiVersion}`;\n      }\n\n      this.baseHeaders = { \"Content-Type\": \"application/json\", Accept: \"application/json\", Authorization: this.config.apiKey, ...this.config.headers };\n   }\n\n   private getErrorMessage(statusCode: number): string {\n      switch (statusCode) {\n         case 400:\n            return \"Bad Request: The request is incorrect and cannot be processed\";\n         case 404:\n            return \"Not Found: The requested element could not be found\";\n         case 405:\n            return \"Method Not Allowed: The specified HTTP method is not supported\";\n         case 413:\n            return \"Payload Too Large: The request exceeds the server capacity limit\";\n         case 500:\n            return \"Internal Server Error: An unexpected error occurred on the server\";\n         case 501:\n            return \"Not Implemented: The server does not support the requested functionality\";\n         case 503:\n            return \"Service Unavailable: The server is currently unavailable due to overload or maintenance\";\n         default:\n            return `HTTP ${statusCode}: Request failed`;\n      }\n   }\n\n   private async request<T>(endpoint: string, options: { method?: \"GET\" | \"POST\"; params?: Record<string, unknown>; body?: unknown; headers?: Record<string, string> } = {}): Promise<T> {\n      const { method = \"GET\", params, body, headers = {} } = options;\n      let url = `${this.baseUrl}${endpoint}`;\n\n      // Build query string for GET requests\n      if (method === \"GET\" && params) {\n         const searchParams = new URLSearchParams();\n         Object.entries(params).forEach(([key, value]) => {\n            if (value !== undefined && value !== null) {\n               if (Array.isArray(value)) {\n                  searchParams.append(key, value.join(\",\"));\n               } else {\n                  searchParams.append(key, String(value));\n               }\n            }\n         });\n         const queryString = searchParams.toString();\n         if (queryString) url += `?${queryString}`;\n      }\n\n      const controller = new AbortController();\n      const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\n\n      try {\n         const response = await fetch(url, {\n            method,\n            headers: { ...this.baseHeaders, ...headers },\n            ...(body ? { body: JSON.stringify(body) } : {}),\n            signal: controller.signal,\n         });\n\n         clearTimeout(timeoutId);\n\n         // Grab rate limit info from response headers\n         const rateLimitInfo = {\n            limit: parseInt(response.headers.get(\"x-ratelimit-limit\") || \"0\", 10),\n            remaining: parseInt(response.headers.get(\"x-ratelimit-remaining\") || \"0\", 10),\n            reset: parseInt(response.headers.get(\"x-ratelimit-reset\") || \"0\", 10),\n         };\n\n         // Keep track of the most recent rate limit info with timestamp\n         if (rateLimitInfo.limit > 0) {\n            this.lastRateLimitInfo = {\n               limit: rateLimitInfo.limit,\n               remaining: rateLimitInfo.remaining,\n               reset: new Date(rateLimitInfo.reset * 1000),\n               requestTimestamp: new Date(),\n            };\n         }\n\n         if (!response.ok) {\n            let errorMessage = this.getErrorMessage(response.status);\n            let responseData;\n            let responseText = \"\";\n\n            try {\n               responseText = await response.text();\n               if (responseText.trim()) {\n                  responseData = JSON.parse(responseText);\n                  if (responseData.error) {\n                     errorMessage = `${errorMessage} - ${responseData.error.message || responseData.error}`;\n                  }\n               }\n            } catch {\n               // Sometimes the API returns non-JSON error responses, handle gracefully\n               responseData = { rawResponse: responseText || \"Empty response\" };\n            }\n\n            throw new OpenRouteServiceError(errorMessage, response.status, responseData, rateLimitInfo);\n         }\n\n         return await response.json();\n      } catch (error) {\n         clearTimeout(timeoutId);\n\n         if (error instanceof OpenRouteServiceError) throw error;\n\n         if (error instanceof Error && error.name === \"AbortError\") {\n            throw new OpenRouteServiceError(`Request timeout after ${this.config.timeout}ms`);\n         }\n\n         throw new OpenRouteServiceError(`Network error: ${error instanceof Error ? error.message : \"Unknown error occurred\"}`);\n      }\n   }\n\n   protected async get<T>(endpoint: string, params?: Record<string, unknown>): Promise<T> {\n      return this.request<T>(endpoint, { method: \"GET\", ...(params ? { params } : {}) });\n   }\n\n   protected async post<T>(endpoint: string, body?: unknown, headers?: Record<string, string>): Promise<T> {\n      return this.request<T>(endpoint, { method: \"POST\", body, ...(headers ? { headers } : {}) });\n   }\n\n   async health(): Promise<{ status: string }> {\n      return this.get(\"/health\");\n   }\n\n   getLastRateLimitInfo() {\n      return this.lastRateLimitInfo;\n   }\n\n   /**\n    * Throttles geocoding requests to comply with API requirements.\n    * Each geocoding endpoint (autocomplete, search, reverse) should be limited to ~3.33 requests/second independently.\n    * Throttling is isolated per API key, so different API keys don't interfere with each other.\n    */\n   private async throttleGeocodingRequest(endpoint: string): Promise<void> {\n      const apiKey = this.config.apiKey;\n\n      // Initialize the endpoint map for this API key if it doesn't exist\n      if (!OpenRouteServiceClient.lastGeocodingRequests.has(apiKey)) {\n         OpenRouteServiceClient.lastGeocodingRequests.set(apiKey, new Map());\n      }\n\n      const endpointMap = OpenRouteServiceClient.lastGeocodingRequests.get(apiKey)!;\n      const now = Date.now();\n      const lastRequestTime = endpointMap.get(endpoint) || 0;\n      const timeSinceLastRequest = now - lastRequestTime;\n\n      if (timeSinceLastRequest < OpenRouteServiceClient.GEOCODING_THROTTLE_MS) {\n         const delayNeeded = OpenRouteServiceClient.GEOCODING_THROTTLE_MS - timeSinceLastRequest;\n         await new Promise(resolve => setTimeout(resolve, delayNeeded));\n      }\n\n      endpointMap.set(endpoint, Date.now());\n   }\n\n   /**\n    * Special GET method for geocoding endpoints with built-in per-endpoint throttling\n    */\n   protected async getWithGeocodingThrottle<T>(endpoint: string, params?: Record<string, unknown>): Promise<T> {\n      await this.throttleGeocodingRequest(endpoint);\n      return this.get<T>(endpoint, params);\n   }\n}\n","import type { Profile, ClientConfig } from \"../types/common.js\";\nimport type { DirectionsGetRequest, DirectionsPostRequest, DirectionsResponse, DirectionsGeoJSONResponse } from \"../types/directions.js\";\nimport { OpenRouteServiceClient } from \"../client.js\";\n\nconst API_VERSION = 2;\n\n/**\n * Directions service - basically your GPS navigator\n *\n * This is what you use when you want to get from point A to point B,\n * with turn-by-turn instructions like \"turn left in 200m\". Works for\n * cars, bikes, walking, and pretty much any way of getting around.\n */\nexport class DirectionsService extends OpenRouteServiceClient {\n   constructor(config: ClientConfig) {\n      super(config, API_VERSION);\n   }\n\n   /**\n    * Simple route calculation using GET request - good for basic routes without fancy options\n    *\n    * @param profile - How you're traveling (car, bike, walking, etc.)\n    * @param request - Start and end coordinates\n    *\n    * @example\n    * ```typescript\n    * const route = await client.directions.getRoute('driving-car', {\n    *   start: [8.681495, 49.41461],  // longitude, latitude\n    *   end: [8.686507, 49.41943]\n    * });\n    * ```\n    */\n   async getRoute(profile: Profile, request: DirectionsGetRequest): Promise<DirectionsGeoJSONResponse> {\n      const params = { start: request.start.join(\",\"), end: request.end.join(\",\") };\n      return this.get<DirectionsGeoJSONResponse>(`/directions/${profile}`, params);\n   }\n\n   /**\n    * Advanced route calculation with all the bells and whistles\n    *\n    * Use this when you need turn-by-turn instructions, alternative routes,\n    * or want to avoid highways/tolls. This is the full-featured version.\n    *\n    * @param profile - How you're traveling (car, bike, walking, etc.)\n    * @param request - All your routing preferences and options\n    *\n    * @example\n    * ```typescript\n    * const route = await client.directions.calculateRoute('driving-car', {\n    *   coordinates: [[8.681495, 49.41461], [8.686507, 49.41943]],\n    *   instructions: true,      // get turn-by-turn directions\n    *   language: 'en',         // in English please\n    *   options: {\n    *     avoid_features: ['highways', 'tollways']  // avoid highways and tolls\n    *   }\n    * });\n    * ```\n    */\n   async calculateRoute(profile: Profile, request: DirectionsPostRequest): Promise<DirectionsResponse> {\n      return this.post<DirectionsResponse>(`/directions/${profile}`, request);\n   }\n\n   /**\n    * Same as calculateRoute but returns GeoJSON format - perfect for displaying on maps\n    */\n   async calculateRouteGeoJSON(profile: Profile, request: DirectionsPostRequest): Promise<DirectionsGeoJSONResponse> {\n      const headers = { Accept: \"application/geo+json\" }; // GeoJSON endpoint requires specific Accept header\n      return this.post<DirectionsGeoJSONResponse>(`/directions/${profile}/geojson`, request, headers);\n   }\n\n   /**\n    * Simple route in GeoJSON format - basically getRoute but returns GeoJSON\n    */\n   async getRouteGeoJSON(profile: Profile, request: DirectionsGetRequest): Promise<DirectionsGeoJSONResponse> {\n      const params = { start: request.start.join(\",\"), end: request.end.join(\",\") };\n      return this.get<DirectionsGeoJSONResponse>(`/directions/${profile}/geojson`, params);\n   }\n}\n","import type { Profile, ClientConfig } from \"../types/common.js\";\nimport type { MatrixRequest, MatrixResponse } from \"../types/matrix.js\";\nimport { OpenRouteServiceClient } from \"../client.js\";\n\nconst API_VERSION = 2;\n\n/**\n * Matrix service - calculate distances and travel times between multiple points\n *\n * Think of it like a spreadsheet where you have multiple locations and want to know\n * how far each one is from all the others. Super useful for delivery route planning\n * or finding the closest store to a customer.\n */\nexport class MatrixService extends OpenRouteServiceClient {\n   constructor(config: ClientConfig) {\n      super(config, API_VERSION);\n   }\n\n   /**\n    * Calculate distance and/or duration matrix between multiple points\n    *\n    * You give it a bunch of coordinates and it tells you how far/long it takes\n    * to get from each point to every other point. Perfect for logistics and routing.\n    *\n    * @param profile - How you're traveling (car, bike, walking, etc.)\n    * @param request - Your locations and what you want to calculate\n    *\n    * @example\n    * ```typescript\n    * // Get distances and travel times between 3 points\n    * const matrix = await client.matrix.calculateMatrix('driving-car', {\n    *   locations: [\n    *     [8.681495, 49.41461],   // point A\n    *     [8.686507, 49.41943],   // point B\n    *     [8.687872, 49.420318]   // point C\n    *   ],\n    *   metrics: ['duration', 'distance']  // want both time and distance\n    * });\n    *\n    * // matrix.durations[0][1] = time from A to B\n    * // matrix.distances[0][1] = distance from A to B\n    * ```\n    *\n    * @example\n    * ```typescript\n    * // Calculate delivery times from 2 warehouses to 3 customers\n    * const matrix = await client.matrix.calculateMatrix('driving-car', {\n    *   locations: [\n    *     [8.681495, 49.41461],   // warehouse 1\n    *     [8.686507, 49.41943],   // warehouse 2\n    *     [8.687872, 49.420318],  // customer 1\n    *     [8.690123, 49.425456],  // customer 2\n    *     [8.692456, 49.428789]   // customer 3\n    *   ],\n    *   sources: [0, 1],          // only start from warehouses\n    *   destinations: [2, 3, 4],  // only deliver to customers\n    *   metrics: ['duration']\n    * });\n    * ```\n    */\n   async calculateMatrix(profile: Profile, request: MatrixRequest): Promise<MatrixResponse> {\n      return this.post<MatrixResponse>(`/matrix/${profile}`, request);\n   }\n}\n","import type { Profile, ClientConfig } from \"../types/common.js\";\nimport type { IsochroneRequest, IsochroneResponse } from \"../types/isochrones.js\";\nimport { OpenRouteServiceClient } from \"../client.js\";\n\nconst API_VERSION = 2;\n\nexport class IsochronesService extends OpenRouteServiceClient {\n   constructor(config: ClientConfig) {\n      super(config, API_VERSION);\n   }\n\n   // Calculate travel time zones - \"show me everywhere I can reach in 15 minutes\"\n   async calculateIsochrones(profile: Profile, request: IsochroneRequest): Promise<IsochroneResponse> {\n      const headers = { Accept: \"application/geo+json\" };\n      return this.post<IsochroneResponse>(`/isochrones/${profile}`, request, headers);\n   }\n}\n","import type { GeocodingRequest, ReverseGeocodingRequest, StructuredGeocodingRequest, AutocompleteRequest, GeocodingResponse } from \"../types/geocoding.js\";\nimport type { ClientConfig } from \"../types/common.js\";\nimport { OpenRouteServiceClient } from \"../client.js\";\n\n// Geocoding still uses v1 API - good ol' reliable\nconst API_VERSION = 1;\n\nexport class GeocodingService extends OpenRouteServiceClient {\n   constructor(config: ClientConfig) {\n      super(config, API_VERSION);\n   }\n\n   // Search for places by name - \"New York\", \"pizza near me\", whatever\n   // Throttled to 4 requests/second as per API requirements\n   async search(request: GeocodingRequest): Promise<GeocodingResponse> {\n      return this.getWithGeocodingThrottle<GeocodingResponse>(\"/geocode/search\", request);\n   }\n\n   // More precise search with separate address components\n   // Throttled to 4 requests/second as per API requirements\n   async searchStructured(request: StructuredGeocodingRequest): Promise<GeocodingResponse> {\n      return this.getWithGeocodingThrottle<GeocodingResponse>(\"/geocode/search/structured\", request);\n   }\n\n   // Turn coordinates back into an address - handy for \"where am I?\"\n   // Throttled to 4 requests/second as per API requirements\n   async reverse(request: ReverseGeocodingRequest): Promise<GeocodingResponse> {\n      return this.getWithGeocodingThrottle<GeocodingResponse>(\"/geocode/reverse\", request);\n   }\n\n   // Get suggestions as you type - perfect for search boxes\n   // Throttled to 4 requests/second as per API requirements\n   async autocomplete(request: AutocompleteRequest): Promise<GeocodingResponse> {\n      return this.getWithGeocodingThrottle<GeocodingResponse>(\"/geocode/autocomplete\", request);\n   }\n}\n","import type { POIRequest, POIResponse, POIStatsResponse, POICategoriesResponse } from \"../types/pois.js\";\nimport type { ClientConfig } from \"../types/common.js\";\nimport { OpenRouteServiceClient } from \"../client.js\";\n\nconst API_VERSION = 1;\n\nexport class POIService extends OpenRouteServiceClient {\n   constructor(config: ClientConfig) {\n      super(config, API_VERSION);\n   }\n\n   // Find POIs around a location - cafes, restaurants, you name it\n   async searchPOIs(request: Omit<POIRequest, \"request\">): Promise<POIResponse> {\n      const body = { ...request, request: \"pois\" };\n      return this.post<POIResponse>(\"/pois\", body);\n   }\n\n   // Get some stats about what POIs are available in an area\n   async getStats(request: Omit<POIRequest, \"request\">): Promise<POIStatsResponse> {\n      const body = { ...request, request: \"stats\" };\n      return this.post<POIStatsResponse>(\"/pois\", body);\n   }\n\n   // List all the POI categories you can search for\n   async getCategories(): Promise<POICategoriesResponse> {\n      return this.post<POICategoriesResponse>(\"/pois\", { request: \"list\" });\n   }\n}\n","import type { OptimizationRequest, OptimizationResponse } from \"../types/optimization.js\";\nimport type { ClientConfig } from \"../types/common.js\";\nimport { OpenRouteServiceClient } from \"../client.js\";\n\nconst API_VERSION = 1;\n\nexport class OptimizationService extends OpenRouteServiceClient {\n   constructor(config: ClientConfig) {\n      super(config, API_VERSION);\n   }\n\n   // Solve the traveling salesman problem - find the best route through multiple stops\n   async solve(request: OptimizationRequest): Promise<OptimizationResponse> {\n      return this.post<OptimizationResponse>(\"/optimization\", request);\n   }\n}\n","import type { ElevationPointRequest, ElevationLineRequest, ElevationPointResponse, ElevationLineResponse, ElevationGeoJSONResponse } from \"../types/elevation.js\";\nimport type { ClientConfig } from \"../types/common.js\";\nimport { OpenRouteServiceClient } from \"../client.js\";\n\nconst API_VERSION = 1;\n\nexport class ElevationService extends OpenRouteServiceClient {\n   constructor(config: ClientConfig) {\n      super(config, API_VERSION);\n   }\n\n   // Get elevation for specific points - how high above sea level?\n   async getPointElevation(request: ElevationPointRequest): Promise<ElevationPointResponse | ElevationGeoJSONResponse> {\n      return this.post<ElevationPointResponse | ElevationGeoJSONResponse>(\"/elevation/point\", request);\n   }\n\n   // Get elevation profile along a path - perfect for hiking route planning\n   async getLineElevation(request: ElevationLineRequest): Promise<ElevationLineResponse | ElevationGeoJSONResponse> {\n      return this.post<ElevationLineResponse | ElevationGeoJSONResponse>(\"/elevation/line\", request);\n   }\n}\n","import type { SnapRequest, SnapResponse, SnapGeoJSONResponse } from \"../types/snap.js\";\nimport type { ClientConfig, Profile } from \"../types/common.js\";\nimport { OpenRouteServiceClient } from \"../client.js\";\n\nconst API_VERSION = 2;\n\n/**\n * Snap service - clean up messy GPS coordinates\n *\n * Got GPS coordinates that are slightly off the road? This service will snap them\n * to the nearest actual road in the routing network. Super useful for cleaning up\n * tracking data or making sure your coordinates are actually on roads.\n */\nexport class SnapService extends OpenRouteServiceClient {\n   constructor(config: ClientConfig) {\n      super(config, API_VERSION);\n   }\n\n   /**\n    * Snap coordinates to the nearest roads - returns JSON format\n    *\n    * Takes your slightly-off coordinates and moves them to the nearest actual road.\n    * Perfect for cleaning up GPS tracks or ensuring coordinates are routable.\n    */\n   async snapLocations(profile: Profile, request: SnapRequest): Promise<SnapResponse> {\n      return this.post<SnapResponse>(`/snap/${profile}`, request);\n   }\n\n   /**\n    * Same as snapLocations but explicitly asks for JSON format\n    *\n    * Sometimes the API gets confused about formats, so this is more explicit.\n    */\n   async snapLocationsJSON(profile: Profile, request: SnapRequest): Promise<SnapResponse> {\n      return this.post<SnapResponse>(`/snap/${profile}/json`, request);\n   }\n\n   /**\n    * Snap coordinates and return as GeoJSON - great for mapping\n    *\n    * Same snapping but returns GeoJSON format, perfect if you want to display\n    * the results on a map or use with mapping libraries.\n    */\n   async snapLocationsGeoJSON(profile: Profile, request: SnapRequest): Promise<SnapGeoJSONResponse> {\n      return this.post<SnapGeoJSONResponse>(`/snap/${profile}/geojson`, request);\n   }\n}\n","/**\n * Export Service - Extract routing graph data within bounding boxes\n *\n * Ever wondered what the actual road network looks like under the hood? This service lets you\n * grab the raw graph data - nodes (intersections) and edges (road segments) with their weights.\n * Perfect for building custom routing algorithms or doing network analysis.\n */\n\nimport { OpenRouteServiceClient } from \"../client.js\";\nimport type { ClientConfig, Profile } from \"../types/common.js\";\nimport type { ExportRequest, ExportResponse, ExportTopoJSONResponse } from \"../types/export.js\";\n\nconst API_VERSION = 2;\n\nexport class ExportService extends OpenRouteServiceClient {\n   constructor(config: ClientConfig) {\n      super(config, API_VERSION);\n   }\n\n   /**\n    * Export routing graph data within a bounding box\n    *\n    * Gets you the raw network data - all the nodes and edges with their weights.\n    * This is the stuff routing algorithms actually use under the hood.\n    *\n    * @param profile - The routing profile to use (driving-car, foot-walking, etc.)\n    * @param request - Export request with bounding box and options\n    * @returns Graph data with nodes and edges\n    *\n    * @example\n    * ```typescript\n    * const graphData = await client.export.exportGraph('driving-car', {\n    *   bbox: [[8.681495, 49.41461], [8.686507, 49.41943]],\n    *   geometry: true\n    * });\n    *\n    * console.log(`Found ${graphData.nodes_count} nodes and ${graphData.edges_count} edges`);\n    * ```\n    */\n   async exportGraph(profile: Profile, request: ExportRequest): Promise<ExportResponse> {\n      return this.post(`/export/${profile}`, request);\n   }\n\n   /**\n    * Export routing graph data as JSON (explicit format)\n    *\n    * Same as exportGraph but explicitly asks for JSON format. Sometimes the API\n    * gets confused about what format you want, so this is more explicit.\n    */\n   async exportGraphJSON(profile: Profile, request: ExportRequest): Promise<ExportResponse> {\n      return this.post(`/export/${profile}/json`, request);\n   }\n\n   /**\n    * Export routing graph data as TopoJSON\n    *\n    * Gets the same data but in TopoJSON format - great for web mapping libraries\n    * that understand this format. More compact than regular GeoJSON too.\n    */\n   async exportGraphTopoJSON(profile: Profile, request: ExportRequest): Promise<ExportTopoJSONResponse> {\n      const headers = { Accept: \"application/json\" };\n      return this.post(`/export/${profile}/topojson`, request, headers);\n   }\n}\n","// Main wrapper class that gives you access to all ORS services\nimport type { ClientConfig } from \"./types/common.js\";\nimport { DirectionsService } from \"./services/directions.js\";\nimport { MatrixService } from \"./services/matrix.js\";\nimport { IsochronesService } from \"./services/isochrones.js\";\nimport { GeocodingService } from \"./services/geocoding.js\";\nimport { POIService } from \"./services/pois.js\";\nimport { OptimizationService } from \"./services/optimization.js\";\nimport { ElevationService } from \"./services/elevation.js\";\nimport { SnapService } from \"./services/snap.js\";\nimport { ExportService } from \"./services/export.js\";\n\n/**\n * The main OpenRouteService client - this is what you'll use most of the time.\n *\n * Just pass in your API key and you're good to go! Each service handles its own thing,\n * so you can mix and match as needed.\n *\n * @example\n * ```typescript\n * const ors = new OpenRouteService({ apiKey: 'your-key-here' });\n *\n * // Get a route\n * const route = await ors.directions.calculateRoute('driving-car', {\n *   coordinates: [[8.681495, 49.41461], [8.686507, 49.41943]]\n * });\n * ```\n */\nexport class OpenRouteService {\n   /** Get routes with turn-by-turn directions */\n   public readonly directions: DirectionsService;\n   /** Calculate distances/times between multiple points */\n   public readonly matrix: MatrixService;\n   /** Find what's reachable within X minutes/km from a point */\n   public readonly isochrones: IsochronesService;\n   /** Search for addresses and places */\n   public readonly geocoding: GeocodingService;\n   /** Find restaurants, ATMs, shops, etc. */\n   public readonly pois: POIService;\n   /** Solve vehicle routing problems (like delivery optimization) */\n   public readonly optimization: OptimizationService;\n   /** Get elevation data for points or along routes */\n   public readonly elevation: ElevationService;\n   /** Snap coordinates to the nearest roads */\n   public readonly snap: SnapService;\n   /** Export routing graph data from specific areas */\n   public readonly export: ExportService;\n\n   constructor(config: ClientConfig) {\n      // Each service handles its own API version internally, so no worries about version conflicts\n      this.directions = new DirectionsService(config);\n      this.matrix = new MatrixService(config);\n      this.isochrones = new IsochronesService(config);\n      this.geocoding = new GeocodingService(config);\n      this.pois = new POIService(config);\n      this.optimization = new OptimizationService(config);\n      this.elevation = new ElevationService(config);\n      this.snap = new SnapService(config);\n      this.export = new ExportService(config);\n   }\n\n   /**\n    * Quick health check to see if the API is working\n    */\n   async healthCheck(): Promise<{ status: string }> {\n      return this.directions.health();\n   }\n\n   /**\n    * Get rate limit info from the most recent request made by any service\n    */\n   getLastRateLimitInfo() {\n      const services = [this.directions, this.matrix, this.isochrones, this.geocoding, this.pois, this.optimization, this.elevation, this.snap, this.export];\n\n      let mostRecentInfo = null;\n      let mostRecentTime = new Date(0);\n\n      for (const service of services) {\n         const info = service.getLastRateLimitInfo();\n         if (info && info.requestTimestamp > mostRecentTime) {\n            mostRecentInfo = info;\n            mostRecentTime = info.requestTimestamp;\n         }\n      }\n\n      return mostRecentInfo;\n   }\n}\n"]}