@geowiki/map 0.16.9-dev.13 → 0.16.9-dev.15

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.
@@ -138,8 +138,7 @@ var init_GenericCache = __esm({
138
138
  getFromStorage(key) {
139
139
  try {
140
140
  const stored = localStorage.getItem(key);
141
- if (!stored)
142
- return null;
141
+ if (!stored) return null;
143
142
  const entry = JSON.parse(stored);
144
143
  if (this.isValid(entry)) {
145
144
  this.hitCount++;
@@ -556,7 +555,7 @@ var prepareRGBImage = (array, width, height) => {
556
555
  ctx == null ? void 0 : ctx.putImageData(imageData, 0, 0);
557
556
  return canvas;
558
557
  };
559
- var getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvasContext, selectedBand) => __async(void 0, null, function* () {
558
+ var getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvasContext, selectedBand) => __async(null, null, function* () {
560
559
  var _a, _b;
561
560
  try {
562
561
  var tiffWidth = rasterItem.width;
@@ -572,8 +571,7 @@ var getCanvasDataFromImageArray = (rasterItem, location, bounds, ndviImageCanvas
572
571
  var rgb = null;
573
572
  if (((_a = rasterItem.name) == null ? void 0 : _a.toLowerCase().includes("ndvi")) && ((_b = rasterItem.name) == null ? void 0 : _b.toLowerCase().includes("perc")))
574
573
  rgb = yield getNDVIValueForPixel(ndviImageCanvasContext, xTiff, yTiff);
575
- else
576
- rgb = null;
574
+ else rgb = null;
577
575
  return [
578
576
  selectedValue,
579
577
  rgb !== null && rgb !== void 0 ? {
@@ -616,12 +614,11 @@ var deepCloneRasterAssetItem = (isAnnualAnnotation, asset, assetBuffer, uri, sel
616
614
  rasterItem.buffer = [...asset.buffer];
617
615
  rasterItem.uri = [...asset.uri];
618
616
  rasterItem.buffer[selectedBand] = new Uint32Array(assetBuffer);
619
- if (Array.isArray(rasterItem.uri))
620
- rasterItem.uri[selectedBand] = uri;
617
+ if (Array.isArray(rasterItem.uri)) rasterItem.uri[selectedBand] = uri;
621
618
  }
622
619
  return rasterItem;
623
620
  };
624
- var getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnnotation, selectedBand, metadata) => __async(void 0, null, function* () {
621
+ var getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnnotation, selectedBand, metadata) => __async(null, null, function* () {
625
622
  var { newArray, canvas } = yield getEmptyPreviewRasterItemForInsert(
626
623
  length,
627
624
  width,
@@ -646,12 +643,12 @@ var getEmptyPreviewRasterItem = (id, length, width, height, labels, isAnnualAnno
646
643
  }
647
644
  return rasterItem;
648
645
  });
649
- var getEmptyPreviewRasterItemForInsert = (length, width, height, labels) => __async(void 0, null, function* () {
646
+ var getEmptyPreviewRasterItemForInsert = (length, width, height, labels) => __async(null, null, function* () {
650
647
  const newArray = new Uint32Array(length).fill(0);
651
648
  const canvas = grayScaleArrayToCanvas(newArray, width, height, labels);
652
649
  return { newArray, canvas };
653
650
  });
654
- var updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnnotation) => __async(void 0, null, function* () {
651
+ var updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnnotation) => __async(null, null, function* () {
655
652
  var _a, _b, _c;
656
653
  if (!fromRasterItem) {
657
654
  return toPreviewRasterItem;
@@ -677,7 +674,7 @@ var updatePreviewRasterFrom = (fromRasterItem, toPreviewRasterItem, isAnnualAnno
677
674
  }
678
675
  return toPreviewRasterItem;
679
676
  });
680
- var getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(void 0, null, function* () {
677
+ var getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(null, null, function* () {
681
678
  const tiff = yield fromArrayBuffer(arrayBuffer);
682
679
  const image = yield tiff.getImage();
683
680
  const pool = new Pool();
@@ -701,7 +698,7 @@ var getRasterItemsNoColorMap = (arrayBuffer, labels) => __async(void 0, null, fu
701
698
  pool.destroy();
702
699
  return { width, height, rasterItems };
703
700
  });
704
- var getRasterItems = (arrayBuffer, projectType) => __async(void 0, null, function* () {
701
+ var getRasterItems = (arrayBuffer, projectType) => __async(null, null, function* () {
705
702
  const tiff = yield fromArrayBuffer(arrayBuffer);
706
703
  const image = yield tiff.getImage();
707
704
  const pool = new Pool();
@@ -741,7 +738,7 @@ var getRasterItems = (arrayBuffer, projectType) => __async(void 0, null, functio
741
738
  pool.destroy();
742
739
  return { rasters, width, height, rasterItems };
743
740
  });
744
- var getAssetItemsForLocationAssets = (assets, labels) => __async(void 0, null, function* () {
741
+ var getAssetItemsForLocationAssets = (assets, labels) => __async(null, null, function* () {
745
742
  var rasterItems = [];
746
743
  for (var i = 0; i < (assets == null ? void 0 : assets.length); i++) {
747
744
  const item = assets[i];
@@ -764,7 +761,7 @@ var getAssetItemsForLocationAssets = (assets, labels) => __async(void 0, null, f
764
761
  }
765
762
  return rasterItems;
766
763
  });
767
- var getRasterAssetItemsForLocationComposite = (assets) => __async(void 0, null, function* () {
764
+ var getRasterAssetItemsForLocationComposite = (assets) => __async(null, null, function* () {
768
765
  var rasterItems = [];
769
766
  for (var i = 0; i < (assets == null ? void 0 : assets.length); i++) {
770
767
  const item = assets[i];
@@ -785,7 +782,7 @@ var getRasterAssetItemsForLocationComposite = (assets) => __async(void 0, null,
785
782
  }
786
783
  return rasterItems;
787
784
  });
788
- var copyAllRasterSegments = (rasterItem, previewRasterItem, selectedValue, labelValue, labels) => __async(void 0, null, function* () {
785
+ var copyAllRasterSegments = (rasterItem, previewRasterItem, selectedValue, labelValue, labels) => __async(null, null, function* () {
789
786
  var newBuffer = overwriteArrayBufferWithSelectedValue(
790
787
  rasterItem.buffer,
791
788
  previewRasterItem.buffer,
@@ -861,8 +858,7 @@ function getAdjPixel(y, x, selectedValue, array2dMatrix) {
861
858
  while (pixelsToCheck.length > 0) {
862
859
  const [xTiff, yTiff] = pixelsToCheck.pop();
863
860
  var key = xTiff + "_" + yTiff;
864
- if (checkedPixels.has(key))
865
- continue;
861
+ if (checkedPixels.has(key)) continue;
866
862
  checkedPixels.add(key);
867
863
  if (array2dMatrix[yTiff][xTiff] === selectedValue) {
868
864
  sameValPixels.push([yTiff, xTiff]);
@@ -884,7 +880,7 @@ function getAdjPixel(y, x, selectedValue, array2dMatrix) {
884
880
  }
885
881
  return sameValPixels;
886
882
  }
887
- var paintRasterSegment = (sourceRasterItem, destRasterItem, locations, bounds, labelValue, labels, paintType, selectedBand, isAnnualAnnotation) => __async(void 0, null, function* () {
883
+ var paintRasterSegment = (sourceRasterItem, destRasterItem, locations, bounds, labelValue, labels, paintType, selectedBand, isAnnualAnnotation) => __async(null, null, function* () {
888
884
  var tiffWidth = sourceRasterItem.width;
889
885
  var tiffHeight = sourceRasterItem.height;
890
886
  var annotatedRaster = isAnnualAnnotation ? destRasterItem.buffer : destRasterItem.buffer[selectedBand];
@@ -1007,8 +1003,7 @@ function pointInsidePolygon(xTiff, yTiff, vs) {
1007
1003
  var xi = vs[i].xTiff, yi = vs[i].yTiff;
1008
1004
  var xj = vs[j].xTiff, yj = vs[j].yTiff;
1009
1005
  var intersect = yi > yTiff !== yj > yTiff && xTiff < (xj - xi) * (yTiff - yi) / (yj - yi) + xi;
1010
- if (intersect)
1011
- inside = !inside;
1006
+ if (intersect) inside = !inside;
1012
1007
  }
1013
1008
  return inside;
1014
1009
  }
@@ -1047,7 +1042,7 @@ function getDiagonalCoordinates(x1, y1, x2, y2) {
1047
1042
  coordinates.push({ yTiff: x2, xTiff: y2 });
1048
1043
  return coordinates;
1049
1044
  }
1050
- var getActiveLearningAnnotation = (assetHref, projectType) => __async(void 0, null, function* () {
1045
+ var getActiveLearningAnnotation = (assetHref, projectType) => __async(null, null, function* () {
1051
1046
  const res = yield fetch(assetHref);
1052
1047
  const buffer = yield res.arrayBuffer();
1053
1048
  const rItems = yield getRasterItems(buffer, projectType);
@@ -1064,7 +1059,7 @@ var getActiveLearningAnnotation = (assetHref, projectType) => __async(void 0, nu
1064
1059
  };
1065
1060
  return assetItem;
1066
1061
  });
1067
- var createImageDataForNDVI = (asset) => __async(void 0, null, function* () {
1062
+ var createImageDataForNDVI = (asset) => __async(null, null, function* () {
1068
1063
  var canvas = document.createElement("canvas");
1069
1064
  var context = canvas.getContext("2d");
1070
1065
  var image = new Image();
@@ -1074,7 +1069,7 @@ var createImageDataForNDVI = (asset) => __async(void 0, null, function* () {
1074
1069
  context == null ? void 0 : context.drawImage(image, 0, 0, canvas.width, canvas.height);
1075
1070
  return context;
1076
1071
  });
1077
- var getNDVIValueForPixel = (ndviImageCanvasContext, x, y) => __async(void 0, null, function* () {
1072
+ var getNDVIValueForPixel = (ndviImageCanvasContext, x, y) => __async(null, null, function* () {
1078
1073
  var context = ndviImageCanvasContext;
1079
1074
  var data = context == null ? void 0 : context.getImageData(x, y, 1, 1).data;
1080
1075
  return data;
@@ -1290,8 +1285,7 @@ function getRasterAssetItemsForLocationAssets(assets) {
1290
1285
  if (Array.isArray((_a = rItem.result) == null ? void 0 : _a.base64)) {
1291
1286
  bufferData = (_b = rItem.result) == null ? void 0 : _b.base64.map((x) => {
1292
1287
  var _a2, _b2;
1293
- if (((_a2 = rItem.result) == null ? void 0 : _a2.arrayType) == "uint8")
1294
- return Buffer.from(x, "base64");
1288
+ if (((_a2 = rItem.result) == null ? void 0 : _a2.arrayType) == "uint8") return Buffer.from(x, "base64");
1295
1289
  else if (((_b2 = rItem.result) == null ? void 0 : _b2.arrayType) == "uint32") {
1296
1290
  const buffer2 = Buffer.from(x, "base64");
1297
1291
  return new Uint32Array(
@@ -1372,16 +1366,14 @@ function ClearAnnotation(annotatedRasterAsset, isAnnualAnnotation, selectedBand,
1372
1366
  selectedBand,
1373
1367
  annotationRasterAsset.metadata
1374
1368
  );
1375
- if (isAnnualAnnotation)
1376
- return { annotationRaster, pastValues };
1369
+ if (isAnnualAnnotation) return { annotationRaster, pastValues };
1377
1370
  else {
1378
1371
  var multiBandAnnotation = annotatedRasterAsset;
1379
1372
  if (multiBandAnnotation == null ? void 0 : multiBandAnnotation.buffer[selectedBand]) {
1380
1373
  multiBandAnnotation.buffer[selectedBand] = annotationRaster.buffer[selectedBand];
1381
1374
  multiBandAnnotation.uri[selectedBand] = annotationRaster.uri[selectedBand];
1382
1375
  return { multiBandAnnotation, undefined: void 0 };
1383
- } else
1384
- return { annotatedRasterAsset: void 0, undefined: void 0 };
1376
+ } else return { annotatedRasterAsset: void 0, undefined: void 0 };
1385
1377
  }
1386
1378
  });
1387
1379
  }
@@ -1415,8 +1407,7 @@ function createTask(locationId, projectId, referenceDate) {
1415
1407
  currentTask: res.task,
1416
1408
  annotation_dates: yield getAnnotationDates(res == null ? void 0 : res.task)
1417
1409
  };
1418
- } else
1419
- return { location: null, currentTask: null, annotation_dates: null };
1410
+ } else return { location: null, currentTask: null, annotation_dates: null };
1420
1411
  });
1421
1412
  }
1422
1413
  function getTask(taskId) {
@@ -1444,8 +1435,7 @@ function getTask(taskId) {
1444
1435
  annotation_dates: yield getAnnotationDates(res == null ? void 0 : res.task),
1445
1436
  location: locData
1446
1437
  };
1447
- } else
1448
- return { currentTask: null, annotation_dates: null, location: null };
1438
+ } else return { currentTask: null, annotation_dates: null, location: null };
1449
1439
  });
1450
1440
  }
1451
1441
  function getActiveLearningAnnotationAsset(assetHref, labels, projectDetail) {
@@ -1497,8 +1487,7 @@ function insertEmptyBufferForSingleBand(length, width, height, selectedBand, ann
1497
1487
  annotatedAsset.buffer[selectedBand] = newArray;
1498
1488
  annotatedAsset.uri[selectedBand] = canvas.toDataURL();
1499
1489
  return annotatedAsset;
1500
- } else
1501
- return null;
1490
+ } else return null;
1502
1491
  });
1503
1492
  }
1504
1493
  function getTaskChangeDetails(taskId) {
@@ -1512,10 +1501,8 @@ function getTaskGeometryDetail(taskId) {
1512
1501
  });
1513
1502
  }
1514
1503
  function getCentroid(geometry, has_area_of_interest, geometry_aoi, is_segment, geometry_segment) {
1515
- if (has_area_of_interest)
1516
- return geometry_aoi;
1517
- if (is_segment)
1518
- return geometry_segment;
1504
+ if (has_area_of_interest) return geometry_aoi;
1505
+ if (is_segment) return geometry_segment;
1519
1506
  return geometry;
1520
1507
  }
1521
1508
  function showAnnotation(savedAnnotations, submittedAnnotations, annotatedRasterAsset) {
@@ -1657,7 +1644,7 @@ var useEvolandStore = create()((set) => ({
1657
1644
  setRecenterLocation: () => set({ recenterLocation: false }),
1658
1645
  setTimerReset: (timerreset) => set({ timerReset: timerreset }),
1659
1646
  setAnnotationTime: (annotationtime) => set({ annotationTime: annotationtime }),
1660
- onLocationSelected: (point2) => __async(void 0, null, function* () {
1647
+ onLocationSelected: (point2) => __async(null, null, function* () {
1661
1648
  var data = yield LocationService2.getPolygonUtmlocationLonLonLatLatWidthWidthHeightHeightGet(
1662
1649
  point2.lng,
1663
1650
  point2.lat,
@@ -1683,10 +1670,10 @@ var useEvolandStore = create()((set) => ({
1683
1670
  location: locData
1684
1671
  });
1685
1672
  }),
1686
- onRecenterLocation: () => __async(void 0, null, function* () {
1673
+ onRecenterLocation: () => __async(null, null, function* () {
1687
1674
  return set({ recenterLocation: true });
1688
1675
  }),
1689
- getLocationAssets: (locationId, projectId, type, taskId) => __async(void 0, null, function* () {
1676
+ getLocationAssets: (locationId, projectId, type, taskId) => __async(null, null, function* () {
1690
1677
  var _a, _b;
1691
1678
  const state = useEvolandStore.getState();
1692
1679
  var {
@@ -1809,7 +1796,7 @@ var useEvolandStore = create()((set) => ({
1809
1796
  }
1810
1797
  return [];
1811
1798
  }),
1812
- getLocationDetails: (locationId, projectId, user, taskId, isAdmin) => __async(void 0, null, function* () {
1799
+ getLocationDetails: (locationId, projectId, user, taskId, isAdmin) => __async(null, null, function* () {
1813
1800
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
1814
1801
  var state = useEvolandStore.getState();
1815
1802
  var { referenceDate, reference_dates, sessionTimeOut, projectDetail, task_for_review } = state;
@@ -1898,7 +1885,7 @@ var useEvolandStore = create()((set) => ({
1898
1885
  }
1899
1886
  }
1900
1887
  }),
1901
- getNextLocationDetails: (projectId) => __async(void 0, null, function* () {
1888
+ getNextLocationDetails: (projectId) => __async(null, null, function* () {
1902
1889
  var _a, _b, _c;
1903
1890
  set({ isLoading: true });
1904
1891
  var state = useEvolandStore.getState();
@@ -1967,7 +1954,7 @@ var useEvolandStore = create()((set) => ({
1967
1954
  setOpacity: (opacity) => set({ opacity }),
1968
1955
  setCompositeOpacity: (opacity) => set({ compositeOpacity: opacity }),
1969
1956
  setAnnotationOpacity: (opacity) => set({ annotationOpacity: opacity }),
1970
- addLabel: (loc, bounds, label) => __async(void 0, null, function* () {
1957
+ addLabel: (loc, bounds, label) => __async(null, null, function* () {
1971
1958
  var _a;
1972
1959
  set({ isLoading: true });
1973
1960
  var store = useEvolandStore.getState();
@@ -2027,14 +2014,14 @@ var useEvolandStore = create()((set) => ({
2027
2014
  setShowTimeSeries: (value) => set({ showTimeSeries: value }),
2028
2015
  reset: () => set(initialState),
2029
2016
  setSelectedColorLabel: (label) => set({ selectedColorLabel: label }),
2030
- getLegendsDetails: (array) => __async(void 0, null, function* () {
2017
+ getLegendsDetails: (array) => __async(null, null, function* () {
2031
2018
  var store = useEvolandStore.getState();
2032
2019
  var legends = yield getLegends(array, store.labels);
2033
2020
  set({
2034
2021
  legends
2035
2022
  });
2036
2023
  }),
2037
- getLocationMetaData: (locationId, projectId, taskId) => __async(void 0, null, function* () {
2024
+ getLocationMetaData: (locationId, projectId, taskId) => __async(null, null, function* () {
2038
2025
  var _a, _b;
2039
2026
  set({ isLoading: true });
2040
2027
  var state = useEvolandStore.getState();
@@ -2060,7 +2047,7 @@ var useEvolandStore = create()((set) => ({
2060
2047
  set({ sessionTimeOut: true, isLoading: false });
2061
2048
  }
2062
2049
  }),
2063
- getLabels: (projectId) => __async(void 0, null, function* () {
2050
+ getLabels: (projectId) => __async(null, null, function* () {
2064
2051
  var state = useEvolandStore.getState();
2065
2052
  if (state.labels) {
2066
2053
  return state.labels;
@@ -2082,10 +2069,10 @@ var useEvolandStore = create()((set) => ({
2082
2069
  });
2083
2070
  return allLabels;
2084
2071
  }),
2085
- setBrushThickness: (value) => __async(void 0, null, function* () {
2072
+ setBrushThickness: (value) => __async(null, null, function* () {
2086
2073
  return set({ brushThickness: value });
2087
2074
  }),
2088
- getProjectDetail: (projectId) => __async(void 0, null, function* () {
2075
+ getProjectDetail: (projectId) => __async(null, null, function* () {
2089
2076
  set({ isLoading: true });
2090
2077
  const projectInfo = yield ProjectService.projectDetailProjectdetailProjectIdProjectIdGet(
2091
2078
  projectId
@@ -2096,12 +2083,12 @@ var useEvolandStore = create()((set) => ({
2096
2083
  isAnnualAnnotation: (projectInfo == null ? void 0 : projectInfo.project_type) == "ANNUALLY" /* ANNUALLY */ ? true : false
2097
2084
  });
2098
2085
  }),
2099
- getTaskEvents: (taskId) => __async(void 0, null, function* () {
2086
+ getTaskEvents: (taskId) => __async(null, null, function* () {
2100
2087
  set({ isLoading: true });
2101
2088
  const taskevents = yield TaskService2.getTaskEventsTaskeventsTaskIdTaskIdGet(taskId);
2102
2089
  set({ isLoading: false, taskEvents: taskevents });
2103
2090
  }),
2104
- getTaskAnnotation: (submittedAnnotationAsset, assetType) => __async(void 0, null, function* () {
2091
+ getTaskAnnotation: (submittedAnnotationAsset, assetType) => __async(null, null, function* () {
2105
2092
  var _a, _b, _c;
2106
2093
  if (submittedAnnotationAsset != null && submittedAnnotationAsset.length > 0) {
2107
2094
  const state = useEvolandStore.getState();
@@ -2151,7 +2138,7 @@ var useEvolandStore = create()((set) => ({
2151
2138
  setCurrentPosition: (position) => set({ currentPosition: position }),
2152
2139
  setSessionTimeOut: (hasTimeOut) => set({ sessionTimeOut: hasTimeOut }),
2153
2140
  setLatestTaskAnnotation: (locationTask) => set({ latestTaskAnnotation: locationTask }),
2154
- getTaskReferenceDates: (projectId, locatioId, asset_type, setSelected) => __async(void 0, null, function* () {
2141
+ getTaskReferenceDates: (projectId, locatioId, asset_type, setSelected) => __async(null, null, function* () {
2155
2142
  const state = useEvolandStore.getState();
2156
2143
  const { annotation_dates, reference_dates, selectedReferenceDate } = state;
2157
2144
  var task_ref_dates = yield getRefDates(projectId, locatioId, asset_type);
@@ -2167,7 +2154,7 @@ var useEvolandStore = create()((set) => ({
2167
2154
  });
2168
2155
  }
2169
2156
  }),
2170
- setSelectedReferenceDate: (currentReferenceDate) => __async(void 0, null, function* () {
2157
+ setSelectedReferenceDate: (currentReferenceDate) => __async(null, null, function* () {
2171
2158
  const state = useEvolandStore.getState();
2172
2159
  const { selectedReferenceDate, reference_dates } = state;
2173
2160
  if (currentReferenceDate !== selectedReferenceDate)
@@ -2176,49 +2163,49 @@ var useEvolandStore = create()((set) => ({
2176
2163
  selectedBand: reference_dates == null ? void 0 : reference_dates.indexOf(currentReferenceDate)
2177
2164
  });
2178
2165
  }),
2179
- setUpdateAsset: (updateAssets) => __async(void 0, null, function* () {
2166
+ setUpdateAsset: (updateAssets) => __async(null, null, function* () {
2180
2167
  return set({ updateAssets });
2181
2168
  }),
2182
- setComment: (comment) => __async(void 0, null, function* () {
2169
+ setComment: (comment) => __async(null, null, function* () {
2183
2170
  return set({ comment });
2184
2171
  }),
2185
- setAnnualAnnotation: (val) => __async(void 0, null, function* () {
2172
+ setAnnualAnnotation: (val) => __async(null, null, function* () {
2186
2173
  return set({ isAnnualAnnotation: val });
2187
2174
  }),
2188
- setSelectedBand: (bandIndex) => __async(void 0, null, function* () {
2175
+ setSelectedBand: (bandIndex) => __async(null, null, function* () {
2189
2176
  return set({ selectedBand: bandIndex });
2190
2177
  }),
2191
- setAnnotationDates: (annotationDates) => __async(void 0, null, function* () {
2178
+ setAnnotationDates: (annotationDates) => __async(null, null, function* () {
2192
2179
  return set({ annotation_dates: annotationDates });
2193
2180
  }),
2194
- setSavedAnnotations: (savedAnnotation) => __async(void 0, null, function* () {
2181
+ setSavedAnnotations: (savedAnnotation) => __async(null, null, function* () {
2195
2182
  return set({ savedAnnotations: savedAnnotation });
2196
2183
  }),
2197
- setLabelList: (labels) => __async(void 0, null, function* () {
2184
+ setLabelList: (labels) => __async(null, null, function* () {
2198
2185
  return set({ labelList: labels });
2199
2186
  }),
2200
- setLocation: (loc) => __async(void 0, null, function* () {
2187
+ setLocation: (loc) => __async(null, null, function* () {
2201
2188
  return set({ location: loc });
2202
2189
  }),
2203
- setCurrentTask: (task) => __async(void 0, null, function* () {
2190
+ setCurrentTask: (task) => __async(null, null, function* () {
2204
2191
  return set({ currentTask: task });
2205
2192
  }),
2206
- setTimeSeriesTypes: (types) => __async(void 0, null, function* () {
2193
+ setTimeSeriesTypes: (types) => __async(null, null, function* () {
2207
2194
  return set({ timeSeriesTypes: types });
2208
2195
  }),
2209
- setTimeSeriesAssets: (assets) => __async(void 0, null, function* () {
2196
+ setTimeSeriesAssets: (assets) => __async(null, null, function* () {
2210
2197
  return set({ timeSeriesAssets: assets });
2211
2198
  }),
2212
- setActiveLearningAnnotations: (active_learning) => __async(void 0, null, function* () {
2199
+ setActiveLearningAnnotations: (active_learning) => __async(null, null, function* () {
2213
2200
  return set({ activeLearningAnnotations: active_learning });
2214
2201
  }),
2215
- setSubmittedAnnotations: (submit_annotation) => __async(void 0, null, function* () {
2202
+ setSubmittedAnnotations: (submit_annotation) => __async(null, null, function* () {
2216
2203
  return set({ submittedAnnotations: submit_annotation });
2217
2204
  }),
2218
- setAnnotatedRasterAsset: (annotated_raster) => __async(void 0, null, function* () {
2205
+ setAnnotatedRasterAsset: (annotated_raster) => __async(null, null, function* () {
2219
2206
  return set({ annotatedRasterAsset: annotated_raster });
2220
2207
  }),
2221
- setTaskGeometry: (task_geometry) => __async(void 0, null, function* () {
2208
+ setTaskGeometry: (task_geometry) => __async(null, null, function* () {
2222
2209
  return set({ taskGeometry: task_geometry });
2223
2210
  }),
2224
2211
  setTaskForReview(taskForReview) {
@@ -2343,8 +2330,7 @@ var TiffImage = (props) => {
2343
2330
  } else if (localcomment !== void 0 && (localcomment == null ? void 0 : localcomment.includes("#" + x))) {
2344
2331
  localcomment = localcomment.replace(" #" + x, "");
2345
2332
  this.className = "rounded-xl flex inline-flex text-secondary p-1 text-sm";
2346
- } else
2347
- localcomment = "#" + x + " ";
2333
+ } else localcomment = "#" + x + " ";
2348
2334
  if (evolandStore.comment !== void 0 && evolandStore.comment !== null && !((_a5 = evolandStore.comment) == null ? void 0 : _a5.includes("#" + x)))
2349
2335
  evolandStore.setComment(
2350
2336
  evolandStore.comment + localcomment
@@ -2353,8 +2339,7 @@ var TiffImage = (props) => {
2353
2339
  evolandStore.setComment(
2354
2340
  evolandStore.comment.replace(" #" + x, "")
2355
2341
  );
2356
- else
2357
- evolandStore.setComment(localcomment);
2342
+ else evolandStore.setComment(localcomment);
2358
2343
  });
2359
2344
  container.appendChild(content);
2360
2345
  }
@@ -2395,7 +2380,7 @@ var TiffImage = (props) => {
2395
2380
  bubblingMouseEvents: false,
2396
2381
  className: "border-2 border-blue-600"
2397
2382
  }).bringToFront();
2398
- imageOverlay3.on("mouseover", (e) => __async(void 0, null, function* () {
2383
+ imageOverlay3.on("mouseover", (e) => __async(null, null, function* () {
2399
2384
  var _a3, _b2;
2400
2385
  if (isBrush()) {
2401
2386
  tooltip2 = L.tooltip({ offset: L.point(20, 0), opacity: 0.6 }).setContent(
@@ -2417,21 +2402,20 @@ var TiffImage = (props) => {
2417
2402
  ).setLatLng(e.latlng).addTo(map);
2418
2403
  }
2419
2404
  }));
2420
- imageOverlay3.on("mousemove", (e) => __async(void 0, null, function* () {
2405
+ imageOverlay3.on("mousemove", (e) => __async(null, null, function* () {
2421
2406
  evolandStore.setNDVIRGBValues(ndvi);
2422
2407
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2423
2408
  if (isDrawing) {
2424
2409
  handleMouseMove(e);
2425
2410
  }
2426
2411
  }));
2427
- imageOverlay3.on("mouseout", () => __async(void 0, null, function* () {
2412
+ imageOverlay3.on("mouseout", () => __async(null, null, function* () {
2428
2413
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2429
2414
  }));
2430
- imageOverlay3.on("click", (e) => __async(void 0, null, function* () {
2415
+ imageOverlay3.on("click", (e) => __async(null, null, function* () {
2431
2416
  var _a3, _b2, _c2;
2432
2417
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2433
- if (((_a3 = evolandStore.selectedRasterAsset) == null ? void 0 : _a3.type) == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */)
2434
- return;
2418
+ if (((_a3 = evolandStore.selectedRasterAsset) == null ? void 0 : _a3.type) == "CHANGE_SEGMENTATION_MASK" /* ChangeSegmentationMask */) return;
2435
2419
  if (evolandStore.selectedColorLabel == null && evolandStore.selectedToolType !== 6 /* ClearSegmentWithPolygon */) {
2436
2420
  alert("Please select label");
2437
2421
  return;
@@ -2478,25 +2462,23 @@ var TiffImage = (props) => {
2478
2462
  opacity: 0.8,
2479
2463
  lineCap: "round"
2480
2464
  }).addTo(map);
2481
- polyLine.on("click", () => __async(void 0, null, function* () {
2465
+ polyLine.on("click", () => __async(null, null, function* () {
2482
2466
  stopPaint();
2483
2467
  }));
2484
- polyLine.on("mouseover", (e) => __async(void 0, null, function* () {
2468
+ polyLine.on("mouseover", (e) => __async(null, null, function* () {
2485
2469
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2486
2470
  tooltip2 = L.tooltip({ offset: L.point(20, 0), opacity: 0.6 }).setContent("Click to Stop").setLatLng(e.latlng).addTo(map);
2487
2471
  }));
2488
- polyLine.on("mousemove", () => __async(void 0, null, function* () {
2472
+ polyLine.on("mousemove", () => __async(null, null, function* () {
2489
2473
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2490
2474
  }));
2491
- polyLine.on("mouseout", () => __async(void 0, null, function* () {
2475
+ polyLine.on("mouseout", () => __async(null, null, function* () {
2492
2476
  tooltip2 == null ? void 0 : tooltip2.removeFrom(map);
2493
2477
  }));
2494
2478
  }
2495
2479
  return () => {
2496
- if (imageOverlay3)
2497
- map.removeLayer(imageOverlay3);
2498
- if (tagsPopUp)
2499
- map.removeLayer(tagsPopUp);
2480
+ if (imageOverlay3) map.removeLayer(imageOverlay3);
2481
+ if (tagsPopUp) map.removeLayer(tagsPopUp);
2500
2482
  if (rectangle3 && evolandStore.isAnnualAnnotation)
2501
2483
  map.removeLayer(rectangle3);
2502
2484
  if (polyLine !== void 0) {
@@ -2589,7 +2571,7 @@ var ReadOnlyTiffImage = (props) => {
2589
2571
  bubblingMouseEvents: false,
2590
2572
  className: "border-2 border-blue-600"
2591
2573
  }).bringToBack();
2592
- imageOverlay3.on("mouseover", (e) => __async(void 0, null, function* () {
2574
+ imageOverlay3.on("mouseover", (e) => __async(null, null, function* () {
2593
2575
  var data = yield getCanvasDataFromImageArray(
2594
2576
  props.raster,
2595
2577
  e.latlng,
@@ -2599,7 +2581,7 @@ var ReadOnlyTiffImage = (props) => {
2599
2581
  );
2600
2582
  setNDVI(data[1]);
2601
2583
  }));
2602
- imageOverlay3.on("mousemove", () => __async(void 0, null, function* () {
2584
+ imageOverlay3.on("mousemove", () => __async(null, null, function* () {
2603
2585
  evolandStore.setNDVIRGBValues(ndvi);
2604
2586
  }));
2605
2587
  imageOverlay3.addTo(map);
@@ -2617,12 +2599,9 @@ var ReadOnlyTiffImage = (props) => {
2617
2599
  }).addTo(map);
2618
2600
  }
2619
2601
  return () => {
2620
- if (imageOverlay3)
2621
- map.removeLayer(imageOverlay3);
2622
- if (rectangle3 && showRectangleAtCenter)
2623
- map.removeLayer(rectangle3);
2624
- if (props.polygonBounds)
2625
- map.removeLayer(polygon_segment);
2602
+ if (imageOverlay3) map.removeLayer(imageOverlay3);
2603
+ if (rectangle3 && showRectangleAtCenter) map.removeLayer(rectangle3);
2604
+ if (props.polygonBounds) map.removeLayer(polygon_segment);
2626
2605
  };
2627
2606
  }, [props, map, showRectangleAtCenter]);
2628
2607
  return null;
@@ -2760,8 +2739,7 @@ var EvoLandGeometry = () => {
2760
2739
  import { jsx as jsx3 } from "react/jsx-runtime";
2761
2740
  var EvolandContainer = ({ sessionStatus }) => {
2762
2741
  const evolandStore = useEvolandStore();
2763
- if (sessionStatus === "unauthenticated")
2764
- return /* @__PURE__ */ jsx3(AuthenticationFailure, {});
2742
+ if (sessionStatus === "unauthenticated") return /* @__PURE__ */ jsx3(AuthenticationFailure, {});
2765
2743
  return evolandStore.location && /* @__PURE__ */ jsx3(EvoLandGeometry, {});
2766
2744
  };
2767
2745
 
@@ -3275,8 +3253,7 @@ import { LoaderFull } from "@geowiki/ui";
3275
3253
  import { Fragment as Fragment2, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
3276
3254
  var assetsByYear = (assets) => assets == null ? void 0 : assets.reduce((acc, item) => {
3277
3255
  const year = new Date(item.reference_date).getFullYear();
3278
- if (!acc[year])
3279
- acc[year] = [];
3256
+ if (!acc[year]) acc[year] = [];
3280
3257
  acc[year].push(item);
3281
3258
  return acc;
3282
3259
  }, {});
@@ -3393,14 +3370,10 @@ var ViewAssets = (props) => {
3393
3370
  );
3394
3371
  if (props.taskId !== void 0 && IsTaskAnnotationLoading)
3395
3372
  return /* @__PURE__ */ jsx7(LoaderFull, {});
3396
- if (maskTab && (masks == null ? void 0 : masks.length) == 0)
3397
- setMasks(evolandStore.maskAsset);
3398
- if (changeMaskTab && (changeMasks == null ? void 0 : changeMasks.length) == 0)
3399
- checkChangeMasksAndLoad();
3400
- if (compositesTab && composites.length == 0)
3401
- checkCompositesAndLoad();
3402
- if (annotationTab)
3403
- checkAnnotationsAndLoad();
3373
+ if (maskTab && (masks == null ? void 0 : masks.length) == 0) setMasks(evolandStore.maskAsset);
3374
+ if (changeMaskTab && (changeMasks == null ? void 0 : changeMasks.length) == 0) checkChangeMasksAndLoad();
3375
+ if (compositesTab && composites.length == 0) checkCompositesAndLoad();
3376
+ if (annotationTab) checkAnnotationsAndLoad();
3404
3377
  function checkMasksAndLoad() {
3405
3378
  if ((masks == null ? void 0 : masks.length) === 0 && !evolandStore.maskAsset) {
3406
3379
  evolandStore.getLocationAssets(
@@ -3411,8 +3384,7 @@ var ViewAssets = (props) => {
3411
3384
  ).then((res) => {
3412
3385
  setMasks(res);
3413
3386
  });
3414
- } else if (masks.length == 0)
3415
- setMasks(evolandStore.maskAsset);
3387
+ } else if (masks.length == 0) setMasks(evolandStore.maskAsset);
3416
3388
  }
3417
3389
  function checkChangeMasksAndLoad() {
3418
3390
  if ((changeMasks == null ? void 0 : changeMasks.length) === 0 && !evolandStore.changeMaskAsset) {
@@ -3458,8 +3430,7 @@ var ViewAssets = (props) => {
3458
3430
  }
3459
3431
  if (props.taskId !== void 0 && IsTaskAnnotationLoading)
3460
3432
  return /* @__PURE__ */ jsx7(LoaderFull, {});
3461
- if (maskTab && ((masks == null ? void 0 : masks.length) == 0 || masks == null))
3462
- setMaskTab(false);
3433
+ if (maskTab && ((masks == null ? void 0 : masks.length) == 0 || masks == null)) setMaskTab(false);
3463
3434
  return /* @__PURE__ */ jsxs5("div", { children: [
3464
3435
  /* @__PURE__ */ jsxs5(
3465
3436
  "div",
@@ -4021,8 +3992,7 @@ var SearchAnnotation = (props) => {
4021
3992
  localStorage.setItem("toDate", toDate);
4022
3993
  if (tasks == null ? void 0 : tasks.exists)
4023
3994
  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" : ""}`;
4024
- else
4025
- alert("No data for search parameters");
3995
+ else alert("No data for search parameters");
4026
3996
  },
4027
3997
  children: [
4028
3998
  /* @__PURE__ */ jsx8(
@@ -4336,14 +4306,11 @@ var EvolandLeftSideBar = (props) => {
4336
4306
  }
4337
4307
  if (evolandStore.projectDetail) {
4338
4308
  if (((_m = (_l = evolandStore.projectDetail) == null ? void 0 : _l.meta_data) == null ? void 0 : _m.default_asset_view) == "SEGMENTATION_MASK" /* SegmentationMask */) {
4339
- if ((masks == null ? void 0 : masks.length) === 0)
4340
- return /* @__PURE__ */ jsx10(LoaderFull3, {});
4309
+ if ((masks == null ? void 0 : masks.length) === 0) return /* @__PURE__ */ jsx10(LoaderFull3, {});
4341
4310
  } else if (((_o = (_n = evolandStore.projectDetail) == null ? void 0 : _n.meta_data) == null ? void 0 : _o.default_asset_view) == "COMPOSITE" /* Composite */) {
4342
- if ((composites == null ? void 0 : composites.length) === 0)
4343
- return /* @__PURE__ */ jsx10(LoaderFull3, {});
4311
+ if ((composites == null ? void 0 : composites.length) === 0) return /* @__PURE__ */ jsx10(LoaderFull3, {});
4344
4312
  }
4345
- } else
4346
- return /* @__PURE__ */ jsx10(LoaderFull3, {});
4313
+ } else return /* @__PURE__ */ jsx10(LoaderFull3, {});
4347
4314
  return /* @__PURE__ */ jsx10(
4348
4315
  "div",
4349
4316
  {
@@ -4510,8 +4477,7 @@ var EvolandLeftSideBar = (props) => {
4510
4477
  canDelete = confirm(
4511
4478
  (review ? "This is a targeted review task. " : "") + "Are you sure you want to delete this task?"
4512
4479
  );
4513
- if (canDelete)
4514
- setDeleteTask(true);
4480
+ if (canDelete) setDeleteTask(true);
4515
4481
  },
4516
4482
  children: [
4517
4483
  /* @__PURE__ */ jsx10(
@@ -4553,8 +4519,7 @@ var EvolandLeftSideBar = (props) => {
4553
4519
  evolandStore.setAnnotationDates(annotation_dates);
4554
4520
  if (currentTask)
4555
4521
  evolandStore.setCurrentTask(currentTask);
4556
- if (location)
4557
- evolandStore.setLocation(location);
4522
+ if (location) evolandStore.setLocation(location);
4558
4523
  if (props.userRole === "admin")
4559
4524
  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" : "");
4560
4525
  }
@@ -4843,10 +4808,9 @@ var RasterPreview = (_props) => {
4843
4808
  },
4844
4809
  { scopes: ["evoland"] }
4845
4810
  );
4846
- const onSubmit = (taskStatus) => __async(void 0, null, function* () {
4811
+ const onSubmit = (taskStatus) => __async(null, null, function* () {
4847
4812
  var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2, _q2, _r2, _s2, _t2, _u2, _v2, _w2;
4848
- if (disableSubmit)
4849
- return;
4813
+ if (disableSubmit) return;
4850
4814
  setDisableSubmit(true);
4851
4815
  var bufferData = null;
4852
4816
  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 };
@@ -4903,8 +4867,7 @@ var RasterPreview = (_props) => {
4903
4867
  if (_props.userRole === "admin") {
4904
4868
  if (tasks == null ? void 0 : tasks.task)
4905
4869
  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" : ""}`;
4906
- else
4907
- alert("No more tasks to review");
4870
+ else alert("No more tasks to review");
4908
4871
  }
4909
4872
  var res = yield evolandStore.getNextLocationDetails(
4910
4873
  parseInt(projectId)
@@ -4928,8 +4891,7 @@ var RasterPreview = (_props) => {
4928
4891
  }
4929
4892
  });
4930
4893
  const arrayEqual = (a, b) => {
4931
- if (a.length !== b.length)
4932
- return false;
4894
+ if (a.length !== b.length) return false;
4933
4895
  return Buffer.compare(Buffer.from(a.buffer), Buffer.from(b.buffer)) === 0;
4934
4896
  };
4935
4897
  const flatten = (input, refArr) => {
@@ -4953,15 +4915,14 @@ var RasterPreview = (_props) => {
4953
4915
  }
4954
4916
  }
4955
4917
  }
4956
- if (indexArr.length == 0)
4957
- result = emptyAnnotation;
4918
+ if (indexArr.length == 0) result = emptyAnnotation;
4958
4919
  return { data: new Uint32Array(result), indexArr };
4959
4920
  };
4960
4921
  function isBase64Zeros(base64String) {
4961
4922
  const trimmed = base64String.replace(/=+$/, "");
4962
4923
  return /^A+$/.test(trimmed);
4963
4924
  }
4964
- const onSave = () => __async(void 0, null, function* () {
4925
+ const onSave = () => __async(null, null, function* () {
4965
4926
  var _a2, _b2;
4966
4927
  var bufferData = null;
4967
4928
  const { data, indexArr } = evolandStore.isAnnualAnnotation ? { data: evolandStore.annotatedRasterAsset.buffer, indexArr: 0 } : flatten(
@@ -5009,8 +4970,7 @@ var RasterPreview = (_props) => {
5009
4970
  setSubmitNotificationMessage(
5010
4971
  "Annotation has been SAVED successfully"
5011
4972
  );
5012
- else
5013
- setSubmitNotificationMessage("Please try again");
4973
+ else setSubmitNotificationMessage("Please try again");
5014
4974
  setSubmitNotification(true);
5015
4975
  }
5016
4976
  } catch (err) {
@@ -5019,7 +4979,7 @@ var RasterPreview = (_props) => {
5019
4979
  }
5020
4980
  }
5021
4981
  });
5022
- const ClearPreview = () => __async(void 0, null, function* () {
4982
+ const ClearPreview = () => __async(null, null, function* () {
5023
4983
  const { annotationRaster, pastValues } = yield ClearAnnotation(
5024
4984
  evolandStore.annotatedRasterAsset,
5025
4985
  evolandStore.isAnnualAnnotation,
@@ -5082,16 +5042,14 @@ var RasterPreview = (_props) => {
5082
5042
  )] : newValue == null ? void 0 : newValue.buffer[0] : newValue == null ? void 0 : newValue.buffer
5083
5043
  );
5084
5044
  };
5085
- if (layerStore.layerOpacity == 0)
5086
- layerStore.setLayerOpacity(0.4);
5045
+ if (layerStore.layerOpacity == 0) layerStore.setLayerOpacity(0.4);
5087
5046
  if (!goToNextTask && evolandStore.location !== null && evolandStore.location.locationId !== searchParams.get("locationId")) {
5088
5047
  if (status == TaskStatus3.ACCEPTED || status == TaskStatus3.DISCARDED || status == TaskStatus3.TO_FIX) {
5089
5048
  setGoToNextTask(true);
5090
5049
  if (_props.userRole === "admin")
5091
5050
  if (tasks == null ? void 0 : tasks.task)
5092
5051
  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" : ""}`;
5093
- else
5094
- alert("No more tasks to review");
5052
+ else alert("No more tasks to review");
5095
5053
  } else
5096
5054
  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}`;
5097
5055
  }
@@ -5140,10 +5098,8 @@ var RasterPreview = (_props) => {
5140
5098
  parseInt(projectId),
5141
5099
  evolandStore.referenceDate
5142
5100
  ).then(({ location, currentTask, annotation_dates }) => {
5143
- if (location)
5144
- evolandStore.setLocation(location);
5145
- if (currentTask)
5146
- evolandStore.setCurrentTask(currentTask);
5101
+ if (location) evolandStore.setLocation(location);
5102
+ if (currentTask) evolandStore.setCurrentTask(currentTask);
5147
5103
  evolandStore.setAnnotationDates(annotation_dates);
5148
5104
  });
5149
5105
  },
@@ -5179,8 +5135,7 @@ var RasterPreview = (_props) => {
5179
5135
  evolandStore.setComment(
5180
5136
  evolandStore.comment.replace(" #" + x, "")
5181
5137
  );
5182
- else
5183
- evolandStore.setComment("#" + x + " ");
5138
+ else evolandStore.setComment("#" + x + " ");
5184
5139
  },
5185
5140
  children: [
5186
5141
  "#",
@@ -5441,7 +5396,7 @@ var Annotation = (props) => {
5441
5396
  labelId: 0
5442
5397
  });
5443
5398
  const [currentLabelItem, setCurrentLabelItem] = useState9();
5444
- const OnSubmitActiveLearning = () => __async(void 0, null, function* () {
5399
+ const OnSubmitActiveLearning = () => __async(null, null, function* () {
5445
5400
  var _a2, _b2;
5446
5401
  setActiveLearningLoading(true);
5447
5402
  var bufferData = null;
@@ -6151,8 +6106,7 @@ var defaultStyles = {
6151
6106
  };
6152
6107
  var excludedProperties = /* @__PURE__ */ new Set(["bbox", "geometry", "type"]);
6153
6108
  var formatValue = (value) => {
6154
- if (value === null || value === void 0)
6155
- return "";
6109
+ if (value === null || value === void 0) return "";
6156
6110
  if (typeof value === "number") {
6157
6111
  return value.toLocaleString();
6158
6112
  }
@@ -6388,8 +6342,7 @@ var BetterWMS = class extends L5.TileLayer.WMS {
6388
6342
  * Builds the URL for the GetFeatureInfo WMS request
6389
6343
  */
6390
6344
  getFeatureInfoUrl(latlng) {
6391
- if (!this.currentMap)
6392
- return null;
6345
+ if (!this.currentMap) return null;
6393
6346
  const point2 = this.currentMap.latLngToContainerPoint(latlng);
6394
6347
  const size = this.currentMap.getSize();
6395
6348
  const wmsParams = this.wmsParams;
@@ -6458,8 +6411,7 @@ var BetterWMS = class extends L5.TileLayer.WMS {
6458
6411
  return;
6459
6412
  }
6460
6413
  this.geoJsonLayer.addData(content);
6461
- if (!this.currentMap)
6462
- return;
6414
+ if (!this.currentMap) return;
6463
6415
  if (this.currentPopup) {
6464
6416
  this.currentMap.closePopup(this.currentPopup);
6465
6417
  }
@@ -6476,8 +6428,7 @@ var BetterWMS = class extends L5.TileLayer.WMS {
6476
6428
  * Show loading popup
6477
6429
  */
6478
6430
  showLoading(latlng) {
6479
- if (!this.currentMap || this.loading || !this.canShowLoading)
6480
- return;
6431
+ if (!this.currentMap || this.loading || !this.canShowLoading) return;
6481
6432
  this.loading = true;
6482
6433
  this.currentPopup = L5.popup(this.popupOptions).setLatLng(latlng).setContent(this.loadingContent).openOn(this.currentMap);
6483
6434
  }
@@ -6488,8 +6439,7 @@ var BetterWMS = class extends L5.TileLayer.WMS {
6488
6439
  return __async(this, null, function* () {
6489
6440
  var _a, _b, _c;
6490
6441
  const url = this.getFeatureInfoUrl(event.latlng);
6491
- if (!url)
6492
- return;
6442
+ if (!url) return;
6493
6443
  try {
6494
6444
  this.showLoading(event.latlng);
6495
6445
  const data = yield this.fetchWithRetry(url);
@@ -6674,8 +6624,7 @@ import { DesignFarmerClusterPin } from "@geowiki/ui";
6674
6624
  import { jsx as jsx15 } from "react/jsx-runtime";
6675
6625
  var FarmerClusterPopup = ({ properties }) => {
6676
6626
  const fileUrl = useFileUrl2();
6677
- if (!properties)
6678
- return /* @__PURE__ */ jsx15("div", { children: "No properties found" });
6627
+ if (!properties) return /* @__PURE__ */ jsx15("div", { children: "No properties found" });
6679
6628
  const name = properties["name"];
6680
6629
  const description = properties["description"];
6681
6630
  const url = "/cluster/view/" + properties["id"];
@@ -6740,8 +6689,7 @@ import {
6740
6689
  import { Image as Image3 } from "@geowiki/core";
6741
6690
  import { jsx as jsx17, jsxs as jsxs12 } from "react/jsx-runtime";
6742
6691
  var SiteInformation = ({ data }) => {
6743
- if (!data)
6744
- return null;
6692
+ if (!data) return null;
6745
6693
  const baseDocUrl = "https://raw.githubusercontent.com/iiasa/static/refs/heads/main/geotrees/docs/biomass_processing_protocol/";
6746
6694
  return /* @__PURE__ */ jsxs12("div", { className: "space-y-6", children: [
6747
6695
  /* @__PURE__ */ jsxs12("div", { className: "space-y-4", children: [
@@ -6916,8 +6864,7 @@ var IfbnSitePopup = ({ properties }) => {
6916
6864
  const [isLoading, setIsLoading] = useState11(false);
6917
6865
  const [imageError, setImageError] = useState11(false);
6918
6866
  const { status: sessionStatus, data: session } = useSession();
6919
- if (!properties)
6920
- return /* @__PURE__ */ jsx17("div", { children: "No properties found" });
6867
+ if (!properties) return /* @__PURE__ */ jsx17("div", { children: "No properties found" });
6921
6868
  const plotId = properties["Plot_ID"];
6922
6869
  const subPlotId = properties["SubPlot_Id"];
6923
6870
  const network = properties["Network"];
@@ -6926,7 +6873,7 @@ var IfbnSitePopup = ({ properties }) => {
6926
6873
  const fallbackUrl = "https://cms.main.geo-wiki.org/geotrees/media/cocoa.png";
6927
6874
  const baseImageUrl = "https://raw.githubusercontent.com/iiasa/static/refs/heads/main/geotrees/sites/";
6928
6875
  const imageUrl = `${baseImageUrl}${plotId}.jpg?raw=true`;
6929
- const fetchSiteData = () => __async(void 0, null, function* () {
6876
+ const fetchSiteData = () => __async(null, null, function* () {
6930
6877
  setIsLoading(true);
6931
6878
  try {
6932
6879
  const response = yield fetch(
@@ -6937,8 +6884,7 @@ var IfbnSitePopup = ({ properties }) => {
6937
6884
  }
6938
6885
  }
6939
6886
  );
6940
- if (!response.ok)
6941
- throw new Error("Failed to fetch data");
6887
+ if (!response.ok) throw new Error("Failed to fetch data");
6942
6888
  const data = yield response.json();
6943
6889
  setSiteData(data);
6944
6890
  } catch (error) {
@@ -7012,16 +6958,14 @@ var IfbnPlotPopup = ({ properties }) => {
7012
6958
  const [error, setError] = useState12(null);
7013
6959
  const API_URL = process.env.NEXT_PUBLIC_GEO_TREE_API_URL;
7014
6960
  useEffect5(() => {
7015
- const fetchApiData = () => __async(void 0, null, function* () {
7016
- if (!(properties == null ? void 0 : properties.id))
7017
- return;
6961
+ const fetchApiData = () => __async(null, null, function* () {
6962
+ if (!(properties == null ? void 0 : properties.id)) return;
7018
6963
  setIsLoading(true);
7019
6964
  try {
7020
6965
  const response = yield fetch(
7021
6966
  `${API_URL}/api/plots/by-plot-id/${properties.plot_id}`
7022
6967
  );
7023
- if (!response.ok)
7024
- throw new Error("Failed to fetch data");
6968
+ if (!response.ok) throw new Error("Failed to fetch data");
7025
6969
  const data = yield response.json();
7026
6970
  console.log("API Response:", data);
7027
6971
  setApiData(data);
@@ -7195,12 +7139,9 @@ var createClusterIcon = (color) => {
7195
7139
  markers.forEach((marker2) => {
7196
7140
  var _a, _b, _c;
7197
7141
  const status = ((_c = (_b = (_a = marker2.feature) == null ? void 0 : _a.properties) == null ? void 0 : _b.Status) == null ? void 0 : _c.trim().toLowerCase()) || "default";
7198
- if (status === "ongoing")
7199
- statusCount.ongoing++;
7200
- else if (status === "auxiliary")
7201
- statusCount.auxiliary++;
7202
- else
7203
- statusCount.default++;
7142
+ if (status === "ongoing") statusCount.ongoing++;
7143
+ else if (status === "auxiliary") statusCount.auxiliary++;
7144
+ else statusCount.default++;
7204
7145
  });
7205
7146
  return L7.divIcon({
7206
7147
  html: `<div style=
@@ -7226,7 +7167,7 @@ var GeoJsonLayer = memo(
7226
7167
  ({ layer }) => {
7227
7168
  const { isLoading, error, data } = useQuery({
7228
7169
  queryKey: ["geoJson", layer.id],
7229
- queryFn: () => __async(void 0, null, function* () {
7170
+ queryFn: () => __async(null, null, function* () {
7230
7171
  const res = yield fetch(layer.url);
7231
7172
  return yield res.json();
7232
7173
  })
@@ -7276,8 +7217,7 @@ var GeoJsonLayer = memo(
7276
7217
  [layerIcon]
7277
7218
  );
7278
7219
  const processedData = useMemo2(() => {
7279
- if (!(data == null ? void 0 : data.features))
7280
- return data;
7220
+ if (!(data == null ? void 0 : data.features)) return data;
7281
7221
  const processed = __spreadValues({}, data);
7282
7222
  processed.features = data.features.map((feature) => {
7283
7223
  var _a;
@@ -7303,10 +7243,8 @@ var GeoJsonLayer = memo(
7303
7243
  }),
7304
7244
  [layer.id]
7305
7245
  );
7306
- if (error)
7307
- return /* @__PURE__ */ jsx20("div", { children: "error" });
7308
- if (isLoading)
7309
- return /* @__PURE__ */ jsx20(LoaderFull5, {});
7246
+ if (error) return /* @__PURE__ */ jsx20("div", { children: "error" });
7247
+ if (isLoading) return /* @__PURE__ */ jsx20(LoaderFull5, {});
7310
7248
  return /* @__PURE__ */ jsx20(
7311
7249
  MarkerClusterGroup2,
7312
7250
  {
@@ -7379,12 +7317,9 @@ var createClusterIcon2 = (cluster) => {
7379
7317
  markers.forEach((marker2) => {
7380
7318
  var _a, _b, _c;
7381
7319
  const status = ((_c = (_b = (_a = marker2.feature) == null ? void 0 : _a.properties) == null ? void 0 : _b.Status) == null ? void 0 : _c.trim().toLowerCase()) || "default";
7382
- if (status === "ongoing")
7383
- statusCount.ongoing++;
7384
- else if (status === "auxiliary")
7385
- statusCount.auxiliary++;
7386
- else
7387
- statusCount.default++;
7320
+ if (status === "ongoing") statusCount.ongoing++;
7321
+ else if (status === "auxiliary") statusCount.auxiliary++;
7322
+ else statusCount.default++;
7388
7323
  });
7389
7324
  let clusterColor = "#2E7D32";
7390
7325
  if (statusCount.ongoing > statusCount.auxiliary && statusCount.ongoing > statusCount.default) {
@@ -7433,7 +7368,7 @@ var IfbnPlotLayer = ({
7433
7368
  });
7434
7369
  const { isLoading, error, data } = useQuery2({
7435
7370
  queryKey: ["IfbnPlotLayer", layer.id],
7436
- queryFn: () => __async(void 0, null, function* () {
7371
+ queryFn: () => __async(null, null, function* () {
7437
7372
  const res = yield fetch(`${layer.url}`);
7438
7373
  return yield res.json();
7439
7374
  })
@@ -7442,8 +7377,7 @@ var IfbnPlotLayer = ({
7442
7377
  return currentZoom <= hideMarkersAboveZoom;
7443
7378
  };
7444
7379
  useEffect7(() => {
7445
- if (!markerClusterGroupRef.current)
7446
- return;
7380
+ if (!markerClusterGroupRef.current) return;
7447
7381
  if (shouldShowMarkers()) {
7448
7382
  markersRef.current.forEach((marker2) => {
7449
7383
  var _a, _b;
@@ -7531,10 +7465,8 @@ var IfbnPlotLayer = ({
7531
7465
  setSelectedFeature({ feature, latlng });
7532
7466
  };
7533
7467
  const ref = useRef2(null);
7534
- if (error)
7535
- return /* @__PURE__ */ jsx21("div", { children: "error" });
7536
- if (isLoading)
7537
- return /* @__PURE__ */ jsx21(LoaderFull6, {});
7468
+ if (error) return /* @__PURE__ */ jsx21("div", { children: "error" });
7469
+ if (isLoading) return /* @__PURE__ */ jsx21(LoaderFull6, {});
7538
7470
  return /* @__PURE__ */ jsxs14(
7539
7471
  MarkerClusterGroup2,
7540
7472
  {
@@ -7795,8 +7727,7 @@ var useCustomLayerStore = create4()((set, get) => ({
7795
7727
  createLayerFromTemplate: (templateId, customData) => {
7796
7728
  var _a, _b;
7797
7729
  const template = get().getTemplate(templateId);
7798
- if (!template)
7799
- return null;
7730
+ if (!template) return null;
7800
7731
  const newLayer = {
7801
7732
  id: uuidv4(),
7802
7733
  isCustom: true,
@@ -8167,16 +8098,11 @@ function getColumnStats(data, columnName) {
8167
8098
  let type;
8168
8099
  if (uniqueTypes.size === 1) {
8169
8100
  const singleType = types[0];
8170
- if (singleType === "string")
8171
- type = "string";
8172
- else if (singleType === "number")
8173
- type = "number";
8174
- else if (singleType === "boolean")
8175
- type = "boolean";
8176
- else if (singleType === "object")
8177
- type = "date";
8178
- else
8179
- type = "mixed";
8101
+ if (singleType === "string") type = "string";
8102
+ else if (singleType === "number") type = "number";
8103
+ else if (singleType === "boolean") type = "boolean";
8104
+ else if (singleType === "object") type = "date";
8105
+ else type = "mixed";
8180
8106
  } else {
8181
8107
  type = "mixed";
8182
8108
  }
@@ -8189,21 +8115,15 @@ var GoogleSheetsPopup = ({
8189
8115
  properties
8190
8116
  }) => {
8191
8117
  const isEmpty = (value) => {
8192
- if (value === null || value === void 0)
8193
- return true;
8194
- if (typeof value === "string")
8195
- return value.trim() === "";
8196
- if (typeof value === "number")
8197
- return isNaN(value);
8198
- if (Array.isArray(value))
8199
- return value.length === 0;
8200
- if (typeof value === "object")
8201
- return Object.keys(value).length === 0;
8118
+ if (value === null || value === void 0) return true;
8119
+ if (typeof value === "string") return value.trim() === "";
8120
+ if (typeof value === "number") return isNaN(value);
8121
+ if (Array.isArray(value)) return value.length === 0;
8122
+ if (typeof value === "object") return Object.keys(value).length === 0;
8202
8123
  return false;
8203
8124
  };
8204
8125
  const isUrl = (value) => {
8205
- if (typeof value !== "string")
8206
- return false;
8126
+ if (typeof value !== "string") return false;
8207
8127
  const trimmedValue = value.trim();
8208
8128
  const urlPatterns = [
8209
8129
  /^https?:\/\//i,
@@ -8710,8 +8630,7 @@ function analyzeColumn(rows, columnName) {
8710
8630
  };
8711
8631
  }
8712
8632
  function getLegendColumns(rows, excludeCoordinateColumns = []) {
8713
- if (rows.length === 0)
8714
- return [];
8633
+ if (rows.length === 0) return [];
8715
8634
  const headers = Object.keys(rows[0]);
8716
8635
  const legendColumns = [];
8717
8636
  for (const header of headers) {
@@ -8848,7 +8767,7 @@ function useGenericCache({
8848
8767
  const isCached = cache.has(cacheKey);
8849
8768
  const queryOptions = {
8850
8769
  queryKey: [cacheKey.type, cacheKey.id, cacheKey.subId, cacheKey.version],
8851
- queryFn: () => __async(this, null, function* () {
8770
+ queryFn: () => __async(null, null, function* () {
8852
8771
  const cachedData = cache.get(cacheKey);
8853
8772
  if (cachedData) {
8854
8773
  console.log(
@@ -8917,7 +8836,7 @@ function useGoogleSheetsData({
8917
8836
  subId: sheetConfig.sheetId,
8918
8837
  version: "1.0.0"
8919
8838
  } : null;
8920
- const fetchData = () => __async(this, null, function* () {
8839
+ const fetchData = () => __async(null, null, function* () {
8921
8840
  if (!sheetConfig) {
8922
8841
  throw new Error("Invalid Google Sheets configuration");
8923
8842
  }
@@ -9185,8 +9104,7 @@ var GoogleSheetsLayer = ({
9185
9104
  };
9186
9105
  const processedData = useMemo3(() => {
9187
9106
  var _a2;
9188
- if (!data)
9189
- return null;
9107
+ if (!data) return null;
9190
9108
  return __spreadProps(__spreadValues({}, data), {
9191
9109
  features: (_a2 = data.features) == null ? void 0 : _a2.map((feature) => {
9192
9110
  var _a3;
@@ -9883,7 +9801,7 @@ var TimeSeries = () => {
9883
9801
  const bbox4 = [bounds[1], bounds[0], bounds[3], bounds[2]];
9884
9802
  const years = changeYears != null ? changeYears : taskChangeYears;
9885
9803
  if (years) {
9886
- years.map((year) => __async(this, null, function* () {
9804
+ years.map((year) => __async(null, null, function* () {
9887
9805
  yield getTimeseries(
9888
9806
  year + "-01-01",
9889
9807
  year + "-12-31",
@@ -9918,8 +9836,7 @@ var TimeSeries = () => {
9918
9836
  })
9919
9837
  }
9920
9838
  );
9921
- if (!appendImages)
9922
- setDetailedImgUrls((yield response.json()).images);
9839
+ if (!appendImages) setDetailedImgUrls((yield response.json()).images);
9923
9840
  else {
9924
9841
  response.json().then((res) => {
9925
9842
  setDetailedImgUrls((prevUrls) => [...prevUrls, ...res.images]);
@@ -9963,18 +9880,15 @@ var TimeSeries = () => {
9963
9880
  return 1;
9964
9881
  else if (x.substring(x.split("_")[0].length, x.length) < y.substring(y.split("_")[0].length, y.length))
9965
9882
  return -1;
9966
- else
9967
- return 0;
9883
+ else return 0;
9968
9884
  }).map((x, index) => /* @__PURE__ */ jsx30(
9969
9885
  "button",
9970
9886
  {
9971
9887
  className: currentTab === index ? "pl-1 pr-5 border-gray-300 text-white" : "pl-1 pr-5 border-gray-300 bg-gray-200",
9972
9888
  onClick: () => {
9973
9889
  setDetailedImgUrls([]);
9974
- if (x.includes("RGB"))
9975
- fetchImages("TRUE_COLOR" /* RGB */);
9976
- else if (x.includes("FCC"))
9977
- fetchImages("COLOR_INFRARED" /* FCC */);
9890
+ if (x.includes("RGB")) fetchImages("TRUE_COLOR" /* RGB */);
9891
+ else if (x.includes("FCC")) fetchImages("COLOR_INFRARED" /* FCC */);
9978
9892
  setCurrentTab(index);
9979
9893
  },
9980
9894
  children: x.substring(x.split("_")[0].length + 1, x.length)
@@ -10239,10 +10153,9 @@ var Questions = (props) => {
10239
10153
  userUserAlias: !localStorage.getItem("searchUser") ? null : localStorage.getItem("searchUser"),
10240
10154
  locationLocationId: null
10241
10155
  });
10242
- const onSubmit = (taskStatus) => __async(void 0, null, function* () {
10156
+ const onSubmit = (taskStatus) => __async(null, null, function* () {
10243
10157
  var _a2, _b2, _c2, _d2, _e2;
10244
- if (disableSubmit)
10245
- return;
10158
+ if (disableSubmit) return;
10246
10159
  setDisableSubmit(true);
10247
10160
  setStatus(taskStatus[0]);
10248
10161
  if (evolandStore.currentTask) {
@@ -10274,8 +10187,7 @@ var Questions = (props) => {
10274
10187
  if (props.userRole === "admin") {
10275
10188
  if (tasks == null ? void 0 : tasks.task)
10276
10189
  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" : ""}`;
10277
- else
10278
- alert("No more tasks to review");
10190
+ else alert("No more tasks to review");
10279
10191
  }
10280
10192
  var res = yield evolandStore.getNextLocationDetails(
10281
10193
  parseInt(projectId)
@@ -10298,7 +10210,7 @@ var Questions = (props) => {
10298
10210
  setSubmitNotificationMessage("");
10299
10211
  }
10300
10212
  });
10301
- const onSave = () => __async(void 0, null, function* () {
10213
+ const onSave = () => __async(null, null, function* () {
10302
10214
  if (evolandStore.currentTask) {
10303
10215
  const saveQuestionnaireReq = {
10304
10216
  task_id: evolandStore.currentTask.task_id,
@@ -10317,8 +10229,7 @@ var Questions = (props) => {
10317
10229
  setSubmitNotificationMessage(
10318
10230
  "Questionnaire has been SAVED successfully"
10319
10231
  );
10320
- else
10321
- setSubmitNotificationMessage("Please try again");
10232
+ else setSubmitNotificationMessage("Please try again");
10322
10233
  setSubmitNotification(true);
10323
10234
  }
10324
10235
  } catch (err) {
@@ -10351,8 +10262,7 @@ var Questions = (props) => {
10351
10262
  "<" + key + ">",
10352
10263
  "" + (label == null ? void 0 : label.labelName)
10353
10264
  );
10354
- } else
10355
- y.text = y.text.replace("<" + key + ">", "" + value);
10265
+ } else y.text = y.text.replace("<" + key + ">", "" + value);
10356
10266
  });
10357
10267
  });
10358
10268
  }
@@ -10398,8 +10308,7 @@ var Questions = (props) => {
10398
10308
  if (props.userRole === "admin")
10399
10309
  if (tasks == null ? void 0 : tasks.task)
10400
10310
  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" : ""}`;
10401
- else
10402
- alert("No more tasks to review");
10311
+ else alert("No more tasks to review");
10403
10312
  } else
10404
10313
  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}`;
10405
10314
  }
@@ -10514,8 +10423,7 @@ var Questions = (props) => {
10514
10423
  evolandStore.setComment(
10515
10424
  evolandStore.comment.replace(" #" + x, "")
10516
10425
  );
10517
- else
10518
- evolandStore.setComment("#" + x + " ");
10426
+ else evolandStore.setComment("#" + x + " ");
10519
10427
  },
10520
10428
  children: [
10521
10429
  "#",
@@ -10548,8 +10456,7 @@ var Questions = (props) => {
10548
10456
  onClick: () => {
10549
10457
  if (TaskState2[x[0]] !== TaskState2.SKIPPED && TaskState2[x[0]] !== TaskState2.DISCARDED && TaskState2[x[0]] !== TaskState2.USER_DISCARDED && userAnswers.length !== requiredUserAnswers)
10550
10458
  alert("Please provide all answers");
10551
- else
10552
- onSubmit(x);
10459
+ else onSubmit(x);
10553
10460
  },
10554
10461
  children: TaskState2[x[0]]
10555
10462
  }
@@ -10614,8 +10521,7 @@ var OverlayLayer = () => {
10614
10521
  if (e.target.value !== "0") {
10615
10522
  layerStore.setSelectedLayer(e.target.value);
10616
10523
  setShowLayerOpacity(true);
10617
- if (layerStore.layerOpacity == 0)
10618
- layerStore.setLayerOpacity(0.4);
10524
+ if (layerStore.layerOpacity == 0) layerStore.setLayerOpacity(0.4);
10619
10525
  } else {
10620
10526
  setShowLayerOpacity(false);
10621
10527
  layerStore.setSelectedLayer("");
@@ -10659,7 +10565,7 @@ import { HotkeysProvider } from "react-hotkeys-hook";
10659
10565
  import { Fragment as Fragment11, jsx as jsx33, jsxs as jsxs24 } from "react/jsx-runtime";
10660
10566
  var GeoWikiMapComponent = ({ mapSettings, session }) => {
10661
10567
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
10662
- const mapRef = useRef4();
10568
+ const mapRef = useRef4(void 0);
10663
10569
  const router = useRouter6();
10664
10570
  var projectId = router.query.projectId;
10665
10571
  var locationId = router.query.locationId;