@tomtom-org/maps-sdk 0.36.0 → 0.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@tomtom-org/maps-sdk",
3
3
  "author": "TomTom International B.V.",
4
4
  "license": "See in LICENSE.txt",
5
- "version": "0.36.0",
5
+ "version": "0.36.1",
6
6
  "description": "TomTom Maps for JavaScript",
7
7
  "keywords": [
8
8
  "tomtom",
@@ -1,2 +1,2 @@
1
- import{mergeFromGlobal as e,generateTomTomHeaders as t,getPosition as n,toPointFeature as r,views as o,bboxFromGeoJSON as i,bboxOnlyIfWithArea as s,generateId as a,bboxFromCoordsArray as c,plugTypes as u,currentTypes as p,avoidableTypes as l,getPositionStrict as A,getRoutePlanningLocationType as d,inputSectionTypesWithGuidance as R,inputSectionTypes as E,indexedMagnitudes as T}from"@tomtom-org/maps-sdk/core";var _=/* @__PURE__ */(e=>(e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.FORBIDDEN=403]="FORBIDDEN",e))(_||{});class h extends Error{constructor(e,t,n){super(e),this.service=t,this.issues=n,Error.captureStackTrace&&Error.captureStackTrace(this,h)}}const S={[_.TOO_MANY_REQUESTS]:"Too Many Requests: The API Key is over QPS (Queries per second)",[_.FORBIDDEN]:"Request failed with status code 403"};class I extends h{constructor(e,t,n){super(e,t),this.status=n,this.status&&S[this.status]&&(this.message=S[this.status])}}const g=(e,t)=>{const{data:n,message:r,status:o}=e;return new I(n?.error||n?.errorText||r,t,o)},f=(e,t,n)=>{if(e.status){const r=e;return n?n(r,t):g(r,t)}return new h(e.message,t)},m=(e,t)=>new h(e.message,t,e.issues);function N(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:/* @__PURE__ */new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=s.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class i extends o{}function s(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const n of o._zod.deferred)n();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class O extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const y={};function C(e){return y}function v(e,t){return"bigint"==typeof t?t.toString():t}function P(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function L(e){return null==e}function U(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const b=Symbol("evaluating");function M(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==b)return void 0===r&&(r=b,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function w(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function H(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}const D="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function G(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const j=/* @__PURE__ */new Set(["string","number","symbol"]);function z(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function x(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function B(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function F(e,t){if(!function(e){if(!1===G(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==G(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=H(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return w(this,"shape",n),n},checks:[]});return x(e,r)}function k(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function W(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function V(e){return"string"==typeof e?e:e?.message}function Y(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=V(e.inst?._zod.def?.error?.(e))??V(t?.error?.(e))??V(n.customError?.(e))??V(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function K(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}const $=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,v,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Z=N("$ZodError",$),q=N("$ZodError",$,{Parent:Error});function J(e){const t=[],n=e.map(e=>"object"==typeof e?e.key:e);for(const r of n)"number"==typeof r?t.push(`[${r}]`):"symbol"==typeof r?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}const Q=/* @__PURE__ */(e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new O;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>Y(e,i,C())));throw D(t,o?.callee),t}return s.value})(q),X=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>Y(e,i,C())));throw D(t,o?.callee),t}return s.value},ee=/* @__PURE__ */X(q),te=/* @__PURE__ */(e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new O;return i.issues.length?{success:!1,error:new(e??Z)(i.issues.map(e=>Y(e,o,C())))}:{success:!0,data:i.value}})(q),ne=/* @__PURE__ */(e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>Y(e,o,C())))}:{success:!0,data:i.value}})(q),re=/^-?\d+(?:\.\d+)?/,oe=/^(?:true|false)$/i,ie=/^undefined$/i,se=/* @__PURE__ */N("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ae={number:"number",bigint:"bigint",object:"date"},ce=/* @__PURE__ */N("$ZodCheckLessThan",(e,t)=>{se.init(e,t);const n=ae[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ue=/* @__PURE__ */N("$ZodCheckGreaterThan",(e,t)=>{se.init(e,t);const n=ae[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pe=/* @__PURE__ */N("$ZodCheckMaxLength",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!L(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=K(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),le=/* @__PURE__ */N("$ZodCheckMinLength",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!L(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=K(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ae=/* @__PURE__ */N("$ZodCheckLengthEquals",(e,t)=>{var n;se.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!L(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=K(r),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),de={major:4,minor:1,patch:13},Re=/* @__PURE__ */N("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=de;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const t of o._zod.onattach)t(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=k(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new O;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(o||(o=k(e,t)))});else{if(e.issues.length===t)continue;o||(o=k(e,t))}}return r?r.then(()=>e):e},n=(n,o,i)=>{if(k(n))return n.aborted=!0,n;const s=t(o,r,i);if(s instanceof Promise){if(!1===i.async)throw new O;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){const t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,i)):n(t,o,i)}const s=e._zod.parse(o,i);if(s instanceof Promise){if(!1===i.async)throw new O;return s.then(e=>t(e,r,i))}return t(s,r,i)}}e["~standard"]={validate:t=>{try{const n=te(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return ne(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),Ee=/* @__PURE__ */N("$ZodString",(e,t)=>{var n;Re.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),Te=/* @__PURE__ */N("$ZodNumber",(e,t)=>{Re.init(e,t),e._zod.pattern=e._zod.bag.pattern??re,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(s){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),_e=/* @__PURE__ */N("$ZodBoolean",(e,t)=>{Re.init(e,t),e._zod.pattern=oe,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(i){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),he=/* @__PURE__ */N("$ZodUndefined",(e,t)=>{Re.init(e,t),e._zod.pattern=ie,e._zod.values=/* @__PURE__ */new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}}),Se=/* @__PURE__ */N("$ZodAny",(e,t)=>{Re.init(e,t),e._zod.parse=e=>e}),Ie=/* @__PURE__ */N("$ZodDate",(e,t)=>{Re.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(s){}const o=n.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),n}});function ge(e,t,n){e.issues.length&&t.issues.push(...W(n,e.issues)),t.value[n]=e.value}const fe=/* @__PURE__ */N("$ZodArray",(e,t)=>{Re.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then(t=>ge(t,n,e))):ge(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function me(e,t,n,r){e.issues.length&&t.issues.push(...W(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Ne(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}const Oe=/* @__PURE__ */N("$ZodObject",(e,t)=>{Re.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=P(()=>Ne(t));M(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=/* @__PURE__ */new Set);for(const e of r.values)n[t].add(e)}}return n});const o=G,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=s.shape;for(const e of s.keys){const r=u[e]._zod.run({value:a[e],issues:[]},n);r instanceof Promise?c.push(r.then(n=>me(n,t,e,a))):me(r,t,e,a)}return i?function(e,t,n,r,o,i){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const p in t){if(a.has(p))continue;if("never"===u){s.push(p);continue}const o=c.run({value:t[p],issues:[]},r);o instanceof Promise?e.push(o.then(e=>me(e,n,p,t))):me(o,n,p,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}});function ye(e,t,n,r){for(const i of e)if(0===i.issues.length)return t.value=i.value,t;const o=e.filter(e=>!k(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Y(e,r,C())))}),t)}const Ce=/* @__PURE__ */N("$ZodUnion",(e,t)=>{Re.init(e,t),M(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),M(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),M(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),M(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>U(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>ye(t,o,e,i)):ye(a,o,e,i)}}),ve=/* @__PURE__ */N("$ZodDiscriminatedUnion",(e,t)=>{Ce.init(e,t);const n=e._zod.parse;M(e._zod,"propValues",()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=/* @__PURE__ */new Set);for(const r of n)e[t].add(r)}}return e});const r=P(()=>{const e=t.options,n=/* @__PURE__ */new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(o,i)=>{const s=o.value;if(!G(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}}),Pe=/* @__PURE__ */N("$ZodTuple",(e,t)=>{Re.init(e,t);const n=t.items;e._zod.parse=(r,o)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const s=[],a=[...n].reverse().findIndex(e=>"optional"!==e._zod.optin),c=-1===a?0:n.length-a;if(!t.rest){const t=i.length>n.length,o=i.length<c-1;if(t||o)return r.issues.push({...t?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),r}let u=-1;for(const e of n){if(u++,u>=i.length&&u>=c)continue;const t=e._zod.run({value:i[u],issues:[]},o);t instanceof Promise?s.push(t.then(e=>Le(e,r,u))):Le(t,r,u)}if(t.rest){const e=i.slice(n.length);for(const n of e){u++;const e=t.rest._zod.run({value:n,issues:[]},o);e instanceof Promise?s.push(e.then(e=>Le(e,r,u))):Le(e,r,u)}}return s.length?Promise.all(s).then(()=>r):r}});function Le(e,t,n){e.issues.length&&t.issues.push(...W(n,e.issues)),t.value[n]=e.value}const Ue=/* @__PURE__ */N("$ZodEnum",(e,t)=>{Re.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>j.has(typeof e)).map(e=>"string"==typeof e?z(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),be=/* @__PURE__ */N("$ZodLiteral",(e,t)=>{if(Re.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?z(e):e?z(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}});function Me(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const we=/* @__PURE__ */N("$ZodOptional",(e,t)=>{Re.init(e,t),e._zod.optin="optional",e._zod.optout="optional",M(e._zod,"values",()=>t.innerType._zod.values?/* @__PURE__ */new Set([...t.innerType._zod.values,void 0]):void 0),M(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${U(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Me(t,e.value)):Me(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),He=/* @__PURE__ */N("$ZodCustom",(e,t)=>{se.init(e,t),Re.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>De(t,n,r,e));De(o,n,r,e)}});function De(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(function(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}(e))}}var Ge;class je{constructor(){this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function ze(e,t){return new ce({check:"less_than",...B(t),value:e,inclusive:!0})}function xe(e,t){return new ue({check:"greater_than",...B(t),value:e,inclusive:!0})}function Be(e,t){return new pe({check:"max_length",...B(t),maximum:e})}function Fe(e,t){return new le({check:"min_length",...B(t),minimum:e})}function ke(e,t){return new Ae({check:"length_equals",...B(t),length:e})}(Ge=globalThis).__zod_globalRegistry??(Ge.__zod_globalRegistry=new je);const We=/* @__PURE__ */N("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");Re.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>Q(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>te(e,t,n),e.parseAsync=async(t,n)=>ee(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ne(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,n)=>x(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e)}),Ve=/* @__PURE__ */N("ZodMiniString",(e,t)=>{Ee.init(e,t),We.init(e,t)});function Ye(e){return function(e,t){return new e({type:"string",...B(t)})}(Ve,e)}const Ke=/* @__PURE__ */N("ZodMiniNumber",(e,t)=>{Te.init(e,t),We.init(e,t)});function $e(e){return function(e,t){return new e({type:"number",checks:[],...B(t)})}(Ke,e)}const Ze=/* @__PURE__ */N("ZodMiniBoolean",(e,t)=>{_e.init(e,t),We.init(e,t)});function qe(e){return function(e,t){return new e({type:"boolean",...B(t)})}(Ze,e)}const Je=/* @__PURE__ */N("ZodMiniUndefined",(e,t)=>{he.init(e,t),We.init(e,t)});const Qe=/* @__PURE__ */N("ZodMiniAny",(e,t)=>{Se.init(e,t),We.init(e,t)});function Xe(){return new Qe({type:"any"})}const et=/* @__PURE__ */N("ZodMiniDate",(e,t)=>{Ie.init(e,t),We.init(e,t)});const tt=/* @__PURE__ */N("ZodMiniArray",(e,t)=>{fe.init(e,t),We.init(e,t)});function nt(e,t){return new tt({type:"array",element:e,...B(t)})}const rt=/* @__PURE__ */N("ZodMiniObject",(e,t)=>{Oe.init(e,t),We.init(e,t),M(e,"shape",()=>t.shape)});function ot(e,t){const n={type:"object",shape:e??{},...B(t)};return new rt(n)}function it(e,t){return F(e,t)}function st(e,t){return function(e,t){const n=H(t._zod.def,{get shape(){const n=t._zod.def.shape,r={...n};for(const t in n)r[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return w(this,"shape",r),r},checks:[]});return x(t,n)}(Tt,e)}const at=/* @__PURE__ */N("ZodMiniUnion",(e,t)=>{Ce.init(e,t),We.init(e,t)});function ct(e,t){return new at({type:"union",options:e,...B(t)})}const ut=/* @__PURE__ */N("ZodMiniDiscriminatedUnion",(e,t)=>{ve.init(e,t),We.init(e,t)});const pt=/* @__PURE__ */N("ZodMiniTuple",(e,t)=>{Pe.init(e,t),We.init(e,t)});function lt(e,t,n){const r=t instanceof Re;return new pt({type:"tuple",items:e,rest:r?t:null,...B(r?n:t)})}const At=/* @__PURE__ */N("ZodMiniEnum",(e,t)=>{Ue.init(e,t),We.init(e,t),e.options=Object.values(t.entries)});function dt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new At({type:"enum",entries:n,...B(t)})}const Rt=/* @__PURE__ */N("ZodMiniLiteral",(e,t)=>{be.init(e,t),We.init(e,t)});function Et(e,t){return new Rt({type:"literal",values:Array.isArray(e)?e:[e],...B(t)})}const Tt=/* @__PURE__ */N("ZodMiniOptional",(e,t)=>{we.init(e,t),We.init(e,t)});function _t(e){return new Tt({type:"optional",innerType:e})}const ht=/* @__PURE__ */N("ZodMiniCustom",(e,t)=>{He.init(e,t),We.init(e,t)});function St(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...B(n)})}(ht,e,t)}const It=st(ot({apiKey:Ye(),commonBaseURL:Ye(),customServiceBaseURL:Ye(),language:Ye()}));class gt extends Error{constructor(e){super(function(e){const t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(const r of n)t.push(`✖ ${r.message}`),r.path?.length&&t.push(` → at ${J(r.path)}`);return t.join("\n")}(e)),this.issues=e.issues}}const ft=async(n,r,o)=>{const i=r.getAPIVersion?.(n),s=e({...n,...i&&{apiVersion:i}});if(void 0===n.validateRequest||n.validateRequest)try{((e,t)=>{const n=(t?.schema?it(It,t.schema.shape):It).check(St(e=>"commonBaseURL"in e||"customServiceBaseURL"in e,"commonBaseURL or customServiceBaseURL is required"));let r;if(t?.refinements?.length){r=n;for(const e of t.refinements)r=r.check(St(e.check,e.message))}const o=(r??n).safeParse(e);if(!o.success)throw new gt(o.error)})(s,r.requestValidation)}catch(u){return Promise.reject(m(u,o))}const a=r.buildRequest(s),c=t(s);n.onAPIRequest?.(a);try{const e=await r.sendRequest(a,c);return n.onAPIResponse?.(a,e),r.parseResponse(await e.data,s)}catch(u){return n.onAPIResponse?.(a,u),Promise.reject(f(u,o,r.parseResponseError))}};class mt extends Error{constructor(e,t,n){super(t??`HTTP Error ${e}`),this.name="FetchError",this.status=e,this.data=n,Error.captureStackTrace&&Error.captureStackTrace(this,mt)}}const Nt=async e=>{if(e.ok)return{data:await e.json(),status:e.status};let t,n;const r=e.headers.get("content-type");throw e.bodyUsed?t=e.statusText:r?.includes("application/json")?(n=await e.json(),t=n?.errorText??n?.message??n?.detailedError?.message):r?.includes("text/xml")&&(n=await e.text(),t=e.statusText),new mt(e.status,t,n)},Ot=async(e,t)=>Nt(await fetch(e,{headers:t})),yt=async(e,t)=>Nt(await fetch(e.url,{method:"POST",body:JSON.stringify(e.data),headers:{...t,"Content-Type":"application/json"}})),Ct=nt(nt($e())),vt=ot({type:dt(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","GeometryCollection","Circle"]),coordinates:ct([nt($e()),Ct,nt(nt(nt($e()))),nt(nt(nt(nt($e()))))]),radius:_t($e()),radiusMeters:_t($e()),bbox:_t(nt($e()))}).check(St(e=>"Circle"!==e.type||Boolean(e.radius),'type: "Circle" must have radius property')),Pt=ot({type:Et("Feature"),geometry:vt,id:_t(ct([Ye(),$e()])),properties:Xe(),bbox:_t(nt($e()))}),Lt=ot({type:Et("FeatureCollection"),features:nt(Pt),id:_t(ct([Ye(),$e()])),properties:Xe(),bbox:_t(nt($e()))}),Ut=ct([lt([$e().check(xe(-180),ze(180)),$e().check(xe(-90),ze(90))]),lt([$e().check(xe(-180),ze(180)),$e().check(xe(-90),ze(90)),$e()]),ot({type:Et("Point"),coordinates:nt($e())}),Pt]),bt=ct([nt($e()).check(ke(4)),nt($e()).check(ke(6))]),Mt=ct([vt,Pt,Lt]),wt=ct([bt,Mt,nt(Mt)]),Ht=it(ot({query:Ye()}),st(ot({position:Ut,limit:$e().check(ze(100)),radiusMeters:$e(),countries:nt(Ye()),resultType:nt(Ye())})).shape);var Dt="object"==typeof global&&global&&global.Object===Object&&global,Gt="object"==typeof self&&self&&self.Object===Object&&self,jt=Dt||Gt||Function("return this")(),zt=jt.Symbol,xt=Object.prototype,Bt=xt.hasOwnProperty,Ft=xt.toString,kt=zt?zt.toStringTag:void 0;var Wt=Object.prototype.toString;var Vt=zt?zt.toStringTag:void 0;function Yt(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Vt&&Vt in Object(e)?function(e){var t=Bt.call(e,kt),n=e[kt];try{e[kt]=void 0;var r=!0}catch(i){}var o=Ft.call(e);return r&&(t?e[kt]=n:delete e[kt]),o}(e):function(e){return Wt.call(e)}(e)}function Kt(e){return null!=e&&"object"==typeof e}function $t(e){return"symbol"==typeof e||Kt(e)&&"[object Symbol]"==Yt(e)}function Zt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var qt=Array.isArray,Jt=zt?zt.prototype:void 0,Qt=Jt?Jt.toString:void 0;function Xt(e){if("string"==typeof e)return e;if(qt(e))return Zt(e,Xt)+"";if($t(e))return Qt?Qt.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function en(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function tn(e){if(!en(e))return!1;var t=Yt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var nn,rn=jt["__core-js_shared__"],on=(nn=/[^.]+$/.exec(rn&&rn.keys&&rn.keys.IE_PROTO||""))?"Symbol(src)_1."+nn:"";var sn=Function.prototype.toString;function an(e){if(null!=e){try{return sn.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var cn=/^\[object .+?Constructor\]$/,un=Function.prototype,pn=Object.prototype,ln=un.toString,An=pn.hasOwnProperty,dn=RegExp("^"+ln.call(An).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Rn(e){return!(!en(e)||(t=e,on&&on in t))&&(tn(e)?dn:cn).test(an(e));var t}function En(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Rn(n)?n:void 0}var Tn=En(jt,"WeakMap");var _n=Date.now;var hn,Sn,In,gn=function(){try{var e=En(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),fn=gn?function(e,t){return gn(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:function(e){return e},mn=(hn=fn,Sn=0,In=0,function(){var e=_n(),t=16-(e-In);if(In=e,t>0){if(++Sn>=800)return arguments[0]}else Sn=0;return hn.apply(void 0,arguments)});var Nn=/^(?:0|[1-9]\d*)$/;function On(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Nn.test(e))&&e>-1&&e%1==0&&e<t}function yn(e,t,n){"__proto__"==t&&gn?gn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Cn(e,t){return e===t||e!=e&&t!=t}var vn=Object.prototype.hasOwnProperty;function Pn(e,t,n){var r=e[t];vn.call(e,t)&&Cn(r,n)&&(void 0!==n||t in e)||yn(e,t,n)}var Ln=Math.max;function Un(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var bn=Object.prototype;function Mn(e){return Kt(e)&&"[object Arguments]"==Yt(e)}var wn=Object.prototype,Hn=wn.hasOwnProperty,Dn=wn.propertyIsEnumerable,Gn=Mn(/* @__PURE__ */function(){return arguments}())?Mn:function(e){return Kt(e)&&Hn.call(e,"callee")&&!Dn.call(e,"callee")};var jn="object"==typeof exports&&exports&&!exports.nodeType&&exports,zn=jn&&"object"==typeof module&&module&&!module.nodeType&&module,xn=zn&&zn.exports===jn?jt.Buffer:void 0,Bn=(xn?xn.isBuffer:void 0)||function(){return!1},Fn={};function kn(e){return function(t){return e(t)}}Fn["[object Float32Array]"]=Fn["[object Float64Array]"]=Fn["[object Int8Array]"]=Fn["[object Int16Array]"]=Fn["[object Int32Array]"]=Fn["[object Uint8Array]"]=Fn["[object Uint8ClampedArray]"]=Fn["[object Uint16Array]"]=Fn["[object Uint32Array]"]=!0,Fn["[object Arguments]"]=Fn["[object Array]"]=Fn["[object ArrayBuffer]"]=Fn["[object Boolean]"]=Fn["[object DataView]"]=Fn["[object Date]"]=Fn["[object Error]"]=Fn["[object Function]"]=Fn["[object Map]"]=Fn["[object Number]"]=Fn["[object Object]"]=Fn["[object RegExp]"]=Fn["[object Set]"]=Fn["[object String]"]=Fn["[object WeakMap]"]=!1;var Wn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Vn=Wn&&"object"==typeof module&&module&&!module.nodeType&&module,Yn=Vn&&Vn.exports===Wn&&Dt.process,Kn=function(){try{var e=Vn&&Vn.require&&Vn.require("util").types;return e||Yn&&Yn.binding&&Yn.binding("util")}catch(t){}}(),$n=Kn&&Kn.isTypedArray,Zn=$n?kn($n):function(e){return Kt(e)&&Un(e.length)&&!!Fn[Yt(e)]};function qn(e,t){var n=qt(e),r=!n&&Gn(e),o=!n&&!r&&Bn(e),i=!n&&!r&&!o&&Zn(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var u in e)s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||On(u,c))||a.push(u);return a}var Jn=Object.prototype.hasOwnProperty;function Qn(e){if(!en(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t,n,r=(n=(t=e)&&t.constructor,t===("function"==typeof n&&n.prototype||bn)),o=[];for(var i in e)("constructor"!=i||!r&&Jn.call(e,i))&&o.push(i);return o}function Xn(e){return null!=(t=e)&&Un(t.length)&&!tn(t)?qn(e):Qn(e);var t}var er=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tr=/^\w*$/;var nr=En(Object,"create");var rr=Object.prototype.hasOwnProperty;var or=Object.prototype.hasOwnProperty;function ir(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function sr(e,t){for(var n=e.length;n--;)if(Cn(e[n][0],t))return n;return-1}ir.prototype.clear=function(){this.__data__=nr?nr(null):{},this.size=0},ir.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ir.prototype.get=function(e){var t=this.__data__;if(nr){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return rr.call(t,e)?t[e]:void 0},ir.prototype.has=function(e){var t=this.__data__;return nr?void 0!==t[e]:or.call(t,e)},ir.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=nr&&void 0===t?"__lodash_hash_undefined__":t,this};var ar=Array.prototype.splice;function cr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}cr.prototype.clear=function(){this.__data__=[],this.size=0},cr.prototype.delete=function(e){var t=this.__data__,n=sr(t,e);return!(n<0)&&(n==t.length-1?t.pop():ar.call(t,n,1),--this.size,!0)},cr.prototype.get=function(e){var t=this.__data__,n=sr(t,e);return n<0?void 0:t[n][1]},cr.prototype.has=function(e){return sr(this.__data__,e)>-1},cr.prototype.set=function(e,t){var n=this.__data__,r=sr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var ur=En(jt,"Map");function pr(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function lr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}lr.prototype.clear=function(){this.size=0,this.__data__={hash:new ir,map:new(ur||cr),string:new ir}},lr.prototype.delete=function(e){var t=pr(this,e).delete(e);return this.size-=t?1:0,t},lr.prototype.get=function(e){return pr(this,e).get(e)},lr.prototype.has=function(e){return pr(this,e).has(e)},lr.prototype.set=function(e,t){var n=pr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function Ar(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(Ar.Cache||lr),n}Ar.Cache=lr;var dr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Rr=/\\(\\)?/g,Er=function(e){var t=Ar(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(dr,function(e,n,r,o){t.push(r?o.replace(Rr,"$1"):n||e)}),t});function Tr(e,t){return qt(e)?e:function(e,t){if(qt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!$t(e))||tr.test(e)||!er.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:Er(function(e){return null==e?"":Xt(e)}(e))}function _r(e){if("string"==typeof e||$t(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function hr(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var Sr=zt?zt.isConcatSpreadable:void 0;function Ir(e){return qt(e)||Gn(e)||!!(Sr&&e&&e[Sr])}function gr(e){return(null==e?0:e.length)?function(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=Ir),o||(o=[]);++i<s;){var a=e[i];n(a)?hr(o,a):o[o.length]=a}return o}(e):[]}var fr=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object),mr=Function.prototype,Nr=Object.prototype,Or=mr.toString,yr=Nr.hasOwnProperty,Cr=Or.call(Object);function vr(e){var t=this.__data__=new cr(e);this.size=t.size}vr.prototype.clear=function(){this.__data__=new cr,this.size=0},vr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},vr.prototype.get=function(e){return this.__data__.get(e)},vr.prototype.has=function(e){return this.__data__.has(e)},vr.prototype.set=function(e,t){var n=this.__data__;if(n instanceof cr){var r=n.__data__;if(!ur||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new lr(r)}return n.set(e,t),this.size=n.size,this};var Pr="object"==typeof exports&&exports&&!exports.nodeType&&exports,Lr=Pr&&"object"==typeof module&&module&&!module.nodeType&&module,Ur=Lr&&Lr.exports===Pr?jt.Buffer:void 0;function br(){return[]}Ur&&Ur.allocUnsafe;var Mr=Object.prototype.propertyIsEnumerable,wr=Object.getOwnPropertySymbols,Hr=wr?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}(wr(e),function(t){return Mr.call(e,t)}))}:br,Dr=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)hr(t,Hr(e)),e=fr(e);return t}:br;function Gr(e){return function(e,t,n){var r=t(e);return qt(e)?r:hr(r,n(e))}(e,Xn,Dr)}var jr=En(jt,"DataView"),zr=En(jt,"Promise"),xr=En(jt,"Set"),Br="[object Map]",Fr="[object Promise]",kr="[object Set]",Wr="[object WeakMap]",Vr="[object DataView]",Yr=an(jr),Kr=an(ur),$r=an(zr),Zr=an(xr),qr=an(Tn),Jr=Yt;(jr&&Jr(new jr(new ArrayBuffer(1)))!=Vr||ur&&Jr(new ur)!=Br||zr&&Jr(zr.resolve())!=Fr||xr&&Jr(new xr)!=kr||Tn&&Jr(new Tn)!=Wr)&&(Jr=function(e){var t=Yt(e),n="[object Object]"==t?e.constructor:void 0,r=n?an(n):"";if(r)switch(r){case Yr:return Vr;case Kr:return Br;case $r:return Fr;case Zr:return kr;case qr:return Wr}return t});var Qr=Object.prototype.hasOwnProperty;var Xr=jt.Uint8Array;function eo(e){var t=new e.constructor(e.byteLength);return new Xr(t).set(new Xr(e)),t}var to=/\w*$/;var no=zt?zt.prototype:void 0,ro=no?no.valueOf:void 0;function oo(e,t,n){var r,o,i,s,a,c=e.constructor;switch(t){case"[object ArrayBuffer]":return eo(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return a=eo((s=e).buffer),new s.constructor(a,s.byteOffset,s.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=eo(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return(i=new(o=e).constructor(o.source,to.exec(o))).lastIndex=o.lastIndex,i;case"[object Symbol]":return r=e,ro?Object(ro.call(r)):{}}}var io=Kn&&Kn.isMap,so=io?kn(io):function(e){return Kt(e)&&"[object Map]"==Jr(e)};var ao=Kn&&Kn.isSet,co=ao?kn(ao):function(e){return Kt(e)&&"[object Set]"==Jr(e)},uo="[object Arguments]",po="[object Function]",lo="[object Object]",Ao={};function Ro(e,t,n,r,o,i){var s;if(n&&(s=o?n(e,r,o,i):n(e)),void 0!==s)return s;if(!en(e))return e;var a=qt(e);if(a)s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Qr.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var c=Jr(e),u=c==po||"[object GeneratorFunction]"==c;if(Bn(e))return e.slice();if(c==lo||c==uo||u&&!o)s={};else{if(!Ao[c])return o?e:{};s=oo(e,c)}}i||(i=new vr);var p=i.get(e);if(p)return p;i.set(e,s),co(e)?e.forEach(function(r){s.add(Ro(r,t,n,r,e,i))}):so(e)&&e.forEach(function(r,o){s.set(o,Ro(r,t,n,o,e,i))});var l=a?void 0:Gr(e);return function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););}(l||e,function(r,o){l&&(r=e[o=r]),Pn(s,o,Ro(r,t,n,o,e,i))}),s}function Eo(e,t){return t.length<2?e:function(e,t){for(var n=0,r=(t=Tr(t,e)).length;null!=e&&n<r;)e=e[_r(t[n++])];return n&&n==r?e:void 0}(e,function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(t,0,-1))}function To(e){return null==e}function _o(e,t){return null==(e=Eo(e,t=Tr(t,e)))||delete e[_r((n=t,r=null==n?0:n.length,r?n[r-1]:void 0))];var n,r}function ho(e){return function(e){if(!Kt(e)||"[object Object]"!=Yt(e))return!1;var t=fr(e);if(null===t)return!0;var n=yr.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Or.call(n)==Cr}(e)?void 0:e}Ao[uo]=Ao["[object Array]"]=Ao["[object ArrayBuffer]"]=Ao["[object DataView]"]=Ao["[object Boolean]"]=Ao["[object Date]"]=Ao["[object Float32Array]"]=Ao["[object Float64Array]"]=Ao["[object Int8Array]"]=Ao["[object Int16Array]"]=Ao["[object Int32Array]"]=Ao["[object Map]"]=Ao["[object Number]"]=Ao[lo]=Ao["[object RegExp]"]=Ao["[object Set]"]=Ao["[object String]"]=Ao["[object Symbol]"]=Ao["[object Uint8Array]"]=Ao["[object Uint8ClampedArray]"]=Ao["[object Uint16Array]"]=Ao["[object Uint32Array]"]=!0,Ao["[object Error]"]=Ao[po]=Ao["[object WeakMap]"]=!1;var So=function(e){return mn(function(e,t,n){return t=Ln(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=Ln(r.length-t,0),s=Array(i);++o<i;)s[o]=r[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=r[o];return a[t]=n(s),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,a)}}(e,void 0,gr),e+"")}(function(e,t){var n={};if(null==e)return n;var r=!1;t=Zt(t,function(t){return t=Tr(t,e),r||(r=t.length>1),t}),function(e,t,n){var r=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var s=t[o],a=void 0;void 0===a&&(a=e[s]),r?yn(n,s,a):Pn(n,s,a)}}(e,Gr(e),n),r&&(n=Ro(n,7,ho));for(var o=t.length;o--;)_o(n,t[o]);return n});const Io={SPORTS_CENTER:7320,STADIUM:7374,RESTAURANT:7315,CAFE_PUB:9376,HEALTH_CARE_SERVICE:9663,HOSPITAL:7321,HOSPITAL_POLYCLINIC:7321,DOCTOR:9373,SHOP:9361,MARIJUANA_DISPENSARY:9364,MARKET:7332,PUBLIC_AMENITY:9932,ROAD_TRAFFIC_CONTROL_CENTER:7301,POST_OFFICE:7324,COLLEGE_UNIVERSITY:7377,OPEN_PARKING_AREA:7369,CLUB_ASSOCIATION:9937,CAMPING_GROUND:7360,HOLIDAY_RENTAL:7304,VACATION_RENTAL:7304,AMUSEMENT_PARK:9902,RESIDENTIAL_ACCOMMODATION:7303,AGRICULTURAL_BUSINESS:7335,AGRICULTURE:7335,AIRPORT:7383,COMPANY:9352,NIGHTLIFE:9379,REPAIR_SHOP:7310,REPAIR_FACILITY:7310,HOTEL_MOTEL:7314,SCHOOL:7372,AUTOMOTIVE_DEALER:9910,MOVIE_THEATER:7342,CINEMA:7342,THEATER:7318,PARK_RECREATION_AREA:9362,PLACE_OF_WORSHIP:7339,IMPORTANT_TOURIST_ATTRACTION:7376,TOURIST_ATTRACTION:7376,TRAIL_SYSTEM:7302,TRAILS:7302,RAILWAY_STATION:7380,PUBLIC_TRANSPORT_STOP:9942,EXCHANGE:9160,MARINA:7347,WEIGH_STATION:7359,CAR_WASH:9155,LEISURE_CENTER:9378,ACCESS_GATEWAY:7389,GEOGRAPHIC_FEATURE:8099,URBAN_STATION:7380004,ADVENTURE_VEHICLE_TRAIL:7302003,ADVERTISING_COMPANY:9352003,AFGHAN_RESTAURANT:7315081,AFRICAN_RESTAURANT:7315002,AGRICULTURAL_SUPPLIES:9361073,AGRICULTURAL_TECHNOLOGY:9352012,AIRFIELD:7383005,AIRLINE_COMPANY:9352034,AIRLINE_ACCESS:7389002,ALGERIAN_RESTAURANT:7315082,AMBULANCE_UNIT:9663005,AMERICAN_RESTAURANT:7315003,AMPHITHEATER:7318007,AMUSEMENT_ARCADE:9902002,AMUSEMENT_PLACE:9902004,ANIMAL_SERVICES:9361048,ANIMAL_SHELTER:9352045,ANTIQUE_ART_SHOP:9361049,APARTMENT_RENTAL:7304006,AQUATIC_ZOO:9927004,ARABIAN_RESTAURANT:7315083,ARCH:7376012,ARGENTINIAN_RESTAURANT:7315084,ARMENIAN_RESTAURANT:7315085,ART_SCHOOL:7372012,ASHRAM:7339007,ASIAN_RESTAURANT:7315062,ATHLETICS_TRACK:7374002,ATV_DEALER:9910009,AUSTRALIAN_RESTAURANT:7315086,AUSTRIAN_RESTAURANT:7315004,AUTOMOBILE_COMPANY:9352013,AUTOMOBILE_MANUFACTURING:9352041,BAGS_LEATHERWEAR:9361058,BANQUET_ROOMS:7315146,BAR:9379004,BARBECUE_RESTAURANT:7315005,BASEBALL_PARK:7374009,BASKETBALL_ARENA:7374012,BASQUE_RESTAURANT:7315087,BATTLEFIELD:9362002,BAY:8099016,BEACH_CLUB:9937002,BEAUTY_SALON:9361067,BEAUTY_SUPPLIES:9361050,B_B_GUEST_HOUSE:7314002,BELGIAN_RESTAURANT:7315006,BETTING_STATION:9361072,BISTRO:7315007,BLOOD_BANK:9663004,BOAT_DEALER:9910004,BOAT_LAUNCHING_RAMP:9362032,BOATING_EQUIPMENT_ACCESSORIES:9361083,BODYSHOP:7310002,BOLIVIAN_RESTAURANT:7315088,BOOK_SHOP:9361002,BOSNIAN_RESTAURANT:7315089,BOWLING_CENTER:9378002,BRAZILIAN_RESTAURANT:7315072,BRIDGE:7376010,BRIDGE_TUNNEL_OPERATIONS:9352035,BRITISH_RESTAURANT:7315008,BUFFET_RESTAURANT:7315142,BUILDING:7376002,BULGARIAN_RESTAURANT:7315090,BUNGALOW_RENTAL:7304004,BURMESE_RESTAURANT:7315091,BUS_DEALER:9910008,BUS_CHARTER_COMPANY:9352025,BUS_LINES:9352027,BUS_STOP:9942002,BUSINESS_SERVICES:9352039,CABARET_THEATER:7318006,CABINS_LODGES:7314007,CABLE_TELEPHONE_COMPANY:9352040,CAFE:9376002,CAFETERIA:7315147,CALIFORNIAN_RESTAURANT:7315009,CAMBODIAN_RESTAURANT:7315092,CANADIAN_RESTAURANT:7315010,CAPE:8099020,CAR_DEALER:9910002,CAR_GLASS_REPLACEMENT_SHOP:7310003,CARAVAN_SITE:7360003,CARIBBEAN_RESTAURANT:7315011,CATERING_SERVICES:9352043,CAVE:8099003,C_DS_DVD_VIDEOS:9361003,VIDEO_RENTAL_SHOP:9361044,CEMETERY:9362003,CHALET_RENTAL:7304005,CHEMICAL_COMPANY:9352014,CHICKEN_RESTAURANT:7315070,CHILD_CARE_FACILITY:7372003,CHILEAN_RESTAURANT:7315093,CHINESE_RESTAURANT:7315012,CHRISTMAS_HOLIDAY_SHOP:9361082,CHURCH:7339002,CLEANING_SERVICES:9352029,CHILDRENS_CLOTHES:9361004,FOOTWEAR_SHOE_REPAIRS:9361005,CLOTHING_SHOP:9361006,MENS_CLOTHING:9361007,SPECIALTY_CLOTHING_SHOP:9361079,WOMENS_CLOTHING:9361008,COACH_STOP:9942005,COCKTAIL_BAR:9379006,COFFEE_SHOP:9376006,COLOMBIAN_RESTAURANT:7315094,COMEDY_CLUB:9379009,COMPUTER_DATA_SERVICES:9352004,SOFTWARE_COMPANY:9352005,CONCERT_HALL:7318002,CONDOMINIUM_COMPLEX:7303006,CONSTRUCTION_COMPANY:9352032,CONSTRUCTION_MATERIAL_EQUIPMENT:9361042,CONVENIENCE_STORE:9361009,CORSICAN_RESTAURANT:7315095,COTTAGE_RENTAL:7304002,COVE:8099017,CREOLE_RESTAURANT:7315063,CREPERIE:7315013,CRICKET_GROUND:7374003,CUBAN_RESTAURANT:7315096,CULINARY_SCHOOL:7372015,CYPRIOT_RESTAURANT:7315097,CZECH_RESTAURANT:7315068,DAM:7376007,DANCE_STUDIO_SCHOOL:9378003,DANISH_RESTAURANT:7315098,DELICATESSEN:9361060,DINNER_THEATER:7318008,DISCO_CLUB:9379002,DIVERSIFIED_FINANCIALS:9352006,DOMINICAN_RESTAURANT:7315099,DONGBEI_RESTAURANT:7315057,DOUGHNUT_RESTAURANT:7315079,DRIVE_THROUGH_BOTTLE_SHOP:9361076,DRIVE_IN_MOVIES:7342003,DRIVING_SCHOOL:7372016,DRUG_STORE:9361051,DRY_CLEANER:9361010,DUNE:8099005,DUTCH_RESTAURANT:7315014,EGYPTIAN_RESTAURANT:7315100,ELECTRICAL_APPLIANCES_SHOP:9361052,CAMERAS_PHOTOGRAPHY:9361011,COMPUTER_COMPUTER_SUPPLIES:9361012,CONSUMER_ELECTRONICS:9361013,OFFICE_EQUIPMENT:9361014,ENGLISH_RESTAURANT:7315101,EQUIPMENT_RENTAL:9352038,EROTIC_RESTAURANT:7315132,ETHIOPIAN_RESTAURANT:7315102,EXOTIC_RESTAURANT:7315133,FACTORY_OUTLET:9361016,FAIRGROUND:9362017,FARM:7335004,FARMERS_MARKET:7332004,FAST_FOOD:7315015,PHILIPPINE_RESTAURANT:7315016,FINNISH_RESTAURANT:7315104,FISHING_HUNTING_AREA:9362016,FITNESS_CLUB_CENTER:7320002,FLATS_APARTMENT_COMPLEX:7303003,FLORISTS:9361017,FLYING_CLUB:9378004,FONDUE_RESTAURANT:7315134,BAKERY:9361018,BUTCHER:9361019,FISHMONGER:9361020,FOOD_MARKET:9361021,GREENGROCER:9361022,GROCERY_STORE:9361023,OTHER_FOOD_SHOPS:9361024,WINE_SPIRITS:9361025,FOOTBALL_STADIUM:7374010,FOREST_AREA:9362015,FRENCH_RESTAURANT:7315017,FUNERAL_SERVICE_MORTUARIES:9352036,FURNITURE_HOME_FURNISHINGS:9361054,FUSION_RESTAURANT:7315071,CAR_REPAIR_AND_SERVICE:7310004,GENERAL_PRACTITIONER:9373002,GERMAN_RESTAURANT:7315018,GIFTS_CARDS_NOVELTIES_SOUVENIRS:9361026,GLASSWARE_CERAMIC_SHOP:9361055,GOLD_EXCHANGE:9160003,GREEK_RESTAURANT:7315019,GRILL_RESTAURANT:7315020,GUANGDONG_RESTAURANT:7315054,GURUDWARA:7339006,HAIRDRESSER:9361027,HAMBURGER_RESTAURANT:7315069,HARBOR:8099018,HARDWARE_STORE:9361069,HAWAIIAN_RESTAURANT:7315021,HIGH_SCHOOL:7372006,HIKING_TRAIL:7302004,HILL:8099025,HISTORIC_SITE:9362004,HISTORICAL_PARK:9362005,HOBBY_SHOP:9361053,HOCKEY_CLUB:9937003,HOME_APPLIANCE_REPAIR:9352044,HORSE_RACING_TRACK:7374005,HORSE_RIDING_CENTER:7320003,HORTICULTURE:7335002,HOSPITAL_FOR_WOMEN_AND_CHILDREN:7321005,HOSPITAL_OF_CHINESE_MEDICINE:7321004,HOSTEL:7314004,HOT_POT_RESTAURANT:7315058,HOTEL:7314003,CARPET_FLOOR_COVERINGS:9361028,CURTAINS_TEXTILES:9361029,DO_IT_YOURSELF_CENTERS:9361030,HOUSE_GARDEN_FURNITURE_FITTINGS:9361031,GARDEN_CENTERS_SERVICES:9361032,GLASS_WINDOWS_STORE:9361080,KITCHENS_BATHROOMS:9361033,LIGHTING_SHOPS:9361034,PAINTING_DECORATING:9361035,HUNAN_RESTAURANT:7315052,HUNGARIAN_RESTAURANT:7315022,ICE_CREAM_PARLOR:7315078,ICE_HOCKEY_ARENA:7374008,IMPORT_EXPORT_AND_DISTRIBUTION:9352042,INDIAN_RESTAURANT:7315023,INDONESIAN_RESTAURANT:7315024,INFORMAL_MARKET:7332002,INSURANCE_COMPANY:9352007,INTERNATIONAL_RESTAURANT:7315073,INTERNATIONAL_RAILROAD_STATION:7380002,INTERNET_CAFE:9376004,INVESTMENT_ADVISOR:9352037,IRANIAN_RESTAURANT:7315105,IRISH_RESTAURANT:7315065,ISLAND:8099022,ISRAELI_RESTAURANT:7315106,ITALIAN_RESTAURANT:7315025,JAMAICAN_RESTAURANT:7315066,JAPANESE_RESTAURANT:7315026,JAZZ_CLUB:9379008,JEWELRY_CLOCKS_WATCHES:9361036,JEWISH_RESTAURANT:7315027,JUNIOR_COLLEGE_COMMUNITY_COLLEGE:7377003,KARAOKE_CLUB:9379010,KOREAN_RESTAURANT:7315028,KOSHER_RESTAURANT:7315067,LAGOON:8099019,LAKESHORE:9362006,LANGUAGE_SCHOOL:7372010,LATIN_AMERICAN_RESTAURANT:7315029,LAUNDRY:9361045,LEBANESE_RESTAURANT:7315030,LEGAL_SERVICES:9352023,LOCAL_POST_OFFICE:7324003,LOCAL_SPECIALITIES_SHOP:9361056,LOCALE:8099027,LOTTERY_SHOP:9361071,LUXEMBOURGIAN_RESTAURANT:7315107,MACROBIOTIC_RESTAURANT:7315135,MAGHRIB_RESTAURANT:7315108,DELIVERY_SERVICE:9352008,MALTESE_RESTAURANT:7315031,MANUFACTURING_COMPANY:9352011,MARINE_ELECTRONIC_EQUIPMENT:9361065,MARSH:8099023,MAURITIAN_RESTAURANT:7315109,MAUSOLEUM_GRAVE:7376011,MECHANICAL_ENGINEERING:9352016,MEDICAL_SUPPLIES_EQUIPMENT:9361043,MEDITERRANEAN_RESTAURANT:7315032,MEMORIAL:9362007,SUBWAY_STATION:7380005,MEXICAN_RESTAURANT:7315033,MICROBREWERY:9376007,MIDDLE_EASTERN_RESTAURANT:7315034,MIDDLE_SCHOOL:7372014,MILITARY_AIRPORT:7383004,MINERAL_HOT_SPRINGS:8099021,MINING_COMPANY:9352031,MOBILE_PHONE_SHOP:9361075,MONGOLIAN_RESTAURANT:7315110,MONUMENT:7376003,MOROCCAN_RESTAURANT:7315074,MOSQUE:7339003,MOTEL:7314006,MOTOR_RACING_STADIUM:7374011,MOTORCYCLE_DEALER:9910003,MOTORCYCLE_REPAIR:7310008,MOUNTAIN_BIKE_TRAIL:7302002,MOUNTAIN_PEAK:8099002,MOVING_STORAGE_COMPANY:9352033,MULTI_PURPOSE_STADIUM:7374006,MUSIC_CENTER:7318003,MUSIC_INSTRUMENTS_STORE:9361059,MUSSELS_RESTAURANT:7315136,NAIL_SALON:9361068,NATIONAL_RAILROAD_STATION:7380003,NATURAL_RECREATION_ATTRACTION:9362030,NEPALESE_RESTAURANT:7315111,NETBALL_STADIUM:7374014,NEWSAGENTS_TOBACCONISTS:9361037,NORWEGIAN_RESTAURANT:7315112,OASIS:8099011,OBSERVATORY:7376005,OEM:9352021,OIL_NATURAL_GAS:9352030,OPERA_HOUSE:7318004,OPTICIAN:9361038,ORGANIC_FOOD_RESTAURANT:7315075,ORIENTAL_RESTAURANT:7315035,OTHER_REPAIR_SHOPS:7310005,OTHER_WINTER_SPORT:9362025,PAGODA:7339008,PAKISTANI_RESTAURANT:7315127,PAN:8099009,PARK:9362008,PARKWAY:9362009,PASSENGER_TRANSPORT_TICKET_OFFICE:9932002,PAWN_SHOP:9361070,PEDESTRIAN_SUBWAY:9932003,PERSONAL_CARE_FACILITY:9663003,PERSONAL_SERVICE:9663002,PERUVIAN_RESTAURANT:7315061,PET_SUPPLIES:9361064,PHARMACEUTICAL_COMPANY:9352018,PHOTO_LAB_DEVELOPMENT:9361046,PHOTOCOPY_SHOP:9361047,PICNIC_AREA:9362033,PIZZERIA:7315036,PLAIN_FLAT:8099007,PLANETARIUM:7376006,PLATEAU:8099008,POLISH_RESTAURANT:7315037,POLYNESIAN_RESTAURANT:7315129,PORTUGUESE_RESTAURANT:7315038,PRE_SCHOOL:7372004,PRESERVE:9362010,PRIMARY_PRODUCER:7335003,PRIMARY_SCHOOL:7372005,PRIVATE_AIRPORT:7383003,PRIVATE_CLUB:9379003,PROVENCAL_RESTAURANT:7315130,PUB:9376003,PUB_FOOD:7315039,PUBLIC_MARKET:7332003,PUBLIC_AIRPORT:7383002,PUBLIC_CALL_BOX:9932004,PUBLIC_HEALTH_TECHNOLOGY_COMPANY:9352017,PUBLISHING_TECHNOLOGIES:9352019,QUARRY:8099026,RACE_TRACK:7374013,RAILROAD_SIDING:7380006,RAPIDS:8099015,REAL_ESTATE_COMPANY:9352009,REAL_ESTATE_AGENT:9361015,RECREATION_AREA:9362011,RECREATIONAL_CAMPING_GROUND:7360002,RECREATIONAL_VEHICLE_DEALER:9910005,RECYCLING_SHOP:9361057,REEF:8099014,RESERVOIR:8099013,RESIDENTIAL_ESTATE:7303004,RESORT:7314005,REST_CAMP:7314008,RETAIL_OUTLET:9361063,RETIREMENT_COMMUNITY:7303002,RIDGE:8099004,RIVER_CROSSING:8099024,ROAD_RESCUE:9932006,ROADSIDE_RESTAURANT:7315041,ROCK_CLIMBING_TRAIL:7302006,ROCKS:8099012,RUGBY_GROUND:7374007,ROMANIAN_RESTAURANT:7315131,RUSSIAN_RESTAURANT:7315040,SALAD_BAR:7315143,CAR_ACCESSORIES:7310006,SANDWICH_RESTAURANT:7315042,SAUNA_SOLARIUM_MASSAGE:9378005,SAVINGS_INSTITUTION:9352010,SAVOY_RESTAURANT:7315113,SCANDINAVIAN_RESTAURANT:7315114,SCOTTISH_RESTAURANT:7315115,SEAFOOD:7315043,SEASHORE:9362013,SECURED_ENTRANCE:7389004,SECURITY_PRODUCTS:9361078,SENIOR_HIGH_SCHOOL:7372007,SERVICE_COMPANY:9352002,SHANDONG_RESTAURANT:7315053,SHANGHAI_RESTAURANT:7315055,SHOPPING_SERVICE:9361062,SICHUAN_RESTAURANT:7315056,SICILIAN_RESTAURANT:7315116,SKI_RESORT:9362026,SLAVIC_RESTAURANT:7315117,SLOVAK_RESTAURANT:7315080,SNACKS_RESTAURANT:7315139,SNOOKER_POOL_BILLIARD:9378006,SOCCER_STADIUM:7374004,SOUL_FOOD:7315064,SOUP_RESTAURANT:7315140,SPANISH_RESTAURANT:7315044,SPECIAL_HOSPITAL:7321003,SPECIAL_SCHOOL:7372013,SPECIALIST:9373003,SPECIALTY_FOODS:9361061,SPORT_SCHOOL:7372011,SPORTS_EQUIPMENT_CLOTHING:9361039,STAMP_SHOP:9361074,STATION_ACCESS:7389003,STATUE:7376013,STEAK_HOUSE:7315045,STOCK_EXCHANGE:9160002,SUDANESE_RESTAURANT:7315118,SUPERMARKETS_HYPERMARKETS:7332005,SURINAMESE_RESTAURANT:7315046,SUSHI_RESTAURANT:7315148,SWEDISH_RESTAURANT:7315119,SWISS_RESTAURANT:7315047,SYNAGOG:7339004,SYRIAN_RESTAURANT:7315120,TAILOR_SHOP:9361077,TAIWANESE_RESTAURANT:7315059,TAKEOUT_FOOD:7315145,TAPAS_RESTAURANT:7315076,TAX_SERVICES:9352022,TAXI_STAND:9942003,TAXI_LIMOUSINE_SHUTTLE_SERVICE:9352026,TEA_HOUSE:9376005,TECHNICAL_SCHOOL:7372009,TELECOMMUNICATIONS:9352020,TEMPLE:7339005,TEPPANYAKI_RESTAURANT:7315121,THAI_RESTAURANT:7315048,THEMATIC_SPORT_CENTER:7320005,TIBETAN_RESTAURANT:7315122,PUBLIC_TOILET:9932005,TOWER:7376009,TOWNHOUSE_COMPLEX:7303005,TOYS_GAMES_SHOP:9361040,TRAFFIC_SERVICE_CENTER:7301002,TRAFFIC_CONTROL_DEPARTMENT:7301002,STREETCAR_STOP:9942004,TRANSPORT_COMPANY:9352024,TRAVEL_AGENT:9361041,TRUCK_DEALER:9910006,TRUCK_REPAIR_AND_SERVICE:7310009,TRUCK_WASH:9155003,TUNISIAN_RESTAURANT:7315123,TUNNEL:7376008,TURKISH_RESTAURANT:7315049,TIRE_SERVICE:7310007,URUGUAYAN_RESTAURANT:7315124,VALLEY:8099006,VAN_DEALER:9910007,VARIETY_STORE:9361081,VEGETARIAN_RESTAURANT:7315050,VENEZUELAN_RESTAURANT:7315125,VIETNAMESE_RESTAURANT:7315051,VILLA_RENTAL:7304003,VOCATIONAL_SCHOOL:7372008,WATER_HOLE:7376014,WEDDING_SERVICES:9352046,WEIGH_SCALES:7359003,WELL:8099010,WELSH_RESTAURANT:7315126,WESTERN_RESTAURANT:7315060,WHOLESALE_CLUB:9361066,WILDERNESS_AREA:9362014,WILDLIFE_PARK:9927005,WINE_BAR:9379007,YACHT_BASIN:7347003,YOGURT_JUICE_BAR:7315149,ZOO:9927003,ZOOS_ARBORETA_BOTANICAL_GARDEN:9927,ELECTRONICS_COMPANY:9352015,RIVER_SCENIC_AREA:9362036,HORSE_RIDING_TRAIL:7302005,NATURAL_TOURIST_ATTRACTION:7376004,OPEN_CAR_PARKING_AREA:7369002,MEDICINAL_MARIJUANA_DISPENSARY:9364002,RECREATIONAL_MARIJUANA_DISPENSARY:9364003,ICE_SKATING_RINK:9360,TENNIS_COURT:9369,GOLF_COURSE:9911,WATER_SPORT:9371,SWIMMING_POOL:7338,RESTAURANT_AREA:9359,DENTIST:9374,VETERINARIAN:9375,PHARMACY:7326,EMERGENCY_ROOM:9956,DEPARTMENT_STORE:7327,SHOPPING_CENTER:7373,FIRE_STATION_BRIGADE:7392,NON_GOVERNMENTAL_ORGANIZATION:9152,PRISON_CORRECTIONAL_FACILITY:9154,EMBASSY:7365,LIBRARY:9913,TRANSPORT_AUTHORITY_VEHICLE_REGISTRATION:9151,WELFARE_ORGANIZATION:9153,NATIVE_RESERVATION:9389,COURTHOUSE:9363,POLICE_STATION:7322,PRIMARY_RESOURCE_UTILITY:9150,GOVERNMENT_OFFICE:7367,MILITARY_INSTALLATION:9388,RENT_A_CAR_PARKING:9930,MUSEUM:7317,INDUSTRIAL_BUILDING:9383,PARKING_GARAGE:7313,TOURIST_INFORMATION_OFFICE:7316,MEDIA_FACILITY:9158,WINERY:7349,EMERGENCY_MEDICAL_SERVICE:7391,CASINO:7341,MANUFACTURING_FACILITY:9156,COMMERCIAL_BUILDING:9382,CULTURAL_CENTER:7319,EXHIBITION_CONVENTION_CENTER:9377,RENT_A_CAR_FACILITY:7312,TRUCK_STOP:7358,ADVENTURE_SPORTS_FACILITY:7305,ADVENTURE_SPORTS_VENUE:7305,REST_AREA:7395,RESEARCH_FACILITY:9157,COURIER_DROP_BOX:7388,GAS_STATION:7311,PETROL_STATION:7311,FUEL_FACILITIES:7311,MOTORING_ORGANIZATION_OFFICE:7368,CASH_DISPENSER:7397,ATM:7397,COMMUNITY_CENTER:7363,BEACH:9357,PORT_WAREHOUSE_FACILITY:9159,ELECTRIC_VEHICLE_STATION:7309,SCENIC_PANORAMIC_VIEW:7337,ENTERTAINMENT:9900,BUSINESS_PARK:7378,BANK:7328,HELIPAD_HELICOPTER_LANDING:7308,CHECKPOINT:9955,FRONTIER_CROSSING:7366,MOUNTAIN_PASS:9935,TOLL_GATE:7375,FERRY_TERMINAL:7352},go=(e,t)=>{e.append("apiVersion",String(t.apiVersion)),e.append("key",t.apiKey),t.language&&e.append("language",t.language)},fo=(e,t,n)=>{for(const r of n||[])e.append(t,r)},mo=(e,t,n)=>{Array.isArray(n)&&n.length>0&&e.append(t,n.join(","))},No=(e,t,n)=>{!To(n)&&e.append(t,String(n))},Oo=(e,t)=>{const r=n(t);r&&(e.append("lat",String(r[1])),e.append("lon",String(r[0])))},yo="/maps/orbis/places",Co=(e,t)=>{const n=e.searchParams;go(n,t),No(n,"limit",t.limit),Oo(n,t.position),mo(n,"fuelSet",t.fuelTypes),mo(n,"idxSet",t.indexes),mo(n,"brandSet",t.poiBrands),t.poiCategories&&mo(n,"categorySet",t.poiCategories.map(e=>"number"!=typeof e?Io[e]:e)),mo(n,"connectorSet",t.connectors),mo(n,"mapcodes",t.mapcodes),mo(n,"extendedPostalCodesFor",t.extendedPostalCodesFor),No(n,"minPowerKW",t.minPowerKW),No(n,"maxPowerKW",t.maxPowerKW),No(n,"view",t.view),No(n,"openingHours",t.openingHours),No(n,"timeZone",t.timeZone),No(n,"relatedPois",t.relatedPois),mo(n,"entityTypeSet",t.geographyTypes)},vo=e=>{const t=new URL(`${n=e,n.customServiceBaseURL||`${n.commonBaseURL}${yo}/autocomplete/${n.query}.json`}`);var n;const r=t.searchParams;return e.language=e.language??"en-GB",go(r,e),No(r,"limit",e.limit),Oo(r,e.position),mo(r,"countrySet",e.countries),No(r,"radius",e.radiusMeters),mo(r,"resultSet",e.resultType),t},Po=e=>{const t=e.split(",");return[Number(t[1]),Number(t[0])]},Lo=e=>`${e[1]},${e[0]}`,Uo=e=>{let t,n;return void 0!==e.topLeftPoint?(t=[e.topLeftPoint.lon,e.btmRightPoint.lat],n=[e.btmRightPoint.lon,e.topLeftPoint.lat]):(t=Po(e.southWest),n=Po(e.northEast)),[t[0],t[1],n[0],n[1]]},bo=e=>[e.lon,e.lat],Mo=e=>{const{position:t,...n}=e.context.geoBias||{};return{...e,context:{...e.context,geoBias:{...t&&{position:bo(t)},radiusMeters:n.radius}}}},wo={requestValidation:{schema:Ht},buildRequest:vo,sendRequest:Ot,parseResponse:Mo},Ho=async(e,t)=>ft(e,{...wo,...t},"Autocomplete"),Do={autocompleteSearch:Ho,buildAutocompleteSearchRequest:vo,parseAutocompleteSearchResponse:Mo,autocompleteSearchTemplate:wo},Go=ot({id:Ye()}),jo=e=>{const t=new URL((e=>e.customServiceBaseURL??`${e.commonBaseURL}${yo}/ev/id`)(e)),n=t.searchParams;return go(n,e),n.append("id",e.id),t},zo=e=>e<12?"slow":e<50?"regular":e<150?"fast":"ultra-fast",xo=e=>{const t={count:0,statusCounts:{}};for(const n of e)for(const e of n.chargingPoints)t.count++,t.statusCounts[e.status]=(t.statusCounts[e.status]||0)+1;return t},Bo=(e,t)=>e.type===t.type&&e.ratedPowerKW===t.ratedPowerKW,Fo=(e,t,n)=>{if(e)for(const r of e){const e=n.find(e=>Bo(r,e.connector));if(e){if(e.count++,t){const n=e.statusCounts;e.statusCounts[t]=(n[t]||0)+1}}else n.push({connector:r,count:1,statusCounts:t?{[t]:1}:{}})}},ko=e=>{const t=[];return((e,t)=>{if(e)for(const n of e){const e=t.find(e=>Bo(n,e.connector));e?e.count++:t.push({connector:n,count:1})}})(e,t),t},Wo=e=>{const t=[];for(const n of e)for(const e of n.chargingPoints)Fo(e.connectors,e.status,t);return t},Vo=e=>{const{year:t,month:n,day:r}=(e=>{const t=e.split("-");return{year:Number.parseInt(t[0]),month:Number.parseInt(t[1]),day:Number.parseInt(t[2])}})(e.date);return{dateYYYYMMDD:e.date,year:t,month:n,day:r,hour:e.hour,minute:e.minute,date:new Date(t,n-1,r,e.hour,e.minute)}},Yo=e=>1===e.length&&0===e[0].start.hour&&0===e[0].end.hour,Ko=e=>{const t=e.timeRanges.map(e=>({start:Vo(e.startTime),end:Vo(e.endTime)}));return{mode:e.mode,timeRanges:t,alwaysOpenThisPeriod:Yo(t)}},$o=e=>{const{position:t,entryPoints:n,poi:o,id:i,dist:s,boundingBox:a,chargingPark:c,...u}=e,p=c?.connectors?.map(e=>({...So(e,"connectorType"),type:e.connectorType,chargingSpeed:zo(e.ratedPowerKW)}));return{...r(bo(t)),...a&&{bbox:Uo(a)},id:i,properties:{...So(u,"viewport"),...s&&{distance:s},...n?.length&&{entryPoints:n.map(e=>({...e,position:bo(e.position)}))},...p?.length&&{chargingPark:{...c,connectors:p.map(e=>({...e,chargingSpeed:zo(e.ratedPowerKW)})),connectorCounts:ko(p)}},...o&&{poi:{...So(o,"categorySet","openingHours"),brands:o?.brands?.map(e=>e.name)??[],categoryIds:o?.categorySet?.map(e=>e.id)??[],...o?.openingHours&&{openingHours:Ko(o?.openingHours)}}}}}},Zo=e=>{const{geoBias:t,...n}=e;return{...t&&{geoBias:bo(t)},...n}},qo=e=>{const t=e.results?.[0];return t?{id:t.id,accessType:t.accessType,chargingStations:(n=t.chargingStations,n.map(e=>({...e,chargingPoints:e.chargingPoints.map(e=>({...e,connectors:e.connectors?.map(e=>({...e,chargingSpeed:zo(e.ratedPowerKW)}))}))}))),chargingPointAvailability:xo(t.chargingStations),connectorAvailabilities:Wo(t.chargingStations),...t.openingHours&&{openingHours:Ko(t.openingHours)}}:void 0;var n},Jo={requestValidation:{schema:Go},buildRequest:jo,sendRequest:Ot,parseResponse:qo,parseResponseError:(e,t)=>{const n=e.data?.detailedError?.message??e.message;return new I(n,t,e.status)}},Qo={buildEVChargingStationsAvailabilityRequest:jo,parseEVChargingStationsAvailabilityResponse:qo,evChargingStationsAvailabilityTemplate:Jo},Xo=st(ot({typeahead:qe(),offset:$e().check(ze(1900)),radiusMeters:$e(),boundingBox:wt,countries:nt(Ye())})),ei=it(ot({query:Ye()}),st(ot({position:Ut,limit:$e().check(ze(100)),extendedPostalCodesFor:nt(Ye()),mapcodes:nt(Ye()),view:dt(o),geographyTypes:nt(Ye())})).shape),ti=it(ei,Xo.shape),ni=e=>e?Array.isArray(e)?e.join(","):"string"==typeof e?e:String(e):"",ri=(e,t)=>{const n=e.length;if(n<=t)return e;const r=[];let o;const i=Math.ceil(n/t);for(o=0;o<n;o+=i)r.push(e[o]);return o>=n-i&&(r.length<t?r.push(e[n-1]):r[r.length-1]=e[n-1]),r},oi=e=>{const t=new URL(`${(e=>e.customServiceBaseURL||`${e.commonBaseURL}${yo}/geocode`)(e)}/${e.query}.json`),n=t.searchParams;go(n,e),e.typeahead&&n.append("typeahead",String(e.typeahead)),!To(e.limit)&&n.append("limit",String(e.limit)),!To(e.offset)&&n.append("ofs",String(e.offset)),Oo(n,e.position),e.countries&&n.append("countrySet",ni(e.countries)),!To(e.radiusMeters)&&n.append("radius",String(e.radiusMeters));const r=e.boundingBox&&i(e.boundingBox);return r&&(n.append("topLeft",ni([r[3],r[0]])),n.append("btmRight",ni([r[1],r[2]]))),e.extendedPostalCodesFor&&n.append("extendedPostalCodesFor",ni(e.extendedPostalCodesFor)),e.mapcodes&&n.append("mapcodes",ni(e.mapcodes)),e.view&&n.append("view",e.view),e.geographyTypes&&n.append("entityTypeSet",ni(e.geographyTypes)),t},ii=e=>{const{position:t,boundingBox:n,dist:o,entryPoints:i,addressRanges:s,entityType:a,id:c,...u}=e;return{...r(bo(t)),...n&&{bbox:Uo(n)},id:c,properties:{...So(u,"viewport"),...o&&{distance:o},...a&&{geographyType:a.split(",")},...i&&{entryPoints:i.map(e=>({...e,position:bo(e.position)}))},...s&&{addressRanges:{...s,from:bo(s.from),to:bo(s.to)}}}}},si=e=>{const t=e.results.map(ii),n=s(i(t));return{type:"FeatureCollection",features:t,...n&&{bbox:n}}},ai={requestValidation:{schema:ti},buildRequest:oi,sendRequest:Ot,parseResponse:si},ci={buildGeocodingRequest:oi,parseGeocodingResponse:si,geocodingTemplate:ai},ui=it(ot({geometries:ct([Lt,nt(ct([Ye(),Pt])).check(Fe(1),Be(20))])}),st(ot({zoom:$e().check(xe(0),ze(22))})).shape),pi=e=>e.map(e=>e.properties.dataSources?.geometry?.id).filter(e=>e),li=e=>{const t=new URL((e=>e.customServiceBaseURL||`${e.commonBaseURL}${yo}/additionalData.json`)(e)),n=t.searchParams;return n.append("apiVersion",String(e.apiVersion)),n.append("key",e.apiKey),((e,t)=>{let n;n=Array.isArray(t)?"string"==typeof t[0]?t:pi(t):pi(t.features),e.append("geometries",ni(n))})(n,e.geometries),No(n,"geometriesZoom",e.zoom),t},Ai=e=>{const t=e.additionalData.flatMap(e=>e.geometryData?.features.map(e=>({...e,id:e.id??a(),bbox:i(e.geometry)}))).filter(e=>e);return{type:"FeatureCollection",bbox:i(t),features:t}},di={requestValidation:{schema:ui},buildRequest:li,sendRequest:Ot,parseResponse:Ai},Ri={buildGeometryDataRequest:li,parseGeometryDataResponse:Ai,geometryDataTemplate:di},Ei=ot(Io),Ti=it(ei,st(ot({indexes:nt(Ye()),poiCategories:nt(ct([$e(),function(e){const t=e._zod.def.shape;return dt(Object.keys(t))}(Ei)])),poiBrands:nt(Ye()),connectors:nt(Ye()),fuelTypes:nt(Ye()),openingHours:Ye(),timeZone:Ye(),relatedPois:Ye(),minPowerKW:$e(),maxPowerKW:$e(),minFuzzyLevel:$e(),mixFuzzyLevel:$e()})).shape),_i=it(Ti,ot({geometries:nt(ct([Lt,vt]))}).shape),hi=e=>{switch(e.type){case"Circle":return[{type:"CIRCLE",radius:e.radius,position:Lo(e.coordinates)}];case"Polygon":return[{type:"POLYGON",vertices:ri(e.coordinates[0],50).map(e=>Lo(e))}];case"MultiPolygon":return e.coordinates.length>50?(e=>{let t=/* @__PURE__ */new Map;return e.coordinates.forEach(e=>{const n=c(e[0]);if(n){const r=Math.abs((n[2]-n[0])*(n[3]-n[1]));t.set(e,r)}}),t=new Map([...t.entries()].sort((e,t)=>t[1]-e[1]).splice(0,50)),[...t.keys()]})(e).flatMap(e=>hi({type:"Polygon",coordinates:e})):e.coordinates.flatMap(e=>hi({type:"Polygon",coordinates:e}));case"FeatureCollection":return e.features.flatMap(e=>hi(e.geometry));default:throw new Error(`Type ${e.type} is not supported`)}},Si=e=>{const t=new URL(`${n=e,n.customServiceBaseURL??`${n.commonBaseURL}${yo}/geometrySearch/${n.query}.json`}`);var n;return Co(t,e),{url:t,data:{geometryList:e.geometries.flatMap(hi)}}},Ii=e=>{const t=e.results.map($o),n=s(i(t));return{type:"FeatureCollection",properties:{...Zo(e.summary)},features:t,...n&&{bbox:n}}},gi={requestValidation:{schema:_i},buildRequest:Si,sendRequest:yt,parseResponse:Ii},fi=async(e,t)=>ft(e,{...gi,...t},"GeometrySearch"),mi={geometrySearch:fi,buildGeometrySearchRequest:Si,parseGeometrySearchResponse:Ii,geometrySearchTemplate:gi},Ni=it(ot({entityId:Ye()}),st(ot({mapcodes:nt(Ye()),view:dt(o),openingHours:Ye(),timeZone:Ye(),relatedPois:Ye()})).shape),Oi=e=>{const t=new URL(`${(e=>e.customServiceBaseURL||`${e.commonBaseURL}${yo}/place.json`)(e)}`),n=t.searchParams;return go(n,e),No(n,"entityId",e.entityId),mo(n,"mapcodes",e.mapcodes),No(n,"view",e.view),No(n,"openingHours",e.openingHours),No(n,"timeZone",e.timeZone),No(n,"relatedPois",e.relatedPois),t},yi=e=>e.results?.length?$o(e.results[0]):void 0,Ci={requestValidation:{schema:Ni},buildRequest:Oi,sendRequest:Ot,parseResponse:yi},vi={buildPlaceByIdRequest:Oi,parsePlaceByIdResponse:yi,placeByIdTemplate:Ci},Pi=$e().check(function(e,t){return new ue({check:"greater_than",...B(t),value:e,inclusive:!1})}(0,Li));var Li;const Ui=$e().check(xe(0)),bi=$e().check(xe(0),ze(100)),Mi=_t(Pi),wi=_t(Ui),Hi=_t($e().check(xe(0),ze(1))),Di=ot({speedKMH:$e(),consumptionUnitsPer100KM:$e()}),Gi={efficiency:_t(ot({acceleration:Hi,deceleration:Hi,uphill:Hi,downhill:Hi}))},ji=nt(Di).check(Fe(1),Be(25)),zi=ot({...Gi,speedsToConsumptionsLiters:ji,auxiliaryPowerInLitersPerHour:wi,fuelEnergyDensityInMJoulesPerLiter:_t($e().check(xe(1)))}),xi=ot({...Gi,speedsToConsumptionsKWH:ji,auxiliaryPowerInkW:wi,consumptionInKWHPerKMAltitudeGain:_t($e().check(ze(500))),recuperationInKWHPerKMAltitudeLoss:wi}),Bi=ot({currentType:dt(p),plugTypes:nt(dt(u)).check(Fe(1)),efficiency:Hi,baseLoadInkW:wi,maxPowerInkW:wi,maxVoltageInV:wi,maxCurrentInA:wi,voltageRange:_t(ot({minVoltageInV:wi,maxVoltageInV:_t($e())}))}),Fi=ot({stateOfChargeInkWh:Ui,maxPowerInkW:Pi}),ki=ot({maxChargeKWH:Pi,batteryCurve:_t(nt(Fi).check(Be(20))),chargingConnectors:_t(nt(Bi).check(Fe(1))),chargingTimeOffsetInSec:wi}),Wi=ot({consumption:zi}),Vi=ot({consumption:xi,charging:_t(ki)}),Yi=_t(ot({lengthMeters:Mi,widthMeters:Mi,heightMeters:Mi,weightKG:Mi,axleWeightKG:Mi})),Ki=ot({variantId:Ye()}),$i=ot({dimensions:Yi,engine:_t(ct([Wi,Vi]))}),Zi=_t(ct([Ki,$i])),qi=ot({heading:_t($e().check(xe(0),ze(360)))}),Ji=it(qi,ot({currentFuelInLiters:Ui}).shape),Qi=ct([it(qi,ot({currentChargePCT:bi}).shape),it(qi,ot({currentChargeInkWh:Ui}).shape)]),Xi=ot({minChargeAtDestinationPCT:bi,minChargeAtChargingStopsPCT:$e().check(xe(0),ze(50))}),es=ot({minChargeAtDestinationInkWh:Ui,minChargeAtChargingStopsInkWh:Ui}),ts=ot({chargingPreferences:_t(ct([Xi,es]))}),ns={model:Zi,restrictions:_t(ot({loadTypes:_t(nt(dt(["USHazmatClass1","USHazmatClass2","USHazmatClass3","USHazmatClass4","USHazmatClass5","USHazmatClass6","USHazmatClass7","USHazmatClass8","USHazmatClass9","otherHazmatExplosive","otherHazmatGeneral","otherHazmatHarmfulToWater"]))),maxSpeedKMH:_t($e().check(xe(0),ze(250))),adrCode:_t(dt(["B","C","D","E"])),commercial:_t(qe())}))},rs=ot({...ns,engineType:function(e){return function(e,t){return new e({type:"undefined",...B(t)})}(Je,e)}(),state:_t(qi),preferences:_t(ot({}))}),os=ct([function(e,t,n){return new ut({type:"union",options:t,discriminator:e,...B(n)})}("engineType",[ot({...ns,engineType:Et("combustion"),state:_t(Ji),preferences:_t(ot({}))}),ot({...ns,engineType:Et("electric"),state:_t(Qi),preferences:_t(ts)})]),rs]),is=st(ot({costModel:st(ot({avoid:nt(dt(l)),traffic:_t(dt(["live","historical"])),routeType:_t(dt(["fast","short","efficient","thrilling"])),thrillingParams:_t(ot({hilliness:_t(dt(["low","normal","high"])),windingness:_t(dt(["low","normal","high"]))}))})),travelMode:Ye(),vehicle:os,when:ot({option:dt(["departAt","arriveBy"]),date:function(e){return function(e,t){return new e({type:"date",...B(t)})}(et,e)}()})})),ss=it(is,it(ot({origin:Ut,budget:ot({type:dt(["timeMinutes","remainingChargeCPT","spentChargePCT","spentFuelLiters","distanceKM"]),value:$e().check(xe(0))})}),ot({maxFerryLengthMeters:_t($e().check(xe(0)))}).shape).shape),as=e=>e.map(e=>`${e.speedKMH},${e.consumptionUnitsPer100KM}`).join(":"),cs=(e,t,n)=>{((e,t)=>{t&&(!To(t.acceleration)&&e.append("accelerationEfficiency",String(t.acceleration)),!To(t.deceleration)&&e.append("decelerationEfficiency",String(t.deceleration)),!To(t.uphill)&&e.append("uphillEfficiency",String(t.uphill)),!To(t.downhill)&&e.append("downhillEfficiency",String(t.downhill)))})(e,n.consumption.efficiency),"electric"===t?(((e,t)=>{t.speedsToConsumptionsKWH&&e.append("constantSpeedConsumptionInkWhPerHundredkm",as(t.speedsToConsumptionsKWH)),!To(t.auxiliaryPowerInkW)&&e.append("auxiliaryPowerInkW",String(t.auxiliaryPowerInkW)),!To(t.consumptionInKWHPerKMAltitudeGain)&&e.append("consumptionInkWhPerkmAltitudeGain",String(t.consumptionInKWHPerKMAltitudeGain)),!To(t.recuperationInKWHPerKMAltitudeLoss)&&e.append("recuperationInkWhPerkmAltitudeLoss",String(t.recuperationInKWHPerKMAltitudeLoss))})(e,n.consumption),((e,t)=>{const n=t.charging;n?.maxChargeKWH&&e.append("maxChargeInkWh",String(n.maxChargeKWH))})(e,n)):((e,t)=>{const n=t.consumption;n.speedsToConsumptionsLiters&&e.append("constantSpeedConsumptionInLitersPerHundredkm",as(n.speedsToConsumptionsLiters)),!To(n.auxiliaryPowerInLitersPerHour)&&e.append("auxiliaryPowerInLitersPerHour",String(n.auxiliaryPowerInLitersPerHour)),!To(n.fuelEnergyDensityInMJoulesPerLiter)&&e.append("fuelEnergyDensityInMJoulesPerLiter",String(n.fuelEnergyDensityInMJoulesPerLiter))})(e,n)},us=(e,t)=>{t.model&&("variantId"in t.model?e.append("vehicleModelId",t.model.variantId):(((e,t)=>{t&&(t.lengthMeters&&e.append("vehicleLength",String(t.lengthMeters)),t.heightMeters&&e.append("vehicleHeight",String(t.heightMeters)),t.widthMeters&&e.append("vehicleWidth",String(t.widthMeters)),t.weightKG&&e.append("vehicleWeight",String(t.weightKG)),t.axleWeightKG&&e.append("vehicleAxleWeight",String(t.axleWeightKG)))})(e,t.model.dimensions),t.model.engine&&cs(e,"engineType"in t?t.engineType:void 0,t.model.engine)))},ps=(e,t)=>{t&&("electric"===t.engineType&&e.append("vehicleEngineType","electric"),us(e,t),((e,t)=>{if(t.state&&(t.state.heading&&e.append("vehicleHeading",String(t.state.heading)),"engineType"in t))if("combustion"===t.engineType){const n=t.state;n.currentFuelInLiters&&e.append("currentFuelInLiters",String(n.currentFuelInLiters))}else if("electric"===t.engineType){const n=t.state,r=n,o=n;if(r.currentChargeInkWh)e.append("currentChargeInkWh",String(r.currentChargeInkWh));else if(o.currentChargePCT&&t.model&&"engine"in t.model&&t.model.engine){const n=t.model.engine,r=n.charging?.maxChargeKWH;r&&e.append("currentChargeInkWh",String(r*o.currentChargePCT/100))}}})(e,t),((e,t)=>{if(t.preferences&&"engineType"in t&&"electric"===t.engineType){const n=t.preferences;if(n.chargingPreferences){const r=n.chargingPreferences,o=r,i=r;if(o.minChargeAtChargingStopsInkWh||o.minChargeAtDestinationInkWh)e.append("minChargeAtDestinationInkWh",String(o.minChargeAtDestinationInkWh)),e.append("minChargeAtChargingStopsInkWh",String(o.minChargeAtChargingStopsInkWh));else if((i.minChargeAtChargingStopsPCT||i.minChargeAtDestinationPCT)&&t.model&&"engine"in t.model&&t.model.engine){const n=t.model.engine,r=n.charging?.maxChargeKWH;r&&(e.append("minChargeAtDestinationInkWh",String(r*i.minChargeAtDestinationPCT/100)),e.append("minChargeAtChargingStopsInkWh",String(r*i.minChargeAtChargingStopsPCT/100)))}}}})(e,t),((e,t)=>{const n=t.restrictions;n&&(fo(e,"vehicleLoadType",n.loadTypes),n.adrCode&&e.append("vehicleAdrTunnelRestrictionCode",n.adrCode),n.commercial&&e.append("vehicleCommercial",String(n.commercial)),n.maxSpeedKMH&&e.append("vehicleMaxSpeed",String(n.maxSpeedKMH)))})(e,t))},ls=(e,t)=>{const n=t.costModel;fo(e,"avoid",n?.avoid),No(e,"traffic",n?.traffic),((e,t)=>{if(t?.date){const n=t.date.toISOString();"departAt"===t.option?e.append("departAt",n):"arriveBy"===t.option&&e.append("arriveAt",n)}})(e,t.when),No(e,"routeType",n?.routeType),No(e,"travelMode",t.travelMode),ps(e,t.vehicle)},As=e=>{const t=new URL((e=>e.customServiceBaseURL||`${e.commonBaseURL}/routing/1/calculateReachableRange/${Lo(A(e.origin))}/json`)(e)),n=t.searchParams;return go(n,e),ls(n,e),No(n,"maxFerryLengthInMeters",e.maxFerryLengthMeters),t},ds=(e,t)=>{const n={type:"Polygon",coordinates:[e.reachableRange.boundary.map(e=>[e.longitude,e.latitude])]};return{type:"Feature",geometry:n,bbox:i(n),properties:t}},Rs={buildReachableRangeRequest:As,parseReachableRangeResponse:ds,reachableRangeTemplate:{requestValidation:{schema:ss},buildRequest:As,sendRequest:Ot,parseResponse:ds}},Es=e=>{const t=A(e.position),n=new URL(`${(e=>e.customServiceBaseURL||`${e.commonBaseURL}${yo}/reverseGeocode`)(e)}/${t[1]},${t[0]}.json`),r=n.searchParams;return go(r,e),e.allowFreeformNewline&&r.append("allowFreeformNewline",String(e.allowFreeformNewline)),e.geographyType&&r.append("entityType",ni(e.geographyType)),!To(e.heading)&&r.append("heading",String(e.heading)),e.mapcodes&&r.append("mapcodes",ni(e.mapcodes)),e.number&&r.append("number",e.number),!To(e.radiusMeters)&&r.append("radius",String(e.radiusMeters)),e.returnSpeedLimit&&r.append("returnSpeedLimit",String(e.returnSpeedLimit)),e.returnRoadUse&&r.append("returnRoadUse",String(e.returnRoadUse)),e.roadUses&&r.append("roadUse",JSON.stringify(e.roadUses)),n},Ts=(e,t)=>{const n=r(A(t.position)),o=e.addresses[0],{boundingBox:i,sideOfStreet:s,offsetPosition:c,...u}=o?.address||{};return{...n,...i&&{bbox:Uo(i)},id:a(),...o&&{properties:{type:o?.entityType?"Geography":u.streetNumber?"Point Address":"Street",address:u,...o.dataSources&&{dataSources:o.dataSources},...o.mapcodes&&{mapcodes:o.mapcodes},...s&&{sideOfStreet:s},...c&&{offsetPosition:Po(c)},originalPosition:Po(o.position)}}}},_s={requestValidation:{schema:it(ot({position:Ut}),st(ot({allowFreeformNewline:qe(),geographyType:nt(Ye()),heading:$e().check(xe(-360),ze(360)),mapcodes:nt(Ye()),number:Ye(),radiusMeters:$e(),returnMatchType:qe(),returnRoadUse:qe(),returnSpeedLimit:qe(),roadUses:nt(Ye()),view:dt(o)})).shape)},buildRequest:Es,sendRequest:Ot,parseResponse:Ts},hs={buildRevGeoRequest:Es,parseRevGeoResponse:Ts,reverseGeocodingTemplate:_s},Ss=ct([Ut,vt]),Is=ct([Ct,Pt]),gs=it(is,it(ot({locations:nt(ct([Ss,Is])).check(Fe(1))}),st(ot({computeAdditionalTravelTimeFor:dt(["none","all"]),vehicleHeading:$e().check(xe(0),ze(359.5)),maxAlternatives:$e().check(xe(0),ze(5)),sectionTypes:nt(dt(R))})).shape).shape),fs=e=>e.vehicle?.preferences?.chargingPreferences,ms=e=>Array.isArray(e)?e:e.geometry.coordinates,Ns=(e,t,n)=>((e,t)=>e.map(e=>{const n=Lo(A(e,{useEntryPoint:t})),r=(e=>e.properties||null)(e)?.radiusMeters;return r?`circle(${n},${r})`:n}).join(":"))(t.includes("path")?((e,t,n)=>{let r;const o=e[0];r="path"===t[0]?ms(o)[0]:A(o,{useEntryPoint:n});const i=e[e.length-1];let s;if("path"===t[t.length-1]){const e=ms(i);s=e[e.length-1]}else s=A(i,{useEntryPoint:n});return[r,s]})(e,t,n):e,n),Os=e=>({latitude:e[1],longitude:e[0]}),ys=(e,t,n)=>{const r=[],o=[];return e.forEach((i,s)=>{"path"===t[s]?((e,t,n,r,o)=>{const i=r.length;for(const s of ms(e))r.push(Os(s));Array.isArray(e)||(e.properties.sections.leg.forEach((e,n)=>{(t>0||n>0)&&o.push({supportingPointIndex:i+e.startPointIndex,waypointSourceType:"USER_DEFINED"})}),t<n.length-1&&o.push({supportingPointIndex:i+e.geometry.coordinates.length-1,waypointSourceType:"USER_DEFINED"}))})(i,s,e,r,o):((e,t,n,r,o,i)=>{r.push(Os(A(e,{useEntryPoint:i}))),t>0&&t<n.length-1&&o.push({supportingPointIndex:r.length-1,waypointSourceType:"USER_DEFINED"})})(i,s,e,r,o,n)}),{supportingPoints:r,...o.length&&{pointWaypoints:o}}},Cs=e=>{const t=e.locations.map(d),n=e.useEntryPoints??"main-when-available",r=new URL(`${(e=>e.customServiceBaseURL||`${e.commonBaseURL}/maps/orbis/routing/${fs(e)?"calculateLongDistanceEVRoute":"calculateRoute"}`)(e)}/${Ns(e.locations,t,n)}/json`),o=r.searchParams;go(o,e),"language"in e||o.append("language","en-GB"),ls(o,e),No(o,"computeTravelTimeFor",e.computeAdditionalTravelTimeFor),((e,t)=>{if(t?.guidance){const n=t.guidance;e.append("instructionsType",n.type),e.append("guidanceVersion",String(n.version??2)),e.append("instructionPhonetics",n.phonetics??"IPA"),e.append("instructionRoadShieldReferences",n.roadShieldReferences??"all"),e.append("language",t.language??"en-US")}})(o,e),!To(e.maxAlternatives)&&o.append("maxAlternatives",String(e.maxAlternatives)),((e,t,n)=>{const r=(t??(n?R:E)).map(e=>"vehicleRestricted"===e?"travelMode":e);fo(e,"sectionType",r)})(o,e.sectionTypes,!!e.guidance?.type);for(const s of e.extendedRouteRepresentations??["distance","travelTime"])o.append("extendedRouteRepresentation",s);const i=((e,t,n)=>{const r=t.includes("path"),o=!!fs(e);if(!r&&!o)return null;const i=e.vehicle?.model,s=i?.engine?.charging;return{...r&&ys(e.locations,t,n),...o&&s&&{chargingParameters:So(s,"maxChargeKWH")}}})(e,t,n);return i?{method:"POST",url:r,data:i}:{method:"GET",url:r}},vs=e=>{switch(e){case"Direct_Current":return"DC";case"Alternating_Current_1_Phase":return"AC1";case"Alternating_Current_3_Phase":return"AC3";default:return}},Ps=(e,t)=>{const n=e.chargingConnectionInfo,r=e.chargingParkLocation,o=[r.coordinate.longitude,r.coordinate.latitude],i=[r.street,r.houseNumber].filter(Boolean),s=i.length>0?i.join(", "):"";return{type:"Feature",id:e.chargingParkId,geometry:{type:"Point",coordinates:o},properties:{...So(e,["chargingConnectionInfo","chargingParkLocation"]),type:"POI",address:{freeformAddress:s,...r.street&&{streetName:r.street},...r.houseNumber&&{streetNumber:r.houseNumber},...r.city&&{municipality:r.city},...r.region&&{countrySubdivision:r.region},...r.postalCode&&{postalCode:r.postalCode},...r.country&&{country:r.country}},...n&&{chargingConnectionInfo:{plugType:n.chargingPlugType,currentInA:n.chargingCurrentInA,voltageInV:n.chargingVoltageInV,chargingPowerInkW:n.chargingPowerInkW,currentType:vs(n.chargingCurrentType),chargingSpeed:zo(n.chargingPowerInkW)}},...t&&{targetChargeInPCT:100*e.targetChargeInkWh/t},...e.chargingParkPowerInkW&&{chargingParkSpeed:zo(e.chargingParkPowerInkW)}}}},Ls=(e,t)=>{const n=t?.vehicle?.model?.engine?.charging?.maxChargeKWH;return{lengthInMeters:e.lengthInMeters,historicTrafficTravelTimeInSeconds:e.historicTrafficTravelTimeInSeconds,liveTrafficIncidentsTravelTimeInSeconds:e.liveTrafficIncidentsTravelTimeInSeconds,noTrafficTravelTimeInSeconds:e.noTrafficTravelTimeInSeconds,trafficDelayInSeconds:e.trafficDelayInSeconds,trafficLengthInMeters:e.trafficLengthInMeters,travelTimeInSeconds:e.travelTimeInSeconds,departureTime:new Date(e.departureTime),arrivalTime:new Date(e.arrivalTime),deviationDistanceInMeters:e.deviationDistance,fuelConsumptionInLiters:e.fuelConsumptionInLiters,...e.deviationPoint&&{deviationPoint:[e.deviationPoint.longitude,e.deviationPoint.latitude]},totalChargingTimeInSeconds:e.totalChargingTimeInSeconds,batteryConsumptionInkWh:e.batteryConsumptionInkWh,...n&&e.batteryConsumptionInkWh&&{batteryConsumptionInPCT:100*e.batteryConsumptionInkWh/n},remainingChargeAtArrivalInkWh:e.remainingChargeAtArrivalInkWh,...n&&e.remainingChargeAtArrivalInkWh&&{remainingChargeAtArrivalInPCT:100*e.remainingChargeAtArrivalInkWh/n},...e.chargingInformationAtEndOfLeg&&{chargingInformationAtEndOfLeg:Ps(e.chargingInformationAtEndOfLeg,n)}}},Us=(e,t)=>e.reduce((e,n,r)=>{const o=0===r?0:e[r-1]?.endPointIndex;let i;return To(o)||(i=0===o?n.points?.length>0?n.points.length-1:0:o+n.points?.length),e.push({...!To(o)&&{startPointIndex:o},...i&&{endPointIndex:i},summary:Ls(n.summary,t),id:a()}),e},[]),bs=e=>({id:a(),startPointIndex:e.startPointIndex,endPointIndex:e.endPointIndex}),Ms=e=>({...bs(e),index:e.importantRoadStretchIndex,streetName:e.streetName?.text,roadNumbers:e.roadNumbers?.map(e=>e.text)}),ws=e=>({...bs(e),countryCodeISO3:e.countryCode}),Hs=e=>"other"===e.travelMode?bs(e):null,Ds=e=>{if(e.tec?.causes?.length)return e.tec.causes.map(e=>(e=>{switch(e){case 1:return"jam";case 2:return"accident";case 3:return"roadworks";case 4:return"narrow-lanes";case 5:return"road-closed";case 9:return"danger";case 11:return"animals-on-road";case 13:return"broken-down-vehicle";case 16:return"lane-closed";case 17:return"wind";case 18:return"fog";case 19:return"rain";case 22:return"frost";case 23:return"flooding";default:return"other"}})(e.mainCauseCode));switch(e.simpleCategory){case"JAM":return["jam"];case"ROAD_WORK":return["roadworks"];case"ROAD_CLOSURE":return["road-closed"];default:return["other"]}},Gs=e=>({...bs(e),delayInSeconds:e.delayInSeconds,effectiveSpeedInKmh:e.effectiveSpeedInKmh,categories:Ds(e),magnitudeOfDelay:T[e.magnitudeOfDelay],tec:e.tec}),js=e=>({...bs(e),lanes:e.lanes,laneSeparators:e.laneSeparators,properties:e.properties}),zs=e=>({...bs(e),maxSpeedLimitInKmh:e.maxSpeedLimitInKmh}),xs=e=>({...bs(e),roadShieldReferences:e.roadShieldReferences}),Bs=(e,t)=>(t[e]||(t[e]=[]),t[e]),Fs=e=>{switch(e.sectionType){case"CAR_TRAIN":return{sectionType:"carTrain",mappingFunction:bs};case"COUNTRY":return{sectionType:"country",mappingFunction:ws};case"FERRY":return{sectionType:"ferry",mappingFunction:bs};case"MOTORWAY":return{sectionType:"motorway",mappingFunction:bs};case"PEDESTRIAN":return{sectionType:"pedestrian",mappingFunction:bs};case"TOLL_VIGNETTE":return{sectionType:"tollVignette",mappingFunction:ws};case"TOLL":return{sectionType:"toll",mappingFunction:bs};case"TRAFFIC":return{sectionType:"traffic",mappingFunction:Gs};case"TRAVEL_MODE":return{sectionType:"vehicleRestricted",mappingFunction:Hs};case"TUNNEL":return{sectionType:"tunnel",mappingFunction:bs};case"UNPAVED":return{sectionType:"unpaved",mappingFunction:bs};case"URBAN":return{sectionType:"urban",mappingFunction:bs};case"CARPOOL":return{sectionType:"carpool",mappingFunction:bs};case"LOW_EMISSION_ZONE":return{sectionType:"lowEmissionZone",mappingFunction:bs};case"LANES":return{sectionType:"lanes",mappingFunction:js};case"SPEED_LIMIT":return{sectionType:"speedLimit",mappingFunction:zs};case"ROAD_SHIELDS":return{sectionType:"roadShields",mappingFunction:xs};case"IMPORTANT_ROAD_STRETCH":return{sectionType:"importantRoadStretch",mappingFunction:Ms}}},ks=(e,t)=>{const n={leg:Us(e.legs,t)};return((e,t)=>{if(Array.isArray(e))for(const n of e){const e=Fs(n),r=e?.mappingFunction(n);r&&Bs(e.sectionType,t).push(r)}})(e.sections,n),n},Ws=1e-4,Vs=(e,t)=>Math.abs(e[0]-t[0])<Ws&&Math.abs(e[1]-t[1])<Ws,Ys=(e,t)=>{const n=[];let r=0;for(const o of e.instructions){const e=[o.maneuverPoint.longitude,o.maneuverPoint.latitude];for(let n=r;n<t.length;n++){if(Vs(t[n],e)){r=n;break}if(n===t.length-1)break}n.push({...o,maneuverPoint:e,pathPointIndex:r,routePath:o.routePath.map(e=>({...e,point:[e.point.longitude,e.point.latitude]}))})}return{instructions:n}},Ks=(e,t)=>{const n=e.routes.map((e,n)=>((e,t,n)=>{const r={type:"LineString",coordinates:e.legs.flatMap(e=>e.points?.map(e=>[e.longitude,e.latitude]))},o=i(r);return{type:"Feature",geometry:r,id:a(),...o&&{bbox:o},properties:{index:t,summary:Ls(e.summary,n),sections:ks(e,n),...e.guidance&&{guidance:Ys(e.guidance,r.coordinates)},...e.progress&&{progress:e.progress}}}})(e,n,t)),r=i(n);return{type:"FeatureCollection",...r&&{bbox:r},features:n}},$s={requestValidation:{schema:gs,refinements:[{check:e=>!!e.locations.map(d).includes("path")||e.locations.length>=2,message:"When passing waypoints only: at least 2 must be defined. If passing also paths, at least one path must be defined"}]},buildRequest:Cs,sendRequest:async(e,t)=>{const n=e.method;if("GET"===n)return Ot(e.url,t);if("POST"===n)return yt(e,t);throw new Error(`Unsupported HTTP method received: ${n}`)},parseResponse:Ks,parseResponseError:(e,t)=>{const{data:n,message:r,status:o}=e;return new I(n?.error?.description??n?.detailedError?.message??r,t,o)},getAPIVersion:()=>2},Zs={reverseGeocode:hs,geocode:ci,geometryData:Ri,geometrySearch:mi,calculateRoute:{buildCalculateRouteRequest:Cs,parseCalculateRouteResponse:Ks,calculateRouteTemplate:$s},reachableRange:Rs,evChargingStationsAvailability:Qo,placeByID:vi,autocompleteSearch:Do},qs=async(e,t)=>ft(e,{...Jo,...t},"EVChargingStationsAvailability"),Js=async e=>{const t=e.properties.dataSources?.chargingAvailability?.id;if(!t)return e;try{const n=await qs({id:t}),r=e.properties.poi;return n?{...e,properties:{...e.properties,...r&&{poi:{...r,openingHours:n.openingHours}},chargingPark:{...e.properties.chargingPark,availability:n}}}:e}catch(n){return console.error(n),e}},Qs=async(e,t={includeIfAvailabilityUnknown:!0})=>{const n=[];for(const r of e.features){const e=await Js(r);(e.properties.chargingPark?.availability||t.includeIfAvailabilityUnknown)&&n.push(e)}return{...e,features:n,bbox:i(n)}},Xs=async(e,t)=>ft(e,{...ai,...t},"Geocode"),ea=async e=>(await Xs({query:e,limit:1})).features[0];async function ta(e,t){const n=await ft(e,{...di,...t},"GeometryData");return Array.isArray(e.geometries)||"FeatureCollection"!==e.geometries.type?n:((e,t)=>{const n=e.features.reduce((e,t)=>{const n=t.properties.dataSources?.geometry?.id;return n&&(e[n]={...t.properties,placeCoordinates:t.geometry.coordinates}),e},{}),r=t.features.map(e=>e.id&&n[e.id]?{...e,properties:n[e.id]}:e);return{type:"FeatureCollection",bbox:t.bbox,features:r}})(e.geometries,n)}const na=async(e,t)=>ft(e,{...Ci,...t},"PlaceById"),ra=async(e,t)=>ft(e,{..._s,...t},"ReverseGeocode"),oa=async(e,t)=>ft(e,{...$s,...t},"Routing"),ia=it(Ti,it(Xo,st(ot({minFuzzyLevel:$e().check(xe(1),ze(4)),maxFuzzyLevel:$e().check(xe(1),ze(4))})).shape).shape),sa=e=>{let t;switch(e.type){case"COORDINATE":t={...e,details:{position:bo(e.details)}};break;case"NEARBY":t={...e,details:{position:bo({lon:e.details.lon,lat:e.details.lat}),text:e.details.text,query:e.details.query}};break;case"BOOKMARK":case"W3W":t=e}return t},aa={requestValidation:{schema:ia},buildRequest:e=>{const t=new URL(`${n=e,n.customServiceBaseURL??`${n.commonBaseURL}${yo}/search/${n.query}.json`}`);var n;Co(t,e);const r=t.searchParams;No(r,"typeahead",e.typeahead),No(r,"ofs",e.offset),mo(r,"countrySet",e.countries),No(r,"radius",e.radiusMeters);const o=e.boundingBox&&i(e.boundingBox);return o&&(r.append("topLeft",ni([o[3],o[0]])),r.append("btmRight",ni([o[1],o[2]]))),No(r,"minFuzzyLevel",e.minFuzzyLevel),No(r,"maxFuzzyLevel",e.maxFuzzyLevel),t},sendRequest:Ot,parseResponse:e=>{const t=e.results.map($o),n=s(i(t));return{type:"FeatureCollection",properties:{...Zo(e.summary),queryIntent:e.summary.queryIntent.map(sa)},features:t,...n&&{bbox:n}}}},ca=async(e,t)=>"geometries"in e?fi(e,t):(async(e,t)=>ft(e,{...aa,...t},"FuzzySearch"))(e,t),ua=async e=>(await ca({query:e,limit:1})).features[0];export{S as APIErrorCode,h as SDKError,I as SDKServiceError,Ho as autocompleteSearch,Js as buildPlaceWithEVAvailability,Qs as buildPlacesWithEVAvailability,f as buildResponseError,m as buildValidationError,oa as calculateRoute,Zs as customizeService,qs as evChargingStationsAvailability,Xs as geocode,ea as geocodeOne,ta as geometryData,g as parseDefaultResponseError,na as placeById,ra as reverseGeocode,ca as search,ua as searchOne};
1
+ import{mergeFromGlobal as e,generateTomTomHeaders as t,getPosition as n,poiCategoriesToID as r,toPointFeature as o,views as i,bboxFromGeoJSON as s,bboxOnlyIfWithArea as a,generateId as c,bboxFromCoordsArray as u,plugTypes as p,currentTypes as l,avoidableTypes as d,getPositionStrict as h,getRoutePlanningLocationType as g,inputSectionTypesWithGuidance as f,inputSectionTypes as m,indexedMagnitudes as y}from"@tomtom-org/maps-sdk/core";var v=/* @__PURE__ */(e=>(e[e.TOO_MANY_REQUESTS=429]="TOO_MANY_REQUESTS",e[e.FORBIDDEN=403]="FORBIDDEN",e))(v||{});class b extends Error{constructor(e,t,n){super(e),this.service=t,this.issues=n,Error.captureStackTrace&&Error.captureStackTrace(this,b)}}const _={[v.TOO_MANY_REQUESTS]:"Too Many Requests: The API Key is over QPS (Queries per second)",[v.FORBIDDEN]:"Request failed with status code 403"};class w extends b{constructor(e,t,n){super(e,t),this.status=n,this.status&&_[this.status]&&(this.message=_[this.status])}}const S=(e,t)=>{const{data:n,message:r,status:o}=e;return new w(n?.error||n?.errorText||r,t,o)},P=(e,t,n)=>{if(e.status){const r=e;return n?n(r,t):S(r,t)}return new b(e.message,t)},T=(e,t)=>new b(e.message,t,e.issues);function I(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:/* @__PURE__ */new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=s.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class i extends o{}function s(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const n of o._zod.deferred)n();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class j extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}const z={};function x(e){return z}function C(e,t){return"bigint"==typeof t?t.toString():t}function R(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function A(e){return null==e}function k(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const O=Symbol("evaluating");function E(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==O)return void 0===r&&(r=O,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function M(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function L(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}const $="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function F(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const U=/* @__PURE__ */new Set(["string","number","symbol"]);function W(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function N(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function D(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}function B(e,t){if(!function(e){if(!1===F(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==F(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const r=L(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return M(this,"shape",n),n},checks:[]});return N(e,r)}function q(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function H(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function K(e){return"string"==typeof e?e:e?.message}function Z(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=K(e.inst?._zod.def?.error?.(e))??K(t?.error?.(e))??K(n.customError?.(e))??K(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function V(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}const G=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,C,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Y=I("$ZodError",G),J=I("$ZodError",G,{Parent:Error});function Q(e){const t=[],n=e.map(e=>"object"==typeof e?e.key:e);for(const r of n)"number"==typeof r?t.push(`[${r}]`):"symbol"==typeof r?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}const X=/* @__PURE__ */(e=>(t,n,r,o)=>{const i=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new j;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>Z(e,i,x())));throw $(t,o?.callee),t}return s.value})(J),ee=e=>async(t,n,r,o)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>Z(e,i,x())));throw $(t,o?.callee),t}return s.value},te=/* @__PURE__ */ee(J),ne=/* @__PURE__ */(e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new j;return i.issues.length?{success:!1,error:new(e??Y)(i.issues.map(e=>Z(e,o,x())))}:{success:!0,data:i.value}})(J),re=/* @__PURE__ */(e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>Z(e,o,x())))}:{success:!0,data:i.value}})(J),oe=/^-?\d+(?:\.\d+)?/,ie=/^(?:true|false)$/i,se=/^undefined$/i,ae=/* @__PURE__ */I("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ce={number:"number",bigint:"bigint",object:"date"},ue=/* @__PURE__ */I("$ZodCheckLessThan",(e,t)=>{ae.init(e,t);const n=ce[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pe=/* @__PURE__ */I("$ZodCheckGreaterThan",(e,t)=>{ae.init(e,t);const n=ce[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),le=/* @__PURE__ */I("$ZodCheckMaxLength",(e,t)=>{var n;ae.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!A(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const r=n.value;if(r.length<=t.maximum)return;const o=V(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),de=/* @__PURE__ */I("$ZodCheckMinLength",(e,t)=>{var n;ae.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!A(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const r=n.value;if(r.length>=t.minimum)return;const o=V(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),he=/* @__PURE__ */I("$ZodCheckLengthEquals",(e,t)=>{var n;ae.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!A(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{const r=n.value,o=r.length;if(o===t.length)return;const i=V(r),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ge={major:4,minor:1,patch:13},fe=/* @__PURE__ */I("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ge;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const t of o._zod.onattach)t(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=q(e);for(const i of t){if(i._zod.def.when){if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new j;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(o||(o=q(e,t)))});else{if(e.issues.length===t)continue;o||(o=q(e,t))}}return r?r.then(()=>e):e},n=(n,o,i)=>{if(q(n))return n.aborted=!0,n;const s=t(o,r,i);if(s instanceof Promise){if(!1===i.async)throw new j;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){const t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,i)):n(t,o,i)}const s=e._zod.parse(o,i);if(s instanceof Promise){if(!1===i.async)throw new j;return s.then(e=>t(e,r,i))}return t(s,r,i)}}e["~standard"]={validate:t=>{try{const n=ne(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return re(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}}),me=/* @__PURE__ */I("$ZodString",(e,t)=>{var n;fe.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),ye=/* @__PURE__ */I("$ZodNumber",(e,t)=>{fe.init(e,t),e._zod.pattern=e._zod.bag.pattern??oe,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(s){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),ve=/* @__PURE__ */I("$ZodBoolean",(e,t)=>{fe.init(e,t),e._zod.pattern=ie,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(i){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),be=/* @__PURE__ */I("$ZodUndefined",(e,t)=>{fe.init(e,t),e._zod.pattern=se,e._zod.values=/* @__PURE__ */new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const r=t.value;return void 0===r||t.issues.push({expected:"undefined",code:"invalid_type",input:r,inst:e}),t}}),_e=/* @__PURE__ */I("$ZodAny",(e,t)=>{fe.init(e,t),e._zod.parse=e=>e}),we=/* @__PURE__ */I("$ZodDate",(e,t)=>{fe.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch(s){}const o=n.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||n.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:e}),n}});function Se(e,t,n){e.issues.length&&t.issues.push(...H(n,e.issues)),t.value[n]=e.value}const Pe=/* @__PURE__ */I("$ZodArray",(e,t)=>{fe.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then(t=>Se(t,n,e))):Se(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function Te(e,t,n,r){e.issues.length&&t.issues.push(...H(n,e.issues)),void 0===e.value?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Ie(e){const t=Object.keys(e.shape);for(const o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);const n=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}const je=/* @__PURE__ */I("$ZodObject",(e,t)=>{fe.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const r=R(()=>Ie(t));E(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=/* @__PURE__ */new Set);for(const e of r.values)n[t].add(e)}}return n});const o=F,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],u=s.shape;for(const e of s.keys){const r=u[e]._zod.run({value:a[e],issues:[]},n);r instanceof Promise?c.push(r.then(n=>Te(n,t,e,a))):Te(r,t,e,a)}return i?function(e,t,n,r,o,i){const s=[],a=o.keySet,c=o.catchall._zod,u=c.def.type;for(const p in t){if(a.has(p))continue;if("never"===u){s.push(p);continue}const o=c.run({value:t[p],issues:[]},r);o instanceof Promise?e.push(o.then(e=>Te(e,n,p,t))):Te(o,n,p,t)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}(c,a,t,n,r.value,e):c.length?Promise.all(c).then(()=>t):t}});function ze(e,t,n,r){for(const i of e)if(0===i.issues.length)return t.value=i.value,t;const o=e.filter(e=>!q(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Z(e,r,x())))}),t)}const xe=/* @__PURE__ */I("$ZodUnion",(e,t)=>{fe.init(e,t),E(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),E(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),E(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),E(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){const e=t.options.map(e=>e._zod.pattern);return new RegExp(`^(${e.map(e=>k(e.source)).join("|")})$`)}});const n=1===t.options.length,r=t.options[0]._zod.run;e._zod.parse=(o,i)=>{if(n)return r(o,i);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:o.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>ze(t,o,e,i)):ze(a,o,e,i)}}),Ce=/* @__PURE__ */I("$ZodDiscriminatedUnion",(e,t)=>{xe.init(e,t);const n=e._zod.parse;E(e._zod,"propValues",()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=/* @__PURE__ */new Set);for(const r of n)e[t].add(r)}}return e});const r=R(()=>{const e=t.options,n=/* @__PURE__ */new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(o,i)=>{const s=o.value;if(!F(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),o)}}),Re=/* @__PURE__ */I("$ZodTuple",(e,t)=>{fe.init(e,t);const n=t.items;e._zod.parse=(r,o)=>{const i=r.value;if(!Array.isArray(i))return r.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];const s=[],a=[...n].reverse().findIndex(e=>"optional"!==e._zod.optin),c=-1===a?0:n.length-a;if(!t.rest){const t=i.length>n.length,o=i.length<c-1;if(t||o)return r.issues.push({...t?{code:"too_big",maximum:n.length}:{code:"too_small",minimum:n.length},input:i,inst:e,origin:"array"}),r}let u=-1;for(const e of n){if(u++,u>=i.length&&u>=c)continue;const t=e._zod.run({value:i[u],issues:[]},o);t instanceof Promise?s.push(t.then(e=>Ae(e,r,u))):Ae(t,r,u)}if(t.rest){const e=i.slice(n.length);for(const n of e){u++;const e=t.rest._zod.run({value:n,issues:[]},o);e instanceof Promise?s.push(e.then(e=>Ae(e,r,u))):Ae(e,r,u)}}return s.length?Promise.all(s).then(()=>r):r}});function Ae(e,t,n){e.issues.length&&t.issues.push(...H(n,e.issues)),t.value[n]=e.value}const ke=/* @__PURE__ */I("$ZodEnum",(e,t)=>{fe.init(e,t);const n=function(e){const t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,n])=>-1===t.indexOf(+e)).map(([e,t])=>t)}(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>U.has(typeof e)).map(e=>"string"==typeof e?W(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),Oe=/* @__PURE__ */I("$ZodLiteral",(e,t)=>{if(fe.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(e=>"string"==typeof e?W(e):e?W(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}});function Ee(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Me=/* @__PURE__ */I("$ZodOptional",(e,t)=>{fe.init(e,t),e._zod.optin="optional",e._zod.optout="optional",E(e._zod,"values",()=>t.innerType._zod.values?/* @__PURE__ */new Set([...t.innerType._zod.values,void 0]):void 0),E(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${k(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Ee(t,e.value)):Ee(r,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Le=/* @__PURE__ */I("$ZodCustom",(e,t)=>{ae.init(e,t),fe.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>$e(t,n,r,e));$e(o,n,r,e)}});function $e(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(function(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}(e))}}var Fe;class Ue{constructor(){this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map}add(e,...t){const n=t[0];if(this._map.set(e,n),n&&"object"==typeof n&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=/* @__PURE__ */new WeakMap,this._idmap=/* @__PURE__ */new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function We(e,t){return new ue({check:"less_than",...D(t),value:e,inclusive:!0})}function Ne(e,t){return new pe({check:"greater_than",...D(t),value:e,inclusive:!0})}function De(e,t){return new le({check:"max_length",...D(t),maximum:e})}function Be(e,t){return new de({check:"min_length",...D(t),minimum:e})}function qe(e,t){return new he({check:"length_equals",...D(t),length:e})}(Fe=globalThis).__zod_globalRegistry??(Fe.__zod_globalRegistry=new Ue);const He=/* @__PURE__ */I("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");fe.init(e,t),e.def=t,e.type=t.type,e.parse=(t,n)=>X(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ne(e,t,n),e.parseAsync=async(t,n)=>te(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>re(e,t,n),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),e.clone=(t,n)=>N(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e)}),Ke=/* @__PURE__ */I("ZodMiniString",(e,t)=>{me.init(e,t),He.init(e,t)});function Ze(e){return function(e,t){return new e({type:"string",...D(t)})}(Ke,e)}const Ve=/* @__PURE__ */I("ZodMiniNumber",(e,t)=>{ye.init(e,t),He.init(e,t)});function Ge(e){return function(e,t){return new e({type:"number",checks:[],...D(t)})}(Ve,e)}const Ye=/* @__PURE__ */I("ZodMiniBoolean",(e,t)=>{ve.init(e,t),He.init(e,t)});function Je(e){return function(e,t){return new e({type:"boolean",...D(t)})}(Ye,e)}const Qe=/* @__PURE__ */I("ZodMiniUndefined",(e,t)=>{be.init(e,t),He.init(e,t)});const Xe=/* @__PURE__ */I("ZodMiniAny",(e,t)=>{_e.init(e,t),He.init(e,t)});function et(){return new Xe({type:"any"})}const tt=/* @__PURE__ */I("ZodMiniDate",(e,t)=>{we.init(e,t),He.init(e,t)});const nt=/* @__PURE__ */I("ZodMiniArray",(e,t)=>{Pe.init(e,t),He.init(e,t)});function rt(e,t){return new nt({type:"array",element:e,...D(t)})}const ot=/* @__PURE__ */I("ZodMiniObject",(e,t)=>{je.init(e,t),He.init(e,t),E(e,"shape",()=>t.shape)});function it(e,t){const n={type:"object",shape:e??{},...D(t)};return new ot(n)}function st(e,t){return B(e,t)}function at(e,t){return function(e,t){const n=L(t._zod.def,{get shape(){const n=t._zod.def.shape,r={...n};for(const t in n)r[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return M(this,"shape",r),r},checks:[]});return N(t,n)}(yt,e)}const ct=/* @__PURE__ */I("ZodMiniUnion",(e,t)=>{xe.init(e,t),He.init(e,t)});function ut(e,t){return new ct({type:"union",options:e,...D(t)})}const pt=/* @__PURE__ */I("ZodMiniDiscriminatedUnion",(e,t)=>{Ce.init(e,t),He.init(e,t)});const lt=/* @__PURE__ */I("ZodMiniTuple",(e,t)=>{Re.init(e,t),He.init(e,t)});function dt(e,t,n){const r=t instanceof fe;return new lt({type:"tuple",items:e,rest:r?t:null,...D(r?n:t)})}const ht=/* @__PURE__ */I("ZodMiniEnum",(e,t)=>{ke.init(e,t),He.init(e,t),e.options=Object.values(t.entries)});function gt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new ht({type:"enum",entries:n,...D(t)})}const ft=/* @__PURE__ */I("ZodMiniLiteral",(e,t)=>{Oe.init(e,t),He.init(e,t)});function mt(e,t){return new ft({type:"literal",values:Array.isArray(e)?e:[e],...D(t)})}const yt=/* @__PURE__ */I("ZodMiniOptional",(e,t)=>{Me.init(e,t),He.init(e,t)});function vt(e){return new yt({type:"optional",innerType:e})}const bt=/* @__PURE__ */I("ZodMiniCustom",(e,t)=>{Le.init(e,t),He.init(e,t)});function _t(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...D(n)})}(bt,e,t)}const wt=at(it({apiKey:Ze(),commonBaseURL:Ze(),customServiceBaseURL:Ze(),language:Ze()}));class St extends Error{constructor(e){super(function(e){const t=[],n=[...e.issues].sort((e,t)=>(e.path??[]).length-(t.path??[]).length);for(const r of n)t.push(`✖ ${r.message}`),r.path?.length&&t.push(` → at ${Q(r.path)}`);return t.join("\n")}(e)),this.issues=e.issues}}const Pt=async(n,r,o)=>{const i=r.getAPIVersion?.(n),s=e({...n,...i&&{apiVersion:i}});if(void 0===n.validateRequest||n.validateRequest)try{((e,t)=>{const n=(t?.schema?st(wt,t.schema.shape):wt).check(_t(e=>"commonBaseURL"in e||"customServiceBaseURL"in e,"commonBaseURL or customServiceBaseURL is required"));let r;if(t?.refinements?.length){r=n;for(const e of t.refinements)r=r.check(_t(e.check,e.message))}const o=(r??n).safeParse(e);if(!o.success)throw new St(o.error)})(s,r.requestValidation)}catch(u){return Promise.reject(T(u,o))}const a=r.buildRequest(s),c=t(s);n.onAPIRequest?.(a);try{const e=await r.sendRequest(a,c);return n.onAPIResponse?.(a,e),r.parseResponse(await e.data,s)}catch(u){return n.onAPIResponse?.(a,u),Promise.reject(P(u,o,r.parseResponseError))}};class Tt extends Error{constructor(e,t,n){super(t??`HTTP Error ${e}`),this.name="FetchError",this.status=e,this.data=n,Error.captureStackTrace&&Error.captureStackTrace(this,Tt)}}const It=async e=>{if(e.ok)return{data:await e.json(),status:e.status};let t,n;const r=e.headers.get("content-type");throw e.bodyUsed?t=e.statusText:r?.includes("application/json")?(n=await e.json(),t=n?.errorText??n?.message??n?.detailedError?.message):r?.includes("text/xml")&&(n=await e.text(),t=e.statusText),new Tt(e.status,t,n)},jt=async(e,t)=>It(await fetch(e,{headers:t})),zt=async(e,t)=>It(await fetch(e.url,{method:"POST",body:JSON.stringify(e.data),headers:{...t,"Content-Type":"application/json"}})),xt=rt(rt(Ge())),Ct=it({type:gt(["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon","GeometryCollection","Circle"]),coordinates:ut([rt(Ge()),xt,rt(rt(rt(Ge()))),rt(rt(rt(rt(Ge()))))]),radius:vt(Ge()),radiusMeters:vt(Ge()),bbox:vt(rt(Ge()))}).check(_t(e=>"Circle"!==e.type||Boolean(e.radius),'type: "Circle" must have radius property')),Rt=it({type:mt("Feature"),geometry:Ct,id:vt(ut([Ze(),Ge()])),properties:et(),bbox:vt(rt(Ge()))}),At=it({type:mt("FeatureCollection"),features:rt(Rt),id:vt(ut([Ze(),Ge()])),properties:et(),bbox:vt(rt(Ge()))}),kt=ut([dt([Ge().check(Ne(-180),We(180)),Ge().check(Ne(-90),We(90))]),dt([Ge().check(Ne(-180),We(180)),Ge().check(Ne(-90),We(90)),Ge()]),it({type:mt("Point"),coordinates:rt(Ge())}),Rt]),Ot=ut([rt(Ge()).check(qe(4)),rt(Ge()).check(qe(6))]),Et=ut([Ct,Rt,At]),Mt=ut([Ot,Et,rt(Et)]),Lt=st(it({query:Ze()}),at(it({position:kt,limit:Ge().check(We(100)),radiusMeters:Ge(),countries:rt(Ze()),resultType:rt(Ze())})).shape);var $t="object"==typeof global&&global&&global.Object===Object&&global,Ft="object"==typeof self&&self&&self.Object===Object&&self,Ut=$t||Ft||Function("return this")(),Wt=Ut.Symbol,Nt=Object.prototype,Dt=Nt.hasOwnProperty,Bt=Nt.toString,qt=Wt?Wt.toStringTag:void 0;var Ht=Object.prototype.toString;var Kt=Wt?Wt.toStringTag:void 0;function Zt(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Kt&&Kt in Object(e)?function(e){var t=Dt.call(e,qt),n=e[qt];try{e[qt]=void 0;var r=!0}catch(i){}var o=Bt.call(e);return r&&(t?e[qt]=n:delete e[qt]),o}(e):function(e){return Ht.call(e)}(e)}function Vt(e){return null!=e&&"object"==typeof e}function Gt(e){return"symbol"==typeof e||Vt(e)&&"[object Symbol]"==Zt(e)}function Yt(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o}var Jt=Array.isArray,Qt=Wt?Wt.prototype:void 0,Xt=Qt?Qt.toString:void 0;function en(e){if("string"==typeof e)return e;if(Jt(e))return Yt(e,en)+"";if(Gt(e))return Xt?Xt.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function tn(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function nn(e){if(!tn(e))return!1;var t=Zt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var rn,on=Ut["__core-js_shared__"],sn=(rn=/[^.]+$/.exec(on&&on.keys&&on.keys.IE_PROTO||""))?"Symbol(src)_1."+rn:"";var an=Function.prototype.toString;function cn(e){if(null!=e){try{return an.call(e)}catch(t){}try{return e+""}catch(t){}}return""}var un=/^\[object .+?Constructor\]$/,pn=Function.prototype,ln=Object.prototype,dn=pn.toString,hn=ln.hasOwnProperty,gn=RegExp("^"+dn.call(hn).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function fn(e){return!(!tn(e)||(t=e,sn&&sn in t))&&(nn(e)?gn:un).test(cn(e));var t}function mn(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return fn(n)?n:void 0}var yn=mn(Ut,"WeakMap");var vn=Date.now;var bn,_n,wn,Sn=function(){try{var e=mn(Object,"defineProperty");return e({},"",{}),e}catch(t){}}(),Pn=Sn?function(e,t){return Sn(e,"toString",{configurable:!0,enumerable:!1,value:(n=t,function(){return n}),writable:!0});var n}:function(e){return e},Tn=(bn=Pn,_n=0,wn=0,function(){var e=vn(),t=16-(e-wn);if(wn=e,t>0){if(++_n>=800)return arguments[0]}else _n=0;return bn.apply(void 0,arguments)});var In=/^(?:0|[1-9]\d*)$/;function jn(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&In.test(e))&&e>-1&&e%1==0&&e<t}function zn(e,t,n){"__proto__"==t&&Sn?Sn(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function xn(e,t){return e===t||e!=e&&t!=t}var Cn=Object.prototype.hasOwnProperty;function Rn(e,t,n){var r=e[t];Cn.call(e,t)&&xn(r,n)&&(void 0!==n||t in e)||zn(e,t,n)}var An=Math.max;function kn(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}var On=Object.prototype;function En(e){return Vt(e)&&"[object Arguments]"==Zt(e)}var Mn=Object.prototype,Ln=Mn.hasOwnProperty,$n=Mn.propertyIsEnumerable,Fn=En(/* @__PURE__ */function(){return arguments}())?En:function(e){return Vt(e)&&Ln.call(e,"callee")&&!$n.call(e,"callee")};var Un="object"==typeof exports&&exports&&!exports.nodeType&&exports,Wn=Un&&"object"==typeof module&&module&&!module.nodeType&&module,Nn=Wn&&Wn.exports===Un?Ut.Buffer:void 0,Dn=(Nn?Nn.isBuffer:void 0)||function(){return!1},Bn={};function qn(e){return function(t){return e(t)}}Bn["[object Float32Array]"]=Bn["[object Float64Array]"]=Bn["[object Int8Array]"]=Bn["[object Int16Array]"]=Bn["[object Int32Array]"]=Bn["[object Uint8Array]"]=Bn["[object Uint8ClampedArray]"]=Bn["[object Uint16Array]"]=Bn["[object Uint32Array]"]=!0,Bn["[object Arguments]"]=Bn["[object Array]"]=Bn["[object ArrayBuffer]"]=Bn["[object Boolean]"]=Bn["[object DataView]"]=Bn["[object Date]"]=Bn["[object Error]"]=Bn["[object Function]"]=Bn["[object Map]"]=Bn["[object Number]"]=Bn["[object Object]"]=Bn["[object RegExp]"]=Bn["[object Set]"]=Bn["[object String]"]=Bn["[object WeakMap]"]=!1;var Hn="object"==typeof exports&&exports&&!exports.nodeType&&exports,Kn=Hn&&"object"==typeof module&&module&&!module.nodeType&&module,Zn=Kn&&Kn.exports===Hn&&$t.process,Vn=function(){try{var e=Kn&&Kn.require&&Kn.require("util").types;return e||Zn&&Zn.binding&&Zn.binding("util")}catch(t){}}(),Gn=Vn&&Vn.isTypedArray,Yn=Gn?qn(Gn):function(e){return Vt(e)&&kn(e.length)&&!!Bn[Zt(e)]};function Jn(e,t){var n=Jt(e),r=!n&&Fn(e),o=!n&&!r&&Dn(e),i=!n&&!r&&!o&&Yn(e),s=n||r||o||i,a=s?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],c=a.length;for(var u in e)s&&("length"==u||o&&("offset"==u||"parent"==u)||i&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||jn(u,c))||a.push(u);return a}var Qn=Object.prototype.hasOwnProperty;function Xn(e){if(!tn(e))return function(e){var t=[];if(null!=e)for(var n in Object(e))t.push(n);return t}(e);var t,n,r=(n=(t=e)&&t.constructor,t===("function"==typeof n&&n.prototype||On)),o=[];for(var i in e)("constructor"!=i||!r&&Qn.call(e,i))&&o.push(i);return o}function er(e){return null!=(t=e)&&kn(t.length)&&!nn(t)?Jn(e):Xn(e);var t}var tr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nr=/^\w*$/;var rr=mn(Object,"create");var or=Object.prototype.hasOwnProperty;var ir=Object.prototype.hasOwnProperty;function sr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function ar(e,t){for(var n=e.length;n--;)if(xn(e[n][0],t))return n;return-1}sr.prototype.clear=function(){this.__data__=rr?rr(null):{},this.size=0},sr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},sr.prototype.get=function(e){var t=this.__data__;if(rr){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return or.call(t,e)?t[e]:void 0},sr.prototype.has=function(e){var t=this.__data__;return rr?void 0!==t[e]:ir.call(t,e)},sr.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=rr&&void 0===t?"__lodash_hash_undefined__":t,this};var cr=Array.prototype.splice;function ur(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ur.prototype.clear=function(){this.__data__=[],this.size=0},ur.prototype.delete=function(e){var t=this.__data__,n=ar(t,e);return!(n<0)&&(n==t.length-1?t.pop():cr.call(t,n,1),--this.size,!0)},ur.prototype.get=function(e){var t=this.__data__,n=ar(t,e);return n<0?void 0:t[n][1]},ur.prototype.has=function(e){return ar(this.__data__,e)>-1},ur.prototype.set=function(e,t){var n=this.__data__,r=ar(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var pr=mn(Ut,"Map");function lr(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function dr(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dr.prototype.clear=function(){this.size=0,this.__data__={hash:new sr,map:new(pr||ur),string:new sr}},dr.prototype.delete=function(e){var t=lr(this,e).delete(e);return this.size-=t?1:0,t},dr.prototype.get=function(e){return lr(this,e).get(e)},dr.prototype.has=function(e){return lr(this,e).has(e)},dr.prototype.set=function(e,t){var n=lr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function hr(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var s=e.apply(this,r);return n.cache=i.set(o,s)||i,s};return n.cache=new(hr.Cache||dr),n}hr.Cache=dr;var gr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fr=/\\(\\)?/g,mr=function(e){var t=hr(e,function(e){return 500===n.size&&n.clear(),e}),n=t.cache;return t}(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(gr,function(e,n,r,o){t.push(r?o.replace(fr,"$1"):n||e)}),t});function yr(e,t){return Jt(e)?e:function(e,t){if(Jt(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Gt(e))||nr.test(e)||!tr.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:mr(function(e){return null==e?"":en(e)}(e))}function vr(e){if("string"==typeof e||Gt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function br(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}var _r=Wt?Wt.isConcatSpreadable:void 0;function wr(e){return Jt(e)||Fn(e)||!!(_r&&e&&e[_r])}function Sr(e){return(null==e?0:e.length)?function(e,t,n,r,o){var i=-1,s=e.length;for(n||(n=wr),o||(o=[]);++i<s;){var a=e[i];n(a)?br(o,a):o[o.length]=a}return o}(e):[]}var Pr=function(e,t){return function(n){return e(t(n))}}(Object.getPrototypeOf,Object),Tr=Function.prototype,Ir=Object.prototype,jr=Tr.toString,zr=Ir.hasOwnProperty,xr=jr.call(Object);function Cr(e){var t=this.__data__=new ur(e);this.size=t.size}Cr.prototype.clear=function(){this.__data__=new ur,this.size=0},Cr.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Cr.prototype.get=function(e){return this.__data__.get(e)},Cr.prototype.has=function(e){return this.__data__.has(e)},Cr.prototype.set=function(e,t){var n=this.__data__;if(n instanceof ur){var r=n.__data__;if(!pr||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new dr(r)}return n.set(e,t),this.size=n.size,this};var Rr="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ar=Rr&&"object"==typeof module&&module&&!module.nodeType&&module,kr=Ar&&Ar.exports===Rr?Ut.Buffer:void 0;function Or(){return[]}kr&&kr.allocUnsafe;var Er=Object.prototype.propertyIsEnumerable,Mr=Object.getOwnPropertySymbols,Lr=Mr?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,i=[];++n<r;){var s=e[n];t(s,n,e)&&(i[o++]=s)}return i}(Mr(e),function(t){return Er.call(e,t)}))}:Or,$r=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)br(t,Lr(e)),e=Pr(e);return t}:Or;function Fr(e){return function(e,t,n){var r=t(e);return Jt(e)?r:br(r,n(e))}(e,er,$r)}var Ur=mn(Ut,"DataView"),Wr=mn(Ut,"Promise"),Nr=mn(Ut,"Set"),Dr="[object Map]",Br="[object Promise]",qr="[object Set]",Hr="[object WeakMap]",Kr="[object DataView]",Zr=cn(Ur),Vr=cn(pr),Gr=cn(Wr),Yr=cn(Nr),Jr=cn(yn),Qr=Zt;(Ur&&Qr(new Ur(new ArrayBuffer(1)))!=Kr||pr&&Qr(new pr)!=Dr||Wr&&Qr(Wr.resolve())!=Br||Nr&&Qr(new Nr)!=qr||yn&&Qr(new yn)!=Hr)&&(Qr=function(e){var t=Zt(e),n="[object Object]"==t?e.constructor:void 0,r=n?cn(n):"";if(r)switch(r){case Zr:return Kr;case Vr:return Dr;case Gr:return Br;case Yr:return qr;case Jr:return Hr}return t});var Xr=Object.prototype.hasOwnProperty;var eo=Ut.Uint8Array;function to(e){var t=new e.constructor(e.byteLength);return new eo(t).set(new eo(e)),t}var no=/\w*$/;var ro=Wt?Wt.prototype:void 0,oo=ro?ro.valueOf:void 0;function io(e,t,n){var r,o,i,s,a,c=e.constructor;switch(t){case"[object ArrayBuffer]":return to(e);case"[object Boolean]":case"[object Date]":return new c(+e);case"[object DataView]":return a=to((s=e).buffer),new s.constructor(a,s.byteOffset,s.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(e){var t=to(e.buffer);return new e.constructor(t,e.byteOffset,e.length)}(e);case"[object Map]":case"[object Set]":return new c;case"[object Number]":case"[object String]":return new c(e);case"[object RegExp]":return(i=new(o=e).constructor(o.source,no.exec(o))).lastIndex=o.lastIndex,i;case"[object Symbol]":return r=e,oo?Object(oo.call(r)):{}}}var so=Vn&&Vn.isMap,ao=so?qn(so):function(e){return Vt(e)&&"[object Map]"==Qr(e)};var co=Vn&&Vn.isSet,uo=co?qn(co):function(e){return Vt(e)&&"[object Set]"==Qr(e)},po="[object Arguments]",lo="[object Function]",ho="[object Object]",go={};function fo(e,t,n,r,o,i){var s;if(n&&(s=o?n(e,r,o,i):n(e)),void 0!==s)return s;if(!tn(e))return e;var a=Jt(e);if(a)s=function(e){var t=e.length,n=new e.constructor(t);return t&&"string"==typeof e[0]&&Xr.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e);else{var c=Qr(e),u=c==lo||"[object GeneratorFunction]"==c;if(Dn(e))return e.slice();if(c==ho||c==po||u&&!o)s={};else{if(!go[c])return o?e:{};s=io(e,c)}}i||(i=new Cr);var p=i.get(e);if(p)return p;i.set(e,s),uo(e)?e.forEach(function(r){s.add(fo(r,t,n,r,e,i))}):ao(e)&&e.forEach(function(r,o){s.set(o,fo(r,t,n,o,e,i))});var l=a?void 0:Fr(e);return function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););}(l||e,function(r,o){l&&(r=e[o=r]),Rn(s,o,fo(r,t,n,o,e,i))}),s}function mo(e,t){return t.length<2?e:function(e,t){for(var n=0,r=(t=yr(t,e)).length;null!=e&&n<r;)e=e[vr(t[n++])];return n&&n==r?e:void 0}(e,function(e,t,n){var r=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r<o;)i[r]=e[r+t];return i}(t,0,-1))}function yo(e){return null==e}function vo(e,t){return null==(e=mo(e,t=yr(t,e)))||delete e[vr((n=t,r=null==n?0:n.length,r?n[r-1]:void 0))];var n,r}function bo(e){return function(e){if(!Vt(e)||"[object Object]"!=Zt(e))return!1;var t=Pr(e);if(null===t)return!0;var n=zr.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&jr.call(n)==xr}(e)?void 0:e}go[po]=go["[object Array]"]=go["[object ArrayBuffer]"]=go["[object DataView]"]=go["[object Boolean]"]=go["[object Date]"]=go["[object Float32Array]"]=go["[object Float64Array]"]=go["[object Int8Array]"]=go["[object Int16Array]"]=go["[object Int32Array]"]=go["[object Map]"]=go["[object Number]"]=go[ho]=go["[object RegExp]"]=go["[object Set]"]=go["[object String]"]=go["[object Symbol]"]=go["[object Uint8Array]"]=go["[object Uint8ClampedArray]"]=go["[object Uint16Array]"]=go["[object Uint32Array]"]=!0,go["[object Error]"]=go[lo]=go["[object WeakMap]"]=!1;var _o=function(e){return Tn(function(e,t,n){return t=An(void 0===t?e.length-1:t,0),function(){for(var r=arguments,o=-1,i=An(r.length-t,0),s=Array(i);++o<i;)s[o]=r[t+o];o=-1;for(var a=Array(t+1);++o<t;)a[o]=r[o];return a[t]=n(s),function(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}(e,this,a)}}(e,void 0,Sr),e+"")}(function(e,t){var n={};if(null==e)return n;var r=!1;t=Yt(t,function(t){return t=yr(t,e),r||(r=t.length>1),t}),function(e,t,n){var r=!n;n||(n={});for(var o=-1,i=t.length;++o<i;){var s=t[o],a=void 0;void 0===a&&(a=e[s]),r?zn(n,s,a):Rn(n,s,a)}}(e,Fr(e),n),r&&(n=fo(n,7,bo));for(var o=t.length;o--;)vo(n,t[o]);return n});const wo=(e,t)=>{e.append("apiVersion",String(t.apiVersion)),e.append("key",t.apiKey),t.language&&e.append("language",t.language)},So=(e,t,n)=>{for(const r of n||[])e.append(t,r)},Po=(e,t,n)=>{Array.isArray(n)&&n.length>0&&e.append(t,n.join(","))},To=(e,t,n)=>{!yo(n)&&e.append(t,String(n))},Io=(e,t)=>{const r=n(t);r&&(e.append("lat",String(r[1])),e.append("lon",String(r[0])))},jo="/maps/orbis/places",zo=(e,t)=>{const n=e.searchParams;wo(n,t),To(n,"limit",t.limit),Io(n,t.position),Po(n,"fuelSet",t.fuelTypes),Po(n,"idxSet",t.indexes),Po(n,"brandSet",t.poiBrands),t.poiCategories&&Po(n,"categorySet",t.poiCategories.map(e=>"number"!=typeof e?r[e]:e)),Po(n,"connectorSet",t.connectors),Po(n,"mapcodes",t.mapcodes),Po(n,"extendedPostalCodesFor",t.extendedPostalCodesFor),To(n,"minPowerKW",t.minPowerKW),To(n,"maxPowerKW",t.maxPowerKW),To(n,"view",t.view),To(n,"openingHours",t.openingHours),To(n,"timeZone",t.timeZone),To(n,"relatedPois",t.relatedPois),Po(n,"entityTypeSet",t.geographyTypes)},xo=e=>{const t=new URL(`${n=e,n.customServiceBaseURL||`${n.commonBaseURL}${jo}/autocomplete/${n.query}.json`}`);var n;const r=t.searchParams;return e.language=e.language??"en-GB",wo(r,e),To(r,"limit",e.limit),Io(r,e.position),Po(r,"countrySet",e.countries),To(r,"radius",e.radiusMeters),Po(r,"resultSet",e.resultType),t},Co=e=>{const t=e.split(",");return[Number(t[1]),Number(t[0])]},Ro=e=>`${e[1]},${e[0]}`,Ao=e=>{let t,n;return void 0!==e.topLeftPoint?(t=[e.topLeftPoint.lon,e.btmRightPoint.lat],n=[e.btmRightPoint.lon,e.topLeftPoint.lat]):(t=Co(e.southWest),n=Co(e.northEast)),[t[0],t[1],n[0],n[1]]},ko=e=>[e.lon,e.lat],Oo=e=>{const{position:t,...n}=e.context.geoBias||{};return{...e,context:{...e.context,geoBias:{...t&&{position:ko(t)},radiusMeters:n.radius}}}},Eo={requestValidation:{schema:Lt},buildRequest:xo,sendRequest:jt,parseResponse:Oo},Mo=async(e,t)=>Pt(e,{...Eo,...t},"Autocomplete"),Lo={autocompleteSearch:Mo,buildAutocompleteSearchRequest:xo,parseAutocompleteSearchResponse:Oo,autocompleteSearchTemplate:Eo},$o=it({id:Ze()}),Fo=e=>{const t=new URL((e=>e.customServiceBaseURL??`${e.commonBaseURL}${jo}/ev/id`)(e)),n=t.searchParams;return wo(n,e),n.append("id",e.id),t},Uo=e=>e<12?"slow":e<50?"regular":e<150?"fast":"ultra-fast",Wo=e=>{const t={count:0,statusCounts:{}};for(const n of e)for(const e of n.chargingPoints)t.count++,t.statusCounts[e.status]=(t.statusCounts[e.status]||0)+1;return t},No=(e,t)=>e.type===t.type&&e.ratedPowerKW===t.ratedPowerKW,Do=(e,t,n)=>{if(e)for(const r of e){const e=n.find(e=>No(r,e.connector));if(e){if(e.count++,t){const n=e.statusCounts;e.statusCounts[t]=(n[t]||0)+1}}else n.push({connector:r,count:1,statusCounts:t?{[t]:1}:{}})}},Bo=e=>{const t=[];return((e,t)=>{if(e)for(const n of e){const e=t.find(e=>No(n,e.connector));e?e.count++:t.push({connector:n,count:1})}})(e,t),t},qo=e=>{const t=[];for(const n of e)for(const e of n.chargingPoints)Do(e.connectors,e.status,t);return t},Ho=e=>{const{year:t,month:n,day:r}=(e=>{const t=e.split("-");return{year:Number.parseInt(t[0]),month:Number.parseInt(t[1]),day:Number.parseInt(t[2])}})(e.date);return{dateYYYYMMDD:e.date,year:t,month:n,day:r,hour:e.hour,minute:e.minute,date:new Date(t,n-1,r,e.hour,e.minute)}},Ko=e=>1===e.length&&0===e[0].start.hour&&0===e[0].end.hour,Zo=e=>{const t=e.timeRanges.map(e=>({start:Ho(e.startTime),end:Ho(e.endTime)}));return{mode:e.mode,timeRanges:t,alwaysOpenThisPeriod:Ko(t)}},Vo=e=>{const{position:t,entryPoints:n,poi:r,id:i,dist:s,boundingBox:a,chargingPark:c,...u}=e,p=c?.connectors?.map(e=>({..._o(e,"connectorType"),type:e.connectorType,chargingSpeed:Uo(e.ratedPowerKW)}));return{...o(ko(t)),...a&&{bbox:Ao(a)},id:i,properties:{..._o(u,"viewport"),...s&&{distance:s},...n?.length&&{entryPoints:n.map(e=>({...e,position:ko(e.position)}))},...p?.length&&{chargingPark:{...c,connectors:p.map(e=>({...e,chargingSpeed:Uo(e.ratedPowerKW)})),connectorCounts:Bo(p)}},...r&&{poi:{..._o(r,"categorySet","openingHours"),brands:r?.brands?.map(e=>e.name)??[],categoryIds:r?.categorySet?.map(e=>e.id)??[],...r?.openingHours&&{openingHours:Zo(r?.openingHours)}}}}}},Go=e=>{const{geoBias:t,...n}=e;return{...t&&{geoBias:ko(t)},...n}},Yo=e=>{const t=e.results?.[0];return t?{id:t.id,accessType:t.accessType,chargingStations:(n=t.chargingStations,n.map(e=>({...e,chargingPoints:e.chargingPoints.map(e=>({...e,connectors:e.connectors?.map(e=>({...e,chargingSpeed:Uo(e.ratedPowerKW)}))}))}))),chargingPointAvailability:Wo(t.chargingStations),connectorAvailabilities:qo(t.chargingStations),...t.openingHours&&{openingHours:Zo(t.openingHours)}}:void 0;var n},Jo={requestValidation:{schema:$o},buildRequest:Fo,sendRequest:jt,parseResponse:Yo,parseResponseError:(e,t)=>{const n=e.data?.detailedError?.message??e.message;return new w(n,t,e.status)}},Qo={buildEVChargingStationsAvailabilityRequest:Fo,parseEVChargingStationsAvailabilityResponse:Yo,evChargingStationsAvailabilityTemplate:Jo},Xo=at(it({typeahead:Je(),offset:Ge().check(We(1900)),radiusMeters:Ge(),boundingBox:Mt,countries:rt(Ze())})),ei=st(it({query:Ze()}),at(it({position:kt,limit:Ge().check(We(100)),extendedPostalCodesFor:rt(Ze()),mapcodes:rt(Ze()),view:gt(i),geographyTypes:rt(Ze())})).shape),ti=st(ei,Xo.shape),ni=e=>e?Array.isArray(e)?e.join(","):"string"==typeof e?e:String(e):"",ri=(e,t)=>{const n=e.length;if(n<=t)return e;const r=[];let o;const i=Math.ceil(n/t);for(o=0;o<n;o+=i)r.push(e[o]);return o>=n-i&&(r.length<t?r.push(e[n-1]):r[r.length-1]=e[n-1]),r},oi=e=>{const t=new URL(`${(e=>e.customServiceBaseURL||`${e.commonBaseURL}${jo}/geocode`)(e)}/${e.query}.json`),n=t.searchParams;wo(n,e),e.typeahead&&n.append("typeahead",String(e.typeahead)),!yo(e.limit)&&n.append("limit",String(e.limit)),!yo(e.offset)&&n.append("ofs",String(e.offset)),Io(n,e.position),e.countries&&n.append("countrySet",ni(e.countries)),!yo(e.radiusMeters)&&n.append("radius",String(e.radiusMeters));const r=e.boundingBox&&s(e.boundingBox);return r&&(n.append("topLeft",ni([r[3],r[0]])),n.append("btmRight",ni([r[1],r[2]]))),e.extendedPostalCodesFor&&n.append("extendedPostalCodesFor",ni(e.extendedPostalCodesFor)),e.mapcodes&&n.append("mapcodes",ni(e.mapcodes)),e.view&&n.append("view",e.view),e.geographyTypes&&n.append("entityTypeSet",ni(e.geographyTypes)),t},ii=e=>{const{position:t,boundingBox:n,dist:r,entryPoints:i,addressRanges:s,entityType:a,id:c,...u}=e;return{...o(ko(t)),...n&&{bbox:Ao(n)},id:c,properties:{..._o(u,"viewport"),...r&&{distance:r},...a&&{geographyType:a.split(",")},...i&&{entryPoints:i.map(e=>({...e,position:ko(e.position)}))},...s&&{addressRanges:{...s,from:ko(s.from),to:ko(s.to)}}}}},si=e=>{const t=e.results.map(ii),n=a(s(t));return{type:"FeatureCollection",features:t,...n&&{bbox:n}}},ai={requestValidation:{schema:ti},buildRequest:oi,sendRequest:jt,parseResponse:si},ci={buildGeocodingRequest:oi,parseGeocodingResponse:si,geocodingTemplate:ai},ui=st(it({geometries:ut([At,rt(ut([Ze(),Rt])).check(Be(1),De(20))])}),at(it({zoom:Ge().check(Ne(0),We(22))})).shape),pi=e=>e.map(e=>e.properties.dataSources?.geometry?.id).filter(e=>e),li=e=>{const t=new URL((e=>e.customServiceBaseURL||`${e.commonBaseURL}${jo}/additionalData.json`)(e)),n=t.searchParams;return n.append("apiVersion",String(e.apiVersion)),n.append("key",e.apiKey),((e,t)=>{let n;n=Array.isArray(t)?"string"==typeof t[0]?t:pi(t):pi(t.features),e.append("geometries",ni(n))})(n,e.geometries),To(n,"geometriesZoom",e.zoom),t},di=e=>{const t=e.additionalData.flatMap(e=>e.geometryData?.features.map(e=>({...e,id:e.id??c(),bbox:s(e.geometry)}))).filter(e=>e);return{type:"FeatureCollection",bbox:s(t),features:t}},hi={requestValidation:{schema:ui},buildRequest:li,sendRequest:jt,parseResponse:di},gi={buildGeometryDataRequest:li,parseGeometryDataResponse:di,geometryDataTemplate:hi},fi=it(r),mi=st(ei,at(it({indexes:rt(Ze()),poiCategories:rt(ut([Ge(),function(e){const t=e._zod.def.shape;return gt(Object.keys(t))}(fi)])),poiBrands:rt(Ze()),connectors:rt(Ze()),fuelTypes:rt(Ze()),openingHours:Ze(),timeZone:Ze(),relatedPois:Ze(),minPowerKW:Ge(),maxPowerKW:Ge(),minFuzzyLevel:Ge(),mixFuzzyLevel:Ge()})).shape),yi=st(mi,it({geometries:rt(ut([At,Ct]))}).shape),vi=e=>{switch(e.type){case"Circle":return[{type:"CIRCLE",radius:e.radius,position:Ro(e.coordinates)}];case"Polygon":return[{type:"POLYGON",vertices:ri(e.coordinates[0],50).map(e=>Ro(e))}];case"MultiPolygon":return e.coordinates.length>50?(e=>{let t=/* @__PURE__ */new Map;return e.coordinates.forEach(e=>{const n=u(e[0]);if(n){const r=Math.abs((n[2]-n[0])*(n[3]-n[1]));t.set(e,r)}}),t=new Map([...t.entries()].sort((e,t)=>t[1]-e[1]).splice(0,50)),[...t.keys()]})(e).flatMap(e=>vi({type:"Polygon",coordinates:e})):e.coordinates.flatMap(e=>vi({type:"Polygon",coordinates:e}));case"FeatureCollection":return e.features.flatMap(e=>vi(e.geometry));default:throw new Error(`Type ${e.type} is not supported`)}},bi=e=>{const t=new URL(`${n=e,n.customServiceBaseURL??`${n.commonBaseURL}${jo}/geometrySearch/${n.query}.json`}`);var n;return zo(t,e),{url:t,data:{geometryList:e.geometries.flatMap(vi)}}},_i=e=>{const t=e.results.map(Vo),n=a(s(t));return{type:"FeatureCollection",properties:{...Go(e.summary)},features:t,...n&&{bbox:n}}},wi={requestValidation:{schema:yi},buildRequest:bi,sendRequest:zt,parseResponse:_i},Si=async(e,t)=>Pt(e,{...wi,...t},"GeometrySearch"),Pi={geometrySearch:Si,buildGeometrySearchRequest:bi,parseGeometrySearchResponse:_i,geometrySearchTemplate:wi},Ti=st(it({entityId:Ze()}),at(it({mapcodes:rt(Ze()),view:gt(i),openingHours:Ze(),timeZone:Ze(),relatedPois:Ze()})).shape),Ii=e=>{const t=new URL(`${(e=>e.customServiceBaseURL||`${e.commonBaseURL}${jo}/place.json`)(e)}`),n=t.searchParams;return wo(n,e),To(n,"entityId",e.entityId),Po(n,"mapcodes",e.mapcodes),To(n,"view",e.view),To(n,"openingHours",e.openingHours),To(n,"timeZone",e.timeZone),To(n,"relatedPois",e.relatedPois),t},ji=e=>e.results?.length?Vo(e.results[0]):void 0,zi={requestValidation:{schema:Ti},buildRequest:Ii,sendRequest:jt,parseResponse:ji},xi={buildPlaceByIdRequest:Ii,parsePlaceByIdResponse:ji,placeByIdTemplate:zi},Ci=Ge().check(function(e,t){return new pe({check:"greater_than",...D(t),value:e,inclusive:!1})}(0,Ri));var Ri;const Ai=Ge().check(Ne(0)),ki=Ge().check(Ne(0),We(100)),Oi=vt(Ci),Ei=vt(Ai),Mi=vt(Ge().check(Ne(0),We(1))),Li=it({speedKMH:Ge(),consumptionUnitsPer100KM:Ge()}),$i={efficiency:vt(it({acceleration:Mi,deceleration:Mi,uphill:Mi,downhill:Mi}))},Fi=rt(Li).check(Be(1),De(25)),Ui=it({...$i,speedsToConsumptionsLiters:Fi,auxiliaryPowerInLitersPerHour:Ei,fuelEnergyDensityInMJoulesPerLiter:vt(Ge().check(Ne(1)))}),Wi=it({...$i,speedsToConsumptionsKWH:Fi,auxiliaryPowerInkW:Ei,consumptionInKWHPerKMAltitudeGain:vt(Ge().check(We(500))),recuperationInKWHPerKMAltitudeLoss:Ei}),Ni=it({currentType:gt(l),plugTypes:rt(gt(p)).check(Be(1)),efficiency:Mi,baseLoadInkW:Ei,maxPowerInkW:Ei,maxVoltageInV:Ei,maxCurrentInA:Ei,voltageRange:vt(it({minVoltageInV:Ei,maxVoltageInV:vt(Ge())}))}),Di=it({stateOfChargeInkWh:Ai,maxPowerInkW:Ci}),Bi=it({maxChargeKWH:Ci,batteryCurve:vt(rt(Di).check(De(20))),chargingConnectors:vt(rt(Ni).check(Be(1))),chargingTimeOffsetInSec:Ei}),qi=it({consumption:Ui}),Hi=it({consumption:Wi,charging:vt(Bi)}),Ki=vt(it({lengthMeters:Oi,widthMeters:Oi,heightMeters:Oi,weightKG:Oi,axleWeightKG:Oi})),Zi=it({variantId:Ze()}),Vi=it({dimensions:Ki,engine:vt(ut([qi,Hi]))}),Gi=vt(ut([Zi,Vi])),Yi=it({heading:vt(Ge().check(Ne(0),We(360)))}),Ji=st(Yi,it({currentFuelInLiters:Ai}).shape),Qi=ut([st(Yi,it({currentChargePCT:ki}).shape),st(Yi,it({currentChargeInkWh:Ai}).shape)]),Xi=it({minChargeAtDestinationPCT:ki,minChargeAtChargingStopsPCT:Ge().check(Ne(0),We(50))}),es=it({minChargeAtDestinationInkWh:Ai,minChargeAtChargingStopsInkWh:Ai}),ts=it({chargingPreferences:vt(ut([Xi,es]))}),ns={model:Gi,restrictions:vt(it({loadTypes:vt(rt(gt(["USHazmatClass1","USHazmatClass2","USHazmatClass3","USHazmatClass4","USHazmatClass5","USHazmatClass6","USHazmatClass7","USHazmatClass8","USHazmatClass9","otherHazmatExplosive","otherHazmatGeneral","otherHazmatHarmfulToWater"]))),maxSpeedKMH:vt(Ge().check(Ne(0),We(250))),adrCode:vt(gt(["B","C","D","E"])),commercial:vt(Je())}))},rs=it({...ns,engineType:function(e){return function(e,t){return new e({type:"undefined",...D(t)})}(Qe,e)}(),state:vt(Yi),preferences:vt(it({}))}),os=ut([function(e,t,n){return new pt({type:"union",options:t,discriminator:e,...D(n)})}("engineType",[it({...ns,engineType:mt("combustion"),state:vt(Ji),preferences:vt(it({}))}),it({...ns,engineType:mt("electric"),state:vt(Qi),preferences:vt(ts)})]),rs]),is=at(it({costModel:at(it({avoid:rt(gt(d)),traffic:vt(gt(["live","historical"])),routeType:vt(gt(["fast","short","efficient","thrilling"])),thrillingParams:vt(it({hilliness:vt(gt(["low","normal","high"])),windingness:vt(gt(["low","normal","high"]))}))})),travelMode:Ze(),vehicle:os,when:it({option:gt(["departAt","arriveBy"]),date:function(e){return function(e,t){return new e({type:"date",...D(t)})}(tt,e)}()})})),ss=st(is,st(it({origin:kt,budget:it({type:gt(["timeMinutes","remainingChargeCPT","spentChargePCT","spentFuelLiters","distanceKM"]),value:Ge().check(Ne(0))})}),it({maxFerryLengthMeters:vt(Ge().check(Ne(0)))}).shape).shape),as=e=>e.map(e=>`${e.speedKMH},${e.consumptionUnitsPer100KM}`).join(":"),cs=(e,t,n)=>{((e,t)=>{t&&(!yo(t.acceleration)&&e.append("accelerationEfficiency",String(t.acceleration)),!yo(t.deceleration)&&e.append("decelerationEfficiency",String(t.deceleration)),!yo(t.uphill)&&e.append("uphillEfficiency",String(t.uphill)),!yo(t.downhill)&&e.append("downhillEfficiency",String(t.downhill)))})(e,n.consumption.efficiency),"electric"===t?(((e,t)=>{t.speedsToConsumptionsKWH&&e.append("constantSpeedConsumptionInkWhPerHundredkm",as(t.speedsToConsumptionsKWH)),!yo(t.auxiliaryPowerInkW)&&e.append("auxiliaryPowerInkW",String(t.auxiliaryPowerInkW)),!yo(t.consumptionInKWHPerKMAltitudeGain)&&e.append("consumptionInkWhPerkmAltitudeGain",String(t.consumptionInKWHPerKMAltitudeGain)),!yo(t.recuperationInKWHPerKMAltitudeLoss)&&e.append("recuperationInkWhPerkmAltitudeLoss",String(t.recuperationInKWHPerKMAltitudeLoss))})(e,n.consumption),((e,t)=>{const n=t.charging;n?.maxChargeKWH&&e.append("maxChargeInkWh",String(n.maxChargeKWH))})(e,n)):((e,t)=>{const n=t.consumption;n.speedsToConsumptionsLiters&&e.append("constantSpeedConsumptionInLitersPerHundredkm",as(n.speedsToConsumptionsLiters)),!yo(n.auxiliaryPowerInLitersPerHour)&&e.append("auxiliaryPowerInLitersPerHour",String(n.auxiliaryPowerInLitersPerHour)),!yo(n.fuelEnergyDensityInMJoulesPerLiter)&&e.append("fuelEnergyDensityInMJoulesPerLiter",String(n.fuelEnergyDensityInMJoulesPerLiter))})(e,n)},us=(e,t)=>{t.model&&("variantId"in t.model?e.append("vehicleModelId",t.model.variantId):(((e,t)=>{t&&(t.lengthMeters&&e.append("vehicleLength",String(t.lengthMeters)),t.heightMeters&&e.append("vehicleHeight",String(t.heightMeters)),t.widthMeters&&e.append("vehicleWidth",String(t.widthMeters)),t.weightKG&&e.append("vehicleWeight",String(t.weightKG)),t.axleWeightKG&&e.append("vehicleAxleWeight",String(t.axleWeightKG)))})(e,t.model.dimensions),t.model.engine&&cs(e,"engineType"in t?t.engineType:void 0,t.model.engine)))},ps=(e,t)=>{t&&("electric"===t.engineType&&e.append("vehicleEngineType","electric"),us(e,t),((e,t)=>{if(t.state&&(t.state.heading&&e.append("vehicleHeading",String(t.state.heading)),"engineType"in t))if("combustion"===t.engineType){const n=t.state;n.currentFuelInLiters&&e.append("currentFuelInLiters",String(n.currentFuelInLiters))}else if("electric"===t.engineType){const n=t.state,r=n,o=n;if(r.currentChargeInkWh)e.append("currentChargeInkWh",String(r.currentChargeInkWh));else if(o.currentChargePCT&&t.model&&"engine"in t.model&&t.model.engine){const n=t.model.engine,r=n.charging?.maxChargeKWH;r&&e.append("currentChargeInkWh",String(r*o.currentChargePCT/100))}}})(e,t),((e,t)=>{if(t.preferences&&"engineType"in t&&"electric"===t.engineType){const n=t.preferences;if(n.chargingPreferences){const r=n.chargingPreferences,o=r,i=r;if(o.minChargeAtChargingStopsInkWh||o.minChargeAtDestinationInkWh)e.append("minChargeAtDestinationInkWh",String(o.minChargeAtDestinationInkWh)),e.append("minChargeAtChargingStopsInkWh",String(o.minChargeAtChargingStopsInkWh));else if((i.minChargeAtChargingStopsPCT||i.minChargeAtDestinationPCT)&&t.model&&"engine"in t.model&&t.model.engine){const n=t.model.engine,r=n.charging?.maxChargeKWH;r&&(e.append("minChargeAtDestinationInkWh",String(r*i.minChargeAtDestinationPCT/100)),e.append("minChargeAtChargingStopsInkWh",String(r*i.minChargeAtChargingStopsPCT/100)))}}}})(e,t),((e,t)=>{const n=t.restrictions;n&&(So(e,"vehicleLoadType",n.loadTypes),n.adrCode&&e.append("vehicleAdrTunnelRestrictionCode",n.adrCode),n.commercial&&e.append("vehicleCommercial",String(n.commercial)),n.maxSpeedKMH&&e.append("vehicleMaxSpeed",String(n.maxSpeedKMH)))})(e,t))},ls=(e,t)=>{const n=t.costModel;So(e,"avoid",n?.avoid),To(e,"traffic",n?.traffic),((e,t)=>{if(t?.date){const n=t.date.toISOString();"departAt"===t.option?e.append("departAt",n):"arriveBy"===t.option&&e.append("arriveAt",n)}})(e,t.when),To(e,"routeType",n?.routeType),To(e,"travelMode",t.travelMode),ps(e,t.vehicle)},ds=e=>{const t=new URL((e=>e.customServiceBaseURL||`${e.commonBaseURL}/routing/1/calculateReachableRange/${Ro(h(e.origin))}/json`)(e)),n=t.searchParams;return wo(n,e),ls(n,e),To(n,"maxFerryLengthInMeters",e.maxFerryLengthMeters),t},hs=(e,t)=>{const n={type:"Polygon",coordinates:[e.reachableRange.boundary.map(e=>[e.longitude,e.latitude])]};return{type:"Feature",geometry:n,bbox:s(n),properties:t}},gs={buildReachableRangeRequest:ds,parseReachableRangeResponse:hs,reachableRangeTemplate:{requestValidation:{schema:ss},buildRequest:ds,sendRequest:jt,parseResponse:hs}},fs=e=>{const t=h(e.position),n=new URL(`${(e=>e.customServiceBaseURL||`${e.commonBaseURL}${jo}/reverseGeocode`)(e)}/${t[1]},${t[0]}.json`),r=n.searchParams;return wo(r,e),e.allowFreeformNewline&&r.append("allowFreeformNewline",String(e.allowFreeformNewline)),e.geographyType&&r.append("entityType",ni(e.geographyType)),!yo(e.heading)&&r.append("heading",String(e.heading)),e.mapcodes&&r.append("mapcodes",ni(e.mapcodes)),e.number&&r.append("number",e.number),!yo(e.radiusMeters)&&r.append("radius",String(e.radiusMeters)),e.returnSpeedLimit&&r.append("returnSpeedLimit",String(e.returnSpeedLimit)),e.returnRoadUse&&r.append("returnRoadUse",String(e.returnRoadUse)),e.roadUses&&r.append("roadUse",JSON.stringify(e.roadUses)),n},ms=(e,t)=>{const n=o(h(t.position)),r=e.addresses[0],{boundingBox:i,sideOfStreet:s,offsetPosition:a,...u}=r?.address||{};return{...n,...i&&{bbox:Ao(i)},id:c(),...r&&{properties:{type:r?.entityType?"Geography":u.streetNumber?"Point Address":"Street",address:u,...r.dataSources&&{dataSources:r.dataSources},...r.mapcodes&&{mapcodes:r.mapcodes},...s&&{sideOfStreet:s},...a&&{offsetPosition:Co(a)},originalPosition:Co(r.position)}}}},ys={requestValidation:{schema:st(it({position:kt}),at(it({allowFreeformNewline:Je(),geographyType:rt(Ze()),heading:Ge().check(Ne(-360),We(360)),mapcodes:rt(Ze()),number:Ze(),radiusMeters:Ge(),returnMatchType:Je(),returnRoadUse:Je(),returnSpeedLimit:Je(),roadUses:rt(Ze()),view:gt(i)})).shape)},buildRequest:fs,sendRequest:jt,parseResponse:ms},vs={buildRevGeoRequest:fs,parseRevGeoResponse:ms,reverseGeocodingTemplate:ys},bs=ut([kt,Ct]),_s=ut([xt,Rt]),ws=st(is,st(it({locations:rt(ut([bs,_s])).check(Be(1))}),at(it({computeAdditionalTravelTimeFor:gt(["none","all"]),vehicleHeading:Ge().check(Ne(0),We(359.5)),maxAlternatives:Ge().check(Ne(0),We(5)),sectionTypes:rt(gt(f))})).shape).shape),Ss=e=>e.vehicle?.preferences?.chargingPreferences,Ps=e=>Array.isArray(e)?e:e.geometry.coordinates,Ts=(e,t,n)=>((e,t)=>e.map(e=>{const n=Ro(h(e,{useEntryPoint:t})),r=(e=>e.properties||null)(e)?.radiusMeters;return r?`circle(${n},${r})`:n}).join(":"))(t.includes("path")?((e,t,n)=>{let r;const o=e[0];r="path"===t[0]?Ps(o)[0]:h(o,{useEntryPoint:n});const i=e[e.length-1];let s;if("path"===t[t.length-1]){const e=Ps(i);s=e[e.length-1]}else s=h(i,{useEntryPoint:n});return[r,s]})(e,t,n):e,n),Is=e=>({latitude:e[1],longitude:e[0]}),js=(e,t,n)=>{const r=[],o=[];return e.forEach((i,s)=>{"path"===t[s]?((e,t,n,r,o)=>{const i=r.length;for(const s of Ps(e))r.push(Is(s));Array.isArray(e)||(e.properties.sections.leg.forEach((e,n)=>{(t>0||n>0)&&o.push({supportingPointIndex:i+e.startPointIndex,waypointSourceType:"USER_DEFINED"})}),t<n.length-1&&o.push({supportingPointIndex:i+e.geometry.coordinates.length-1,waypointSourceType:"USER_DEFINED"}))})(i,s,e,r,o):((e,t,n,r,o,i)=>{r.push(Is(h(e,{useEntryPoint:i}))),t>0&&t<n.length-1&&o.push({supportingPointIndex:r.length-1,waypointSourceType:"USER_DEFINED"})})(i,s,e,r,o,n)}),{supportingPoints:r,...o.length&&{pointWaypoints:o}}},zs=e=>{const t=e.locations.map(g),n=e.useEntryPoints??"main-when-available",r=new URL(`${(e=>e.customServiceBaseURL||`${e.commonBaseURL}/maps/orbis/routing/${Ss(e)?"calculateLongDistanceEVRoute":"calculateRoute"}`)(e)}/${Ts(e.locations,t,n)}/json`),o=r.searchParams;wo(o,e),"language"in e||o.append("language","en-GB"),ls(o,e),To(o,"computeTravelTimeFor",e.computeAdditionalTravelTimeFor),((e,t)=>{if(t?.guidance){const n=t.guidance;e.append("instructionsType",n.type),e.append("guidanceVersion",String(n.version??2)),e.append("instructionPhonetics",n.phonetics??"IPA"),e.append("instructionRoadShieldReferences",n.roadShieldReferences??"all"),e.append("language",t.language??"en-US")}})(o,e),!yo(e.maxAlternatives)&&o.append("maxAlternatives",String(e.maxAlternatives)),((e,t,n)=>{const r=(t??(n?f:m)).map(e=>"vehicleRestricted"===e?"travelMode":e);So(e,"sectionType",r)})(o,e.sectionTypes,!!e.guidance?.type);for(const s of e.extendedRouteRepresentations??["distance","travelTime"])o.append("extendedRouteRepresentation",s);const i=((e,t,n)=>{const r=t.includes("path"),o=!!Ss(e);if(!r&&!o)return null;const i=e.vehicle?.model,s=i?.engine?.charging;return{...r&&js(e.locations,t,n),...o&&s&&{chargingParameters:_o(s,"maxChargeKWH")}}})(e,t,n);return i?{method:"POST",url:r,data:i}:{method:"GET",url:r}},xs=e=>{switch(e){case"Direct_Current":return"DC";case"Alternating_Current_1_Phase":return"AC1";case"Alternating_Current_3_Phase":return"AC3";default:return}},Cs=(e,t)=>{const n=e.chargingConnectionInfo,r=e.chargingParkLocation,o=[r.coordinate.longitude,r.coordinate.latitude],i=[r.street,r.houseNumber].filter(Boolean),s=i.length>0?i.join(", "):"";return{type:"Feature",id:e.chargingParkId,geometry:{type:"Point",coordinates:o},properties:{..._o(e,["chargingConnectionInfo","chargingParkLocation"]),type:"POI",address:{freeformAddress:s,...r.street&&{streetName:r.street},...r.houseNumber&&{streetNumber:r.houseNumber},...r.city&&{municipality:r.city},...r.region&&{countrySubdivision:r.region},...r.postalCode&&{postalCode:r.postalCode},...r.country&&{country:r.country}},...n&&{chargingConnectionInfo:{plugType:n.chargingPlugType,currentInA:n.chargingCurrentInA,voltageInV:n.chargingVoltageInV,chargingPowerInkW:n.chargingPowerInkW,currentType:xs(n.chargingCurrentType),chargingSpeed:Uo(n.chargingPowerInkW)}},...t&&{targetChargeInPCT:100*e.targetChargeInkWh/t},...e.chargingParkPowerInkW&&{chargingParkSpeed:Uo(e.chargingParkPowerInkW)}}}},Rs=(e,t)=>{const n=t?.vehicle?.model?.engine?.charging?.maxChargeKWH;return{lengthInMeters:e.lengthInMeters,historicTrafficTravelTimeInSeconds:e.historicTrafficTravelTimeInSeconds,liveTrafficIncidentsTravelTimeInSeconds:e.liveTrafficIncidentsTravelTimeInSeconds,noTrafficTravelTimeInSeconds:e.noTrafficTravelTimeInSeconds,trafficDelayInSeconds:e.trafficDelayInSeconds,trafficLengthInMeters:e.trafficLengthInMeters,travelTimeInSeconds:e.travelTimeInSeconds,departureTime:new Date(e.departureTime),arrivalTime:new Date(e.arrivalTime),deviationDistanceInMeters:e.deviationDistance,fuelConsumptionInLiters:e.fuelConsumptionInLiters,...e.deviationPoint&&{deviationPoint:[e.deviationPoint.longitude,e.deviationPoint.latitude]},totalChargingTimeInSeconds:e.totalChargingTimeInSeconds,batteryConsumptionInkWh:e.batteryConsumptionInkWh,...n&&e.batteryConsumptionInkWh&&{batteryConsumptionInPCT:100*e.batteryConsumptionInkWh/n},remainingChargeAtArrivalInkWh:e.remainingChargeAtArrivalInkWh,...n&&e.remainingChargeAtArrivalInkWh&&{remainingChargeAtArrivalInPCT:100*e.remainingChargeAtArrivalInkWh/n},...e.chargingInformationAtEndOfLeg&&{chargingInformationAtEndOfLeg:Cs(e.chargingInformationAtEndOfLeg,n)}}},As=(e,t)=>e.reduce((e,n,r)=>{const o=0===r?0:e[r-1]?.endPointIndex;let i;return yo(o)||(i=0===o?n.points?.length>0?n.points.length-1:0:o+n.points?.length),e.push({...!yo(o)&&{startPointIndex:o},...i&&{endPointIndex:i},summary:Rs(n.summary,t),id:c()}),e},[]),ks=e=>({id:c(),startPointIndex:e.startPointIndex,endPointIndex:e.endPointIndex}),Os=e=>({...ks(e),index:e.importantRoadStretchIndex,streetName:e.streetName?.text,roadNumbers:e.roadNumbers?.map(e=>e.text)}),Es=e=>({...ks(e),countryCodeISO3:e.countryCode}),Ms=e=>"other"===e.travelMode?ks(e):null,Ls=e=>{if(e.tec?.causes?.length)return e.tec.causes.map(e=>(e=>{switch(e){case 1:return"jam";case 2:return"accident";case 3:return"roadworks";case 4:return"narrow-lanes";case 5:return"road-closed";case 9:return"danger";case 11:return"animals-on-road";case 13:return"broken-down-vehicle";case 16:return"lane-closed";case 17:return"wind";case 18:return"fog";case 19:return"rain";case 22:return"frost";case 23:return"flooding";default:return"other"}})(e.mainCauseCode));switch(e.simpleCategory){case"JAM":return["jam"];case"ROAD_WORK":return["roadworks"];case"ROAD_CLOSURE":return["road-closed"];default:return["other"]}},$s=e=>({...ks(e),delayInSeconds:e.delayInSeconds,effectiveSpeedInKmh:e.effectiveSpeedInKmh,categories:Ls(e),magnitudeOfDelay:y[e.magnitudeOfDelay],tec:e.tec}),Fs=e=>({...ks(e),lanes:e.lanes,laneSeparators:e.laneSeparators,properties:e.properties}),Us=e=>({...ks(e),maxSpeedLimitInKmh:e.maxSpeedLimitInKmh}),Ws=e=>({...ks(e),roadShieldReferences:e.roadShieldReferences}),Ns=(e,t)=>(t[e]||(t[e]=[]),t[e]),Ds=e=>{switch(e.sectionType){case"CAR_TRAIN":return{sectionType:"carTrain",mappingFunction:ks};case"COUNTRY":return{sectionType:"country",mappingFunction:Es};case"FERRY":return{sectionType:"ferry",mappingFunction:ks};case"MOTORWAY":return{sectionType:"motorway",mappingFunction:ks};case"PEDESTRIAN":return{sectionType:"pedestrian",mappingFunction:ks};case"TOLL_VIGNETTE":return{sectionType:"tollVignette",mappingFunction:Es};case"TOLL":return{sectionType:"toll",mappingFunction:ks};case"TRAFFIC":return{sectionType:"traffic",mappingFunction:$s};case"TRAVEL_MODE":return{sectionType:"vehicleRestricted",mappingFunction:Ms};case"TUNNEL":return{sectionType:"tunnel",mappingFunction:ks};case"UNPAVED":return{sectionType:"unpaved",mappingFunction:ks};case"URBAN":return{sectionType:"urban",mappingFunction:ks};case"CARPOOL":return{sectionType:"carpool",mappingFunction:ks};case"LOW_EMISSION_ZONE":return{sectionType:"lowEmissionZone",mappingFunction:ks};case"LANES":return{sectionType:"lanes",mappingFunction:Fs};case"SPEED_LIMIT":return{sectionType:"speedLimit",mappingFunction:Us};case"ROAD_SHIELDS":return{sectionType:"roadShields",mappingFunction:Ws};case"IMPORTANT_ROAD_STRETCH":return{sectionType:"importantRoadStretch",mappingFunction:Os}}},Bs=(e,t)=>{const n={leg:As(e.legs,t)};return((e,t)=>{if(Array.isArray(e))for(const n of e){const e=Ds(n),r=e?.mappingFunction(n);r&&Ns(e.sectionType,t).push(r)}})(e.sections,n),n},qs=1e-4,Hs=(e,t)=>Math.abs(e[0]-t[0])<qs&&Math.abs(e[1]-t[1])<qs,Ks=(e,t)=>{const n=[];let r=0;for(const o of e.instructions){const e=[o.maneuverPoint.longitude,o.maneuverPoint.latitude];for(let n=r;n<t.length;n++){if(Hs(t[n],e)){r=n;break}if(n===t.length-1)break}n.push({...o,maneuverPoint:e,pathPointIndex:r,routePath:o.routePath.map(e=>({...e,point:[e.point.longitude,e.point.latitude]}))})}return{instructions:n}},Zs=(e,t)=>{const n=e.routes.map((e,n)=>((e,t,n)=>{const r={type:"LineString",coordinates:e.legs.flatMap(e=>e.points?.map(e=>[e.longitude,e.latitude]))},o=s(r);return{type:"Feature",geometry:r,id:c(),...o&&{bbox:o},properties:{index:t,summary:Rs(e.summary,n),sections:Bs(e,n),...e.guidance&&{guidance:Ks(e.guidance,r.coordinates)},...e.progress&&{progress:e.progress}}}})(e,n,t)),r=s(n);return{type:"FeatureCollection",...r&&{bbox:r},features:n}},Vs={requestValidation:{schema:ws,refinements:[{check:e=>!!e.locations.map(g).includes("path")||e.locations.length>=2,message:"When passing waypoints only: at least 2 must be defined. If passing also paths, at least one path must be defined"}]},buildRequest:zs,sendRequest:async(e,t)=>{const n=e.method;if("GET"===n)return jt(e.url,t);if("POST"===n)return zt(e,t);throw new Error(`Unsupported HTTP method received: ${n}`)},parseResponse:Zs,parseResponseError:(e,t)=>{const{data:n,message:r,status:o}=e;return new w(n?.error?.description??n?.detailedError?.message??r,t,o)},getAPIVersion:()=>2},Gs={reverseGeocode:vs,geocode:ci,geometryData:gi,geometrySearch:Pi,calculateRoute:{buildCalculateRouteRequest:zs,parseCalculateRouteResponse:Zs,calculateRouteTemplate:Vs},reachableRange:gs,evChargingStationsAvailability:Qo,placeByID:xi,autocompleteSearch:Lo},Ys=async(e,t)=>Pt(e,{...Jo,...t},"EVChargingStationsAvailability"),Js=async e=>{const t=e.properties.dataSources?.chargingAvailability?.id;if(!t)return e;try{const n=await Ys({id:t}),r=e.properties.poi;return n?{...e,properties:{...e.properties,...r&&{poi:{...r,openingHours:n.openingHours}},chargingPark:{...e.properties.chargingPark,availability:n}}}:e}catch(n){return console.error(n),e}},Qs=async(e,t={includeIfAvailabilityUnknown:!0})=>{const n=[];for(const r of e.features){const e=await Js(r);(e.properties.chargingPark?.availability||t.includeIfAvailabilityUnknown)&&n.push(e)}return{...e,features:n,bbox:s(n)}},Xs=async(e,t)=>Pt(e,{...ai,...t},"Geocode"),ea=async e=>(await Xs({query:e,limit:1})).features[0];async function ta(e,t){const n=await Pt(e,{...hi,...t},"GeometryData");return Array.isArray(e.geometries)||"FeatureCollection"!==e.geometries.type?n:((e,t)=>{const n=e.features.reduce((e,t)=>{const n=t.properties.dataSources?.geometry?.id;return n&&(e[n]={...t.properties,placeCoordinates:t.geometry.coordinates}),e},{}),r=t.features.map(e=>e.id&&n[e.id]?{...e,properties:n[e.id]}:e);return{type:"FeatureCollection",bbox:t.bbox,features:r}})(e.geometries,n)}const na=async(e,t)=>Pt(e,{...zi,...t},"PlaceById"),ra=async(e,t)=>Pt(e,{...ys,...t},"ReverseGeocode"),oa=async(e,t)=>Pt(e,{...Vs,...t},"Routing"),ia=st(mi,st(Xo,at(it({minFuzzyLevel:Ge().check(Ne(1),We(4)),maxFuzzyLevel:Ge().check(Ne(1),We(4))})).shape).shape),sa=e=>{let t;switch(e.type){case"COORDINATE":t={...e,details:{position:ko(e.details)}};break;case"NEARBY":t={...e,details:{position:ko({lon:e.details.lon,lat:e.details.lat}),text:e.details.text,query:e.details.query}};break;case"BOOKMARK":case"W3W":t=e}return t},aa={requestValidation:{schema:ia},buildRequest:e=>{const t=new URL(`${n=e,n.customServiceBaseURL??`${n.commonBaseURL}${jo}/search/${n.query}.json`}`);var n;zo(t,e);const r=t.searchParams;To(r,"typeahead",e.typeahead),To(r,"ofs",e.offset),Po(r,"countrySet",e.countries),To(r,"radius",e.radiusMeters);const o=e.boundingBox&&s(e.boundingBox);return o&&(r.append("topLeft",ni([o[3],o[0]])),r.append("btmRight",ni([o[1],o[2]]))),To(r,"minFuzzyLevel",e.minFuzzyLevel),To(r,"maxFuzzyLevel",e.maxFuzzyLevel),t},sendRequest:jt,parseResponse:e=>{const t=e.results.map(Vo),n=a(s(t));return{type:"FeatureCollection",properties:{...Go(e.summary),queryIntent:e.summary.queryIntent.map(sa)},features:t,...n&&{bbox:n}}}},ca=async(e,t)=>"geometries"in e?Si(e,t):(async(e,t)=>Pt(e,{...aa,...t},"FuzzySearch"))(e,t),ua=async e=>(await ca({query:e,limit:1})).features[0];export{_ as APIErrorCode,b as SDKError,w as SDKServiceError,Mo as autocompleteSearch,Js as buildPlaceWithEVAvailability,Qs as buildPlacesWithEVAvailability,P as buildResponseError,T as buildValidationError,oa as calculateRoute,Gs as customizeService,Ys as evChargingStationsAvailability,Xs as geocode,ea as geocodeOne,ta as geometryData,S as parseDefaultResponseError,na as placeById,ra as reverseGeocode,ca as search,ua as searchOne};
2
2
  //# sourceMappingURL=services.es.js.map