basemapkit 0.1.3 → 0.2.0

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.
@@ -1,5 +1,5 @@
1
- import { language_script_pairs as D, get_country_name as q, get_multiline_name as P } from "@protomaps/basemaps";
2
- const k = {
1
+ import { language_script_pairs as U, get_country_name as W, get_multiline_name as J } from "@protomaps/basemaps";
2
+ const x = {
3
3
  aliceblue: [240, 248, 255],
4
4
  antiquewhite: [250, 235, 215],
5
5
  aqua: [0, 255, 255],
@@ -148,110 +148,110 @@ const k = {
148
148
  whitesmoke: [245, 245, 245],
149
149
  yellow: [255, 255, 0],
150
150
  yellowgreen: [154, 205, 50]
151
- }, B = /* @__PURE__ */ Object.create(null);
152
- for (const n in k)
153
- Object.hasOwn(k, n) && (B[k[n]] = n);
154
- const y = {
151
+ }, Q = /* @__PURE__ */ Object.create(null);
152
+ for (const n in x)
153
+ Object.hasOwn(x, n) && (Q[x[n]] = n);
154
+ const g = {
155
155
  to: {},
156
156
  get: {}
157
157
  };
158
- y.get = function(n) {
158
+ g.get = function(n) {
159
159
  const e = n.slice(0, 3).toLowerCase();
160
- let t, o;
160
+ let t, i;
161
161
  switch (e) {
162
162
  case "hsl": {
163
- t = y.get.hsl(n), o = "hsl";
163
+ t = g.get.hsl(n), i = "hsl";
164
164
  break;
165
165
  }
166
166
  case "hwb": {
167
- t = y.get.hwb(n), o = "hwb";
167
+ t = g.get.hwb(n), i = "hwb";
168
168
  break;
169
169
  }
170
170
  default: {
171
- t = y.get.rgb(n), o = "rgb";
171
+ t = g.get.rgb(n), i = "rgb";
172
172
  break;
173
173
  }
174
174
  }
175
- return t ? { model: o, value: t } : null;
175
+ return t ? { model: i, value: t } : null;
176
176
  };
177
- y.get.rgb = function(n) {
177
+ g.get.rgb = function(n) {
178
178
  if (!n)
179
179
  return null;
180
- const e = /^#([a-f\d]{3,4})$/i, t = /^#([a-f\d]{6})([a-f\d]{2})?$/i, o = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, i = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, l = /^(\w+)$/;
180
+ const e = /^#([a-f\d]{3,4})$/i, t = /^#([a-f\d]{6})([a-f\d]{2})?$/i, i = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, o = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/, l = /^(\w+)$/;
181
181
  let r = [0, 0, 0, 1], a, s, u;
182
182
  if (a = n.match(t)) {
183
183
  for (u = a[2], a = a[1], s = 0; s < 3; s++) {
184
- const _ = s * 2;
185
- r[s] = Number.parseInt(a.slice(_, _ + 2), 16);
184
+ const y = s * 2;
185
+ r[s] = Number.parseInt(a.slice(y, y + 2), 16);
186
186
  }
187
187
  u && (r[3] = Number.parseInt(u, 16) / 255);
188
188
  } else if (a = n.match(e)) {
189
189
  for (a = a[1], u = a[3], s = 0; s < 3; s++)
190
190
  r[s] = Number.parseInt(a[s] + a[s], 16);
191
191
  u && (r[3] = Number.parseInt(u + u, 16) / 255);
192
- } else if (a = n.match(o)) {
192
+ } else if (a = n.match(i)) {
193
193
  for (s = 0; s < 3; s++)
194
194
  r[s] = Number.parseInt(a[s + 1], 10);
195
195
  a[4] && (r[3] = a[5] ? Number.parseFloat(a[4]) * 0.01 : Number.parseFloat(a[4]));
196
- } else if (a = n.match(i)) {
196
+ } else if (a = n.match(o)) {
197
197
  for (s = 0; s < 3; s++)
198
198
  r[s] = Math.round(Number.parseFloat(a[s + 1]) * 2.55);
199
199
  a[4] && (r[3] = a[5] ? Number.parseFloat(a[4]) * 0.01 : Number.parseFloat(a[4]));
200
- } else return (a = n.match(l)) ? a[1] === "transparent" ? [0, 0, 0, 0] : Object.hasOwn(k, a[1]) ? (r = k[a[1]], r[3] = 1, r) : null : null;
200
+ } else return (a = n.match(l)) ? a[1] === "transparent" ? [0, 0, 0, 0] : Object.hasOwn(x, a[1]) ? (r = x[a[1]], r[3] = 1, r) : null : null;
201
201
  for (s = 0; s < 3; s++)
202
- r[s] = z(r[s], 0, 255);
203
- return r[3] = z(r[3], 0, 1), r;
202
+ r[s] = B(r[s], 0, 255);
203
+ return r[3] = B(r[3], 0, 1), r;
204
204
  };
205
- y.get.hsl = function(n) {
205
+ g.get.hsl = function(n) {
206
206
  if (!n)
207
207
  return null;
208
208
  const e = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, t = n.match(e);
209
209
  if (t) {
210
- const o = Number.parseFloat(t[4]), i = (Number.parseFloat(t[1]) % 360 + 360) % 360, l = z(Number.parseFloat(t[2]), 0, 100), r = z(Number.parseFloat(t[3]), 0, 100), a = z(Number.isNaN(o) ? 1 : o, 0, 1);
211
- return [i, l, r, a];
210
+ const i = Number.parseFloat(t[4]), o = (Number.parseFloat(t[1]) % 360 + 360) % 360, l = B(Number.parseFloat(t[2]), 0, 100), r = B(Number.parseFloat(t[3]), 0, 100), a = B(Number.isNaN(i) ? 1 : i, 0, 1);
211
+ return [o, l, r, a];
212
212
  }
213
213
  return null;
214
214
  };
215
- y.get.hwb = function(n) {
215
+ g.get.hwb = function(n) {
216
216
  if (!n)
217
217
  return null;
218
218
  const e = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, t = n.match(e);
219
219
  if (t) {
220
- const o = Number.parseFloat(t[4]), i = (Number.parseFloat(t[1]) % 360 + 360) % 360, l = z(Number.parseFloat(t[2]), 0, 100), r = z(Number.parseFloat(t[3]), 0, 100), a = z(Number.isNaN(o) ? 1 : o, 0, 1);
221
- return [i, l, r, a];
220
+ const i = Number.parseFloat(t[4]), o = (Number.parseFloat(t[1]) % 360 + 360) % 360, l = B(Number.parseFloat(t[2]), 0, 100), r = B(Number.parseFloat(t[3]), 0, 100), a = B(Number.isNaN(i) ? 1 : i, 0, 1);
221
+ return [o, l, r, a];
222
222
  }
223
223
  return null;
224
224
  };
225
- y.to.hex = function(...n) {
225
+ g.to.hex = function(...n) {
226
226
  return "#" + A(n[0]) + A(n[1]) + A(n[2]) + (n[3] < 1 ? A(Math.round(n[3] * 255)) : "");
227
227
  };
228
- y.to.rgb = function(...n) {
228
+ g.to.rgb = function(...n) {
229
229
  return n.length < 4 || n[3] === 1 ? "rgb(" + Math.round(n[0]) + ", " + Math.round(n[1]) + ", " + Math.round(n[2]) + ")" : "rgba(" + Math.round(n[0]) + ", " + Math.round(n[1]) + ", " + Math.round(n[2]) + ", " + n[3] + ")";
230
230
  };
231
- y.to.rgb.percent = function(...n) {
232
- const e = Math.round(n[0] / 255 * 100), t = Math.round(n[1] / 255 * 100), o = Math.round(n[2] / 255 * 100);
233
- return n.length < 4 || n[3] === 1 ? "rgb(" + e + "%, " + t + "%, " + o + "%)" : "rgba(" + e + "%, " + t + "%, " + o + "%, " + n[3] + ")";
231
+ g.to.rgb.percent = function(...n) {
232
+ const e = Math.round(n[0] / 255 * 100), t = Math.round(n[1] / 255 * 100), i = Math.round(n[2] / 255 * 100);
233
+ return n.length < 4 || n[3] === 1 ? "rgb(" + e + "%, " + t + "%, " + i + "%)" : "rgba(" + e + "%, " + t + "%, " + i + "%, " + n[3] + ")";
234
234
  };
235
- y.to.hsl = function(...n) {
235
+ g.to.hsl = function(...n) {
236
236
  return n.length < 4 || n[3] === 1 ? "hsl(" + n[0] + ", " + n[1] + "%, " + n[2] + "%)" : "hsla(" + n[0] + ", " + n[1] + "%, " + n[2] + "%, " + n[3] + ")";
237
237
  };
238
- y.to.hwb = function(...n) {
238
+ g.to.hwb = function(...n) {
239
239
  let e = "";
240
240
  return n.length >= 4 && n[3] !== 1 && (e = ", " + n[3]), "hwb(" + n[0] + ", " + n[1] + "%, " + n[2] + "%" + e + ")";
241
241
  };
242
- y.to.keyword = function(...n) {
243
- return B[n.slice(0, 3)];
242
+ g.to.keyword = function(...n) {
243
+ return Q[n.slice(0, 3)];
244
244
  };
245
- function z(n, e, t) {
245
+ function B(n, e, t) {
246
246
  return Math.min(Math.max(e, n), t);
247
247
  }
248
248
  function A(n) {
249
249
  const e = Math.round(n).toString(16).toUpperCase();
250
250
  return e.length < 2 ? "0" + e : e;
251
251
  }
252
- const J = {};
253
- for (const n of Object.keys(k))
254
- J[k[n]] = n;
252
+ const X = {};
253
+ for (const n of Object.keys(x))
254
+ X[x[n]] = n;
255
255
  const c = {
256
256
  rgb: { channels: 3, labels: "rgb" },
257
257
  hsl: { channels: 3, labels: "hsl" },
@@ -270,12 +270,12 @@ const c = {
270
270
  hcg: { channels: 3, labels: ["h", "c", "g"] },
271
271
  apple: { channels: 3, labels: ["r16", "g16", "b16"] },
272
272
  gray: { channels: 1, labels: ["gray"] }
273
- }, w = (6 / 29) ** 3;
274
- function N(n) {
273
+ }, v = (6 / 29) ** 3;
274
+ function S(n) {
275
275
  const e = n > 31308e-7 ? 1.055 * n ** 0.4166666666666667 - 0.055 : n * 12.92;
276
276
  return Math.min(Math.max(0, e), 1);
277
277
  }
278
- function S(n) {
278
+ function C(n) {
279
279
  return n > 0.04045 ? ((n + 0.055) / 1.055) ** 2.4 : n / 12.92;
280
280
  }
281
281
  for (const n of Object.keys(c)) {
@@ -289,259 +289,259 @@ for (const n of Object.keys(c)) {
289
289
  delete c[n].channels, delete c[n].labels, Object.defineProperty(c[n], "channels", { value: e }), Object.defineProperty(c[n], "labels", { value: t });
290
290
  }
291
291
  c.rgb.hsl = function(n) {
292
- const e = n[0] / 255, t = n[1] / 255, o = n[2] / 255, i = Math.min(e, t, o), l = Math.max(e, t, o), r = l - i;
292
+ const e = n[0] / 255, t = n[1] / 255, i = n[2] / 255, o = Math.min(e, t, i), l = Math.max(e, t, i), r = l - o;
293
293
  let a, s;
294
294
  switch (l) {
295
- case i: {
295
+ case o: {
296
296
  a = 0;
297
297
  break;
298
298
  }
299
299
  case e: {
300
- a = (t - o) / r;
300
+ a = (t - i) / r;
301
301
  break;
302
302
  }
303
303
  case t: {
304
- a = 2 + (o - e) / r;
304
+ a = 2 + (i - e) / r;
305
305
  break;
306
306
  }
307
- case o: {
307
+ case i: {
308
308
  a = 4 + (e - t) / r;
309
309
  break;
310
310
  }
311
311
  }
312
312
  a = Math.min(a * 60, 360), a < 0 && (a += 360);
313
- const u = (i + l) / 2;
314
- return l === i ? s = 0 : u <= 0.5 ? s = r / (l + i) : s = r / (2 - l - i), [a, s * 100, u * 100];
313
+ const u = (o + l) / 2;
314
+ return l === o ? s = 0 : u <= 0.5 ? s = r / (l + o) : s = r / (2 - l - o), [a, s * 100, u * 100];
315
315
  };
316
316
  c.rgb.hsv = function(n) {
317
- let e, t, o, i, l;
318
- const r = n[0] / 255, a = n[1] / 255, s = n[2] / 255, u = Math.max(r, a, s), _ = u - Math.min(r, a, s), m = function(F) {
319
- return (u - F) / 6 / _ + 1 / 2;
317
+ let e, t, i, o, l;
318
+ const r = n[0] / 255, a = n[1] / 255, s = n[2] / 255, u = Math.max(r, a, s), y = u - Math.min(r, a, s), _ = function(N) {
319
+ return (u - N) / 6 / y + 1 / 2;
320
320
  };
321
- if (_ === 0)
322
- i = 0, l = 0;
321
+ if (y === 0)
322
+ o = 0, l = 0;
323
323
  else {
324
- switch (l = _ / u, e = m(r), t = m(a), o = m(s), u) {
324
+ switch (l = y / u, e = _(r), t = _(a), i = _(s), u) {
325
325
  case r: {
326
- i = o - t;
326
+ o = i - t;
327
327
  break;
328
328
  }
329
329
  case a: {
330
- i = 1 / 3 + e - o;
330
+ o = 1 / 3 + e - i;
331
331
  break;
332
332
  }
333
333
  case s: {
334
- i = 2 / 3 + t - e;
334
+ o = 2 / 3 + t - e;
335
335
  break;
336
336
  }
337
337
  }
338
- i < 0 ? i += 1 : i > 1 && (i -= 1);
338
+ o < 0 ? o += 1 : o > 1 && (o -= 1);
339
339
  }
340
340
  return [
341
- i * 360,
341
+ o * 360,
342
342
  l * 100,
343
343
  u * 100
344
344
  ];
345
345
  };
346
346
  c.rgb.hwb = function(n) {
347
347
  const e = n[0], t = n[1];
348
- let o = n[2];
349
- const i = c.rgb.hsl(n)[0], l = 1 / 255 * Math.min(e, Math.min(t, o));
350
- return o = 1 - 1 / 255 * Math.max(e, Math.max(t, o)), [i, l * 100, o * 100];
348
+ let i = n[2];
349
+ const o = c.rgb.hsl(n)[0], l = 1 / 255 * Math.min(e, Math.min(t, i));
350
+ return i = 1 - 1 / 255 * Math.max(e, Math.max(t, i)), [o, l * 100, i * 100];
351
351
  };
352
352
  c.rgb.oklab = function(n) {
353
- const e = S(n[0] / 255), t = S(n[1] / 255), o = S(n[2] / 255), i = Math.cbrt(0.4122214708 * e + 0.5363325363 * t + 0.0514459929 * o), l = Math.cbrt(0.2119034982 * e + 0.6806995451 * t + 0.1073969566 * o), r = Math.cbrt(0.0883024619 * e + 0.2817188376 * t + 0.6299787005 * o), a = 0.2104542553 * i + 0.793617785 * l - 0.0040720468 * r, s = 1.9779984951 * i - 2.428592205 * l + 0.4505937099 * r, u = 0.0259040371 * i + 0.7827717662 * l - 0.808675766 * r;
353
+ const e = C(n[0] / 255), t = C(n[1] / 255), i = C(n[2] / 255), o = Math.cbrt(0.4122214708 * e + 0.5363325363 * t + 0.0514459929 * i), l = Math.cbrt(0.2119034982 * e + 0.6806995451 * t + 0.1073969566 * i), r = Math.cbrt(0.0883024619 * e + 0.2817188376 * t + 0.6299787005 * i), a = 0.2104542553 * o + 0.793617785 * l - 0.0040720468 * r, s = 1.9779984951 * o - 2.428592205 * l + 0.4505937099 * r, u = 0.0259040371 * o + 0.7827717662 * l - 0.808675766 * r;
354
354
  return [a * 100, s * 100, u * 100];
355
355
  };
356
356
  c.rgb.cmyk = function(n) {
357
- const e = n[0] / 255, t = n[1] / 255, o = n[2] / 255, i = Math.min(1 - e, 1 - t, 1 - o), l = (1 - e - i) / (1 - i) || 0, r = (1 - t - i) / (1 - i) || 0, a = (1 - o - i) / (1 - i) || 0;
358
- return [l * 100, r * 100, a * 100, i * 100];
357
+ const e = n[0] / 255, t = n[1] / 255, i = n[2] / 255, o = Math.min(1 - e, 1 - t, 1 - i), l = (1 - e - o) / (1 - o) || 0, r = (1 - t - o) / (1 - o) || 0, a = (1 - i - o) / (1 - o) || 0;
358
+ return [l * 100, r * 100, a * 100, o * 100];
359
359
  };
360
- function V(n, e) {
360
+ function tn(n, e) {
361
361
  return (n[0] - e[0]) ** 2 + (n[1] - e[1]) ** 2 + (n[2] - e[2]) ** 2;
362
362
  }
363
363
  c.rgb.keyword = function(n) {
364
- const e = J[n];
364
+ const e = X[n];
365
365
  if (e)
366
366
  return e;
367
- let t = Number.POSITIVE_INFINITY, o;
368
- for (const i of Object.keys(k)) {
369
- const l = k[i], r = V(n, l);
370
- r < t && (t = r, o = i);
367
+ let t = Number.POSITIVE_INFINITY, i;
368
+ for (const o of Object.keys(x)) {
369
+ const l = x[o], r = tn(n, l);
370
+ r < t && (t = r, i = o);
371
371
  }
372
- return o;
372
+ return i;
373
373
  };
374
374
  c.keyword.rgb = function(n) {
375
- return k[n];
375
+ return x[n];
376
376
  };
377
377
  c.rgb.xyz = function(n) {
378
- const e = S(n[0] / 255), t = S(n[1] / 255), o = S(n[2] / 255), i = e * 0.4124564 + t * 0.3575761 + o * 0.1804375, l = e * 0.2126729 + t * 0.7151522 + o * 0.072175, r = e * 0.0193339 + t * 0.119192 + o * 0.9503041;
379
- return [i * 100, l * 100, r * 100];
378
+ const e = C(n[0] / 255), t = C(n[1] / 255), i = C(n[2] / 255), o = e * 0.4124564 + t * 0.3575761 + i * 0.1804375, l = e * 0.2126729 + t * 0.7151522 + i * 0.072175, r = e * 0.0193339 + t * 0.119192 + i * 0.9503041;
379
+ return [o * 100, l * 100, r * 100];
380
380
  };
381
381
  c.rgb.lab = function(n) {
382
382
  const e = c.rgb.xyz(n);
383
- let t = e[0], o = e[1], i = e[2];
384
- t /= 95.047, o /= 100, i /= 108.883, t = t > w ? t ** (1 / 3) : 7.787 * t + 16 / 116, o = o > w ? o ** (1 / 3) : 7.787 * o + 16 / 116, i = i > w ? i ** (1 / 3) : 7.787 * i + 16 / 116;
385
- const l = 116 * o - 16, r = 500 * (t - o), a = 200 * (o - i);
383
+ let t = e[0], i = e[1], o = e[2];
384
+ t /= 95.047, i /= 100, o /= 108.883, t = t > v ? t ** (1 / 3) : 7.787 * t + 16 / 116, i = i > v ? i ** (1 / 3) : 7.787 * i + 16 / 116, o = o > v ? o ** (1 / 3) : 7.787 * o + 16 / 116;
385
+ const l = 116 * i - 16, r = 500 * (t - i), a = 200 * (i - o);
386
386
  return [l, r, a];
387
387
  };
388
388
  c.hsl.rgb = function(n) {
389
- const e = n[0] / 360, t = n[1] / 100, o = n[2] / 100;
390
- let i, l;
389
+ const e = n[0] / 360, t = n[1] / 100, i = n[2] / 100;
390
+ let o, l;
391
391
  if (t === 0)
392
- return l = o * 255, [l, l, l];
393
- const r = o < 0.5 ? o * (1 + t) : o + t - o * t, a = 2 * o - r, s = [0, 0, 0];
392
+ return l = i * 255, [l, l, l];
393
+ const r = i < 0.5 ? i * (1 + t) : i + t - i * t, a = 2 * i - r, s = [0, 0, 0];
394
394
  for (let u = 0; u < 3; u++)
395
- i = e + 1 / 3 * -(u - 1), i < 0 && i++, i > 1 && i--, 6 * i < 1 ? l = a + (r - a) * 6 * i : 2 * i < 1 ? l = r : 3 * i < 2 ? l = a + (r - a) * (2 / 3 - i) * 6 : l = a, s[u] = l * 255;
395
+ o = e + 1 / 3 * -(u - 1), o < 0 && o++, o > 1 && o--, 6 * o < 1 ? l = a + (r - a) * 6 * o : 2 * o < 1 ? l = r : 3 * o < 2 ? l = a + (r - a) * (2 / 3 - o) * 6 : l = a, s[u] = l * 255;
396
396
  return s;
397
397
  };
398
398
  c.hsl.hsv = function(n) {
399
399
  const e = n[0];
400
- let t = n[1] / 100, o = n[2] / 100, i = t;
401
- const l = Math.max(o, 0.01);
402
- o *= 2, t *= o <= 1 ? o : 2 - o, i *= l <= 1 ? l : 2 - l;
403
- const r = (o + t) / 2, a = o === 0 ? 2 * i / (l + i) : 2 * t / (o + t);
400
+ let t = n[1] / 100, i = n[2] / 100, o = t;
401
+ const l = Math.max(i, 0.01);
402
+ i *= 2, t *= i <= 1 ? i : 2 - i, o *= l <= 1 ? l : 2 - l;
403
+ const r = (i + t) / 2, a = i === 0 ? 2 * o / (l + o) : 2 * t / (i + t);
404
404
  return [e, a * 100, r * 100];
405
405
  };
406
406
  c.hsv.rgb = function(n) {
407
407
  const e = n[0] / 60, t = n[1] / 100;
408
- let o = n[2] / 100;
409
- const i = Math.floor(e) % 6, l = e - Math.floor(e), r = 255 * o * (1 - t), a = 255 * o * (1 - t * l), s = 255 * o * (1 - t * (1 - l));
410
- switch (o *= 255, i) {
408
+ let i = n[2] / 100;
409
+ const o = Math.floor(e) % 6, l = e - Math.floor(e), r = 255 * i * (1 - t), a = 255 * i * (1 - t * l), s = 255 * i * (1 - t * (1 - l));
410
+ switch (i *= 255, o) {
411
411
  case 0:
412
- return [o, s, r];
412
+ return [i, s, r];
413
413
  case 1:
414
- return [a, o, r];
414
+ return [a, i, r];
415
415
  case 2:
416
- return [r, o, s];
416
+ return [r, i, s];
417
417
  case 3:
418
- return [r, a, o];
418
+ return [r, a, i];
419
419
  case 4:
420
- return [s, r, o];
420
+ return [s, r, i];
421
421
  case 5:
422
- return [o, r, a];
422
+ return [i, r, a];
423
423
  }
424
424
  };
425
425
  c.hsv.hsl = function(n) {
426
- const e = n[0], t = n[1] / 100, o = n[2] / 100, i = Math.max(o, 0.01);
426
+ const e = n[0], t = n[1] / 100, i = n[2] / 100, o = Math.max(i, 0.01);
427
427
  let l, r;
428
- r = (2 - t) * o;
429
- const a = (2 - t) * i;
430
- return l = t * i, l /= a <= 1 ? a : 2 - a, l = l || 0, r /= 2, [e, l * 100, r * 100];
428
+ r = (2 - t) * i;
429
+ const a = (2 - t) * o;
430
+ return l = t * o, l /= a <= 1 ? a : 2 - a, l = l || 0, r /= 2, [e, l * 100, r * 100];
431
431
  };
432
432
  c.hwb.rgb = function(n) {
433
433
  const e = n[0] / 360;
434
- let t = n[1] / 100, o = n[2] / 100;
435
- const i = t + o;
434
+ let t = n[1] / 100, i = n[2] / 100;
435
+ const o = t + i;
436
436
  let l;
437
- i > 1 && (t /= i, o /= i);
438
- const r = Math.floor(6 * e), a = 1 - o;
437
+ o > 1 && (t /= o, i /= o);
438
+ const r = Math.floor(6 * e), a = 1 - i;
439
439
  l = 6 * e - r, (r & 1) !== 0 && (l = 1 - l);
440
440
  const s = t + l * (a - t);
441
- let u, _, m;
441
+ let u, y, _;
442
442
  switch (r) {
443
443
  default:
444
444
  case 6:
445
445
  case 0: {
446
- u = a, _ = s, m = t;
446
+ u = a, y = s, _ = t;
447
447
  break;
448
448
  }
449
449
  case 1: {
450
- u = s, _ = a, m = t;
450
+ u = s, y = a, _ = t;
451
451
  break;
452
452
  }
453
453
  case 2: {
454
- u = t, _ = a, m = s;
454
+ u = t, y = a, _ = s;
455
455
  break;
456
456
  }
457
457
  case 3: {
458
- u = t, _ = s, m = a;
458
+ u = t, y = s, _ = a;
459
459
  break;
460
460
  }
461
461
  case 4: {
462
- u = s, _ = t, m = a;
462
+ u = s, y = t, _ = a;
463
463
  break;
464
464
  }
465
465
  case 5: {
466
- u = a, _ = t, m = s;
466
+ u = a, y = t, _ = s;
467
467
  break;
468
468
  }
469
469
  }
470
- return [u * 255, _ * 255, m * 255];
470
+ return [u * 255, y * 255, _ * 255];
471
471
  };
472
472
  c.cmyk.rgb = function(n) {
473
- const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = n[3] / 100, l = 1 - Math.min(1, e * (1 - i) + i), r = 1 - Math.min(1, t * (1 - i) + i), a = 1 - Math.min(1, o * (1 - i) + i);
473
+ const e = n[0] / 100, t = n[1] / 100, i = n[2] / 100, o = n[3] / 100, l = 1 - Math.min(1, e * (1 - o) + o), r = 1 - Math.min(1, t * (1 - o) + o), a = 1 - Math.min(1, i * (1 - o) + o);
474
474
  return [l * 255, r * 255, a * 255];
475
475
  };
476
476
  c.xyz.rgb = function(n) {
477
- const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100;
478
- let i, l, r;
479
- return i = e * 3.2404542 + t * -1.5371385 + o * -0.4985314, l = e * -0.969266 + t * 1.8760108 + o * 0.041556, r = e * 0.0556434 + t * -0.2040259 + o * 1.0572252, i = N(i), l = N(l), r = N(r), [i * 255, l * 255, r * 255];
477
+ const e = n[0] / 100, t = n[1] / 100, i = n[2] / 100;
478
+ let o, l, r;
479
+ return o = e * 3.2404542 + t * -1.5371385 + i * -0.4985314, l = e * -0.969266 + t * 1.8760108 + i * 0.041556, r = e * 0.0556434 + t * -0.2040259 + i * 1.0572252, o = S(o), l = S(l), r = S(r), [o * 255, l * 255, r * 255];
480
480
  };
481
481
  c.xyz.lab = function(n) {
482
- let e = n[0], t = n[1], o = n[2];
483
- e /= 95.047, t /= 100, o /= 108.883, e = e > w ? e ** (1 / 3) : 7.787 * e + 16 / 116, t = t > w ? t ** (1 / 3) : 7.787 * t + 16 / 116, o = o > w ? o ** (1 / 3) : 7.787 * o + 16 / 116;
484
- const i = 116 * t - 16, l = 500 * (e - t), r = 200 * (t - o);
485
- return [i, l, r];
482
+ let e = n[0], t = n[1], i = n[2];
483
+ e /= 95.047, t /= 100, i /= 108.883, e = e > v ? e ** (1 / 3) : 7.787 * e + 16 / 116, t = t > v ? t ** (1 / 3) : 7.787 * t + 16 / 116, i = i > v ? i ** (1 / 3) : 7.787 * i + 16 / 116;
484
+ const o = 116 * t - 16, l = 500 * (e - t), r = 200 * (t - i);
485
+ return [o, l, r];
486
486
  };
487
487
  c.xyz.oklab = function(n) {
488
- const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = Math.cbrt(0.8189330101 * e + 0.3618667424 * t - 0.1288597137 * o), l = Math.cbrt(0.0329845436 * e + 0.9293118715 * t + 0.0361456387 * o), r = Math.cbrt(0.0482003018 * e + 0.2643662691 * t + 0.633851707 * o), a = 0.2104542553 * i + 0.793617785 * l - 0.0040720468 * r, s = 1.9779984951 * i - 2.428592205 * l + 0.4505937099 * r, u = 0.0259040371 * i + 0.7827717662 * l - 0.808675766 * r;
488
+ const e = n[0] / 100, t = n[1] / 100, i = n[2] / 100, o = Math.cbrt(0.8189330101 * e + 0.3618667424 * t - 0.1288597137 * i), l = Math.cbrt(0.0329845436 * e + 0.9293118715 * t + 0.0361456387 * i), r = Math.cbrt(0.0482003018 * e + 0.2643662691 * t + 0.633851707 * i), a = 0.2104542553 * o + 0.793617785 * l - 0.0040720468 * r, s = 1.9779984951 * o - 2.428592205 * l + 0.4505937099 * r, u = 0.0259040371 * o + 0.7827717662 * l - 0.808675766 * r;
489
489
  return [a * 100, s * 100, u * 100];
490
490
  };
491
491
  c.oklab.oklch = function(n) {
492
492
  return c.lab.lch(n);
493
493
  };
494
494
  c.oklab.xyz = function(n) {
495
- const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = (0.999999998 * e + 0.396337792 * t + 0.215803758 * o) ** 3, l = (1.000000008 * e - 0.105561342 * t - 0.063854175 * o) ** 3, r = (1.000000055 * e - 0.089484182 * t - 1.291485538 * o) ** 3, a = 1.227013851 * i - 0.55779998 * l + 0.281256149 * r, s = -0.040580178 * i + 1.11225687 * l - 0.071676679 * r, u = -0.076381285 * i - 0.421481978 * l + 1.58616322 * r;
495
+ const e = n[0] / 100, t = n[1] / 100, i = n[2] / 100, o = (0.999999998 * e + 0.396337792 * t + 0.215803758 * i) ** 3, l = (1.000000008 * e - 0.105561342 * t - 0.063854175 * i) ** 3, r = (1.000000055 * e - 0.089484182 * t - 1.291485538 * i) ** 3, a = 1.227013851 * o - 0.55779998 * l + 0.281256149 * r, s = -0.040580178 * o + 1.11225687 * l - 0.071676679 * r, u = -0.076381285 * o - 0.421481978 * l + 1.58616322 * r;
496
496
  return [a * 100, s * 100, u * 100];
497
497
  };
498
498
  c.oklab.rgb = function(n) {
499
- const e = n[0] / 100, t = n[1] / 100, o = n[2] / 100, i = (e + 0.3963377774 * t + 0.2158037573 * o) ** 3, l = (e - 0.1055613458 * t - 0.0638541728 * o) ** 3, r = (e - 0.0894841775 * t - 1.291485548 * o) ** 3, a = N(4.0767416621 * i - 3.3077115913 * l + 0.2309699292 * r), s = N(-1.2684380046 * i + 2.6097574011 * l - 0.3413193965 * r), u = N(-0.0041960863 * i - 0.7034186147 * l + 1.707614701 * r);
499
+ const e = n[0] / 100, t = n[1] / 100, i = n[2] / 100, o = (e + 0.3963377774 * t + 0.2158037573 * i) ** 3, l = (e - 0.1055613458 * t - 0.0638541728 * i) ** 3, r = (e - 0.0894841775 * t - 1.291485548 * i) ** 3, a = S(4.0767416621 * o - 3.3077115913 * l + 0.2309699292 * r), s = S(-1.2684380046 * o + 2.6097574011 * l - 0.3413193965 * r), u = S(-0.0041960863 * o - 0.7034186147 * l + 1.707614701 * r);
500
500
  return [a * 255, s * 255, u * 255];
501
501
  };
502
502
  c.oklch.oklab = function(n) {
503
503
  return c.lch.lab(n);
504
504
  };
505
505
  c.lab.xyz = function(n) {
506
- const e = n[0], t = n[1], o = n[2];
507
- let i, l, r;
508
- l = (e + 16) / 116, i = t / 500 + l, r = l - o / 200;
509
- const a = l ** 3, s = i ** 3, u = r ** 3;
510
- return l = a > w ? a : (l - 16 / 116) / 7.787, i = s > w ? s : (i - 16 / 116) / 7.787, r = u > w ? u : (r - 16 / 116) / 7.787, i *= 95.047, l *= 100, r *= 108.883, [i, l, r];
506
+ const e = n[0], t = n[1], i = n[2];
507
+ let o, l, r;
508
+ l = (e + 16) / 116, o = t / 500 + l, r = l - i / 200;
509
+ const a = l ** 3, s = o ** 3, u = r ** 3;
510
+ return l = a > v ? a : (l - 16 / 116) / 7.787, o = s > v ? s : (o - 16 / 116) / 7.787, r = u > v ? u : (r - 16 / 116) / 7.787, o *= 95.047, l *= 100, r *= 108.883, [o, l, r];
511
511
  };
512
512
  c.lab.lch = function(n) {
513
- const e = n[0], t = n[1], o = n[2];
514
- let i;
515
- i = Math.atan2(o, t) * 360 / 2 / Math.PI, i < 0 && (i += 360);
516
- const r = Math.sqrt(t * t + o * o);
517
- return [e, r, i];
513
+ const e = n[0], t = n[1], i = n[2];
514
+ let o;
515
+ o = Math.atan2(i, t) * 360 / 2 / Math.PI, o < 0 && (o += 360);
516
+ const r = Math.sqrt(t * t + i * i);
517
+ return [e, r, o];
518
518
  };
519
519
  c.lch.lab = function(n) {
520
- const e = n[0], t = n[1], i = n[2] / 360 * 2 * Math.PI, l = t * Math.cos(i), r = t * Math.sin(i);
520
+ const e = n[0], t = n[1], o = n[2] / 360 * 2 * Math.PI, l = t * Math.cos(o), r = t * Math.sin(o);
521
521
  return [e, l, r];
522
522
  };
523
523
  c.rgb.ansi16 = function(n, e = null) {
524
- const [t, o, i] = n;
524
+ const [t, i, o] = n;
525
525
  let l = e === null ? c.rgb.hsv(n)[2] : e;
526
526
  if (l = Math.round(l / 50), l === 0)
527
527
  return 30;
528
- let r = 30 + (Math.round(i / 255) << 2 | Math.round(o / 255) << 1 | Math.round(t / 255));
528
+ let r = 30 + (Math.round(o / 255) << 2 | Math.round(i / 255) << 1 | Math.round(t / 255));
529
529
  return l === 2 && (r += 60), r;
530
530
  };
531
531
  c.hsv.ansi16 = function(n) {
532
532
  return c.rgb.ansi16(c.hsv.rgb(n), n[2]);
533
533
  };
534
534
  c.rgb.ansi256 = function(n) {
535
- const e = n[0], t = n[1], o = n[2];
536
- return e >> 4 === t >> 4 && t >> 4 === o >> 4 ? e < 8 ? 16 : e > 248 ? 231 : Math.round((e - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(e / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(o / 255 * 5);
535
+ const e = n[0], t = n[1], i = n[2];
536
+ return e >> 4 === t >> 4 && t >> 4 === i >> 4 ? e < 8 ? 16 : e > 248 ? 231 : Math.round((e - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(e / 255 * 5) + 6 * Math.round(t / 255 * 5) + Math.round(i / 255 * 5);
537
537
  };
538
538
  c.ansi16.rgb = function(n) {
539
539
  n = n[0];
540
540
  let e = n % 10;
541
541
  if (e === 0 || e === 7)
542
542
  return n > 50 && (e += 3.5), e = e / 10.5 * 255, [e, e, e];
543
- const t = (Math.trunc(n > 50) + 1) * 0.5, o = (e & 1) * t * 255, i = (e >> 1 & 1) * t * 255, l = (e >> 2 & 1) * t * 255;
544
- return [o, i, l];
543
+ const t = (Math.trunc(n > 50) + 1) * 0.5, i = (e & 1) * t * 255, o = (e >> 1 & 1) * t * 255, l = (e >> 2 & 1) * t * 255;
544
+ return [i, o, l];
545
545
  };
546
546
  c.ansi256.rgb = function(n) {
547
547
  if (n = n[0], n >= 232) {
@@ -550,8 +550,8 @@ c.ansi256.rgb = function(n) {
550
550
  }
551
551
  n -= 16;
552
552
  let e;
553
- const t = Math.floor(n / 36) / 5 * 255, o = Math.floor((e = n % 36) / 6) / 5 * 255, i = e % 6 / 5 * 255;
554
- return [t, o, i];
553
+ const t = Math.floor(n / 36) / 5 * 255, i = Math.floor((e = n % 36) / 6) / 5 * 255, o = e % 6 / 5 * 255;
554
+ return [t, i, o];
555
555
  };
556
556
  c.rgb.hex = function(n) {
557
557
  const t = (((Math.round(n[0]) & 255) << 16) + ((Math.round(n[1]) & 255) << 8) + (Math.round(n[2]) & 255)).toString(16).toUpperCase();
@@ -563,79 +563,79 @@ c.hex.rgb = function(n) {
563
563
  return [0, 0, 0];
564
564
  let t = e[0];
565
565
  e[0].length === 3 && (t = [...t].map((a) => a + a).join(""));
566
- const o = Number.parseInt(t, 16), i = o >> 16 & 255, l = o >> 8 & 255, r = o & 255;
567
- return [i, l, r];
566
+ const i = Number.parseInt(t, 16), o = i >> 16 & 255, l = i >> 8 & 255, r = i & 255;
567
+ return [o, l, r];
568
568
  };
569
569
  c.rgb.hcg = function(n) {
570
- const e = n[0] / 255, t = n[1] / 255, o = n[2] / 255, i = Math.max(Math.max(e, t), o), l = Math.min(Math.min(e, t), o), r = i - l;
570
+ const e = n[0] / 255, t = n[1] / 255, i = n[2] / 255, o = Math.max(Math.max(e, t), i), l = Math.min(Math.min(e, t), i), r = o - l;
571
571
  let a;
572
572
  const s = r < 1 ? l / (1 - r) : 0;
573
- return r <= 0 ? a = 0 : i === e ? a = (t - o) / r % 6 : i === t ? a = 2 + (o - e) / r : a = 4 + (e - t) / r, a /= 6, a %= 1, [a * 360, r * 100, s * 100];
573
+ return r <= 0 ? a = 0 : o === e ? a = (t - i) / r % 6 : o === t ? a = 2 + (i - e) / r : a = 4 + (e - t) / r, a /= 6, a %= 1, [a * 360, r * 100, s * 100];
574
574
  };
575
575
  c.hsl.hcg = function(n) {
576
- const e = n[1] / 100, t = n[2] / 100, o = t < 0.5 ? 2 * e * t : 2 * e * (1 - t);
577
- let i = 0;
578
- return o < 1 && (i = (t - 0.5 * o) / (1 - o)), [n[0], o * 100, i * 100];
576
+ const e = n[1] / 100, t = n[2] / 100, i = t < 0.5 ? 2 * e * t : 2 * e * (1 - t);
577
+ let o = 0;
578
+ return i < 1 && (o = (t - 0.5 * i) / (1 - i)), [n[0], i * 100, o * 100];
579
579
  };
580
580
  c.hsv.hcg = function(n) {
581
- const e = n[1] / 100, t = n[2] / 100, o = e * t;
582
- let i = 0;
583
- return o < 1 && (i = (t - o) / (1 - o)), [n[0], o * 100, i * 100];
581
+ const e = n[1] / 100, t = n[2] / 100, i = e * t;
582
+ let o = 0;
583
+ return i < 1 && (o = (t - i) / (1 - i)), [n[0], i * 100, o * 100];
584
584
  };
585
585
  c.hcg.rgb = function(n) {
586
- const e = n[0] / 360, t = n[1] / 100, o = n[2] / 100;
586
+ const e = n[0] / 360, t = n[1] / 100, i = n[2] / 100;
587
587
  if (t === 0)
588
- return [o * 255, o * 255, o * 255];
589
- const i = [0, 0, 0], l = e % 1 * 6, r = l % 1, a = 1 - r;
588
+ return [i * 255, i * 255, i * 255];
589
+ const o = [0, 0, 0], l = e % 1 * 6, r = l % 1, a = 1 - r;
590
590
  let s = 0;
591
591
  switch (Math.floor(l)) {
592
592
  case 0: {
593
- i[0] = 1, i[1] = r, i[2] = 0;
593
+ o[0] = 1, o[1] = r, o[2] = 0;
594
594
  break;
595
595
  }
596
596
  case 1: {
597
- i[0] = a, i[1] = 1, i[2] = 0;
597
+ o[0] = a, o[1] = 1, o[2] = 0;
598
598
  break;
599
599
  }
600
600
  case 2: {
601
- i[0] = 0, i[1] = 1, i[2] = r;
601
+ o[0] = 0, o[1] = 1, o[2] = r;
602
602
  break;
603
603
  }
604
604
  case 3: {
605
- i[0] = 0, i[1] = a, i[2] = 1;
605
+ o[0] = 0, o[1] = a, o[2] = 1;
606
606
  break;
607
607
  }
608
608
  case 4: {
609
- i[0] = r, i[1] = 0, i[2] = 1;
609
+ o[0] = r, o[1] = 0, o[2] = 1;
610
610
  break;
611
611
  }
612
612
  default:
613
- i[0] = 1, i[1] = 0, i[2] = a;
613
+ o[0] = 1, o[1] = 0, o[2] = a;
614
614
  }
615
- return s = (1 - t) * o, [
616
- (t * i[0] + s) * 255,
617
- (t * i[1] + s) * 255,
618
- (t * i[2] + s) * 255
615
+ return s = (1 - t) * i, [
616
+ (t * o[0] + s) * 255,
617
+ (t * o[1] + s) * 255,
618
+ (t * o[2] + s) * 255
619
619
  ];
620
620
  };
621
621
  c.hcg.hsv = function(n) {
622
- const e = n[1] / 100, t = n[2] / 100, o = e + t * (1 - e);
623
- let i = 0;
624
- return o > 0 && (i = e / o), [n[0], i * 100, o * 100];
622
+ const e = n[1] / 100, t = n[2] / 100, i = e + t * (1 - e);
623
+ let o = 0;
624
+ return i > 0 && (o = e / i), [n[0], o * 100, i * 100];
625
625
  };
626
626
  c.hcg.hsl = function(n) {
627
- const e = n[1] / 100, o = n[2] / 100 * (1 - e) + 0.5 * e;
628
- let i = 0;
629
- return o > 0 && o < 0.5 ? i = e / (2 * o) : o >= 0.5 && o < 1 && (i = e / (2 * (1 - o))), [n[0], i * 100, o * 100];
627
+ const e = n[1] / 100, i = n[2] / 100 * (1 - e) + 0.5 * e;
628
+ let o = 0;
629
+ return i > 0 && i < 0.5 ? o = e / (2 * i) : i >= 0.5 && i < 1 && (o = e / (2 * (1 - i))), [n[0], o * 100, i * 100];
630
630
  };
631
631
  c.hcg.hwb = function(n) {
632
- const e = n[1] / 100, t = n[2] / 100, o = e + t * (1 - e);
633
- return [n[0], (o - e) * 100, (1 - o) * 100];
632
+ const e = n[1] / 100, t = n[2] / 100, i = e + t * (1 - e);
633
+ return [n[0], (i - e) * 100, (1 - i) * 100];
634
634
  };
635
635
  c.hwb.hcg = function(n) {
636
- const e = n[1] / 100, o = 1 - n[2] / 100, i = o - e;
636
+ const e = n[1] / 100, i = 1 - n[2] / 100, o = i - e;
637
637
  let l = 0;
638
- return i < 1 && (l = (o - i) / (1 - i)), [n[0], i * 100, l * 100];
638
+ return o < 1 && (l = (i - o) / (1 - o)), [n[0], o * 100, l * 100];
639
639
  };
640
640
  c.apple.rgb = function(n) {
641
641
  return [n[0] / 65535 * 255, n[1] / 65535 * 255, n[2] / 65535 * 255];
@@ -660,16 +660,16 @@ c.gray.lab = function(n) {
660
660
  return [n[0], 0, 0];
661
661
  };
662
662
  c.gray.hex = function(n) {
663
- const e = Math.round(n[0] / 100 * 255) & 255, o = ((e << 16) + (e << 8) + e).toString(16).toUpperCase();
664
- return "000000".slice(o.length) + o;
663
+ const e = Math.round(n[0] / 100 * 255) & 255, i = ((e << 16) + (e << 8) + e).toString(16).toUpperCase();
664
+ return "000000".slice(i.length) + i;
665
665
  };
666
666
  c.rgb.gray = function(n) {
667
667
  return [(n[0] + n[1] + n[2]) / 3 / 255 * 100];
668
668
  };
669
- function Q() {
669
+ function on() {
670
670
  const n = {}, e = Object.keys(c);
671
- for (let { length: t } = e, o = 0; o < t; o++)
672
- n[e[o]] = {
671
+ for (let { length: t } = e, i = 0; i < t; i++)
672
+ n[e[i]] = {
673
673
  // http://jsperf.com/1-vs-infinity
674
674
  // micro-opt, but this is simple.
675
675
  distance: -1,
@@ -677,97 +677,97 @@ function Q() {
677
677
  };
678
678
  return n;
679
679
  }
680
- function X(n) {
681
- const e = Q(), t = [n];
680
+ function rn(n) {
681
+ const e = on(), t = [n];
682
682
  for (e[n].distance = 0; t.length > 0; ) {
683
- const o = t.pop(), i = Object.keys(c[o]);
684
- for (let { length: l } = i, r = 0; r < l; r++) {
685
- const a = i[r], s = e[a];
686
- s.distance === -1 && (s.distance = e[o].distance + 1, s.parent = o, t.unshift(a));
683
+ const i = t.pop(), o = Object.keys(c[i]);
684
+ for (let { length: l } = o, r = 0; r < l; r++) {
685
+ const a = o[r], s = e[a];
686
+ s.distance === -1 && (s.distance = e[i].distance + 1, s.parent = i, t.unshift(a));
687
687
  }
688
688
  }
689
689
  return e;
690
690
  }
691
- function Z(n, e) {
691
+ function ln(n, e) {
692
692
  return function(t) {
693
693
  return e(n(t));
694
694
  };
695
695
  }
696
- function nn(n, e) {
696
+ function an(n, e) {
697
697
  const t = [e[n].parent, n];
698
- let o = c[e[n].parent][n], i = e[n].parent;
699
- for (; e[i].parent; )
700
- t.unshift(e[i].parent), o = Z(c[e[i].parent][i], o), i = e[i].parent;
701
- return o.conversion = t, o;
698
+ let i = c[e[n].parent][n], o = e[n].parent;
699
+ for (; e[o].parent; )
700
+ t.unshift(e[o].parent), i = ln(c[e[o].parent][o], i), o = e[o].parent;
701
+ return i.conversion = t, i;
702
702
  }
703
- function en(n) {
704
- const e = X(n), t = {}, o = Object.keys(e);
705
- for (let { length: i } = o, l = 0; l < i; l++) {
706
- const r = o[l];
707
- e[r].parent !== null && (t[r] = nn(r, e));
703
+ function sn(n) {
704
+ const e = rn(n), t = {}, i = Object.keys(e);
705
+ for (let { length: o } = i, l = 0; l < o; l++) {
706
+ const r = i[l];
707
+ e[r].parent !== null && (t[r] = an(r, e));
708
708
  }
709
709
  return t;
710
710
  }
711
- const b = {}, tn = Object.keys(c);
712
- function on(n) {
711
+ const m = {}, cn = Object.keys(c);
712
+ function un(n) {
713
713
  const e = function(...t) {
714
- const o = t[0];
715
- return o == null ? o : (o.length > 1 && (t = o), n(t));
714
+ const i = t[0];
715
+ return i == null ? i : (i.length > 1 && (t = i), n(t));
716
716
  };
717
717
  return "conversion" in n && (e.conversion = n.conversion), e;
718
718
  }
719
- function rn(n) {
719
+ function dn(n) {
720
720
  const e = function(...t) {
721
- const o = t[0];
722
- if (o == null)
723
- return o;
724
- o.length > 1 && (t = o);
725
- const i = n(t);
726
- if (typeof i == "object")
727
- for (let { length: l } = i, r = 0; r < l; r++)
728
- i[r] = Math.round(i[r]);
729
- return i;
721
+ const i = t[0];
722
+ if (i == null)
723
+ return i;
724
+ i.length > 1 && (t = i);
725
+ const o = n(t);
726
+ if (typeof o == "object")
727
+ for (let { length: l } = o, r = 0; r < l; r++)
728
+ o[r] = Math.round(o[r]);
729
+ return o;
730
730
  };
731
731
  return "conversion" in n && (e.conversion = n.conversion), e;
732
732
  }
733
- for (const n of tn) {
734
- b[n] = {}, Object.defineProperty(b[n], "channels", { value: c[n].channels }), Object.defineProperty(b[n], "labels", { value: c[n].labels });
735
- const e = en(n), t = Object.keys(e);
736
- for (const o of t) {
737
- const i = e[o];
738
- b[n][o] = rn(i), b[n][o].raw = on(i);
733
+ for (const n of cn) {
734
+ m[n] = {}, Object.defineProperty(m[n], "channels", { value: c[n].channels }), Object.defineProperty(m[n], "labels", { value: c[n].labels });
735
+ const e = sn(n), t = Object.keys(e);
736
+ for (const i of t) {
737
+ const o = e[i];
738
+ m[n][i] = dn(o), m[n][i].raw = un(o);
739
739
  }
740
740
  }
741
- const K = [
741
+ const Z = [
742
742
  // To be honest, I don't really feel like keyword belongs in color convert, but eh.
743
743
  "keyword",
744
744
  // Gray conflicts with some method names, and has its own method defined.
745
745
  "gray",
746
746
  // Shouldn't really be in color-convert either...
747
747
  "hex"
748
- ], I = {};
749
- for (const n of Object.keys(b))
750
- I[[...b[n].labels].sort().join("")] = n;
751
- const C = {};
752
- function h(n, e) {
753
- if (!(this instanceof h))
754
- return new h(n, e);
755
- if (e && e in K && (e = null), e && !(e in b))
748
+ ], $ = {};
749
+ for (const n of Object.keys(m))
750
+ $[[...m[n].labels].sort().join("")] = n;
751
+ const K = {};
752
+ function f(n, e) {
753
+ if (!(this instanceof f))
754
+ return new f(n, e);
755
+ if (e && e in Z && (e = null), e && !(e in m))
756
756
  throw new Error("Unknown model: " + e);
757
- let t, o;
757
+ let t, i;
758
758
  if (n == null)
759
759
  this.model = "rgb", this.color = [0, 0, 0], this.valpha = 1;
760
- else if (n instanceof h)
760
+ else if (n instanceof f)
761
761
  this.model = n.model, this.color = [...n.color], this.valpha = n.valpha;
762
762
  else if (typeof n == "string") {
763
- const i = y.get(n);
764
- if (i === null)
763
+ const o = g.get(n);
764
+ if (o === null)
765
765
  throw new Error("Unable to parse color from string: " + n);
766
- this.model = i.model, o = b[this.model].channels, this.color = i.value.slice(0, o), this.valpha = typeof i.value[o] == "number" ? i.value[o] : 1;
766
+ this.model = o.model, i = m[this.model].channels, this.color = o.value.slice(0, i), this.valpha = typeof o.value[i] == "number" ? o.value[i] : 1;
767
767
  } else if (n.length > 0) {
768
- this.model = e || "rgb", o = b[this.model].channels;
769
- const i = Array.prototype.slice.call(n, 0, o);
770
- this.color = R(i, o), this.valpha = typeof n[o] == "number" ? n[o] : 1;
768
+ this.model = e || "rgb", i = m[this.model].channels;
769
+ const o = Array.prototype.slice.call(n, 0, i);
770
+ this.color = D(o, i), this.valpha = typeof n[i] == "number" ? n[i] : 1;
771
771
  } else if (typeof n == "number")
772
772
  this.model = "rgb", this.color = [
773
773
  n >> 16 & 255,
@@ -776,25 +776,25 @@ function h(n, e) {
776
776
  ], this.valpha = 1;
777
777
  else {
778
778
  this.valpha = 1;
779
- const i = Object.keys(n);
780
- "alpha" in n && (i.splice(i.indexOf("alpha"), 1), this.valpha = typeof n.alpha == "number" ? n.alpha : 0);
781
- const l = i.sort().join("");
782
- if (!(l in I))
779
+ const o = Object.keys(n);
780
+ "alpha" in n && (o.splice(o.indexOf("alpha"), 1), this.valpha = typeof n.alpha == "number" ? n.alpha : 0);
781
+ const l = o.sort().join("");
782
+ if (!(l in $))
783
783
  throw new Error("Unable to parse color from object: " + JSON.stringify(n));
784
- this.model = I[l];
785
- const { labels: r } = b[this.model], a = [];
784
+ this.model = $[l];
785
+ const { labels: r } = m[this.model], a = [];
786
786
  for (t = 0; t < r.length; t++)
787
787
  a.push(n[r[t]]);
788
- this.color = R(a);
788
+ this.color = D(a);
789
789
  }
790
- if (C[this.model])
791
- for (o = b[this.model].channels, t = 0; t < o; t++) {
792
- const i = C[this.model][t];
793
- i && (this.color[t] = i(this.color[t]));
790
+ if (K[this.model])
791
+ for (i = m[this.model].channels, t = 0; t < i; t++) {
792
+ const o = K[this.model][t];
793
+ o && (this.color[t] = o(this.color[t]));
794
794
  }
795
795
  this.valpha = Math.max(0, Math.min(1, this.valpha)), Object.freeze && Object.freeze(this);
796
796
  }
797
- h.prototype = {
797
+ f.prototype = {
798
798
  toString() {
799
799
  return this.string();
800
800
  },
@@ -802,22 +802,22 @@ h.prototype = {
802
802
  return this[this.model]();
803
803
  },
804
804
  string(n) {
805
- let e = this.model in y.to ? this : this.rgb();
805
+ let e = this.model in g.to ? this : this.rgb();
806
806
  e = e.round(typeof n == "number" ? n : 1);
807
807
  const t = e.valpha === 1 ? e.color : [...e.color, this.valpha];
808
- return y.to[e.model](...t);
808
+ return g.to[e.model](...t);
809
809
  },
810
810
  percentString(n) {
811
811
  const e = this.rgb().round(typeof n == "number" ? n : 1), t = e.valpha === 1 ? e.color : [...e.color, this.valpha];
812
- return y.to.rgb.percent(...t);
812
+ return g.to.rgb.percent(...t);
813
813
  },
814
814
  array() {
815
815
  return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
816
816
  },
817
817
  object() {
818
- const n = {}, { channels: e } = b[this.model], { labels: t } = b[this.model];
819
- for (let o = 0; o < e; o++)
820
- n[t[o]] = this.color[o];
818
+ const n = {}, { channels: e } = m[this.model], { labels: t } = m[this.model];
819
+ for (let i = 0; i < e; i++)
820
+ n[t[i]] = this.color[i];
821
821
  return this.valpha !== 1 && (n.alpha = this.valpha), n;
822
822
  },
823
823
  unitArray() {
@@ -829,46 +829,46 @@ h.prototype = {
829
829
  return n.r /= 255, n.g /= 255, n.b /= 255, this.valpha !== 1 && (n.alpha = this.valpha), n;
830
830
  },
831
831
  round(n) {
832
- return n = Math.max(n || 0, 0), new h([...this.color.map(an(n)), this.valpha], this.model);
832
+ return n = Math.max(n || 0, 0), new f([...this.color.map(pn(n)), this.valpha], this.model);
833
833
  },
834
834
  alpha(n) {
835
- return n !== void 0 ? new h([...this.color, Math.max(0, Math.min(1, n))], this.model) : this.valpha;
835
+ return n !== void 0 ? new f([...this.color, Math.max(0, Math.min(1, n))], this.model) : this.valpha;
836
836
  },
837
837
  // Rgb
838
- red: d("rgb", 0, f(255)),
839
- green: d("rgb", 1, f(255)),
840
- blue: d("rgb", 2, f(255)),
841
- hue: d(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (n) => (n % 360 + 360) % 360),
842
- saturationl: d("hsl", 1, f(100)),
843
- lightness: d("hsl", 2, f(100)),
844
- saturationv: d("hsv", 1, f(100)),
845
- value: d("hsv", 2, f(100)),
846
- chroma: d("hcg", 1, f(100)),
847
- gray: d("hcg", 2, f(100)),
848
- white: d("hwb", 1, f(100)),
849
- wblack: d("hwb", 2, f(100)),
850
- cyan: d("cmyk", 0, f(100)),
851
- magenta: d("cmyk", 1, f(100)),
852
- yellow: d("cmyk", 2, f(100)),
853
- black: d("cmyk", 3, f(100)),
854
- x: d("xyz", 0, f(95.047)),
855
- y: d("xyz", 1, f(100)),
856
- z: d("xyz", 2, f(108.833)),
857
- l: d("lab", 0, f(100)),
858
- a: d("lab", 1),
859
- b: d("lab", 2),
838
+ red: p("rgb", 0, b(255)),
839
+ green: p("rgb", 1, b(255)),
840
+ blue: p("rgb", 2, b(255)),
841
+ hue: p(["hsl", "hsv", "hsl", "hwb", "hcg"], 0, (n) => (n % 360 + 360) % 360),
842
+ saturationl: p("hsl", 1, b(100)),
843
+ lightness: p("hsl", 2, b(100)),
844
+ saturationv: p("hsv", 1, b(100)),
845
+ value: p("hsv", 2, b(100)),
846
+ chroma: p("hcg", 1, b(100)),
847
+ gray: p("hcg", 2, b(100)),
848
+ white: p("hwb", 1, b(100)),
849
+ wblack: p("hwb", 2, b(100)),
850
+ cyan: p("cmyk", 0, b(100)),
851
+ magenta: p("cmyk", 1, b(100)),
852
+ yellow: p("cmyk", 2, b(100)),
853
+ black: p("cmyk", 3, b(100)),
854
+ x: p("xyz", 0, b(95.047)),
855
+ y: p("xyz", 1, b(100)),
856
+ z: p("xyz", 2, b(108.833)),
857
+ l: p("lab", 0, b(100)),
858
+ a: p("lab", 1),
859
+ b: p("lab", 2),
860
860
  keyword(n) {
861
- return n !== void 0 ? new h(n) : b[this.model].keyword(this.color);
861
+ return n !== void 0 ? new f(n) : m[this.model].keyword(this.color);
862
862
  },
863
863
  hex(n) {
864
- return n !== void 0 ? new h(n) : y.to.hex(...this.rgb().round().color);
864
+ return n !== void 0 ? new f(n) : g.to.hex(...this.rgb().round().color);
865
865
  },
866
866
  hexa(n) {
867
867
  if (n !== void 0)
868
- return new h(n);
868
+ return new f(n);
869
869
  const e = this.rgb().round().color;
870
870
  let t = Math.round(this.valpha * 255).toString(16).toUpperCase();
871
- return t.length === 1 && (t = "0" + t), y.to.hex(...e) + t;
871
+ return t.length === 1 && (t = "0" + t), g.to.hex(...e) + t;
872
872
  },
873
873
  rgbNumber() {
874
874
  const n = this.rgb().color;
@@ -876,9 +876,9 @@ h.prototype = {
876
876
  },
877
877
  luminosity() {
878
878
  const n = this.rgb().color, e = [];
879
- for (const [t, o] of n.entries()) {
880
- const i = o / 255;
881
- e[t] = i <= 0.04045 ? i / 12.92 : ((i + 0.055) / 1.055) ** 2.4;
879
+ for (const [t, i] of n.entries()) {
880
+ const o = i / 255;
881
+ e[t] = o <= 0.04045 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4;
882
882
  }
883
883
  return 0.2126 * e[0] + 0.7152 * e[1] + 0.0722 * e[2];
884
884
  },
@@ -929,7 +929,7 @@ h.prototype = {
929
929
  },
930
930
  grayscale() {
931
931
  const n = this.rgb().color, e = n[0] * 0.3 + n[1] * 0.59 + n[2] * 0.11;
932
- return h.rgb(e, e, e);
932
+ return f.rgb(e, e, e);
933
933
  },
934
934
  fade(n) {
935
935
  return this.alpha(this.valpha - this.valpha * n);
@@ -945,114 +945,114 @@ h.prototype = {
945
945
  mix(n, e) {
946
946
  if (!n || !n.rgb)
947
947
  throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof n);
948
- const t = n.rgb(), o = this.rgb(), i = e === void 0 ? 0.5 : e, l = 2 * i - 1, r = t.alpha() - o.alpha(), a = ((l * r === -1 ? l : (l + r) / (1 + l * r)) + 1) / 2, s = 1 - a;
949
- return h.rgb(
950
- a * t.red() + s * o.red(),
951
- a * t.green() + s * o.green(),
952
- a * t.blue() + s * o.blue(),
953
- t.alpha() * i + o.alpha() * (1 - i)
948
+ const t = n.rgb(), i = this.rgb(), o = e === void 0 ? 0.5 : e, l = 2 * o - 1, r = t.alpha() - i.alpha(), a = ((l * r === -1 ? l : (l + r) / (1 + l * r)) + 1) / 2, s = 1 - a;
949
+ return f.rgb(
950
+ a * t.red() + s * i.red(),
951
+ a * t.green() + s * i.green(),
952
+ a * t.blue() + s * i.blue(),
953
+ t.alpha() * o + i.alpha() * (1 - o)
954
954
  );
955
955
  }
956
956
  };
957
- for (const n of Object.keys(b)) {
958
- if (K.includes(n))
957
+ for (const n of Object.keys(m)) {
958
+ if (Z.includes(n))
959
959
  continue;
960
- const { channels: e } = b[n];
961
- h.prototype[n] = function(...t) {
962
- return this.model === n ? new h(this) : t.length > 0 ? new h(t, n) : new h([...sn(b[this.model][n].raw(this.color)), this.valpha], n);
963
- }, h[n] = function(...t) {
964
- let o = t[0];
965
- return typeof o == "number" && (o = R(t, e)), new h(o, n);
960
+ const { channels: e } = m[n];
961
+ f.prototype[n] = function(...t) {
962
+ return this.model === n ? new f(this) : t.length > 0 ? new f(t, n) : new f([...fn(m[this.model][n].raw(this.color)), this.valpha], n);
963
+ }, f[n] = function(...t) {
964
+ let i = t[0];
965
+ return typeof i == "number" && (i = D(t, e)), new f(i, n);
966
966
  };
967
967
  }
968
- function ln(n, e) {
968
+ function hn(n, e) {
969
969
  return Number(n.toFixed(e));
970
970
  }
971
- function an(n) {
971
+ function pn(n) {
972
972
  return function(e) {
973
- return ln(e, n);
973
+ return hn(e, n);
974
974
  };
975
975
  }
976
- function d(n, e, t) {
976
+ function p(n, e, t) {
977
977
  n = Array.isArray(n) ? n : [n];
978
- for (const o of n)
979
- (C[o] || (C[o] = []))[e] = t;
980
- return n = n[0], function(o) {
981
- let i;
982
- return o !== void 0 ? (t && (o = t(o)), i = this[n](), i.color[e] = o, i) : (i = this[n]().color[e], t && (i = t(i)), i);
978
+ for (const i of n)
979
+ (K[i] || (K[i] = []))[e] = t;
980
+ return n = n[0], function(i) {
981
+ let o;
982
+ return i !== void 0 ? (t && (i = t(i)), o = this[n](), o.color[e] = i, o) : (o = this[n]().color[e], t && (o = t(o)), o);
983
983
  };
984
984
  }
985
- function f(n) {
985
+ function b(n) {
986
986
  return function(e) {
987
987
  return Math.max(0, Math.min(n, e));
988
988
  };
989
989
  }
990
- function sn(n) {
990
+ function fn(n) {
991
991
  return Array.isArray(n) ? n : [n];
992
992
  }
993
- function R(n, e) {
993
+ function D(n, e) {
994
994
  for (let t = 0; t < e; t++)
995
995
  typeof n[t] != "number" && (n[t] = 0);
996
996
  return n;
997
997
  }
998
- function W(n) {
998
+ function Y(n) {
999
999
  return !!(typeof n == "string" && (n.startsWith("#") || n.startsWith("rgb(") || n.startsWith("rgba(") || n.startsWith("hsl(") || n.startsWith("hwb(")));
1000
1000
  }
1001
- function T(n, e) {
1001
+ function G(n, e) {
1002
1002
  if (!(typeof n == "string" || typeof n == "number" || typeof n == "boolean" || n === null || n === void 0)) {
1003
1003
  if (Array.isArray(n))
1004
1004
  for (let t = 0; t < n.length; t += 1) {
1005
- const o = n[t];
1006
- if (W(o)) {
1007
- n[t] = e(o);
1005
+ const i = n[t];
1006
+ if (Y(i)) {
1007
+ n[t] = e(i);
1008
1008
  continue;
1009
1009
  }
1010
- T(o, e);
1010
+ G(i, e);
1011
1011
  }
1012
1012
  else if (typeof n == "object") {
1013
- const t = n, o = Object.keys(n);
1014
- for (const i of o) {
1015
- const l = t[i];
1016
- if (W(l)) {
1017
- t[i] = e(l);
1013
+ const t = n, i = Object.keys(n);
1014
+ for (const o of i) {
1015
+ const l = t[o];
1016
+ if (Y(l)) {
1017
+ t[o] = e(l);
1018
1018
  continue;
1019
1019
  }
1020
- T(l, e);
1020
+ G(l, e);
1021
1021
  }
1022
1022
  }
1023
1023
  }
1024
1024
  }
1025
- function cn(n, e) {
1026
- const t = n / 255, o = t + (1 - t) * t * e;
1027
- return Math.max(0, Math.min(255, o * 255));
1025
+ function _n(n, e) {
1026
+ const t = n / 255, i = t + (1 - t) * t * e;
1027
+ return Math.max(0, Math.min(255, i * 255));
1028
1028
  }
1029
- function un(n, e) {
1030
- return n.map((t) => cn(t, e));
1029
+ function yn(n, e) {
1030
+ return n.map((t) => _n(t, e));
1031
1031
  }
1032
- function pn(n, e, t = 127) {
1033
- const o = Math.max(-0.99, Math.min(0.99, e)), i = o < 0 ? o + 1 : 1 / (1 - o), l = t + i * (n - t);
1032
+ function bn(n, e, t = 127) {
1033
+ const i = Math.max(-0.99, Math.min(0.99, e)), o = i < 0 ? i + 1 : 1 / (1 - i), l = t + o * (n - t);
1034
1034
  return Math.round(Math.max(0, Math.min(255, l)));
1035
1035
  }
1036
- function dn(n, e, t = 127) {
1037
- return n.map((o) => pn(o, e, t));
1036
+ function gn(n, e, t = 127) {
1037
+ return n.map((i) => bn(i, e, t));
1038
1038
  }
1039
- function hn(n, e, t = 1) {
1039
+ function mn(n, e, t = 1) {
1040
1040
  return 255 * (n / 255) * (e / 255) * t + n / 255 * (1 - t) * 255;
1041
1041
  }
1042
- function _n(n, e, t = 1) {
1043
- return n.map((o, i) => hn(n[i], e[i], t));
1042
+ function kn(n, e, t = 1) {
1043
+ return n.map((i, o) => mn(n[o], e[o], t));
1044
1044
  }
1045
- const fn = `[
1045
+ const xn = `[
1046
1046
  {
1047
1047
  "id": "background",
1048
1048
  "type": "background",
1049
1049
  "layout": {"visibility": "visible"},
1050
- "paint": {"background-color": "#cccccc"}
1050
+ "paint": {"background-color": "rgb(135, 199, 236)"}
1051
1051
  },
1052
1052
  {
1053
1053
  "id": "earth",
1054
1054
  "type": "fill",
1055
- "source": "__protomaps_source",
1055
+ "source": "<BMK_BM_SRC>",
1056
1056
  "source-layer": "earth",
1057
1057
  "filter": ["==", "$type", "Polygon"],
1058
1058
  "layout": {"visibility": "visible"},
@@ -1061,7 +1061,7 @@ const fn = `[
1061
1061
  {
1062
1062
  "id": "landcover",
1063
1063
  "type": "fill",
1064
- "source": "__protomaps_source",
1064
+ "source": "<BMK_BM_SRC>",
1065
1065
  "source-layer": "landcover",
1066
1066
  "filter": [
1067
1067
  "all",
@@ -1111,7 +1111,7 @@ const fn = `[
1111
1111
  {
1112
1112
  "id": "landuse_residential",
1113
1113
  "type": "fill",
1114
- "source": "__protomaps_source",
1114
+ "source": "<BMK_BM_SRC>",
1115
1115
  "source-layer": "landuse",
1116
1116
  "filter": ["all", ["==", "kind", "residential"]],
1117
1117
  "layout": {"visibility": "visible"},
@@ -1123,7 +1123,7 @@ const fn = `[
1123
1123
  {
1124
1124
  "id": "landuse_urban_green",
1125
1125
  "type": "fill",
1126
- "source": "__protomaps_source",
1126
+ "source": "<BMK_BM_SRC>",
1127
1127
  "source-layer": "landuse",
1128
1128
  "filter": ["in", "kind", "allotments", "village_green", "playground"],
1129
1129
  "layout": {"visibility": "visible"},
@@ -1132,7 +1132,7 @@ const fn = `[
1132
1132
  {
1133
1133
  "id": "landuse-sand",
1134
1134
  "type": "fill",
1135
- "source": "__protomaps_source",
1135
+ "source": "<BMK_BM_SRC>",
1136
1136
  "source-layer": "landuse",
1137
1137
  "filter": ["all", ["==", "kind", "sand"]],
1138
1138
  "layout": {"visibility": "visible"},
@@ -1144,7 +1144,7 @@ const fn = `[
1144
1144
  {
1145
1145
  "id": "landuse_bare_rock",
1146
1146
  "type": "fill",
1147
- "source": "__protomaps_source",
1147
+ "source": "<BMK_BM_SRC>",
1148
1148
  "source-layer": "landuse",
1149
1149
  "filter": ["all", ["in", "kind", "bare_rock"]],
1150
1150
  "layout": {"visibility": "visible"},
@@ -1153,7 +1153,7 @@ const fn = `[
1153
1153
  {
1154
1154
  "id": "landuse_park",
1155
1155
  "type": "fill",
1156
- "source": "__protomaps_source",
1156
+ "source": "<BMK_BM_SRC>",
1157
1157
  "source-layer": "landuse",
1158
1158
  "filter": [
1159
1159
  "all",
@@ -1204,7 +1204,7 @@ const fn = `[
1204
1204
  {
1205
1205
  "id": "landuse_farmland",
1206
1206
  "type": "fill",
1207
- "source": "__protomaps_source",
1207
+ "source": "<BMK_BM_SRC>",
1208
1208
  "source-layer": "landuse",
1209
1209
  "filter": ["all", ["==", "kind", "farmland"]],
1210
1210
  "layout": {"visibility": "visible"},
@@ -1213,7 +1213,7 @@ const fn = `[
1213
1213
  {
1214
1214
  "id": "landuse_pitch",
1215
1215
  "type": "fill",
1216
- "source": "__protomaps_source",
1216
+ "source": "<BMK_BM_SRC>",
1217
1217
  "source-layer": "landuse",
1218
1218
  "filter": ["all", ["==", "kind", "pitch"]],
1219
1219
  "layout": {"visibility": "visible"},
@@ -1222,7 +1222,7 @@ const fn = `[
1222
1222
  {
1223
1223
  "id": "landuse_military",
1224
1224
  "type": "fill",
1225
- "source": "__protomaps_source",
1225
+ "source": "<BMK_BM_SRC>",
1226
1226
  "source-layer": "landuse",
1227
1227
  "filter": ["all", ["==", "kind", "military"]],
1228
1228
  "layout": {"visibility": "visible"},
@@ -1231,7 +1231,7 @@ const fn = `[
1231
1231
  {
1232
1232
  "id": "landuse_wood-forest",
1233
1233
  "type": "fill",
1234
- "source": "__protomaps_source",
1234
+ "source": "<BMK_BM_SRC>",
1235
1235
  "source-layer": "landuse",
1236
1236
  "filter": ["all", ["in", "kind", "forest", "wood"]],
1237
1237
  "layout": {"visibility": "visible"},
@@ -1243,7 +1243,7 @@ const fn = `[
1243
1243
  {
1244
1244
  "id": "landuse_hospital",
1245
1245
  "type": "fill",
1246
- "source": "__protomaps_source",
1246
+ "source": "<BMK_BM_SRC>",
1247
1247
  "source-layer": "landuse",
1248
1248
  "filter": ["==", "kind", "hospital"],
1249
1249
  "layout": {"visibility": "visible"},
@@ -1252,7 +1252,7 @@ const fn = `[
1252
1252
  {
1253
1253
  "id": "landuse_industrial",
1254
1254
  "type": "fill",
1255
- "source": "__protomaps_source",
1255
+ "source": "<BMK_BM_SRC>",
1256
1256
  "source-layer": "landuse",
1257
1257
  "filter": ["==", "kind", "industrial"],
1258
1258
  "layout": {"visibility": "visible"},
@@ -1261,7 +1261,7 @@ const fn = `[
1261
1261
  {
1262
1262
  "id": "landuse_school",
1263
1263
  "type": "fill",
1264
- "source": "__protomaps_source",
1264
+ "source": "<BMK_BM_SRC>",
1265
1265
  "source-layer": "landuse",
1266
1266
  "filter": ["in", "kind", "school", "university", "college"],
1267
1267
  "layout": {"visibility": "visible"},
@@ -1270,7 +1270,7 @@ const fn = `[
1270
1270
  {
1271
1271
  "id": "landuse_zoo",
1272
1272
  "type": "fill",
1273
- "source": "__protomaps_source",
1273
+ "source": "<BMK_BM_SRC>",
1274
1274
  "source-layer": "landuse",
1275
1275
  "filter": ["in", "kind", "zoo"],
1276
1276
  "layout": {"visibility": "visible"},
@@ -1279,7 +1279,7 @@ const fn = `[
1279
1279
  {
1280
1280
  "id": "landuse_aerodrome",
1281
1281
  "type": "fill",
1282
- "source": "__protomaps_source",
1282
+ "source": "<BMK_BM_SRC>",
1283
1283
  "source-layer": "landuse",
1284
1284
  "filter": ["in", "kind", "aerodrome"],
1285
1285
  "layout": {"visibility": "visible"},
@@ -1288,7 +1288,7 @@ const fn = `[
1288
1288
  {
1289
1289
  "id": "roads_runway",
1290
1290
  "type": "line",
1291
- "source": "__protomaps_source",
1291
+ "source": "<BMK_BM_SRC>",
1292
1292
  "source-layer": "roads",
1293
1293
  "filter": ["==", "kind_detail", "runway"],
1294
1294
  "layout": {"visibility": "visible"},
@@ -1310,7 +1310,7 @@ const fn = `[
1310
1310
  {
1311
1311
  "id": "roads_taxiway",
1312
1312
  "type": "line",
1313
- "source": "__protomaps_source",
1313
+ "source": "<BMK_BM_SRC>",
1314
1314
  "source-layer": "roads",
1315
1315
  "minzoom": 13,
1316
1316
  "filter": ["==", "kind_detail", "taxiway"],
@@ -1333,24 +1333,61 @@ const fn = `[
1333
1333
  {
1334
1334
  "id": "landuse_runway",
1335
1335
  "type": "fill",
1336
- "source": "__protomaps_source",
1336
+ "source": "<BMK_BM_SRC>",
1337
1337
  "source-layer": "landuse",
1338
1338
  "filter": ["any", ["in", "kind", "runway", "taxiway"]],
1339
1339
  "paint": {"fill-color": "#e9e9ed"}
1340
1340
  },
1341
+ {
1342
+ "id": "hillshader",
1343
+ "type": "hillshade",
1344
+ "source": "<BMK_TR_SRC>",
1345
+ "paint": {
1346
+ "hillshade-illumination-anchor": "viewport",
1347
+ "hillshade-exaggeration": [
1348
+ "interpolate",
1349
+ ["exponential", 1.6],
1350
+ ["zoom"],
1351
+ 0, 0.1,
1352
+ 4, 0.2,
1353
+ 7, 0.3,
1354
+ 10, 0.4,
1355
+ 15, 0.4,
1356
+ 17, 0.2
1357
+ ],
1358
+ "hillshade-shadow-color": "#123161",
1359
+ "hillshade-highlight-color": "#fff0b3",
1360
+ "hillshade-accent-color": "rgba(0, 184, 255, 0.65)",
1361
+ "hillshade-illumination-direction": [
1362
+ "literal",
1363
+ 310
1364
+ ]
1365
+ },
1366
+ "layout": {"visibility": "visible"}
1367
+ },
1341
1368
  {
1342
1369
  "id": "water",
1343
1370
  "type": "fill",
1344
- "source": "__protomaps_source",
1371
+ "source": "<BMK_BM_SRC>",
1345
1372
  "source-layer": "water",
1346
1373
  "filter": ["==", "$type", "Polygon"],
1347
1374
  "layout": {"visibility": "visible"},
1348
- "paint": {"fill-color": "rgb(135, 199, 236)"}
1375
+ "paint": {
1376
+ "fill-color": "rgb(135, 199, 236)",
1377
+ "fill-opacity": [
1378
+ "interpolate",
1379
+ ["exponential", 1.6],
1380
+ ["zoom"],
1381
+ 0, 0.4,
1382
+ 5, 0.75,
1383
+ 8, 0.95
1384
+ ]
1385
+ }
1349
1386
  },
1350
1387
  {
1351
1388
  "id": "water_stream",
1352
1389
  "type": "line",
1353
- "source": "__protomaps_source",
1390
+ "source": "<BMK_BM_SRC>",
1354
1391
  "source-layer": "water",
1355
1392
  "minzoom": 14,
1356
1393
  "filter": ["in", "kind", "stream"],
@@ -1360,7 +1397,7 @@ const fn = `[
1360
1397
  {
1361
1398
  "id": "landuse_beach",
1362
1399
  "type": "fill",
1363
- "source": "__protomaps_source",
1400
+ "source": "<BMK_BM_SRC>",
1364
1401
  "source-layer": "landuse",
1365
1402
  "filter": ["in", "kind", "beach"],
1366
1403
  "layout": {"visibility": "visible"},
@@ -1369,7 +1406,7 @@ const fn = `[
1369
1406
  {
1370
1407
  "id": "water_river",
1371
1408
  "type": "line",
1372
- "source": "__protomaps_source",
1409
+ "source": "<BMK_BM_SRC>",
1373
1410
  "source-layer": "water",
1374
1411
  "minzoom": 9,
1375
1412
  "filter": ["in", "kind", "river"],
@@ -1392,16 +1429,64 @@ const fn = `[
1392
1429
  {
1393
1430
  "id": "landuse_wetland",
1394
1431
  "type": "fill",
1395
- "source": "__protomaps_source",
1432
+ "source": "<BMK_BM_SRC>",
1396
1433
  "source-layer": "landuse",
1397
1434
  "filter": ["all", ["==", "kind", "wetland"]],
1398
1435
  "layout": {"visibility": "visible"},
1399
1436
  "paint": {"fill-color": "rgba(43, 63, 131, 0.07)"}
1400
1437
  },
1438
+ {
1439
+ "id": "landuse_nature_reserve_bg",
1440
+ "type": "line",
1441
+ "source": "<BMK_BM_SRC>",
1442
+ "source-layer": "landuse",
1443
+ "minzoom": 8,
1444
+ "filter": ["all", ["==", "kind", "nature_reserve"]],
1445
+ "layout": {"visibility": "visible"},
1446
+ "paint": {
1447
+ "line-width": [
1448
+ "interpolate",
1449
+ ["exponential", 1.6],
1450
+ ["zoom"],
1451
+ 8,
1452
+ 5,
1453
+ 15,
1454
+ 20,
1455
+ 18,
1456
+ 30
1457
+ ],
1458
+ "line-color": "rgba(5, 109, 0, 0.19)",
1459
+ "line-opacity": {"stops": [[8, 0], [9, 0.4]]}
1460
+ }
1461
+ },
1462
+ {
1463
+ "id": "landuse_nature_reserve",
1464
+ "type": "line",
1465
+ "source": "<BMK_BM_SRC>",
1466
+ "source-layer": "landuse",
1467
+ "minzoom": 8,
1468
+ "filter": ["all", ["==", "kind", "nature_reserve"]],
1469
+ "layout": {"visibility": "visible"},
1470
+ "paint": {
1471
+ "line-width": [
1472
+ "interpolate",
1473
+ ["exponential", 1.6],
1474
+ ["zoom"],
1475
+ 8,
1476
+ 1,
1477
+ 15,
1478
+ 3,
1479
+ 18,
1480
+ 5
1481
+ ],
1482
+ "line-color": "rgba(5, 109, 0, 0.19)",
1483
+ "line-opacity": {"stops": [[8, 0], [9, 1]]}
1484
+ }
1485
+ },
1401
1486
  {
1402
1487
  "id": "ferry",
1403
1488
  "type": "line",
1404
- "source": "__protomaps_source",
1489
+ "source": "<BMK_BM_SRC>",
1405
1490
  "source-layer": "roads",
1406
1491
  "filter": ["all", ["==", "kind", "ferry"]],
1407
1492
  "layout": {"visibility": "visible"},
@@ -1425,7 +1510,7 @@ const fn = `[
1425
1510
  {
1426
1511
  "id": "landuse_pedestrian",
1427
1512
  "type": "fill",
1428
- "source": "__protomaps_source",
1513
+ "source": "<BMK_BM_SRC>",
1429
1514
  "source-layer": "landuse",
1430
1515
  "filter": ["in", "kind", "pedestrian", "dam"],
1431
1516
  "layout": {"visibility": "visible"},
@@ -1434,7 +1519,7 @@ const fn = `[
1434
1519
  {
1435
1520
  "id": "landuse_pier",
1436
1521
  "type": "fill",
1437
- "source": "__protomaps_source",
1522
+ "source": "<BMK_BM_SRC>",
1438
1523
  "source-layer": "landuse",
1439
1524
  "filter": ["==", "kind", "pier"],
1440
1525
  "paint": {"fill-color": "#e0e0e0"}
@@ -1442,7 +1527,7 @@ const fn = `[
1442
1527
  {
1443
1528
  "id": "roads_tunnels_other_casing",
1444
1529
  "type": "line",
1445
- "source": "__protomaps_source",
1530
+ "source": "<BMK_BM_SRC>",
1446
1531
  "source-layer": "roads",
1447
1532
  "filter": ["all", ["has", "is_tunnel"], ["in", "kind", "other", "path"]],
1448
1533
  "paint": {
@@ -1461,7 +1546,7 @@ const fn = `[
1461
1546
  {
1462
1547
  "id": "roads_tunnels_minor_casing",
1463
1548
  "type": "line",
1464
- "source": "__protomaps_source",
1549
+ "source": "<BMK_BM_SRC>",
1465
1550
  "source-layer": "roads",
1466
1551
  "filter": ["all", ["has", "is_tunnel"], ["==", "kind", "minor_road"]],
1467
1552
  "paint": {
@@ -1494,7 +1579,7 @@ const fn = `[
1494
1579
  {
1495
1580
  "id": "roads_tunnels_link_casing",
1496
1581
  "type": "line",
1497
- "source": "__protomaps_source",
1582
+ "source": "<BMK_BM_SRC>",
1498
1583
  "source-layer": "roads",
1499
1584
  "filter": ["all", ["has", "is_tunnel"], ["has", "is_link"]],
1500
1585
  "paint": {
@@ -1525,7 +1610,7 @@ const fn = `[
1525
1610
  {
1526
1611
  "id": "roads_tunnels_major_casing",
1527
1612
  "type": "line",
1528
- "source": "__protomaps_source",
1613
+ "source": "<BMK_BM_SRC>",
1529
1614
  "source-layer": "roads",
1530
1615
  "filter": [
1531
1616
  "all",
@@ -1562,7 +1647,7 @@ const fn = `[
1562
1647
  {
1563
1648
  "id": "roads_tunnels_highway_casing",
1564
1649
  "type": "line",
1565
- "source": "__protomaps_source",
1650
+ "source": "<BMK_BM_SRC>",
1566
1651
  "source-layer": "roads",
1567
1652
  "filter": [
1568
1653
  "all",
@@ -1601,7 +1686,7 @@ const fn = `[
1601
1686
  {
1602
1687
  "id": "roads_tunnels_other",
1603
1688
  "type": "line",
1604
- "source": "__protomaps_source",
1689
+ "source": "<BMK_BM_SRC>",
1605
1690
  "source-layer": "roads",
1606
1691
  "filter": ["all", ["has", "is_tunnel"], ["in", "kind", "other", "path"]],
1607
1692
  "paint": {
@@ -1621,7 +1706,7 @@ const fn = `[
1621
1706
  {
1622
1707
  "id": "roads_tunnels_minor",
1623
1708
  "type": "line",
1624
- "source": "__protomaps_source",
1709
+ "source": "<BMK_BM_SRC>",
1625
1710
  "source-layer": "roads",
1626
1711
  "filter": ["all", ["has", "is_tunnel"], ["==", "kind", "minor_road"]],
1627
1712
  "paint": {
@@ -1644,7 +1729,7 @@ const fn = `[
1644
1729
  {
1645
1730
  "id": "roads_tunnels_link",
1646
1731
  "type": "line",
1647
- "source": "__protomaps_source",
1732
+ "source": "<BMK_BM_SRC>",
1648
1733
  "source-layer": "roads",
1649
1734
  "filter": ["all", ["has", "is_tunnel"], ["has", "is_link"]],
1650
1735
  "paint": {
@@ -1665,7 +1750,7 @@ const fn = `[
1665
1750
  {
1666
1751
  "id": "roads_tunnels_major",
1667
1752
  "type": "line",
1668
- "source": "__protomaps_source",
1753
+ "source": "<BMK_BM_SRC>",
1669
1754
  "source-layer": "roads",
1670
1755
  "filter": ["all", ["has", "is_tunnel"], ["==", "kind", "major_road"]],
1671
1756
  "paint": {
@@ -1688,7 +1773,7 @@ const fn = `[
1688
1773
  {
1689
1774
  "id": "roads_tunnels_highway",
1690
1775
  "type": "line",
1691
- "source": "__protomaps_source",
1776
+ "source": "<BMK_BM_SRC>",
1692
1777
  "source-layer": "roads",
1693
1778
  "filter": [
1694
1779
  "all",
@@ -1718,7 +1803,7 @@ const fn = `[
1718
1803
  {
1719
1804
  "id": "buildings",
1720
1805
  "type": "fill",
1721
- "source": "__protomaps_source",
1806
+ "source": "<BMK_BM_SRC>",
1722
1807
  "source-layer": "buildings",
1723
1808
  "filter": ["in", "kind", "building", "building_part"],
1724
1809
  "paint": {"fill-opacity": 0.3, "fill-color": "#c2beba"}
@@ -1726,7 +1811,7 @@ const fn = `[
1726
1811
  {
1727
1812
  "id": "roads_pier",
1728
1813
  "type": "line",
1729
- "source": "__protomaps_source",
1814
+ "source": "<BMK_BM_SRC>",
1730
1815
  "source-layer": "roads",
1731
1816
  "filter": ["==", "kind_detail", "pier"],
1732
1817
  "paint": {
@@ -1747,7 +1832,7 @@ const fn = `[
1747
1832
  {
1748
1833
  "id": "roads_minor_service_casing",
1749
1834
  "type": "line",
1750
- "source": "__protomaps_source",
1835
+ "source": "<BMK_BM_SRC>",
1751
1836
  "source-layer": "roads",
1752
1837
  "minzoom": 13,
1753
1838
  "filter": [
@@ -1783,7 +1868,7 @@ const fn = `[
1783
1868
  {
1784
1869
  "id": "roads_minor_casing",
1785
1870
  "type": "line",
1786
- "source": "__protomaps_source",
1871
+ "source": "<BMK_BM_SRC>",
1787
1872
  "source-layer": "roads",
1788
1873
  "filter": [
1789
1874
  "all",
@@ -1824,7 +1909,7 @@ const fn = `[
1824
1909
  {
1825
1910
  "id": "roads_link_casing",
1826
1911
  "type": "line",
1827
- "source": "__protomaps_source",
1912
+ "source": "<BMK_BM_SRC>",
1828
1913
  "source-layer": "roads",
1829
1914
  "minzoom": 13,
1830
1915
  "filter": ["has", "is_link"],
@@ -1855,7 +1940,7 @@ const fn = `[
1855
1940
  {
1856
1941
  "id": "roads_major_casing_late",
1857
1942
  "type": "line",
1858
- "source": "__protomaps_source",
1943
+ "source": "<BMK_BM_SRC>",
1859
1944
  "source-layer": "roads",
1860
1945
  "minzoom": 12,
1861
1946
  "filter": [
@@ -1896,7 +1981,7 @@ const fn = `[
1896
1981
  {
1897
1982
  "id": "roads_highway_casing_late",
1898
1983
  "type": "line",
1899
- "source": "__protomaps_source",
1984
+ "source": "<BMK_BM_SRC>",
1900
1985
  "source-layer": "roads",
1901
1986
  "minzoom": 12,
1902
1987
  "filter": [
@@ -1936,7 +2021,7 @@ const fn = `[
1936
2021
  {
1937
2022
  "id": "roads_other-bg",
1938
2023
  "type": "line",
1939
- "source": "__protomaps_source",
2024
+ "source": "<BMK_BM_SRC>",
1940
2025
  "source-layer": "roads",
1941
2026
  "minzoom": 13,
1942
2027
  "filter": [
@@ -1957,13 +2042,13 @@ const fn = `[
1957
2042
  20,
1958
2043
  6
1959
2044
  ],
1960
- "line-color": "rgba(0, 0, 0, 0.15)"
2045
+ "line-color": "rgba(0, 0, 0, 0.05)"
1961
2046
  }
1962
2047
  },
1963
2048
  {
1964
2049
  "id": "roads_other",
1965
2050
  "type": "line",
1966
- "source": "__protomaps_source",
2051
+ "source": "<BMK_BM_SRC>",
1967
2052
  "source-layer": "roads",
1968
2053
  "minzoom": 13,
1969
2054
  "filter": [
@@ -1975,7 +2060,7 @@ const fn = `[
1975
2060
  ],
1976
2061
  "layout": {"visibility": "visible"},
1977
2062
  "paint": {
1978
- "line-dasharray": [2, 2],
2063
+ "line-dasharray": [3, 1.5],
1979
2064
  "line-width": [
1980
2065
  "interpolate",
1981
2066
  ["exponential", 1.6],
@@ -1985,13 +2070,13 @@ const fn = `[
1985
2070
  20,
1986
2071
  9
1987
2072
  ],
1988
- "line-color": "rgba(249, 247, 241, 1)"
2073
+ "line-color": "rgba(249, 247, 241, 0.6)"
1989
2074
  }
1990
2075
  },
1991
2076
  {
1992
2077
  "id": "roads_link",
1993
2078
  "type": "line",
1994
- "source": "__protomaps_source",
2079
+ "source": "<BMK_BM_SRC>",
1995
2080
  "source-layer": "roads",
1996
2081
  "filter": ["has", "is_link"],
1997
2082
  "paint": {
@@ -2012,7 +2097,7 @@ const fn = `[
2012
2097
  {
2013
2098
  "id": "roads_minor_service",
2014
2099
  "type": "line",
2015
- "source": "__protomaps_source",
2100
+ "source": "<BMK_BM_SRC>",
2016
2101
  "source-layer": "roads",
2017
2102
  "filter": [
2018
2103
  "all",
@@ -2037,7 +2122,7 @@ const fn = `[
2037
2122
  {
2038
2123
  "id": "roads_minor",
2039
2124
  "type": "line",
2040
- "source": "__protomaps_source",
2125
+ "source": "<BMK_BM_SRC>",
2041
2126
  "source-layer": "roads",
2042
2127
  "filter": [
2043
2128
  "all",
@@ -2067,7 +2152,7 @@ const fn = `[
2067
2152
  {
2068
2153
  "id": "roads_major_casing_early",
2069
2154
  "type": "line",
2070
- "source": "__protomaps_source",
2155
+ "source": "<BMK_BM_SRC>",
2071
2156
  "source-layer": "roads",
2072
2157
  "maxzoom": 12,
2073
2158
  "filter": [
@@ -2104,7 +2189,7 @@ const fn = `[
2104
2189
  {
2105
2190
  "id": "roads_major",
2106
2191
  "type": "line",
2107
- "source": "__protomaps_source",
2192
+ "source": "<BMK_BM_SRC>",
2108
2193
  "source-layer": "roads",
2109
2194
  "filter": [
2110
2195
  "all",
@@ -2133,7 +2218,7 @@ const fn = `[
2133
2218
  {
2134
2219
  "id": "roads_highway_casing_early",
2135
2220
  "type": "line",
2136
- "source": "__protomaps_source",
2221
+ "source": "<BMK_BM_SRC>",
2137
2222
  "source-layer": "roads",
2138
2223
  "maxzoom": 12,
2139
2224
  "filter": [
@@ -2177,7 +2262,7 @@ const fn = `[
2177
2262
  {
2178
2263
  "id": "roads_highway",
2179
2264
  "type": "line",
2180
- "source": "__protomaps_source",
2265
+ "source": "<BMK_BM_SRC>",
2181
2266
  "source-layer": "roads",
2182
2267
  "filter": [
2183
2268
  "all",
@@ -2209,7 +2294,7 @@ const fn = `[
2209
2294
  {
2210
2295
  "id": "roads_rail",
2211
2296
  "type": "line",
2212
- "source": "__protomaps_source",
2297
+ "source": "<BMK_BM_SRC>",
2213
2298
  "source-layer": "roads",
2214
2299
  "filter": ["==", "kind", "rail"],
2215
2300
  "layout": {"visibility": "visible"},
@@ -2233,7 +2318,7 @@ const fn = `[
2233
2318
  {
2234
2319
  "id": "boundaries_country_casing",
2235
2320
  "type": "line",
2236
- "source": "__protomaps_source",
2321
+ "source": "<BMK_BM_SRC>",
2237
2322
  "source-layer": "boundaries",
2238
2323
  "minzoom": 3,
2239
2324
  "filter": ["<=", "kind_detail", 2],
@@ -2257,7 +2342,7 @@ const fn = `[
2257
2342
  {
2258
2343
  "id": "boundaries_country",
2259
2344
  "type": "line",
2260
- "source": "__protomaps_source",
2345
+ "source": "<BMK_BM_SRC>",
2261
2346
  "source-layer": "boundaries",
2262
2347
  "filter": ["<=", "kind_detail", 2],
2263
2348
  "layout": {"visibility": "visible"},
@@ -2287,7 +2372,7 @@ const fn = `[
2287
2372
  {
2288
2373
  "id": "boundaries",
2289
2374
  "type": "line",
2290
- "source": "__protomaps_source",
2375
+ "source": "<BMK_BM_SRC>",
2291
2376
  "source-layer": "boundaries",
2292
2377
  "filter": [">", "kind_detail", 2],
2293
2378
  "layout": {"visibility": "visible"},
@@ -2306,7 +2391,7 @@ const fn = `[
2306
2391
  {
2307
2392
  "id": "roads_bridges_other_casing",
2308
2393
  "type": "line",
2309
- "source": "__protomaps_source",
2394
+ "source": "<BMK_BM_SRC>",
2310
2395
  "source-layer": "roads",
2311
2396
  "minzoom": 12,
2312
2397
  "filter": ["all", ["has", "is_bridge"], ["in", "kind", "other", "path"]],
@@ -2326,7 +2411,7 @@ const fn = `[
2326
2411
  {
2327
2412
  "id": "roads_bridges_link_casing",
2328
2413
  "type": "line",
2329
- "source": "__protomaps_source",
2414
+ "source": "<BMK_BM_SRC>",
2330
2415
  "source-layer": "roads",
2331
2416
  "minzoom": 12,
2332
2417
  "filter": ["all", ["has", "is_bridge"], ["has", "is_link"]],
@@ -2357,7 +2442,7 @@ const fn = `[
2357
2442
  {
2358
2443
  "id": "roads_bridges_minor_casing",
2359
2444
  "type": "line",
2360
- "source": "__protomaps_source",
2445
+ "source": "<BMK_BM_SRC>",
2361
2446
  "source-layer": "roads",
2362
2447
  "minzoom": 12,
2363
2448
  "filter": ["all", ["has", "is_bridge"], ["==", "kind", "minor_road"]],
@@ -2390,7 +2475,7 @@ const fn = `[
2390
2475
  {
2391
2476
  "id": "roads_bridges_major_casing",
2392
2477
  "type": "line",
2393
- "source": "__protomaps_source",
2478
+ "source": "<BMK_BM_SRC>",
2394
2479
  "source-layer": "roads",
2395
2480
  "minzoom": 12,
2396
2481
  "filter": ["all", ["has", "is_bridge"], ["==", "kind", "major_road"]],
@@ -2421,7 +2506,7 @@ const fn = `[
2421
2506
  {
2422
2507
  "id": "roads_bridges_other",
2423
2508
  "type": "line",
2424
- "source": "__protomaps_source",
2509
+ "source": "<BMK_BM_SRC>",
2425
2510
  "source-layer": "roads",
2426
2511
  "minzoom": 12,
2427
2512
  "filter": ["all", ["has", "is_bridge"], ["in", "kind", "other", "path"]],
@@ -2443,7 +2528,7 @@ const fn = `[
2443
2528
  {
2444
2529
  "id": "roads_bridges_minor",
2445
2530
  "type": "line",
2446
- "source": "__protomaps_source",
2531
+ "source": "<BMK_BM_SRC>",
2447
2532
  "source-layer": "roads",
2448
2533
  "minzoom": 12,
2449
2534
  "filter": ["all", ["has", "is_bridge"], ["==", "kind", "minor_road"]],
@@ -2467,7 +2552,7 @@ const fn = `[
2467
2552
  {
2468
2553
  "id": "roads_bridges_link",
2469
2554
  "type": "line",
2470
- "source": "__protomaps_source",
2555
+ "source": "<BMK_BM_SRC>",
2471
2556
  "source-layer": "roads",
2472
2557
  "minzoom": 12,
2473
2558
  "filter": ["all", ["has", "is_bridge"], ["has", "is_link"]],
@@ -2489,7 +2574,7 @@ const fn = `[
2489
2574
  {
2490
2575
  "id": "roads_bridges_major",
2491
2576
  "type": "line",
2492
- "source": "__protomaps_source",
2577
+ "source": "<BMK_BM_SRC>",
2493
2578
  "source-layer": "roads",
2494
2579
  "minzoom": 12,
2495
2580
  "filter": ["all", ["has", "is_bridge"], ["==", "kind", "major_road"]],
@@ -2513,7 +2598,7 @@ const fn = `[
2513
2598
  {
2514
2599
  "id": "cycleway_bg",
2515
2600
  "type": "line",
2516
- "source": "__protomaps_source",
2601
+ "source": "<BMK_BM_SRC>",
2517
2602
  "source-layer": "roads",
2518
2603
  "filter": ["any", ["==", "kind_detail", "cycleway"]],
2519
2604
  "layout": {"visibility": "visible"},
@@ -2536,7 +2621,7 @@ const fn = `[
2536
2621
  {
2537
2622
  "id": "cycleway",
2538
2623
  "type": "line",
2539
- "source": "__protomaps_source",
2624
+ "source": "<BMK_BM_SRC>",
2540
2625
  "source-layer": "roads",
2541
2626
  "filter": ["any", ["==", "kind_detail", "cycleway"]],
2542
2627
  "layout": {"visibility": "visible"},
@@ -2552,14 +2637,14 @@ const fn = `[
2552
2637
  18,
2553
2638
  4
2554
2639
  ],
2555
- "line-color": "rgba(20, 116, 0, 1)",
2556
- "line-dasharray": [2, 1.5]
2640
+ "line-color": "rgba(20, 116, 0, 0.7)",
2641
+ "line-dasharray": [3, 1.5]
2557
2642
  }
2558
2643
  },
2559
2644
  {
2560
2645
  "id": "roads_bridges_highway_casing",
2561
2646
  "type": "line",
2562
- "source": "__protomaps_source",
2647
+ "source": "<BMK_BM_SRC>",
2563
2648
  "source-layer": "roads",
2564
2649
  "minzoom": 12,
2565
2650
  "filter": [
@@ -2597,7 +2682,7 @@ const fn = `[
2597
2682
  {
2598
2683
  "id": "roads_bridges_highway",
2599
2684
  "type": "line",
2600
- "source": "__protomaps_source",
2685
+ "source": "<BMK_BM_SRC>",
2601
2686
  "source-layer": "roads",
2602
2687
  "filter": [
2603
2688
  "all",
@@ -2627,7 +2712,7 @@ const fn = `[
2627
2712
  {
2628
2713
  "id": "address_label",
2629
2714
  "type": "symbol",
2630
- "source": "__protomaps_source",
2715
+ "source": "<BMK_BM_SRC>",
2631
2716
  "source-layer": "buildings",
2632
2717
  "minzoom": 18,
2633
2718
  "filter": ["==", "kind", "address"],
@@ -2646,7 +2731,7 @@ const fn = `[
2646
2731
  {
2647
2732
  "id": "water_waterway_label",
2648
2733
  "type": "symbol",
2649
- "source": "__protomaps_source",
2734
+ "source": "<BMK_BM_SRC>",
2650
2735
  "source-layer": "water",
2651
2736
  "minzoom": 13,
2652
2737
  "filter": ["in", "kind", "river", "stream"],
@@ -2662,7 +2747,7 @@ const fn = `[
2662
2747
  {
2663
2748
  "id": "roads_labels_minor",
2664
2749
  "type": "symbol",
2665
- "source": "__protomaps_source",
2750
+ "source": "<BMK_BM_SRC>",
2666
2751
  "source-layer": "roads",
2667
2752
  "minzoom": 15,
2668
2753
  "filter": ["in", "kind", "minor_road", "other", "path"],
@@ -2683,7 +2768,7 @@ const fn = `[
2683
2768
  {
2684
2769
  "id": "water_label_ocean",
2685
2770
  "type": "symbol",
2686
- "source": "__protomaps_source",
2771
+ "source": "<BMK_BM_SRC>",
2687
2772
  "source-layer": "water",
2688
2773
  "filter": ["in", "kind", "sea", "ocean", "bay", "strait", "fjord"],
2689
2774
  "layout": {
@@ -2703,7 +2788,7 @@ const fn = `[
2703
2788
  {
2704
2789
  "id": "earth_label_islands",
2705
2790
  "type": "symbol",
2706
- "source": "__protomaps_source",
2791
+ "source": "<BMK_BM_SRC>",
2707
2792
  "source-layer": "earth",
2708
2793
  "filter": ["in", "kind", "island"],
2709
2794
  "layout": {
@@ -2722,7 +2807,7 @@ const fn = `[
2722
2807
  {
2723
2808
  "id": "water_label_lakes",
2724
2809
  "type": "symbol",
2725
- "source": "__protomaps_source",
2810
+ "source": "<BMK_BM_SRC>",
2726
2811
  "source-layer": "water",
2727
2812
  "filter": ["in", "kind", "lake", "water"],
2728
2813
  "layout": {
@@ -2747,7 +2832,7 @@ const fn = `[
2747
2832
  {
2748
2833
  "id": "roads_labels_major",
2749
2834
  "type": "symbol",
2750
- "source": "__protomaps_source",
2835
+ "source": "<BMK_BM_SRC>",
2751
2836
  "source-layer": "roads",
2752
2837
  "minzoom": 11,
2753
2838
  "filter": ["in", "kind", "highway", "major_road"],
@@ -2768,7 +2853,7 @@ const fn = `[
2768
2853
  {
2769
2854
  "id": "pois",
2770
2855
  "type": "symbol",
2771
- "source": "__protomaps_source",
2856
+ "source": "<BMK_BM_SRC>",
2772
2857
  "source-layer": "pois",
2773
2858
  "filter": [
2774
2859
  "all",
@@ -2877,7 +2962,7 @@ const fn = `[
2877
2962
  {
2878
2963
  "id": "places_subplace",
2879
2964
  "type": "symbol",
2880
- "source": "__protomaps_source",
2965
+ "source": "<BMK_BM_SRC>",
2881
2966
  "source-layer": "places",
2882
2967
  "filter": ["==", "kind", "neighbourhood"],
2883
2968
  "layout": {
@@ -2926,7 +3011,7 @@ const fn = `[
2926
3011
  {
2927
3012
  "id": "places_region",
2928
3013
  "type": "symbol",
2929
- "source": "__protomaps_source",
3014
+ "source": "<BMK_BM_SRC>",
2930
3015
  "source-layer": "places",
2931
3016
  "filter": ["==", "kind", "region"],
2932
3017
  "layout": {
@@ -2947,7 +3032,7 @@ const fn = `[
2947
3032
  {
2948
3033
  "id": "places_locality",
2949
3034
  "type": "symbol",
2950
- "source": "__protomaps_source",
3035
+ "source": "<BMK_BM_SRC>",
2951
3036
  "source-layer": "places",
2952
3037
  "filter": ["==", "kind", "locality"],
2953
3038
  "layout": {
@@ -3071,7 +3156,7 @@ const fn = `[
3071
3156
  {
3072
3157
  "id": "places_country",
3073
3158
  "type": "symbol",
3074
- "source": "__protomaps_source",
3159
+ "source": "<BMK_BM_SRC>",
3075
3160
  "source-layer": "places",
3076
3161
  "filter": ["==", "kind", "country"],
3077
3162
  "layout": {
@@ -3141,7 +3226,7 @@ const fn = `[
3141
3226
  {
3142
3227
  "id": "building_extrusion",
3143
3228
  "type": "fill-extrusion",
3144
- "source": "__protomaps_source",
3229
+ "source": "<BMK_BM_SRC>",
3145
3230
  "source-layer": "buildings",
3146
3231
  "filter": [
3147
3232
  "any",
@@ -3154,29 +3239,30 @@ const fn = `[
3154
3239
  "fill-extrusion-height": {"type": "identity", "property": "height"}
3155
3240
  }
3156
3241
  }
3242
+
3157
3243
  ]`;
3158
- function Y(n, e) {
3159
- const t = D.filter((o) => o.lang === n);
3244
+ function nn(n, e) {
3245
+ const t = U.filter((i) => i.lang === n);
3160
3246
  if (t.length === 0)
3161
3247
  throw new Error(
3162
- `The language "${n}". The languages available are: ${D.map((o) => o.lang).join(", ")}.`
3248
+ `The language "${n}". The languages available are: ${U.map((i) => i.lang).join(", ")}.`
3163
3249
  );
3164
3250
  if (e) {
3165
- if (t.filter((i) => i.script === e).length)
3251
+ if (t.filter((o) => o.script === e).length)
3166
3252
  return !0;
3167
3253
  throw new Error(
3168
- `The script "${e}" for the language "${n}" is unsupported. Script available for this language: ${t.map((i) => i.script).join(", ")}.`
3254
+ `The script "${e}" for the language "${n}" is unsupported. Script available for this language: ${t.map((o) => o.script).join(", ")}.`
3169
3255
  );
3170
3256
  }
3171
3257
  return !0;
3172
3258
  }
3173
- function yn() {
3259
+ function Mn() {
3174
3260
  const n = Intl.DateTimeFormat().resolvedOptions().locale.split("-")[0];
3175
- return Y(n, void 0) ? n : "en";
3261
+ return nn(n, void 0) ? n : "en";
3176
3262
  }
3177
- const E = {
3178
- avenue: fn
3179
- }, $ = {
3263
+ const F = {
3264
+ avenue: xn
3265
+ }, P = {
3180
3266
  "avenue-pop": {
3181
3267
  baseStyle: "avenue",
3182
3268
  colorEdit: {
@@ -3250,19 +3336,19 @@ const E = {
3250
3336
  contrast: [0.2, 200]
3251
3337
  }
3252
3338
  }
3253
- };
3254
- function kn() {
3255
- return Object.keys(E).concat(Object.keys($));
3339
+ }, H = "__bmk_bm_src", T = "__bmk_tr_src";
3340
+ function zn() {
3341
+ return Object.keys(F).concat(Object.keys(P));
3256
3342
  }
3257
- function xn(n, e) {
3258
- if (n in E)
3259
- return U({
3343
+ function Sn(n, e) {
3344
+ if (n in F)
3345
+ return V({
3260
3346
  ...e,
3261
3347
  baseStyleName: n
3262
3348
  });
3263
- if (n in $) {
3264
- const t = $[n];
3265
- return U({
3349
+ if (n in P) {
3350
+ const t = P[n];
3351
+ return V({
3266
3352
  ...e,
3267
3353
  baseStyleName: t.baseStyle,
3268
3354
  colorEdit: t.colorEdit
@@ -3270,20 +3356,20 @@ function xn(n, e) {
3270
3356
  }
3271
3357
  throw new Error(`The style "${n}" does not exist as a base style, nor as a preset.`);
3272
3358
  }
3273
- function U(n) {
3359
+ function V(n) {
3274
3360
  let e, t;
3275
- const o = n.hideLabels ?? !1;
3276
- if (o)
3361
+ const i = n.hideLabels ?? !1;
3362
+ if (i)
3277
3363
  e = '""', t = '""';
3278
- else if (typeof n.lang == "string" && Y(n.lang, n.script))
3279
- e = JSON.stringify(q(n.lang, n.script)), t = JSON.stringify(P(n.lang, n.script));
3364
+ else if (typeof n.lang == "string" && nn(n.lang, n.script))
3365
+ e = JSON.stringify(W(n.lang, n.script)), t = JSON.stringify(J(n.lang, n.script));
3280
3366
  else {
3281
- const g = yn();
3282
- e = JSON.stringify(q(g)), t = JSON.stringify(P(g));
3367
+ const k = Mn();
3368
+ e = JSON.stringify(W(k)), t = JSON.stringify(J(k));
3283
3369
  }
3284
- if (!(n.baseStyleName in E))
3370
+ if (!(n.baseStyleName in F))
3285
3371
  throw new Error(`The base style ${n.baseStyleName} does not exist.`);
3286
- const l = E[n.baseStyleName].replaceAll('"<LANG>"', t).replaceAll('"<LANG_COUNTRY>"', e);
3372
+ const l = F[n.baseStyleName].replaceAll("<BMK_BM_SRC>", H).replaceAll("<BMK_TR_SRC>", T).replaceAll('"<LANG>"', t).replaceAll('"<LANG_COUNTRY>"', e);
3287
3373
  let r;
3288
3374
  if (typeof n.tilejson == "string")
3289
3375
  r = n.tilejson;
@@ -3291,57 +3377,77 @@ function U(n) {
3291
3377
  r = `pmtiles://${n.pmtiles}`;
3292
3378
  else
3293
3379
  throw new Error('At least one option of "tilejson" or "pmtiles" must be provided as data source.');
3294
- let a = JSON.parse(l);
3295
- const s = n.hidePOIs ?? !1;
3296
- if (s && (a = a.filter((g) => g.id !== "pois")), o) {
3297
- const g = a.filter((p) => p.id === "pois");
3298
- if (g.length) {
3299
- const p = g[0];
3300
- if (p.layout !== void 0) {
3301
- const v = p.layout;
3302
- v["text-field"] !== void 0 && (v["text-field"] = "");
3380
+ let a = "", s = !1, u = "", y = 0;
3381
+ n.terrain && (typeof n.terrain.tilejson == "string" ? a = n.terrain.tilejson : typeof n.terrain.pmtiles == "string" && (a = `pmtiles://${n.terrain.pmtiles}`), a && (s = n.terrain.hillshading ?? !0, y = n.terrain.exaggeration ?? 0), u = n.terrain.encoding ?? "mapbox");
3382
+ let _ = JSON.parse(l);
3383
+ const N = n.hidePOIs ?? !1;
3384
+ if (s || (_ = _.filter((k) => k.id !== "hillshader")), N && (_ = _.filter((k) => k.id !== "pois")), i) {
3385
+ const k = _.filter((h) => h.id === "pois");
3386
+ if (k.length) {
3387
+ const h = k[0];
3388
+ if (h.layout !== void 0) {
3389
+ const w = h.layout;
3390
+ w["text-field"] !== void 0 && (w["text-field"] = "");
3303
3391
  }
3304
3392
  }
3305
- a = a.filter((p) => p.id === "pois" || p.type !== "symbol" ? !0 : !(p.layout !== void 0 && p.layout["text-field"] !== void 0));
3393
+ _ = _.filter((h) => h.id === "pois" || h.type !== "symbol" ? !0 : !(h.layout !== void 0 && h.layout["text-field"] !== void 0));
3306
3394
  }
3307
- const u = n.colorEdit ?? {}, _ = u.brightness ?? 0, m = u.hueRotation ?? 0, F = u.saturation ?? 0, G = u.negate ?? !1, O = u.brightnessShift ?? 0, j = u.exposure ?? 0;
3308
- return (_ !== 0 || m !== 0 || F !== 0 || G === !0 || u.multiplyColor !== void 0 || u.mixColor !== void 0 || O !== 0 || u.contrast !== void 0 || j !== 0) && T(a, (g) => {
3309
- g === "#a6e085" && console.log("#a6e085");
3310
- let p = h(g);
3311
- if (G && (p = p.negate()), m !== 0 && (p = p.rotate(m)), F !== 0 && (p = p.saturate(F)), _ > 0 ? p = p.lighten(_) : _ < 0 && (p = p.darken(_ * -1)), O !== 0) {
3312
- const M = p.hsl().array();
3313
- M[2] += O * 100, p = h.hsl(...M);
3314
- }
3315
- Array.isArray(u.mixColor) && typeof u.mixColor[0] == "string" && typeof u.mixColor[1] == "number" && u.mixColor[1] !== 0 && (p = p.mix(h(u.mixColor[0]), u.mixColor[1]));
3316
- const v = p.rgb(), H = v.alpha();
3317
- let x = [v.red(), v.green(), v.blue()];
3318
- if (j !== 0 && (x = un(x, j)), Array.isArray(u.contrast) && typeof u.contrast[0] == "number" && typeof u.contrast[1] == "number" && u.contrast[0] !== 0 && (x = dn(x, u.contrast[0], u.contrast[1])), Array.isArray(u.multiplyColor) && typeof u.multiplyColor[0] == "string" && typeof u.multiplyColor[1] == "number" && u.multiplyColor[1] !== 0) {
3319
- const M = h(u.multiplyColor[0]);
3320
- x = _n(
3321
- x,
3322
- [M.red(), M.green(), M.blue()],
3323
- u.multiplyColor[1]
3395
+ const d = n.colorEdit ?? {}, R = d.brightness ?? 0, E = d.hueRotation ?? 0, O = d.saturation ?? 0, q = d.negate ?? !1, j = d.brightnessShift ?? 0, I = d.exposure ?? 0;
3396
+ return (R !== 0 || E !== 0 || O !== 0 || q === !0 || d.multiplyColor !== void 0 || d.mixColor !== void 0 || j !== 0 || d.contrast !== void 0 || I !== 0) && G(_, (k) => {
3397
+ let h = f(k);
3398
+ if (q && (h = h.negate()), E !== 0 && (h = h.rotate(E)), O !== 0 && (h = h.saturate(O)), R > 0 ? h = h.lighten(R) : R < 0 && (h = h.darken(R * -1)), j !== 0) {
3399
+ const z = h.hsl().array();
3400
+ z[2] += j * 100, h = f.hsl(...z);
3401
+ }
3402
+ Array.isArray(d.mixColor) && typeof d.mixColor[0] == "string" && typeof d.mixColor[1] == "number" && d.mixColor[1] !== 0 && (h = h.mix(f(d.mixColor[0]), d.mixColor[1]));
3403
+ const w = h.rgb(), en = w.alpha();
3404
+ let M = [w.red(), w.green(), w.blue()];
3405
+ if (I !== 0 && (M = yn(M, I)), Array.isArray(d.contrast) && typeof d.contrast[0] == "number" && typeof d.contrast[1] == "number" && d.contrast[0] !== 0 && (M = gn(M, d.contrast[0], d.contrast[1])), Array.isArray(d.multiplyColor) && typeof d.multiplyColor[0] == "string" && typeof d.multiplyColor[1] == "number" && d.multiplyColor[1] !== 0) {
3406
+ const z = f(d.multiplyColor[0]);
3407
+ M = kn(
3408
+ M,
3409
+ [z.red(), z.green(), z.blue()],
3410
+ d.multiplyColor[1]
3324
3411
  );
3325
3412
  }
3326
- const L = h({ r: x[0], g: x[1], b: x[2], alpha: H });
3327
- return g.startsWith("rgba(") || g.startsWith("rgb(") ? L.rgb().toString() : g.startsWith("hsl(") || g.startsWith("hsla(") ? L.hsl().toString() : L.hexa();
3413
+ const L = f({ r: M[0], g: M[1], b: M[2], alpha: en });
3414
+ return k.startsWith("rgba(") || k.startsWith("rgb(") ? L.rgb().toString() : k.startsWith("hsl(") || k.startsWith("hsla(") ? L.hsl().toString() : L.hexa();
3328
3415
  }), {
3329
3416
  version: 8,
3330
- ...n.sprite && !s ? { sprite: n.sprite } : {},
3417
+ ...n.sprite && !N ? { sprite: n.sprite } : {},
3331
3418
  glyphs: n.glyphs,
3332
3419
  sources: {
3333
- __protomaps_source: {
3420
+ [H]: {
3334
3421
  type: "vector",
3335
3422
  url: r,
3336
3423
  attribution: "<a href='https://openstreetmap.org/copyright'>© OpenStreetMap Contributors</a>"
3337
- }
3424
+ },
3425
+ // Add the terrain source if terrain source is provided and the hillshading
3426
+ // or terrain is enabled.
3427
+ ...a && (y || s) ? {
3428
+ [T]: {
3429
+ url: a,
3430
+ type: "raster-dem",
3431
+ encoding: u
3432
+ }
3433
+ } : {}
3338
3434
  },
3339
- layers: a
3435
+ layers: _,
3436
+ projection: { type: ["interpolate", ["linear"], ["zoom"], 7, "vertical-perspective", 8, "mercator"] },
3437
+ // Add the terrain if the terrain source is provided and the exaggeration is superior to 0
3438
+ ...a && y ? {
3439
+ terrain: {
3440
+ source: T,
3441
+ exaggeration: y
3442
+ }
3443
+ } : {}
3340
3444
  };
3341
3445
  }
3342
3446
  export {
3343
- U as buildStyle,
3344
- xn as getStyle,
3345
- kn as getStyleList
3447
+ H as BASEMAPKIT_BASEMAP_SOURCE_ID,
3448
+ T as BASEMAPKIT_TERRAIN_SOURCE_ID,
3449
+ V as buildStyle,
3450
+ Sn as getStyle,
3451
+ zn as getStyleList
3346
3452
  };
3347
3453
  //# sourceMappingURL=basemapkit.js.map