@geowiki/map 0.16.0-dev.0 → 0.16.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -163,7 +163,8 @@ var init_GenericCache = __esm({
163
163
  getFromStorage(key) {
164
164
  try {
165
165
  const stored = localStorage.getItem(key);
166
- if (!stored) return null;
166
+ if (!stored)
167
+ return null;
167
168
  const entry = JSON.parse(stored);
168
169
  if (this.isValid(entry)) {
169
170
  this.hitCount++;
@@ -448,8 +449,8 @@ var init_GenericCache = __esm({
448
449
  });
449
450
 
450
451
  // src/index.tsx
451
- var index_exports = {};
452
- __export(index_exports, {
452
+ var src_exports = {};
453
+ __export(src_exports, {
453
454
  Annotation: () => Annotation,
454
455
  BasfMap: () => BasfMap,
455
456
  BasicMap: () => BasicMap,
@@ -486,7 +487,7 @@ __export(index_exports, {
486
487
  useMapLayerStore: () => useMapLayerStore,
487
488
  useMapStore: () => useMapStore
488
489
  });
489
- module.exports = __toCommonJS(index_exports);
490
+ module.exports = __toCommonJS(src_exports);
490
491
 
491
492
  // src/Components/GenericControl.tsx
492
493
  var import_jsx_runtime = require("react/jsx-runtime");
@@ -622,7 +623,7 @@ var prepareRGBImage = (array, width, height) => {
622
623
  ctx == null ? void 0 : ctx.putImageData(imageData, 0, 0);
623
624
  return canvas;
624
625
  };
625
- var getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvasContext, selectedBand) => __async(null, null, function* () {
626
+ var getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvasContext, selectedBand) => __async(void 0, null, function* () {
626
627
  var _a, _b;
627
628
  try {
628
629
  var tiffWidth = rasterItem.width;
@@ -638,7 +639,8 @@ var getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvas
638
639
  var rgb = null;
639
640
  if (((_a = rasterItem.name) == null ? void 0 : _a.toLowerCase().includes("ndvi")) && ((_b = rasterItem.name) == null ? void 0 : _b.toLowerCase().includes("perc")))
640
641
  rgb = yield getNDVIValueForPixel(ndviImageCanvasContext, xTiff, yTiff);
641
- else rgb = null;
642
+ else
643
+ rgb = null;
642
644
  return [
643
645
  selectedValue,
644
646
  rgb !== null && rgb !== void 0 ? {
@@ -681,11 +683,12 @@ var deepCloneRasterAssetItem = (isAnnualAnnotation, asset, assetBuffer, uri, sel
681
683
  rasterItem.buffer = [...asset.buffer];
682
684
  rasterItem.uri = [...asset.uri];
683
685
  rasterItem.buffer[selectedBand] = new Uint32Array(assetBuffer);
684
- if (Array.isArray(rasterItem.uri)) rasterItem.uri[selectedBand] = uri;
686
+ if (Array.isArray(rasterItem.uri))
687
+ rasterItem.uri[selectedBand] = uri;
685
688
  }
686
689
  return rasterItem;
687
690
  };
688
- var getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnnotation, selectedBand, metadata) => __async(null, null, function* () {
691
+ var getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnnotation, selectedBand, metadata) => __async(void 0, null, function* () {
689
692
  var { newArray, canvas } = yield getEmptyPreviewRasterItemForInsert(
690
693
  length,
691
694
  width,
@@ -710,12 +713,12 @@ var getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnno
710
713
  }
711
714
  return rasterItem;
712
715
  });
713
- var getEmptyPreviewRasterItemForInsert = (length, width, height, labels) => __async(null, null, function* () {
716
+ var getEmptyPreviewRasterItemForInsert = (length, width, height, labels) => __async(void 0, null, function* () {
714
717
  const newArray = new Uint32Array(length).fill(0);
715
718
  const canvas = grayScaleArrayToCanvas(newArray, width, height, labels);
716
719
  return { newArray, canvas };
717
720
  });
718
- var updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnnotation) => __async(null, null, function* () {
721
+ var updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnnotation) => __async(void 0, null, function* () {
719
722
  var _a, _b, _c;
720
723
  if (!fromRasterItem) {
721
724
  return toPreviewRasterItem;
@@ -741,7 +744,7 @@ var updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnno
741
744
  }
742
745
  return toPreviewRasterItem;
743
746
  });
744
- var getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(null, null, function* () {
747
+ var getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(void 0, null, function* () {
745
748
  const tiff = yield (0, import_geotiff.fromArrayBuffer)(arrayBuffer);
746
749
  const image = yield tiff.getImage();
747
750
  const pool = new import_geotiff.Pool();
@@ -765,7 +768,7 @@ var getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(null, null, func
765
768
  pool.destroy();
766
769
  return { width, height, rasterItems };
767
770
  });
768
- var getRasterItems = (arrayBuffer, projectType) => __async(null, null, function* () {
771
+ var getRasterItems = (arrayBuffer, projectType) => __async(void 0, null, function* () {
769
772
  const tiff = yield (0, import_geotiff.fromArrayBuffer)(arrayBuffer);
770
773
  const image = yield tiff.getImage();
771
774
  const pool = new import_geotiff.Pool();
@@ -805,7 +808,7 @@ var getRasterItems = (arrayBuffer, projectType) => __async(null, null, function*
805
808
  pool.destroy();
806
809
  return { rasters, width, height, rasterItems };
807
810
  });
808
- var getAssetItemsForLocationAssets = (assets, labels) => __async(null, null, function* () {
811
+ var getAssetItemsForLocationAssets = (assets, labels) => __async(void 0, null, function* () {
809
812
  var rasterItems = [];
810
813
  for (var i = 0; i < (assets == null ? void 0 : assets.length); i++) {
811
814
  const item = assets[i];
@@ -828,7 +831,7 @@ var getAssetItemsForLocationAssets = (assets, labels) => __async(null, null, fun
828
831
  }
829
832
  return rasterItems;
830
833
  });
831
- var getRasterAssetItemsForLocationComposite = (assets) => __async(null, null, function* () {
834
+ var getRasterAssetItemsForLocationComposite = (assets) => __async(void 0, null, function* () {
832
835
  var rasterItems = [];
833
836
  for (var i = 0; i < (assets == null ? void 0 : assets.length); i++) {
834
837
  const item = assets[i];
@@ -849,7 +852,7 @@ var getRasterAssetItemsForLocationComposite = (assets) => __async(null, null, fu
849
852
  }
850
853
  return rasterItems;
851
854
  });
852
- var copyAllRasterSegments = (rasterItem, previewRasterItem, selectedValue, labelValue, labels) => __async(null, null, function* () {
855
+ var copyAllRasterSegments = (rasterItem, previewRasterItem, selectedValue, labelValue, labels) => __async(void 0, null, function* () {
853
856
  var newBuffer = overwriteArrayBufferWithSelectedValue(
854
857
  rasterItem.buffer,
855
858
  previewRasterItem.buffer,
@@ -925,7 +928,8 @@ function getAdjPixel(y, x, selectedValue, array2dMatrix) {
925
928
  while (pixelsToCheck.length > 0) {
926
929
  const [xTiff, yTiff] = pixelsToCheck.pop();
927
930
  var key = xTiff + "_" + yTiff;
928
- if (checkedPixels.has(key)) continue;
931
+ if (checkedPixels.has(key))
932
+ continue;
929
933
  checkedPixels.add(key);
930
934
  if (array2dMatrix[yTiff][xTiff] === selectedValue) {
931
935
  sameValPixels.push([yTiff, xTiff]);
@@ -947,7 +951,7 @@ function getAdjPixel(y, x, selectedValue, array2dMatrix) {
947
951
  }
948
952
  return sameValPixels;
949
953
  }
950
- var paintRasterSegment = (sourceRasterItem, destRasterItem, locations, bounds, labelValue, labels, paintType, selectedBand, isAnnualAnnotation) => __async(null, null, function* () {
954
+ var paintRasterSegment = (sourceRasterItem, destRasterItem, locations, bounds, labelValue, labels, paintType, selectedBand, isAnnualAnnotation) => __async(void 0, null, function* () {
951
955
  var tiffWidth = sourceRasterItem.width;
952
956
  var tiffHeight = sourceRasterItem.height;
953
957
  var annotatedRaster = isAnnualAnnotation ? destRasterItem.buffer : destRasterItem.buffer[selectedBand];
@@ -1070,7 +1074,8 @@ function pointInsidePolygon(xTiff, yTiff, vs) {
1070
1074
  var xi = vs[i].xTiff, yi = vs[i].yTiff;
1071
1075
  var xj = vs[j].xTiff, yj = vs[j].yTiff;
1072
1076
  var intersect = yi > yTiff !== yj > yTiff && xTiff < (xj - xi) * (yTiff - yi) / (yj - yi) + xi;
1073
- if (intersect) inside = !inside;
1077
+ if (intersect)
1078
+ inside = !inside;
1074
1079
  }
1075
1080
  return inside;
1076
1081
  }
@@ -1109,7 +1114,7 @@ function getDiagonalCoordinates(x1, y1, x2, y2) {
1109
1114
  coordinates.push({ yTiff: x2, xTiff: y2 });
1110
1115
  return coordinates;
1111
1116
  }
1112
- var getActiveLearningAnnotation = (assetHref, projectType) => __async(null, null, function* () {
1117
+ var getActiveLearningAnnotation = (assetHref, projectType) => __async(void 0, null, function* () {
1113
1118
  const res = yield fetch(assetHref);
1114
1119
  const buffer = yield res.arrayBuffer();
1115
1120
  const rItems = yield getRasterItems(buffer, projectType);
@@ -1126,7 +1131,7 @@ var getActiveLearningAnnotation = (assetHref, projectType) => __async(null, null
1126
1131
  };
1127
1132
  return assetItem;
1128
1133
  });
1129
- var createImageDataForNDVI = (asset) => __async(null, null, function* () {
1134
+ var createImageDataForNDVI = (asset) => __async(void 0, null, function* () {
1130
1135
  var canvas = document.createElement("canvas");
1131
1136
  var context = canvas.getContext("2d");
1132
1137
  var image = new Image();
@@ -1136,7 +1141,7 @@ var createImageDataForNDVI = (asset) => __async(null, null, function* () {
1136
1141
  context == null ? void 0 : context.drawImage(image, 0, 0, canvas.width, canvas.height);
1137
1142
  return context;
1138
1143
  });
1139
- var getNDVIValueForPixel = (ndviImageCanvasContext, x, y) => __async(null, null, function* () {
1144
+ var getNDVIValueForPixel = (ndviImageCanvasContext, x, y) => __async(void 0, null, function* () {
1140
1145
  var context = ndviImageCanvasContext;
1141
1146
  var data = context == null ? void 0 : context.getImageData(x, y, 1, 1).data;
1142
1147
  return data;
@@ -1356,7 +1361,8 @@ function getRasterAssetItemsForLocationAssets(assets) {
1356
1361
  if (Array.isArray((_a = rItem.result) == null ? void 0 : _a.base64)) {
1357
1362
  bufferData = (_b = rItem.result) == null ? void 0 : _b.base64.map((x) => {
1358
1363
  var _a2, _b2;
1359
- if (((_a2 = rItem.result) == null ? void 0 : _a2.arrayType) == "uint8") return Buffer.from(x, "base64");
1364
+ if (((_a2 = rItem.result) == null ? void 0 : _a2.arrayType) == "uint8")
1365
+ return Buffer.from(x, "base64");
1360
1366
  else if (((_b2 = rItem.result) == null ? void 0 : _b2.arrayType) == "uint32") {
1361
1367
  const buffer2 = Buffer.from(x, "base64");
1362
1368
  return new Uint32Array(
@@ -1437,14 +1443,16 @@ function ClearAnnotation(annotatedRasterAsset, isAnnualAnnotation, selectedBand,
1437
1443
  selectedBand,
1438
1444
  annotationRasterAsset.metadata
1439
1445
  );
1440
- if (isAnnualAnnotation) return { annotationRaster, pastValues };
1446
+ if (isAnnualAnnotation)
1447
+ return { annotationRaster, pastValues };
1441
1448
  else {
1442
1449
  var multiBandAnnotation = annotatedRasterAsset;
1443
1450
  if (multiBandAnnotation == null ? void 0 : multiBandAnnotation.buffer[selectedBand]) {
1444
1451
  multiBandAnnotation.buffer[selectedBand] = annotationRaster.buffer[selectedBand];
1445
1452
  multiBandAnnotation.uri[selectedBand] = annotationRaster.uri[selectedBand];
1446
1453
  return { multiBandAnnotation, undefined: void 0 };
1447
- } else return { annotatedRasterAsset: void 0, undefined: void 0 };
1454
+ } else
1455
+ return { annotatedRasterAsset: void 0, undefined: void 0 };
1448
1456
  }
1449
1457
  });
1450
1458
  }
@@ -1478,7 +1486,8 @@ function createTask(locationId, projectId, referenceDate) {
1478
1486
  currentTask: res.task,
1479
1487
  annotation_dates: yield getAnnotationDates(res == null ? void 0 : res.task)
1480
1488
  };
1481
- } else return { location: null, currentTask: null, annotation_dates: null };
1489
+ } else
1490
+ return { location: null, currentTask: null, annotation_dates: null };
1482
1491
  });
1483
1492
  }
1484
1493
  function getTask(taskId) {
@@ -1506,7 +1515,8 @@ function getTask(taskId) {
1506
1515
  annotation_dates: yield getAnnotationDates(res == null ? void 0 : res.task),
1507
1516
  location: locData
1508
1517
  };
1509
- } else return { currentTask: null, annotation_dates: null, location: null };
1518
+ } else
1519
+ return { currentTask: null, annotation_dates: null, location: null };
1510
1520
  });
1511
1521
  }
1512
1522
  function getActiveLearningAnnotationAsset(assetHref, labels, projectDetail) {
@@ -1558,7 +1568,8 @@ function insertEmptyBufferForSingleBand(length, width, height, selectedBand, ann
1558
1568
  annotatedAsset.buffer[selectedBand] = newArray;
1559
1569
  annotatedAsset.uri[selectedBand] = canvas.toDataURL();
1560
1570
  return annotatedAsset;
1561
- } else return null;
1571
+ } else
1572
+ return null;
1562
1573
  });
1563
1574
  }
1564
1575
  function getTaskChangeDetails(taskId) {
@@ -1572,8 +1583,10 @@ function getTaskGeometryDetail(taskId) {
1572
1583
  });
1573
1584
  }
1574
1585
  function getCentroid(geometry, has_area_of_interest, geometry_aoi, is_segment, geometry_segment) {
1575
- if (has_area_of_interest) return geometry_aoi;
1576
- if (is_segment) return geometry_segment;
1586
+ if (has_area_of_interest)
1587
+ return geometry_aoi;
1588
+ if (is_segment)
1589
+ return geometry_segment;
1577
1590
  return geometry;
1578
1591
  }
1579
1592
  function showAnnotation(savedAnnotations, submittedAnnotations, annotatedRasterAsset) {
@@ -1715,7 +1728,7 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
1715
1728
  setRecenterLocation: () => set({ recenterLocation: false }),
1716
1729
  setTimerReset: (timerreset) => set({ timerReset: timerreset }),
1717
1730
  setAnnotationTime: (annotationtime) => set({ annotationTime: annotationtime }),
1718
- onLocationSelected: (point3) => __async(null, null, function* () {
1731
+ onLocationSelected: (point3) => __async(void 0, null, function* () {
1719
1732
  var data = yield import_evoland_api_proxy2.LocationService.getPolygonUtmlocationLonLonLatLatWidthWidthHeightHeightGet(
1720
1733
  point3.lng,
1721
1734
  point3.lat,
@@ -1741,10 +1754,10 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
1741
1754
  location: locData
1742
1755
  });
1743
1756
  }),
1744
- onRecenterLocation: () => __async(null, null, function* () {
1757
+ onRecenterLocation: () => __async(void 0, null, function* () {
1745
1758
  return set({ recenterLocation: true });
1746
1759
  }),
1747
- getLocationAssets: (locationId, projectId, type, taskId) => __async(null, null, function* () {
1760
+ getLocationAssets: (locationId, projectId, type, taskId) => __async(void 0, null, function* () {
1748
1761
  var _a, _b;
1749
1762
  const state = useEvolandStore.getState();
1750
1763
  var {
@@ -1867,7 +1880,7 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
1867
1880
  }
1868
1881
  return [];
1869
1882
  }),
1870
- getLocationDetails: (locationId, projectId, user, taskId, isAdmin) => __async(null, null, function* () {
1883
+ getLocationDetails: (locationId, projectId, user, taskId, isAdmin) => __async(void 0, null, function* () {
1871
1884
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
1872
1885
  var state = useEvolandStore.getState();
1873
1886
  var { referenceDate, reference_dates, sessionTimeOut, projectDetail, task_for_review } = state;
@@ -1956,7 +1969,7 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
1956
1969
  }
1957
1970
  }
1958
1971
  }),
1959
- getNextLocationDetails: (projectId) => __async(null, null, function* () {
1972
+ getNextLocationDetails: (projectId) => __async(void 0, null, function* () {
1960
1973
  var _a, _b, _c;
1961
1974
  set({ isLoading: true });
1962
1975
  var state = useEvolandStore.getState();
@@ -2025,7 +2038,7 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
2025
2038
  setOpacity: (opacity) => set({ opacity }),
2026
2039
  setCompositeOpacity: (opacity) => set({ compositeOpacity: opacity }),
2027
2040
  setAnnotationOpacity: (opacity) => set({ annotationOpacity: opacity }),
2028
- addLabel: (loc, bounds, label) => __async(null, null, function* () {
2041
+ addLabel: (loc, bounds, label) => __async(void 0, null, function* () {
2029
2042
  var _a;
2030
2043
  set({ isLoading: true });
2031
2044
  var store = useEvolandStore.getState();
@@ -2085,14 +2098,14 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
2085
2098
  setShowTimeSeries: (value) => set({ showTimeSeries: value }),
2086
2099
  reset: () => set(initialState),
2087
2100
  setSelectedColorLabel: (label) => set({ selectedColorLabel: label }),
2088
- getLegendsDetails: (array) => __async(null, null, function* () {
2101
+ getLegendsDetails: (array) => __async(void 0, null, function* () {
2089
2102
  var store = useEvolandStore.getState();
2090
2103
  var legends = yield getLegends(array, store.labels);
2091
2104
  set({
2092
2105
  legends
2093
2106
  });
2094
2107
  }),
2095
- getLocationMetaData: (locationId, projectId, taskId) => __async(null, null, function* () {
2108
+ getLocationMetaData: (locationId, projectId, taskId) => __async(void 0, null, function* () {
2096
2109
  var _a, _b;
2097
2110
  set({ isLoading: true });
2098
2111
  var state = useEvolandStore.getState();
@@ -2118,7 +2131,7 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
2118
2131
  set({ sessionTimeOut: true, isLoading: false });
2119
2132
  }
2120
2133
  }),
2121
- getLabels: (projectId) => __async(null, null, function* () {
2134
+ getLabels: (projectId) => __async(void 0, null, function* () {
2122
2135
  var state = useEvolandStore.getState();
2123
2136
  if (state.labels) {
2124
2137
  return state.labels;
@@ -2140,10 +2153,10 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
2140
2153
  });
2141
2154
  return allLabels;
2142
2155
  }),
2143
- setBrushThickness: (value) => __async(null, null, function* () {
2156
+ setBrushThickness: (value) => __async(void 0, null, function* () {
2144
2157
  return set({ brushThickness: value });
2145
2158
  }),
2146
- getProjectDetail: (projectId) => __async(null, null, function* () {
2159
+ getProjectDetail: (projectId) => __async(void 0, null, function* () {
2147
2160
  set({ isLoading: true });
2148
2161
  const projectInfo = yield import_evoland_api_proxy2.ProjectService.projectDetailProjectdetailProjectIdProjectIdGet(
2149
2162
  projectId
@@ -2154,12 +2167,12 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
2154
2167
  isAnnualAnnotation: (projectInfo == null ? void 0 : projectInfo.project_type) == "ANNUALLY" /* ANNUALLY */ ? true : false
2155
2168
  });
2156
2169
  }),
2157
- getTaskEvents: (taskId) => __async(null, null, function* () {
2170
+ getTaskEvents: (taskId) => __async(void 0, null, function* () {
2158
2171
  set({ isLoading: true });
2159
2172
  const taskevents = yield import_evoland_api_proxy2.TaskService.getTaskEventsTaskeventsTaskIdTaskIdGet(taskId);
2160
2173
  set({ isLoading: false, taskEvents: taskevents });
2161
2174
  }),
2162
- getTaskAnnotation: (submittedAnnotationAsset, assetType) => __async(null, null, function* () {
2175
+ getTaskAnnotation: (submittedAnnotationAsset, assetType) => __async(void 0, null, function* () {
2163
2176
  var _a, _b, _c;
2164
2177
  if (submittedAnnotationAsset != null && submittedAnnotationAsset.length > 0) {
2165
2178
  const state = useEvolandStore.getState();
@@ -2209,7 +2222,7 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
2209
2222
  setCurrentPosition: (position) => set({ currentPosition: position }),
2210
2223
  setSessionTimeOut: (hasTimeOut) => set({ sessionTimeOut: hasTimeOut }),
2211
2224
  setLatestTaskAnnotation: (locationTask) => set({ latestTaskAnnotation: locationTask }),
2212
- getTaskReferenceDates: (projectId, locatioId, asset_type, setSelected) => __async(null, null, function* () {
2225
+ getTaskReferenceDates: (projectId, locatioId, asset_type, setSelected) => __async(void 0, null, function* () {
2213
2226
  const state = useEvolandStore.getState();
2214
2227
  const { annotation_dates, reference_dates, selectedReferenceDate } = state;
2215
2228
  var task_ref_dates = yield getRefDates(projectId, locatioId, asset_type);
@@ -2225,7 +2238,7 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
2225
2238
  });
2226
2239
  }
2227
2240
  }),
2228
- setSelectedReferenceDate: (currentReferenceDate) => __async(null, null, function* () {
2241
+ setSelectedReferenceDate: (currentReferenceDate) => __async(void 0, null, function* () {
2229
2242
  const state = useEvolandStore.getState();
2230
2243
  const { selectedReferenceDate, reference_dates } = state;
2231
2244
  if (currentReferenceDate !== selectedReferenceDate)
@@ -2234,49 +2247,49 @@ var useEvolandStore = (0, import_zustand.create)()((set) => ({
2234
2247
  selectedBand: reference_dates == null ? void 0 : reference_dates.indexOf(currentReferenceDate)
2235
2248
  });
2236
2249
  }),
2237
- setUpdateAsset: (updateAssets) => __async(null, null, function* () {
2250
+ setUpdateAsset: (updateAssets) => __async(void 0, null, function* () {
2238
2251
  return set({ updateAssets });
2239
2252
  }),
2240
- setComment: (comment) => __async(null, null, function* () {
2253
+ setComment: (comment) => __async(void 0, null, function* () {
2241
2254
  return set({ comment });
2242
2255
  }),
2243
- setAnnualAnnotation: (val) => __async(null, null, function* () {
2256
+ setAnnualAnnotation: (val) => __async(void 0, null, function* () {
2244
2257
  return set({ isAnnualAnnotation: val });
2245
2258
  }),
2246
- setSelectedBand: (bandIndex) => __async(null, null, function* () {
2259
+ setSelectedBand: (bandIndex) => __async(void 0, null, function* () {
2247
2260
  return set({ selectedBand: bandIndex });
2248
2261
  }),
2249
- setAnnotationDates: (annotationDates) => __async(null, null, function* () {
2262
+ setAnnotationDates: (annotationDates) => __async(void 0, null, function* () {
2250
2263
  return set({ annotation_dates: annotationDates });
2251
2264
  }),
2252
- setSavedAnnotations: (savedAnnotation) => __async(null, null, function* () {
2265
+ setSavedAnnotations: (savedAnnotation) => __async(void 0, null, function* () {
2253
2266
  return set({ savedAnnotations: savedAnnotation });
2254
2267
  }),
2255
- setLabelList: (labels) => __async(null, null, function* () {
2268
+ setLabelList: (labels) => __async(void 0, null, function* () {
2256
2269
  return set({ labelList: labels });
2257
2270
  }),
2258
- setLocation: (loc) => __async(null, null, function* () {
2271
+ setLocation: (loc) => __async(void 0, null, function* () {
2259
2272
  return set({ location: loc });
2260
2273
  }),
2261
- setCurrentTask: (task) => __async(null, null, function* () {
2274
+ setCurrentTask: (task) => __async(void 0, null, function* () {
2262
2275
  return set({ currentTask: task });
2263
2276
  }),
2264
- setTimeSeriesTypes: (types) => __async(null, null, function* () {
2277
+ setTimeSeriesTypes: (types) => __async(void 0, null, function* () {
2265
2278
  return set({ timeSeriesTypes: types });
2266
2279
  }),
2267
- setTimeSeriesAssets: (assets) => __async(null, null, function* () {
2280
+ setTimeSeriesAssets: (assets) => __async(void 0, null, function* () {
2268
2281
  return set({ timeSeriesAssets: assets });
2269
2282
  }),
2270
- setActiveLearningAnnotations: (active_learning) => __async(null, null, function* () {
2283
+ setActiveLearningAnnotations: (active_learning) => __async(void 0, null, function* () {
2271
2284
  return set({ activeLearningAnnotations: active_learning });
2272
2285
  }),
2273
- setSubmittedAnnotations: (submit_annotation) => __async(null, null, function* () {
2286
+ setSubmittedAnnotations: (submit_annotation) => __async(void 0, null, function* () {
2274
2287
  return set({ submittedAnnotations: submit_annotation });
2275
2288
  }),
2276
- setAnnotatedRasterAsset: (annotated_raster) => __async(null, null, function* () {
2289
+ setAnnotatedRasterAsset: (annotated_raster) => __async(void 0, null, function* () {
2277
2290
  return set({ annotatedRasterAsset: annotated_raster });
2278
2291
  }),
2279
- setTaskGeometry: (task_geometry) => __async(null, null, function* () {
2292
+ setTaskGeometry: (task_geometry) => __async(void 0, null, function* () {
2280
2293
  return set({ taskGeometry: task_geometry });
2281
2294
  }),
2282
2295
  setTaskForReview(taskForReview) {
@@ -2394,7 +2407,8 @@ var TiffImage = (props) => {
2394
2407
  } else if (localcomment !== void 0 && (localcomment == null ? void 0 : localcomment.includes("#" + x))) {
2395
2408
  localcomment = localcomment.replace(" #" + x, "");
2396
2409
  this.className = "rounded-xl flex inline-flex text-secondary p-1 text-sm";
2397
- } else localcomment = "#" + x + " ";
2410
+ } else
2411
+ localcomment = "#" + x + " ";
2398
2412
  if (evolandStore.comment !== void 0 && evolandStore.comment !== null && !((_a5 = evolandStore.comment) == null ? void 0 : _a5.includes("#" + x)))
2399
2413
  evolandStore.setComment(
2400
2414
  evolandStore.comment + localcomment
@@ -2403,7 +2417,8 @@ var TiffImage = (props) => {
2403
2417
  evolandStore.setComment(
2404
2418
  evolandStore.comment.replace(" #" + x, "")
2405
2419
  );
2406
- else evolandStore.setComment(localcomment);
2420
+ else
2421
+ evolandStore.setComment(localcomment);
2407
2422
  });
2408
2423
  container.appendChild(content);
2409
2424
  }
@@ -2444,7 +2459,7 @@ var TiffImage = (props) => {
2444
2459
  bubblingMouseEvents: false,
2445
2460
  className: "border-2 border-blue-600"
2446
2461
  }).bringToFront();
2447
- imageOverlay3.on("mouseover", (e) => __async(null, null, function* () {
2462
+ imageOverlay3.on("mouseover", (e) => __async(void 0, null, function* () {
2448
2463
  var _a3, _b2;
2449
2464
  if (isBrush()) {
2450
2465
  tooltip2 = L.tooltip({ offset: L.point(20, 0), opacity: 0.6 }).setContent(
@@ -2466,20 +2481,21 @@ var TiffImage = (props) => {
2466
2481
  ).setLatLng(e.latlng).addTo(map);
2467
2482
  }
2468
2483
  }));
2469
- imageOverlay3.on("mousemove", (e) => __async(null, null, function* () {
2484
+ imageOverlay3.on("mousemove", (e) => __async(void 0, null, function* () {
2470
2485
  evolandStore.setNDVIRGBValues(ndvi);
2471
2486
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2472
2487
  if (isDrawing) {
2473
2488
  handleMouseMove(e);
2474
2489
  }
2475
2490
  }));
2476
- imageOverlay3.on("mouseout", () => __async(null, null, function* () {
2491
+ imageOverlay3.on("mouseout", () => __async(void 0, null, function* () {
2477
2492
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2478
2493
  }));
2479
- imageOverlay3.on("click", (e) => __async(null, null, function* () {
2494
+ imageOverlay3.on("click", (e) => __async(void 0, null, function* () {
2480
2495
  var _a3, _b2, _c2;
2481
2496
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2482
- if (((_a3 = evolandStore.selectedRasterAsset) == null ? void 0 : _a3.type) == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */) return;
2497
+ if (((_a3 = evolandStore.selectedRasterAsset) == null ? void 0 : _a3.type) == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */)
2498
+ return;
2483
2499
  if (evolandStore.selectedColorLabel == null && evolandStore.selectedToolType !== 6 /* ClearSegmentWithPolygon */) {
2484
2500
  alert("Please select label");
2485
2501
  return;
@@ -2526,23 +2542,25 @@ var TiffImage = (props) => {
2526
2542
  opacity: 0.8,
2527
2543
  lineCap: "round"
2528
2544
  }).addTo(map);
2529
- polyLine.on("click", () => __async(null, null, function* () {
2545
+ polyLine.on("click", () => __async(void 0, null, function* () {
2530
2546
  stopPaint();
2531
2547
  }));
2532
- polyLine.on("mouseover", (e) => __async(null, null, function* () {
2548
+ polyLine.on("mouseover", (e) => __async(void 0, null, function* () {
2533
2549
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2534
2550
  tooltip2 = L.tooltip({ offset: L.point(20, 0), opacity: 0.6 }).setContent("Click to Stop").setLatLng(e.latlng).addTo(map);
2535
2551
  }));
2536
- polyLine.on("mousemove", () => __async(null, null, function* () {
2552
+ polyLine.on("mousemove", () => __async(void 0, null, function* () {
2537
2553
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2538
2554
  }));
2539
- polyLine.on("mouseout", () => __async(null, null, function* () {
2555
+ polyLine.on("mouseout", () => __async(void 0, null, function* () {
2540
2556
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2541
2557
  }));
2542
2558
  }
2543
2559
  return () => {
2544
- if (imageOverlay3) map.removeLayer(imageOverlay3);
2545
- if (tagsPopUp) map.removeLayer(tagsPopUp);
2560
+ if (imageOverlay3)
2561
+ map.removeLayer(imageOverlay3);
2562
+ if (tagsPopUp)
2563
+ map.removeLayer(tagsPopUp);
2546
2564
  if (rectangle3 && evolandStore.isAnnualAnnotation)
2547
2565
  map.removeLayer(rectangle3);
2548
2566
  if (polyLine !== void 0) {
@@ -2635,7 +2653,7 @@ var ReadOnlyTiffImage = (props) => {
2635
2653
  bubblingMouseEvents: false,
2636
2654
  className: "border-2 border-blue-600"
2637
2655
  }).bringToBack();
2638
- imageOverlay3.on("mouseover", (e) => __async(null, null, function* () {
2656
+ imageOverlay3.on("mouseover", (e) => __async(void 0, null, function* () {
2639
2657
  var data = yield getCanvasDataFromImageArray(
2640
2658
  props.raster,
2641
2659
  e.latlng,
@@ -2645,7 +2663,7 @@ var ReadOnlyTiffImage = (props) => {
2645
2663
  );
2646
2664
  setNDVI(data[1]);
2647
2665
  }));
2648
- imageOverlay3.on("mousemove", () => __async(null, null, function* () {
2666
+ imageOverlay3.on("mousemove", () => __async(void 0, null, function* () {
2649
2667
  evolandStore.setNDVIRGBValues(ndvi);
2650
2668
  }));
2651
2669
  imageOverlay3.addTo(map);
@@ -2663,9 +2681,12 @@ var ReadOnlyTiffImage = (props) => {
2663
2681
  }).addTo(map);
2664
2682
  }
2665
2683
  return () => {
2666
- if (imageOverlay3) map.removeLayer(imageOverlay3);
2667
- if (rectangle3 && showRectangleAtCenter) map.removeLayer(rectangle3);
2668
- if (props.polygonBounds) map.removeLayer(polygon_segment);
2684
+ if (imageOverlay3)
2685
+ map.removeLayer(imageOverlay3);
2686
+ if (rectangle3 && showRectangleAtCenter)
2687
+ map.removeLayer(rectangle3);
2688
+ if (props.polygonBounds)
2689
+ map.removeLayer(polygon_segment);
2669
2690
  };
2670
2691
  }, [props, map, showRectangleAtCenter]);
2671
2692
  return null;
@@ -2908,7 +2929,8 @@ var import_ui = require("@geowiki/ui");
2908
2929
  var import_jsx_runtime4 = require("react/jsx-runtime");
2909
2930
  var EvolandContainer = ({ sessionStatus }) => {
2910
2931
  const evolandStore = useEvolandStore();
2911
- if (sessionStatus === "unauthenticated") return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui.AuthenticationFailure, {});
2932
+ if (sessionStatus === "unauthenticated")
2933
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_ui.AuthenticationFailure, {});
2912
2934
  return evolandStore.location && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(EvoLandGeometry, {});
2913
2935
  };
2914
2936
 
@@ -3088,7 +3110,8 @@ var defaultStyles = {
3088
3110
  };
3089
3111
  var excludedProperties = /* @__PURE__ */ new Set(["bbox", "geometry", "type"]);
3090
3112
  var formatValue = (value) => {
3091
- if (value === null || value === void 0) return "";
3113
+ if (value === null || value === void 0)
3114
+ return "";
3092
3115
  if (typeof value === "number") {
3093
3116
  return value.toLocaleString();
3094
3117
  }
@@ -3324,7 +3347,8 @@ var BetterWMS = class extends import_leaflet4.default.TileLayer.WMS {
3324
3347
  * Builds the URL for the GetFeatureInfo WMS request
3325
3348
  */
3326
3349
  getFeatureInfoUrl(latlng) {
3327
- if (!this.currentMap) return null;
3350
+ if (!this.currentMap)
3351
+ return null;
3328
3352
  const point3 = this.currentMap.latLngToContainerPoint(latlng);
3329
3353
  const size = this.currentMap.getSize();
3330
3354
  const wmsParams = this.wmsParams;
@@ -3393,7 +3417,8 @@ var BetterWMS = class extends import_leaflet4.default.TileLayer.WMS {
3393
3417
  return;
3394
3418
  }
3395
3419
  this.geoJsonLayer.addData(content);
3396
- if (!this.currentMap) return;
3420
+ if (!this.currentMap)
3421
+ return;
3397
3422
  if (this.currentPopup) {
3398
3423
  this.currentMap.closePopup(this.currentPopup);
3399
3424
  }
@@ -3410,7 +3435,8 @@ var BetterWMS = class extends import_leaflet4.default.TileLayer.WMS {
3410
3435
  * Show loading popup
3411
3436
  */
3412
3437
  showLoading(latlng) {
3413
- if (!this.currentMap || this.loading || !this.canShowLoading) return;
3438
+ if (!this.currentMap || this.loading || !this.canShowLoading)
3439
+ return;
3414
3440
  this.loading = true;
3415
3441
  this.currentPopup = import_leaflet4.default.popup(this.popupOptions).setLatLng(latlng).setContent(this.loadingContent).openOn(this.currentMap);
3416
3442
  }
@@ -3421,7 +3447,8 @@ var BetterWMS = class extends import_leaflet4.default.TileLayer.WMS {
3421
3447
  return __async(this, null, function* () {
3422
3448
  var _a, _b, _c;
3423
3449
  const url = this.getFeatureInfoUrl(event.latlng);
3424
- if (!url) return;
3450
+ if (!url)
3451
+ return;
3425
3452
  try {
3426
3453
  this.showLoading(event.latlng);
3427
3454
  const data = yield this.fetchWithRetry(url);
@@ -3602,7 +3629,8 @@ var import_ui3 = require("@geowiki/ui");
3602
3629
  var import_jsx_runtime8 = require("react/jsx-runtime");
3603
3630
  var FarmerClusterPopup = ({ properties }) => {
3604
3631
  const fileUrl = (0, import_core5.useFileUrl)();
3605
- if (!properties) return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "No properties found" });
3632
+ if (!properties)
3633
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: "No properties found" });
3606
3634
  const name = properties["name"];
3607
3635
  const description = properties["description"];
3608
3636
  const url = "/cluster/view/" + properties["id"];
@@ -3658,7 +3686,8 @@ var import_ui5 = require("@geowiki/ui");
3658
3686
  var import_image2 = __toESM(require("next/image"));
3659
3687
  var import_jsx_runtime10 = require("react/jsx-runtime");
3660
3688
  var SiteInformation = ({ data }) => {
3661
- if (!data) return null;
3689
+ if (!data)
3690
+ return null;
3662
3691
  const baseDocUrl = "https://raw.githubusercontent.com/iiasa/static/refs/heads/main/geotrees/docs/biomass_processing_protocol/";
3663
3692
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-6", children: [
3664
3693
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "space-y-4", children: [
@@ -3833,7 +3862,8 @@ var IfbnSitePopup = ({ properties }) => {
3833
3862
  const [isLoading, setIsLoading] = (0, import_react6.useState)(false);
3834
3863
  const [imageError, setImageError] = (0, import_react6.useState)(false);
3835
3864
  const { status: sessionStatus, data: session } = (0, import_core6.useSession)();
3836
- if (!properties) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: "No properties found" });
3865
+ if (!properties)
3866
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { children: "No properties found" });
3837
3867
  const plotId = properties["Plot_ID"];
3838
3868
  const subPlotId = properties["SubPlot_Id"];
3839
3869
  const network = properties["Network"];
@@ -3842,7 +3872,7 @@ var IfbnSitePopup = ({ properties }) => {
3842
3872
  const fallbackUrl = "https://cms.main.geo-wiki.org/geotrees/media/cocoa.png";
3843
3873
  const baseImageUrl = "https://raw.githubusercontent.com/iiasa/static/refs/heads/main/geotrees/sites/";
3844
3874
  const imageUrl = `${baseImageUrl}${plotId}.jpg?raw=true`;
3845
- const fetchSiteData = () => __async(null, null, function* () {
3875
+ const fetchSiteData = () => __async(void 0, null, function* () {
3846
3876
  setIsLoading(true);
3847
3877
  try {
3848
3878
  const response = yield fetch(
@@ -3853,7 +3883,8 @@ var IfbnSitePopup = ({ properties }) => {
3853
3883
  }
3854
3884
  }
3855
3885
  );
3856
- if (!response.ok) throw new Error("Failed to fetch data");
3886
+ if (!response.ok)
3887
+ throw new Error("Failed to fetch data");
3857
3888
  const data = yield response.json();
3858
3889
  setSiteData(data);
3859
3890
  } catch (error) {
@@ -3927,14 +3958,16 @@ var IfbnPlotPopup = ({ properties }) => {
3927
3958
  const [error, setError] = (0, import_react7.useState)(null);
3928
3959
  const API_URL = process.env.NEXT_PUBLIC_GEO_TREE_API_URL;
3929
3960
  (0, import_react7.useEffect)(() => {
3930
- const fetchApiData = () => __async(null, null, function* () {
3931
- if (!(properties == null ? void 0 : properties.id)) return;
3961
+ const fetchApiData = () => __async(void 0, null, function* () {
3962
+ if (!(properties == null ? void 0 : properties.id))
3963
+ return;
3932
3964
  setIsLoading(true);
3933
3965
  try {
3934
3966
  const response = yield fetch(
3935
3967
  `${API_URL}/api/plots/by-plot-id/${properties.plot_id}`
3936
3968
  );
3937
- if (!response.ok) throw new Error("Failed to fetch data");
3969
+ if (!response.ok)
3970
+ throw new Error("Failed to fetch data");
3938
3971
  const data = yield response.json();
3939
3972
  console.log("API Response:", data);
3940
3973
  setApiData(data);
@@ -4108,9 +4141,12 @@ var createClusterIcon = (color) => {
4108
4141
  markers.forEach((marker2) => {
4109
4142
  var _a, _b, _c;
4110
4143
  const status = ((_c = (_b = (_a = marker2.feature) == null ? void 0 : _a.properties) == null ? void 0 : _b.Status) == null ? void 0 : _c.trim().toLowerCase()) || "default";
4111
- if (status === "ongoing") statusCount.ongoing++;
4112
- else if (status === "auxiliary") statusCount.auxiliary++;
4113
- else statusCount.default++;
4144
+ if (status === "ongoing")
4145
+ statusCount.ongoing++;
4146
+ else if (status === "auxiliary")
4147
+ statusCount.auxiliary++;
4148
+ else
4149
+ statusCount.default++;
4114
4150
  });
4115
4151
  return import_leaflet6.default.divIcon({
4116
4152
  html: `<div style=
@@ -4136,7 +4172,7 @@ var GeoJsonLayer = (0, import_react8.memo)(
4136
4172
  ({ layer }) => {
4137
4173
  const { isLoading, error, data } = (0, import_react_query.useQuery)({
4138
4174
  queryKey: ["geoJson", layer.id],
4139
- queryFn: () => __async(null, null, function* () {
4175
+ queryFn: () => __async(void 0, null, function* () {
4140
4176
  const res = yield fetch(layer.url);
4141
4177
  return yield res.json();
4142
4178
  })
@@ -4186,7 +4222,8 @@ var GeoJsonLayer = (0, import_react8.memo)(
4186
4222
  [layerIcon]
4187
4223
  );
4188
4224
  const processedData = (0, import_react8.useMemo)(() => {
4189
- if (!(data == null ? void 0 : data.features)) return data;
4225
+ if (!(data == null ? void 0 : data.features))
4226
+ return data;
4190
4227
  const processed = __spreadValues({}, data);
4191
4228
  processed.features = data.features.map((feature) => {
4192
4229
  var _a;
@@ -4212,8 +4249,10 @@ var GeoJsonLayer = (0, import_react8.memo)(
4212
4249
  }),
4213
4250
  [layer.id]
4214
4251
  );
4215
- if (error) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: "error" });
4216
- if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui6.LoaderFull, {});
4252
+ if (error)
4253
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: "error" });
4254
+ if (isLoading)
4255
+ return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_ui6.LoaderFull, {});
4217
4256
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
4218
4257
  MarkerClusterGroup2,
4219
4258
  {
@@ -4286,9 +4325,12 @@ var createClusterIcon2 = (cluster) => {
4286
4325
  markers.forEach((marker2) => {
4287
4326
  var _a, _b, _c;
4288
4327
  const status = ((_c = (_b = (_a = marker2.feature) == null ? void 0 : _a.properties) == null ? void 0 : _b.Status) == null ? void 0 : _c.trim().toLowerCase()) || "default";
4289
- if (status === "ongoing") statusCount.ongoing++;
4290
- else if (status === "auxiliary") statusCount.auxiliary++;
4291
- else statusCount.default++;
4328
+ if (status === "ongoing")
4329
+ statusCount.ongoing++;
4330
+ else if (status === "auxiliary")
4331
+ statusCount.auxiliary++;
4332
+ else
4333
+ statusCount.default++;
4292
4334
  });
4293
4335
  let clusterColor = "#2E7D32";
4294
4336
  if (statusCount.ongoing > statusCount.auxiliary && statusCount.ongoing > statusCount.default) {
@@ -4337,7 +4379,7 @@ var IfbnPlotLayer = ({
4337
4379
  });
4338
4380
  const { isLoading, error, data } = (0, import_react_query2.useQuery)({
4339
4381
  queryKey: ["IfbnPlotLayer", layer.id],
4340
- queryFn: () => __async(null, null, function* () {
4382
+ queryFn: () => __async(void 0, null, function* () {
4341
4383
  const res = yield fetch(`${layer.url}`);
4342
4384
  return yield res.json();
4343
4385
  })
@@ -4346,7 +4388,8 @@ var IfbnPlotLayer = ({
4346
4388
  return currentZoom <= hideMarkersAboveZoom;
4347
4389
  };
4348
4390
  (0, import_react9.useEffect)(() => {
4349
- if (!markerClusterGroupRef.current) return;
4391
+ if (!markerClusterGroupRef.current)
4392
+ return;
4350
4393
  if (shouldShowMarkers()) {
4351
4394
  markersRef.current.forEach((marker2) => {
4352
4395
  var _a, _b;
@@ -4434,8 +4477,10 @@ var IfbnPlotLayer = ({
4434
4477
  setSelectedFeature({ feature, latlng });
4435
4478
  };
4436
4479
  const ref = (0, import_react9.useRef)(null);
4437
- if (error) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: "error" });
4438
- if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui8.LoaderFull, {});
4480
+ if (error)
4481
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { children: "error" });
4482
+ if (isLoading)
4483
+ return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_ui8.LoaderFull, {});
4439
4484
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(
4440
4485
  MarkerClusterGroup2,
4441
4486
  {
@@ -4689,7 +4734,8 @@ var useCustomLayerStore = (0, import_zustand4.create)()((set, get) => ({
4689
4734
  createLayerFromTemplate: (templateId, customData) => {
4690
4735
  var _a, _b;
4691
4736
  const template = get().getTemplate(templateId);
4692
- if (!template) return null;
4737
+ if (!template)
4738
+ return null;
4693
4739
  const newLayer = {
4694
4740
  id: (0, import_uuid.v4)(),
4695
4741
  isCustom: true,
@@ -5060,11 +5106,16 @@ function getColumnStats(data, columnName) {
5060
5106
  let type;
5061
5107
  if (uniqueTypes.size === 1) {
5062
5108
  const singleType = types[0];
5063
- if (singleType === "string") type = "string";
5064
- else if (singleType === "number") type = "number";
5065
- else if (singleType === "boolean") type = "boolean";
5066
- else if (singleType === "object") type = "date";
5067
- else type = "mixed";
5109
+ if (singleType === "string")
5110
+ type = "string";
5111
+ else if (singleType === "number")
5112
+ type = "number";
5113
+ else if (singleType === "boolean")
5114
+ type = "boolean";
5115
+ else if (singleType === "object")
5116
+ type = "date";
5117
+ else
5118
+ type = "mixed";
5068
5119
  } else {
5069
5120
  type = "mixed";
5070
5121
  }
@@ -5077,15 +5128,21 @@ var GoogleSheetsPopup = ({
5077
5128
  properties
5078
5129
  }) => {
5079
5130
  const isEmpty = (value) => {
5080
- if (value === null || value === void 0) return true;
5081
- if (typeof value === "string") return value.trim() === "";
5082
- if (typeof value === "number") return isNaN(value);
5083
- if (Array.isArray(value)) return value.length === 0;
5084
- if (typeof value === "object") return Object.keys(value).length === 0;
5131
+ if (value === null || value === void 0)
5132
+ return true;
5133
+ if (typeof value === "string")
5134
+ return value.trim() === "";
5135
+ if (typeof value === "number")
5136
+ return isNaN(value);
5137
+ if (Array.isArray(value))
5138
+ return value.length === 0;
5139
+ if (typeof value === "object")
5140
+ return Object.keys(value).length === 0;
5085
5141
  return false;
5086
5142
  };
5087
5143
  const isUrl = (value) => {
5088
- if (typeof value !== "string") return false;
5144
+ if (typeof value !== "string")
5145
+ return false;
5089
5146
  const trimmedValue = value.trim();
5090
5147
  const urlPatterns = [
5091
5148
  /^https?:\/\//i,
@@ -5555,7 +5612,8 @@ function analyzeColumn(rows, columnName) {
5555
5612
  };
5556
5613
  }
5557
5614
  function getLegendColumns(rows, excludeCoordinateColumns = []) {
5558
- if (rows.length === 0) return [];
5615
+ if (rows.length === 0)
5616
+ return [];
5559
5617
  const headers = Object.keys(rows[0]);
5560
5618
  const legendColumns = [];
5561
5619
  for (const header of headers) {
@@ -5692,7 +5750,7 @@ function useGenericCache({
5692
5750
  const isCached = cache.has(cacheKey);
5693
5751
  const queryOptions = {
5694
5752
  queryKey: [cacheKey.type, cacheKey.id, cacheKey.subId, cacheKey.version],
5695
- queryFn: () => __async(null, null, function* () {
5753
+ queryFn: () => __async(this, null, function* () {
5696
5754
  const cachedData = cache.get(cacheKey);
5697
5755
  if (cachedData) {
5698
5756
  console.log(
@@ -5761,7 +5819,7 @@ function useGoogleSheetsData({
5761
5819
  subId: sheetConfig.sheetId,
5762
5820
  version: "1.0.0"
5763
5821
  } : null;
5764
- const fetchData = () => __async(null, null, function* () {
5822
+ const fetchData = () => __async(this, null, function* () {
5765
5823
  if (!sheetConfig) {
5766
5824
  throw new Error("Invalid Google Sheets configuration");
5767
5825
  }
@@ -6029,7 +6087,8 @@ var GoogleSheetsLayer = ({
6029
6087
  };
6030
6088
  const processedData = (0, import_react10.useMemo)(() => {
6031
6089
  var _a2;
6032
- if (!data) return null;
6090
+ if (!data)
6091
+ return null;
6033
6092
  return __spreadProps(__spreadValues({}, data), {
6034
6093
  features: (_a2 = data.features) == null ? void 0 : _a2.map((feature) => {
6035
6094
  var _a3;
@@ -6847,9 +6906,10 @@ var RasterPreview = (_props) => {
6847
6906
  },
6848
6907
  { scopes: ["evoland"] }
6849
6908
  );
6850
- const onSubmit = (taskStatus) => __async(null, null, function* () {
6909
+ const onSubmit = (taskStatus) => __async(void 0, null, function* () {
6851
6910
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2;
6852
- if (disableSubmit) return;
6911
+ if (disableSubmit)
6912
+ return;
6853
6913
  setDisableSubmit(true);
6854
6914
  var bufferData = null;
6855
6915
  var { data: savedAnnotationBuffer, indexArr: savedAnnotationIndexArr } = evolandStore.savedAnnotations && evolandStore.isAnnualAnnotation ? { data: evolandStore.savedAnnotations.buffer, indexArr: 0 } : evolandStore.savedAnnotations ? flatten(evolandStore.savedAnnotations.buffer) : { data: void 0, indexArr: 0 };
@@ -6906,7 +6966,8 @@ var RasterPreview = (_props) => {
6906
6966
  if (_props.userRole === "admin") {
6907
6967
  if (tasks == null ? void 0 : tasks.task)
6908
6968
  window.location.href = `/map?projectId=${projectId}&locationId=${(_v2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _v2.location_id}&taskId=${(_w2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _w2.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
6909
- else alert("No more tasks to review");
6969
+ else
6970
+ alert("No more tasks to review");
6910
6971
  }
6911
6972
  var res = yield evolandStore.getNextLocationDetails(
6912
6973
  parseInt(projectId)
@@ -6930,7 +6991,8 @@ var RasterPreview = (_props) => {
6930
6991
  }
6931
6992
  });
6932
6993
  const arrayEqual = (a, b) => {
6933
- if (a.length !== b.length) return false;
6994
+ if (a.length !== b.length)
6995
+ return false;
6934
6996
  return Buffer.compare(Buffer.from(a.buffer), Buffer.from(b.buffer)) === 0;
6935
6997
  };
6936
6998
  const flatten = (input, refArr) => {
@@ -6954,14 +7016,15 @@ var RasterPreview = (_props) => {
6954
7016
  }
6955
7017
  }
6956
7018
  }
6957
- if (indexArr.length == 0) result = emptyAnnotation;
7019
+ if (indexArr.length == 0)
7020
+ result = emptyAnnotation;
6958
7021
  return { data: new Uint32Array(result), indexArr };
6959
7022
  };
6960
7023
  function isBase64Zeros(base64String) {
6961
7024
  const trimmed = base64String.replace(/=+$/, "");
6962
7025
  return /^A+$/.test(trimmed);
6963
7026
  }
6964
- const onSave = () => __async(null, null, function* () {
7027
+ const onSave = () => __async(void 0, null, function* () {
6965
7028
  var _a2, _b2;
6966
7029
  var bufferData = null;
6967
7030
  const { data, indexArr } = evolandStore.isAnnualAnnotation ? { data: evolandStore.annotatedRasterAsset.buffer, indexArr: 0 } : flatten(
@@ -7009,7 +7072,8 @@ var RasterPreview = (_props) => {
7009
7072
  setSubmitNotificationMessage(
7010
7073
  "Annotation has been SAVED successfully"
7011
7074
  );
7012
- else setSubmitNotificationMessage("Please try again");
7075
+ else
7076
+ setSubmitNotificationMessage("Please try again");
7013
7077
  setSubmitNotification(true);
7014
7078
  }
7015
7079
  } catch (err) {
@@ -7018,7 +7082,7 @@ var RasterPreview = (_props) => {
7018
7082
  }
7019
7083
  }
7020
7084
  });
7021
- const ClearPreview = () => __async(null, null, function* () {
7085
+ const ClearPreview = () => __async(void 0, null, function* () {
7022
7086
  const { annotationRaster, pastValues } = yield ClearAnnotation(
7023
7087
  evolandStore.annotatedRasterAsset,
7024
7088
  evolandStore.isAnnualAnnotation,
@@ -7081,14 +7145,16 @@ var RasterPreview = (_props) => {
7081
7145
  )] : newValue == null ? void 0 : newValue.buffer[0] : newValue == null ? void 0 : newValue.buffer
7082
7146
  );
7083
7147
  };
7084
- if (layerStore.layerOpacity == 0) layerStore.setLayerOpacity(0.4);
7148
+ if (layerStore.layerOpacity == 0)
7149
+ layerStore.setLayerOpacity(0.4);
7085
7150
  if (!goToNextTask && evolandStore.location !== null && evolandStore.location.locationId !== searchParams.get("locationId")) {
7086
7151
  if (status == import_core9.TaskStatus.ACCEPTED || status == import_core9.TaskStatus.DISCARDED || status == import_core9.TaskStatus.TO_FIX) {
7087
7152
  setGoToNextTask(true);
7088
7153
  if (_props.userRole === "admin")
7089
7154
  if (tasks == null ? void 0 : tasks.task)
7090
7155
  window.location.href = `/map?projectId=${projectId}&locationId=${(_a = tasks == null ? void 0 : tasks.task) == null ? void 0 : _a.location_id}&taskId=${(_b = tasks == null ? void 0 : tasks.task) == null ? void 0 : _b.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
7091
- else alert("No more tasks to review");
7156
+ else
7157
+ alert("No more tasks to review");
7092
7158
  } else
7093
7159
  window.location.href = `/map?projectId=${projectId}&locationId=${(_c = evolandStore.location) == null ? void 0 : _c.locationId}&taskId=${(_d = evolandStore.location) == null ? void 0 : _d.task[0].task_id}`;
7094
7160
  }
@@ -7137,8 +7203,10 @@ var RasterPreview = (_props) => {
7137
7203
  parseInt(projectId),
7138
7204
  evolandStore.referenceDate
7139
7205
  ).then(({ location, currentTask, annotation_dates }) => {
7140
- if (location) evolandStore.setLocation(location);
7141
- if (currentTask) evolandStore.setCurrentTask(currentTask);
7206
+ if (location)
7207
+ evolandStore.setLocation(location);
7208
+ if (currentTask)
7209
+ evolandStore.setCurrentTask(currentTask);
7142
7210
  evolandStore.setAnnotationDates(annotation_dates);
7143
7211
  });
7144
7212
  },
@@ -7174,7 +7242,8 @@ var RasterPreview = (_props) => {
7174
7242
  evolandStore.setComment(
7175
7243
  evolandStore.comment.replace(" #" + x, "")
7176
7244
  );
7177
- else evolandStore.setComment("#" + x + " ");
7245
+ else
7246
+ evolandStore.setComment("#" + x + " ");
7178
7247
  },
7179
7248
  children: [
7180
7249
  "#",
@@ -7429,7 +7498,7 @@ var Annotation = (props) => {
7429
7498
  labelId: 0
7430
7499
  });
7431
7500
  const [currentLabelItem, setCurrentLabelItem] = (0, import_react16.useState)();
7432
- const OnSubmitActiveLearning = () => __async(null, null, function* () {
7501
+ const OnSubmitActiveLearning = () => __async(void 0, null, function* () {
7433
7502
  var _a2, _b2;
7434
7503
  setActiveLearningLoading(true);
7435
7504
  var bufferData = null;
@@ -8500,7 +8569,8 @@ var import_ui13 = require("@geowiki/ui");
8500
8569
  var import_jsx_runtime31 = require("react/jsx-runtime");
8501
8570
  var assetsByYear = (assets) => assets == null ? void 0 : assets.reduce((acc, item) => {
8502
8571
  const year = new Date(item.reference_date).getFullYear();
8503
- if (!acc[year]) acc[year] = [];
8572
+ if (!acc[year])
8573
+ acc[year] = [];
8504
8574
  acc[year].push(item);
8505
8575
  return acc;
8506
8576
  }, {});
@@ -8617,10 +8687,14 @@ var ViewAssets = (props) => {
8617
8687
  );
8618
8688
  if (props.taskId !== void 0 && IsTaskAnnotationLoading)
8619
8689
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui13.LoaderFull, {});
8620
- if (maskTab && (masks == null ? void 0 : masks.length) == 0) setMasks(evolandStore.maskAsset);
8621
- if (changeMaskTab && (changeMasks == null ? void 0 : changeMasks.length) == 0) checkChangeMasksAndLoad();
8622
- if (compositesTab && composites.length == 0) checkCompositesAndLoad();
8623
- if (annotationTab) checkAnnotationsAndLoad();
8690
+ if (maskTab && (masks == null ? void 0 : masks.length) == 0)
8691
+ setMasks(evolandStore.maskAsset);
8692
+ if (changeMaskTab && (changeMasks == null ? void 0 : changeMasks.length) == 0)
8693
+ checkChangeMasksAndLoad();
8694
+ if (compositesTab && composites.length == 0)
8695
+ checkCompositesAndLoad();
8696
+ if (annotationTab)
8697
+ checkAnnotationsAndLoad();
8624
8698
  function checkMasksAndLoad() {
8625
8699
  if ((masks == null ? void 0 : masks.length) === 0 && !evolandStore.maskAsset) {
8626
8700
  evolandStore.getLocationAssets(
@@ -8631,7 +8705,8 @@ var ViewAssets = (props) => {
8631
8705
  ).then((res) => {
8632
8706
  setMasks(res);
8633
8707
  });
8634
- } else if (masks.length == 0) setMasks(evolandStore.maskAsset);
8708
+ } else if (masks.length == 0)
8709
+ setMasks(evolandStore.maskAsset);
8635
8710
  }
8636
8711
  function checkChangeMasksAndLoad() {
8637
8712
  if ((changeMasks == null ? void 0 : changeMasks.length) === 0 && !evolandStore.changeMaskAsset) {
@@ -8677,7 +8752,8 @@ var ViewAssets = (props) => {
8677
8752
  }
8678
8753
  if (props.taskId !== void 0 && IsTaskAnnotationLoading)
8679
8754
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_ui13.LoaderFull, {});
8680
- if (maskTab && ((masks == null ? void 0 : masks.length) == 0 || masks == null)) setMaskTab(false);
8755
+ if (maskTab && ((masks == null ? void 0 : masks.length) == 0 || masks == null))
8756
+ setMaskTab(false);
8681
8757
  return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("div", { children: [
8682
8758
  /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
8683
8759
  "div",
@@ -9233,7 +9309,8 @@ var SearchAnnotation = (props) => {
9233
9309
  localStorage.setItem("toDate", toDate);
9234
9310
  if (tasks == null ? void 0 : tasks.exists)
9235
9311
  window.location.href = `/map?projectId=${tasks == null ? void 0 : tasks.task.project_id}&locationId=${tasks == null ? void 0 : tasks.task.location_id}&taskId=${tasks == null ? void 0 : tasks.task.task_id}${props.taskForReview ? "&review=true" : ""}`;
9236
- else alert("No data for search parameters");
9312
+ else
9313
+ alert("No data for search parameters");
9237
9314
  },
9238
9315
  children: [
9239
9316
  /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
@@ -9547,11 +9624,14 @@ var EvolandLeftSideBar = (props) => {
9547
9624
  }
9548
9625
  if (evolandStore.projectDetail) {
9549
9626
  if (((_m = (_l = evolandStore.projectDetail) == null ? void 0 : _l.meta_data) == null ? void 0 : _m.default_asset_view) == "SEGMENTATION_MASK" /* SegmentationMask */) {
9550
- if ((masks == null ? void 0 : masks.length) === 0) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
9627
+ if ((masks == null ? void 0 : masks.length) === 0)
9628
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
9551
9629
  } else if (((_o = (_n = evolandStore.projectDetail) == null ? void 0 : _n.meta_data) == null ? void 0 : _o.default_asset_view) == "COMPOSITE" /* Composite */) {
9552
- if ((composites == null ? void 0 : composites.length) === 0) return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
9630
+ if ((composites == null ? void 0 : composites.length) === 0)
9631
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
9553
9632
  }
9554
- } else return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
9633
+ } else
9634
+ return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_ui15.LoaderFull, {});
9555
9635
  return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
9556
9636
  "div",
9557
9637
  {
@@ -9718,7 +9798,8 @@ var EvolandLeftSideBar = (props) => {
9718
9798
  canDelete = confirm(
9719
9799
  (review ? "This is a targeted review task. " : "") + "Are you sure you want to delete this task?"
9720
9800
  );
9721
- if (canDelete) setDeleteTask(true);
9801
+ if (canDelete)
9802
+ setDeleteTask(true);
9722
9803
  },
9723
9804
  children: [
9724
9805
  /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
@@ -9760,7 +9841,8 @@ var EvolandLeftSideBar = (props) => {
9760
9841
  evolandStore.setAnnotationDates(annotation_dates);
9761
9842
  if (currentTask)
9762
9843
  evolandStore.setCurrentTask(currentTask);
9763
- if (location) evolandStore.setLocation(location);
9844
+ if (location)
9845
+ evolandStore.setLocation(location);
9764
9846
  if (props.userRole === "admin")
9765
9847
  window.location.href = "/map?projectId=" + projectId + "&locationId=" + (currentTask == null ? void 0 : currentTask.location_id) + "&taskId=" + (currentTask == null ? void 0 : currentTask.task_id) + (evolandStore.task_for_review ? "&review=true" : "");
9766
9848
  }
@@ -9943,9 +10025,10 @@ var Questions = (props) => {
9943
10025
  userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
9944
10026
  locationLocationId: null
9945
10027
  });
9946
- const onSubmit = (taskStatus) => __async(null, null, function* () {
10028
+ const onSubmit = (taskStatus) => __async(void 0, null, function* () {
9947
10029
  var _a2, _b2, _c2, _d2, _e2;
9948
- if (disableSubmit) return;
10030
+ if (disableSubmit)
10031
+ return;
9949
10032
  setDisableSubmit(true);
9950
10033
  setStatus(taskStatus[0]);
9951
10034
  if (evolandStore.currentTask) {
@@ -9977,7 +10060,8 @@ var Questions = (props) => {
9977
10060
  if (props.userRole === "admin") {
9978
10061
  if (tasks == null ? void 0 : tasks.task)
9979
10062
  window.location.href = `/map?projectId=${projectId}&locationId=${(_d2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _d2.location_id}&taskId=${(_e2 = tasks == null ? void 0 : tasks.task) == null ? void 0 : _e2.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
9980
- else alert("No more tasks to review");
10063
+ else
10064
+ alert("No more tasks to review");
9981
10065
  }
9982
10066
  var res = yield evolandStore.getNextLocationDetails(
9983
10067
  parseInt(projectId)
@@ -10000,7 +10084,7 @@ var Questions = (props) => {
10000
10084
  setSubmitNotificationMessage("");
10001
10085
  }
10002
10086
  });
10003
- const onSave = () => __async(null, null, function* () {
10087
+ const onSave = () => __async(void 0, null, function* () {
10004
10088
  if (evolandStore.currentTask) {
10005
10089
  const saveQuestionnaireReq = {
10006
10090
  task_id: evolandStore.currentTask.task_id,
@@ -10019,7 +10103,8 @@ var Questions = (props) => {
10019
10103
  setSubmitNotificationMessage(
10020
10104
  "Questionnaire has been SAVED successfully"
10021
10105
  );
10022
- else setSubmitNotificationMessage("Please try again");
10106
+ else
10107
+ setSubmitNotificationMessage("Please try again");
10023
10108
  setSubmitNotification(true);
10024
10109
  }
10025
10110
  } catch (err) {
@@ -10052,7 +10137,8 @@ var Questions = (props) => {
10052
10137
  "<" + key + ">",
10053
10138
  "" + (label == null ? void 0 : label.labelName)
10054
10139
  );
10055
- } else y.text = y.text.replace("<" + key + ">", "" + value);
10140
+ } else
10141
+ y.text = y.text.replace("<" + key + ">", "" + value);
10056
10142
  });
10057
10143
  });
10058
10144
  }
@@ -10098,7 +10184,8 @@ var Questions = (props) => {
10098
10184
  if (props.userRole === "admin")
10099
10185
  if (tasks == null ? void 0 : tasks.task)
10100
10186
  window.location.href = `/map?projectId=${projectId}&locationId=${(_c = tasks == null ? void 0 : tasks.task) == null ? void 0 : _c.location_id}&taskId=${(_d = tasks == null ? void 0 : tasks.task) == null ? void 0 : _d.task_id}${evolandStore.task_for_review ? "&review=true" : ""}`;
10101
- else alert("No more tasks to review");
10187
+ else
10188
+ alert("No more tasks to review");
10102
10189
  } else
10103
10190
  window.location.href = `/map?projectId=${projectId}&locationId=${(_e = evolandStore.location) == null ? void 0 : _e.locationId}&taskId=${(_f = evolandStore.location) == null ? void 0 : _f.task[0].task_id}`;
10104
10191
  }
@@ -10213,7 +10300,8 @@ var Questions = (props) => {
10213
10300
  evolandStore.setComment(
10214
10301
  evolandStore.comment.replace(" #" + x, "")
10215
10302
  );
10216
- else evolandStore.setComment("#" + x + " ");
10303
+ else
10304
+ evolandStore.setComment("#" + x + " ");
10217
10305
  },
10218
10306
  children: [
10219
10307
  "#",
@@ -10246,7 +10334,8 @@ var Questions = (props) => {
10246
10334
  onClick: () => {
10247
10335
  if (import_core15.TaskState[x[0]] !== import_core15.TaskState.SKIPPED && import_core15.TaskState[x[0]] !== import_core15.TaskState.DISCARDED && import_core15.TaskState[x[0]] !== import_core15.TaskState.USER_DISCARDED && userAnswers.length !== requiredUserAnswers)
10248
10336
  alert("Please provide all answers");
10249
- else onSubmit(x);
10337
+ else
10338
+ onSubmit(x);
10250
10339
  },
10251
10340
  children: import_core15.TaskState[x[0]]
10252
10341
  }
@@ -10292,7 +10381,7 @@ var TimeSeries = () => {
10292
10381
  const bbox4 = [bounds[1], bounds[0], bounds[3], bounds[2]];
10293
10382
  const years = changeYears != null ? changeYears : taskChangeYears;
10294
10383
  if (years) {
10295
- years.map((year) => __async(null, null, function* () {
10384
+ years.map((year) => __async(this, null, function* () {
10296
10385
  yield getTimeseries(
10297
10386
  year + "-01-01",
10298
10387
  year + "-12-31",
@@ -10327,7 +10416,8 @@ var TimeSeries = () => {
10327
10416
  })
10328
10417
  }
10329
10418
  );
10330
- if (!appendImages) setDetailedImgUrls((yield response.json()).images);
10419
+ if (!appendImages)
10420
+ setDetailedImgUrls((yield response.json()).images);
10331
10421
  else {
10332
10422
  response.json().then((res) => {
10333
10423
  setDetailedImgUrls((prevUrls) => [...prevUrls, ...res.images]);
@@ -10371,15 +10461,18 @@ var TimeSeries = () => {
10371
10461
  return 1;
10372
10462
  else if (x.substring(x.split("_")[0].length, x.length) < y.substring(y.split("_")[0].length, y.length))
10373
10463
  return -1;
10374
- else return 0;
10464
+ else
10465
+ return 0;
10375
10466
  }).map((x, index) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
10376
10467
  "button",
10377
10468
  {
10378
10469
  className: currentTab === index ? "pl-1 pr-5 border-gray-300 text-white" : "pl-1 pr-5 border-gray-300 bg-gray-200",
10379
10470
  onClick: () => {
10380
10471
  setDetailedImgUrls([]);
10381
- if (x.includes("RGB")) fetchImages("TRUE_COLOR" /* RGB */);
10382
- else if (x.includes("FCC")) fetchImages("COLOR_INFRARED" /* FCC */);
10472
+ if (x.includes("RGB"))
10473
+ fetchImages("TRUE_COLOR" /* RGB */);
10474
+ else if (x.includes("FCC"))
10475
+ fetchImages("COLOR_INFRARED" /* FCC */);
10383
10476
  setCurrentTab(index);
10384
10477
  },
10385
10478
  children: x.substring(x.split("_")[0].length + 1, x.length)
@@ -10558,7 +10651,8 @@ var OverlayLayer = () => {
10558
10651
  if (e.target.value !== "0") {
10559
10652
  layerStore.setSelectedLayer(e.target.value);
10560
10653
  setShowLayerOpacity(true);
10561
- if (layerStore.layerOpacity == 0) layerStore.setLayerOpacity(0.4);
10654
+ if (layerStore.layerOpacity == 0)
10655
+ layerStore.setLayerOpacity(0.4);
10562
10656
  } else {
10563
10657
  setShowLayerOpacity(false);
10564
10658
  layerStore.setSelectedLayer("");
@@ -10621,8 +10715,10 @@ var BingLayer = class extends L13.TileLayer {
10621
10715
  for (let i = z4; i > 0; i--) {
10622
10716
  let digit = 0;
10623
10717
  const mask = 1 << i - 1;
10624
- if ((x & mask) !== 0) digit += 1;
10625
- if ((y & mask) !== 0) digit += 2;
10718
+ if ((x & mask) !== 0)
10719
+ digit += 1;
10720
+ if ((y & mask) !== 0)
10721
+ digit += 2;
10626
10722
  quad = quad + digit;
10627
10723
  }
10628
10724
  return quad;
@@ -10636,7 +10732,8 @@ var BingLayer = class extends L13.TileLayer {
10636
10732
  }
10637
10733
  loadMetadata() {
10638
10734
  var _a;
10639
- if (this.metaRequested) return;
10735
+ if (this.metaRequested)
10736
+ return;
10640
10737
  this.metaRequested = true;
10641
10738
  const _this = this;
10642
10739
  const cbid = "_bing_metadata_" + L13.Util.stamp(this);
@@ -10644,7 +10741,8 @@ var BingLayer = class extends L13.TileLayer {
10644
10741
  var _a2;
10645
10742
  window[cbid] = void 0;
10646
10743
  const e = document.getElementById(cbid);
10647
- if (e) (_a2 = e.parentNode) == null ? void 0 : _a2.removeChild(e);
10744
+ if (e)
10745
+ (_a2 = e.parentNode) == null ? void 0 : _a2.removeChild(e);
10648
10746
  if (meta.errorDetails) {
10649
10747
  console.log(meta.errorDetails);
10650
10748
  return;
@@ -10688,7 +10786,8 @@ var BingLayer = class extends L13.TileLayer {
10688
10786
  this._update();
10689
10787
  }
10690
10788
  _update() {
10691
- if (this._url === null || !this._map) return;
10789
+ if (this._url === null || !this._map)
10790
+ return;
10692
10791
  this._update_attribution();
10693
10792
  super._update();
10694
10793
  }
@@ -10850,7 +10949,8 @@ var useMapControlStore = (0, import_zustand6.create)((set) => ({
10850
10949
  })),
10851
10950
  toggleControlOpen: (id) => set((state) => {
10852
10951
  const targetControl = state.controls.find((c) => c.id === id);
10853
- if (!targetControl) return state;
10952
+ if (!targetControl)
10953
+ return state;
10854
10954
  const targetPosition = targetControl.position;
10855
10955
  const shouldOpenTarget = !targetControl.isOpen;
10856
10956
  const updatedControls = state.controls.map((control) => {
@@ -11036,7 +11136,7 @@ var import_jsx_runtime42 = require("react/jsx-runtime");
11036
11136
  var constructLegendUrl = (baseUrl, layer, format, style) => {
11037
11137
  return `${baseUrl}?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=${format}&LAYER=${layer}&STYLE=${style}&legend_options=dpi:150`;
11038
11138
  };
11039
- var fetchLegendData = (baseUrl, layerName, format, style) => __async(null, null, function* () {
11139
+ var fetchLegendData = (baseUrl, layerName, format, style) => __async(void 0, null, function* () {
11040
11140
  const legendGraphicUrl = constructLegendUrl(
11041
11141
  baseUrl,
11042
11142
  layerName,
@@ -11833,8 +11933,10 @@ var LayerSwitcher = (0, import_react27.memo)(() => {
11833
11933
  },
11834
11934
  [openHoverCardId]
11835
11935
  );
11836
- if (error) return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: "Error loading map layers" });
11837
- if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: "Loading layers..." });
11936
+ if (error)
11937
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: "Error loading map layers" });
11938
+ if (isLoading)
11939
+ return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { children: "Loading layers..." });
11838
11940
  const mapMenus = parseMapMenuItems(mapMenuItems);
11839
11941
  const hasRegularLayers = (mapMenus == null ? void 0 : mapMenus.length) > 0;
11840
11942
  const hasCustomLayers = customLayers.length > 0;
@@ -12305,7 +12407,8 @@ var MapControlContainer = (0, import_react35.memo)(() => {
12305
12407
  }, [controls]);
12306
12408
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_ui24.TooltipProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_jsx_runtime50.Fragment, { children: Object.entries(POSITION_CLASSES2).map(([position, className]) => {
12307
12409
  const positionControls = controlsByPosition[position] || [];
12308
- if (positionControls.length === 0) return null;
12410
+ if (positionControls.length === 0)
12411
+ return null;
12309
12412
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(
12310
12413
  PositionGroup,
12311
12414
  {
@@ -12332,7 +12435,8 @@ var BasicMap = () => {
12332
12435
  ((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
12333
12436
  ];
12334
12437
  (0, import_core22.useRenderInfo)("BasicMap");
12335
- if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_ui25.LoaderFull, {});
12438
+ if (isSettingsLoading)
12439
+ return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_ui25.LoaderFull, {});
12336
12440
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
12337
12441
  import_react_leaflet15.MapContainer,
12338
12442
  {
@@ -12400,7 +12504,8 @@ var useSelectedPixelStore = (0, import_zustand7.default)((set) => ({
12400
12504
  set((state) => {
12401
12505
  var _a;
12402
12506
  const feat = (_a = geoJson.features[0]) == null ? void 0 : _a.id;
12403
- if (!feat) return state;
12507
+ if (!feat)
12508
+ return state;
12404
12509
  const existing = state.data.some(
12405
12510
  (item) => item.features[0].id === geoJson.features[0].id
12406
12511
  );
@@ -13060,7 +13165,7 @@ var BasfSelect = () => {
13060
13165
  [selectedItems]
13061
13166
  );
13062
13167
  const onSubmit = (0, import_react43.useCallback)(
13063
- (data) => __async(null, null, function* () {
13168
+ (data) => __async(void 0, null, function* () {
13064
13169
  setIsSubmitting(true);
13065
13170
  try {
13066
13171
  if (checkIfItemExists(data)) {
@@ -13170,7 +13275,8 @@ function PolylineMeasureControl() {
13170
13275
  const controlRef = (0, import_react44.useRef)(null);
13171
13276
  const [active, setActive] = (0, import_react44.useState)(false);
13172
13277
  (0, import_react44.useEffect)(() => {
13173
- if (!map) return;
13278
+ if (!map)
13279
+ return;
13174
13280
  controlRef.current = import_leaflet12.default.control.polylineMeasure({
13175
13281
  position: "topright",
13176
13282
  unit: "metres",
@@ -13191,7 +13297,8 @@ function PolylineMeasureControl() {
13191
13297
  };
13192
13298
  }, [map]);
13193
13299
  const togglePolylineMeasure = () => {
13194
- if (!controlRef.current) return;
13300
+ if (!controlRef.current)
13301
+ return;
13195
13302
  if (!controlRef.current._measureControl) {
13196
13303
  console.warn("Measurement control not properly initialized");
13197
13304
  return;
@@ -13207,7 +13314,8 @@ function PolylineMeasureControl() {
13207
13314
  }
13208
13315
  };
13209
13316
  const clearMeasurements = () => {
13210
- if (!controlRef.current) return;
13317
+ if (!controlRef.current)
13318
+ return;
13211
13319
  controlRef.current._clearAllMeasurements();
13212
13320
  import_core27.trackMapEvent.measurementTool("clear");
13213
13321
  };
@@ -13316,7 +13424,8 @@ var BasfMapComponent = (_a) => {
13316
13424
  Number((_i = (_h = (_g = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _g.Longitude) == null ? void 0 : _h.Text) != null ? _i : 16.3738)
13317
13425
  ];
13318
13426
  const steps = (_k = (_j = mapSettings == null ? void 0 : mapSettings.MapSettings) == null ? void 0 : _j.TourSteps) == null ? void 0 : _k.Text;
13319
- if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_ui33.LoaderFull, {});
13427
+ if (isSettingsLoading)
13428
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_ui33.LoaderFull, {});
13320
13429
  return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_jsx_runtime62.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
13321
13430
  import_react_leaflet19.MapContainer,
13322
13431
  __spreadProps(__spreadValues({
@@ -13386,7 +13495,7 @@ var GeoTreesDownloadContent = () => {
13386
13495
  }
13387
13496
  }, [session, setValue]);
13388
13497
  (0, import_react47.useEffect)(() => {
13389
- const fetchCountries = () => __async(null, null, function* () {
13498
+ const fetchCountries = () => __async(void 0, null, function* () {
13390
13499
  try {
13391
13500
  const response = yield fetch(
13392
13501
  `${baseUrl}/api/plots/get-available-countries`,
@@ -13402,7 +13511,7 @@ var GeoTreesDownloadContent = () => {
13402
13511
  console.error("Error fetching countries:", error);
13403
13512
  }
13404
13513
  });
13405
- const fetchVersions = () => __async(null, null, function* () {
13514
+ const fetchVersions = () => __async(void 0, null, function* () {
13406
13515
  try {
13407
13516
  const response = yield fetch(
13408
13517
  `${baseUrl}/api/plots/available-versions`,
@@ -13656,7 +13765,8 @@ var ScaleControl3 = ({
13656
13765
  const [scale, setScale] = (0, import_react48.useState)("");
13657
13766
  (0, import_react48.useEffect)(() => {
13658
13767
  const updateScale = () => {
13659
- if (!map) return;
13768
+ if (!map)
13769
+ return;
13660
13770
  const center4 = map.getCenter();
13661
13771
  const zoom = map.getZoom();
13662
13772
  const metersPerPixel = 156543.03392 * Math.cos(center4.lat * Math.PI / 180) / Math.pow(2, zoom);
@@ -13672,7 +13782,8 @@ var ScaleControl3 = ({
13672
13782
  map.off("moveend", updateScale);
13673
13783
  };
13674
13784
  }, [map]);
13675
- if (!scale) return null;
13785
+ if (!scale)
13786
+ return null;
13676
13787
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
13677
13788
  "div",
13678
13789
  {
@@ -14262,7 +14373,7 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
14262
14373
  const externalUrl = `${API_URL}/api/external/google-sheet-geojson`;
14263
14374
  const { isLoading, error, data } = (0, import_react_query5.useQuery)({
14264
14375
  queryKey: ["geoTreesExternal", externalUrl],
14265
- queryFn: () => __async(null, null, function* () {
14376
+ queryFn: () => __async(void 0, null, function* () {
14266
14377
  if (!API_URL) {
14267
14378
  throw new Error("NEXT_PUBLIC_GEO_TREE_API_URL is not configured");
14268
14379
  }
@@ -14294,7 +14405,8 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
14294
14405
  );
14295
14406
  const addGeoTreesLayer = (0, import_react51.useCallback)(() => {
14296
14407
  var _a2;
14297
- if (!data) return;
14408
+ if (!data)
14409
+ return;
14298
14410
  const layerId = "geotrees-external-layer";
14299
14411
  if (hasLayerBeenAdded(layerId) || existingLayer || hasAddedLayer.current) {
14300
14412
  console.warn("GEO-TREES BRM layer already exists, skipping addition", {
@@ -14307,7 +14419,8 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
14307
14419
  const filteredFeatures = ((_a2 = data.features) == null ? void 0 : _a2.filter((feature) => {
14308
14420
  var _a3;
14309
14421
  const status = (_a3 = feature.properties) == null ? void 0 : _a3.Status;
14310
- if (!status) return true;
14422
+ if (!status)
14423
+ return true;
14311
14424
  const statusKey = getStatusFromRaw(status);
14312
14425
  return statusKey ? statusFilter[statusKey] : true;
14313
14426
  })) || [];
@@ -14375,9 +14488,12 @@ var GeoTreesExternalLayer = (0, import_react51.forwardRef)(
14375
14488
  addGeoTreesLayer();
14376
14489
  }
14377
14490
  }, [data, autoAdd, existingLayer, addGeoTreesLayer, hasLayerBeenAdded]);
14378
- if (error) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ErrorDisplay, { error });
14379
- if (isLoading) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(LoadingDisplay, {});
14380
- if (!((_a = data == null ? void 0 : data.features) == null ? void 0 : _a.length)) return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EmptyStateDisplay, {});
14491
+ if (error)
14492
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(ErrorDisplay, { error });
14493
+ if (isLoading)
14494
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(LoadingDisplay, {});
14495
+ if (!((_a = data == null ? void 0 : data.features) == null ? void 0 : _a.length))
14496
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(EmptyStateDisplay, {});
14381
14497
  return null;
14382
14498
  }
14383
14499
  );
@@ -14428,7 +14544,8 @@ var GeoTreesMap = () => {
14428
14544
  "Error loading map settings: ",
14429
14545
  error.message
14430
14546
  ] }) });
14431
- if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_ui35.LoaderFull, { showInCenter: false });
14547
+ if (isSettingsLoading)
14548
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_ui35.LoaderFull, { showInCenter: false });
14432
14549
  const zoom = (_c = (_b = (_a = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _a.Zoom) == null ? void 0 : _b.Value) != null ? _c : 12;
14433
14550
  const center4 = [
14434
14551
  (_f = (_e = (_d = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _d.Latitude) == null ? void 0 : _e.Text) != null ? _f : 48.2082,
@@ -14488,7 +14605,8 @@ var useAreaSelect = ({
14488
14605
  const rectangleRef = (0, import_react53.useRef)(null);
14489
14606
  (0, import_react53.useEffect)(() => {
14490
14607
  var _a;
14491
- if (!map.selectArea) return;
14608
+ if (!map.selectArea)
14609
+ return;
14492
14610
  (_a = map.selectArea) == null ? void 0 : _a.setControlKey(false);
14493
14611
  if (!rectangleRef.current) {
14494
14612
  rectangleRef.current = new import_leaflet17.Rectangle(
@@ -14501,7 +14619,8 @@ var useAreaSelect = ({
14501
14619
  }
14502
14620
  const handleAreaSelected = (e) => {
14503
14621
  var _a2, _b, _c;
14504
- if (!e.bounds) return;
14622
+ if (!e.bounds)
14623
+ return;
14505
14624
  const boundsString = e.bounds.toBBoxString();
14506
14625
  if (onAreaSelected) {
14507
14626
  onAreaSelected(boundsString);
@@ -14574,8 +14693,9 @@ var import_jsx_runtime70 = require("react/jsx-runtime");
14574
14693
  var CanopyAtlasDownload = () => {
14575
14694
  const [format, setFormat] = (0, import_react54.useState)("shape-zip");
14576
14695
  const { bbox: bbox4 } = useAreaSelectStore();
14577
- const handleDownload = () => __async(null, null, function* () {
14578
- if (!bbox4) return;
14696
+ const handleDownload = () => __async(void 0, null, function* () {
14697
+ if (!bbox4)
14698
+ return;
14579
14699
  const params = {
14580
14700
  request: "GetFeature",
14581
14701
  service: "WFS",
@@ -14590,7 +14710,8 @@ var CanopyAtlasDownload = () => {
14590
14710
  const wfsUrl = baseUrl + import_leaflet18.default.Util.getParamString(params, baseUrl, true);
14591
14711
  try {
14592
14712
  const response = yield fetch(wfsUrl);
14593
- if (!response.ok) throw new Error("Download failed");
14713
+ if (!response.ok)
14714
+ throw new Error("Download failed");
14594
14715
  const blob = yield response.blob();
14595
14716
  const url = window.URL.createObjectURL(blob);
14596
14717
  const a = document.createElement("a");
@@ -14764,15 +14885,20 @@ var CanopyFilter = (0, import_react55.memo)(({ onFilterChange }) => {
14764
14885
  localStorage.setItem(STORAGE_KEY, JSON.stringify(updatedFilters));
14765
14886
  onFilterChange(updatedFilters);
14766
14887
  };
14767
- const handleDownload = () => __async(null, null, function* () {
14888
+ const handleDownload = () => __async(void 0, null, function* () {
14768
14889
  const cqlFilters = [];
14769
- if (filters.biome) cqlFilters.push(`biome='${filters.biome}'`);
14770
- if (filters.realm) cqlFilters.push(`realm='${filters.realm}'`);
14771
- if (filters.access) cqlFilters.push(`access='${filters.access}'`);
14890
+ if (filters.biome)
14891
+ cqlFilters.push(`biome='${filters.biome}'`);
14892
+ if (filters.realm)
14893
+ cqlFilters.push(`realm='${filters.realm}'`);
14894
+ if (filters.access)
14895
+ cqlFilters.push(`access='${filters.access}'`);
14772
14896
  if (filters.idunique)
14773
14897
  cqlFilters.push(`IDunique LIKE '%${filters.idunique}%'`);
14774
- if (filters.minyear) cqlFilters.push(`minyear>=${filters.minyear}`);
14775
- if (filters.maxyear) cqlFilters.push(`minyear<=${filters.maxyear}`);
14898
+ if (filters.minyear)
14899
+ cqlFilters.push(`minyear>=${filters.minyear}`);
14900
+ if (filters.maxyear)
14901
+ cqlFilters.push(`minyear<=${filters.maxyear}`);
14776
14902
  const params = __spreadValues({
14777
14903
  request: "GetFeature",
14778
14904
  service: "WFS",
@@ -14786,7 +14912,8 @@ var CanopyFilter = (0, import_react55.memo)(({ onFilterChange }) => {
14786
14912
  const wfsUrl = baseUrl + import_leaflet19.default.Util.getParamString(params, baseUrl, true);
14787
14913
  try {
14788
14914
  const response = yield fetch(wfsUrl);
14789
- if (!response.ok) throw new Error("Download failed");
14915
+ if (!response.ok)
14916
+ throw new Error("Download failed");
14790
14917
  const blob = yield response.blob();
14791
14918
  const url = window.URL.createObjectURL(blob);
14792
14919
  const a = document.createElement("a");
@@ -15020,8 +15147,10 @@ var constructCqlFilter = (filterParams) => {
15020
15147
  return "";
15021
15148
  }
15022
15149
  let _a = filterParams || {}, { minyear, maxyear } = _a, rest = __objRest(_a, ["minyear", "maxyear"]);
15023
- if (Array.isArray(minyear)) minyear = minyear[0];
15024
- if (Array.isArray(maxyear)) maxyear = maxyear[0];
15150
+ if (Array.isArray(minyear))
15151
+ minyear = minyear[0];
15152
+ if (Array.isArray(maxyear))
15153
+ maxyear = maxyear[0];
15025
15154
  const cqlExpressions = [];
15026
15155
  if (minyear && maxyear) {
15027
15156
  cqlExpressions.push(
@@ -15128,14 +15257,16 @@ var formatPropertyValue = (value, propertyName) => {
15128
15257
  return value.toString();
15129
15258
  };
15130
15259
  var createDefaultPopupContent = (feature, propertyNames) => {
15131
- if (!feature.properties) return "";
15260
+ if (!feature.properties)
15261
+ return "";
15132
15262
  const propertiesToShow = (propertyNames == null ? void 0 : propertyNames.length) ? propertyNames : DEFAULT_POPUP_PROPERTIES;
15133
15263
  const properties = Object.entries(feature.properties).filter(([key]) => propertiesToShow.includes(key)).sort((a, b) => {
15134
15264
  const indexA = propertiesToShow.indexOf(a[0]);
15135
15265
  const indexB = propertiesToShow.indexOf(b[0]);
15136
15266
  return indexA - indexB;
15137
15267
  });
15138
- if (properties.length === 0) return "";
15268
+ if (properties.length === 0)
15269
+ return "";
15139
15270
  return `
15140
15271
  <div class="leaflet-popup-content-wrapper" style="background-color: #fff; padding: 0; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.15);">
15141
15272
  <div style="width: 100%; overflow-y: auto;">
@@ -15206,7 +15337,7 @@ var openDatabase = () => {
15206
15337
  };
15207
15338
  });
15208
15339
  };
15209
- var storeInIndexedDB = (key, data) => __async(null, null, function* () {
15340
+ var storeInIndexedDB = (key, data) => __async(void 0, null, function* () {
15210
15341
  try {
15211
15342
  const db = yield openDatabase();
15212
15343
  const transaction = db.transaction(STORE_NAME, "readwrite");
@@ -15225,7 +15356,7 @@ var storeInIndexedDB = (key, data) => __async(null, null, function* () {
15225
15356
  console.warn("Failed to store data in IndexedDB:", e);
15226
15357
  }
15227
15358
  });
15228
- var getFromIndexedDB = (key) => __async(null, null, function* () {
15359
+ var getFromIndexedDB = (key) => __async(void 0, null, function* () {
15229
15360
  try {
15230
15361
  const db = yield openDatabase();
15231
15362
  const transaction = db.transaction(STORE_NAME, "readonly");
@@ -15247,7 +15378,7 @@ var getFromIndexedDB = (key) => __async(null, null, function* () {
15247
15378
  return null;
15248
15379
  }
15249
15380
  });
15250
- var cleanupIndexedDB = () => __async(null, null, function* () {
15381
+ var cleanupIndexedDB = () => __async(void 0, null, function* () {
15251
15382
  try {
15252
15383
  const db = yield openDatabase();
15253
15384
  const transaction = db.transaction(STORE_NAME, "readwrite");
@@ -15297,7 +15428,8 @@ var WfsLayer = ({
15297
15428
  }
15298
15429
  });
15299
15430
  const stableFilterParams = (0, import_react56.useMemo)(() => {
15300
- if (!filterParams) return null;
15431
+ if (!filterParams)
15432
+ return null;
15301
15433
  return JSON.stringify(filterParams);
15302
15434
  }, [filterParams]);
15303
15435
  const queryKey = (0, import_react56.useMemo)(() => {
@@ -15319,7 +15451,7 @@ var WfsLayer = ({
15319
15451
  }, [url, layerName, filterParams, useServerFiltering]);
15320
15452
  const { data: geoJsonData, error } = (0, import_react_query6.useQuery)({
15321
15453
  queryKey,
15322
- queryFn: () => __async(null, null, function* () {
15454
+ queryFn: () => __async(void 0, null, function* () {
15323
15455
  mapStore.setIsLoading(true);
15324
15456
  const wfsUrl = constructWfsUrl();
15325
15457
  const storageKey = `wfs-data-${queryKey.join("-")}`;
@@ -15384,7 +15516,8 @@ var WfsLayer = ({
15384
15516
  const getFeatureStyle = (0, import_react56.useCallback)(
15385
15517
  (feature) => {
15386
15518
  var _a2;
15387
- if (!feature) return defaultStyle;
15519
+ if (!feature)
15520
+ return defaultStyle;
15388
15521
  const featureId = ((_a2 = feature.id) == null ? void 0 : _a2.toString()) || JSON.stringify(feature.properties);
15389
15522
  return featureId === selectedFeatureId ? highlightStyle : defaultStyle;
15390
15523
  },
@@ -15395,7 +15528,8 @@ var WfsLayer = ({
15395
15528
  var _a2;
15396
15529
  const featureId = ((_a2 = feature.id) == null ? void 0 : _a2.toString()) || JSON.stringify(feature.properties);
15397
15530
  layerRef.current[featureId] = layer;
15398
- if (!popupOptions || !feature.properties) return;
15531
+ if (!popupOptions || !feature.properties)
15532
+ return;
15399
15533
  let popupContent;
15400
15534
  if (popupOptions.renderContent) {
15401
15535
  popupContent = popupOptions.renderContent(feature);
@@ -15440,7 +15574,8 @@ var WfsLayer = ({
15440
15574
  []
15441
15575
  );
15442
15576
  const filteredGeoJson = (0, import_react56.useMemo)(() => {
15443
- if (!geoJsonData) return null;
15577
+ if (!geoJsonData)
15578
+ return null;
15444
15579
  if (useServerFiltering || !filterParams || Object.keys(filterParams).length === 0) {
15445
15580
  return geoJsonData;
15446
15581
  }
@@ -15684,7 +15819,8 @@ var CanopyMap = () => {
15684
15819
  ((_f = (_e = mapSettings == null ? void 0 : mapSettings.LocationPart) == null ? void 0 : _e.Longitude) == null ? void 0 : _f.Text) || 16.3738
15685
15820
  ];
15686
15821
  (0, import_core30.useRenderInfo)("BasicMap");
15687
- if (isSettingsLoading) return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_ui41.LoaderFull, { showInCenter: false });
15822
+ if (isSettingsLoading)
15823
+ return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_ui41.LoaderFull, { showInCenter: false });
15688
15824
  return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_jsx_runtime74.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(
15689
15825
  import_react_leaflet27.MapContainer,
15690
15826
  {
@@ -15808,7 +15944,7 @@ var BasfLeftPanel = () => {
15808
15944
  [selectedItems]
15809
15945
  );
15810
15946
  const onSubmit = (0, import_react59.useCallback)(
15811
- (data) => __async(null, null, function* () {
15947
+ (data) => __async(void 0, null, function* () {
15812
15948
  setIsSubmitting(true);
15813
15949
  try {
15814
15950
  if (checkIfItemExists(data)) {
@@ -16017,7 +16153,8 @@ var BetterWMS2 = class extends import_leaflet22.default.TileLayer.WMS {
16017
16153
  if (url) {
16018
16154
  fetch(url).then((res) => res.json()).then((data) => {
16019
16155
  this.showGetFeatureInfo(event.latlng, data);
16020
- if (this.onInfoReceived) this.onInfoReceived(data);
16156
+ if (this.onInfoReceived)
16157
+ this.onInfoReceived(data);
16021
16158
  }).catch((err) => {
16022
16159
  console.log(err);
16023
16160
  });
@@ -16457,7 +16594,8 @@ var WaybackTimelineMap = (props) => {
16457
16594
  return null;
16458
16595
  }
16459
16596
  (0, import_react61.useEffect)(() => {
16460
- if (props.mapping) setWAYBACK_SNAPSHOTS(props.mapping);
16597
+ if (props.mapping)
16598
+ setWAYBACK_SNAPSHOTS(props.mapping);
16461
16599
  }, [props.mapping]);
16462
16600
  const west = parseFloat(searchParams.get("xmin"));
16463
16601
  const south = parseFloat(searchParams.get("ymin"));