@eodash/eodash 5.0.0-alpha.2.15 → 5.0.0-alpha.2.17

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 (54) hide show
  1. package/README.md +1 -1
  2. package/core/client/composables/EodashMap.js +296 -0
  3. package/core/client/composables/index.js +15 -4
  4. package/core/client/eodash.js +7 -2
  5. package/core/client/plugins/axios.js +8 -0
  6. package/core/client/store/Actions.js +32 -11
  7. package/core/client/store/States.js +8 -1
  8. package/core/client/store/stac.js +59 -6
  9. package/core/client/types.d.ts +6 -2
  10. package/core/client/utils/createLayers.js +187 -49
  11. package/core/client/utils/eodashSTAC.js +147 -31
  12. package/core/client/utils/helpers.js +259 -13
  13. package/core/client/utils/states.js +17 -0
  14. package/dist/client/{DashboardLayout-DQE4aB6e.js → DashboardLayout-BR1lU9ER.js} +2 -2
  15. package/dist/client/{DynamicWebComponent-TrDsJuF8.js → DynamicWebComponent-7z8VFsrZ.js} +1 -1
  16. package/dist/client/EodashDatePicker-o7ZOYIHL.js +259 -0
  17. package/dist/client/EodashItemFilter-lNjVkidr.js +7651 -0
  18. package/dist/client/EodashLayerControl-B0N8_XmX.js +24485 -0
  19. package/dist/client/{EodashMap--2y6XErO.js → EodashMap-DFT2R2Rk.js} +22298 -24006
  20. package/dist/client/{EodashMapBtns-BSf3iUAb.js → EodashMapBtns-CoGjVl8Y.js} +2 -2
  21. package/dist/client/{ExportState-BTONkMIz.js → ExportState-Dwv37MRw.js} +171 -158
  22. package/dist/client/{Footer-B7JDXdxT.js → Footer-DuScuHSx.js} +59 -57
  23. package/dist/client/{Header-Dlumetq0.js → Header-C4Y0u0E5.js} +70 -70
  24. package/dist/client/{IframeWrapper-DRjSqhFx.js → IframeWrapper-D1TfK4xH.js} +1 -1
  25. package/dist/client/{MobileLayout-9z2X_rmU.js → MobileLayout-C-b8DIFO.js} +43 -41
  26. package/dist/client/{PopUp-CXbMBYGh.js → PopUp-DBMZX3l3.js} +5 -5
  27. package/dist/client/{VImg-Dgk5tryv.js → VImg-bAMQHnMM.js} +33 -31
  28. package/dist/client/VMain-Df5VMG9r.js +38 -0
  29. package/dist/client/VOverlay-D5GzAYRY.js +973 -0
  30. package/dist/client/{WidgetsContainer-CHK_3dlD.js → WidgetsContainer-yZDmY6_u.js} +1 -1
  31. package/dist/client/asWebComponent-DhR2_xlP.js +24492 -0
  32. package/dist/client/eo-dash.js +1 -1
  33. package/dist/client/{forwardRefs-OX_5lLJW.js → forwardRefs-C0MQxvur.js} +1 -1
  34. package/dist/client/{index-B_KfD-iF.js → index-qNWeBhRh.js} +23 -23
  35. package/dist/client/{lerc-B4lXefGh-CplqAh1B.js → lerc-B4lXefGh-CsL-d8wY.js} +1 -1
  36. package/dist/client/{ssrBoot-BZTPJZkq.js → ssrBoot-Xmkz8T49.js} +1 -1
  37. package/dist/client/style.css +2 -2
  38. package/dist/client/{transition-Dq8XIV_D.js → transition-DRzZPWIN.js} +1 -1
  39. package/dist/client/{webfontloader-qotgY98I.js → webfontloader-CqD-lAx-.js} +1 -1
  40. package/dist/node/cli.js +1 -1
  41. package/package.json +27 -22
  42. package/widgets/EodashDatePicker.vue +104 -100
  43. package/widgets/EodashItemFilter.vue +2 -0
  44. package/widgets/EodashLayerControl.vue +69 -2
  45. package/widgets/EodashMap.vue +31 -214
  46. package/widgets/ExportState.vue +12 -9
  47. package/dist/client/EodashDatePicker-CkA9rHp6.js +0 -252
  48. package/dist/client/EodashItemFilter-Bp0lcvbI.js +0 -10121
  49. package/dist/client/EodashLayerControl-lfLYqyeU.js +0 -20963
  50. package/dist/client/VMain-Ubv9jyyL.js +0 -39
  51. package/dist/client/VOverlay-CqZC2CbA.js +0 -972
  52. package/dist/client/_commonjsHelpers-DaMA6jEr.js +0 -8
  53. package/dist/client/asWebComponent-Ddg71BJk.js +0 -20451
  54. package/dist/client/helpers-BCawTwFg.js +0 -1390
@@ -6,8 +6,8 @@
6
6
  <eox-map
7
7
  class="fill-height fill-width overflow-none"
8
8
  slot="first"
9
- sync="eox-map#compare"
10
9
  ref="eoxMap"
10
+ :sync="compareMap"
11
11
  id="main"
12
12
  :config="eoxMapConfig"
13
13
  />
@@ -21,21 +21,14 @@
21
21
  </eox-map-compare>
22
22
  </template>
23
23
  <script setup>
24
- import { onMounted, onUnmounted, reactive, ref, watch } from "vue";
25
- import { EodashCollection } from "@/utils/eodashSTAC";
26
- import { extractCollectionUrls } from "@/utils/helpers";
27
- import {
28
- currentUrl,
29
- currentCompareUrl,
30
- datetime,
31
- mapEl,
32
- mapPosition,
33
- } from "@/store/States";
34
- import { transformExtent } from "ol/proj";
24
+ import { computed, onMounted, reactive, ref } from "vue";
25
+ import { datetime, mapEl, mapPosition, mapCompareEl } from "@/store/States";
35
26
  import { storeToRefs } from "pinia";
36
27
  import { useSTAcStore } from "@/store/stac";
37
28
  import "@eox/map";
38
29
  import "@eox/map/dist/eox-map-advanced-layers-and-sources.js";
30
+ import { eodashCollections, eodashCompareCollections } from "@/utils/states";
31
+ import { useHandleMapMoveEnd, useInitMap } from "@/composables/EodashMap";
39
32
 
40
33
  const props = defineProps({
41
34
  enableCompare: {
@@ -44,19 +37,17 @@ const props = defineProps({
44
37
  },
45
38
  });
46
39
 
47
- /** @type {import("vue").Ref<(HTMLElement & Record<string,any>) | null>} */
40
+ /** @type {import("vue").Ref<(HTMLElement & Record<string,any> & { map:import("ol").Map }) | null>} */
48
41
  const eoxMap = ref(null);
49
- /** @type {import("vue").Ref<(HTMLElement & Record<string,any>) | null>} */
42
+ /** @type {import("vue").Ref<(HTMLElement & Record<string,any> & { map:import("ol").Map }) | null>} */
50
43
  const compareMap = ref(null);
51
44
 
52
- const showCompare = ref("first");
53
-
54
45
  const eoxMapConfig = reactive({
55
46
  /** @type {(number|undefined)[] | undefined} */
56
47
  center: [15, 48],
57
48
  /** @type {number | undefined} */
58
49
  zoom: 4,
59
- // TODO: we should probably introduce some way of defining
50
+ // TODO: we should probably introduce some way of defining default base layers
60
51
  layers: [
61
52
  {
62
53
  type: "Tile",
@@ -86,209 +77,35 @@ if (mapPosition && mapPosition.value && mapPosition.value.length === 3) {
86
77
  eoxMapConfig.center = [mapPosition.value?.[0], mapPosition.value[1]];
87
78
  eoxMapConfig.zoom = mapPosition.value[2];
88
79
  }
80
+ const { selectedCompareStac } = storeToRefs(useSTAcStore());
81
+ const showCompare = computed(() =>
82
+ props.enableCompare && !!selectedCompareStac.value ? "" : "first",
83
+ );
89
84
 
90
- /** @type {import("openlayers").EventsListenerFunctionType} */
91
- const handleMoveEnd = (evt) => {
92
- const map = /** @type {import("openlayers").Map | undefined} */ (
93
- /** @type {any} */ (evt).map
94
- );
95
- const [x, y] = map?.getView().getCenter() ?? [0, 0];
96
- const z = map?.getView().getZoom();
97
- if (!Number.isNaN(x) && !Number.isNaN(y) && !Number.isNaN(z)) {
98
- mapPosition.value = [x, y, z];
99
- }
100
- };
101
-
102
- const store = useSTAcStore();
103
- /**
104
- *
105
- * @param {import("vue").Ref<string>} baseUrl
106
- * @param {string} updatedTime
107
- * @param {import("vue").Ref<
108
- * | import("stac-ts").StacCatalog
109
- * | import("stac-ts").StacCollection
110
- * | import("stac-ts").StacItem
111
- * | null
112
- * >} selectedStac
113
- */
114
- const createLayersConfig = async (baseUrl, updatedTime, selectedStac) => {
115
- const collectionUrls = extractCollectionUrls(
116
- selectedStac.value,
117
- baseUrl.value,
118
- );
119
- const eodashCollections = collectionUrls.map(
120
- (cu) => new EodashCollection(cu),
121
- );
122
-
123
- const layersCollection = [];
124
- const dataLayers = {
125
- type: "Group",
126
- properties: {
127
- id: "AnalysisGroup",
128
- title: "Analysis Layers",
129
- layerControlExpand: true,
130
- },
131
- layers: /** @type {Record<string,any>[]}*/ ([]),
132
- };
133
-
134
- for (const ec of eodashCollections) {
135
- let layers;
136
- if (updatedTime) {
137
- layers = await ec.createLayersJson(new Date(updatedTime));
138
- } else {
139
- layers = await ec.createLayersJson();
140
- }
141
- if (layers) {
142
- dataLayers.layers.push(...layers);
143
- }
144
- }
145
- // Add expand to all analysis layers
146
- dataLayers.layers.forEach((dl) => {
147
- dl.properties.layerControlExpand = true;
148
- dl.properties.layerControlToolsExpand = true;
149
- });
150
-
151
- layersCollection.push(dataLayers);
152
- const indicator = new EodashCollection(currentUrl.value);
153
- const indicatorLayers = await indicator.buildJsonArray(
154
- //@ts-expect-error we use this function to generate collection level visualization
155
- selectedStac.value,
156
- currentUrl.value,
157
- selectedStac.value?.title ?? "",
158
- selectedStac.value?.endpointtype ?? false,
159
- );
160
-
161
- const baseLayers = {
162
- type: "Group",
163
- properties: {
164
- id: "BaseLayersGroup",
165
- title: "Base Layers",
166
- },
167
- layers: /** @type {Record<string,any>[]}*/ ([]),
168
- };
169
-
170
- const indicatorBaseLayers = indicatorLayers.filter(
171
- (l) => l.properties.group === "baselayer",
172
- );
173
- if (indicatorBaseLayers.length) {
174
- baseLayers.layers.push(...indicatorBaseLayers);
175
-
176
- // Add exclusive to baselayers and make sure only one is selected
177
- baseLayers.layers.forEach((bl) => {
178
- bl.properties.layerControlExclusive = true;
179
- });
180
- } else {
181
- // Default to some baselayer
182
- baseLayers.layers.push({
183
- type: "Tile",
184
- properties: {
185
- id: "osm",
186
- title: "Background",
187
- layerControlExclusive: true,
188
- },
189
- source: {
190
- type: "OSM",
191
- },
192
- });
193
- }
194
-
195
- if (baseLayers.layers.length) {
196
- layersCollection.push(baseLayers);
197
- }
198
-
199
- const overlayLayers = {
200
- type: "Group",
201
- properties: {
202
- id: "OverlayGroup",
203
- title: "Overlay Layers",
204
- },
205
- layers: /** @type {Record<string,any>[]}*/ ([]),
206
- };
207
-
208
- const indicatorOverlays = indicatorLayers.filter(
209
- (l) => l.properties.group === "overlay",
210
- );
211
- if (indicatorOverlays.length) {
212
- overlayLayers.layers.push(...indicatorOverlays);
213
- layersCollection.unshift(overlayLayers);
214
- }
215
-
216
- return layersCollection;
217
- };
85
+ useHandleMapMoveEnd(eoxMap, mapPosition);
218
86
 
219
87
  onMounted(() => {
220
- mapEl.value = /** @type {HTMLElement & Record<string,any>} */ (eoxMap.value);
221
-
222
- /** @type {import('ol/Map').default} */
223
- (eoxMap.value?.map)?.on("moveend", handleMoveEnd);
224
-
225
- const { selectedStac, selectedCompareStac } = storeToRefs(store);
88
+ const { selectedCompareStac, selectedStac } = storeToRefs(useSTAcStore());
89
+ // assign map Element state to eox map
90
+ mapEl.value = eoxMap.value;
226
91
  if (props.enableCompare) {
227
- watch(
228
- [selectedCompareStac, datetime],
229
- async (
230
- [updatedCompareStac, updatedTime],
231
- [_previousCompareStac, _previousTime],
232
- ) => {
233
- if (updatedCompareStac) {
234
- const compareLayersCollection = await createLayersConfig(
235
- currentCompareUrl,
236
- updatedTime,
237
- selectedCompareStac,
238
- );
239
- /** @type {any} */
240
- (compareMap.value).layers = compareLayersCollection;
241
- showCompare.value = "";
242
- }
243
- },
92
+ mapCompareEl.value = compareMap.value;
93
+ }
94
+ if (props.enableCompare) {
95
+ useInitMap(
96
+ compareMap,
97
+ //@ts-expect-error todo selectedStac as collection
98
+ selectedCompareStac,
99
+ eodashCompareCollections,
100
+ datetime,
244
101
  );
245
102
  }
246
-
247
- watch(
248
- [selectedStac, datetime],
249
- async ([updatedStac, updatedTime], [previousSTAC, _previousTime]) => {
250
- if (updatedStac) {
251
- const layersCollection = await createLayersConfig(
252
- currentUrl,
253
- updatedTime,
254
- selectedStac,
255
- );
256
- /** @type {any} */
257
- (eoxMap.value).layers = layersCollection;
258
-
259
- // only on different indicator selection and not on time change
260
- if (previousSTAC?.id !== updatedStac.id) {
261
- showCompare.value = "first";
262
- // Try to move map view to extent
263
- // Make sure for now we are always converting from 4326
264
- // of stac items into current map projection
265
- // TODO: This might change if we decide to use 4326 as default for zoom and extent
266
- // Sanitize extent
267
- // @ts-expect-error we will need to change the approach to use
268
- // native eox-map transformation once included
269
- const b = updatedStac.extent?.spatial.bbox[0];
270
- const sanitizedExtent = [
271
- b[0] > -180 ? b[0] : -180,
272
- b[1] > -90 ? b[1] : -90,
273
- b[2] < 180 ? b[2] : 180,
274
- b[3] < 90 ? b[3] : 90,
275
- ];
276
- const reprojExtent = transformExtent(
277
- sanitizedExtent,
278
- "EPSG:4326",
279
- eoxMap.value?.map?.getView().getProjection(),
280
- );
281
- /** @type {any} */
282
- (eoxMap.value).zoomExtent = reprojExtent;
283
- }
284
- }
285
- },
286
- { immediate: true },
103
+ useInitMap(
104
+ eoxMap,
105
+ //@ts-expect-error todo selectedStac as collection
106
+ selectedStac,
107
+ eodashCollections,
108
+ datetime,
287
109
  );
288
110
  });
289
-
290
- onUnmounted(() => {
291
- /** @type {import('ol/Map').default} */
292
- (eoxMap.value?.map)?.un("moveend", handleMoveEnd);
293
- });
294
111
  </script>
@@ -1,17 +1,17 @@
1
1
  <template>
2
2
  <PopUp v-model="dialog">
3
- <v-card>
4
- <v-card-title class="bg-primary">
3
+ <v-card style="max-height: 498px">
4
+ <v-card-title class="bg-primary" style="max-height: 49px">
5
5
  <h5 class="text-h5">Storytelling map configuration</h5>
6
6
  </v-card-title>
7
7
 
8
- <v-card-text class="py-5">
8
+ <v-card-text class="py-5 overflow-auto" style="height: 400px">
9
9
  <p class="text-body-2">
10
- Copy and paste this code into the map layers field of the storytelling
11
- editor:
10
+ Copy and paste this code into the map <b>layers field</b> of the
11
+ storytelling editor:
12
12
  </p>
13
13
  <div class="pa-3 code-block">
14
- {{ getLayers() }}
14
+ {{ removeUnneededProperties(getLayers()) }}
15
15
  </div>
16
16
 
17
17
  <div style="position: absolute; bottom: 15px">
@@ -41,7 +41,7 @@
41
41
 
42
42
  <v-divider></v-divider>
43
43
 
44
- <v-card-actions>
44
+ <v-card-actions style="max-height: 49px">
45
45
  <v-spacer></v-spacer>
46
46
  <v-btn variant="text" @click="dialog = !dialog"> Close </v-btn>
47
47
  </v-card-actions>
@@ -55,6 +55,7 @@ import { copyToClipBoard } from "@/utils";
55
55
  import { computed, ref } from "vue";
56
56
  import { getLayers as getLayerAction } from "@/store/Actions";
57
57
  import { mapPosition } from "@/store/States";
58
+ import { removeUnneededProperties } from "@/utils/helpers";
58
59
 
59
60
  const dialog = defineModel({ type: Boolean, required: true, default: false });
60
61
 
@@ -93,7 +94,7 @@ const mapStepCode = computed(() => {
93
94
  #### Tour step title
94
95
  Text describing the current step of the tour and why it is interesting what the map shows currently
95
96
  `;
96
- return `${preTag}'${JSON.stringify(props.getLayers())}' ${endTag}`;
97
+ return `${preTag}'${JSON.stringify(removeUnneededProperties(props.getLayers()))}' ${endTag}`;
97
98
  });
98
99
  const mapEntryCode = computed(() => {
99
100
  const [x, y, z] = mapPosition.value;
@@ -101,7 +102,7 @@ const mapEntryCode = computed(() => {
101
102
  "## Map Example <!" +
102
103
  '--{as="eox-map" style="width: 100%; height: 500px;" layers=';
103
104
  const endTag = `zoom="${z}" center=[${[x, y]}] }-->`;
104
- return `${preTag}'${JSON.stringify(props.getLayers())}' ${endTag}`;
105
+ return `${preTag}'${JSON.stringify(removeUnneededProperties(props.getLayers()))}' ${endTag}`;
105
106
  });
106
107
  </script>
107
108
  <style scoped>
@@ -109,5 +110,7 @@ const mapEntryCode = computed(() => {
109
110
  background-color: #ddd;
110
111
  font-family: monospace;
111
112
  font-size: small;
113
+ max-height: 200px;
114
+ overflow-y: auto;
112
115
  }
113
116
  </style>
@@ -1,252 +0,0 @@
1
- import { p as B, o as $, g as _, y as j, av as I, c as v, r as V, d as h, a as M, b as p, aw as R, ax as O, T as U, ay as F, x as H, Z as N, az as Y, aA as z, w as G, $ as w, a6 as W, a1 as y, a3 as C, aB as K, F as L, W as Z, a9 as k, aC as q, aD as J, t as S, a0 as T, M as D, aE as Q, V as P, aF as X, aG as x, aH as tt } from "./asWebComponent-Ddg71BJk.js";
2
- import { t as et, e as at } from "./helpers-BCawTwFg.js";
3
- import { m as ot, V as E } from "./VOverlay-CqZC2CbA.js";
4
- import { b as nt, f as st } from "./forwardRefs-OX_5lLJW.js";
5
- const rt = B({
6
- id: String,
7
- text: String,
8
- ...$(ot({
9
- closeOnBack: !1,
10
- location: "end",
11
- locationStrategy: "connected",
12
- eager: !0,
13
- minWidth: 0,
14
- offset: 10,
15
- openOnClick: !1,
16
- openOnHover: !0,
17
- origin: "auto",
18
- scrim: !1,
19
- scrollStrategy: "reposition",
20
- transition: !1
21
- }), ["absolute", "persistent"])
22
- }, "VTooltip"), it = _()({
23
- name: "VTooltip",
24
- props: rt(),
25
- emits: {
26
- "update:modelValue": (t) => !0
27
- },
28
- setup(t, r) {
29
- let {
30
- slots: i
31
- } = r;
32
- const o = j(t, "modelValue"), {
33
- scopeId: n
34
- } = nt(), l = I(), e = v(() => t.id || `v-tooltip-${l}`), a = V(), s = v(() => t.location.split(" ").length > 1 ? t.location : t.location + " center"), c = v(() => t.origin === "auto" || t.origin === "overlap" || t.origin.split(" ").length > 1 || t.location.split(" ").length > 1 ? t.origin : t.origin + " center"), d = v(() => t.transition ? t.transition : o.value ? "scale-transition" : "fade-transition"), f = v(() => h({
35
- "aria-describedby": e.value
36
- }, t.activatorProps));
37
- return M(() => {
38
- const b = E.filterProps(t);
39
- return p(E, h({
40
- ref: a,
41
- class: ["v-tooltip", t.class],
42
- style: t.style,
43
- id: e.value
44
- }, b, {
45
- modelValue: o.value,
46
- "onUpdate:modelValue": (m) => o.value = m,
47
- transition: d.value,
48
- absolute: !0,
49
- location: s.value,
50
- origin: c.value,
51
- persistent: !0,
52
- role: "tooltip",
53
- activatorProps: f.value,
54
- _disableGlobalStack: !0
55
- }, n), {
56
- activator: i.activator,
57
- default: function() {
58
- for (var m = arguments.length, u = new Array(m), g = 0; g < m; g++)
59
- u[g] = arguments[g];
60
- return i.default?.(...u) ?? t.text;
61
- }
62
- });
63
- }), st({}, a);
64
- }
65
- });
66
- function lt(t, r) {
67
- const i = typeof t == "string" ? R(t) : t, o = ct(i, r);
68
- return {
69
- mounted: o,
70
- updated: o,
71
- unmounted(n) {
72
- O(null, n);
73
- }
74
- };
75
- }
76
- function ct(t, r) {
77
- return function(i, o, n) {
78
- const l = typeof r == "function" ? r(o) : r, e = o.value?.text ?? o.value ?? l?.text, a = U(o.value) ? o.value : {}, s = () => e ?? i.innerHTML, c = (n.ctx === o.instance.$ ? ut(n, o.instance.$)?.provides : n.ctx?.provides) ?? o.instance.$.provides, d = F(t, h(l, a), s);
79
- d.appContext = Object.assign(/* @__PURE__ */ Object.create(null), o.instance.$.appContext, {
80
- provides: c
81
- }), O(d, i);
82
- };
83
- }
84
- function ut(t, r) {
85
- const i = /* @__PURE__ */ new Set(), o = (l) => {
86
- for (const e of l) {
87
- if (!e) continue;
88
- if (e === t)
89
- return !0;
90
- i.add(e);
91
- let a;
92
- if (e.suspense ? a = o([e.ssContent]) : Array.isArray(e.children) ? a = o(e.children) : e.component?.vnode && (a = o([e.component?.subTree])), a)
93
- return a;
94
- i.delete(e);
95
- }
96
- return !1;
97
- };
98
- if (!o([r.subTree]))
99
- throw new Error("Could not find original vnode");
100
- const n = Array.from(i).reverse();
101
- for (const l of n)
102
- if (l.component)
103
- return l.component;
104
- return r;
105
- }
106
- const A = lt(it, (t) => ({
107
- activator: "parent",
108
- location: t.arg?.replace("-", " ") ?? "top",
109
- text: typeof t.value == "boolean" ? void 0 : t.value
110
- })), dt = {
111
- class: "flex rounded-lg border border-gray-300 dark:border-gray-600",
112
- style: { margin: "2px" }
113
- }, ft = ["value"], yt = {
114
- __name: "EodashDatePicker",
115
- setup(t) {
116
- function r(e) {
117
- if (n.value && n.value.length > 0) {
118
- let a = e ? 1 / 0 : -1 / 0;
119
- n.value.forEach((s) => {
120
- s?.dates && s.dates.forEach((c) => {
121
- c instanceof Date && (!e && c.getTime() > a || e && c.getTime() < a) && (a = c.getTime());
122
- });
123
- }), a !== 0 && (l.value = new Date(a));
124
- }
125
- }
126
- const i = (
127
- /** @type {import("@/types").Eodash} */
128
- H(Z)
129
- ), o = V({
130
- input: "YYYY-MM-DD"
131
- }), n = V([]), l = v({
132
- get() {
133
- return x.value ? new Date(x.value) : /* @__PURE__ */ new Date();
134
- },
135
- /** @param {Date | string} updatedDate */
136
- set(e) {
137
- e instanceof Date && !isNaN(e.getTime()) ? x.value = new Date(
138
- e.getTime() - e.getTimezoneOffset() * 6e4
139
- ).toISOString() : x.value = (/* @__PURE__ */ new Date()).toISOString();
140
- }
141
- });
142
- return N(() => {
143
- const { selectedStac: e } = Y(z());
144
- G(
145
- [e],
146
- async ([a]) => {
147
- if (a) {
148
- const s = et(
149
- `./${a.id}/collection.json`,
150
- i.stacEndpoint
151
- ), c = at(
152
- e.value,
153
- s
154
- ), d = [
155
- "#009E73",
156
- "#0072B2",
157
- "#E69F00",
158
- "#CC79A7",
159
- "#56B4E9",
160
- "#D55E00"
161
- ];
162
- for (let f = 0; f < c.length; f++) {
163
- const m = (await tt.get(c[f]).then((u) => u.data)).links.filter(
164
- (u) => u.rel === "item" && "datetime" in u
165
- ).map(
166
- (u) => new Date(u.datetime)
167
- );
168
- n.value = [
169
- {
170
- bar: {
171
- style: {
172
- backgroundColor: d[f % d.length]
173
- }
174
- },
175
- dates: m
176
- }
177
- ];
178
- }
179
- }
180
- },
181
- { immediate: !0 }
182
- );
183
- }), (e, a) => (w(), W(
184
- L,
185
- null,
186
- [
187
- p(C(J), {
188
- modelValue: l.value,
189
- "onUpdate:modelValue": a[0] || (a[0] = (s) => l.value = s),
190
- masks: o.value,
191
- attributes: n.value
192
- }, {
193
- default: y(({ inputValue: s, inputEvents: c }) => [
194
- k("div", dt, [
195
- k("input", h({ value: s }, q(c, !0), {
196
- style: { margin: "1px" },
197
- class: "flex-grow px-1 py-1 bg-white dark:bg-gray-700"
198
- }), null, 16, ft)
199
- ])
200
- ]),
201
- _: 1
202
- /* STABLE */
203
- }, 8, ["modelValue", "masks", "attributes"]),
204
- p(K, {
205
- align: "center",
206
- justify: "center",
207
- style: { "margin-top": "6px" }
208
- }, {
209
- default: y(() => [
210
- S((w(), T(P, {
211
- style: { padding: "0px", "margin-right": "4px" },
212
- density: "compact",
213
- onClick: a[1] || (a[1] = (s) => r(!0))
214
- }, {
215
- default: y(() => [
216
- p(D, {
217
- icon: [C(Q)]
218
- }, null, 8, ["icon"])
219
- ]),
220
- _: 1
221
- /* STABLE */
222
- })), [
223
- [A, "Set date to oldest available dataset", "bottom"]
224
- ]),
225
- S((w(), T(P, {
226
- style: { padding: "0px", "margin-left": "4px" },
227
- density: "compact",
228
- onClick: a[2] || (a[2] = (s) => r(!1))
229
- }, {
230
- default: y(() => [
231
- p(D, {
232
- icon: [C(X)]
233
- }, null, 8, ["icon"])
234
- ]),
235
- _: 1
236
- /* STABLE */
237
- })), [
238
- [A, "Set date to latest available dataset", "bottom"]
239
- ])
240
- ]),
241
- _: 1
242
- /* STABLE */
243
- })
244
- ],
245
- 64
246
- /* STABLE_FRAGMENT */
247
- ));
248
- }
249
- };
250
- export {
251
- yt as default
252
- };