@datagouv/components-next 1.0.2-dev.112 → 1.0.2-dev.114

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.
Files changed (31) hide show
  1. package/dist/{Control-ZFh5ta_U.js → Control-b-43UT2B.js} +10 -10
  2. package/dist/{Datafair.client-CKB2P_X1.js → Datafair.client-BH351yV9.js} +4 -4
  3. package/dist/{Event-DSQcW7OF.js → Event-py_AAwJY.js} +18 -18
  4. package/dist/{Image-BijNEG0p.js → Image-BHQYZWzH.js} +23 -23
  5. package/dist/{JsonPreview.client-Bx11-jfT.js → JsonPreview.client-CawLfTe_.js} +5 -5
  6. package/dist/{Map-BUtPf5GN.js → Map-CtP7leHl.js} +1313 -1173
  7. package/dist/{MapContainer.client-CdZSeT_L.js → MapContainer.client-DN8kHTOA.js} +17 -17
  8. package/dist/{OSM-D4MTdBtk.js → OSM-gdDSIsDA.js} +15 -23
  9. package/dist/{PdfPreview.client-Bh9lP-qU.js → PdfPreview.client-BGOycK0h.js} +6 -10
  10. package/dist/Pmtiles.client-CRaI4U8S.js +26123 -0
  11. package/dist/{PreviewWrapper.vue_vue_type_script_setup_true_lang-BnC7vWGP.js → PreviewWrapper.vue_vue_type_script_setup_true_lang-DAddoRna.js} +2 -2
  12. package/dist/{ScaleLine-hJQIqcZm.js → ScaleLine-hG-FhNqy.js} +2 -2
  13. package/dist/{Tile-Dcl7oIVu.js → Tile-D6rFonpT.js} +163 -166
  14. package/dist/{TileImage-BJeHipMX.js → TileImage-cfrEgz5y.js} +131 -119
  15. package/dist/{View-xp_P_OHw.js → View-vp7vDb9q.js} +169 -119
  16. package/dist/{XmlPreview.client-oFAOv828.js → XmlPreview.client-Dyv0J4kw.js} +5 -5
  17. package/dist/{common-BjQlan3k.js → common-C8efyyuc.js} +49 -49
  18. package/dist/components-next.css +1 -52
  19. package/dist/components-next.js +36 -36
  20. package/dist/components.css +2 -2
  21. package/dist/{index-CxCuKQ81.js → index-_qLRU0Z5.js} +6382 -6057
  22. package/dist/{leaflet-src-7m1mB8LI.js → leaflet-src-D_sX6kLJ.js} +162 -164
  23. package/dist/{main-CQ9ZQG7n.js → main-CR8bhz_w.js} +19161 -20321
  24. package/dist/{proj-CsNo9yH1.js → proj-CsjVeojN.js} +322 -306
  25. package/dist/{text-clamp.esm-B5kW_XMt.js → text-clamp.esm-DVseBqZZ.js} +4 -4
  26. package/dist/{tilecoord-A0fLnBZr.js → tilecoord-CPcQJnrF.js} +270 -261
  27. package/dist/{vue3-json-viewer-BXwup7nO.js → vue3-json-viewer-CJLQFzXZ.js} +10 -16
  28. package/dist/{vue3-xml-viewer.common-B9qp90K_.js → vue3-xml-viewer.common-DRgxPToX.js} +1 -1
  29. package/package.json +34 -34
  30. package/src/components/ResourceAccordion/Pmtiles.client.vue +3 -1
  31. package/dist/Pmtiles.client-Bi46wN14.js +0 -25185
@@ -1,14 +1,14 @@
1
- import { T as _, W as nt, n as xt, c as H, b as et } from "./Image-BijNEG0p.js";
2
- import { z as Tt, g as pt } from "./common-BjQlan3k.js";
3
- import { aD as It, E as ft, al as Xt, U as dt, g as at, X as Wt, w as Mt, F as b, n as _t, L, an as gt, aU as vt, x as Yt, r as Lt, aV as Ft, ak as wt, aJ as yt, aA as Dt, aK as Ot, aW as st, ae as ot, i as Ct, W as z, a1 as $, d as V, l as Pt, u as rt, a7 as ht, I as At, a as Rt } from "./proj-CsNo9yH1.js";
1
+ import { T as d, b as nt, l as xt, c as H, r as st } from "./Image-BHQYZWzH.js";
2
+ import { f as Tt, b as pt } from "./common-C8efyyuc.js";
3
+ import { c as It, E as ft, d as Xt, aS as _t, ag as rt, u as Mt, X as vt, ae as b, ao as y, ai as dt, aI as Wt, y as gt, aa as Yt, $ as yt, I as Pt, ak as Lt, aj as Ot, a9 as Ft, a8 as wt, a7 as et, m as ot, aq as Dt, aA as $, Y as z, af as V, ax as Ct, aV as at, p as ht, aX as At, am as Rt } from "./proj-CsjVeojN.js";
4
4
  class mt extends It {
5
5
  /**
6
6
  * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
7
7
  * @param {import("./TileState.js").default} state State.
8
8
  * @param {Options} [options] Tile options.
9
9
  */
10
- constructor(t, e, s) {
11
- super(), s = s || {}, this.tileCoord = t, this.state = e, this.key = "", this.transition_ = s.transition === void 0 ? 250 : s.transition, this.transitionStarts_ = {}, this.interpolate = !!s.interpolate;
10
+ constructor(t, s, e) {
11
+ super(), e = e || {}, this.tileCoord = t, this.state = s, this.key = "", this.transition_ = e.transition === void 0 ? 250 : e.transition, this.transitionStarts_ = {}, this.interpolate = !!e.interpolate;
12
12
  }
13
13
  /**
14
14
  * @protected
@@ -20,7 +20,7 @@ class mt extends It {
20
20
  * Called by the tile cache when the tile is removed from the cache due to expiry
21
21
  */
22
22
  release() {
23
- this.setState(_.EMPTY);
23
+ this.setState(d.EMPTY);
24
24
  }
25
25
  /**
26
26
  * @return {string} Key.
@@ -51,8 +51,8 @@ class mt extends It {
51
51
  * @api
52
52
  */
53
53
  setState(t) {
54
- if (this.state !== _.EMPTY) {
55
- if (this.state !== _.ERROR && this.state > t)
54
+ if (this.state !== d.EMPTY) {
55
+ if (this.state !== d.ERROR && this.state > t)
56
56
  throw new Error("Tile load sequence violation");
57
57
  this.state = t, this.changed();
58
58
  }
@@ -73,16 +73,16 @@ class mt extends It {
73
73
  * @param {number} time The render frame time.
74
74
  * @return {number} A number between 0 and 1.
75
75
  */
76
- getAlpha(t, e) {
76
+ getAlpha(t, s) {
77
77
  if (!this.transition_)
78
78
  return 1;
79
- let s = this.transitionStarts_[t];
80
- if (!s)
81
- s = e, this.transitionStarts_[t] = s;
82
- else if (s === -1)
79
+ let e = this.transitionStarts_[t];
80
+ if (!e)
81
+ e = s, this.transitionStarts_[t] = e;
82
+ else if (e === -1)
83
83
  return 1;
84
- const n = e - s + 1e3 / 60;
85
- return n >= this.transition_ ? 1 : Tt(n / this.transition_);
84
+ const r = s - e + 1e3 / 60;
85
+ return r >= this.transition_ ? 1 : Tt(r / this.transition_);
86
86
  }
87
87
  /**
88
88
  * Determine if a tile is in an alpha transition. A tile is considered in
@@ -108,17 +108,17 @@ class mt extends It {
108
108
  this.release(), super.disposeInternal();
109
109
  }
110
110
  }
111
- class zt extends mt {
111
+ class $t extends mt {
112
112
  /**
113
113
  * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
114
114
  * @param {import("./TileState.js").default} state State.
115
115
  * @param {string} src Image source URI.
116
- * @param {?string} crossOrigin Cross origin.
116
+ * @param {import('./dom.js').ImageAttributes} imageAttributes Image attributes options.
117
117
  * @param {import("./Tile.js").LoadFunction} tileLoadFunction Tile load function.
118
118
  * @param {import("./Tile.js").Options} [options] Tile options.
119
119
  */
120
- constructor(t, e, s, n, i, c) {
121
- super(t, e, c), this.crossOrigin_ = n, this.src_ = s, this.key = s, this.image_, nt ? this.image_ = new OffscreenCanvas(1, 1) : (this.image_ = new Image(), n !== null && (this.image_.crossOrigin = n)), this.unlisten_ = null, this.tileLoadFunction_ = i;
120
+ constructor(t, s, e, r, i, c) {
121
+ super(t, s, c), this.crossOrigin_ = r?.crossOrigin, this.referrerPolicy_ = r?.referrerPolicy, this.src_ = e, this.key = e, this.image_, nt ? this.image_ = new OffscreenCanvas(1, 1) : (this.image_ = new Image(), this.crossOrigin_ !== null && (this.image_.crossOrigin = this.crossOrigin_), this.referrerPolicy_ !== void 0 && (this.image_.referrerPolicy = this.referrerPolicy_)), this.unlisten_ = null, this.tileLoadFunction_ = i;
122
122
  }
123
123
  /**
124
124
  * Get the HTML image element for this tile (may be a Canvas, OffscreenCanvas, Image, or Video).
@@ -133,7 +133,7 @@ class zt extends mt {
133
133
  * @param {HTMLCanvasElement|OffscreenCanvas|HTMLImageElement} element Element.
134
134
  */
135
135
  setImage(t) {
136
- this.image_ = t, this.state = _.LOADED, this.unlistenImage_(), this.changed();
136
+ this.image_ = t, this.state = d.LOADED, this.unlistenImage_(), this.changed();
137
137
  }
138
138
  /**
139
139
  * Get the cross origin of the ImageTile.
@@ -142,13 +142,20 @@ class zt extends mt {
142
142
  getCrossOrigin() {
143
143
  return this.crossOrigin_;
144
144
  }
145
+ /**
146
+ * Get the referrer policy of the ImageTile.
147
+ * @return {ReferrerPolicy} Referrer policy.
148
+ */
149
+ getReferrerPolicy() {
150
+ return this.referrerPolicy_;
151
+ }
145
152
  /**
146
153
  * Tracks loading or read errors.
147
154
  *
148
155
  * @private
149
156
  */
150
157
  handleImageError_() {
151
- this.state = _.ERROR, this.unlistenImage_(), this.image_ = kt(), this.changed();
158
+ this.state = d.ERROR, this.unlistenImage_(), this.image_ = kt(), this.changed();
152
159
  }
153
160
  /**
154
161
  * Tracks successful image load.
@@ -157,13 +164,13 @@ class zt extends mt {
157
164
  */
158
165
  handleImageLoad_() {
159
166
  if (nt)
160
- this.state = _.LOADED;
167
+ this.state = d.LOADED;
161
168
  else {
162
169
  const t = (
163
170
  /** @type {HTMLImageElement} */
164
171
  this.image_
165
172
  );
166
- t.naturalWidth && t.naturalHeight ? this.state = _.LOADED : this.state = _.EMPTY;
173
+ t.naturalWidth && t.naturalHeight ? this.state = d.LOADED : this.state = d.EMPTY;
167
174
  }
168
175
  this.unlistenImage_(), this.changed();
169
176
  }
@@ -205,7 +212,7 @@ class zt extends mt {
205
212
  * @override
206
213
  */
207
214
  load() {
208
- this.state == _.ERROR && (this.state = _.IDLE, this.image_ = new Image(), this.crossOrigin_ !== null && (this.image_.crossOrigin = this.crossOrigin_)), this.state == _.IDLE && (this.state = _.LOADING, this.changed(), this.tileLoadFunction_(this, this.src_), this.unlisten_ = xt(
215
+ this.state == d.ERROR && (this.state = d.IDLE, this.image_ = new Image(), this.crossOrigin_ !== null && (this.image_.crossOrigin = this.crossOrigin_), this.referrerPolicy_ !== void 0 && (this.image_.referrerPolicy = this.referrerPolicy_)), this.state == d.IDLE && (this.state = d.LOADING, this.changed(), this.tileLoadFunction_(this, this.src_), this.unlisten_ = xt(
209
216
  this.image_,
210
217
  this.handleImageLoad_.bind(this),
211
218
  this.handleImageError_.bind(this)
@@ -227,8 +234,8 @@ class zt extends mt {
227
234
  }
228
235
  }
229
236
  function kt() {
230
- const a = H(1, 1);
231
- return a.fillStyle = "rgba(0,0,0,0)", a.fillRect(0, 0, 1, 1), a.canvas;
237
+ const n = H(1, 1);
238
+ return n.fillStyle = "rgba(0,0,0,0)", n.fillRect(0, 0, 1, 1), n.canvas;
232
239
  }
233
240
  class Bt {
234
241
  /**
@@ -237,8 +244,8 @@ class Bt {
237
244
  * @param {number} minY Minimum Y.
238
245
  * @param {number} maxY Maximum Y.
239
246
  */
240
- constructor(t, e, s, n) {
241
- this.minX = t, this.maxX = e, this.minY = s, this.maxY = n;
247
+ constructor(t, s, e, r) {
248
+ this.minX = t, this.maxX = s, this.minY = e, this.maxY = r;
242
249
  }
243
250
  /**
244
251
  * @param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
@@ -259,8 +266,8 @@ class Bt {
259
266
  * @param {number} y Tile coordinate y.
260
267
  * @return {boolean} Contains coordinate.
261
268
  */
262
- containsXY(t, e) {
263
- return this.minX <= t && t <= this.maxX && this.minY <= e && e <= this.maxY;
269
+ containsXY(t, s) {
270
+ return this.minX <= t && t <= this.maxX && this.minY <= s && s <= this.maxY;
264
271
  }
265
272
  /**
266
273
  * @param {TileRange} tileRange Tile range.
@@ -301,97 +308,97 @@ class Bt {
301
308
  return this.minX <= t.maxX && this.maxX >= t.minX && this.minY <= t.maxY && this.maxY >= t.minY;
302
309
  }
303
310
  }
304
- function $t(a, t, e, s, n) {
305
- return n !== void 0 ? (n.minX = a, n.maxX = t, n.minY = e, n.maxY = s, n) : new Bt(a, t, e, s);
311
+ function zt(n, t, s, e, r) {
312
+ return r !== void 0 ? (r.minX = n, r.maxX = t, r.minY = s, r.maxY = e, r) : new Bt(n, t, s, e);
306
313
  }
307
314
  let J;
308
315
  const B = [];
309
- function ct(a, t, e, s, n) {
310
- a.beginPath(), a.moveTo(0, 0), a.lineTo(t, e), a.lineTo(s, n), a.closePath(), a.save(), a.clip(), a.fillRect(0, 0, Math.max(t, s) + 1, Math.max(e, n)), a.restore();
316
+ function ct(n, t, s, e, r) {
317
+ n.beginPath(), n.moveTo(0, 0), n.lineTo(t, s), n.lineTo(e, r), n.closePath(), n.save(), n.clip(), n.fillRect(0, 0, Math.max(t, e) + 1, Math.max(s, r)), n.restore();
311
318
  }
312
- function tt(a, t) {
313
- return Math.abs(a[t * 4] - 210) > 2 || Math.abs(a[t * 4 + 3] - 0.75 * 255) > 2;
319
+ function tt(n, t) {
320
+ return Math.abs(n[t * 4] - 210) > 2 || Math.abs(n[t * 4 + 3] - 0.75 * 255) > 2;
314
321
  }
315
322
  function Gt() {
316
323
  if (J === void 0) {
317
- const a = H(6, 6, B);
318
- a.globalCompositeOperation = "lighter", a.fillStyle = "rgba(210, 0, 0, 0.75)", ct(a, 4, 5, 4, 0), ct(a, 4, 5, 0, 5);
319
- const t = a.getImageData(0, 0, 3, 3).data;
320
- J = tt(t, 0) || tt(t, 4) || tt(t, 8), et(a), B.push(a.canvas);
324
+ const n = H(6, 6, B);
325
+ n.globalCompositeOperation = "lighter", n.fillStyle = "rgba(210, 0, 0, 0.75)", ct(n, 4, 5, 4, 0), ct(n, 4, 5, 0, 5);
326
+ const t = n.getImageData(0, 0, 3, 3).data;
327
+ J = tt(t, 0) || tt(t, 4) || tt(t, 8), st(n), B.push(n.canvas);
321
328
  }
322
329
  return J;
323
330
  }
324
- function ut(a, t, e, s) {
325
- const n = dt(e, t, a);
326
- let i = at(
331
+ function ut(n, t, s, e) {
332
+ const r = _t(s, t, n);
333
+ let i = rt(
327
334
  t,
328
- s,
329
- e
335
+ e,
336
+ s
330
337
  );
331
338
  const c = t.getMetersPerUnit();
332
339
  c !== void 0 && (i *= c);
333
- const m = a.getMetersPerUnit();
340
+ const m = n.getMetersPerUnit();
334
341
  m !== void 0 && (i /= m);
335
- const g = a.getExtent();
336
- if (!g || Wt(g, n)) {
337
- const T = at(a, i, n) / i;
342
+ const g = n.getExtent();
343
+ if (!g || Mt(g, r)) {
344
+ const T = rt(n, i, r) / i;
338
345
  isFinite(T) && T > 0 && (i /= T);
339
346
  }
340
347
  return i;
341
348
  }
342
- function Kt(a, t, e, s) {
343
- const n = Yt(e);
349
+ function Nt(n, t, s, e) {
350
+ const r = Yt(s);
344
351
  let i = ut(
345
- a,
346
- t,
347
352
  n,
348
- s
353
+ t,
354
+ r,
355
+ e
349
356
  );
350
- return (!isFinite(i) || i <= 0) && Lt(e, function(c) {
357
+ return (!isFinite(i) || i <= 0) && yt(s, function(c) {
351
358
  return i = ut(
352
- a,
359
+ n,
353
360
  t,
354
361
  c,
355
- s
362
+ e
356
363
  ), isFinite(i) && i > 0;
357
364
  }), i;
358
365
  }
359
- function Nt(a, t, e, s, n, i, c, m, g, T, X, x, F, w) {
360
- const r = H(
361
- Math.round(e * a),
362
- Math.round(e * t),
366
+ function St(n, t, s, e, r, i, c, m, g, T, X, x, P, L) {
367
+ const a = H(
368
+ Math.round(s * n),
369
+ Math.round(s * t),
363
370
  B
364
371
  );
365
- if (x || (r.imageSmoothingEnabled = !1), g.length === 0)
366
- return r.canvas;
367
- r.scale(e, e);
372
+ if (x || (a.imageSmoothingEnabled = !1), g.length === 0)
373
+ return a.canvas;
374
+ a.scale(s, s);
368
375
  function h(o) {
369
- return Math.round(o * e) / e;
376
+ return Math.round(o * s) / s;
370
377
  }
371
- r.globalCompositeOperation = "lighter";
372
- const E = _t();
373
- g.forEach(function(o, y, C) {
374
- Mt(E, o.extent);
378
+ a.globalCompositeOperation = "lighter";
379
+ const E = gt();
380
+ g.forEach(function(o, O, w) {
381
+ vt(E, o.extent);
375
382
  });
376
383
  let l;
377
- const f = e / s, d = (x ? 1 : 1 + Math.pow(2, -24)) / f;
378
- (!F || g.length !== 1 || T !== 0) && (l = H(
379
- Math.round(L(E) * f),
384
+ const f = s / e, _ = (x ? 1 : 1 + Math.pow(2, -24)) / f;
385
+ (!P || g.length !== 1 || T !== 0) && (l = H(
386
+ Math.round(y(E) * f),
380
387
  Math.round(b(E) * f),
381
388
  B
382
- ), x || (l.imageSmoothingEnabled = !1), g.forEach(function(o, y, C) {
389
+ ), x || (l.imageSmoothingEnabled = !1), g.forEach(function(o, O, w) {
383
390
  if (o.image.width > 0 && o.image.height > 0) {
384
391
  if (o.clipExtent) {
385
392
  l.save();
386
- const W = (o.clipExtent[0] - E[0]) * f, M = -(o.clipExtent[3] - E[3]) * f, D = L(o.clipExtent) * f, A = b(o.clipExtent) * f;
393
+ const M = (o.clipExtent[0] - E[0]) * f, W = -(o.clipExtent[3] - E[3]) * f, D = y(o.clipExtent) * f, A = b(o.clipExtent) * f;
387
394
  l.rect(
388
- x ? W : Math.round(W),
389
395
  x ? M : Math.round(M),
390
- x ? D : Math.round(W + D) - Math.round(W),
391
- x ? A : Math.round(M + A) - Math.round(M)
396
+ x ? W : Math.round(W),
397
+ x ? D : Math.round(M + D) - Math.round(M),
398
+ x ? A : Math.round(W + A) - Math.round(W)
392
399
  ), l.clip();
393
400
  }
394
- const p = (o.extent[0] - E[0]) * f, I = -(o.extent[3] - E[3]) * f, v = L(o.extent) * f, Y = b(o.extent) * f;
401
+ const p = (o.extent[0] - E[0]) * f, I = -(o.extent[3] - E[3]) * f, v = y(o.extent) * f, Y = b(o.extent) * f;
395
402
  l.drawImage(
396
403
  o.image,
397
404
  T,
@@ -405,69 +412,69 @@ function Nt(a, t, e, s, n, i, c, m, g, T, X, x, F, w) {
405
412
  ), o.clipExtent && l.restore();
406
413
  }
407
414
  }));
408
- const u = gt(c);
409
- return m.getTriangles().forEach(function(o, y, C) {
415
+ const u = dt(c);
416
+ return m.getTriangles().forEach(function(o, O, w) {
410
417
  const p = o.source, I = o.target;
411
- let v = p[0][0], Y = p[0][1], W = p[1][0], M = p[1][1], D = p[2][0], A = p[2][1];
412
- const G = h((I[0][0] - u[0]) / i), K = h(
418
+ let v = p[0][0], Y = p[0][1], M = p[1][0], W = p[1][1], D = p[2][0], A = p[2][1];
419
+ const G = h((I[0][0] - u[0]) / i), N = h(
413
420
  -(I[0][1] - u[1]) / i
414
421
  ), R = h((I[1][0] - u[0]) / i), k = h(
415
422
  -(I[1][1] - u[1]) / i
416
- ), U = h((I[2][0] - u[0]) / i), Q = h(
423
+ ), Q = h((I[2][0] - u[0]) / i), U = h(
417
424
  -(I[2][1] - u[1]) / i
418
425
  ), j = v, q = Y;
419
- v = 0, Y = 0, W -= j, M -= q, D -= j, A -= q;
426
+ v = 0, Y = 0, M -= j, W -= q, D -= j, A -= q;
420
427
  const Et = [
421
- [W, M, 0, 0, R - G],
422
- [D, A, 0, 0, U - G],
423
- [0, 0, W, M, k - K],
424
- [0, 0, D, A, Q - K]
425
- ], N = vt(Et);
426
- if (!N)
428
+ [M, W, 0, 0, R - G],
429
+ [D, A, 0, 0, Q - G],
430
+ [0, 0, M, W, k - N],
431
+ [0, 0, D, A, U - N]
432
+ ], S = Wt(Et);
433
+ if (!S)
427
434
  return;
428
- if (r.save(), r.beginPath(), Gt() || !x) {
429
- r.moveTo(R, k);
430
- const O = 4, S = G - R, it = K - k;
431
- for (let P = 0; P < O; P++)
432
- r.lineTo(
433
- R + h((P + 1) * S / O),
434
- k + h(P * it / (O - 1))
435
- ), P != O - 1 && r.lineTo(
436
- R + h((P + 1) * S / O),
437
- k + h((P + 1) * it / (O - 1))
435
+ if (a.save(), a.beginPath(), Gt() || !x) {
436
+ a.moveTo(R, k);
437
+ const F = 4, K = G - R, it = N - k;
438
+ for (let C = 0; C < F; C++)
439
+ a.lineTo(
440
+ R + h((C + 1) * K / F),
441
+ k + h(C * it / (F - 1))
442
+ ), C != F - 1 && a.lineTo(
443
+ R + h((C + 1) * K / F),
444
+ k + h((C + 1) * it / (F - 1))
438
445
  );
439
- r.lineTo(U, Q);
446
+ a.lineTo(Q, U);
440
447
  } else
441
- r.moveTo(R, k), r.lineTo(G, K), r.lineTo(U, Q);
442
- r.clip(), r.transform(
443
- N[0],
444
- N[2],
445
- N[1],
446
- N[3],
448
+ a.moveTo(R, k), a.lineTo(G, N), a.lineTo(Q, U);
449
+ a.clip(), a.transform(
450
+ S[0],
451
+ S[2],
452
+ S[1],
453
+ S[3],
447
454
  G,
448
- K
449
- ), r.translate(
455
+ N
456
+ ), a.translate(
450
457
  E[0] - j,
451
458
  E[3] - q
452
459
  );
453
460
  let Z;
454
461
  if (l)
455
- Z = l.canvas, r.scale(d, -d);
462
+ Z = l.canvas, a.scale(_, -_);
456
463
  else {
457
- const O = g[0], S = O.extent;
458
- Z = O.image, r.scale(
459
- L(S) / Z.width,
460
- -b(S) / Z.height
464
+ const F = g[0], K = F.extent;
465
+ Z = F.image, a.scale(
466
+ y(K) / Z.width,
467
+ -b(K) / Z.height
461
468
  );
462
469
  }
463
- r.drawImage(Z, 0, 0), r.restore();
464
- }), l && (et(l), B.push(l.canvas)), X && (r.save(), r.globalCompositeOperation = "source-over", r.strokeStyle = "black", r.lineWidth = 1, m.getTriangles().forEach(function(o, y, C) {
465
- const p = o.target, I = (p[0][0] - u[0]) / i, v = -(p[0][1] - u[1]) / i, Y = (p[1][0] - u[0]) / i, W = -(p[1][1] - u[1]) / i, M = (p[2][0] - u[0]) / i, D = -(p[2][1] - u[1]) / i;
466
- r.beginPath(), r.moveTo(Y, W), r.lineTo(I, v), r.lineTo(M, D), r.closePath(), r.stroke();
467
- }), r.restore()), r.canvas;
470
+ a.drawImage(Z, 0, 0), a.restore();
471
+ }), l && (st(l), B.push(l.canvas)), X && (a.save(), a.globalCompositeOperation = "source-over", a.strokeStyle = "black", a.lineWidth = 1, m.getTriangles().forEach(function(o, O, w) {
472
+ const p = o.target, I = (p[0][0] - u[0]) / i, v = -(p[0][1] - u[1]) / i, Y = (p[1][0] - u[0]) / i, M = -(p[1][1] - u[1]) / i, W = (p[2][0] - u[0]) / i, D = -(p[2][1] - u[1]) / i;
473
+ a.beginPath(), a.moveTo(Y, M), a.lineTo(I, v), a.lineTo(W, D), a.closePath(), a.stroke();
474
+ }), a.restore()), a.canvas;
468
475
  }
469
476
  const Zt = 10, lt = 0.25;
470
- class St {
477
+ class Kt {
471
478
  /**
472
479
  * @param {import("../proj/Projection.js").default} sourceProj Source projection.
473
480
  * @param {import("../proj/Projection.js").default} targetProj Target projection.
@@ -477,42 +484,42 @@ class St {
477
484
  * @param {?number} destinationResolution The (optional) resolution of the destination.
478
485
  * @param {import("../transform.js").Transform} [sourceMatrix] Source transform matrix.
479
486
  */
480
- constructor(t, e, s, n, i, c, m) {
481
- this.sourceProj_ = t, this.targetProj_ = e;
487
+ constructor(t, s, e, r, i, c, m) {
488
+ this.sourceProj_ = t, this.targetProj_ = s;
482
489
  let g = {};
483
- const T = m ? Ft(
484
- (d) => pt(
490
+ const T = m ? Pt(
491
+ (_) => pt(
485
492
  m,
486
- dt(d, this.targetProj_, this.sourceProj_)
493
+ _t(_, this.targetProj_, this.sourceProj_)
487
494
  )
488
- ) : wt(this.targetProj_, this.sourceProj_);
489
- this.transformInv_ = function(d) {
490
- const u = d[0] + "/" + d[1];
491
- return g[u] || (g[u] = T(d)), g[u];
492
- }, this.maxSourceExtent_ = n, this.errorThresholdSquared_ = i * i, this.triangles_ = [], this.wrapsXInSource_ = !1, this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!n && !!this.sourceProj_.getExtent() && L(n) >= L(this.sourceProj_.getExtent()), this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? L(this.sourceProj_.getExtent()) : null, this.targetWorldWidth_ = this.targetProj_.getExtent() ? L(this.targetProj_.getExtent()) : null;
493
- const X = gt(s), x = yt(s), F = Dt(s), w = Ot(s), r = this.transformInv_(X), h = this.transformInv_(x), E = this.transformInv_(F), l = this.transformInv_(w), f = Zt + (c ? Math.max(
495
+ ) : Lt(this.targetProj_, this.sourceProj_);
496
+ this.transformInv_ = function(_) {
497
+ const u = _[0] + "/" + _[1];
498
+ return g[u] || (g[u] = T(_)), g[u];
499
+ }, this.maxSourceExtent_ = r, this.errorThresholdSquared_ = i * i, this.triangles_ = [], this.wrapsXInSource_ = !1, this.canWrapXInSource_ = this.sourceProj_.canWrapX() && !!r && !!this.sourceProj_.getExtent() && y(r) >= y(this.sourceProj_.getExtent()), this.sourceWorldWidth_ = this.sourceProj_.getExtent() ? y(this.sourceProj_.getExtent()) : null, this.targetWorldWidth_ = this.targetProj_.getExtent() ? y(this.targetProj_.getExtent()) : null;
500
+ const X = dt(e), x = Ot(e), P = Ft(e), L = wt(e), a = this.transformInv_(X), h = this.transformInv_(x), E = this.transformInv_(P), l = this.transformInv_(L), f = Zt + (c ? Math.max(
494
501
  0,
495
502
  Math.ceil(
496
503
  Math.log2(
497
- st(s) / (c * c * 256 * 256)
504
+ et(e) / (c * c * 256 * 256)
498
505
  )
499
506
  )
500
507
  ) : 0);
501
508
  if (this.addQuad_(
502
509
  X,
503
510
  x,
504
- F,
505
- w,
506
- r,
511
+ P,
512
+ L,
513
+ a,
507
514
  h,
508
515
  E,
509
516
  l,
510
517
  f
511
518
  ), this.wrapsXInSource_) {
512
- let d = 1 / 0;
513
- this.triangles_.forEach(function(u, o, y) {
514
- d = Math.min(
515
- d,
519
+ let _ = 1 / 0;
520
+ this.triangles_.forEach(function(u, o, O) {
521
+ _ = Math.min(
522
+ _,
516
523
  u.source[0][0],
517
524
  u.source[1][0],
518
525
  u.source[2][0]
@@ -522,14 +529,14 @@ class St {
522
529
  u.source[0][0],
523
530
  u.source[1][0],
524
531
  u.source[2][0]
525
- ) - d > this.sourceWorldWidth_ / 2) {
532
+ ) - _ > this.sourceWorldWidth_ / 2) {
526
533
  const o = [
527
534
  [u.source[0][0], u.source[0][1]],
528
535
  [u.source[1][0], u.source[1][1]],
529
536
  [u.source[2][0], u.source[2][1]]
530
537
  ];
531
- o[0][0] - d > this.sourceWorldWidth_ / 2 && (o[0][0] -= this.sourceWorldWidth_), o[1][0] - d > this.sourceWorldWidth_ / 2 && (o[1][0] -= this.sourceWorldWidth_), o[2][0] - d > this.sourceWorldWidth_ / 2 && (o[2][0] -= this.sourceWorldWidth_);
532
- const y = Math.min(
538
+ o[0][0] - _ > this.sourceWorldWidth_ / 2 && (o[0][0] -= this.sourceWorldWidth_), o[1][0] - _ > this.sourceWorldWidth_ / 2 && (o[1][0] -= this.sourceWorldWidth_), o[2][0] - _ > this.sourceWorldWidth_ / 2 && (o[2][0] -= this.sourceWorldWidth_);
539
+ const O = Math.min(
533
540
  o[0][0],
534
541
  o[1][0],
535
542
  o[2][0]
@@ -538,7 +545,7 @@ class St {
538
545
  o[0][0],
539
546
  o[1][0],
540
547
  o[2][0]
541
- ) - y < this.sourceWorldWidth_ / 2 && (u.source = o);
548
+ ) - O < this.sourceWorldWidth_ / 2 && (u.source = o);
542
549
  }
543
550
  });
544
551
  }
@@ -554,10 +561,10 @@ class St {
554
561
  * @param {import("../coordinate.js").Coordinate} cSrc The source c coordinate.
555
562
  * @private
556
563
  */
557
- addTriangle_(t, e, s, n, i, c) {
564
+ addTriangle_(t, s, e, r, i, c) {
558
565
  this.triangles_.push({
559
- source: [n, i, c],
560
- target: [t, e, s]
566
+ source: [r, i, c],
567
+ target: [t, s, e]
561
568
  });
562
569
  }
563
570
  /**
@@ -576,93 +583,93 @@ class St {
576
583
  * @param {number} maxSubdivision Maximal allowed subdivision of the quad.
577
584
  * @private
578
585
  */
579
- addQuad_(t, e, s, n, i, c, m, g, T) {
580
- const X = ot([i, c, m, g]), x = this.sourceWorldWidth_ ? L(X) / this.sourceWorldWidth_ : null, F = (
586
+ addQuad_(t, s, e, r, i, c, m, g, T) {
587
+ const X = ot([i, c, m, g]), x = this.sourceWorldWidth_ ? y(X) / this.sourceWorldWidth_ : null, P = (
581
588
  /** @type {number} */
582
589
  this.sourceWorldWidth_
583
- ), w = this.sourceProj_.canWrapX() && x > 0.5 && x < 1;
584
- let r = !1;
590
+ ), L = this.sourceProj_.canWrapX() && x > 0.5 && x < 1;
591
+ let a = !1;
585
592
  if (T > 0) {
586
593
  if (this.targetProj_.isGlobal() && this.targetWorldWidth_) {
587
- const E = ot([t, e, s, n]);
588
- r = L(E) / this.targetWorldWidth_ > lt || r;
594
+ const E = ot([t, s, e, r]);
595
+ a = y(E) / this.targetWorldWidth_ > lt || a;
589
596
  }
590
- !w && this.sourceProj_.isGlobal() && x && (r = x > lt || r);
597
+ !L && this.sourceProj_.isGlobal() && x && (a = x > lt || a);
591
598
  }
592
- if (!r && this.maxSourceExtent_ && isFinite(X[0]) && isFinite(X[1]) && isFinite(X[2]) && isFinite(X[3]) && !Ct(X, this.maxSourceExtent_))
599
+ if (!a && this.maxSourceExtent_ && isFinite(X[0]) && isFinite(X[1]) && isFinite(X[2]) && isFinite(X[3]) && !Dt(X, this.maxSourceExtent_))
593
600
  return;
594
601
  let h = 0;
595
- if (!r && (!isFinite(i[0]) || !isFinite(i[1]) || !isFinite(c[0]) || !isFinite(c[1]) || !isFinite(m[0]) || !isFinite(m[1]) || !isFinite(g[0]) || !isFinite(g[1]))) {
602
+ if (!a && (!isFinite(i[0]) || !isFinite(i[1]) || !isFinite(c[0]) || !isFinite(c[1]) || !isFinite(m[0]) || !isFinite(m[1]) || !isFinite(g[0]) || !isFinite(g[1]))) {
596
603
  if (T > 0)
597
- r = !0;
604
+ a = !0;
598
605
  else if (h = (!isFinite(i[0]) || !isFinite(i[1]) ? 8 : 0) + (!isFinite(c[0]) || !isFinite(c[1]) ? 4 : 0) + (!isFinite(m[0]) || !isFinite(m[1]) ? 2 : 0) + (!isFinite(g[0]) || !isFinite(g[1]) ? 1 : 0), h != 1 && h != 2 && h != 4 && h != 8)
599
606
  return;
600
607
  }
601
608
  if (T > 0) {
602
- if (!r) {
603
- const E = [(t[0] + s[0]) / 2, (t[1] + s[1]) / 2], l = this.transformInv_(E);
609
+ if (!a) {
610
+ const E = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2], l = this.transformInv_(E);
604
611
  let f;
605
- w ? f = (z(i[0], F) + z(m[0], F)) / 2 - z(l[0], F) : f = (i[0] + m[0]) / 2 - l[0];
606
- const d = (i[1] + m[1]) / 2 - l[1];
607
- r = f * f + d * d > this.errorThresholdSquared_;
612
+ L ? f = ($(i[0], P) + $(m[0], P)) / 2 - $(l[0], P) : f = (i[0] + m[0]) / 2 - l[0];
613
+ const _ = (i[1] + m[1]) / 2 - l[1];
614
+ a = f * f + _ * _ > this.errorThresholdSquared_;
608
615
  }
609
- if (r) {
610
- if (Math.abs(t[0] - s[0]) <= Math.abs(t[1] - s[1])) {
611
- const E = [(e[0] + s[0]) / 2, (e[1] + s[1]) / 2], l = this.transformInv_(E), f = [(n[0] + t[0]) / 2, (n[1] + t[1]) / 2], d = this.transformInv_(f);
616
+ if (a) {
617
+ if (Math.abs(t[0] - e[0]) <= Math.abs(t[1] - e[1])) {
618
+ const E = [(s[0] + e[0]) / 2, (s[1] + e[1]) / 2], l = this.transformInv_(E), f = [(r[0] + t[0]) / 2, (r[1] + t[1]) / 2], _ = this.transformInv_(f);
612
619
  this.addQuad_(
613
620
  t,
614
- e,
621
+ s,
615
622
  E,
616
623
  f,
617
624
  i,
618
625
  c,
619
626
  l,
620
- d,
627
+ _,
621
628
  T - 1
622
629
  ), this.addQuad_(
623
630
  f,
624
631
  E,
625
- s,
626
- n,
627
- d,
632
+ e,
633
+ r,
634
+ _,
628
635
  l,
629
636
  m,
630
637
  g,
631
638
  T - 1
632
639
  );
633
640
  } else {
634
- const E = [(t[0] + e[0]) / 2, (t[1] + e[1]) / 2], l = this.transformInv_(E), f = [(s[0] + n[0]) / 2, (s[1] + n[1]) / 2], d = this.transformInv_(f);
641
+ const E = [(t[0] + s[0]) / 2, (t[1] + s[1]) / 2], l = this.transformInv_(E), f = [(e[0] + r[0]) / 2, (e[1] + r[1]) / 2], _ = this.transformInv_(f);
635
642
  this.addQuad_(
636
643
  t,
637
644
  E,
638
645
  f,
639
- n,
646
+ r,
640
647
  i,
641
648
  l,
642
- d,
649
+ _,
643
650
  g,
644
651
  T - 1
645
652
  ), this.addQuad_(
646
653
  E,
647
- e,
648
654
  s,
655
+ e,
649
656
  f,
650
657
  l,
651
658
  c,
652
659
  m,
653
- d,
660
+ _,
654
661
  T - 1
655
662
  );
656
663
  }
657
664
  return;
658
665
  }
659
666
  }
660
- if (w) {
667
+ if (L) {
661
668
  if (!this.canWrapXInSource_)
662
669
  return;
663
670
  this.wrapsXInSource_ = !0;
664
671
  }
665
- (h & 11) == 0 && this.addTriangle_(t, s, n, i, m, g), (h & 14) == 0 && this.addTriangle_(t, s, e, i, m, c), h && ((h & 13) == 0 && this.addTriangle_(e, n, t, c, g, i), (h & 7) == 0 && this.addTriangle_(e, n, s, c, g, m));
672
+ (h & 11) == 0 && this.addTriangle_(t, e, r, i, m, g), (h & 14) == 0 && this.addTriangle_(t, e, s, i, m, c), h && ((h & 13) == 0 && this.addTriangle_(s, r, t, c, g, i), (h & 7) == 0 && this.addTriangle_(s, r, e, c, g, m));
666
673
  }
667
674
  /**
668
675
  * Calculates extent of the `source` coordinates from all the triangles.
@@ -670,10 +677,10 @@ class St {
670
677
  * @return {import("../extent.js").Extent} Calculated extent.
671
678
  */
672
679
  calculateSourceExtent() {
673
- const t = _t();
674
- return this.triangles_.forEach(function(e, s, n) {
675
- const i = e.source;
676
- $(t, i[0]), $(t, i[1]), $(t, i[2]);
680
+ const t = gt();
681
+ return this.triangles_.forEach(function(s, e, r) {
682
+ const i = s.source;
683
+ z(t, i[0]), z(t, i[1]), z(t, i[2]);
677
684
  }), t;
678
685
  }
679
686
  /**
@@ -700,44 +707,44 @@ class Vt extends mt {
700
707
  * @param {boolean} [renderEdges] Render reprojection edges.
701
708
  * @param {import("../Tile.js").Options} [options] Tile options.
702
709
  */
703
- constructor(t, e, s, n, i, c, m, g, T, X, x, F) {
704
- super(i, _.IDLE, F), this.renderEdges_ = x !== void 0 ? x : !1, this.pixelRatio_ = m, this.gutter_ = g, this.canvas_ = null, this.sourceTileGrid_ = e, this.targetTileGrid_ = n, this.wrappedTileCoord_ = c || i, this.sourceTiles_ = [], this.sourcesListenerKeys_ = null, this.sourceZ_ = 0, this.clipExtent_ = t.canWrapX() ? t.getExtent() : void 0;
705
- const w = n.getTileCoordExtent(
710
+ constructor(t, s, e, r, i, c, m, g, T, X, x, P) {
711
+ super(i, d.IDLE, P), this.renderEdges_ = x !== void 0 ? x : !1, this.pixelRatio_ = m, this.gutter_ = g, this.canvas_ = null, this.sourceTileGrid_ = s, this.targetTileGrid_ = r, this.wrappedTileCoord_ = c || i, this.sourceTiles_ = [], this.sourcesListenerKeys_ = null, this.sourceZ_ = 0, this.clipExtent_ = t.canWrapX() ? t.getExtent() : void 0;
712
+ const L = r.getTileCoordExtent(
706
713
  this.wrappedTileCoord_
707
- ), r = this.targetTileGrid_.getExtent();
714
+ ), a = this.targetTileGrid_.getExtent();
708
715
  let h = this.sourceTileGrid_.getExtent();
709
- const E = r ? V(w, r) : w;
710
- if (st(E) === 0) {
711
- this.state = _.EMPTY;
716
+ const E = a ? V(L, a) : L;
717
+ if (et(E) === 0) {
718
+ this.state = d.EMPTY;
712
719
  return;
713
720
  }
714
721
  const l = t.getExtent();
715
722
  l && (h ? h = V(h, l) : h = l);
716
- const f = n.getResolution(
723
+ const f = r.getResolution(
717
724
  this.wrappedTileCoord_[0]
718
- ), d = Kt(
725
+ ), _ = Nt(
719
726
  t,
720
- s,
727
+ e,
721
728
  E,
722
729
  f
723
730
  );
724
- if (!isFinite(d) || d <= 0) {
725
- this.state = _.EMPTY;
731
+ if (!isFinite(_) || _ <= 0) {
732
+ this.state = d.EMPTY;
726
733
  return;
727
734
  }
728
735
  const u = X !== void 0 ? X : bt;
729
- if (this.triangulation_ = new St(
736
+ if (this.triangulation_ = new Kt(
730
737
  t,
731
- s,
738
+ e,
732
739
  E,
733
740
  h,
734
- d * u,
741
+ _ * u,
735
742
  f
736
743
  ), this.triangulation_.getTriangles().length === 0) {
737
- this.state = _.EMPTY;
744
+ this.state = d.EMPTY;
738
745
  return;
739
746
  }
740
- this.sourceZ_ = e.getZForResolution(d);
747
+ this.sourceZ_ = s.getZForResolution(_);
741
748
  let o = this.triangulation_.calculateSourceExtent();
742
749
  if (h && (t.canWrapX() ? (o[1] = ht(
743
750
  o[1],
@@ -747,31 +754,31 @@ class Vt extends mt {
747
754
  o[3],
748
755
  h[1],
749
756
  h[3]
750
- )) : o = V(o, h)), !st(o))
751
- this.state = _.EMPTY;
757
+ )) : o = V(o, h)), !et(o))
758
+ this.state = d.EMPTY;
752
759
  else {
753
- let y = 0, C = 0;
754
- t.canWrapX() && (y = L(l), C = Math.floor(
755
- (o[0] - l[0]) / y
760
+ let O = 0, w = 0;
761
+ t.canWrapX() && (O = y(l), w = Math.floor(
762
+ (o[0] - l[0]) / O
756
763
  )), At(
757
764
  o.slice(),
758
765
  t,
759
766
  !0
760
767
  ).forEach((I) => {
761
- const v = e.getTileRangeForExtentAndZ(
768
+ const v = s.getTileRangeForExtentAndZ(
762
769
  I,
763
770
  this.sourceZ_
764
771
  );
765
772
  for (let Y = v.minX; Y <= v.maxX; Y++)
766
- for (let W = v.minY; W <= v.maxY; W++) {
767
- const M = T(this.sourceZ_, Y, W, m);
768
- if (M) {
769
- const D = C * y;
770
- this.sourceTiles_.push({ tile: M, offset: D });
771
- }
773
+ for (let M = v.minY; M <= v.maxY; M++) {
774
+ const W = w * O;
775
+ this.sourceTiles_.push({
776
+ getTile: () => T(this.sourceZ_, Y, M, m),
777
+ offset: W
778
+ });
772
779
  }
773
- ++C;
774
- }), this.sourceTiles_.length === 0 && (this.state = _.EMPTY);
780
+ ++w;
781
+ }), this.sourceTiles_.length === 0 && (this.state = d.EMPTY);
775
782
  }
776
783
  }
777
784
  /**
@@ -786,28 +793,28 @@ class Vt extends mt {
786
793
  */
787
794
  reproject_() {
788
795
  const t = [];
789
- if (this.sourceTiles_.forEach((e) => {
790
- const s = e.tile;
791
- if (s && s.getState() == _.LOADED) {
792
- const n = this.sourceTileGrid_.getTileCoordExtent(s.tileCoord);
793
- n[0] += e.offset, n[2] += e.offset;
796
+ if (this.sourceTiles_.forEach((s) => {
797
+ const e = s.tile;
798
+ if (e && e.getState() == d.LOADED) {
799
+ const r = this.sourceTileGrid_.getTileCoordExtent(e.tileCoord);
800
+ r[0] += s.offset, r[2] += s.offset;
794
801
  const i = this.clipExtent_?.slice();
795
- i && (i[0] += e.offset, i[2] += e.offset), t.push({
796
- extent: n,
802
+ i && (i[0] += s.offset, i[2] += s.offset), t.push({
803
+ extent: r,
797
804
  clipExtent: i,
798
- image: s.getImage()
805
+ image: e.getImage()
799
806
  });
800
807
  }
801
808
  }), this.sourceTiles_.length = 0, t.length === 0)
802
- this.state = _.ERROR;
809
+ this.state = d.ERROR;
803
810
  else {
804
- const e = this.wrappedTileCoord_[0], s = this.targetTileGrid_.getTileSize(e), n = typeof s == "number" ? s : s[0], i = typeof s == "number" ? s : s[1], c = this.targetTileGrid_.getResolution(e), m = this.sourceTileGrid_.getResolution(
811
+ const s = this.wrappedTileCoord_[0], e = this.targetTileGrid_.getTileSize(s), r = typeof e == "number" ? e : e[0], i = typeof e == "number" ? e : e[1], c = this.targetTileGrid_.getResolution(s), m = this.sourceTileGrid_.getResolution(
805
812
  this.sourceZ_
806
813
  ), g = this.targetTileGrid_.getTileCoordExtent(
807
814
  this.wrappedTileCoord_
808
815
  );
809
- this.canvas_ = Nt(
810
- n,
816
+ this.canvas_ = St(
817
+ r,
811
818
  i,
812
819
  this.pixelRatio_,
813
820
  m,
@@ -819,7 +826,7 @@ class Vt extends mt {
819
826
  this.gutter_,
820
827
  this.renderEdges_,
821
828
  this.interpolate
822
- ), this.state = _.LOADED;
829
+ ), this.state = d.LOADED;
823
830
  }
824
831
  this.changed();
825
832
  }
@@ -828,21 +835,23 @@ class Vt extends mt {
828
835
  * @override
829
836
  */
830
837
  load() {
831
- if (this.state == _.IDLE) {
832
- this.state = _.LOADING, this.changed();
838
+ for (const t of this.sourceTiles_)
839
+ t.tile = t.getTile();
840
+ if (this.state == d.IDLE) {
841
+ this.state = d.LOADING, this.changed();
833
842
  let t = 0;
834
- this.sourcesListenerKeys_ = [], this.sourceTiles_.forEach(({ tile: e }) => {
835
- const s = e.getState();
836
- if (s == _.IDLE || s == _.LOADING) {
843
+ this.sourcesListenerKeys_ = [], this.sourceTiles_.forEach(({ tile: s }) => {
844
+ const e = s.getState();
845
+ if (e == d.IDLE || e == d.LOADING) {
837
846
  t++;
838
- const n = Pt(e, ft.CHANGE, (i) => {
839
- const c = e.getState();
840
- (c == _.LOADED || c == _.ERROR || c == _.EMPTY) && (rt(n), t--, t === 0 && (this.unlistenSources_(), this.reproject_()));
847
+ const r = Ct(s, ft.CHANGE, (i) => {
848
+ const c = s.getState();
849
+ (c == d.LOADED || c == d.ERROR || c == d.EMPTY) && (at(r), t--, t === 0 && (this.unlistenSources_(), this.reproject_()));
841
850
  });
842
- this.sourcesListenerKeys_.push(n);
851
+ this.sourcesListenerKeys_.push(r);
843
852
  }
844
- }), t === 0 ? setTimeout(this.reproject_.bind(this), 0) : this.sourceTiles_.forEach(function({ tile: e }, s, n) {
845
- e.getState() == _.IDLE && e.load();
853
+ }), t === 0 ? setTimeout(this.reproject_.bind(this), 0) : this.sourceTiles_.forEach(function({ tile: s }, e, r) {
854
+ s.getState() == d.IDLE && s.load();
846
855
  });
847
856
  }
848
857
  }
@@ -850,53 +859,53 @@ class Vt extends mt {
850
859
  * @private
851
860
  */
852
861
  unlistenSources_() {
853
- this.sourcesListenerKeys_.forEach(rt), this.sourcesListenerKeys_ = null;
862
+ this.sourcesListenerKeys_.forEach(at), this.sourcesListenerKeys_ = null;
854
863
  }
855
864
  /**
856
865
  * Remove from the cache due to expiry
857
866
  * @override
858
867
  */
859
868
  release() {
860
- this.canvas_ && (et(
869
+ this.canvas_ && (st(
861
870
  /** @type {CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D} */
862
871
  this.canvas_.getContext("2d")
863
- ), B.push(this.canvas_), this.canvas_ = null), super.release();
872
+ ), B.push(this.canvas_), this.canvas_ = null), this.sourceTiles_.length = 0, super.release();
864
873
  }
865
874
  }
866
- function Jt(a, t, e, s) {
867
- return s !== void 0 ? (s[0] = a, s[1] = t, s[2] = e, s) : [a, t, e];
875
+ function Jt(n, t, s, e) {
876
+ return e !== void 0 ? (e[0] = n, e[1] = t, e[2] = s, e) : [n, t, s];
868
877
  }
869
- function Ht(a, t, e) {
870
- return a + "/" + t + "/" + e;
878
+ function Ht(n, t, s) {
879
+ return n + "/" + t + "/" + s;
871
880
  }
872
- function ts(a, t, e, s, n) {
873
- return `${Rt(a)},${t},${Ht(e, s, n)}`;
881
+ function te(n, t, s, e, r) {
882
+ return `${Rt(n)},${t},${Ht(s, e, r)}`;
874
883
  }
875
- function ss(a) {
876
- return Ut(a[0], a[1], a[2]);
884
+ function ee(n) {
885
+ return Qt(n[0], n[1], n[2]);
877
886
  }
878
- function Ut(a, t, e) {
879
- return (t << a) + e;
887
+ function Qt(n, t, s) {
888
+ return (t << n) + s;
880
889
  }
881
- function es(a, t) {
882
- const e = a[0], s = a[1], n = a[2];
883
- if (t.getMinZoom() > e || e > t.getMaxZoom())
890
+ function se(n, t) {
891
+ const s = n[0], e = n[1], r = n[2];
892
+ if (t.getMinZoom() > s || s > t.getMaxZoom())
884
893
  return !1;
885
- const i = t.getFullTileRange(e);
886
- return i ? i.containsXY(s, n) : !0;
894
+ const i = t.getFullTileRange(s);
895
+ return i ? i.containsXY(e, r) : !0;
887
896
  }
888
897
  export {
889
898
  bt as E,
890
- zt as I,
899
+ $t as I,
891
900
  Vt as R,
892
901
  mt as T,
893
- St as a,
894
- Bt as b,
902
+ Bt as a,
903
+ Kt as b,
895
904
  ut as c,
896
905
  Jt as d,
897
- $t as e,
898
- ts as g,
899
- ss as h,
900
- Nt as r,
901
- es as w
906
+ zt as e,
907
+ te as g,
908
+ ee as h,
909
+ St as r,
910
+ se as w
902
911
  };