UNPKG

@stadiamaps/api

Version:
1 lines 157 kB
(function(n,T){typeof exports=="object"&&typeof module<"u"?T(exports):typeof define=="function"&&define.amd?define(["exports"],T):(n=typeof globalThis<"u"?globalThis:n||self,T(n.stadiaMapsApi={}))})(this,function(n){"use strict";const T="https://api.stadiamaps.com".replace(/\/+$/,"");class tn{constructor(i={}){this.configuration=i}set config(i){this.configuration=i}get basePath(){return this.configuration.basePath!=null?this.configuration.basePath:T}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||se}get username(){return this.configuration.username}get password(){return this.configuration.password}get apiKey(){const i=this.configuration.apiKey;if(i)return typeof i=="function"?i:()=>i}get accessToken(){const i=this.configuration.accessToken;if(i)return typeof i=="function"?i:async()=>i}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}}const rn=new tn,ue=class ue{constructor(i=rn){this.configuration=i,this.fetchApi=async(r,t)=>{let o={url:r,init:t};for(const c of this.middleware)c.pre&&(o=await c.pre({fetch:this.fetchApi,...o})||o);let a;try{a=await(this.configuration.fetchApi||fetch)(o.url,o.init)}catch(c){for(const g of this.middleware)g.onError&&(a=await g.onError({fetch:this.fetchApi,url:o.url,init:o.init,error:c,response:a?a.clone():void 0})||a);if(a===void 0)throw c instanceof Error?new an(c,"The request failed and the interceptors did not return an alternative response"):c}for(const c of this.middleware)c.post&&(a=await c.post({fetch:this.fetchApi,url:o.url,init:o.init,response:a.clone()})||a);return a},this.middleware=i.middleware}withMiddleware(...i){const r=this.clone();return r.middleware=r.middleware.concat(...i),r}withPreMiddleware(...i){const r=i.map(t=>({pre:t}));return this.withMiddleware(...r)}withPostMiddleware(...i){const r=i.map(t=>({post:t}));return this.withMiddleware(...r)}isJsonMime(i){return i?ue.jsonRegex.test(i):!1}async request(i,r){const{url:t,init:o}=await this.createFetchParams(i,r),a=await this.fetchApi(t,o);if(a&&a.status>=200&&a.status<300)return a;throw new on(a,"Response returned an error code")}async createFetchParams(i,r){let t=this.configuration.basePath+i.path;i.query!==void 0&&Object.keys(i.query).length!==0&&(t+="?"+this.configuration.queryParamsStringify(i.query));const o=Object.assign({},this.configuration.headers,i.headers);Object.keys(o).forEach(Cd=>o[Cd]===void 0?delete o[Cd]:{});const a=typeof r=="function"?r:async()=>r,c={method:i.method,headers:o,body:i.body,credentials:this.configuration.credentials},g={...c,...await a({init:c,context:i})};let le;vd(g.body)||g.body instanceof URLSearchParams||Md(g.body)?le=g.body:this.isJsonMime(o["Content-Type"])?le=JSON.stringify(g.body):le=g.body;const Zy={...g,body:le};return{url:t,init:Zy}}clone(){const i=this.constructor,r=new i(this.configuration);return r.middleware=this.middleware.slice(),r}};ue.jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");let N=ue;function Md(e){return typeof Blob<"u"&&e instanceof Blob}function vd(e){return typeof FormData<"u"&&e instanceof FormData}class on extends Error{constructor(i,r){super(r),this.response=i,this.name="ResponseError"}}class an extends Error{constructor(i,r){super(r),this.cause=i,this.name="FetchError"}}class f extends Error{constructor(i,r){super(r),this.field=i,this.name="RequiredError"}}const d={csv:",",ssv:" ",tsv:" ",pipes:"|"};function se(e,i=""){return Object.keys(e).map(r=>cn(r,e[r],i)).filter(r=>r.length>0).join("&")}function cn(e,i,r=""){const t=r+(r.length?`[${e}]`:e);if(i instanceof Array){const o=i.map(a=>encodeURIComponent(String(a))).join(`&${encodeURIComponent(t)}=`);return`${encodeURIComponent(t)}=${o}`}if(i instanceof Set){const o=Array.from(i);return cn(e,o,r)}return i instanceof Date?`${encodeURIComponent(t)}=${encodeURIComponent(i.toISOString())}`:i instanceof Object?se(i,t):`${encodeURIComponent(t)}=${encodeURIComponent(String(i))}`}function kd(e,i){const r=e[i];return r!=null}function Ld(e,i){const r={};for(const t of Object.keys(e))r[t]=i(e[t]);return r}function Ed(e){for(const i of e)if(i.contentType==="multipart/form-data")return!0;return!1}class u{constructor(i,r=t=>t){this.raw=i,this.transformer=r}async value(){return this.transformer(await this.raw.json())}}class Dd{constructor(i){this.raw=i}async value(){}}class Ad{constructor(i){this.raw=i}async value(){return await this.raw.blob()}}class Id{constructor(i){this.raw=i}async value(){return await this.raw.text()}}function Gd(e){return!0}function dn(e){return un(e)}function un(e,i){return e==null?e:{golfCart:e.golf_cart==null?void 0:e.golf_cart,wheelchair:e.wheelchair==null?void 0:e.wheelchair,taxi:e.taxi==null?void 0:e.taxi,hOV:e.HOV==null?void 0:e.HOV,truck:e.truck==null?void 0:e.truck,emergency:e.emergency==null?void 0:e.emergency,pedestrian:e.pedestrian==null?void 0:e.pedestrian,car:e.car==null?void 0:e.car,bus:e.bus==null?void 0:e.bus,bicycle:e.bicycle==null?void 0:e.bicycle,motorcycle:e.motorcycle==null?void 0:e.motorcycle,moped:e.moped==null?void 0:e.moped}}function ln(e){return sn(e,!1)}function sn(e,i=!1){return e==null?e:{golf_cart:e.golfCart,wheelchair:e.wheelchair,taxi:e.taxi,HOV:e.hOV,truck:e.truck,emergency:e.emergency,pedestrian:e.pedestrian,car:e.car,bus:e.bus,bicycle:e.bicycle,motorcycle:e.motorcycle,moped:e.moped}}function Bd(e){return!0}function fn(e){return yn(e)}function yn(e,i){return e==null?e:{tel:e.tel==null?void 0:e.tel,website:e.website==null?void 0:e.website}}function gn(e){return mn(e,!1)}function mn(e,i=!1){return e==null?e:{tel:e.tel,website:e.website}}function Pd(e){return!0}function pn(e){return On(e)}function On(e,i){return e==null?e:{eurographicsGiscoId:e.eurographics_gisco_id==null?void 0:e.eurographics_gisco_id,faaCode:e.faa_code==null?void 0:e.faa_code,factualId:e.factual_id==null?void 0:e.factual_id,fifaId:e.fifa_id==null?void 0:e.fifa_id,fipsCode:e.fips_code==null?void 0:e.fips_code,frGovEpciCode:e.fr_gov_epci_code==null?void 0:e.fr_gov_epci_code,fraInseeCode:e.fra_insee_code==null?void 0:e.fra_insee_code,geonamesId:e.geonames_id==null?void 0:e.geonames_id,geoplanetId:e.geoplanet_id==null?void 0:e.geoplanet_id,hascId:e.hasc_id==null?void 0:e.hasc_id,iataCode:e.iata_code==null?void 0:e.iata_code,icaoCode:e.icao_code==null?void 0:e.icao_code,ituId:e.itu_id==null?void 0:e.itu_id,karmashapesId:e.karmashapes_id==null?void 0:e.karmashapes_id,naturalEarthId:e.natural_earth_id==null?void 0:e.natural_earth_id,nuts2021Id:e.nuts_2021_id==null?void 0:e.nuts_2021_id,quattroshapesId:e.quattroshapes_id==null?void 0:e.quattroshapes_id,quattroshapesPgId:e.quattroshapes_pg_id==null?void 0:e.quattroshapes_pg_id,usCensusGeoId:e.us_census_geo_id==null?void 0:e.us_census_geo_id,wikidataId:e.wikidata_id==null?void 0:e.wikidata_id,wikipediaPage:e.wikipedia_page==null?void 0:e.wikipedia_page}}function _n(e){return Sn(e,!1)}function Sn(e,i=!1){return e==null?e:{eurographics_gisco_id:e.eurographicsGiscoId,faa_code:e.faaCode,factual_id:e.factualId,fifa_id:e.fifaId,fips_code:e.fipsCode,fr_gov_epci_code:e.frGovEpciCode,fra_insee_code:e.fraInseeCode,geonames_id:e.geonamesId,geoplanet_id:e.geoplanetId,hasc_id:e.hascId,iata_code:e.iataCode,icao_code:e.icaoCode,itu_id:e.ituId,karmashapes_id:e.karmashapesId,natural_earth_id:e.naturalEarthId,nuts_2021_id:e.nuts2021Id,quattroshapes_id:e.quattroshapesId,quattroshapes_pg_id:e.quattroshapesPgId,us_census_geo_id:e.usCensusGeoId,wikidata_id:e.wikidataId,wikipedia_page:e.wikipediaPage}}function Vd(e){return!0}function hn(e){return Tn(e)}function Tn(e,i){return e==null?e:{brand:e.brand==null?void 0:e.brand,iata:e.iata==null?void 0:e.iata,icao:e.icao==null?void 0:e.icao,openingHours:e.opening_hours==null?void 0:e.opening_hours,operator:e.operator==null?void 0:e.operator,phone:e.phone==null?void 0:e.phone,website:e.website==null?void 0:e.website,wheelchair:e.wheelchair==null?void 0:e.wheelchair,wikidata:e.wikidata==null?void 0:e.wikidata,wikipedia:e.wikipedia==null?void 0:e.wikipedia}}function Nn(e){return Jn(e,!1)}function Jn(e,i=!1){return e==null?e:{brand:e.brand,iata:e.iata,icao:e.icao,opening_hours:e.openingHours,operator:e.operator,phone:e.phone,website:e.website,wheelchair:e.wheelchair,wikidata:e.wikidata,wikipedia:e.wikipedia}}function Wd(e){return!(!("featureCode"in e)||e.featureCode===void 0)}function bn(e){return Rn(e)}function Rn(e,i){return e==null?e:{featureCode:e.feature_code}}function Fn(e){return wn(e,!1)}function wn(e,i=!1){return e==null?e:{feature_code:e.featureCode}}function Hd(e){return!0}function fe(e){return Cn(e)}function Cn(e,i){return e==null?e:{foursquare:e.foursquare==null?void 0:fn(e.foursquare),geonames:e.geonames==null?void 0:bn(e.geonames),osm:e.osm==null?void 0:hn(e.osm),whosonfirstConcordances:e.whosonfirst_concordances==null?void 0:pn(e.whosonfirst_concordances)}}function ye(e){return Mn(e,!1)}function Mn(e,i=!1){return e==null?e:{foursquare:gn(e.foursquare),geonames:Fn(e.geonames),osm:Nn(e.osm),whosonfirst_concordances:_n(e.whosonfirstConcordances)}}function zd(e){return!0}function ge(e){return vn(e)}function vn(e,i){return e==null?e:{crossStreet:e.cross_street==null?void 0:e.cross_street,number:e.number==null?void 0:e.number,postalCode:e.postal_code==null?void 0:e.postal_code,street:e.street==null?void 0:e.street,unit:e.unit==null?void 0:e.unit}}function me(e){return kn(e,!1)}function kn(e,i=!1){return e==null?e:{cross_street:e.crossStreet,number:e.number,postal_code:e.postalCode,street:e.street,unit:e.unit}}function Ud(e){return!0}function pe(e){return Ln(e)}function Ln(e,i){return e==null?e:{countryCode:e.country_code==null?void 0:e.country_code,countryText:e.country_text==null?void 0:e.country_text,stateCode:e.state_code==null?void 0:e.state_code,stateText:e.state_text==null?void 0:e.state_text}}function Oe(e){return En(e,!1)}function En(e,i=!1){return e==null?e:{country_code:e.countryCode,country_text:e.countryText,state_code:e.stateCode,state_text:e.stateText}}function Kd(e){return!0}function Dn(e){return An(e)}function An(e,i){return e==null?e:{iso31661:e["iso_3166-1"]==null?void 0:e["iso_3166-1"],country:e.country==null?void 0:e.country,iso31662:e["iso_3166-2"]==null?void 0:e["iso_3166-2"],state:e.state==null?void 0:e.state}}function In(e){return Gn(e,!1)}function Gn(e,i=!1){return e==null?e:{"iso_3166-1":e.iso31661,country:e.country,"iso_3166-2":e.iso31662,state:e.state}}const qd={Include:"include",Exclude:"exclude"},Qd={ShapeAttributesSpeed:"shape_attributes.speed",ShapeAttributesSpeedLimit:"shape_attributes.speed_limit",ShapeAttributesTime:"shape_attributes.time",ShapeAttributesLength:"shape_attributes.length"};function $d(e){return!0}function J(e){return Bn(e)}function Bn(e,i){return e==null?e:{action:e.action==null?void 0:e.action,attributes:e.attributes==null?void 0:e.attributes}}function b(e){return Pn(e,!1)}function Pn(e,i=!1){return e==null?e:{action:e.action,attributes:e.attributes}}function Zd(e){return!0}function v(e){return Vn(e)}function Vn(e,i){return e==null?e:{maneuverPenalty:e.maneuver_penalty==null?void 0:e.maneuver_penalty,gateCost:e.gate_cost==null?void 0:e.gate_cost,gatePenalty:e.gate_penalty==null?void 0:e.gate_penalty,countryCrossingCost:e.country_crossing_cost==null?void 0:e.country_crossing_cost,countryCrossingPenalty:e.country_crossing_penalty==null?void 0:e.country_crossing_penalty,servicePenalty:e.service_penalty==null?void 0:e.service_penalty,serviceFactor:e.service_factor==null?void 0:e.service_factor,useLivingStreets:e.use_living_streets==null?void 0:e.use_living_streets,useFerry:e.use_ferry==null?void 0:e.use_ferry,ignoreRestrictions:e.ignore_restrictions==null?void 0:e.ignore_restrictions,ignoreNonVehicularRestrictions:e.ignore_non_vehicular_restrictions==null?void 0:e.ignore_non_vehicular_restrictions,ignoreOneways:e.ignore_oneways==null?void 0:e.ignore_oneways,height:e.height==null?void 0:e.height,width:e.width==null?void 0:e.width,tollBoothCost:e.toll_booth_cost==null?void 0:e.toll_booth_cost,tollBoothPenalty:e.toll_booth_penalty==null?void 0:e.toll_booth_penalty,ferryCost:e.ferry_cost==null?void 0:e.ferry_cost,useHighways:e.use_highways==null?void 0:e.use_highways,useTolls:e.use_tolls==null?void 0:e.use_tolls,useTracks:e.use_tracks==null?void 0:e.use_tracks,topSpeed:e.top_speed==null?void 0:e.top_speed,shortest:e.shortest==null?void 0:e.shortest,ignoreClosures:e.ignore_closures==null?void 0:e.ignore_closures,includeHov2:e.include_hov2==null?void 0:e.include_hov2,includeHov3:e.include_hov3==null?void 0:e.include_hov3,includeHot:e.include_hot==null?void 0:e.include_hot,alleyFactor:e.alley_factor==null?void 0:e.alley_factor}}function k(e){return Wn(e,!1)}function Wn(e,i=!1){return e==null?e:{maneuver_penalty:e.maneuverPenalty,gate_cost:e.gateCost,gate_penalty:e.gatePenalty,country_crossing_cost:e.countryCrossingCost,country_crossing_penalty:e.countryCrossingPenalty,service_penalty:e.servicePenalty,service_factor:e.serviceFactor,use_living_streets:e.useLivingStreets,use_ferry:e.useFerry,ignore_restrictions:e.ignoreRestrictions,ignore_non_vehicular_restrictions:e.ignoreNonVehicularRestrictions,ignore_oneways:e.ignoreOneways,height:e.height,width:e.width,toll_booth_cost:e.tollBoothCost,toll_booth_penalty:e.tollBoothPenalty,ferry_cost:e.ferryCost,use_highways:e.useHighways,use_tolls:e.useTolls,use_tracks:e.useTracks,top_speed:e.topSpeed,shortest:e.shortest,ignore_closures:e.ignoreClosures,include_hov2:e.includeHov2,include_hov3:e.includeHov3,include_hot:e.includeHot,alley_factor:e.alleyFactor}}function Xd(e){return!0}function Yd(e){return Hn(e)}function Hn(e,i){return e==null?e:{maneuverPenalty:e.maneuver_penalty==null?void 0:e.maneuver_penalty,gateCost:e.gate_cost==null?void 0:e.gate_cost,gatePenalty:e.gate_penalty==null?void 0:e.gate_penalty,countryCrossingCost:e.country_crossing_cost==null?void 0:e.country_crossing_cost,countryCrossingPenalty:e.country_crossing_penalty==null?void 0:e.country_crossing_penalty,servicePenalty:e.service_penalty==null?void 0:e.service_penalty,serviceFactor:e.service_factor==null?void 0:e.service_factor,useLivingStreets:e.use_living_streets==null?void 0:e.use_living_streets,useFerry:e.use_ferry==null?void 0:e.use_ferry,ignoreRestrictions:e.ignore_restrictions==null?void 0:e.ignore_restrictions,ignoreNonVehicularRestrictions:e.ignore_non_vehicular_restrictions==null?void 0:e.ignore_non_vehicular_restrictions,ignoreOneways:e.ignore_oneways==null?void 0:e.ignore_oneways}}function xd(e){return zn(e,!1)}function zn(e,i=!1){return e==null?e:{maneuver_penalty:e.maneuverPenalty,gate_cost:e.gateCost,gate_penalty:e.gatePenalty,country_crossing_cost:e.countryCrossingCost,country_crossing_penalty:e.countryCrossingPenalty,service_penalty:e.servicePenalty,service_factor:e.serviceFactor,use_living_streets:e.useLivingStreets,use_ferry:e.useFerry,ignore_restrictions:e.ignoreRestrictions,ignore_non_vehicular_restrictions:e.ignoreNonVehicularRestrictions,ignore_oneways:e.ignoreOneways}}function jd(e){return!0}function Un(e){return Kn(e)}function Kn(e,i){return e==null?e:{maneuverPenalty:e.maneuver_penalty==null?void 0:e.maneuver_penalty,gateCost:e.gate_cost==null?void 0:e.gate_cost,gatePenalty:e.gate_penalty==null?void 0:e.gate_penalty,countryCrossingCost:e.country_crossing_cost==null?void 0:e.country_crossing_cost,countryCrossingPenalty:e.country_crossing_penalty==null?void 0:e.country_crossing_penalty,servicePenalty:e.service_penalty==null?void 0:e.service_penalty,serviceFactor:e.service_factor==null?void 0:e.service_factor,useLivingStreets:e.use_living_streets==null?void 0:e.use_living_streets,useFerry:e.use_ferry==null?void 0:e.use_ferry,ignoreRestrictions:e.ignore_restrictions==null?void 0:e.ignore_restrictions,ignoreNonVehicularRestrictions:e.ignore_non_vehicular_restrictions==null?void 0:e.ignore_non_vehicular_restrictions,ignoreOneways:e.ignore_oneways==null?void 0:e.ignore_oneways,height:e.height==null?void 0:e.height,width:e.width==null?void 0:e.width,tollBoothCost:e.toll_booth_cost==null?void 0:e.toll_booth_cost,tollBoothPenalty:e.toll_booth_penalty==null?void 0:e.toll_booth_penalty,ferryCost:e.ferry_cost==null?void 0:e.ferry_cost,useHighways:e.use_highways==null?void 0:e.use_highways,useTolls:e.use_tolls==null?void 0:e.use_tolls,useTracks:e.use_tracks==null?void 0:e.use_tracks,topSpeed:e.top_speed==null?void 0:e.top_speed,shortest:e.shortest==null?void 0:e.shortest,ignoreClosures:e.ignore_closures==null?void 0:e.ignore_closures,includeHov2:e.include_hov2==null?void 0:e.include_hov2,includeHov3:e.include_hov3==null?void 0:e.include_hov3,includeHot:e.include_hot==null?void 0:e.include_hot,alleyFactor:e.alley_factor==null?void 0:e.alley_factor,usePrimary:e.use_primary==null?void 0:e.use_primary,useHills:e.use_hills==null?void 0:e.use_hills}}function qn(e){return Qn(e,!1)}function Qn(e,i=!1){return e==null?e:{maneuver_penalty:e.maneuverPenalty,gate_cost:e.gateCost,gate_penalty:e.gatePenalty,country_crossing_cost:e.countryCrossingCost,country_crossing_penalty:e.countryCrossingPenalty,service_penalty:e.servicePenalty,service_factor:e.serviceFactor,use_living_streets:e.useLivingStreets,use_ferry:e.useFerry,ignore_restrictions:e.ignoreRestrictions,ignore_non_vehicular_restrictions:e.ignoreNonVehicularRestrictions,ignore_oneways:e.ignoreOneways,height:e.height,width:e.width,toll_booth_cost:e.tollBoothCost,toll_booth_penalty:e.tollBoothPenalty,ferry_cost:e.ferryCost,use_highways:e.useHighways,use_tolls:e.useTolls,use_tracks:e.useTracks,top_speed:e.topSpeed,shortest:e.shortest,ignore_closures:e.ignoreClosures,include_hov2:e.includeHov2,include_hov3:e.includeHov3,include_hot:e.includeHot,alley_factor:e.alleyFactor,use_primary:e.usePrimary,use_hills:e.useHills}}const L={Foot:"foot",Blind:"blind",Wheelchair:"wheelchair"};function eu(e){for(const i in L)if(Object.prototype.hasOwnProperty.call(L,i)&&L[i]===e)return!0;return!1}function $n(e){return Zn(e)}function Zn(e,i){return e}function nu(e){return e}function iu(e,i){return e}function tu(e){return!0}function Xn(e){return Yn(e)}function Yn(e,i){return e==null?e:{walkingSpeed:e.walking_speed==null?void 0:e.walking_speed,walkwayFactor:e.walkway_factor==null?void 0:e.walkway_factor,sidewalkFactor:e.sidewalk_factor==null?void 0:e.sidewalk_factor,alleyFactor:e.alley_factor==null?void 0:e.alley_factor,drivewayFactor:e.driveway_factor==null?void 0:e.driveway_factor,stepPenalty:e.step_penalty==null?void 0:e.step_penalty,useFerry:e.use_ferry==null?void 0:e.use_ferry,useLivingStreets:e.use_living_streets==null?void 0:e.use_living_streets,useTracks:e.use_tracks==null?void 0:e.use_tracks,useHills:e.use_hills==null?void 0:e.use_hills,useLit:e.use_lit==null?void 0:e.use_lit,servicePenalty:e.service_penalty==null?void 0:e.service_penalty,serviceFactor:e.service_factor==null?void 0:e.service_factor,maxHikingDifficulty:e.max_hiking_difficulty==null?void 0:e.max_hiking_difficulty,bssRentCost:e.bss_rent_cost==null?void 0:e.bss_rent_cost,bssRentPenalty:e.bss_rent_penalty==null?void 0:e.bss_rent_penalty,type:e.type==null?void 0:$n(e.type)}}function xn(e){return jn(e,!1)}function jn(e,i=!1){return e==null?e:{walking_speed:e.walkingSpeed,walkway_factor:e.walkwayFactor,sidewalk_factor:e.sidewalkFactor,alley_factor:e.alleyFactor,driveway_factor:e.drivewayFactor,step_penalty:e.stepPenalty,use_ferry:e.useFerry,use_living_streets:e.useLivingStreets,use_tracks:e.useTracks,use_hills:e.useHills,use_lit:e.useLit,service_penalty:e.servicePenalty,service_factor:e.serviceFactor,max_hiking_difficulty:e.maxHikingDifficulty,bss_rent_cost:e.bssRentCost,bss_rent_penalty:e.bssRentPenalty,type:e.type}}function ru(e){return!0}function ei(e){return ni(e)}function ni(e,i){return e==null?e:{maneuverPenalty:e.maneuver_penalty==null?void 0:e.maneuver_penalty,gateCost:e.gate_cost==null?void 0:e.gate_cost,gatePenalty:e.gate_penalty==null?void 0:e.gate_penalty,countryCrossingCost:e.country_crossing_cost==null?void 0:e.country_crossing_cost,countryCrossingPenalty:e.country_crossing_penalty==null?void 0:e.country_crossing_penalty,servicePenalty:e.service_penalty==null?void 0:e.service_penalty,serviceFactor:e.service_factor==null?void 0:e.service_factor,useLivingStreets:e.use_living_streets==null?void 0:e.use_living_streets,useFerry:e.use_ferry==null?void 0:e.use_ferry,ignoreRestrictions:e.ignore_restrictions==null?void 0:e.ignore_restrictions,ignoreNonVehicularRestrictions:e.ignore_non_vehicular_restrictions==null?void 0:e.ignore_non_vehicular_restrictions,ignoreOneways:e.ignore_oneways==null?void 0:e.ignore_oneways,height:e.height==null?void 0:e.height,width:e.width==null?void 0:e.width,tollBoothCost:e.toll_booth_cost==null?void 0:e.toll_booth_cost,tollBoothPenalty:e.toll_booth_penalty==null?void 0:e.toll_booth_penalty,ferryCost:e.ferry_cost==null?void 0:e.ferry_cost,useHighways:e.use_highways==null?void 0:e.use_highways,useTolls:e.use_tolls==null?void 0:e.use_tolls,useTracks:e.use_tracks==null?void 0:e.use_tracks,topSpeed:e.top_speed==null?void 0:e.top_speed,shortest:e.shortest==null?void 0:e.shortest,ignoreClosures:e.ignore_closures==null?void 0:e.ignore_closures,includeHov2:e.include_hov2==null?void 0:e.include_hov2,includeHov3:e.include_hov3==null?void 0:e.include_hov3,includeHot:e.include_hot==null?void 0:e.include_hot,alleyFactor:e.alley_factor==null?void 0:e.alley_factor,length:e.length==null?void 0:e.length,weight:e.weight==null?void 0:e.weight,axleLoad:e.axle_load==null?void 0:e.axle_load,hazmat:e.hazmat==null?void 0:e.hazmat}}function ii(e){return ti(e,!1)}function ti(e,i=!1){return e==null?e:{maneuver_penalty:e.maneuverPenalty,gate_cost:e.gateCost,gate_penalty:e.gatePenalty,country_crossing_cost:e.countryCrossingCost,country_crossing_penalty:e.countryCrossingPenalty,service_penalty:e.servicePenalty,service_factor:e.serviceFactor,use_living_streets:e.useLivingStreets,use_ferry:e.useFerry,ignore_restrictions:e.ignoreRestrictions,ignore_non_vehicular_restrictions:e.ignoreNonVehicularRestrictions,ignore_oneways:e.ignoreOneways,height:e.height,width:e.width,toll_booth_cost:e.tollBoothCost,toll_booth_penalty:e.tollBoothPenalty,ferry_cost:e.ferryCost,use_highways:e.useHighways,use_tolls:e.useTolls,use_tracks:e.useTracks,top_speed:e.topSpeed,shortest:e.shortest,ignore_closures:e.ignoreClosures,include_hov2:e.includeHov2,include_hov3:e.includeHov3,include_hot:e.includeHot,alley_factor:e.alleyFactor,length:e.length,weight:e.weight,axle_load:e.axleLoad,hazmat:e.hazmat}}const ou={Road:"Road",Hybrid:"Hybrid",Cross:"Cross",Mountain:"Mountain"};function au(e){return!0}function ri(e){return oi(e)}function oi(e,i){return e==null?e:{maneuverPenalty:e.maneuver_penalty==null?void 0:e.maneuver_penalty,gateCost:e.gate_cost==null?void 0:e.gate_cost,gatePenalty:e.gate_penalty==null?void 0:e.gate_penalty,countryCrossingCost:e.country_crossing_cost==null?void 0:e.country_crossing_cost,countryCrossingPenalty:e.country_crossing_penalty==null?void 0:e.country_crossing_penalty,servicePenalty:e.service_penalty==null?void 0:e.service_penalty,serviceFactor:e.service_factor==null?void 0:e.service_factor,useLivingStreets:e.use_living_streets==null?void 0:e.use_living_streets,useFerry:e.use_ferry==null?void 0:e.use_ferry,ignoreRestrictions:e.ignore_restrictions==null?void 0:e.ignore_restrictions,ignoreNonVehicularRestrictions:e.ignore_non_vehicular_restrictions==null?void 0:e.ignore_non_vehicular_restrictions,ignoreOneways:e.ignore_oneways==null?void 0:e.ignore_oneways,bicycleType:e.bicycle_type==null?void 0:e.bicycle_type,cyclingSpeed:e.cycling_speed==null?void 0:e.cycling_speed,useRoads:e.use_roads==null?void 0:e.use_roads,useHills:e.use_hills==null?void 0:e.use_hills,avoidBadSurfaces:e.avoid_bad_surfaces==null?void 0:e.avoid_bad_surfaces,bssReturnCost:e.bss_return_cost==null?void 0:e.bss_return_cost,bssReturnPenalty:e.bss_return_penalty==null?void 0:e.bss_return_penalty}}function ai(e){return ci(e,!1)}function ci(e,i=!1){return e==null?e:{maneuver_penalty:e.maneuverPenalty,gate_cost:e.gateCost,gate_penalty:e.gatePenalty,country_crossing_cost:e.countryCrossingCost,country_crossing_penalty:e.countryCrossingPenalty,service_penalty:e.servicePenalty,service_factor:e.serviceFactor,use_living_streets:e.useLivingStreets,use_ferry:e.useFerry,ignore_restrictions:e.ignoreRestrictions,ignore_non_vehicular_restrictions:e.ignoreNonVehicularRestrictions,ignore_oneways:e.ignoreOneways,bicycle_type:e.bicycleType,cycling_speed:e.cyclingSpeed,use_roads:e.useRoads,use_hills:e.useHills,avoid_bad_surfaces:e.avoidBadSurfaces,bss_return_cost:e.bssReturnCost,bss_return_penalty:e.bssReturnPenalty}}const cu={LowSpeedVehicle:"low_speed_vehicle",GolfCart:"golf_cart"};function du(e){return!0}function di(e){return ui(e)}function ui(e,i){return e==null?e:{maneuverPenalty:e.maneuver_penalty==null?void 0:e.maneuver_penalty,gateCost:e.gate_cost==null?void 0:e.gate_cost,gatePenalty:e.gate_penalty==null?void 0:e.gate_penalty,countryCrossingCost:e.country_crossing_cost==null?void 0:e.country_crossing_cost,countryCrossingPenalty:e.country_crossing_penalty==null?void 0:e.country_crossing_penalty,servicePenalty:e.service_penalty==null?void 0:e.service_penalty,serviceFactor:e.service_factor==null?void 0:e.service_factor,useLivingStreets:e.use_living_streets==null?void 0:e.use_living_streets,useFerry:e.use_ferry==null?void 0:e.use_ferry,ignoreRestrictions:e.ignore_restrictions==null?void 0:e.ignore_restrictions,ignoreNonVehicularRestrictions:e.ignore_non_vehicular_restrictions==null?void 0:e.ignore_non_vehicular_restrictions,ignoreOneways:e.ignore_oneways==null?void 0:e.ignore_oneways,vehicleType:e.vehicle_type==null?void 0:e.vehicle_type,topSpeed:e.top_speed==null?void 0:e.top_speed,maxAllowedSpeedLimit:e.max_allowed_speed_limit==null?void 0:e.max_allowed_speed_limit}}function li(e){return si(e,!1)}function si(e,i=!1){return e==null?e:{maneuver_penalty:e.maneuverPenalty,gate_cost:e.gateCost,gate_penalty:e.gatePenalty,country_crossing_cost:e.countryCrossingCost,country_crossing_penalty:e.countryCrossingPenalty,service_penalty:e.servicePenalty,service_factor:e.serviceFactor,use_living_streets:e.useLivingStreets,use_ferry:e.useFerry,ignore_restrictions:e.ignoreRestrictions,ignore_non_vehicular_restrictions:e.ignoreNonVehicularRestrictions,ignore_oneways:e.ignoreOneways,vehicle_type:e.vehicleType,top_speed:e.topSpeed,max_allowed_speed_limit:e.maxAllowedSpeedLimit}}function uu(e){return!0}function fi(e){return yi(e)}function yi(e,i){return e==null?e:{maneuverPenalty:e.maneuver_penalty==null?void 0:e.maneuver_penalty,gateCost:e.gate_cost==null?void 0:e.gate_cost,gatePenalty:e.gate_penalty==null?void 0:e.gate_penalty,countryCrossingCost:e.country_crossing_cost==null?void 0:e.country_crossing_cost,countryCrossingPenalty:e.country_crossing_penalty==null?void 0:e.country_crossing_penalty,servicePenalty:e.service_penalty==null?void 0:e.service_penalty,serviceFactor:e.service_factor==null?void 0:e.service_factor,useLivingStreets:e.use_living_streets==null?void 0:e.use_living_streets,useFerry:e.use_ferry==null?void 0:e.use_ferry,ignoreRestrictions:e.ignore_restrictions==null?void 0:e.ignore_restrictions,ignoreNonVehicularRestrictions:e.ignore_non_vehicular_restrictions==null?void 0:e.ignore_non_vehicular_restrictions,ignoreOneways:e.ignore_oneways==null?void 0:e.ignore_oneways,height:e.height==null?void 0:e.height,width:e.width==null?void 0:e.width,tollBoothCost:e.toll_booth_cost==null?void 0:e.toll_booth_cost,tollBoothPenalty:e.toll_booth_penalty==null?void 0:e.toll_booth_penalty,ferryCost:e.ferry_cost==null?void 0:e.ferry_cost,useHighways:e.use_highways==null?void 0:e.use_highways,useTolls:e.use_tolls==null?void 0:e.use_tolls,useTracks:e.use_tracks==null?void 0:e.use_tracks,topSpeed:e.top_speed==null?void 0:e.top_speed,shortest:e.shortest==null?void 0:e.shortest,ignoreClosures:e.ignore_closures==null?void 0:e.ignore_closures,includeHov2:e.include_hov2==null?void 0:e.include_hov2,includeHov3:e.include_hov3==null?void 0:e.include_hov3,includeHot:e.include_hot==null?void 0:e.include_hot,alleyFactor:e.alley_factor==null?void 0:e.alley_factor,useTrails:e.use_trails==null?void 0:e.use_trails}}function gi(e){return mi(e,!1)}function mi(e,i=!1){return e==null?e:{maneuver_penalty:e.maneuverPenalty,gate_cost:e.gateCost,gate_penalty:e.gatePenalty,country_crossing_cost:e.countryCrossingCost,country_crossing_penalty:e.countryCrossingPenalty,service_penalty:e.servicePenalty,service_factor:e.serviceFactor,use_living_streets:e.useLivingStreets,use_ferry:e.useFerry,ignore_restrictions:e.ignoreRestrictions,ignore_non_vehicular_restrictions:e.ignoreNonVehicularRestrictions,ignore_oneways:e.ignoreOneways,height:e.height,width:e.width,toll_booth_cost:e.tollBoothCost,toll_booth_penalty:e.tollBoothPenalty,ferry_cost:e.ferryCost,use_highways:e.useHighways,use_tolls:e.useTolls,use_tracks:e.useTracks,top_speed:e.topSpeed,shortest:e.shortest,ignore_closures:e.ignoreClosures,include_hov2:e.includeHov2,include_hov3:e.includeHov3,include_hot:e.includeHot,alley_factor:e.alleyFactor,use_trails:e.useTrails}}function lu(e){return!0}function m(e){return pi(e)}function pi(e,i){return e==null?e:{auto:e.auto==null?void 0:v(e.auto),bus:e.bus==null?void 0:v(e.bus),taxi:e.taxi==null?void 0:v(e.taxi),truck:e.truck==null?void 0:ei(e.truck),bicycle:e.bicycle==null?void 0:ri(e.bicycle),motorScooter:e.motor_scooter==null?void 0:Un(e.motor_scooter),motorcycle:e.motorcycle==null?void 0:fi(e.motorcycle),pedestrian:e.pedestrian==null?void 0:Xn(e.pedestrian),lowSpeedVehicle:e.low_speed_vehicle==null?void 0:di(e.low_speed_vehicle)}}function p(e){return Oi(e,!1)}function Oi(e,i=!1){return e==null?e:{auto:k(e.auto),bus:k(e.bus),taxi:k(e.taxi),truck:ii(e.truck),bicycle:ai(e.bicycle),motor_scooter:qn(e.motorScooter),motorcycle:gi(e.motorcycle),pedestrian:xn(e.pedestrian),low_speed_vehicle:li(e.lowSpeedVehicle)}}const E={Auto:"auto",Bus:"bus",Taxi:"taxi",Truck:"truck",Bicycle:"bicycle",Bikeshare:"bikeshare",MotorScooter:"motor_scooter",Motorcycle:"motorcycle",Pedestrian:"pedestrian",LowSpeedVehicle:"low_speed_vehicle"};function su(e){for(const i in E)if(Object.prototype.hasOwnProperty.call(E,i)&&E[i]===e)return!0;return!1}function D(e){return _i(e)}function _i(e,i){return e}function fu(e){return e}function yu(e,i){return e}const A={Km:"km",Mi:"mi"};function gu(e){for(const i in A)if(Object.prototype.hasOwnProperty.call(A,i)&&A[i]===e)return!0;return!1}function O(e){return Si(e)}function Si(e,i){return e}function mu(e){return e}function pu(e,i){return e}const I={BgBg:"bg-BG",CaEs:"ca-ES",CsCz:"cs-CZ",DaDk:"da-DK",DeDe:"de-DE",ElGr:"el-GR",EnGb:"en-GB",EnUsXPirate:"en-US-x-pirate",EnUs:"en-US",EsEs:"es-ES",EtEe:"et-EE",FiFi:"fi-FI",FrFr:"fr-FR",HiIn:"hi-IN",HuHu:"hu-HU",ItIt:"it-IT",JaJp:"ja-JP",NbNo:"nb-NO",NlNl:"nl-NL",PlPl:"pl-PL",PtBr:"pt-BR",PtPt:"pt-PT",RoRo:"ro-RO",RuRu:"ru-RU",SkSk:"sk-SK",SlSi:"sl-SI",SvSe:"sv-SE",TrTr:"tr-TR",UkUa:"uk-UA"};function Ou(e){for(const i in I)if(Object.prototype.hasOwnProperty.call(I,i)&&I[i]===e)return!0;return!1}function y(e){return hi(e)}function hi(e,i){return e}function _u(e){return e}function Su(e,i){return e}const hu={Break:"break",Through:"through",Via:"via",BreakThrough:"break_through"};function Tu(e){return!(!("lat"in e)||e.lat===void 0||!("lon"in e)||e.lon===void 0)}function G(e){return Ti(e)}function Ti(e,i){return e==null?e:{lat:e.lat,lon:e.lon,type:e.type==null?void 0:e.type,time:e.time==null?void 0:e.time}}function B(e){return Ni(e,!1)}function Ni(e,i=!1){return e==null?e:{lat:e.lat,lon:e.lon,type:e.type,time:e.time}}const Nu={None:"none",Maneuvers:"maneuvers",Instructions:"instructions"},Ju={EdgeWalk:"edge_walk",MapSnap:"map_snap",WalkOrSnap:"walk_or_snap"};function bu(e){return!(!("costing"in e)||e.costing===void 0)}function Ru(e){return Ji(e)}function Ji(e,i){return e==null?e:{units:e.units==null?void 0:O(e.units),language:e.language==null?void 0:y(e.language),directionsType:e.directions_type==null?void 0:e.directions_type,id:e.id==null?void 0:e.id,shape:e.shape==null?void 0:e.shape.map(G),encodedPolyline:e.encoded_polyline==null?void 0:e.encoded_polyline,costing:D(e.costing),costingOptions:e.costing_options==null?void 0:m(e.costing_options),shapeMatch:e.shape_match==null?void 0:e.shape_match}}function Fu(e){return bi(e,!1)}function bi(e,i=!1){return e==null?e:{units:e.units,language:e.language,directions_type:e.directionsType,id:e.id,shape:e.shape==null?void 0:e.shape.map(B),encoded_polyline:e.encodedPolyline,costing:e.costing,costing_options:p(e.costingOptions),shape_match:e.shapeMatch}}function wu(e){return!0}function Ri(e){return Fi(e)}function Fi(e,i){return e==null?e:{mountain:e.mountain==null?void 0:e.mountain,local:e.local==null?void 0:e.local,regional:e.regional==null?void 0:e.regional,national:e.national==null?void 0:e.national}}function wi(e){return Ci(e,!1)}function Ci(e,i=!1){return e==null?e:{mountain:e.mountain,local:e.local,regional:e.regional,national:e.national}}const P={Openstreetmap:"openstreetmap",Openaddresses:"openaddresses",Whosonfirst:"whosonfirst",Geonames:"geonames",Foursquare:"foursquare"};function Cu(e){for(const i in P)if(Object.prototype.hasOwnProperty.call(P,i)&&P[i]===e)return!0;return!1}function _e(e){return Mi(e)}function Mi(e,i){return e}function Se(e){return e}function Mu(e,i){return e}const V={Venue:"venue",Address:"address",Street:"street",Country:"country",Macroregion:"macroregion",Region:"region",Macrocounty:"macrocounty",County:"county",Locality:"locality",Localadmin:"localadmin",Borough:"borough",Neighbourhood:"neighbourhood",Postalcode:"postalcode",Coarse:"coarse",Dependency:"dependency",Macrohood:"macrohood",Marinearea:"marinearea",Disputed:"disputed",Empire:"empire",Continent:"continent",Ocean:"ocean"};function vu(e){for(const i in V)if(Object.prototype.hasOwnProperty.call(V,i)&&V[i]===e)return!0;return!1}function he(e){return vi(e)}function vi(e,i){return e}function Te(e){return e}function ku(e,i){return e}function Ne(e){return"text"in e}function Lu(e){return Je(e)}function Je(e,i){return e==null?e:{text:e.text==null?void 0:e.text,focusPointLat:e["focus.point.lat"]==null?void 0:e["focus.point.lat"],focusPointLon:e["focus.point.lon"]==null?void 0:e["focus.point.lon"],boundaryRectMinLat:e["boundary.rect.min_lat"]==null?void 0:e["boundary.rect.min_lat"],boundaryRectMaxLat:e["boundary.rect.max_lat"]==null?void 0:e["boundary.rect.max_lat"],boundaryRectMinLon:e["boundary.rect.min_lon"]==null?void 0:e["boundary.rect.min_lon"],boundaryRectMaxLon:e["boundary.rect.max_lon"]==null?void 0:e["boundary.rect.max_lon"],boundaryCircleLat:e["boundary.circle.lat"]==null?void 0:e["boundary.circle.lat"],boundaryCircleLon:e["boundary.circle.lon"]==null?void 0:e["boundary.circle.lon"],boundaryCircleRadius:e["boundary.circle.radius"]==null?void 0:e["boundary.circle.radius"],boundaryCountry:e["boundary.country"]==null?void 0:e["boundary.country"],boundaryGid:e["boundary.gid"]==null?void 0:e["boundary.gid"],layers:e.layers==null?void 0:e.layers.map(he),sources:e.sources==null?void 0:e.sources.map(_e),size:e.size==null?void 0:e.size,lang:e.lang==null?void 0:e.lang}}function ki(e){return Li(e,!1)}function Li(e,i=!1){return e==null?e:{text:e.text,"focus.point.lat":e.focusPointLat,"focus.point.lon":e.focusPointLon,"boundary.rect.min_lat":e.boundaryRectMinLat,"boundary.rect.max_lat":e.boundaryRectMaxLat,"boundary.rect.min_lon":e.boundaryRectMinLon,"boundary.rect.max_lon":e.boundaryRectMaxLon,"boundary.circle.lat":e.boundaryCircleLat,"boundary.circle.lon":e.boundaryCircleLon,"boundary.circle.radius":e.boundaryCircleRadius,"boundary.country":e.boundaryCountry,"boundary.gid":e.boundaryGid,layers:e.layers==null?void 0:e.layers.map(Te),sources:e.sources==null?void 0:e.sources.map(Se),size:e.size,lang:e.lang}}function Eu(e){return!0}function Du(e){return be(e)}function be(e,i){return e==null?e:{address:e.address==null?void 0:e.address,neighbourhood:e.neighbourhood==null?void 0:e.neighbourhood,borough:e.borough==null?void 0:e.borough,locality:e.locality==null?void 0:e.locality,county:e.county==null?void 0:e.county,region:e.region==null?void 0:e.region,postalcode:e.postalcode==null?void 0:e.postalcode,country:e.country==null?void 0:e.country,focusPointLat:e["focus.point.lat"]==null?void 0:e["focus.point.lat"],focusPointLon:e["focus.point.lon"]==null?void 0:e["focus.point.lon"],boundaryRectMinLat:e["boundary.rect.min_lat"]==null?void 0:e["boundary.rect.min_lat"],boundaryRectMaxLat:e["boundary.rect.max_lat"]==null?void 0:e["boundary.rect.max_lat"],boundaryRectMinLon:e["boundary.rect.min_lon"]==null?void 0:e["boundary.rect.min_lon"],boundaryRectMaxLon:e["boundary.rect.max_lon"]==null?void 0:e["boundary.rect.max_lon"],boundaryCircleLat:e["boundary.circle.lat"]==null?void 0:e["boundary.circle.lat"],boundaryCircleLon:e["boundary.circle.lon"]==null?void 0:e["boundary.circle.lon"],boundaryCircleRadius:e["boundary.circle.radius"]==null?void 0:e["boundary.circle.radius"],boundaryCountry:e["boundary.country"]==null?void 0:e["boundary.country"],boundaryGid:e["boundary.gid"]==null?void 0:e["boundary.gid"],layers:e.layers==null?void 0:e.layers.map(he),sources:e.sources==null?void 0:e.sources.map(_e),size:e.size==null?void 0:e.size,lang:e.lang==null?void 0:e.lang}}function Ei(e){return Di(e,!1)}function Di(e,i=!1){return e==null?e:{address:e.address,neighbourhood:e.neighbourhood,borough:e.borough,locality:e.locality,county:e.county,region:e.region,postalcode:e.postalcode,country:e.country,"focus.point.lat":e.focusPointLat,"focus.point.lon":e.focusPointLon,"boundary.rect.min_lat":e.boundaryRectMinLat,"boundary.rect.max_lat":e.boundaryRectMaxLat,"boundary.rect.min_lon":e.boundaryRectMinLon,"boundary.rect.max_lon":e.boundaryRectMaxLon,"boundary.circle.lat":e.boundaryCircleLat,"boundary.circle.lon":e.boundaryCircleLon,"boundary.circle.radius":e.boundaryCircleRadius,"boundary.country":e.boundaryCountry,"boundary.gid":e.boundaryGid,layers:e.layers==null?void 0:e.layers.map(Te),sources:e.sources==null?void 0:e.sources.map(Se),size:e.size,lang:e.lang}}function Ai(e){return Ii(e)}function Ii(e,i){return e==null||typeof e!="object"?e:Ne(e)?Je(e):be(e)}function Gi(e){return Bi(e,!1)}function Bi(e,i=!1){return e==null||typeof e!="object"?e:Ne(e)?ki(e):Ei(e)}const Au={V1Search:"/v1/search",V1SearchStructured:"/v1/search/structured"};function Iu(e){return!0}function Gu(e){return Pi(e)}function Pi(e,i){return e==null?e:{endpoint:e.endpoint==null?void 0:e.endpoint,query:e.query==null?void 0:Ai(e.query)}}function Vi(e){return Wi(e,!1)}function Wi(e,i=!1){return e==null?e:{endpoint:e.endpoint,query:Gi(e.query)}}function Bu(e){return!0}function Hi(e){return zi(e)}function zi(e,i){return e==null?e:{attribution:e.attribution==null?void 0:e.attribution,query:e.query==null?void 0:e.query,warnings:e.warnings==null?void 0:e.warnings,errors:e.errors==null?void 0:e.errors}}function Ui(e){return Ki(e,!1)}function Ki(e,i=!1){return e==null?e:{attribution:e.attribution,query:e.query,warnings:e.warnings,errors:e.errors}}const Pu={Point:"Point",MultiPoint:"MultiPoint",LineString:"LineString",MultiLineString:"MultiLineString",Polygon:"Polygon",MultiPolygon:"MultiPolygon"};function Vu(e){return!(!("type"in e)||e.type===void 0||!("coordinates"in e)||e.coordinates===void 0)}function qi(e){return Qi(e)}function Qi(e,i){return e==null?e:{type:e.type,coordinates:e.coordinates}}function $i(e){return Zi(e,!1)}function Zi(e,i=!1){return e==null?e:{type:e.type,coordinates:e.coordinates}}function Wu(e){return!0}function Xi(e){return Yi(e)}function Yi(e,i){return e==null?e:{...e,website:e.website==null?void 0:e.website,wikipedia:e.wikipedia==null?void 0:e.wikipedia,wikidata:e.wikidata==null?void 0:e.wikidata,phone:e.phone==null?void 0:e.phone}}function xi(e){return ji(e,!1)}function ji(e,i=!1){return e==null?e:{...e,website:e.website,wikipedia:e.wikipedia,wikidata:e.wikidata,phone:e.phone}}function Hu(e){return!0}function et(e){return nt(e)}function nt(e,i){return e==null?e:{...e,osm:e.osm==null?void 0:Xi(e.osm)}}function it(e){return tt(e,!1)}function tt(e,i=!1){return e==null?e:{...e,osm:xi(e.osm)}}const zu={Point:"point",Centroid:"centroid"},Uu={Exact:"exact",Interpolated:"interpolated",Fallback:"fallback"};function Ku(e){return!0}function rt(e){return ot(e)}function ot(e,i){return e==null?e:{...e,gid:e.gid==null?void 0:e.gid,sourceId:e.source_id==null?void 0:e.source_id,label:e.label==null?void 0:e.label,layer:e.layer==null?void 0:e.layer,source:e.source==null?void 0:e.source,name:e.name==null?void 0:e.name,accuracy:e.accuracy==null?void 0:e.accuracy,addendum:e.addendum==null?void 0:et(e.addendum),continent:e.continent==null?void 0:e.continent,continentGid:e.continent_gid==null?void 0:e.continent_gid,country:e.country==null?void 0:e.country,countryA:e.country_a==null?void 0:e.country_a,countryCode:e.country_code==null?void 0:e.country_code,countryGid:e.country_gid==null?void 0:e.country_gid,neighbourhood:e.neighbourhood==null?void 0:e.neighbourhood,neighbourhoodGid:e.neighbourhood_gid==null?void 0:e.neighbourhood_gid,borough:e.borough==null?void 0:e.borough,boroughGid:e.borough_gid==null?void 0:e.borough_gid,postalcode:e.postalcode==null?void 0:e.postalcode,street:e.street==null?void 0:e.street,housenumber:e.housenumber==null?void 0:e.housenumber,locality:e.locality==null?void 0:e.locality,localityGid:e.locality_gid==null?void 0:e.locality_gid,county:e.county==null?void 0:e.county,countyGid:e.county_gid==null?void 0:e.county_gid,region:e.region==null?void 0:e.region,regionA:e.region_a==null?void 0:e.region_a,regionGid:e.region_gid==null?void 0:e.region_gid,localadmin:e.localadmin==null?void 0:e.localadmin,localadminGid:e.localadmin_gid==null?void 0:e.localadmin_gid,matchType:e.match_type==null?void 0:e.match_type,confidence:e.confidence==null?void 0:e.confidence}}function at(e){return ct(e,!1)}function ct(e,i=!1){return e==null?e:{...e,gid:e.gid,source_id:e.sourceId,label:e.label,layer:e.layer,source:e.source,name:e.name,accuracy:e.accuracy,addendum:it(e.addendum),continent:e.continent,continent_gid:e.continentGid,country:e.country,country_a:e.countryA,country_code:e.countryCode,country_gid:e.countryGid,neighbourhood:e.neighbourhood,neighbourhood_gid:e.neighbourhoodGid,borough:e.borough,borough_gid:e.boroughGid,postalcode:e.postalcode,street:e.street,housenumber:e.housenumber,locality:e.locality,locality_gid:e.localityGid,county:e.county,county_gid:e.countyGid,region:e.region,region_a:e.regionA,region_gid:e.regionGid,localadmin:e.localadmin,localadmin_gid:e.localadminGid,match_type:e.matchType,confidence:e.confidence}}const qu={Feature:"Feature"};function Qu(e){return!(!("type"in e)||e.type===void 0||!("geometry"in e)||e.geometry===void 0)}function dt(e){return ut(e)}function ut(e,i){return e==null?e:{type:e.type,geometry:qi(e.geometry),properties:e.properties==null?void 0:rt(e.properties),bbox:e.bbox==null?void 0:e.bbox}}function lt(e){return st(e,!1)}function st(e,i=!1){return e==null?e:{type:e.type,geometry:$i(e.geometry),properties:at(e.properties),bbox:e.bbox}}function $u(e){return!(!("geocoding"in e)||e.geocoding===void 0||!("features"in e)||e.features===void 0)}function h(e){return ft(e)}function ft(e,i){return e==null?e:{geocoding:Hi(e.geocoding),bbox:e.bbox==null?void 0:e.bbox,features:e.features.map(dt)}}function yt(e){return gt(e,!1)}function gt(e,i=!1){return e==null?e:{geocoding:Ui(e.geocoding),bbox:e.bbox,features:e.features.map(lt)}}function Zu(e){return!(!("status"in e)||e.status===void 0)}function mt(e){return pt(e)}function pt(e,i){return e==null?e:{status:e.status,response:e.response==null?void 0:h(e.response),msg:e.msg==null?void 0:e.msg}}function Xu(e){return Ot(e,!1)}function Ot(e,i=!1){return e==null?e:{status:e.status,response:yt(e.response),msg:e.msg}}function Yu(e){return!(!("gid"in e)||e.gid===void 0||!("name"in e)||e.name===void 0)}function l(e){return _t(e)}function _t(e,i){return e==null?e:{abbreviation:e.abbreviation==null?void 0:e.abbreviation,gid:e.gid,name:e.name}}function s(e){return St(e,!1)}function St(e,i=!1){return e==null?e:{abbreviation:e.abbreviation,gid:e.gid,name:e.name}}function xu(e){return!0}function ht(e){return Tt(e)}function Tt(e,i){return e==null?e:{borough:e.borough==null?void 0:l(e.borough),continent:e.continent==null?void 0:l(e.continent),country:e.country==null?void 0:l(e.country),county:e.county==null?void 0:l(e.county),dependency:e.dependency==null?void 0:l(e.dependency),localadmin:e.localadmin==null?void 0:l(e.localadmin),locality:e.locality==null?void 0:l(e.locality),macrocounty:e.macrocounty==null?void 0:l(e.macrocounty),macroregion:e.macroregion==null?void 0:l(e.macroregion),marinearea:e.marinearea==null?void 0:l(e.marinearea),neighbourhood:e.neighbourhood==null?void 0:l(e.neighbourhood),ocean:e.ocean==null?void 0:l(e.ocean),region:e.region==null?void 0:l(e.region)}}function Nt(e){return Jt(e,!1)}function Jt(e,i=!1){return e==null?e:{borough:s(e.borough),continent:s(e.continent),country:s(e.country),county:s(e.county),dependency:s(e.dependency),localadmin:s(e.localadmin),locality:s(e.locality),macrocounty:s(e.macrocounty),macroregion:s(e.macroregion),marinearea:s(e.marinearea),neighbourhood:s(e.neighbourhood),ocean:s(e.ocean),region:s(e.region)}}function ju(e){return!(!("whosonfirst"in e)||e.whosonfirst===void 0)}function Re(e){return bt(e)}function bt(e,i){return e==null?e:{iso3166A2:e.iso_3166_a2==null?void 0:e.iso_3166_a2,iso3166A3:e.iso_3166_a3==null?void 0:e.iso_3166_a3,whosonfirst:ht(e.whosonfirst)}}function Fe(e){return Rt(e,!1)}function Rt(e,i=!1){return e==null?e:{iso_3166_a2:e.iso3166A2,iso_3166_a3:e.iso3166A3,whosonfirst:Nt(e.whosonfirst)}}function el(e){return!0}function Ft(e){return wt(e)}function wt(e,i){return e==null?e:{time:e.time==null?void 0:e.time,distance:e.distance==null?void 0:e.distance,color:e.color==null?void 0:e.color}}function Ct(e){return Mt(e,!1)}function Mt(e,i=!1){return e==null?e:{time:e.time,distance:e.distance,color:e.color}}function nl(e){return!(!("lat"in e)||e.lat===void 0||!("lon"in e)||e.lon===void 0)}function _(e){return vt(e)}function vt(e,i){return e==null?e:{lat:e.lat,lon:e.lon}}function S(e){return kt(e,!1)}function kt(e,i=!1){return e==null?e:{lat:e.lat,lon:e.lon}}const W={Auto:"auto",Bus:"bus",Taxi:"taxi",Truck:"truck",Bicycle:"bicycle",Bikeshare:"bikeshare",MotorScooter:"motor_scooter",Motorcycle:"motorcycle",Pedestrian:"pedestrian",LowSpeedVehicle:"low_speed_vehicle"};function il(e){for(const i in W)if(Object.prototype.hasOwnProperty.call(W,i)&&W[i]===e)return!0;return!1}function we(e){return Lt(e)}function Lt(e,i){return e}function tl(e){return e}function rl(e,i){return e}const ol={None:"none",Maneuvers:"maneuvers",Instructions:"instructions"};function al(e){return!0}function cl(e){return Et(e)}function Et(e,i){return e==null?e:{units:e.units==null?void 0:O(e.units),language:e.language==null?void 0:y(e.language),directionsType:e.directions_type==null?void 0:e.directions_type}}function dl(e){return Dt(e,!1)}function Dt(e,i=!1){return e==null?e:{units:e.units,language:e.language,directions_type:e.directionsType}}function ul(e){return!0}function At(e){return It(e)}function It(e,i){return e==null?e:{exitNumber:e.exit_number==null?void 0:e.exit_number,exitBranch:e.exit_branch==null?void 0:e.exit_branch,exitToward:e.exit_toward==null?void 0:e.exit_toward,exitName:e.exit_name==null?void 0:e.exit_name}}function Gt(e){return Bt(e,!1)}function Bt(e,i=!1){return e==null?e:{exit_number:e.exitNumber,exit_branch:e.exitBranch,exit_toward:e.exitToward,exit_name:e.exitName}}const H={Road:"road",Ramp:"ramp",TurnChannel:"turn_channel",Track:"track",Driveway:"driveway",Alley:"alley",ParkingAisle:"parking_aisle",EmergencyAccess:"emergency_access",DriveThrough:"drive_through",Culdesac:"culdesac",LivingStreet:"living_street",ServiceRoad:"service_road",Cycleway:"cycleway",MountainBike:"mountain_bike",Sidewalk:"sidewalk",Footway:"footway",Steps:"steps",Path:"path",Pedestrian:"pedestrian",PedestrianCrossing:"pedestrian_crossing",Bridleway:"bridleway",RestArea:"rest_area",ServiceArea:"service_area",Other:"other",Ferry:"ferry",RailFerry:"rail-ferry",Rail:"rail",Bus:"bus",EgressConnection:"egress_connection",PlatformConnection:"platform_connection",TransitConnection:"transit_connection"};function ll(e){for(const i in H)if(Object.prototype.hasOwnProperty.call(H,i)&&H[i]===e)return!0;return!1}function Ce(e){return Pt(e)}function Pt(e,i){return e}function sl(e){return e}function fl(e,i){return e}const z={Forward:"forward",Backward:"backward",Both:"both"};function yl(e){for(const i in z)if(Object.prototype.hasOwnProperty.call(z,i)&&z[i]===e)return!0;return!1}function R(e){return Vt(e)}function Vt(e,i){return e}function gl(e){return e}function ml(e,i){return e}const U={Motorway:"motorway",Trunk:"trunk",Primary:"primary",Secondary:"secondary",Tertiary:"tertiary",Unclassified:"unclassified",Residential:"residential",ServiceOther:"service_other"};function pl(e){for(const i in U)if(Object.prototype.hasOwnProperty.call(U,i)&&U[i]===e)return!0;return!1}function F(e){return Wt(e)}function Wt(e,i){return e}function Ol(e){return e}function _l(e,i){return e}function Sl(e){return!0}function Ht(e){return zt(e)}function zt(e,i){return e==null?e:{beginHeading:e.begin_heading==null?void 0:e.begin_heading,fromEdgeNameConsistency:e.from_edge_name_consistency==null?void 0:e.from_edge_name_consistency,toEdgeNameConsistency:e.to_edge_name_consistency==null?void 0:e.to_edge_name_consistency,driveability:e.driveability==null?void 0:R(e.driveability),cyclability:e.cyclability==null?void 0:R(e.cyclability),walkability:e.walkability==null?void 0:R(e.walkability),use:e.use==null?void 0:Ce(e.use),roadClass:e.road_class==null?void 0:F(e.road_class)}}function Ut(e){return Kt(e,!1)}function Kt(e,i=!1){return e==null?e:{begin_heading:e.beginHeading,from_edge_name_consistency:e.fromEdgeNameConsistency,to_edge_name_consistency:e.toEdgeNameConsistency,driveability:e.driveability,cyclability:e.cyclability,walkability:e.walkability,use:e.use,road_class:e.roadClass}}const K={StreetIntersection:"street_intersection",Gate:"gate",Bollard:"bollard",T