@wemap/core 14.6.0-beta.3 → 14.6.0-beta.5

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/dist/index.js CHANGED
@@ -1,270 +1,266 @@
1
- import { BoundingBox, Coordinates } from "@wemap/geo";
2
- var HttpError = class extends Error {
1
+ import { BoundingBox as e, Coordinates as t } from "@wemap/geo";
2
+ //#region src/services/HttpClient.ts
3
+ var n = class extends Error {
3
4
  status;
4
5
  statusText;
5
6
  data;
6
- constructor(s, E, D, O) {
7
- super(O || `HTTP Error ${s}: ${E}`), this.name = "HttpError", this.status = s, this.statusText = E, this.data = D;
7
+ constructor(e, t, n, r) {
8
+ super(r || `HTTP Error ${e}: ${t}`), this.name = "HttpError", this.status = e, this.statusText = t, this.data = n;
8
9
  }
9
- }, HttpClient = class {
10
+ }, r = class {
10
11
  config;
11
- constructor(s) {
12
+ constructor(e) {
12
13
  this.config = {
13
- defaultHeaders: { "Content-Type": "application/json" },
14
- ...s
14
+ defaultHeaders: {},
15
+ ...e
15
16
  };
16
17
  }
17
- setBaseUrl(s) {
18
- this.config.baseUrl = s;
18
+ setBaseUrl(e) {
19
+ this.config.baseUrl = e;
19
20
  }
20
- setDefaultHeaders(s) {
21
+ setDefaultHeaders(e) {
21
22
  this.config.defaultHeaders = {
22
23
  ...this.config.defaultHeaders,
23
- ...s
24
+ ...e
24
25
  };
25
26
  }
26
- buildUrl(s, E) {
27
- let D = s.startsWith("http") ? s : `${this.config.baseUrl}${s.startsWith("/") ? s : `/${s}`}`;
28
- if (!E || Object.keys(E).length === 0) return D;
29
- let O = new URLSearchParams();
30
- return Object.entries(E).forEach(([s, E]) => {
31
- E != null && O.append(s, String(E));
32
- }), `${D}${D.includes("?") ? "&" : "?"}${O.toString()}`;
33
- }
34
- mergeHeaders(s) {
35
- let E = new Headers();
36
- return this.config.defaultHeaders && Object.entries(this.config.defaultHeaders).forEach(([s, D]) => {
37
- E.set(s, D);
38
- }), s && Object.entries(s).forEach(([s, D]) => {
39
- E.set(s, D);
40
- }), E;
41
- }
42
- async parseResponse(s) {
43
- let E = s.headers.get("content-type") || "";
44
- if (E.includes("application/json")) return await s.json();
45
- if (E.includes("text/")) return await s.text();
46
- if (E.includes("application/octet-stream") || E.includes("application/pdf")) return await s.blob();
27
+ buildUrl(e, t) {
28
+ let n = e.startsWith("http") ? e : `${this.config.baseUrl}${e.startsWith("/") ? e : `/${e}`}`;
29
+ if (!t || Object.keys(t).length === 0) return n;
30
+ let r = new URLSearchParams();
31
+ return Object.entries(t).forEach(([e, t]) => {
32
+ t != null && r.append(e, String(t));
33
+ }), `${n}${n.includes("?") ? "&" : "?"}${r.toString()}`;
34
+ }
35
+ mergeHeaders(e) {
36
+ let t = new Headers();
37
+ return this.config.defaultHeaders && Object.entries(this.config.defaultHeaders).forEach(([e, n]) => {
38
+ t.set(e, n);
39
+ }), e && Object.entries(e).forEach(([e, n]) => {
40
+ t.set(e, n);
41
+ }), t;
42
+ }
43
+ async parseResponse(e) {
44
+ let t = e.headers.get("content-type") || "";
45
+ if (t.includes("application/json")) return await e.json();
46
+ if (t.includes("text/")) return await e.text();
47
+ if (t.includes("application/octet-stream") || t.includes("application/pdf")) return await e.blob();
47
48
  try {
48
- return await s.json();
49
+ return await e.json();
49
50
  } catch {
50
- return await s.text();
51
+ return await e.text();
51
52
  }
52
53
  }
53
- async handleError(s) {
54
- let E;
54
+ async handleError(e) {
55
+ let t;
55
56
  try {
56
- E = await this.parseResponse(s);
57
+ t = await this.parseResponse(e);
57
58
  } catch {
58
- E = await s.text().catch(() => null);
59
+ t = await e.text().catch(() => null);
59
60
  }
60
- throw new HttpError(s.status, s.statusText, E, `HTTP ${s.status}: ${s.statusText}`);
61
+ throw new n(e.status, e.statusText, t, `HTTP ${e.status}: ${e.statusText}`);
61
62
  }
62
- createAbortController(s) {
63
- if (!s && !this.config.timeout) return null;
64
- let E = new AbortController(), D = s || this.config.timeout || 3e4;
63
+ createAbortController(e) {
64
+ if (!e && !this.config.timeout) return null;
65
+ let t = new AbortController(), n = e || this.config.timeout || 3e4;
65
66
  return setTimeout(() => {
66
- E.abort();
67
- }, D), E;
67
+ t.abort();
68
+ }, n), t;
68
69
  }
69
- async request(s, E = {}) {
70
- let { method: O = "GET", headers: k, body: A, params: j, timeout: M } = E, N = this.buildUrl(s, j), P = this.mergeHeaders(k), F = this.createAbortController(M);
70
+ async request(e, t = {}) {
71
+ let { method: r = "GET", headers: i, body: a, params: o, timeout: s } = t, c = this.buildUrl(e, o), l = new Headers(this.mergeHeaders(i)), u = this.createAbortController(s);
71
72
  try {
72
- let s = {
73
- method: O,
74
- headers: P,
75
- signal: F?.signal
73
+ let e = {
74
+ method: r,
75
+ headers: l,
76
+ signal: u?.signal
76
77
  };
77
- if (A !== void 0 && O !== "GET") if (typeof A == "string") s.body = A;
78
- else if (A instanceof FormData || A instanceof Blob) {
79
- if (s.body = A, A instanceof FormData) {
80
- let E = new Headers(P);
81
- E.delete("Content-Type"), s.headers = E;
82
- }
83
- } else s.body = JSON.stringify(A);
84
- let E = await fetch(N, s);
85
- return E.ok || await this.handleError(E), {
86
- data: await this.parseResponse(E),
87
- status: E.status,
88
- statusText: E.statusText,
89
- headers: E.headers
78
+ a !== void 0 && r !== "GET" ? typeof a == "string" ? (e.body = a, l.has("Content-Type") || l.set("Content-Type", "application/json")) : a instanceof FormData ? (e.body = a, l.delete("Content-Type")) : a instanceof Blob ? (e.body = a, !l.has("Content-Type") && a.type && l.set("Content-Type", a.type)) : (e.body = JSON.stringify(a), l.has("Content-Type") || l.set("Content-Type", "application/json")) : l.delete("Content-Type");
79
+ let t = await fetch(c, e);
80
+ return t.ok || await this.handleError(t), {
81
+ data: await this.parseResponse(t),
82
+ status: t.status,
83
+ statusText: t.statusText,
84
+ headers: t.headers
90
85
  };
91
- } catch (s) {
92
- throw s instanceof HttpError ? s : s instanceof Error && s.name === "AbortError" ? new HttpError(408, "Request Timeout", null, `Request timeout after ${M || this.config.timeout || 3e4}ms`) : new HttpError(0, "Network Error", null, s instanceof Error ? s.message : "Unknown error occurred");
86
+ } catch (e) {
87
+ throw e instanceof n ? e : e instanceof Error && e.name === "AbortError" ? new n(408, "Request Timeout", null, `Request timeout after ${s || this.config.timeout || 3e4}ms`) : new n(0, "Network Error", null, e instanceof Error ? e.message : "Unknown error occurred");
93
88
  }
94
89
  }
95
- async get(s, E) {
96
- return this.request(s, {
97
- ...E,
90
+ async get(e, t) {
91
+ return this.request(e, {
92
+ ...t,
98
93
  method: "GET"
99
94
  });
100
95
  }
101
- async post(s, E, D) {
102
- return this.request(s, {
103
- ...D,
96
+ async post(e, t, n) {
97
+ return this.request(e, {
98
+ ...n,
104
99
  method: "POST",
105
- body: E
100
+ body: t
106
101
  });
107
102
  }
108
- async put(s, E, D) {
109
- return this.request(s, {
110
- ...D,
103
+ async put(e, t, n) {
104
+ return this.request(e, {
105
+ ...n,
111
106
  method: "PUT",
112
- body: E
107
+ body: t
113
108
  });
114
109
  }
115
- async patch(s, E, D) {
116
- return this.request(s, {
117
- ...D,
110
+ async patch(e, t, n) {
111
+ return this.request(e, {
112
+ ...n,
118
113
  method: "PATCH",
119
- body: E
114
+ body: t
120
115
  });
121
116
  }
122
- async delete(s, E) {
123
- return this.request(s, {
124
- ...E,
117
+ async delete(e, t) {
118
+ return this.request(e, {
119
+ ...t,
125
120
  method: "DELETE"
126
121
  });
127
122
  }
128
- }, LivemapService = class {
123
+ }, i = class {
129
124
  httpClient;
130
- constructor(s) {
131
- this.httpClient = new HttpClient({ baseUrl: s });
125
+ constructor(e) {
126
+ this.httpClient = new r({ baseUrl: e });
132
127
  }
133
- async fetchLivemap(s) {
134
- return (await this.httpClient.get(`/livemaps/${s}`)).data;
128
+ async fetchLivemap(e) {
129
+ return (await this.httpClient.get(`/livemaps/${e}`)).data;
135
130
  }
136
- }, BuildingService = class s {
131
+ }, a = class e {
137
132
  static MIN_BBOX_SIZE = 3e3;
138
133
  static PAGE_SIZE = 20;
139
134
  http;
140
135
  emmid;
141
136
  buildings = /* @__PURE__ */ new Map();
142
137
  cachedBbox = null;
143
- constructor(s, E) {
144
- this.http = new HttpClient({ baseUrl: s }), this.emmid = String(E);
145
- }
146
- async getBuildingsFromBbox(E) {
147
- if (!(this.cachedBbox?.contains(E.getNorthWest()) && this.cachedBbox?.contains(E.getSouthEast()))) {
148
- let D = s.MIN_BBOX_SIZE / 2, O = E.extend(E.center.destinationPoint(D, 0)).extend(E.center.destinationPoint(D, Math.PI / 2)).extend(E.center.destinationPoint(D, Math.PI)).extend(E.center.destinationPoint(D, 3 * Math.PI / 2));
149
- for (let s of await this.fetchAll()) s.id != null && this.buildings.set(Number(s.id), s);
150
- this.cachedBbox = O;
138
+ constructor(e, t) {
139
+ this.http = new r({ baseUrl: e }), this.emmid = String(t);
140
+ }
141
+ async getBuildingsFromBbox(t) {
142
+ if (!(this.cachedBbox?.contains(t.getNorthWest()) && this.cachedBbox?.contains(t.getSouthEast()))) {
143
+ let n = e.MIN_BBOX_SIZE / 2, r = t.extend(t.center.destinationPoint(n, 0)).extend(t.center.destinationPoint(n, Math.PI / 2)).extend(t.center.destinationPoint(n, Math.PI)).extend(t.center.destinationPoint(n, 3 * Math.PI / 2));
144
+ for (let e of await this.fetchAll()) e.id != null && this.buildings.set(Number(e.id), e);
145
+ this.cachedBbox = r;
151
146
  }
152
- return this.intersecting(E);
147
+ return this.intersecting(t);
153
148
  }
154
- intersecting(s) {
155
- let E = s.toArray(), D = [];
156
- for (let s of this.buildings.values()) s.bbox && bboxIntersects(E, s.bbox) && D.push(s);
157
- return D;
149
+ intersecting(e) {
150
+ let t = e.toArray(), n = [];
151
+ for (let e of this.buildings.values()) e.bbox && o(t, e.bbox) && n.push(e);
152
+ return n;
158
153
  }
159
154
  async fetchAll() {
160
- let E = [], D = 0, O = 0;
155
+ let t = [], n = 0, r = 0;
161
156
  do {
162
- let { data: k } = await this.http.get("/buildings/search", { params: {
157
+ let { data: i } = await this.http.get("/buildings/search", { params: {
163
158
  livemap: this.emmid,
164
- limit: s.PAGE_SIZE,
165
- offset: O
159
+ limit: e.PAGE_SIZE,
160
+ offset: r
166
161
  } });
167
- D ||= k.count, E.push(...k.results), O += s.PAGE_SIZE;
168
- } while (E.length < D);
169
- return E;
162
+ n ||= i.count, t.push(...i.results), r += e.PAGE_SIZE;
163
+ } while (t.length < n);
164
+ return t;
170
165
  }
171
166
  };
172
- function bboxIntersects(s, E) {
173
- return s[0] <= E[2] && s[2] >= E[0] && s[1] <= E[3] && s[3] >= E[1];
167
+ function o(e, t) {
168
+ return e[0] <= t[2] && e[2] >= t[0] && e[1] <= t[3] && e[3] >= t[1];
174
169
  }
175
- const isString = (s) => typeof s == "string", isNumber = (s) => typeof s == "number", isDefinedStrict = (s) => s != null, isObjectType = (s) => typeof s == "object" && !!s, defaultBounds = new BoundingBox(new Coordinates(85, 170), new Coordinates(-85, -170));
176
- var FLOAT_PRECISION = 5;
177
- const correctBounds = (D) => {
178
- let O = D.getSouthWest(), k = D.getNorthEast(), A = O.lat, j = O.lng, M = k.lat, N = k.lng;
179
- j > N && (j = -(180 - j + 180));
180
- let P = new Coordinates(0, 0);
181
- P.autoWrap = !1, P.lat = M, P.lng = N;
182
- let F = new Coordinates(0, 0);
183
- return F.autoWrap = !1, F.lat = A, F.lng = j, new BoundingBox(P, F);
184
- }, deltaToBounds = (D) => {
185
- if (!D) return defaultBounds;
186
- let O = new Coordinates(Number(D.latitude) - Number(D.latitude_delta), Number(D.longitude) - Number(D.longitude_delta));
187
- return correctBounds(new BoundingBox(new Coordinates(Number(D.latitude) + Number(D.latitude_delta), Number(D.longitude) + Number(D.longitude_delta)), O));
188
- }, boundsToDelta = (s) => {
189
- let E, D, O, k, A = FLOAT_PRECISION;
190
- return E = Math.max(s.center.lat, -180), E = Math.min(E, 180).toFixed(A), D = Math.max(s.center.lng, -180), D = Math.min(D, 180).toFixed(A), O = Math.abs(s.getNorth() - s.getSouth()), O /= 2, O = Math.min(O, 90).toFixed(A), k = Math.abs(s.getEast() - s.getWest()), k /= 2, k = Math.min(k, 180).toFixed(A), {
191
- center_latitude: parseFloat(E),
192
- center_longitude: parseFloat(D),
193
- latitude_delta: parseFloat(O),
194
- longitude_delta: parseFloat(k)
170
+ //#endregion
171
+ //#region src/utils/validators.ts
172
+ var s = (e) => typeof e == "string", c = (e) => typeof e == "number", l = (e) => e != null, u = (e) => typeof e == "object" && !!e, d = new e(new t(85, 170), new t(-85, -170)), f = 5, p = (n) => {
173
+ let r = n.getSouthWest(), i = n.getNorthEast(), a = r.lat, o = r.lng, s = i.lat, c = i.lng;
174
+ o > c && (o = -(180 - o + 180));
175
+ let l = new t(0, 0);
176
+ l.autoWrap = !1, l.lat = s, l.lng = c;
177
+ let u = new t(0, 0);
178
+ return u.autoWrap = !1, u.lat = a, u.lng = o, new e(l, u);
179
+ }, m = (n) => {
180
+ if (!n) return d;
181
+ let r = new t(Number(n.latitude) - Number(n.latitude_delta), Number(n.longitude) - Number(n.longitude_delta));
182
+ return p(new e(new t(Number(n.latitude) + Number(n.latitude_delta), Number(n.longitude) + Number(n.longitude_delta)), r));
183
+ }, h = (e) => {
184
+ let t, n, r, i, a = f;
185
+ return t = Math.max(e.center.lat, -180), t = Math.min(t, 180).toFixed(a), n = Math.max(e.center.lng, -180), n = Math.min(n, 180).toFixed(a), r = Math.abs(e.getNorth() - e.getSouth()), r /= 2, r = Math.min(r, 90).toFixed(a), i = Math.abs(e.getEast() - e.getWest()), i /= 2, i = Math.min(i, 180).toFixed(a), {
186
+ center_latitude: parseFloat(t),
187
+ center_longitude: parseFloat(n),
188
+ latitude_delta: parseFloat(r),
189
+ longitude_delta: parseFloat(i)
195
190
  };
196
- }, latLngLikeToCoordinates = (s) => {
197
- if (s instanceof Coordinates) return s;
198
- if (Array.isArray(s)) {
199
- let [D, O, k] = s;
200
- return new Coordinates(D, O, null, k);
201
- }
202
- let D = "lat" in s ? s.lat : s.latitude, O = "lng" in s ? s.lng : s.longitude, k = "level" in s ? s.level : null, A = "alt" in s ? s.alt : null;
203
- if ("altitude" in s && (A = s.altitude), !isNumber(D) || !isNumber(O)) throw Error("Cannot parse lat/lng in" + JSON.stringify(s));
204
- return new Coordinates(D, O, isNumber(A) ? A : null, isNumber(k) ? k : null);
205
- };
206
- var PinpointService = class s {
191
+ }, g = (e) => {
192
+ if (e instanceof t) return e;
193
+ if (Array.isArray(e)) {
194
+ let [n, r, i] = e;
195
+ return new t(n, r, null, i);
196
+ }
197
+ let n = "lat" in e ? e.lat : e.latitude, r = "lng" in e ? e.lng : e.longitude, i = "level" in e ? e.level : null, a = "alt" in e ? e.alt : null;
198
+ if ("altitude" in e && (a = e.altitude), !c(n) || !c(r)) throw Error("Cannot parse lat/lng in" + JSON.stringify(e));
199
+ return new t(n, r, c(a) ? a : null, c(i) ? i : null);
200
+ }, _ = class e {
207
201
  static PAGE_SIZE = 400;
208
202
  http;
209
203
  emmid;
210
- constructor(s, E) {
211
- this.http = new HttpClient({ baseUrl: s }), this.emmid = String(E);
204
+ constructor(e, t) {
205
+ this.http = new r({ baseUrl: e }), this.emmid = String(t);
212
206
  }
213
- async search(s) {
214
- let E = this.buildSearchParams(s), { data: D } = await this.http.get("/pinpoints/search", { params: E });
207
+ async search(e) {
208
+ let t = this.buildSearchParams(e), { data: n } = await this.http.get("/pinpoints/search", { params: t });
215
209
  return {
216
- count: D.count,
217
- items: D.results.map(mapPinpoint),
218
- next: D.next,
219
- previous: D.previous,
220
- query: E
210
+ count: n.count,
211
+ items: n.results.map(v),
212
+ next: n.next,
213
+ previous: n.previous,
214
+ query: t
221
215
  };
222
216
  }
223
- async getById(s) {
224
- let { data: E } = await this.http.get(`/pinpoints/${s}`);
225
- return mapPinpoint(E);
217
+ async getById(e) {
218
+ let { data: t } = await this.http.get(`/pinpoints/${e}`);
219
+ return v(t);
226
220
  }
227
221
  async getAll() {
228
- let E = [], D = 0, O = 0;
222
+ let t = [], n = 0, r = 0;
229
223
  do {
230
- let { data: k } = await this.http.get("/pinpoints/search", { params: {
224
+ let { data: i } = await this.http.get("/pinpoints/search", { params: {
231
225
  livemap: this.emmid,
232
- limit: s.PAGE_SIZE,
233
- offset: O
226
+ limit: e.PAGE_SIZE,
227
+ offset: r
234
228
  } });
235
- D ||= k.count, E.push(...k.results.map(mapPinpoint)), O += s.PAGE_SIZE;
236
- } while (O < D);
237
- return E;
229
+ n ||= i.count, t.push(...i.results.map(v)), r += e.PAGE_SIZE;
230
+ } while (r < n);
231
+ return t;
238
232
  }
239
- buildSearchParams(s) {
240
- let E = {
233
+ buildSearchParams(e) {
234
+ let t = {
241
235
  livemap: this.emmid,
242
236
  query_mode: "phrase",
243
- center_latitude: s.center_latitude,
244
- center_longitude: s.center_longitude,
245
- latitude_delta: s.latitude_delta,
246
- longitude_delta: s.longitude_delta
237
+ center_latitude: e.center_latitude,
238
+ center_longitude: e.center_longitude,
239
+ latitude_delta: e.latitude_delta,
240
+ longitude_delta: e.longitude_delta
247
241
  };
248
- return s.query && (E.query = s.query), s.tags !== void 0 && (E.tags = Array.isArray(s.tags) ? s.tags.join(",") : s.tags), s.levels === void 0 ? s.level !== void 0 && (E.levels = `null,${s.level}`) : E.levels = s.levels, s.limit !== void 0 && (E.limit = s.limit), s.offset !== void 0 && (E.offset = s.offset), E;
242
+ return e.query && (t.query = e.query), e.tags !== void 0 && (t.tags = Array.isArray(e.tags) ? e.tags.join(",") : e.tags), e.levels === void 0 ? e.level !== void 0 && (t.levels = `null,${e.level}`) : t.levels = e.levels, e.limit !== void 0 && (t.limit = e.limit), e.offset !== void 0 && (t.offset = e.offset), t;
249
243
  }
250
244
  };
251
- function mapPinpoint(s) {
245
+ function v(e) {
252
246
  return {
253
- id: s.id,
254
- name: s.name,
255
- ...s.description ? { description: s.description } : {},
256
- latitude: s.latitude,
257
- longitude: s.longitude,
258
- ...s.level === void 0 ? {} : { level: s.level },
259
- ...s.altitude === void 0 ? {} : { altitude: s.altitude },
260
- ...s.tags ? { tags: s.tags } : {},
261
- ...s.category === void 0 ? {} : { category: s.category },
262
- ...s.image_url ? { image_url: s.image_url } : {},
263
- ...s.address ? { address: s.address } : {},
264
- external_data: s.external_data ?? null
247
+ id: e.id,
248
+ name: e.name,
249
+ ...e.description ? { description: e.description } : {},
250
+ latitude: e.latitude,
251
+ longitude: e.longitude,
252
+ ...e.level === void 0 ? {} : { level: e.level },
253
+ ...e.altitude === void 0 ? {} : { altitude: e.altitude },
254
+ ...e.tags ? { tags: e.tags } : {},
255
+ ...e.category === void 0 ? {} : { category: e.category },
256
+ ...e.image_url ? { image_url: e.image_url } : {},
257
+ ...e.address ? { address: e.address } : {},
258
+ external_data: e.external_data ?? null
265
259
  };
266
260
  }
267
- var PinpointCache = class s {
261
+ //#endregion
262
+ //#region src/services/PinpointCache.ts
263
+ var y = class e {
268
264
  static MIN_BBOX_SIZE = 3e3;
269
265
  static PAGE_SIZE = 400;
270
266
  static instances = /* @__PURE__ */ new Map();
@@ -272,85 +268,85 @@ var PinpointCache = class s {
272
268
  service;
273
269
  pinpoints = /* @__PURE__ */ new Map();
274
270
  cachedBboxByLevel = /* @__PURE__ */ new Map();
275
- constructor(s) {
276
- this.service = s;
271
+ constructor(e) {
272
+ this.service = e;
277
273
  }
278
- static forLivemap(E, D) {
279
- let O = `${E}:${D}`;
280
- s.refCounts.set(O, (s.refCounts.get(O) ?? 0) + 1);
281
- let k = s.instances.get(O);
282
- return k || (k = new s(new PinpointService(E, D)), s.instances.set(O, k)), k;
274
+ static forLivemap(t, n) {
275
+ let r = `${t}:${n}`;
276
+ e.refCounts.set(r, (e.refCounts.get(r) ?? 0) + 1);
277
+ let i = e.instances.get(r);
278
+ return i || (i = new e(new _(t, n)), e.instances.set(r, i)), i;
283
279
  }
284
- static release(E, D) {
285
- let O = `${E}:${D}`, k = (s.refCounts.get(O) ?? 1) - 1;
286
- k <= 0 ? (s.refCounts.delete(O), s.instances.delete(O)) : s.refCounts.set(O, k);
280
+ static release(t, n) {
281
+ let r = `${t}:${n}`, i = (e.refCounts.get(r) ?? 1) - 1;
282
+ i <= 0 ? (e.refCounts.delete(r), e.instances.delete(r)) : e.refCounts.set(r, i);
287
283
  }
288
- upsert(s) {
289
- for (let E of s) this.pinpoints.set(E.id, E);
284
+ upsert(e) {
285
+ for (let t of e) this.pinpoints.set(t.id, t);
290
286
  }
291
- search(s) {
292
- return this.service.search(s);
287
+ search(e) {
288
+ return this.service.search(e);
293
289
  }
294
290
  async getAll() {
295
- let s = await this.service.getAll();
296
- return this.upsert(s), s;
291
+ let e = await this.service.getAll();
292
+ return this.upsert(e), e;
297
293
  }
298
- getCachedById(s) {
299
- return this.pinpoints.get(s);
294
+ getCachedById(e) {
295
+ return this.pinpoints.get(e);
300
296
  }
301
297
  getLoaded() {
302
298
  return [...this.pinpoints.values()];
303
299
  }
304
300
  getCachedBbox() {
305
- let s = [...this.cachedBboxByLevel.values()];
306
- return s.length === 0 ? null : s.slice(1).reduce((s, E) => s.extend(E), s[0]);
301
+ let e = [...this.cachedBboxByLevel.values()];
302
+ return e.length === 0 ? null : e.slice(1).reduce((e, t) => e.extend(t), e[0]);
307
303
  }
308
- async getById(s) {
309
- let E = this.pinpoints.get(s);
310
- if (E) return E;
304
+ async getById(e) {
305
+ let t = this.pinpoints.get(e);
306
+ if (t) return t;
311
307
  try {
312
- let E = await this.service.getById(s);
313
- return this.pinpoints.set(E.id, E), E;
308
+ let t = await this.service.getById(e);
309
+ return this.pinpoints.set(t.id, t), t;
314
310
  } catch {
315
311
  return null;
316
312
  }
317
313
  }
318
- async preloadViewport(E, D) {
319
- let O = D ?? null, k = this.cachedBboxByLevel.get(O);
320
- if (k?.contains(E.getNorthWest()) && k?.contains(E.getSouthEast())) return;
321
- let A = s.MIN_BBOX_SIZE / 2, j = E.extend(E.center.destinationPoint(A, 0)).extend(E.center.destinationPoint(A, Math.PI / 2)).extend(E.center.destinationPoint(A, Math.PI)).extend(E.center.destinationPoint(A, 3 * Math.PI / 2)), M = {
322
- ...boundsToDelta(j),
323
- ...D == null ? {} : { level: D }
324
- }, N = 0, P = 0;
314
+ async preloadViewport(t, n) {
315
+ let r = n ?? null, i = this.cachedBboxByLevel.get(r);
316
+ if (i?.contains(t.getNorthWest()) && i?.contains(t.getSouthEast())) return;
317
+ let a = e.MIN_BBOX_SIZE / 2, o = t.extend(t.center.destinationPoint(a, 0)).extend(t.center.destinationPoint(a, Math.PI / 2)).extend(t.center.destinationPoint(a, Math.PI)).extend(t.center.destinationPoint(a, 3 * Math.PI / 2)), s = {
318
+ ...h(o),
319
+ ...n == null ? {} : { level: n }
320
+ }, c = 0, l = 0;
325
321
  do {
326
- let E = await this.service.search({
327
- ...M,
328
- limit: s.PAGE_SIZE,
329
- offset: N
322
+ let t = await this.service.search({
323
+ ...s,
324
+ limit: e.PAGE_SIZE,
325
+ offset: c
330
326
  });
331
- P ||= E.count, this.upsert(E.items), N += s.PAGE_SIZE;
332
- } while (N < P);
333
- this.cachedBboxByLevel.set(O, j);
327
+ l ||= t.count, this.upsert(t.items), c += e.PAGE_SIZE;
328
+ } while (c < l);
329
+ this.cachedBboxByLevel.set(r, o);
334
330
  }
335
- }, PinpointManager = class {
331
+ }, b = class {
336
332
  cache;
337
333
  baseUrl;
338
334
  emmid;
339
- constructor(s, E) {
340
- this.baseUrl = s, this.emmid = E, this.cache = PinpointCache.forLivemap(s, E);
335
+ constructor(e, t) {
336
+ this.baseUrl = e, this.emmid = t, this.cache = y.forLivemap(e, t);
341
337
  }
342
- async search(s) {
343
- let E = await this.cache.search(s);
344
- return this.cache.upsert(E.items), E;
338
+ async search(e) {
339
+ let t = await this.cache.search(e);
340
+ return this.cache.upsert(t.items), t;
345
341
  }
346
342
  getAll() {
347
343
  return this.cache.getAll();
348
344
  }
349
- getById(s) {
350
- return this.cache.getById(s);
345
+ getById(e) {
346
+ return this.cache.getById(e);
351
347
  }
352
- preloadViewport(s, E) {
353
- return this.cache.preloadViewport(s, E);
348
+ preloadViewport(e, t) {
349
+ return this.cache.preloadViewport(e, t);
354
350
  }
355
351
  getLoadedPinpoints() {
356
352
  return this.cache.getLoaded();
@@ -359,164 +355,220 @@ var PinpointCache = class s {
359
355
  return this.cache.getCachedBbox();
360
356
  }
361
357
  release() {
362
- PinpointCache.release(this.baseUrl, this.emmid);
358
+ y.release(this.baseUrl, this.emmid);
359
+ }
360
+ }, x = "https://geocoding.getwemap.workers.dev", S = class {
361
+ http;
362
+ defaults;
363
+ constructor(e = {}) {
364
+ let { baseUrl: t = x, language: n, region: i, bbox: a } = e;
365
+ this.http = new r({ baseUrl: t }), this.defaults = {
366
+ ...n === void 0 ? {} : { language: n },
367
+ ...i === void 0 ? {} : { region: i },
368
+ ...a === void 0 ? {} : { bbox: a }
369
+ };
370
+ }
371
+ async search(e, t) {
372
+ let n = await this.fetchFeatures(this.buildSearchParams(e, t));
373
+ return n.length > 0 ? C(n[0]) : null;
374
+ }
375
+ async searchMultiple(e, t) {
376
+ return (await this.fetchFeatures(this.buildSearchParams(e, t))).map(C);
377
+ }
378
+ async reverseGeocode(e, t, n) {
379
+ let r = {
380
+ latitude: e,
381
+ longitude: t
382
+ }, i = n?.language ?? this.defaults.language;
383
+ i !== void 0 && (r.language = i);
384
+ let a = await this.fetchFeatures(r);
385
+ return a.length > 0 ? C(a[0]) : null;
386
+ }
387
+ buildSearchParams(e, t) {
388
+ let n = t?.language ?? this.defaults.language, r = t?.region ?? this.defaults.region, i = t?.bbox ?? this.defaults.bbox, a = { query: e };
389
+ return n !== void 0 && (a.language = n), r !== void 0 && (a.region = r), i !== void 0 && (a.bbox = i.join(",")), a;
363
390
  }
364
- }, livemap_snippet_default = {
391
+ async fetchFeatures(e) {
392
+ let { data: t } = await this.http.get("/", { params: e });
393
+ return t.features ?? [];
394
+ }
395
+ };
396
+ function C(e) {
397
+ let [t, n] = e.center;
398
+ return {
399
+ id: e.id,
400
+ placeType: e.place_type,
401
+ relevance: e.relevance,
402
+ text: e.text,
403
+ placeName: e.place_name,
404
+ ...e.language === void 0 ? {} : { language: e.language },
405
+ latitude: n,
406
+ longitude: t,
407
+ ...e.bbox === void 0 ? {} : { bbox: e.bbox }
408
+ };
409
+ }
410
+ var w = {
365
411
  properties: /* @__PURE__ */ JSON.parse("{\"actionbuttons\":{\"default\":{\"withlabel\":false},\"description\":\"Configuration relative to the action buttons\",\"properties\":{\"withlabel\":{\"default\":false,\"description\":\"Enable label on action buttons\",\"type\":\"boolean\"}},\"type\":\"object\"},\"analytics\":{\"default\":null,\"description\":\"Parameters relative to analytics\",\"type\":\"object\",\"properties\":{\"gtagIDs\":{\"default\":[],\"description\":\"Gtag IDs to configure\",\"type\":\"array\",\"items\":{\"type\":\"string\"}}}},\"arnavigationdata\":{\"default\":{\"arRadius\":1000,\"audio\":false,\"maxDistanceNavigation\":10000,\"default\":\"outdoor\",\"cursorVisible\":true,\"cursorTimeout\":1000,\"mapFooter\":false,\"indoor\":{\"accuracyThreshold\":8,\"end\":{\"geofence\":5,\"visibleDistance\":200},\"instructions\":{\"geofence\":3,\"maxDistance\":10,\"minAlt\":1,\"opacityDistanceStart\":10,\"realSizeScale\":1,\"scale\":0.06,\"audioDistance\":10},\"itinerary\":{\"sampling\":1.6,\"opacityDistanceEnd\":15,\"arrowTargetDistance\":5},\"mapmatching\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":15,\"minDistance\":1,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"multilevel\":{\"geofenceDisableNav\":3},\"pinpoints\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true}},\"outdoor\":{\"accuracyThreshold\":25,\"end\":{\"geofence\":15,\"visibleDistance\":200},\"instructions\":{\"geofence\":10,\"maxDistance\":40,\"minAlt\":1.5,\"opacityDistanceStart\":20,\"realSizeScale\":3,\"scale\":0.03,\"audioDistance\":30},\"itinerary\":{\"sampling\":1.6,\"opacityDistanceEnd\":30,\"arrowTargetDistance\":10},\"mapmatching\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":50,\"minDistance\":0,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"multilevel\":{\"geofenceDisableNav\":3},\"pinpoints\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true}},\"providers\":{\"blacklist\":[],\"gnssWifi\":{\"discardPositionsAbove\":50,\"enableHighAccuracy\":true},\"polestarkey\":null,\"straightLineDetector\":{\"stepsConsideredForStraightLine\":2},\"stepDetector\":{\"algorithm\":\"minMaxPeaks2\",\"stepSizeMultiplier\":1,\"minMaxPeaks2\":null,\"minMaxPeaks3\":null},\"useMapMatching\":true,\"usePositionSmoother\":true,\"useAllAbsolutePositions\":false,\"vps\":null,\"whitelist\":[]},\"visibleTags\":[]},\"description\":\"Configuration relative to the AR navigation \",\"properties\":{\"arRadius\":{\"default\":1000,\"description\":\"Maximum distance for the displayed pinpoints in AR view (in meters)\",\"type\":\"integer\"},\"default\":{\"default\":\"outdoor\",\"description\":\"The default value for the ar navigation parameters\",\"type\":\"string\"},\"audio\":{\"default\":false,\"description\":\"If the user should be guided with audio\",\"type\":\"boolean\"},\"cursorVisible\":{\"default\":true,\"description\":\"If the cursor should be visible\",\"type\":\"boolean\"},\"cursorTimeout\":{\"default\":1000,\"description\":\"The timeout to open a pinpoint with the cursor\",\"type\":\"number\"},\"maxDistanceNavigation\":{\"default\":10000,\"description\":\"The max distance where the navigation is started directly\",\"type\":\"number\"},\"mapFooter\":{\"default\":false,\"description\":\"If the map should be shown at footer on navigation\",\"type\":\"boolean\"},\"indoor\":{\"default\":{\"accuracyThreshold\":8,\"end\":{\"geofence\":5,\"visibleDistance\":200},\"instructions\":{\"geofence\":3,\"maxDistance\":10,\"minAlt\":1,\"opacityDistanceStart\":10,\"realSizeScale\":1,\"scale\":0.06,\"audioDistance\":10},\"itinerary\":{\"sampling\":1.6,\"opacityDistanceEnd\":15,\"arrowTargetDistance\":5},\"mapmatching\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":15,\"minDistance\":1,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"multilevel\":{\"geofenceDisableNav\":3},\"pinpoints\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true}},\"properties\":{\"accuracyThreshold\":{\"default\":8,\"type\":\"integer\"},\"end\":{\"default\":{\"geofence\":5,\"visibleDistance\":200},\"type\":\"object\",\"properties\":{\"geofence\":{\"type\":\"integer\",\"default\":5},\"visibleDistance\":{\"type\":\"integer\",\"default\":200}}},\"instructions\":{\"default\":{\"geofence\":3,\"maxDistance\":10,\"minAlt\":1,\"opacityDistanceStart\":10,\"realSizeScale\":1,\"scale\":0.06,\"audioDistance\":10},\"type\":\"object\",\"properties\":{\"geofence\":{\"type\":\"integer\",\"default\":3},\"maxDistance\":{\"type\":\"integer\",\"description\":\"Distance from which the instruction will be display instead of banner with meters\",\"default\":10},\"minAlt\":{\"type\":\"integer\",\"default\":1},\"opacityDistanceStart\":{\"type\":\"integer\",\"default\":10},\"realSizeScale\":{\"type\":\"integer\",\"default\":1},\"scale\":{\"type\":\"number\",\"default\":0.06},\"audioDistance\":{\"type\":\"integer\",\"description\":\"Distance from which the audio will be triggered between 2 steps\",\"default\":10}}},\"itinerary\":{\"default\":{\"sampling\":1.6,\"opacityDistanceEnd\":15,\"arrowTargetDistance\":5},\"type\":\"object\",\"properties\":{\"sampling\":{\"type\":\"integer\",\"default\":1.6},\"opacityDistanceEnd\":{\"type\":\"integer\",\"default\":15},\"arrowTargetDistance\":{\"type\":\"integer\",\"default\":5}}},\"mapmatching\":{\"default\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":15,\"minDistance\":1,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"type\":\"object\",\"properties\":{\"network\":{\"type\":\"string\",\"description\":\"Network to use outside a navigation\",\"default\":null},\"maxAngleBearing\":{\"type\":\"integer\",\"default\":30},\"maxDistance\":{\"type\":\"integer\",\"default\":15},\"minDistance\":{\"type\":\"integer\",\"default\":1},\"useItineraryStartAsPosition\":{\"type\":\"boolean\",\"default\":false},\"useOrientationMatching\":{\"type\":\"boolean\",\"default\":true},\"useStrict\":{\"type\":\"boolean\",\"default\":false},\"hugeJumpDistance\":{\"type\":\"number\",\"default\":3},\"minStepsBetweenOrientationMatching\":{\"type\":\"number\",\"default\":3},\"minStepsForOrientationMatching\":{\"type\":\"number\",\"default\":5},\"lastProjectionsWindowSize\":{\"type\":\"number\",\"default\":3},\"lastProjectionsEdgeAngleThreshold\":{\"type\":\"number\",\"default\":3},\"disableMMCloseToATurnDistance\":{\"type\":\"number\",\"default\":2}}},\"multilevel\":{\"default\":{\"geofenceDisableNav\":3},\"type\":\"object\",\"properties\":{\"geofenceDisableNav\":{\"type\":\"integer\",\"default\":3}}},\"pinpoints\":{\"default\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true},\"type\":\"object\",\"properties\":{\"scale\":{\"type\":\"number\",\"default\":0.09},\"updateDistance\":{\"type\":\"integer\",\"default\":30},\"minDistance\":{\"type\":\"integer\",\"default\":1},\"overlap\":{\"default\":false,\"description\":\"If pinpoint shape in AR should overlap between each other\",\"type\":\"boolean\"},\"label\":{\"default\":true,\"description\":\"If pinpoint shape in AR should have label\",\"type\":\"boolean\"}}}},\"description\":\"The indoor set of parameters\",\"type\":\"object\"},\"outdoor\":{\"default\":{\"accuracyThreshold\":25,\"end\":{\"geofence\":15,\"visibleDistance\":200},\"instructions\":{\"maxDistance\":40,\"geofence\":10,\"minAlt\":1.5,\"opacityDistanceStart\":20,\"realSizeScale\":3,\"scale\":0.03,\"audioDistance\":30},\"itinerary\":{\"sampling\":1.6,\"opacityDistanceEnd\":30,\"arrowTargetDistance\":10},\"mapmatching\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":50,\"minDistance\":0,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"multilevel\":{\"geofenceDisableNav\":3},\"pinpoints\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true}},\"properties\":{\"accuracyThreshold\":{\"default\":25,\"type\":\"integer\"},\"end\":{\"default\":{\"geofence\":15,\"visibleDistance\":200},\"type\":\"object\",\"properties\":{\"geofence\":{\"type\":\"integer\",\"default\":15},\"visibleDistance\":{\"type\":\"integer\",\"default\":200}}},\"instructions\":{\"default\":{\"geofence\":10,\"maxDistance\":40,\"minAlt\":1.5,\"opacityDistanceStart\":20,\"realSizeScale\":3,\"scale\":0.03,\"audioDistance\":30},\"type\":\"object\",\"properties\":{\"geofence\":{\"type\":\"integer\",\"default\":10},\"maxDistance\":{\"type\":\"integer\",\"description\":\"Distance from which the instruction will be display instead of banner with meters\",\"default\":40},\"minAlt\":{\"type\":\"integer\",\"default\":1.5},\"opacityDistanceStart\":{\"type\":\"integer\",\"default\":20},\"realSizeScale\":{\"type\":\"integer\",\"default\":3},\"scale\":{\"type\":\"number\",\"default\":0.03},\"audioDistance\":{\"type\":\"integer\",\"description\":\"Distance from which the audio will be triggered between 2 instructions\",\"default\":30}}},\"itinerary\":{\"default\":{\"sampling\":1.6,\"opacityDistanceEnd\":30,\"arrowTargetDistance\":10},\"type\":\"object\",\"properties\":{\"sampling\":{\"type\":\"integer\",\"default\":1.6},\"opacityDistanceEnd\":{\"type\":\"integer\",\"default\":30},\"arrowTargetDistance\":{\"type\":\"integer\",\"default\":10}}},\"mapmatching\":{\"default\":{\"network\":null,\"maxAngleBearing\":30,\"maxDistance\":50,\"minDistance\":0,\"useItineraryStartAsPosition\":false,\"useOrientationMatching\":true,\"useStrict\":false,\"hugeJumpDistance\":3,\"minStepsBetweenOrientationMatching\":3,\"minStepsForOrientationMatching\":5,\"lastProjectionsWindowSize\":3,\"lastProjectionsEdgeAngleThreshold\":3,\"disableMMCloseToATurnDistance\":2},\"type\":\"object\",\"properties\":{\"useItineraryStartAsPosition\":{\"type\":\"boolean\",\"default\":false},\"network\":{\"type\":\"string\",\"description\":\"Network to use outside a navigation\",\"default\":null},\"maxAngleBearing\":{\"type\":\"number\",\"default\":30},\"maxDistance\":{\"type\":\"integer\",\"default\":50},\"minDistance\":{\"type\":\"integer\",\"default\":0},\"useOrientationMatching\":{\"type\":\"boolean\",\"default\":true},\"useStrict\":{\"type\":\"boolean\",\"default\":false},\"hugeJumpDistance\":{\"type\":\"number\",\"default\":3},\"minStepsBetweenOrientationMatching\":{\"type\":\"number\",\"default\":3},\"minStepsForOrientationMatching\":{\"type\":\"number\",\"default\":5},\"lastProjectionsWindowSize\":{\"type\":\"number\",\"default\":3},\"lastProjectionsEdgeAngleThreshold\":{\"type\":\"number\",\"default\":3},\"disableMMCloseToATurnDistance\":{\"type\":\"number\",\"default\":2}}},\"multilevel\":{\"default\":{\"geofenceDisableNav\":3},\"type\":\"object\",\"properties\":{\"geofenceDisableNav\":{\"type\":\"integer\",\"default\":3}}},\"pinpoints\":{\"default\":{\"scale\":0.09,\"updateDistance\":30,\"minDistance\":1,\"overlap\":false,\"label\":true},\"type\":\"object\",\"properties\":{\"scale\":{\"type\":\"number\",\"default\":0.09},\"updateDistance\":{\"type\":\"integer\",\"default\":30},\"minDistance\":{\"type\":\"integer\",\"default\":1},\"overlap\":{\"default\":false,\"description\":\"If pinpoint shape in AR should overlap between each other\",\"type\":\"boolean\"},\"label\":{\"default\":true,\"description\":\"If pinpoint shape in AR should have label\",\"type\":\"boolean\"}}}},\"description\":\"The outdoor set of parameters\",\"type\":\"object\"},\"providers\":{\"default\":{\"blacklist\":[],\"gnssWifi\":{\"discardPositionsAbove\":50,\"enableHighAccuracy\":true},\"polestarkey\":null,\"straightLineDetector\":{\"stepsConsideredForStraightLine\":2},\"stepDetector\":{\"algorithm\":\"minMaxPeaks2\",\"stepSizeMultiplier\":1,\"minMaxPeaks2\":null,\"minMaxPeaks3\":null},\"useMapMatching\":true,\"usePositionSmoother\":true,\"useAllAbsolutePositions\":false,\"vps\":null,\"whitelist\":[]},\"properties\":{\"blacklist\":{\"default\":[],\"type\":\"array\"},\"gnssWifi\":{\"default\":{\"discardPositionsAbove\":50,\"enableHighAccuracy\":true},\"properties\":{\"discardPositionsAbove\":{\"default\":50,\"type\":\"number\"},\"enableHighAccuracy\":{\"default\":true,\"type\":\"boolean\"}}},\"polestarkey\":{\"default\":null,\"type\":\"string\"},\"straightLineDetector\":{\"default\":{\"stepsConsideredForStraightLine\":2},\"properties\":{\"stepsConsideredForStraightLine\":{\"default\":2,\"type\":\"number\"}},\"type\":\"object\"},\"stepDetector\":{\"default\":{\"algorithm\":\"minMaxPeaks2\",\"stepSizeMultiplier\":1,\"minMaxPeaks2\":null,\"minMaxPeaks3\":null},\"properties\":{\"algorithm\":{\"default\":\"minMaxPeaks2\",\"enum\":[\"ladetto\",\"minMaxPeaks\",\"minMaxPeaks2\",\"minMaxPeaks3\"],\"type\":\"string\"},\"stepSizeMultiplier\":{\"default\":1,\"type\":\"number\"},\"minMaxPeaks2\":{\"default\":null,\"properties\":{\"windowTime\":{\"default\":0.3,\"type\":\"number\"},\"minTimeBetweenSteps\":{\"default\":0.4,\"type\":\"number\"},\"maxFrequency\":{\"default\":4,\"type\":\"number\"},\"minFrequency\":{\"default\":1,\"type\":\"number\"},\"verticalAccPositivePeakThreshold\":{\"default\":0.75,\"type\":\"number\"},\"verticalAccNegativePeakThreshold\":{\"default\":-0.3,\"type\":\"number\"}},\"type\":\"object\"},\"minMaxPeaks3\":{\"default\":null,\"properties\":{\"windowTime\":{\"default\":0.6,\"type\":\"number\"},\"minTimeBetweenSteps\":{\"default\":0.6,\"type\":\"number\"},\"maxFrequency\":{\"default\":4,\"type\":\"number\"},\"minFrequency\":{\"default\":1,\"type\":\"number\"},\"verticalAccPositivePeakThreshold\":{\"default\":0.2,\"type\":\"number\"},\"verticalAccNegativePeakThreshold\":{\"default\":-0.1,\"type\":\"number\"}},\"type\":\"object\"}},\"type\":\"object\"},\"useMapMatching\":{\"default\":true,\"type\":\"boolean\"},\"usePositionSmoother\":{\"default\":true,\"type\":\"boolean\"},\"useAllAbsolutePositions\":{\"default\":false,\"type\":\"boolean\"},\"vps\":{\"default\":null,\"properties\":{\"endpoint\":{\"default\":null,\"type\":\"string\"},\"minInclinationForRequest\":{\"default\":60,\"type\":\"number\"},\"useInclination\":{\"default\":true,\"type\":\"boolean\"},\"requestInterval\":{\"default\":null,\"type\":\"number\"},\"useCoarsePose\":{\"default\":true,\"type\":\"boolean\"},\"waitTimeMinInclinationForRequest\":{\"default\":200,\"type\":\"number\"}},\"type\":\"object\"},\"whitelist\":{\"default\":[],\"type\":\"array\"}},\"description\":\"Providers to use or not\",\"type\":\"object\"},\"visibleTags\":{\"default\":[],\"type\":\"array\",\"items\":{\"type\":\"string\"}}},\"type\":\"object\"},\"addcid\":{\"default\":false,\"description\":\"Double Click Publisher ID\",\"type\":\"string\"},\"addcslot\":{\"default\":false,\"description\":\"Double Click Ad Slot\",\"type\":\"string\"},\"addcsize\":{\"default\":false,\"description\":\"Double Click Size\",\"items\":{\"items\":{\"type\":\"integer\"},\"maxItems\":2,\"minItems\":2,\"type\":\"array\"},\"type\":\"array\"},\"addctarget\":{\"default\":false,\"description\":\"Double Click Target\",\"items\":{\"items\":{\"type\":\"string\"},\"maxItems\":2,\"minItems\":2,\"type\":\"array\"},\"type\":\"array\"},\"adheight\":{\"default\":false,\"description\":\"Ad display height options.\",\"type\":\"string\"},\"adsenseid\":{\"default\":false,\"description\":\"Adsense\",\"type\":\"integer\"},\"adsenseslot\":{\"default\":false,\"description\":\"Adsense\",\"type\":\"integer\"},\"adwidth\":{\"default\":false,\"description\":\"Ad display width options.\",\"type\":\"string\"},\"aroundme\":{\"default\":true,\"description\":\"Show around button in livemap.\",\"type\":\"boolean\"},\"arviewenabled\":{\"default\":false,\"description\":\"Enable the Wemap-AR view on compatible mobile devices.\",\"type\":\"boolean\"},\"arswitcherbutton\":{\"default\":false,\"description\":\"Use button instead of device inclination for switching AR/map\",\"type\":\"boolean\"},\"autocenter\":{\"default\":0,\"description\":\"Automatic centering on landing area when idle (in milliseconds).\",\"type\":\"integer\"},\"autologin\":{\"default\":true,\"description\":\"Use localStorage to login.\",\"type\":\"boolean\"},\"autoplay\":{\"default\":false,\"description\":\"Slideshow of pinpoints when map is idle.\",\"type\":[\"boolean\",\"object\"]},\"autoplayoverlay\":{\"default\":false,\"description\":\"If true, the autoplay will be locked with an overlay and no interaction will be available\",\"type\":\"boolean\"},\"autoplaytimeout\":{\"default\":5000,\"description\":\"How long until considering the map as idle (in milliseconds).\",\"type\":\"integer\"},\"bodyfullscreen\":{\"default\":false,\"description\":\"If body parent to livemap should be showned in fullscreen mode instead of livemap's container.\",\"type\":\"boolean\"},\"calendarfilterenabled\":{\"default\":false,\"description\":\"Force to enable calendar filter even if useevents is false.\",\"type\":\"boolean\"},\"calendarfiltermindate\":{\"default\":\"\",\"description\":\"Min date at ISO format for calendar filter (filters view & welcome card)\",\"type\":\"string\"},\"calendarfiltermaxdate\":{\"default\":\"\",\"description\":\"Max date at ISO format for calendar filter (filters view & welcome card)\",\"type\":\"string\"},\"cancomment\":{\"default\":true,\"description\":\"Ability to comment/contribute on pinpoints.\",\"type\":\"boolean\"},\"canopenpinpoint\":{\"default\":true,\"description\":\"Ability to open a marker on click.\",\"type\":\"boolean\"},\"clicktofullscreen\":{\"default\":false,\"description\":\"Click on the map to unlock and go fullscreen.\",\"type\":\"boolean\"},\"clicktofullscreendevices\":{\"default\":\"mobile\",\"description\":\"Click on the map to unlock and go fullscreen. Only for specified devices.\",\"enum\":[\"all\",\"mobile\"],\"type\":\"string\"},\"clicktonavigate\":{\"default\":false,\"description\":\"Click on the map to navigate to coordinates\",\"type\":\"boolean\"},\"clientname\":{\"default\":\"\",\"description\":\"Add an additional css class wemap-livemap-<clientname> to the main livemap's container Value can also describe a sub-client: client:sub-client. Eg: allow mcc components customization\",\"type\":\"string\"},\"clustercircle\":{\"default\":false,\"description\":\"Displays a simple circle instead of a cluster icon.\",\"type\":\"boolean\"},\"clustercolor\":{\"default\":\"#015697\",\"description\":\"Clusters icons color (requires clustercircle).\",\"type\":\"string\"},\"clustericon\":{\"default\":null,\"description\":\"Cluster icon image (ignored if clustercircle is set).\",\"type\":\"string\"},\"clustering\":{\"default\":true,\"description\":\"Enables front-end side clustering of pinpoints.\",\"type\":\"boolean\"},\"clustermethod\":{\"default\":\"supercluster\",\"description\":\"Algorithm used to group pinpoints into clusters.\",\"enum\":[\"hierarchy\",\"supercluster\"],\"type\":\"string\"},\"clusterplussign\":{\"default\":false,\"description\":\"Replaces the cluster count by a plus sign (requires clustercircle).\",\"type\":\"boolean\"},\"clusterradius\":{\"default\":80,\"description\":\"Configure the radius of the clustering algorithm (and multipoint search area).\",\"type\":\"integer\"},\"custompetals\":{\"type\":\"array\",\"description\":\"List of custom petals that will replace the classic ones.\",\"items\":{\"type\":\"object\",\"description\":\"A custom petal.\",\"properties\":{\"position\":{\"type\":\"integer\",\"description\":\"The position of the custom petal (between 1 and 5).\"},\"iconurl\":{\"type\":\"string\",\"description\":\"The url of the petal icon.\"},\"text\":{\"type\":\"string\",\"description\":\"The text that will be displayed when the petal is hovered.\"},\"actionname\":{\"type\":\"string\",\"description\":\"The action realized when the petal is clicked. The available actions are described in the documentation.\"},\"actionparameters\":{\"type\":\"object\",\"default\":{}}}},\"default\":[]},\"customshareurl\":{\"default\":null,\"description\":\"Custom url for pinpoint sharing.\",\"type\":\"string\"},\"dateonly\":{\"default\":false,\"description\":\"Do not display event hours\",\"type\":\"boolean\"},\"deeplinkingenabled\":{\"description\":\"Enable the update of the url hash when navigate through the application\",\"type\":\"boolean\",\"default\":true},\"displaypoorevent\":{\"default\":true,\"description\":\"Display event as poor event if they don't have description\",\"type\":\"boolean\"},\"dragging\":{\"default\":true,\"description\":\"Enable map dragging with mouse/touch.\",\"type\":\"boolean\"},\"enabledcontrols\":{\"default\":true,\"description\":\"Enable map controls.\",\"type\":\"boolean\"},\"enableembedshare\":{\"default\":true,\"description\":\"Enable/Disable EMBED share on the livemap.\",\"type\":\"boolean\"},\"enablelogin\":{\"default\":true,\"description\":\"Are users allowed to login.\",\"type\":\"boolean\"},\"enablepetals\":{\"default\":true,\"description\":\"Enable/Disable petals components on the livemap.\",\"type\":\"boolean\"},\"enablesidebar\":{\"default\":true,\"description\":\"Enable/Disable sidebar on the livemap.\",\"type\":\"boolean\"},\"expanddescription\":{\"default\":false,\"description\":\"Shows a Read more button at the bottom of pinpoint description.\",\"type\":\"boolean\"},\"externalcontent\":{\"default\":false,\"description\":\"Add HTML content to main container, permits to user to customize its map.\",\"items\":{\"type\":\"string\"},\"type\":\"array\"},\"externalscripts\":{\"default\":false,\"description\":\"External JavaScript defined by user, added as script tags into livemap's document header\",\"items\":{\"properties\":{\"content\":{\"description\":\"JavaScript code.\",\"type\":\"string\"},\"url\":{\"description\":\"The URL from which to fetch the JavaScript code.\",\"type\":\"string\"}},\"type\":\"object\"},\"type\":\"array\"},\"externalstyles\":{\"default\":false,\"description\":\"External stylesheets defined by user, added as style tags into livemap's document header. Could be used to override existent css rule\",\"items\":{\"properties\":{\"content\":{\"description\":\"CSS code.\",\"type\":[\"object\",\"string\"]},\"url\":{\"description\":\"The URL from which to fetch the CSS code.\",\"type\":\"string\"}},\"type\":\"object\"},\"type\":\"array\"},\"featuredlists\":{\"default\":false,\"description\":\"Add a new button with the livemap's title, on click it will open the right sidebar containing all the lists for this map.\",\"type\":\"boolean\"},\"featuretilesenabled\":{\"default\":false,\"description\":\"Enables server-side clustering.\",\"type\":\"boolean\"},\"floors\":{\"default\":[],\"description\":\"Floors for multi-levels maps.\",\"items\":{\"properties\":{\"maxaltitude\":{\"description\":\"The maximum altitude for the floor (exclusive).\",\"title\":\"Maximum altitude\",\"type\":\"number\"},\"minaltitude\":{\"description\":\"The minimum altitude for the floor (inclusive).\",\"title\":\"Minimum altitude\",\"type\":\"number\"},\"name\":{\"title\":\"Name\",\"type\":\"string\"}},\"required\":[\"name\",\"minaltitude\",\"maxaltitude\"],\"type\":\"object\"},\"type\":\"array\"},\"floorsminzoom\":{\"default\":null,\"description\":\"Min zoom to display the floors switcher\",\"type\":\"number\"},\"forcelittlescreenview\":{\"default\":false,\"description\":\"Force to use the 'little screen' display mode if not in mobile view.\",\"type\":\"boolean\"},\"forcemobileview\":{\"default\":false,\"description\":\"Force to add class 'mobile-view' to livemap container and add a class forced-mobileview to livemap container it will also force livemap state.\",\"type\":\"boolean\"},\"fullscreencontrol\":{\"default\":false,\"description\":\"Show/Hide burger menu item 'Goto Fullscreen'.\",\"type\":\"boolean\"},\"geoentities\":{\"default\":{\"hideOthersOnSelect\":true,\"strokeHighlightScale\":1.5},\"properties\":{\"hideOthersOnSelect\":{\"default\":true,\"description\":\"Hide other geoentities when one is selected.\",\"type\":\"boolean\"},\"strokeHighlightScale\":{\"default\":1.5,\"description\":\"Scale factor of stroke width on highlight\",\"type\":\"number\"}},\"description\":\"Enable/Disable geoentities components on the livemap.\",\"type\":\"object\"},\"handlebearing\":{\"default\":false,\"description\":\"Allow map to rotate depending on the device orientation.\",\"type\":\"boolean\"},\"hereandnowcontrol\":{\"default\":false,\"description\":\"Replace geolocate button by a button 'here and now' which also filter on current day.\",\"type\":\"boolean\"},\"homecontrol\":{\"default\":true,\"description\":\"Show/Hide menu item 'Back to first view'.\",\"type\":\"boolean\"},\"howtocontrol\":{\"default\":false,\"description\":\"Show/Hide menu item 'How to use this map'.\",\"type\":\"boolean\"},\"indoor\":{\"default\":{\"enable\":false,\"usePinpoints\":false,\"useLevelSearch\":false,\"limitOutdoorAtLevel\":null,\"highlightEnabled\":true,\"highlightColor\":null,\"highlightOnSearch\":false,\"minZoom\":17,\"enableInteraction\":true},\"properties\":{\"enable\":{\"default\":false,\"description\":\"Enable indoor mode.\",\"type\":\"boolean\"},\"enableInteraction\":{\"default\":true,\"description\":\"Enable/disable interaction with indoor features (hover, click)\",\"type\":\"boolean\"},\"highlightColor\":{\"default\":null,\"description\":\"Color for highlight feature\",\"type\":\"string\"},\"selectedColor\":{\"default\":null,\"description\":\"Color for selected feature\",\"type\":\"string\"},\"highlightEnabled\":{\"default\":true,\"description\":\"Enable/disable highlight feature on click\",\"type\":\"boolean\"},\"highlightOnSearch\":{\"default\":false,\"description\":\"Enable/disable highlight feature on search\",\"type\":\"boolean\"},\"limitOutdoorAtLevel\":{\"default\":null,\"description\":\"Define which level should show outdoor pinpoint. If null all levels will show outdoor pinpoint.\",\"type\":\"number\"},\"minZoom\":{\"default\":17,\"description\":\"Define the zoom level at which indoor mode will be enabled\",\"type\":\"number\"},\"usePinpoints\":{\"default\":false,\"description\":\"If pinpoint are linked to indoor feature. It will automatically open pinpoint on feature click and highlight feature on pinpoint open.\",\"type\":\"boolean\"},\"useLevelSearch\":{\"default\":false,\"description\":\"If pinpoint search is made on the current level. If not, it will search on all levels.\",\"type\":\"boolean\"}},\"description\":\"Configuration relative to indoor\",\"type\":\"object\"},\"initialbearing\":{\"default\":0,\"description\":\"Initial bearing of the map.\",\"type\":\"number\"},\"introcard\":{\"default\":null,\"description\":\"Shows an information popin on map load.\",\"properties\":{\"active\":{\"default\":true,\"description\":\"If not true, the welcomeCard won't be displayed.\",\"title\":\"Active\",\"type\":\"boolean\"},\"avatar\":{\"description\":\"Custom user's avatar image.\",\"title\":\"Avatar URL\",\"type\":\"string\"},\"background\":{\"description\":\"URL background image shown behind the user's avatar, default is user's background image.\",\"title\":\"Background URL\",\"type\":\"string\"},\"class\":{\"description\":\"Custom classnames for the popin.\",\"title\":\"CSS classname\",\"type\":\"string\"},\"enableAroundMe\":{\"default\":false,\"description\":\"Display the 'around me' button on welcome card.\",\"title\":\"Display 'Around me' button\",\"type\":\"boolean\"},\"aroundMeTitle\":{\"title\":\"Title of the around me filter.\",\"description\":\"Title of the around me filter.\",\"type\":\"string\"},\"aroundMeSubtitle\":{\"title\":\"Subtitle of the around me filter.\",\"description\":\"Subtitle of the around me filter.\",\"type\":\"string\"},\"filters\":{\"description\":\"Enable filters on WelcomeCard.\",\"items\":{\"properties\":{\"type\":{\"description\":\"Type of filter.\",\"enum\":[\"tag\",\"when\",\"where\"],\"title\":\"Type of filter\",\"type\":\"string\"},\"title\":{\"description\":\"Title of the filter.\",\"title\":\"Title of the filter.\",\"type\":\"string\"},\"subtitle\":{\"description\":\"Subtitle of the filter.\",\"title\":\"Subtitle of the filter.\",\"type\":\"string\"}},\"type\":\"object\"},\"required\":[\"type\"],\"type\":\"array\"},\"noBackground\":{\"default\":false,\"description\":\"Hide the user's background image.\",\"title\":\"Hide Backround\",\"type\":\"boolean\"},\"permanent\":{\"default\":true,\"description\":\"Show WelcomeCard everytime.\",\"title\":\"Permanent WelcomeCard\",\"type\":\"boolean\"},\"text\":{\"description\":\"Displayed under the title as HTML.\",\"title\":\"HTML Text\",\"type\":\"string\"},\"title\":{\"description\":\"Displayed under the user's avatar with bold font.\",\"title\":\"Title\",\"type\":\"string\"}},\"type\":\"object\"},\"iscontributive\":{\"default\":false,\"description\":\"Tell if the map is contributive or not.\",\"type\":\"boolean\"},\"kiosk\":{\"default\":null,\"description\":\"Kiosk parameters like the photosphere image or position\",\"properties\":{\"list\":{\"type\":\"array\",\"default\":[],\"items\":{\"type\":\"object\",\"default\":null,\"properties\":{\"photosphere\":{\"type\":\"object\",\"default\":null,\"properties\":{\"day\":{\"type\":\"string\"},\"night\":{\"type\":\"string\"}}},\"kioskid\":{\"type\":\"string\",\"default\":\"\"},\"accessibleheight\":{\"type\":\"string\",\"description\":\"Kiosk mode has a max height for interactive button for accessibility purpose\",\"default\":50},\"heading\":{\"description\":\"Heading is used to orient the photosphere according to the map (in degrees)\",\"type\":\"number\",\"default\":0},\"initialorientation\":{\"description\":\"Initial orientation of the view (in degrees)\",\"type\":\"number\",\"default\":0},\"position\":{\"properties\":{\"lat\":{\"description\":\"Latitude of position for photosphere.\",\"title\":\"Latitude\",\"type\":\"number\"},\"lng\":{\"description\":\"Longitude of position for photosphere.\",\"title\":\"Longitude\",\"type\":\"number\"},\"alt\":{\"description\":\"Altitude of position for photosphere.\",\"title\":\"Altitude\",\"type\":\"number\"},\"level\":{\"description\":\"Level of position for photosphere.\",\"title\":\"Level\",\"type\":\"number\"}},\"required\":[\"lat\",\"lng\"],\"type\":\"object\"},\"rotationduration\":{\"description\":\"Rotation of sphere. Number of seconds for a complete loop\",\"type\":\"number\",\"default\":35}}}},\"screensavertype\":{\"type\":\"string\",\"enum\":[\"auto\",null],\"default\":\"auto\"},\"timeoutscreensaver\":{\"type\":\"number\",\"default\":30000},\"type\":{\"type\":\"string\",\"default\":\"default\",\"enum\":[\"default\",\"desktop\"]},\"intro\":{\"type\":\"object\",\"default\":null,\"properties\":{\"text\":{\"type\":\"string\"},\"title\":{\"type\":\"string\"}}}},\"type\":\"object\"},\"kioskid\":{\"default\":null,\"type\":\"string\"},\"kiosk_viewer\":{\"default\":null,\"description\":\"Id of kiosk viewer map\",\"type\":\"string\"},\"layers\":{\"default\":[],\"description\":\"Additional feature layers.\",\"items\":{\"properties\":{\"altitude\":{\"description\":\"The altitude (in meters) of this layer, for multi-floor maps.\",\"title\":\"Altitude\",\"type\":\"number\"},\"clustering\":{\"default\":false,\"description\":\"Use this layer for front-end hierarchy clustering.\",\"title\":\"Clustering\",\"type\":\"boolean\"},\"coordinates\":{\"default\":null,\"description\":\"Coordinates of each corner of the image. It can only be used with layer type image. Represented by an array of coordinates array [lng, lat]\",\"items\":{\"items\":{\"type\":\"number\"},\"type\":\"array\"},\"type\":\"array\"},\"maxzoom\":{\"default\":18,\"description\":\"The maximum zoom at which the layer is visible (exclusive).\",\"minimum\":0,\"title\":\"Maximum zoom\",\"type\":\"integer\"},\"minzoom\":{\"default\":2,\"description\":\"The minimum zoom at which the layer is visible (inclusive).\",\"minimum\":0,\"title\":\"Minimum zoom\",\"type\":\"integer\"},\"onclick\":{\"default\":\"zoom\",\"enum\":[\"ignore\",\"popup\",\"tooltip\",\"zoom\"],\"title\":\"Action on click\",\"type\":\"string\"},\"onhover\":{\"default\":\"highlight\",\"enum\":[\"ignore\",\"highlight\"],\"title\":\"Action on hover\",\"type\":\"string\"},\"type\":{\"description\":\"The type of layer format (GeoJSON, vector tiles or image).\",\"enum\":[\"geojson\",\"image\",\"vector\"],\"title\":\"Type\",\"type\":\"string\"},\"url\":{\"description\":\"The URL from which to fetch the layer's data.\",\"title\":\"URL\",\"type\":\"string\"}},\"required\":[\"type\",\"url\"],\"type\":\"object\"},\"type\":\"array\"},\"limitperpage\":{\"default\":10,\"description\":\"Number of items per page in the livebar.\",\"type\":\"integer\"},\"linksenabled\":{\"default\":true,\"description\":\"Enable clicking on links (in pinpoint description or comments).\",\"type\":\"boolean\"},\"littlescreenthresholdwidth\":{\"default\":1030,\"description\":\"Max width before going to littleScreen mode.\",\"type\":\"integer\"},\"locked\":{\"default\":false,\"description\":\"Lock map, need to click it to unlock and use (no hover).\",\"type\":\"boolean\"},\"mapviewenabled\":{\"default\":true,\"description\":\"If false, hide the map and keep only the UI.\",\"type\":\"boolean\"},\"markersize\":{\"default\":100,\"type\":\"integer\",\"description\":\"Size of the map markers.\"},\"maxbounds\":{\"default\":null,\"description\":\"Restricts the map view to the given bounds.\",\"properties\":{\"_northEast\":{\"properties\":{\"lat\":{\"description\":\"Latitude of upper-right's corner (northEast).\",\"title\":\"NorthEast latitude\",\"type\":\"number\"},\"lng\":{\"description\":\"Longitude of upper-right's corner (northEast).\",\"title\":\"NorthEast longitude\",\"type\":\"number\"}},\"required\":[\"lat\",\"lng\"],\"type\":\"object\"},\"_southWest\":{\"properties\":{\"lat\":{\"description\":\"Latitude of bottom-left's corner (southWest).\",\"title\":\"SouthWest latitude\",\"type\":\"number\"},\"lng\":{\"description\":\"Longitude of bottom-left's corner (southWest).\",\"title\":\"SouthWest longitude\",\"type\":\"number\"}},\"required\":[\"lat\",\"lng\"],\"type\":\"object\"}},\"required\":[\"_northEast\",\"_southWest\"],\"type\":\"object\"},\"maximagewidth\":{\"default\":500,\"description\":\"Sets the maximum image width in sidebar. (in px)\",\"type\":\"integer\"},\"maxzoom\":{\"default\":18,\"description\":\"Maximum zoom level of the map.\",\"maximum\":24,\"minimum\":0,\"type\":\"integer\"},\"maxzoomcluster\":{\"default\":null,\"description\":\"Maximum zoom for clustering. Default will be maxzoom\",\"maximum\":24,\"minimum\":0,\"type\":\"integer\"},\"menuextensions\":{\"default\":false,\"description\":\"Add options to the livemap menu.\",\"items\":{\"properties\":{\"icon\":{\"description\":\"Name of Font-Awesome Icon.\",\"title\":\"Icon\",\"type\":\"string\"},\"text\":{\"description\":\"Label for custom button.\",\"title\":\"Button's Label\",\"type\":\"string\"},\"url\":{\"description\":\"URL to redirect from.\",\"title\":\"URL\",\"type\":\"string\"}},\"type\":\"object\"},\"type\":\"array\"},\"minzoom\":{\"default\":2,\"description\":\"Minimum zoom level of the map.\",\"maximum\":24,\"minimum\":0,\"type\":\"integer\"},\"mobilethresholdwidth\":{\"default\":630,\"description\":\"When to consider the map as small/mobile. (main application container will be prefixed by 'mobile-view' class)\",\"type\":\"integer\"},\"mode\":{\"default\":\"default\",\"description\":\"Define the mode of the livemap if it should be with AR, for navigation or kiosk. This will change the UI and features\",\"enum\":[\"default\",\"kiosk_map\",\"kiosk_viewer\",\"kiosk_screensaver_map\"],\"type\":\"string\"},\"models\":{\"default\":null,\"description\":\"Define the URL of the 3d models to load in the map.\",\"type\":\"array\",\"items\":{\"type\":\"object\",\"properties\":{\"id\":{\"type\":\"string\"},\"visible\":{\"default\":\"always\",\"enum\":[\"always\",\"3d\"]},\"url\":{\"type\":\"string\"},\"minzoom\":{\"default\":0,\"type\":\"number\"},\"maxzoom\":{\"default\":24,\"type\":\"number\"}}}},\"navigatefromposition\":{\"default\":true,\"description\":\"If it should use user location for itineraries\",\"type\":\"boolean\"},\"offline\":{\"default\":{\"blacklist\":[],\"enable\":false,\"tiles\":null},\"description\":\"Configuration relative to the offline.\",\"properties\":{\"blacklist\":{\"default\":[],\"description\":\"Array of list to not use for offline\",\"type\":\"array\"},\"enable\":{\"default\":false,\"description\":\"Enable the offline feature\",\"type\":\"boolean\"},\"tiles\":{\"default\":null,\"description\":\"Mbtiles file to load for offline tiles\",\"type\":\"string\"}},\"type\":\"object\"},\"openedsearch\":{\"default\":false,\"description\":\"Open search bar at startup (if not opened at startup it can opened on click on search button).\",\"type\":\"boolean\"},\"openeventinpinpoint\":{\"default\":false,\"description\":\"Open event inside the pinpoint view instead of opening new view\",\"type\":\"boolean\"},\"imageoperation\":{\"default\":{\"thumbnail\":\"fit\",\"sidebar\":\"fit\"},\"description\":\"Operation applied to the image by the backend\",\"properties\":{\"thumbnail\":{\"default\":\"fit\",\"description\":\"operation applied for images used in map thumbnails\",\"type\":\"string\",\"enum\":[\"contain\",\"fit\"]},\"sidebar\":{\"default\":\"fit\",\"description\":\"operation applied for images used in sidebar\",\"type\":\"string\",\"enum\":[\"contain\",\"fit\"]}},\"type\":\"object\"},\"openedsidebar\":{\"description\":\"Open sidebar by default on featured list or sources ('featured' or 'sources').\",\"enum\":[\"\",\"featured\",\"sources\"],\"default\":\"\",\"type\":\"string\"},\"pinpointopentype\":{\"description\":\"Defined how the pinpoint should be opened, if it opens from the sidebar or with a popin\",\"default\":\"sidebar\",\"enum\":[\"sidebar\",\"popin\"],\"type\":\"string\"},\"pitchenabled\":{\"description\":\"Allow user to pitching and bearing map\",\"type\":\"boolean\",\"default\":false},\"pitchstart\":{\"description\":\"initial pitch (tilt) of the map, measured in degrees away from the plane of the screen (0-60)\",\"type\":\"integer\",\"default\":0},\"pitchswitcherbutton\":{\"description\":\"Show a button to switch pitch\",\"type\":\"boolean\",\"default\":false},\"providersenabled\":{\"description\":\"Use providers to locate the user\",\"type\":\"boolean\",\"default\":true},\"metarouterurl\":{\"default\":null,\"description\":\"The meta router url to use\",\"type\":\"string\"},\"routingtype\":{\"default\":\"google\",\"description\":\"The provider to use for routing.\",\"enum\":[\"google\",\"deutsche-bahn\",\"osrm\",\"otp\",\"cityway\",\"idfm\",\"navitia\",\"tictactrip\"],\"type\":\"string\"},\"routingurl\":{\"default\":\"https://routing-osrm.getwemap.com\",\"description\":\"The root URL for the OSRM routing server.\",\"type\":\"string\"},\"routingmode\":{\"default\":\"driving\",\"description\":\"Mode of routing.\",\"enum\":[\"driving\",\"walking\",\"bike\",\"bus\",\"multi\"],\"type\":\"string\"},\"samewindow\":{\"default\":false,\"description\":\"Open links (from pinpoints descriptions or comments) in the same page.\",\"type\":\"boolean\"},\"scaninstructions\":{\"default\":\"\",\"description\":\"Instruction message displayed when the scan view is open.\",\"type\":\"string\"},\"scrollwheelzoom\":{\"default\":true,\"description\":\"Enable zoom using the scrollwheel.\",\"type\":\"boolean\"},\"searchcontrol\":{\"default\":true,\"description\":\"Show/hide search button.\",\"type\":\"boolean\"},\"searchparameters\":{\"default\":{\"geocoding\":true,\"region\":null,\"multilevel\":false,\"boundingbox\":null,\"extended\":false,\"sortbyname\":null,\"query_fields\":null,\"sortbydistance\":null},\"description\":\"Configuration relative to the search engine\",\"properties\":{\"extended\":{\"default\":false,\"description\":\"Extend search will search on bigger bounds even if results not empty\",\"type\":\"boolean\"},\"geocoding\":{\"default\":true,\"description\":\"Enable geocoding for search\",\"type\":\"boolean\"},\"multilevel\":{\"default\":false,\"description\":\"Enable search on all level instead of current level\",\"type\":\"boolean\"},\"region\":{\"default\":null,\"description\":\"Specify the region (country) in which the geocoding search should be done\",\"type\":\"string\"},\"sortbyname\":{\"default\":null,\"description\":\"Specify the sorting results method\",\"type\":\"string\",\"enum\":[\"ASC\",\"DESC\"]},\"query_fields\":{\"default\":null,\"description\":\"Specify fields to search on\",\"type\":\"string\"},\"sortbydistance\":{\"default\":false,\"description\":\"Specify the sorting results by distance\",\"type\":\"boolean\"},\"boundingbox\":{\"default\":null,\"description\":\"Limit results to only those contained within the supplied bounding box.\",\"properties\":{\"_northEast\":{\"properties\":{\"lat\":{\"description\":\"Latitude of upper-right's corner (northEast).\",\"title\":\"NorthEast latitude\",\"type\":\"number\"},\"lng\":{\"description\":\"Longitude of upper-right's corner (northEast).\",\"title\":\"NorthEast longitude\",\"type\":\"number\"}},\"required\":[\"lat\",\"lng\"],\"type\":\"object\"},\"_southWest\":{\"properties\":{\"lat\":{\"description\":\"Latitude of bottom-left's corner (southWest).\",\"title\":\"SouthWest latitude\",\"type\":\"number\"},\"lng\":{\"description\":\"Longitude of bottom-left's corner (southWest).\",\"title\":\"SouthWest longitude\",\"type\":\"number\"}},\"required\":[\"lat\",\"lng\"],\"type\":\"object\"}},\"required\":[\"_northEast\",\"_southWest\"],\"type\":\"object\"}},\"type\":\"object\"},\"searchplaceholder\":{\"default\":null,\"description\":\"Override search input placeholder.\",\"type\":\"object\"},\"searchclustertiles\":{\"default\":false,\"description\":\"If the search request should return clusters\",\"type\":\"boolean\"},\"seo\":{\"default\":null,\"description\":\"Configuration relative to the SEO.\",\"properties\":{\"bindPageTitleToOpenedEntity\":{\"default\":true,\"description\":\"Replace the page title by the name of the opened entity.\",\"type\":\"boolean\"},\"pageTitleBindingPrefix\":{\"default\":\"\",\"description\":\"When the page title is binded to the content, you can configure the base of the title with this parameter. The final page title will be the concatenation of this parameter and the opened entity name.\",\"type\":\"string\"},\"baseUrl\":{\"default\":\"\",\"description\":\"Base url for the SEO.\",\"type\":\"string\"},\"bindPageDescriptionToOpenedEntity\":{\"default\":true,\"description\":\"Replace the page description by the description of the opened entity.\",\"type\":\"boolean\"},\"bindSchemaToOpenedEntity\":{\"default\":true,\"description\":\"Generate the schema.org structure based on the opened content.\",\"type\":\"boolean\"}},\"type\":\"object\"},\"services\":{\"default\":{\"g7\":false,\"uber\":false,\"velib\":false},\"description\":\"Configuration relative to the external services.\",\"properties\":{\"g7\":{\"default\":false,\"description\":\"Use G7 services\",\"type\":\"boolean\"},\"uber\":{\"default\":false,\"description\":\"Use Uber services\",\"type\":\"boolean\"},\"velib\":{\"default\":false,\"description\":\"Use velib services\",\"type\":\"boolean\"}},\"type\":\"object\"},\"sharesnippet\":{\"default\":false,\"description\":\"Enables the sharing of livemaps (shows a button).\",\"type\":\"boolean\"},\"showaddress\":{\"default\":true,\"description\":\"Show pinpoint's address.\",\"type\":\"boolean\"},\"showauthor\":{\"default\":true,\"description\":\"Show pinpoint's author.\",\"type\":\"boolean\"},\"showfinishedeventscontrol\":{\"default\":true,\"description\":\"Display a checkbox to hide/show the finished events.\",\"type\":\"boolean\"},\"showmediainresults\":{\"default\":false,\"description\":\"Show/hide media in result list\",\"type\":\"boolean\"},\"showmultilevel\":{\"default\":{\"position\":false,\"itinerary\":false},\"description\":\"Show/hide element depending on current floor for a multilevel map\",\"properties\":{\"position\":{\"type\":\"boolean\",\"default\":false},\"itinerary\":{\"type\":\"boolean\",\"default\":false}},\"type\":\"object\"},\"showpinpointmedia\":{\"default\":true,\"description\":\"Show/hide media (picture or video) in pinpoint detailed description\",\"type\":\"boolean\"},\"showrelatedlists\":{\"default\":true,\"description\":\"Show the lists pinpoints belong to.\",\"type\":\"boolean\"},\"showrelativedate\":{\"default\":true,\"description\":\"Show pinpoint's relative creation date.\",\"type\":\"boolean\"},\"sidebarsforceopen\":{\"default\":[\"navigation\",\"direction\"],\"description\":\"Force sidebar to be opened even if parameter enablesidebar is set to false\",\"type\":\"array\",\"items\":{\"type\":\"string\",\"enum\":[\"pinpoint\",\"event\",\"lists\",\"multipoint\",\"sources\",\"navigation\"]}},\"stillswitch\":{\"default\":false,\"description\":\"Should the map stay still (in location) when switching emm ?\",\"type\":\"boolean\"},\"switcher\":{\"default\":null,\"description\":\"Switch between livemaps via theirs emmid.\",\"properties\":{\"direction\":{\"type\":\"string\"},\"items\":{\"items\":{\"properties\":{\"action\":{\"properties\":{\"type\":{\"emmid\":\"string\"}},\"type\":\"object\"},\"icon\":{\"properties\":{\"content\":{\"type\":\"string\"},\"place\":{\"type\":\"string\"},\"style\":{\"type\":\"object\"},\"type\":{\"type\":\"string\"}},\"type\":\"object\"},\"text\":{\"type\":\"string\"}},\"type\":\"object\"},\"type\":\"array\"},\"itemsStyle\":{\"type\":\"object\"},\"itemsStyleActive\":{\"type\":\"object\"},\"itemsStyleHover\":{\"type\":\"object\"},\"style\":{\"type\":\"object\"}},\"type\":\"object\"},\"tagsoverlap\":{\"default\":false,\"description\":\"Enable/disable OR/AND logic for tags filtering\",\"type\":\"boolean\"},\"tilesstyle\":{\"default\":\"https://tiles.getwemap.com/styles/wemap-v2-en/style.json\",\"description\":\"URL for the vector tiles style.\",\"type\":\"string\"},\"tilestoken\":{\"default\":null,\"description\":\"Token for the vector tiles style. (ex : using Mapbox Terrain, or Mapbox Satellite)\",\"type\":\"string\"},\"timecircle\":{\"default\":null,\"description\":\"Circle of distance to go in given time\",\"properties\":{\"type\":{\"type\":\"string\",\"default\":\"walk\"},\"time\":{\"type\":\"integer\",\"default\":300}},\"type\":\"object\"},\"uber\":{\"default\":false,\"description\":\"Add Uber to pinpoint petals.\",\"type\":\"boolean\"},\"useevents\":{\"default\":false,\"description\":\"Current map should use entities events or not.\",\"type\":\"boolean\"},\"usertour\":{\"type\":\"object\",\"default\":null,\"description\":\"Display a user tour at first start if enabled.\",\"properties\":{\"active\":{\"type\":\"boolean\",\"default\":true,\"description\":\"Enable or disable the user tour.\"},\"steps\":{\"type\":\"array\",\"default\":[],\"description\":\"Steps of the user tour.\",\"items\":{\"type\":\"object\",\"properties\":{\"type\":{\"type\":\"string\",\"description\":\"Type of the step\",\"enum\":[\"filterButton\",\"menuButton\",\"livebarButton\",\"pinpointPetals\",\"shareViewButton\",\"custom\"]},\"body\":{\"type\":\"string\",\"description\":\"Text of the step\"},\"selector\":{\"type\":\"string\",\"description\":\"Selector to get the element to point with this step.\"},\"routename\":{\"type\":\"string\",\"description\":\"Name of the route to navigate before displaying the step tooltip.\"},\"routeparams\":{\"type\":\"object\",\"description\":\"Parameters of the route to navigate before displaying the step tooltip.\",\"default\":{}},\"routequery\":{\"type\":\"object\",\"description\":\"Query of the route to navigate before displaying the step tooltip.\",\"default\":{}},\"maskstyle\":{\"type\":\"object\",\"description\":\"Inline CSS style to apply to the user tour mask when displaying this step.\"},\"visibility\":{\"type\":\"array\",\"items\":{\"type\":\"string\",\"enum\":[\"mobile\",\"desktop\",\"littlescreen\"]},\"default\":[\"mobile\",\"desktop\",\"littlescreen\"]}},\"required\":[\"type\"]}}}},\"tagrules\":{\"default\":[],\"description\":\"Rules to apply for tags\",\"items\":{\"type\":\"object\",\"properties\":{\"type\":{\"description\":\"Type of rule\",\"enum\":[\"search\",\"size\",\"featured-direction\"],\"type\":\"string\"},\"tags\":{\"description\":\"List of tags to apply the rule\",\"type\":\"array\",\"items\":{\"type\":\"string\"}},\"filteringLogic\":{\"description\":\"Logic to apply when filtering tags (OR or AND)\",\"type\":\"string\",\"enum\":[\"OR\",\"AND\"],\"default\":\"AND\"},\"minzoom\":{\"default\":null,\"description\":\"Min zoom to apply the rule\",\"type\":\"number\"},\"scale\":{\"default\":null,\"description\":\"Scale of pinpoint marker, use it with type 'size'\",\"type\":\"number\"},\"maxzoom\":{\"default\":null,\"description\":\"Max zoom to apply the rule\",\"type\":\"number\"}}},\"type\":\"array\"},\"usetags\":{\"anyOf\":[{\"type\":\"boolean\"},{\"properties\":{\"active\":{\"type\":\"boolean\"},\"filteringLogic\":{\"type\":\"string\",\"default\":\"DEFAULT\",\"enum\":[\"AND\",\"OR\",\"DEFAULT\"]},\"categories\":{\"items\":{\"properties\":{\"name\":{\"type\":\"string\"},\"slug\":{\"type\":\"string\"}},\"required\":[\"name\",\"slug\"],\"type\":\"object\"},\"type\":\"array\"},\"clickable\":{\"type\":\"boolean\"},\"tags\":{\"items\":{\"properties\":{\"category\":{\"type\":[\"boolean\",\"string\"]},\"name\":{\"type\":\"string\"},\"slug\":{\"type\":\"string\"},\"visibility\":{\"type\":\"string\"}},\"required\":[\"name\",\"slug\"],\"type\":\"object\"},\"type\":\"array\"}},\"type\":\"object\"}],\"description\":\"Show tags button in search bar, enable search by tags.\",\"type\":\"object\",\"default\":false},\"webgl\":{\"default\":true,\"description\":\"Force WEBGL livemap's rendering.\",\"type\":\"boolean\"},\"webworkerclustering\":{\"default\":false,\"description\":\"Process superclustering in a webworker\",\"type\":\"boolean\"},\"welcomebuttonlabel\":{\"default\":\"OK !\",\"description\":\"Welcome card button label.\",\"type\":\"string\"},\"zoomcontrol\":{\"default\":true,\"description\":\"Enable zoom control.\",\"type\":\"boolean\"}}"),
366
412
  type: "object"
367
- }, getArray = function(s, E) {
368
- let D = s;
369
- return isString(D) && (D = parseJSONSafely(D)), Array.isArray(D) ? D : E;
370
- }, getBoolean = function(s, E) {
371
- return isDefinedStrict(s) ? isString(s) ? (s = s.toLowerCase(), s === "true") : typeof s == "boolean" ? s : E : E;
372
- }, getInteger = function(s, E) {
373
- let D = Number(s);
374
- return isNaN(D) ? E : D;
375
- }, getFloat = function(s, E) {
376
- let D = Number(s);
377
- return isNaN(D) ? E : D;
378
- }, getObject = function(s) {
379
- let E = livemap_snippet_default.properties[s], D = SnippetParser.snippet[s];
380
- return isDefinedStrict(D) ? (isString(D) && (D = parseJSONSafely(D)), isObjectType(D) || (D = {}), D = SnippetParser.fillEmptyByDefault(D, "properties" in E ? E.properties : {}), D) : E.default;
413
+ }, T = function(e, t) {
414
+ let n = e;
415
+ return s(n) && (n = j(n)), Array.isArray(n) ? n : t;
416
+ }, E = function(e, t) {
417
+ return l(e) ? s(e) ? (e = e.toLowerCase(), e === "true") : typeof e == "boolean" ? e : t : t;
418
+ }, D = function(e, t) {
419
+ let n = Number(e);
420
+ return isNaN(n) ? t : n;
421
+ }, O = function(e, t) {
422
+ let n = Number(e);
423
+ return isNaN(n) ? t : n;
424
+ }, k = function(e) {
425
+ let t = w.properties[e], n = N.snippet[e];
426
+ return l(n) ? (s(n) && (n = j(n)), u(n) || (n = {}), n = N.fillEmptyByDefault(n, "properties" in t ? t.properties : {}), n) : t.default;
381
427
  };
382
- function getMaxBounds(E, D) {
383
- let O = parseJSONSafely(E);
384
- return O ? new BoundingBox(latLngLikeToCoordinates(O._northEast), latLngLikeToCoordinates(O._southWest)) : D;
428
+ function A(t, n) {
429
+ let r = j(t);
430
+ return r ? new e(g(r._northEast), g(r._southWest)) : n;
385
431
  }
386
- var parseJSONSafely = function(s) {
387
- if (!isString(s) || s === null) return s;
432
+ var j = function(e) {
433
+ if (!s(e) || e === null) return e;
388
434
  try {
389
435
  try {
390
- return JSON.parse(decodeURI(s));
436
+ return JSON.parse(decodeURI(e));
391
437
  } catch {
392
- return JSON.parse(decodeURIComponent(s));
438
+ return JSON.parse(decodeURIComponent(e));
393
439
  }
394
440
  } catch {
395
441
  return null;
396
442
  }
397
- }, getString = function(s, E) {
398
- return s == null || typeof s != "string" ? E : s;
399
- }, SnippetParser = class s {
443
+ }, M = function(e, t) {
444
+ return e == null || typeof e != "string" ? t : e;
445
+ }, N = class e {
400
446
  static snippet = {};
401
447
  static mapObject;
402
- static getProperty(E) {
403
- let D = livemap_snippet_default.properties[E];
404
- return D.type === "array" ? getArray(s.snippet[E], D.default) : D.type === "boolean" ? getBoolean(s.snippet[E], D.default) : D.type === "integer" ? getInteger(s.snippet[E], D.default) : D.type === "number" ? getFloat(s.snippet[E], D.default) : D.type === "string" ? getString(s.snippet[E], D.default) : D.type === "object" ? getObject(E) : null;
405
- }
406
- static fillEmptyByDefault(E, D) {
407
- let O = { ...E };
408
- return D && Object.keys(D).forEach((E) => {
409
- let k = D[E];
410
- O.hasOwnProperty(E) ? k.type === "object" ? O[E] = s.fillEmptyByDefault(O[E], k.properties) : k.type === "array" && k.hasOwnProperty("items") && k.items.hasOwnProperty("properties") && (O[E] = O[E].map((E) => s.fillEmptyByDefault(E, k.items.properties))) : k.hasOwnProperty("default") ? O[E] = k.default : k.type === "object" && (O[E] = s.fillEmptyByDefault(O[E], k.properties));
411
- }), O;
412
- }
413
- static parse(E) {
414
- return s.mapObject = E, s.snippet = E.snippet, {
415
- arNavigationData: s.getProperty("arnavigationdata"),
416
- aroundme: !!s.getProperty("aroundme"),
417
- deepLinkingEnabled: s.getProperty("deeplinkingenabled"),
418
- dragging: s.getProperty("dragging"),
419
- emmid: Number(s.mapObject.id),
420
- handleBearing: s.getProperty("handlebearing"),
421
- indoor: s.getProperty("indoor"),
422
- initialBounds: deltaToBounds(E),
423
- initialBearing: s.getProperty("initialbearing"),
424
- limit: Number(s.mapObject.count),
425
- locked: s.getProperty("locked"),
426
- maxBounds: getMaxBounds(s.snippet.maxbounds, defaultBounds),
427
- maxZoom: s.getProperty("maxzoom"),
428
- minZoom: s.getProperty("minzoom"),
429
- name: s.mapObject.name,
430
- pitchEnabled: s.getProperty("pitchenabled"),
431
- pitchStart: s.getProperty("pitchstart"),
432
- providersEnabled: s.getProperty("providersenabled"),
433
- routingMode: s.getProperty("routingmode"),
434
- routingType: s.getProperty("routingtype"),
435
- routingUrl: s.getProperty("routingurl"),
436
- scrollWheelZoom: s.getProperty("scrollwheelzoom"),
437
- tilesStyle: s.getProperty("tilesstyle")
448
+ static getProperty(t) {
449
+ let n = w.properties[t];
450
+ return n.type === "array" ? T(e.snippet[t], n.default) : n.type === "boolean" ? E(e.snippet[t], n.default) : n.type === "integer" ? D(e.snippet[t], n.default) : n.type === "number" ? O(e.snippet[t], n.default) : n.type === "string" ? M(e.snippet[t], n.default) : n.type === "object" ? k(t) : null;
451
+ }
452
+ static fillEmptyByDefault(t, n) {
453
+ let r = { ...t };
454
+ return n && Object.keys(n).forEach((t) => {
455
+ let i = n[t];
456
+ r.hasOwnProperty(t) ? i.type === "object" ? r[t] = e.fillEmptyByDefault(r[t], i.properties) : i.type === "array" && i.hasOwnProperty("items") && i.items.hasOwnProperty("properties") && (r[t] = r[t].map((t) => e.fillEmptyByDefault(t, i.items.properties))) : i.hasOwnProperty("default") ? r[t] = i.default : i.type === "object" && (r[t] = e.fillEmptyByDefault(r[t], i.properties));
457
+ }), r;
458
+ }
459
+ static parse(t) {
460
+ return e.mapObject = t, e.snippet = t.snippet, {
461
+ arNavigationData: e.getProperty("arnavigationdata"),
462
+ aroundme: !!e.getProperty("aroundme"),
463
+ deepLinkingEnabled: e.getProperty("deeplinkingenabled"),
464
+ dragging: e.getProperty("dragging"),
465
+ emmid: Number(e.mapObject.id),
466
+ handleBearing: e.getProperty("handlebearing"),
467
+ indoor: e.getProperty("indoor"),
468
+ initialBounds: m(t),
469
+ initialBearing: e.getProperty("initialbearing"),
470
+ limit: Number(e.mapObject.count),
471
+ locked: e.getProperty("locked"),
472
+ maxBounds: A(e.snippet.maxbounds, d),
473
+ maxZoom: e.getProperty("maxzoom"),
474
+ minZoom: e.getProperty("minzoom"),
475
+ name: e.mapObject.name,
476
+ pitchEnabled: e.getProperty("pitchenabled"),
477
+ pitchStart: e.getProperty("pitchstart"),
478
+ providersEnabled: e.getProperty("providersenabled"),
479
+ routingMode: e.getProperty("routingmode"),
480
+ routingType: e.getProperty("routingtype"),
481
+ routingUrl: e.getProperty("routingurl"),
482
+ scrollWheelZoom: e.getProperty("scrollwheelzoom"),
483
+ tilesStyle: e.getProperty("tilesstyle")
438
484
  };
439
485
  }
440
- };
441
- const DEFAULT_THEME = {
486
+ }, P = {
442
487
  colorPrimary: "#2f7de1",
443
488
  colorOnPrimary: "#ffffff",
444
489
  colorSurface: "#ffffff",
445
490
  colorOnSurface: "#1a1a1a"
446
491
  };
447
- function resolveTheme(s) {
492
+ function F(e) {
448
493
  return {
449
- ...DEFAULT_THEME,
450
- ...s ?? {}
494
+ ...P,
495
+ ...e ?? {}
451
496
  };
452
497
  }
453
- function themeToCssVariables(s) {
498
+ function I(e) {
454
499
  return {
455
- "--wemap-color-primary": s.colorPrimary,
456
- "--wemap-color-on-primary": s.colorOnPrimary,
457
- "--wemap-color-surface": s.colorSurface,
458
- "--wemap-color-on-surface": s.colorOnSurface
500
+ "--wemap-color-primary": e.colorPrimary,
501
+ "--wemap-color-on-primary": e.colorOnPrimary,
502
+ "--wemap-color-surface": e.colorSurface,
503
+ "--wemap-color-on-surface": e.colorOnSurface
459
504
  };
460
505
  }
461
- var CoreConfig = class s {
506
+ //#endregion
507
+ //#region src/CoreConfig.ts
508
+ var L = class e {
462
509
  static snippet;
463
- static theme = resolveTheme();
510
+ static theme = F();
464
511
  livemapService = null;
465
512
  env = "production";
466
513
  constructor() {}
467
514
  getBaseUrl() {
468
515
  return this.env === "production" ? "https://api.getwemap.com/v3.0" : "https://apidev.maaap.it/v3.0";
469
516
  }
470
- async init(E) {
471
- if (!E.emmid || !E.token) throw Error("emmid and token are required");
472
- this.env = E.env || "production", s.theme = resolveTheme(E.theme), this.livemapService = new LivemapService(this.getBaseUrl());
517
+ async init(t) {
518
+ if (!t.emmid || !t.token) throw Error("emmid and token are required");
519
+ this.env = t.env || "production", e.theme = F(t.theme);
520
+ let n = this.getBaseUrl();
521
+ this.livemapService = new i(n);
473
522
  try {
474
- let D = await this.livemapService.fetchLivemap(E.emmid);
475
- s.snippet = SnippetParser.parse(D);
476
- } catch (s) {
477
- throw console.error("Failed to initialize Core SDK:", s), s;
523
+ let n = await this.livemapService.fetchLivemap(t.emmid);
524
+ e.snippet = N.parse(n);
525
+ } catch (e) {
526
+ throw console.error("Failed to initialize Core SDK:", e), e;
478
527
  }
479
528
  }
480
529
  static getConfig() {
481
- return s.snippet || {};
530
+ return e.snippet || {};
482
531
  }
483
532
  static getIndoorOptions() {
484
- let E = s.getConfig().indoor;
533
+ let t = e.getConfig().indoor;
485
534
  return {
486
- enabled: E?.enable ?? !1,
487
- minZoom: E?.minZoom ?? 17
535
+ enabled: t?.enable ?? !1,
536
+ minZoom: t?.minZoom ?? 17
488
537
  };
489
538
  }
490
539
  static getMapOptions() {
491
- let E = s.getConfig();
540
+ let t = e.getConfig();
492
541
  return {
493
- style: E.tilesStyle,
494
- bounds: E.initialBounds,
495
- maxBounds: E.maxBounds,
496
- minZoom: E.minZoom,
497
- maxZoom: E.maxZoom,
498
- bearing: E.initialBearing,
499
- pitch: E.pitchStart,
500
- dragPan: E.dragging,
501
- dragRotate: E.pitchEnabled,
502
- pitchWithRotate: E.pitchEnabled,
503
- scrollZoom: E.scrollWheelZoom,
504
- interactive: !E.locked
542
+ style: t.tilesStyle,
543
+ bounds: t.initialBounds,
544
+ maxBounds: t.maxBounds,
545
+ minZoom: t.minZoom,
546
+ maxZoom: t.maxZoom,
547
+ bearing: t.initialBearing,
548
+ pitch: t.pitchStart,
549
+ dragPan: t.dragging,
550
+ dragRotate: t.pitchEnabled,
551
+ pitchWithRotate: t.pitchEnabled,
552
+ scrollZoom: t.scrollWheelZoom,
553
+ interactive: !t.locked
505
554
  };
506
555
  }
507
556
  static getTheme() {
508
- return s.theme;
557
+ return e.theme;
509
558
  }
510
559
  static getThemeCssVariables() {
511
- return themeToCssVariables(s.theme);
560
+ return I(e.theme);
512
561
  }
513
562
  createBuildingProvider() {
514
- let E = new BuildingService(this.getBaseUrl(), s.getConfig().emmid);
515
- return (s) => E.getBuildingsFromBbox(s);
563
+ let t = new a(this.getBaseUrl(), e.getConfig().emmid);
564
+ return (e) => t.getBuildingsFromBbox(e);
516
565
  }
517
566
  createPinpointManager() {
518
- return new PinpointManager(this.getBaseUrl(), s.getConfig().emmid);
567
+ return new b(this.getBaseUrl(), e.getConfig().emmid);
519
568
  }
520
- };
521
- const core = new CoreConfig();
522
- export { BuildingService, CoreConfig, DEFAULT_THEME, HttpClient, HttpError, LivemapService, PinpointManager, boundsToDelta, core, latLngLikeToCoordinates, resolveTheme, themeToCssVariables };
569
+ createGeocodingService(e) {
570
+ return new S(e);
571
+ }
572
+ }, R = new L();
573
+ //#endregion
574
+ export { a as BuildingService, L as CoreConfig, P as DEFAULT_THEME, x as GEOCODING_BASE_URL, S as GeocodingService, r as HttpClient, n as HttpError, i as LivemapService, b as PinpointManager, h as boundsToDelta, R as core, g as latLngLikeToCoordinates, F as resolveTheme, I as themeToCssVariables };