@datagouv/components-next 1.0.2-dev.19 → 1.0.2-dev.190

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 (156) hide show
  1. package/README.md +7 -6
  2. package/assets/main.css +4 -0
  3. package/dist/{Control-DuZJdKV_.js → Control-B9WQxlpJ.js} +1 -1
  4. package/dist/{Datafair.client-Ds3VQrRi.js → Datafair.client-VsEj9A00.js} +9 -9
  5. package/dist/{Event--kp8kMdJ.js → Event-iXDrp-fy.js} +31 -31
  6. package/dist/{Image-34hvypZI.js → Image-mNMBOofs.js} +9 -9
  7. package/dist/ImagePreview.client-cv32--L0.js +36 -0
  8. package/dist/JsonPreview.client-JmyzznjY.js +40 -0
  9. package/dist/{Map-BjUnLyj8.js → Map-BfqKMw0S.js} +1739 -1599
  10. package/dist/{MapContainer.client-B2BijMx5.js → MapContainer.client-BxGjbFJV.js} +41 -42
  11. package/dist/{OSM-s40W6sQ2.js → OSM-CcrUhItr.js} +15 -23
  12. package/dist/{PdfPreview.client-DJBMzrlC.js → PdfPreview.client-CkrjnmJP.js} +835 -856
  13. package/dist/Pmtiles.client-EAekMgpr.js +26333 -0
  14. package/dist/PreviewWrapper.vue_vue_type_script_setup_true_lang-B0OeAb39.js +60 -0
  15. package/dist/{ScaleLine-KW-nXqp3.js → ScaleLine-VGQ7nkMS.js} +2 -2
  16. package/dist/{Tile-DbNFNPfU.js → Tile-CSpn0Ca8.js} +160 -163
  17. package/dist/{TileImage-BsXBxMtq.js → TileImage-CpbaEFwd.js} +143 -131
  18. package/dist/{View-BR92hTWP.js → View-BYBpt-AU.js} +483 -422
  19. package/dist/XmlPreview.client-WcOMRUAD.js +34 -0
  20. package/dist/{common-PJfpC179.js → common-BoeTUnDZ.js} +52 -52
  21. package/dist/components-next.css +1 -52
  22. package/dist/components-next.js +194 -149
  23. package/dist/components.css +2 -2
  24. package/dist/{index-BFQX7Ccz.js → index-DLsJxwiN.js} +21842 -15810
  25. package/dist/{leaflet-src-7m1mB8LI.js → leaflet-src-D0FPslrZ.js} +185 -187
  26. package/dist/{main-vqhkVhVS.js → main-HzoTSLAM.js} +41511 -73246
  27. package/dist/{proj-DsetBcW7.js → proj-DxGbobp7.js} +662 -626
  28. package/dist/{text-clamp.esm-B5kW_XMt.js → text-clamp.esm-DVseBqZZ.js} +4 -4
  29. package/dist/{tilecoord-Db24Px13.js → tilecoord-DvX7WWiA.js} +273 -264
  30. package/dist/{vue3-json-viewer-BXwup7nO.js → vue3-json-viewer-CJLQFzXZ.js} +10 -16
  31. package/dist/{vue3-xml-viewer.common-BcNJo35o.js → vue3-xml-viewer.common-iq0K0tIG.js} +16 -16
  32. package/package.json +47 -38
  33. package/src/chart.ts +5 -0
  34. package/src/components/ActivityList/ActivityList.vue +3 -2
  35. package/src/components/AppLink.vue +3 -0
  36. package/src/components/BannerAction.vue +6 -2
  37. package/src/components/Chart/ChartViewer.vue +320 -0
  38. package/src/components/Chart/ChartViewerWrapper.vue +182 -0
  39. package/src/components/CopyButton.vue +6 -2
  40. package/src/components/DataserviceCard.vue +9 -0
  41. package/src/components/DataserviceQuality.vue +82 -0
  42. package/src/components/DataserviceQualityInline.vue +31 -0
  43. package/src/components/DataserviceQualityTooltipContent.vue +79 -0
  44. package/src/components/DatasetCard.vue +9 -4
  45. package/src/components/DatasetQuality.vue +11 -11
  46. package/src/components/DatasetQualityInline.vue +2 -2
  47. package/src/components/DatasetQualityTooltipContent.vue +1 -1
  48. package/src/components/Form/Listbox.vue +101 -0
  49. package/src/components/Form/SchemaSelect.vue +2 -0
  50. package/src/components/InfiniteLoader.vue +53 -0
  51. package/src/components/ObjectCardHeader.vue +11 -4
  52. package/src/components/OpenApiViewer/ContentTypeSelect.vue +48 -0
  53. package/src/components/OpenApiViewer/EndpointRequest.vue +164 -0
  54. package/src/components/OpenApiViewer/EndpointResponses.vue +149 -0
  55. package/src/components/OpenApiViewer/OpenApiViewer.vue +308 -0
  56. package/src/components/OpenApiViewer/SchemaPanel.vue +53 -0
  57. package/src/components/OpenApiViewer/SchemaTree.vue +77 -0
  58. package/src/components/OpenApiViewer/openapi.ts +150 -0
  59. package/src/components/OrganizationNameWithCertificate.vue +3 -2
  60. package/src/components/Pagination.vue +23 -58
  61. package/src/components/RadioInput.vue +7 -2
  62. package/src/components/ResourceAccordion/DataStructure.vue +11 -33
  63. package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
  64. package/src/components/ResourceAccordion/Downloads.vue +160 -0
  65. package/src/components/ResourceAccordion/ImagePreview.client.vue +48 -0
  66. package/src/components/ResourceAccordion/JsonPreview.client.vue +23 -104
  67. package/src/components/ResourceAccordion/MapContainer.client.vue +2 -11
  68. package/src/components/ResourceAccordion/Metadata.vue +1 -2
  69. package/src/components/ResourceAccordion/PdfPreview.client.vue +58 -97
  70. package/src/components/ResourceAccordion/PdfSkeleton.vue +44 -0
  71. package/src/components/ResourceAccordion/Pmtiles.client.vue +28 -13
  72. package/src/components/ResourceAccordion/Preview.vue +11 -11
  73. package/src/components/ResourceAccordion/PreviewWrapper.vue +89 -0
  74. package/src/components/ResourceAccordion/ResourceAccordion.vue +23 -114
  75. package/src/components/ResourceAccordion/XmlPreview.client.vue +16 -98
  76. package/src/components/ResourceExplorer/ResourceExplorer.vue +102 -210
  77. package/src/components/ResourceExplorer/ResourceExplorerHeader.vue +74 -0
  78. package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +103 -71
  79. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +143 -291
  80. package/src/components/ResourceExplorer/ResourceMainAction.vue +240 -0
  81. package/src/components/ResourceExplorer/ResourceSelector.vue +51 -0
  82. package/src/components/ResourceExplorer/ResourceViewerHeader.vue +115 -0
  83. package/src/components/ResourceExplorer/ResourceViewerSkeleton.vue +94 -0
  84. package/src/components/ResourceListItem.vue +154 -0
  85. package/src/components/ReuseCard.vue +14 -6
  86. package/src/components/ReuseDetails.vue +2 -2
  87. package/src/components/ReuseHorizontalCard.vue +2 -2
  88. package/src/components/SchemaCard.vue +10 -1
  89. package/src/components/Search/Filter/AccessTypeFilter.vue +2 -2
  90. package/src/components/Search/GlobalSearch.vue +220 -117
  91. package/src/components/Search/SearchInput.vue +5 -4
  92. package/src/components/Search/Sidemenu.vue +4 -3
  93. package/src/components/TabularExplorer/TabularActiveFilters.vue +79 -0
  94. package/src/components/TabularExplorer/TabularCell.vue +50 -0
  95. package/src/components/TabularExplorer/TabularCellPopover.vue +170 -0
  96. package/src/components/TabularExplorer/TabularColumnsMenu.vue +112 -0
  97. package/src/components/TabularExplorer/TabularExplorer.vue +299 -0
  98. package/src/components/TabularExplorer/TabularFilterContent.vue +362 -0
  99. package/src/components/TabularExplorer/TabularFilterPopover.vue +106 -0
  100. package/src/components/TabularExplorer/TabularMobileFilterButton.vue +21 -0
  101. package/src/components/TabularExplorer/TabularMobileFilters.vue +150 -0
  102. package/src/components/TabularExplorer/TabularRowsInfo.vue +31 -0
  103. package/src/components/TabularExplorer/TabularSkeleton.vue +92 -0
  104. package/src/components/TabularExplorer/TabularTable.vue +481 -0
  105. package/src/components/TabularExplorer/TabularToolbar.vue +25 -0
  106. package/src/components/TabularExplorer/types.ts +81 -0
  107. package/src/components/TabularExplorer/useColumnMetadata.ts +98 -0
  108. package/src/components/TabularExplorer/useTabularContext.ts +82 -0
  109. package/src/composables/useActiveDescendant.ts +5 -0
  110. package/src/composables/useDatasetResources.ts +164 -0
  111. package/src/composables/useHasTabularData.ts +15 -1
  112. package/src/composables/useMetrics.ts +1 -1
  113. package/src/composables/useResizable.ts +46 -0
  114. package/src/composables/useResourceCapabilities.ts +48 -40
  115. package/src/composables/useSearchFilter.ts +120 -0
  116. package/src/composables/useStableQueryParams.ts +38 -6
  117. package/src/composables/useTabularProfile.ts +70 -0
  118. package/src/composables/useTranslation.ts +24 -9
  119. package/src/config.ts +21 -3
  120. package/src/functions/activities.ts +3 -3
  121. package/src/functions/api.ts +20 -42
  122. package/src/functions/api.types.ts +1 -0
  123. package/src/functions/charts.ts +99 -0
  124. package/src/functions/datasets.ts +0 -17
  125. package/src/functions/dates.ts +3 -2
  126. package/src/functions/helpers.ts +15 -0
  127. package/src/functions/metrics.ts +63 -60
  128. package/src/functions/paginate.ts +46 -0
  129. package/src/functions/resourceCapabilities.ts +34 -0
  130. package/src/functions/resources.ts +136 -1
  131. package/src/functions/schemas.ts +27 -0
  132. package/src/functions/tabular.ts +214 -0
  133. package/src/functions/tabularApi.ts +96 -11
  134. package/src/main.ts +117 -14
  135. package/src/types/dataservices.ts +17 -0
  136. package/src/types/organizations.ts +10 -0
  137. package/src/types/pages.ts +0 -5
  138. package/src/types/posts.ts +2 -2
  139. package/src/types/reports.ts +5 -1
  140. package/src/types/resources.ts +0 -1
  141. package/src/types/reuses.ts +12 -1
  142. package/src/types/search.ts +63 -1
  143. package/src/types/site.ts +5 -3
  144. package/src/types/ui.ts +2 -0
  145. package/src/types/users.ts +2 -1
  146. package/src/types/visualizations.ts +93 -0
  147. package/assets/swagger-themes/newspaper.css +0 -1670
  148. package/dist/JsonPreview.client-CYxmz0yV.js +0 -72
  149. package/dist/Pmtiles.client-C_hvRDuy.js +0 -25185
  150. package/dist/Swagger.client-B4y0hXME.js +0 -4
  151. package/dist/XmlPreview.client-LETEfNBH.js +0 -64
  152. package/src/components/ResourceAccordion/Swagger.client.vue +0 -48
  153. package/src/functions/pagination.ts +0 -9
  154. /package/src/components/{DatasetQualityItem.vue → QualityItem.vue} +0 -0
  155. /package/src/components/{DatasetQualityItemWarning.vue → QualityItemWarning.vue} +0 -0
  156. /package/src/components/{DatasetQualityScore.vue → QualityScore.vue} +0 -0
@@ -1,9 +1,9 @@
1
- import { b as Y, e as f, d as b, h as D, w as v, I as K, R as N, g as k } from "./tilecoord-Db24Px13.js";
2
- import { t as g, s as W, T as _, W as q } from "./Image-34hvypZI.js";
3
- import { aQ as H, an as $, q as j, N as V, a7 as B, P as F, S as x, D as E, M as J, F as Q, L as w, X as tt, aR as et, W as it, B as nt, a as R, al as rt, J as st, e as z, E as ot } from "./proj-DsetBcW7.js";
4
- import { a as m, x as A, y as lt, D as at } from "./common-PJfpC179.js";
5
- const T = [0, 0, 0], d = 5;
6
- class X {
1
+ import { b as Y, e as f, d as G, h as D, w as v, I as K, R as N, g as k } from "./tilecoord-DvX7WWiA.js";
2
+ import { t as d, s as W, T as _, i as q } from "./Image-mNMBOofs.js";
3
+ import { aT as H, an as $, D as j, J as V, a6 as B, K as F, P as x, y as E, M as J, z as Q, I as w, U as tt, aU as et, R as it, B as nt, a as R, al as rt, G as st, e as P, E as ot } from "./proj-DxGbobp7.js";
4
+ import { a as m, x as A, y as lt, D as at } from "./common-BoeTUnDZ.js";
5
+ const T = [0, 0, 0], g = 5;
6
+ class U {
7
7
  /**
8
8
  * @param {Options} options Tile grid options.
9
9
  */
@@ -16,13 +16,13 @@ class X {
16
16
  * @param {number} b Second resolution
17
17
  * @return {number} Comparison result
18
18
  */
19
- (n, r) => r - n
19
+ (n, s) => s - n
20
20
  ),
21
21
  "`resolutions` must be sorted in descending order"
22
22
  );
23
23
  let e;
24
24
  if (!t.origins) {
25
- for (let n = 0, r = this.resolutions_.length - 1; n < r; ++n)
25
+ for (let n = 0, s = this.resolutions_.length - 1; n < s; ++n)
26
26
  if (!e)
27
27
  e = this.resolutions_[n] / this.resolutions_[n + 1];
28
28
  else if (this.resolutions_[n] / this.resolutions_[n + 1] !== e) {
@@ -44,18 +44,18 @@ class X {
44
44
  )), this.tileSize_ = t.tileSize !== void 0 ? t.tileSize : this.tileSizes_ ? null : A, m(
45
45
  !this.tileSize_ && this.tileSizes_ || this.tileSize_ && !this.tileSizes_,
46
46
  "Either `tileSize` or `tileSizes` must be configured, never both"
47
- ), this.extent_ = i !== void 0 ? i : null, this.fullTileRanges_ = null, this.tmpSize_ = [0, 0], this.tmpExtent_ = [0, 0, 0, 0], t.sizes !== void 0 ? this.fullTileRanges_ = t.sizes.map((n, r) => {
48
- const s = new Y(
47
+ ), this.extent_ = i !== void 0 ? i : null, this.fullTileRanges_ = null, this.tmpSize_ = [0, 0], this.tmpExtent_ = [0, 0, 0, 0], t.sizes !== void 0 ? this.fullTileRanges_ = t.sizes.map((n, s) => {
48
+ const r = new Y(
49
49
  Math.min(0, n[0]),
50
50
  Math.max(n[0] - 1, -1),
51
51
  Math.min(0, n[1]),
52
52
  Math.max(n[1] - 1, -1)
53
53
  );
54
54
  if (i) {
55
- const l = this.getTileRangeForExtentAndZ(i, r);
56
- s.minX = Math.max(l.minX, s.minX), s.maxX = Math.min(l.maxX, s.maxX), s.minY = Math.max(l.minY, s.minY), s.maxY = Math.min(l.maxY, s.maxY);
55
+ const l = this.getTileRangeForExtentAndZ(i, s);
56
+ r.minX = Math.max(l.minX, r.minX), r.maxX = Math.min(l.maxX, r.maxX), r.minY = Math.max(l.minY, r.minY), r.maxY = Math.min(l.maxY, r.maxY);
57
57
  }
58
- return s;
58
+ return r;
59
59
  }) : i && this.calculateTileRanges_(i);
60
60
  }
61
61
  /**
@@ -68,9 +68,9 @@ class X {
68
68
  */
69
69
  forEachTileCoord(t, e, i) {
70
70
  const n = this.getTileRangeForExtentAndZ(t, e);
71
- for (let r = n.minX, s = n.maxX; r <= s; ++r)
71
+ for (let s = n.minX, r = n.maxX; s <= r; ++s)
72
72
  for (let l = n.minY, a = n.maxY; l <= a; ++l)
73
- i([e, r, l]);
73
+ i([e, s, l]);
74
74
  }
75
75
  /**
76
76
  * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
@@ -80,13 +80,13 @@ class X {
80
80
  * @return {boolean} Callback succeeded.
81
81
  */
82
82
  forEachTileCoordParentTileRange(t, e, i, n) {
83
- let r, s, l, a = null, h = t[0] - 1;
84
- for (this.zoomFactor_ === 2 ? (s = t[1], l = t[2]) : a = this.getTileCoordExtent(t, n); h >= this.minZoom; ) {
85
- if (s !== void 0 && l !== void 0 ? (s = Math.floor(s / 2), l = Math.floor(l / 2), r = f(s, s, l, l, i)) : r = this.getTileRangeForExtentAndZ(
83
+ let s, r, l, a = null, h = t[0] - 1;
84
+ for (this.zoomFactor_ === 2 ? (r = t[1], l = t[2]) : a = this.getTileCoordExtent(t, n); h >= this.minZoom; ) {
85
+ if (r !== void 0 && l !== void 0 ? (r = Math.floor(r / 2), l = Math.floor(l / 2), s = f(r, r, l, l, i)) : s = this.getTileRangeForExtentAndZ(
86
86
  a,
87
87
  h,
88
88
  i
89
- ), e(h, r))
89
+ ), e(h, s))
90
90
  return !0;
91
91
  --h;
92
92
  }
@@ -125,6 +125,13 @@ class X {
125
125
  getOrigin(t) {
126
126
  return this.origin_ ? this.origin_ : this.origins_[t];
127
127
  }
128
+ /**
129
+ * Get the list of origins for the grid.
130
+ * @return {Array<import("../coordinate.js").Coordinate>|null} Origin.
131
+ */
132
+ getOrigins() {
133
+ return this.origins_;
134
+ }
128
135
  /**
129
136
  * Get the resolution for the given zoom level.
130
137
  * @param {number} z Integer zoom level.
@@ -151,12 +158,12 @@ class X {
151
158
  getTileCoordChildTileRange(t, e, i) {
152
159
  if (t[0] < this.maxZoom) {
153
160
  if (this.zoomFactor_ === 2) {
154
- const r = t[1] * 2, s = t[2] * 2;
161
+ const s = t[1] * 2, r = t[2] * 2;
155
162
  return f(
156
- r,
157
- r + 1,
158
163
  s,
159
164
  s + 1,
165
+ r,
166
+ r + 1,
160
167
  e
161
168
  );
162
169
  }
@@ -181,21 +188,21 @@ class X {
181
188
  getTileRangeForTileCoordAndZ(t, e, i) {
182
189
  if (e > this.maxZoom || e < this.minZoom)
183
190
  return null;
184
- const n = t[0], r = t[1], s = t[2];
191
+ const n = t[0], s = t[1], r = t[2];
185
192
  if (e === n)
186
193
  return f(
187
- r,
188
194
  s,
189
195
  r,
190
196
  s,
197
+ r,
191
198
  i
192
199
  );
193
200
  if (this.zoomFactor_) {
194
- const a = Math.pow(this.zoomFactor_, e - n), h = Math.floor(r * a), u = Math.floor(s * a);
201
+ const a = Math.pow(this.zoomFactor_, e - n), h = Math.floor(s * a), c = Math.floor(r * a);
195
202
  if (e < n)
196
- return f(h, h, u, u, i);
197
- const c = Math.floor(a * (r + 1)) - 1, S = Math.floor(a * (s + 1)) - 1;
198
- return f(h, c, u, S, i);
203
+ return f(h, h, c, c, i);
204
+ const u = Math.floor(a * (s + 1)) - 1, S = Math.floor(a * (r + 1)) - 1;
205
+ return f(h, u, c, S, i);
199
206
  }
200
207
  const l = this.getTileCoordExtent(t, this.tmpExtent_);
201
208
  return this.getTileRangeForExtentAndZ(l, e, i);
@@ -209,17 +216,17 @@ class X {
209
216
  */
210
217
  getTileRangeForExtentAndZ(t, e, i) {
211
218
  this.getTileCoordForXYAndZ_(t[0], t[3], e, !1, T);
212
- const n = T[1], r = T[2];
219
+ const n = T[1], s = T[2];
213
220
  this.getTileCoordForXYAndZ_(t[2], t[1], e, !0, T);
214
- const s = T[1], l = T[2];
215
- return f(n, s, r, l, i);
221
+ const r = T[1], l = T[2];
222
+ return f(n, r, s, l, i);
216
223
  }
217
224
  /**
218
225
  * @param {import("../tilecoord.js").TileCoord} tileCoord Tile coordinate.
219
226
  * @return {import("../coordinate.js").Coordinate} Tile center.
220
227
  */
221
228
  getTileCoordCenter(t) {
222
- const e = this.getOrigin(t[0]), i = this.getResolution(t[0]), n = g(this.getTileSize(t[0]), this.tmpSize_);
229
+ const e = this.getOrigin(t[0]), i = this.getResolution(t[0]), n = d(this.getTileSize(t[0]), this.tmpSize_);
223
230
  return [
224
231
  e[0] + (t[1] + 0.5) * n[0] * i,
225
232
  e[1] - (t[2] + 0.5) * n[1] * i
@@ -234,8 +241,8 @@ class X {
234
241
  * @api
235
242
  */
236
243
  getTileCoordExtent(t, e) {
237
- const i = this.getOrigin(t[0]), n = this.getResolution(t[0]), r = g(this.getTileSize(t[0]), this.tmpSize_), s = i[0] + t[1] * r[0] * n, l = i[1] - (t[2] + 1) * r[1] * n, a = s + r[0] * n, h = l + r[1] * n;
238
- return j(s, l, a, h, e);
244
+ const i = this.getOrigin(t[0]), n = this.getResolution(t[0]), s = d(this.getTileSize(t[0]), this.tmpSize_), r = i[0] + t[1] * s[0] * n, l = i[1] - (t[2] + 1) * s[1] * n, a = r + s[0] * n, h = l + s[1] * n;
245
+ return j(r, l, a, h, e);
239
246
  }
240
247
  /**
241
248
  * Get the tile coordinate for the given map coordinate and resolution. This
@@ -270,10 +277,10 @@ class X {
270
277
  * @return {import("../tilecoord.js").TileCoord} Tile coordinate.
271
278
  * @private
272
279
  */
273
- getTileCoordForXYAndResolution_(t, e, i, n, r) {
274
- const s = this.getZForResolution(i), l = i / this.getResolution(s), a = this.getOrigin(s), h = g(this.getTileSize(s), this.tmpSize_);
275
- let u = l * (t - a[0]) / i / h[0], c = l * (a[1] - e) / i / h[1];
276
- return n ? (u = F(u, d) - 1, c = F(c, d) - 1) : (u = x(u, d), c = x(c, d)), b(s, u, c, r);
280
+ getTileCoordForXYAndResolution_(t, e, i, n, s) {
281
+ const r = this.getZForResolution(i), l = i / this.getResolution(r), a = this.getOrigin(r), h = d(this.getTileSize(r), this.tmpSize_);
282
+ let c = l * (t - a[0]) / i / h[0], u = l * (a[1] - e) / i / h[1];
283
+ return n ? (c = F(c, g) - 1, u = F(u, g) - 1) : (c = x(c, g), u = x(u, g)), G(r, c, u, s);
277
284
  }
278
285
  /**
279
286
  * Although there is repetition between this method and `getTileCoordForXYAndResolution_`,
@@ -290,10 +297,10 @@ class X {
290
297
  * @return {import("../tilecoord.js").TileCoord} Tile coordinate.
291
298
  * @private
292
299
  */
293
- getTileCoordForXYAndZ_(t, e, i, n, r) {
294
- const s = this.getOrigin(i), l = this.getResolution(i), a = g(this.getTileSize(i), this.tmpSize_);
295
- let h = (t - s[0]) / l / a[0], u = (s[1] - e) / l / a[1];
296
- return n ? (h = F(h, d) - 1, u = F(u, d) - 1) : (h = x(h, d), u = x(u, d)), b(i, h, u, r);
300
+ getTileCoordForXYAndZ_(t, e, i, n, s) {
301
+ const r = this.getOrigin(i), l = this.getResolution(i), a = d(this.getTileSize(i), this.tmpSize_);
302
+ let h = (t - r[0]) / l / a[0], c = (r[1] - e) / l / a[1];
303
+ return n ? (h = F(h, g) - 1, c = F(c, g) - 1) : (h = x(h, g), c = x(c, g)), G(i, h, c, s);
297
304
  }
298
305
  /**
299
306
  * Get a tile coordinate given a map coordinate and zoom level.
@@ -388,24 +395,24 @@ class X {
388
395
  this.fullTileRanges_ = i;
389
396
  }
390
397
  }
391
- function U(o) {
398
+ function O(o) {
392
399
  let t = o.getDefaultTileGrid();
393
- return t || (t = ct(o), o.setDefaultTileGrid(t)), t;
400
+ return t || (t = ut(o), o.setDefaultTileGrid(t)), t;
394
401
  }
395
402
  function ht(o, t, e) {
396
- const i = t[0], n = o.getTileCoordCenter(t), r = Z(e);
397
- if (!tt(r, n)) {
398
- const s = w(r), l = Math.ceil(
399
- (r[0] - n[0]) / s
403
+ const i = t[0], n = o.getTileCoordCenter(t), s = p(e);
404
+ if (!tt(s, n)) {
405
+ const r = w(s), l = Math.ceil(
406
+ (s[0] - n[0]) / r
400
407
  );
401
- return n[0] += s * l, o.getTileCoordForCoordAndZ(n, i);
408
+ return n[0] += r * l, o.getTileCoordForCoordAndZ(n, i);
402
409
  }
403
410
  return t;
404
411
  }
405
- function ut(o, t, e, i) {
412
+ function ct(o, t, e, i) {
406
413
  i = i !== void 0 ? i : "top-left";
407
- const n = p(o, t, e);
408
- return new X({
414
+ const n = X(o, t, e);
415
+ return new U({
409
416
  extent: o,
410
417
  origin: et(o, i),
411
418
  resolutions: n,
@@ -417,29 +424,29 @@ function jt(o) {
417
424
  extent: e,
418
425
  minZoom: t.minZoom,
419
426
  tileSize: t.tileSize,
420
- resolutions: p(
427
+ resolutions: X(
421
428
  e,
422
429
  t.maxZoom,
423
430
  t.tileSize,
424
431
  t.maxResolution
425
432
  )
426
433
  };
427
- return new X(i);
434
+ return new U(i);
428
435
  }
429
- function p(o, t, e, i) {
430
- t = t !== void 0 ? t : at, e = g(e !== void 0 ? e : A);
431
- const n = Q(o), r = w(o);
432
- i = i > 0 ? i : Math.max(r / e[0], n / e[1]);
433
- const s = t + 1, l = new Array(s);
434
- for (let a = 0; a < s; ++a)
436
+ function X(o, t, e, i) {
437
+ t = t !== void 0 ? t : at, e = d(e !== void 0 ? e : A);
438
+ const n = Q(o), s = w(o);
439
+ i = i > 0 ? i : Math.max(s / e[0], n / e[1]);
440
+ const r = t + 1, l = new Array(r);
441
+ for (let a = 0; a < r; ++a)
435
442
  l[a] = i / Math.pow(2, a);
436
443
  return l;
437
444
  }
438
- function ct(o, t, e, i) {
439
- const n = Z(o);
440
- return ut(n, t, e, i);
445
+ function ut(o, t, e, i) {
446
+ const n = p(o);
447
+ return ct(n, t, e, i);
441
448
  }
442
- function Z(o) {
449
+ function p(o) {
443
450
  o = E(o);
444
451
  let t = o.getExtent();
445
452
  if (!t) {
@@ -456,9 +463,9 @@ function wt(o, t) {
456
463
  const i = e.join("&");
457
464
  return o = o.replace(/[?&]$/, ""), o += o.includes("?") ? "&" : "?", o + i;
458
465
  }
459
- const dt = /\{z\}/g, gt = /\{x\}/g, ft = /\{y\}/g, Tt = /\{-y\}/g;
466
+ const gt = /\{z\}/g, dt = /\{x\}/g, ft = /\{y\}/g, Tt = /\{-y\}/g;
460
467
  function mt(o, t, e, i, n) {
461
- return o.replace(dt, t.toString()).replace(gt, e.toString()).replace(ft, i.toString()).replace(Tt, function() {
468
+ return o.replace(gt, t.toString()).replace(dt, e.toString()).replace(ft, i.toString()).replace(Tt, function() {
462
469
  if (n === void 0)
463
470
  throw new Error(
464
471
  "If the URL template has a {-y} placeholder, the grid extent must be known"
@@ -471,9 +478,9 @@ function _t(o) {
471
478
  let e = /\{([a-z])-([a-z])\}/.exec(o);
472
479
  if (e) {
473
480
  const i = e[1].charCodeAt(0), n = e[2].charCodeAt(0);
474
- let r;
475
- for (r = i; r <= n; ++r)
476
- t.push(o.replace(e[0], String.fromCharCode(r)));
481
+ let s;
482
+ for (s = i; s <= n; ++s)
483
+ t.push(o.replace(e[0], String.fromCharCode(s)));
477
484
  return t;
478
485
  }
479
486
  if (e = /\{(\d+)-(\d+)\}/.exec(o), e) {
@@ -495,13 +502,13 @@ function Ft(o, t) {
495
502
  (function(e, i, n) {
496
503
  if (!e)
497
504
  return;
498
- let r;
499
- const s = e[0];
505
+ let s;
506
+ const r = e[0];
500
507
  if (t) {
501
- const l = t.getFullTileRange(s);
502
- l && (r = l.getHeight() - 1);
508
+ const l = t.getFullTileRange(r);
509
+ l && (s = l.getHeight() - 1);
503
510
  }
504
- return mt(o, s, e[1], e[2], r);
511
+ return mt(o, r, e[1], e[2], s);
505
512
  })
506
513
  );
507
514
  }
@@ -522,8 +529,8 @@ function Rt(o) {
522
529
  (function(t, e, i) {
523
530
  if (!t)
524
531
  return;
525
- const n = D(t), r = it(n, o.length);
526
- return o[r](t, e, i);
532
+ const n = D(t), s = it(n, o.length);
533
+ return o[s](t, e, i);
527
534
  })
528
535
  );
529
536
  }
@@ -532,7 +539,7 @@ class Et extends nt {
532
539
  * @param {Options} options Source options.
533
540
  */
534
541
  constructor(t) {
535
- super(), this.projection = E(t.projection), this.attributions_ = G(t.attributions), this.attributionsCollapsible_ = t.attributionsCollapsible ?? !0, this.loading = !1, this.state_ = t.state !== void 0 ? t.state : "ready", this.wrapX_ = t.wrapX !== void 0 ? t.wrapX : !1, this.interpolate_ = !!t.interpolate, this.viewResolver = null, this.viewRejector = null;
542
+ super(), this.projection = E(t.projection), this.attributions_ = b(t.attributions), this.attributionsCollapsible_ = t.attributionsCollapsible ?? !0, this.loading = !1, this.state_ = t.state !== void 0 ? t.state : "ready", this.wrapX_ = t.wrapX !== void 0 ? t.wrapX : !1, this.interpolate_ = !!t.interpolate, this.viewResolver = null, this.viewRejector = null;
536
543
  const e = this;
537
544
  this.viewPromise_ = new Promise(function(i, n) {
538
545
  e.viewResolver = i, e.viewRejector = n;
@@ -562,7 +569,7 @@ class Et extends nt {
562
569
  return this.projection;
563
570
  }
564
571
  /**
565
- * @param {import("../proj/Projection").default} [projection] Projection.
572
+ * @param {import("../proj/Projection.js").default} [projection] Projection.
566
573
  * @return {Array<number>|null} Resolutions.
567
574
  */
568
575
  getResolutions(t) {
@@ -609,7 +616,7 @@ class Et extends nt {
609
616
  * @api
610
617
  */
611
618
  setAttributions(t) {
612
- this.attributions_ = G(t), this.changed();
619
+ this.attributions_ = b(t), this.changed();
613
620
  }
614
621
  /**
615
622
  * Set the state of the source.
@@ -619,7 +626,7 @@ class Et extends nt {
619
626
  this.state_ = t, this.changed();
620
627
  }
621
628
  }
622
- function G(o) {
629
+ function b(o) {
623
630
  return o ? typeof o == "function" ? o : (Array.isArray(o) || (o = [o]), (t) => o) : null;
624
631
  }
625
632
  class St extends Et {
@@ -636,7 +643,7 @@ class St extends Et {
636
643
  interpolate: t.interpolate
637
644
  }), this.on, this.once, this.un, this.tilePixelRatio_ = t.tilePixelRatio !== void 0 ? t.tilePixelRatio : 1, this.tileGrid = t.tileGrid !== void 0 ? t.tileGrid : null;
638
645
  const e = [256, 256];
639
- this.tileGrid && g(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()), e), this.tmpSize = [0, 0], this.key_ = t.key || R(this), this.tileOptions = {
646
+ this.tileGrid && d(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()), e), this.tmpSize = [0, 0], this.key_ = t.key || R(this), this.tileOptions = {
640
647
  transition: t.transition,
641
648
  interpolate: t.interpolate
642
649
  }, this.zDirection = t.zDirection ? t.zDirection : 0;
@@ -664,7 +671,7 @@ class St extends Et {
664
671
  this.key_ !== t && (this.key_ = t, this.changed());
665
672
  }
666
673
  /**
667
- * @param {import("../proj/Projection").default} [projection] Projection.
674
+ * @param {import("../proj/Projection.js").default} [projection] Projection.
668
675
  * @return {Array<number>|null} Resolutions.
669
676
  * @override
670
677
  */
@@ -682,7 +689,7 @@ class St extends Et {
682
689
  * @param {import("../structs/LRUCache.js").default<import("../Tile.js").default>} [tileCache] Tile cache.
683
690
  * @return {TileType|null} Tile.
684
691
  */
685
- getTile(t, e, i, n, r, s) {
692
+ getTile(t, e, i, n, s, r) {
686
693
  return rt();
687
694
  }
688
695
  /**
@@ -698,7 +705,7 @@ class St extends Et {
698
705
  * @return {!import("../tilegrid/TileGrid.js").default} Tile grid.
699
706
  */
700
707
  getTileGridForProjection(t) {
701
- return this.tileGrid ? this.tileGrid : U(t);
708
+ return this.tileGrid ? this.tileGrid : O(t);
702
709
  }
703
710
  /**
704
711
  * Get the tile pixel ratio for this source. Subclasses may override this
@@ -717,8 +724,8 @@ class St extends Et {
717
724
  * @return {import("../size.js").Size} Tile size.
718
725
  */
719
726
  getTilePixelSize(t, e, i) {
720
- const n = this.getTileGridForProjection(i), r = this.getTilePixelRatio(e), s = g(n.getTileSize(t), this.tmpSize);
721
- return r == 1 ? s : W(s, r, this.tmpSize);
727
+ const n = this.getTileGridForProjection(i), s = this.getTilePixelRatio(e), r = d(n.getTileSize(t), this.tmpSize);
728
+ return s == 1 ? r : W(r, s, this.tmpSize);
722
729
  }
723
730
  /**
724
731
  * Returns a tile coordinate wrapped around the x-axis. When the tile coordinate
@@ -746,7 +753,7 @@ class St extends Et {
746
753
  this.clear(), super.refresh();
747
754
  }
748
755
  }
749
- class zt extends st {
756
+ class Pt extends st {
750
757
  /**
751
758
  * @param {string} type Type.
752
759
  * @param {import("../Tile.js").default} tile The tile.
@@ -755,7 +762,7 @@ class zt extends st {
755
762
  super(t), this.tile = e;
756
763
  }
757
764
  }
758
- const P = {
765
+ const y = {
759
766
  /**
760
767
  * Triggered when a tile starts loading.
761
768
  * @event module:ol/source/Tile.TileSourceEvent#tileloadstart
@@ -778,7 +785,7 @@ const P = {
778
785
  */
779
786
  TILELOADERROR: "tileloaderror"
780
787
  };
781
- class y extends St {
788
+ class z extends St {
782
789
  /**
783
790
  * @param {Options} options Image tile options.
784
791
  */
@@ -796,7 +803,7 @@ class y extends St {
796
803
  key: t.key,
797
804
  attributionsCollapsible: t.attributionsCollapsible,
798
805
  zDirection: t.zDirection
799
- }), this.generateTileUrlFunction_ = this.tileUrlFunction === y.prototype.tileUrlFunction, this.tileLoadFunction = t.tileLoadFunction, t.tileUrlFunction && (this.tileUrlFunction = t.tileUrlFunction), this.urls = null, t.urls ? this.setUrls(t.urls) : t.url && this.setUrl(t.url), this.tileLoadingKeys_ = {};
806
+ }), this.generateTileUrlFunction_ = this.tileUrlFunction === z.prototype.tileUrlFunction, this.tileLoadFunction = t.tileLoadFunction, t.tileUrlFunction && (this.tileUrlFunction = t.tileUrlFunction), this.urls = null, t.urls ? this.setUrls(t.urls) : t.url && this.setUrl(t.url), this.tileLoadingKeys_ = {};
800
807
  }
801
808
  /**
802
809
  * Deprecated. Use an ImageTile source instead.
@@ -837,8 +844,8 @@ class y extends St {
837
844
  /** @type {import("../Tile.js").default} */
838
845
  t.target
839
846
  ), i = R(e), n = e.getState();
840
- let r;
841
- n == _.LOADING ? (this.tileLoadingKeys_[i] = !0, r = P.TILELOADSTART) : i in this.tileLoadingKeys_ && (delete this.tileLoadingKeys_[i], r = n == _.ERROR ? P.TILELOADERROR : n == _.LOADED ? P.TILELOADEND : void 0), r != null && this.dispatchEvent(new zt(r, e));
847
+ let s;
848
+ n == _.LOADING ? (this.tileLoadingKeys_[i] = !0, s = y.TILELOADSTART) : i in this.tileLoadingKeys_ && (delete this.tileLoadingKeys_[i], s = n == _.ERROR ? y.TILELOADERROR : n == _.LOADED ? y.TILELOADEND : void 0), s != null && this.dispatchEvent(new Pt(s, e));
842
849
  }
843
850
  /**
844
851
  * Deprecated. Use an ImageTile source instead.
@@ -889,7 +896,7 @@ class y extends St {
889
896
  tileUrlFunction(t, e, i) {
890
897
  }
891
898
  }
892
- class At extends y {
899
+ class At extends z {
893
900
  /**
894
901
  * @param {!Options} options Image tile options.
895
902
  */
@@ -900,7 +907,7 @@ class At extends y {
900
907
  projection: t.projection,
901
908
  state: t.state,
902
909
  tileGrid: t.tileGrid,
903
- tileLoadFunction: t.tileLoadFunction ? t.tileLoadFunction : Pt,
910
+ tileLoadFunction: t.tileLoadFunction ? t.tileLoadFunction : yt,
904
911
  tilePixelRatio: t.tilePixelRatio,
905
912
  tileUrlFunction: t.tileUrlFunction,
906
913
  url: t.url,
@@ -911,7 +918,7 @@ class At extends y {
911
918
  key: t.key,
912
919
  attributionsCollapsible: t.attributionsCollapsible,
913
920
  zDirection: t.zDirection
914
- }), this.crossOrigin = t.crossOrigin !== void 0 ? t.crossOrigin : null, this.tileClass = t.tileClass !== void 0 ? t.tileClass : K, this.tileGridForProjection = {}, this.reprojectionErrorThreshold_ = t.reprojectionErrorThreshold, this.renderReprojectionEdges_ = !1;
921
+ }), this.crossOrigin = t.crossOrigin !== void 0 ? t.crossOrigin : null, this.referrerPolicy = t.referrerPolicy, this.tileClass = t.tileClass !== void 0 ? t.tileClass : K, this.tileGridForProjection = {}, this.reprojectionErrorThreshold_ = t.reprojectionErrorThreshold, this.renderReprojectionEdges_ = !1;
915
922
  }
916
923
  /**
917
924
  * @param {import("../proj/Projection.js").default} projection Projection.
@@ -919,7 +926,7 @@ class At extends y {
919
926
  * @override
920
927
  */
921
928
  getGutterForProjection(t) {
922
- return this.getProjection() && t && !z(this.getProjection(), t) ? 0 : this.getGutter();
929
+ return this.getProjection() && t && !P(this.getProjection(), t) ? 0 : this.getGutter();
923
930
  }
924
931
  /**
925
932
  * @return {number} Gutter.
@@ -943,10 +950,10 @@ class At extends y {
943
950
  */
944
951
  getTileGridForProjection(t) {
945
952
  const e = this.getProjection();
946
- if (this.tileGrid && (!e || z(e, t)))
953
+ if (this.tileGrid && (!e || P(e, t)))
947
954
  return this.tileGrid;
948
955
  const i = R(t);
949
- return i in this.tileGridForProjection || (this.tileGridForProjection[i] = U(t)), this.tileGridForProjection[i];
956
+ return i in this.tileGridForProjection || (this.tileGridForProjection[i] = O(t)), this.tileGridForProjection[i];
950
957
  }
951
958
  /**
952
959
  * @param {number} z Tile coordinate z.
@@ -958,19 +965,22 @@ class At extends y {
958
965
  * @return {!ImageTile} Tile.
959
966
  * @private
960
967
  */
961
- createTile_(t, e, i, n, r, s) {
968
+ createTile_(t, e, i, n, s, r) {
962
969
  const l = [t, e, i], a = this.getTileCoordForTileUrlFunction(
963
970
  l,
964
- r
965
- ), h = a ? this.tileUrlFunction(a, n, r) : void 0, u = new this.tileClass(
971
+ s
972
+ ), h = a ? this.tileUrlFunction(a, n, s) : void 0, c = new this.tileClass(
966
973
  l,
967
974
  h !== void 0 ? _.IDLE : _.EMPTY,
968
975
  h !== void 0 ? h : "",
969
- this.crossOrigin,
976
+ {
977
+ crossOrigin: this.crossOrigin,
978
+ referrerPolicy: this.referrerPolicy
979
+ },
970
980
  this.tileLoadFunction,
971
981
  this.tileOptions
972
982
  );
973
- return u.key = s, u.addEventListener(ot.CHANGE, this.handleTileChange.bind(this)), u;
983
+ return c.key = r, c.addEventListener(ot.CHANGE, this.handleTileChange.bind(this)), c;
974
984
  }
975
985
  /**
976
986
  * @param {number} z Tile coordinate z.
@@ -982,29 +992,29 @@ class At extends y {
982
992
  * @return {!(ImageTile|ReprojTile)} Tile.
983
993
  * @override
984
994
  */
985
- getTile(t, e, i, n, r, s) {
995
+ getTile(t, e, i, n, s, r) {
986
996
  const l = this.getProjection();
987
- if (!l || !r || z(l, r))
997
+ if (!l || !s || P(l, s))
988
998
  return this.getTileInternal(
989
999
  t,
990
1000
  e,
991
1001
  i,
992
1002
  n,
993
- l || r
1003
+ l || s
994
1004
  );
995
- const a = [t, e, i], h = this.getKey(), u = this.getTileGridForProjection(l), c = this.getTileGridForProjection(r), S = this.getTileCoordForTileUrlFunction(
1005
+ const a = [t, e, i], h = this.getKey(), c = this.getTileGridForProjection(l), u = this.getTileGridForProjection(s), S = this.getTileCoordForTileUrlFunction(
996
1006
  a,
997
- r
1007
+ s
998
1008
  ), C = new N(
999
1009
  l,
1000
- u,
1001
- r,
1002
1010
  c,
1011
+ s,
1012
+ u,
1003
1013
  a,
1004
1014
  S,
1005
1015
  this.getTilePixelRatio(n),
1006
1016
  this.getGutter(),
1007
- (O, L, I, M) => this.getTileInternal(O, L, I, M, l, s),
1017
+ (Z, L, I, M) => this.getTileInternal(Z, L, I, M, l, r),
1008
1018
  this.reprojectionErrorThreshold_,
1009
1019
  this.renderReprojectionEdges_,
1010
1020
  this.tileOptions
@@ -1021,15 +1031,15 @@ class At extends y {
1021
1031
  * @return {!ImageTile} Tile.
1022
1032
  * @protected
1023
1033
  */
1024
- getTileInternal(t, e, i, n, r, s) {
1034
+ getTileInternal(t, e, i, n, s, r) {
1025
1035
  const l = this.getKey(), a = k(this, l, t, e, i);
1026
- if (s && s.containsKey(a))
1036
+ if (r && r.containsKey(a))
1027
1037
  return (
1028
1038
  /** @type {!ImageTile} */
1029
- s.get(a)
1039
+ r.get(a)
1030
1040
  );
1031
- const h = this.createTile_(t, e, i, n, r, l);
1032
- return s?.set(a, h), h;
1041
+ const h = this.createTile_(t, e, i, n, s, l);
1042
+ return r?.set(a, h), h;
1033
1043
  }
1034
1044
  /**
1035
1045
  * Sets whether to render reprojection edges or not (usually for debugging).
@@ -1059,21 +1069,24 @@ class At extends y {
1059
1069
  }
1060
1070
  }
1061
1071
  }
1062
- function Pt(o, t) {
1072
+ function yt(o, t) {
1063
1073
  if (q) {
1064
1074
  const e = o.getCrossOrigin();
1065
1075
  let i = "same-origin", n = "same-origin";
1066
- e === "anonymous" || e === "" ? (i = "cors", n = "omit") : e === "use-credentials" && (i = "cors", n = "include"), fetch(t, {
1076
+ e === "anonymous" || e === "" ? (i = "cors", n = "omit") : e === "use-credentials" && (i = "cors", n = "include");
1077
+ const s = {
1067
1078
  mode: i,
1068
- credentials: n
1069
- }).then((r) => {
1079
+ credentials: n,
1080
+ referrerPolicy: o.getReferrerPolicy()
1081
+ };
1082
+ fetch(t, s).then((r) => {
1070
1083
  if (!r.ok)
1071
1084
  throw new Error(`HTTP ${r.status}`);
1072
1085
  return r.blob();
1073
1086
  }).then((r) => createImageBitmap(r)).then((r) => {
1074
- const s = o.getImage();
1075
- s.width = r.width, s.height = r.height, /** @type {OffscreenCanvas} */
1076
- s.getContext("2d").drawImage(r, 0, 0), r.close?.(), s.dispatchEvent(new Event("load"));
1087
+ const l = o.getImage();
1088
+ l.width = r.width, l.height = r.height, /** @type {OffscreenCanvas} */
1089
+ l.getContext("2d").drawImage(r, 0, 0), r.close?.(), l.dispatchEvent(new Event("load"));
1077
1090
  }).catch(() => {
1078
1091
  o.getImage().dispatchEvent(new Event("error"));
1079
1092
  });
@@ -1084,14 +1097,13 @@ function Pt(o, t) {
1084
1097
  export {
1085
1098
  Et as S,
1086
1099
  At as T,
1087
- y as U,
1088
- X as a,
1100
+ z as U,
1101
+ U as a,
1089
1102
  wt as b,
1090
1103
  jt as c,
1091
- Pt as d,
1092
- Z as e,
1093
- _t as f,
1094
- U as g,
1095
- Rt as h,
1096
- xt as i
1104
+ _t as d,
1105
+ p as e,
1106
+ Rt as f,
1107
+ O as g,
1108
+ xt as h
1097
1109
  };