@opengeoweb/store 15.3.0 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/index.esm.js +841 -326
  2. package/package.json +6 -6
  3. package/src/index.d.ts +0 -1
  4. package/src/store/common/auth/index.d.ts +0 -3
  5. package/src/store/common/auth/reducer.d.ts +0 -14
  6. package/src/store/common/auth/reducer.spec.d.ts +0 -1
  7. package/src/store/common/auth/selectors.d.ts +0 -87
  8. package/src/store/common/auth/selectors.spec.d.ts +0 -1
  9. package/src/store/common/auth/types.d.ts +0 -22
  10. package/src/store/common/index.d.ts +0 -81
  11. package/src/store/common/listener.d.ts +0 -2
  12. package/src/store/common/types.d.ts +0 -6
  13. package/src/store/drawingTool/index.d.ts +0 -4
  14. package/src/store/drawingTool/listener.d.ts +0 -3
  15. package/src/store/drawingTool/listener.spec.d.ts +0 -1
  16. package/src/store/drawingTool/reducer.d.ts +0 -45
  17. package/src/store/drawingTool/reducer.spec.d.ts +0 -4
  18. package/src/store/drawingTool/selectors.d.ts +0 -347
  19. package/src/store/drawingTool/selectors.spec.d.ts +0 -1
  20. package/src/store/drawingTool/testUtils.d.ts +0 -1
  21. package/src/store/drawingTool/utils.d.ts +0 -1
  22. package/src/store/drawingTool/utils.spec.d.ts +0 -1
  23. package/src/store/generic/actions.d.ts +0 -28
  24. package/src/store/generic/hooks.d.ts +0 -2
  25. package/src/store/generic/index.d.ts +0 -25
  26. package/src/store/generic/linking/constants.d.ts +0 -6
  27. package/src/store/generic/linking/index.d.ts +0 -1
  28. package/src/store/generic/listener.d.ts +0 -2
  29. package/src/store/generic/listener.spec.d.ts +0 -1
  30. package/src/store/generic/loadingIndicator/constants.d.ts +0 -1
  31. package/src/store/generic/loadingIndicator/index.d.ts +0 -3
  32. package/src/store/generic/loadingIndicator/reducer.d.ts +0 -13
  33. package/src/store/generic/loadingIndicator/reducer.spec.d.ts +0 -1
  34. package/src/store/generic/loadingIndicator/selectors.d.ts +0 -337
  35. package/src/store/generic/loadingIndicator/selectors.spec.d.ts +0 -1
  36. package/src/store/generic/loadingIndicator/types.d.ts +0 -22
  37. package/src/store/generic/selectors.d.ts +0 -410
  38. package/src/store/generic/selectors.spec.d.ts +0 -1
  39. package/src/store/generic/syncGroups/__mocks__/mockState.d.ts +0 -2
  40. package/src/store/generic/syncGroups/constants.d.ts +0 -4
  41. package/src/store/generic/syncGroups/hooks.d.ts +0 -8
  42. package/src/store/generic/syncGroups/hooks.spec.d.ts +0 -1
  43. package/src/store/generic/syncGroups/index.d.ts +0 -10
  44. package/src/store/generic/syncGroups/listener.d.ts +0 -2
  45. package/src/store/generic/syncGroups/listener.spec.d.ts +0 -1
  46. package/src/store/generic/syncGroups/reducer.d.ts +0 -60
  47. package/src/store/generic/syncGroups/reducer.spec.d.ts +0 -1
  48. package/src/store/generic/syncGroups/selector.d.ts +0 -29
  49. package/src/store/generic/syncGroups/selectors.d.ts +0 -235
  50. package/src/store/generic/syncGroups/selectors.spec.d.ts +0 -1
  51. package/src/store/generic/syncGroups/types.d.ts +0 -166
  52. package/src/store/generic/syncGroups/utils.d.ts +0 -76
  53. package/src/store/generic/syncGroups/utils.spec.d.ts +0 -1
  54. package/src/store/generic/synchronizationActions/actions.d.ts +0 -11
  55. package/src/store/generic/synchronizationActions/types.d.ts +0 -43
  56. package/src/store/generic/types.d.ts +0 -24
  57. package/src/store/generic/utils.d.ts +0 -9
  58. package/src/store/generic/utils.spec.d.ts +0 -1
  59. package/src/store/index.d.ts +0 -22
  60. package/src/store/map/index.d.ts +0 -5
  61. package/src/store/map/layer/index.d.ts +0 -5
  62. package/src/store/map/layer/listeners.d.ts +0 -2
  63. package/src/store/map/layer/listeners.spec.d.ts +0 -1
  64. package/src/store/map/layer/reducer.d.ts +0 -88
  65. package/src/store/map/layer/reducer.spec.d.ts +0 -1
  66. package/src/store/map/layer/selectors.d.ts +0 -2547
  67. package/src/store/map/layer/selectors.spec.d.ts +0 -1
  68. package/src/store/map/layer/types.d.ts +0 -175
  69. package/src/store/map/layer/utils.d.ts +0 -33
  70. package/src/store/map/layer/utils.spec.d.ts +0 -1
  71. package/src/store/map/map/actions.d.ts +0 -9
  72. package/src/store/map/map/constants.d.ts +0 -3
  73. package/src/store/map/map/enums.d.ts +0 -3
  74. package/src/store/map/map/filterLayers.d.ts +0 -10
  75. package/src/store/map/map/filterLayers.spec.d.ts +0 -1
  76. package/src/store/map/map/index.d.ts +0 -26
  77. package/src/store/map/map/listener.d.ts +0 -4
  78. package/src/store/map/map/listener.spec.d.ts +0 -1
  79. package/src/store/map/map/mapListenerAnimationUtils.d.ts +0 -28
  80. package/src/store/map/map/mapListenerAnimationUtils.spec.d.ts +0 -1
  81. package/src/store/map/map/metronomeListener.d.ts +0 -2
  82. package/src/store/map/map/olMapListenerAnimationUtils.d.ts +0 -46
  83. package/src/store/map/map/olMapListenerAnimationUtils.spec.d.ts +0 -1
  84. package/src/store/map/map/reducer.d.ts +0 -132
  85. package/src/store/map/map/reducer.spec.d.ts +0 -1
  86. package/src/store/map/map/replaceLayerIdsToEnsureUniqueLayerIdsInStore.d.ts +0 -7
  87. package/src/store/map/map/replaceLayerIdsToEnsureUniqueLayerIdsInStore.spec.d.ts +0 -1
  88. package/src/store/map/map/selectors.d.ts +0 -3535
  89. package/src/store/map/map/selectors.spec.d.ts +0 -1
  90. package/src/store/map/map/types.d.ts +0 -327
  91. package/src/store/map/map/utils.d.ts +0 -87
  92. package/src/store/map/map/utils.spec.d.ts +0 -1
  93. package/src/store/map/service/WMS111GetCapabilitiesGeoServicesRADAR.d.ts +0 -2
  94. package/src/store/map/service/index.d.ts +0 -4
  95. package/src/store/map/service/listener.d.ts +0 -5
  96. package/src/store/map/service/listener.spec.d.ts +0 -1
  97. package/src/store/map/service/localStorage.d.ts +0 -3
  98. package/src/store/map/service/localStorage.spec.d.ts +0 -1
  99. package/src/store/map/service/reducer.d.ts +0 -10
  100. package/src/store/map/service/reducer.spec.d.ts +0 -1
  101. package/src/store/map/service/selectors.d.ts +0 -386
  102. package/src/store/map/service/selectors.spec.d.ts +0 -1
  103. package/src/store/map/service/types.d.ts +0 -52
  104. package/src/store/map/storeTestSettings.d.ts +0 -8
  105. package/src/store/map/storeTestUtils.d.ts +0 -18
  106. package/src/store/map/types.d.ts +0 -11
  107. package/src/store/mapStore/openlayers/listener.d.ts +0 -2
  108. package/src/store/mapStore/openlayers/listener.spec.d.ts +0 -1
  109. package/src/store/mapStore/openlayers/syncGroupViewStore.d.ts +0 -26
  110. package/src/store/router/index.d.ts +0 -2
  111. package/src/store/router/listener.d.ts +0 -2
  112. package/src/store/router/listener.spec.d.ts +0 -1
  113. package/src/store/router/reducer.d.ts +0 -9
  114. package/src/store/router/reducer.spec.d.ts +0 -1
  115. package/src/store/router/types.d.ts +0 -9
  116. package/src/store/router/utils.d.ts +0 -4
  117. package/src/store/store.d.ts +0 -37
  118. package/src/store/types.d.ts +0 -7
  119. package/src/store/ui/index.d.ts +0 -5
  120. package/src/store/ui/reducer.d.ts +0 -39
  121. package/src/store/ui/reducer.spec.d.ts +0 -1
  122. package/src/store/ui/selectors.d.ts +0 -234
  123. package/src/store/ui/selectors.spec.d.ts +0 -1
  124. package/src/store/ui/types.d.ts +0 -87
  125. package/src/store/ui/useSetupDialog.d.ts +0 -11
  126. package/src/store/ui/useSetupDialog.spec.d.ts +0 -1
  127. package/src/store/unifyReducerMaps.d.ts +0 -3
  128. package/src/store/unifyReducermaps.spec.d.ts +0 -1
  129. package/src/store/utils.d.ts +0 -6
package/index.esm.js CHANGED
@@ -573,6 +573,7 @@ var serviceReducer = slice$8.reducer,
573
573
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
574
574
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
575
575
  * */
576
+
576
577
  var selectorMemoizationOptions = {
577
578
  memoizeOptions: {
578
579
  maxSize: 1000,
@@ -602,9 +603,11 @@ var utils$3 = /*#__PURE__*/Object.freeze({
602
603
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
603
604
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
604
605
  * */
606
+
605
607
  var getServicesStore = function getServicesStore(store) {
606
608
  return store === null || store === void 0 ? void 0 : store.services;
607
609
  };
610
+
608
611
  /**
609
612
  * Retrieves all serviceIds
610
613
  *
@@ -616,6 +619,7 @@ var getServiceIds = createSelector(getServicesStore, function (serviceState) {
616
619
  var _serviceState$allIds;
617
620
  return (_serviceState$allIds = serviceState === null || serviceState === void 0 ? void 0 : serviceState.allIds) !== null && _serviceState$allIds !== void 0 ? _serviceState$allIds : [];
618
621
  }, selectorMemoizationOptions);
622
+
619
623
  /**
620
624
  * Gets map services
621
625
  *
@@ -627,6 +631,7 @@ var getServices = createSelector(getServicesStore, function (store) {
627
631
  var _store$byId;
628
632
  return (_store$byId = store === null || store === void 0 ? void 0 : store.byId) !== null && _store$byId !== void 0 ? _store$byId : {};
629
633
  }, selectorMemoizationOptions);
634
+
630
635
  /**
631
636
  * Gets the service object by its url
632
637
  *
@@ -644,6 +649,7 @@ var getServiceByUrl = createSelector(getServicesStore, function (state, serviceU
644
649
  return service.serviceUrl === serviceUrl;
645
650
  });
646
651
  }, selectorMemoizationOptions);
652
+
647
653
  /**
648
654
  * Gets the layer from the store using the serviceUrl and layerName
649
655
  *
@@ -656,6 +662,7 @@ var getLayersFromServiceSelector = createSelector(getServiceByUrl, function (ser
656
662
  var _service$layers;
657
663
  return (_service$layers = service === null || service === void 0 ? void 0 : service.layers) !== null && _service$layers !== void 0 ? _service$layers : [];
658
664
  }, selectorMemoizationOptions);
665
+
659
666
  /**
660
667
  * Gets the layer from the store using the serviceUrl and layerName
661
668
  *
@@ -672,6 +679,7 @@ var getLayerFromService = createSelector(getLayersFromServiceSelector, function
672
679
  return serviceLayer.name === layerName;
673
680
  });
674
681
  }, selectorMemoizationOptions);
682
+
675
683
  /**
676
684
  * Gets the layers stylelist from the servicestore using the serviceUrl and layerName
677
685
  *
@@ -685,6 +693,7 @@ var getLayerStyles = createSelector(getLayerFromService, function (layer) {
685
693
  var _layer$styles;
686
694
  return (_layer$styles = layer === null || layer === void 0 ? void 0 : layer.styles) !== null && _layer$styles !== void 0 ? _layer$styles : [];
687
695
  }, selectorMemoizationOptions);
696
+
688
697
  /**
689
698
  * Gets the layer title from the servicestore using the serviceUrl and layerName
690
699
  *
@@ -709,6 +718,10 @@ var selectors$7 = /*#__PURE__*/Object.freeze({
709
718
  getServices: getServices
710
719
  });
711
720
 
721
+ var types$6 = /*#__PURE__*/Object.freeze({
722
+ __proto__: null
723
+ });
724
+
712
725
  /* *
713
726
  * Licensed under the Apache License, Version 2.0 (the "License");
714
727
  * you may not use this file except in compliance with the License.
@@ -726,6 +739,7 @@ var selectors$7 = /*#__PURE__*/Object.freeze({
726
739
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
727
740
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
728
741
  * */
742
+
729
743
  var getUserAddedServices = function getUserAddedServices() {
730
744
  try {
731
745
  var storedString = window.localStorage.getItem('userAddedServices');
@@ -813,6 +827,7 @@ var replaceLayerIdsToEnsureUniqueLayerIdsInStore = function replaceLayerIdsToEns
813
827
  autoUpdateLayerId: autoUpdateLayerIdNew
814
828
  };
815
829
  }
830
+
816
831
  // The code below is executed if neither auto timestep
817
832
  // nor auto update layer id was provided
818
833
  var layersWithNewIds = layers.map(function (layer) {
@@ -858,8 +873,8 @@ function replaceLayerIds(layers, autoLayerIdOld, autoLayerIdNew) {
858
873
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
859
874
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
860
875
  * */
861
- var AnimationLength;
862
- (function (AnimationLength) {
876
+
877
+ var AnimationLength = /*#__PURE__*/function (AnimationLength) {
863
878
  AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
864
879
  AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
865
880
  AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
@@ -868,11 +883,16 @@ var AnimationLength;
868
883
  AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
869
884
  AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
870
885
  AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
871
- })(AnimationLength || (AnimationLength = {}));
886
+ return AnimationLength;
887
+ }({});
872
888
 
873
- var types$3 = /*#__PURE__*/Object.freeze({
889
+ // Layer actions
890
+
891
+ // Dependency issue with core, so the following interfaces are copies from libs/core/src/lib/components/ComponentsLookUp/componentsLookUp.tsx
892
+
893
+ var types$5 = /*#__PURE__*/Object.freeze({
874
894
  __proto__: null,
875
- get AnimationLength () { return AnimationLength; }
895
+ AnimationLength: AnimationLength
876
896
  });
877
897
 
878
898
  var dateFormat = dateUtils.DATE_FORMAT_UTC;
@@ -998,6 +1018,7 @@ var checkValidLayersPayload = function checkValidLayersPayload(layers, mapId) {
998
1018
  }
999
1019
  return true;
1000
1020
  };
1021
+
1001
1022
  /**
1002
1023
  * This will get the map from the map draftstate.
1003
1024
  * If the mapId is not found, it registers one and returns it.
@@ -1017,6 +1038,7 @@ var getDraftMapById = function getDraftMapById(mapId, draft) {
1017
1038
  }
1018
1039
  return draft.byId[mapId];
1019
1040
  };
1041
+
1020
1042
  /**
1021
1043
  * Sets the map dimension in the state.
1022
1044
  * It will add dimensions to the map if they are missing.
@@ -1048,6 +1070,7 @@ var produceDraftStateSetWebMapDimension = function produceDraftStateSetWebMapDim
1048
1070
  }
1049
1071
  }
1050
1072
  };
1073
+
1051
1074
  /**
1052
1075
  * Find the mapId belonging to a layerId
1053
1076
  * @param draft The WebMapState containing the state of all maps.
@@ -1064,10 +1087,12 @@ var findMapIdFromLayerId = function findMapIdFromLayerId(mapState, layerId) {
1064
1087
  });
1065
1088
  return result === undefined ? null : result;
1066
1089
  };
1090
+
1067
1091
  /*
1068
1092
  When a layer dimension is changed, it can affect the map dimension if the layer dimension is linked with the map.
1069
1093
  We need to find out from the layerId to which map it is coupled, and then adjust the map dimension
1070
1094
  */
1095
+
1071
1096
  var produceDraftStateSetMapDimensionFromLayerChangeDimension = function produceDraftStateSetMapDimensionFromLayerChangeDimension(draft, layerId, dimension) {
1072
1097
  var wmjsDimension = webmapUtils.getWMJSDimensionForLayerAndDimension(layerId, dimension.name);
1073
1098
  if (!wmjsDimension) {
@@ -1083,6 +1108,7 @@ var produceDraftStateSetMapDimensionFromLayerChangeDimension = function produceD
1083
1108
  }
1084
1109
  produceDraftStateSetWebMapDimension(draft, mapId, dimension, true);
1085
1110
  };
1111
+
1086
1112
  /**
1087
1113
  * Returns array with new order of swapped elements
1088
1114
  * @param array Array with ids
@@ -1129,6 +1155,7 @@ var getSpeedFactor = function getSpeedFactor(speedDelay) {
1129
1155
  var getAnimationDuration = function getAnimationDuration(animationEndTime, animationStartTime) {
1130
1156
  return animationEndTime && animationStartTime ? dateUtils.differenceInMinutes(new Date(animationEndTime), new Date(animationStartTime)) : 0;
1131
1157
  };
1158
+
1132
1159
  /**
1133
1160
  * @param animationStart
1134
1161
  * @param animationEnd
@@ -1141,6 +1168,7 @@ var generateAnimationList = function generateAnimationList(unixAnimationStart, u
1141
1168
  }
1142
1169
  var iso8601Intervals = parseTimeDimToISO8601Interval(timeValues);
1143
1170
  var animationList = [];
1171
+
1144
1172
  // If there are no ISO8601 intervals in the time dimension we treat it as a list of time values
1145
1173
  if (!iso8601Intervals.length) {
1146
1174
  timeValues.split(',').forEach(function (timeValue) {
@@ -1153,13 +1181,16 @@ var generateAnimationList = function generateAnimationList(unixAnimationStart, u
1153
1181
  });
1154
1182
  return animationList;
1155
1183
  }
1184
+
1156
1185
  // Initialize aggregate start time for animation points in case of multiple intervals
1157
1186
  var currentAnimationTime = unixAnimationStart;
1187
+
1158
1188
  // Iterate over each iso8601 interval and generate animation points
1159
1189
  iso8601Intervals.forEach(function (timeInterval) {
1160
1190
  if (!timeInterval.duration) {
1161
1191
  return;
1162
1192
  }
1193
+
1163
1194
  // Convert interval start and end times to Unix time
1164
1195
  var unixIntervalStart = dateUtils.unix(dateUtils.utc(timeInterval.startTime));
1165
1196
  var unixIntervalEnd = dateUtils.unix(dateUtils.utc(timeInterval.endTime));
@@ -1169,6 +1200,7 @@ var generateAnimationList = function generateAnimationList(unixAnimationStart, u
1169
1200
  return getTimeStepFromDataInterval(interval) * 60;
1170
1201
  };
1171
1202
  var intervalSeconds = animationInterval ? animationInterval * 60 : getIntervalInSeconds(timeInterval.duration);
1203
+
1172
1204
  // Generate animation points for the current interval
1173
1205
  for (var i = currentAnimationTime; i <= unixAnimationEnd; i += intervalSeconds) {
1174
1206
  if (i >= unixIntervalStart && i <= unixIntervalEnd) {
@@ -1182,16 +1214,19 @@ var generateAnimationList = function generateAnimationList(unixAnimationStart, u
1182
1214
  break;
1183
1215
  }
1184
1216
  }
1217
+
1185
1218
  // Update the start time for the next interval
1186
1219
  currentAnimationTime = unixIntervalStart + intervalSeconds;
1187
1220
  });
1188
1221
  return animationList;
1189
1222
  };
1223
+
1190
1224
  /**
1191
1225
  * Parses the time dimension values string to an array of ISO8601 intervals
1192
1226
  * @param timeInterval
1193
1227
  * @returns An array of ISO8601 intervals
1194
1228
  */
1229
+
1195
1230
  var parseTimeDimToISO8601Interval = function parseTimeDimToISO8601Interval(timeInterval) {
1196
1231
  if (!(timeInterval !== null && timeInterval !== void 0 && timeInterval.includes('/'))) {
1197
1232
  return [];
@@ -1208,6 +1243,7 @@ var parseTimeDimToISO8601Interval = function parseTimeDimToISO8601Interval(timeI
1208
1243
  duration: duration === null || duration === void 0 ? void 0 : duration.trim()
1209
1244
  };
1210
1245
  });
1246
+
1211
1247
  // Filter out intervals with missing start, end or duration
1212
1248
  return intervalList.filter(function (interval) {
1213
1249
  return interval.startTime && interval.endTime && interval.duration;
@@ -1260,11 +1296,13 @@ var utils$2 = /*#__PURE__*/Object.freeze({
1260
1296
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
1261
1297
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1262
1298
  * */
1299
+
1263
1300
  /**
1264
1301
  * These actions causes circular dependency if they are defined in the reducer.ts file.
1265
1302
  * Therefor they are instead added to this file
1266
1303
  * https://redux-toolkit.js.org/usage/usage-guide#exporting-and-using-slices
1267
1304
  */
1305
+
1268
1306
  var mapChangeDimension = createAction('MAP_CHANGE_DIMENSION');
1269
1307
  var setMapPreset = createAction('SET_MAP_PRESET');
1270
1308
 
@@ -1285,6 +1323,7 @@ var setMapPreset = createAction('SET_MAP_PRESET');
1285
1323
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
1286
1324
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1287
1325
  * */
1326
+
1288
1327
  /**
1289
1328
  * Generic action to set the time.
1290
1329
  *
@@ -1295,6 +1334,7 @@ var setMapPreset = createAction('SET_MAP_PRESET');
1295
1334
  * }
1296
1335
  */
1297
1336
  var setTime = createAction('GENERIC_SETTIME');
1337
+
1298
1338
  /**
1299
1339
  * Generic action to set the bounding box.
1300
1340
  *
@@ -1330,16 +1370,13 @@ var setBbox = createAction('GENERIC_SETBBOX');
1330
1370
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
1331
1371
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1332
1372
  * */
1373
+
1333
1374
  /**
1334
1375
  * These actions are fired by the generic/listener.ts, based on generic actions and the synchronizationGroup state.
1335
1376
  *
1336
1377
  * These actions should not be used by components directly. Components should only use the generic actions.
1337
1378
  */
1338
- var setTimeSync = createAction('GENERIC_SYNC_SETTIME', function (setTimePayload,
1339
- // This payload is used to set the state in the syncgroup itself. This state is needed because other listeners (like the timeslider sync) might need this information to trigger new actions.
1340
- targets,
1341
- // The targets which will be updated by this action. It contains the payload as well.
1342
- groups) {
1379
+ var setTimeSync = createAction('GENERIC_SYNC_SETTIME', function (setTimePayload, targets, groups) {
1343
1380
  return {
1344
1381
  payload: {
1345
1382
  source: setTimePayload && setTime(setTimePayload),
@@ -1369,131 +1406,6 @@ var setLayerActionSync = createAction('GENERIC_SYNC_SETLAYERACTIONS', function (
1369
1406
  };
1370
1407
  });
1371
1408
 
1372
- var moveToTop = function moveToTop(list, element) {
1373
- var filteredList = list.filter(function (item) {
1374
- return item !== element;
1375
- });
1376
- var newOrder = [element].concat(_toConsumableArray(filteredList));
1377
- return newOrder;
1378
- };
1379
- var createUIDialogElement = function createUIDialogElement(_ref) {
1380
- var activeMapId = _ref.activeMapId,
1381
- type = _ref.type,
1382
- setOpen = _ref.setOpen,
1383
- _ref$source = _ref.source,
1384
- source = _ref$source === void 0 ? 'app' : _ref$source,
1385
- sourcePanelId = _ref.sourcePanelId;
1386
- return {
1387
- activeMapId: activeMapId,
1388
- isOpen: setOpen,
1389
- type: type,
1390
- source: source,
1391
- isLoading: false,
1392
- error: undefined,
1393
- sourcePanelId: sourcePanelId
1394
- };
1395
- };
1396
- var initialState$6 = {
1397
- order: [],
1398
- dialogs: {},
1399
- activeWindowId: undefined
1400
- };
1401
- var slice$7 = createSlice({
1402
- initialState: initialState$6,
1403
- name: 'uiReducer',
1404
- reducers: {
1405
- registerDialog: function registerDialog(draft, action) {
1406
- var type = action.payload.type;
1407
- var activeMapId = action.payload.mapId ? action.payload.mapId : '';
1408
- var setOpen = action.payload.setOpen ? action.payload.setOpen : false;
1409
- var source = action.payload.source ? action.payload.source : 'app';
1410
- if (!Object.keys(draft.dialogs).includes(type)) {
1411
- draft.dialogs[type] = createUIDialogElement({
1412
- activeMapId: activeMapId,
1413
- type: type,
1414
- setOpen: setOpen,
1415
- source: source
1416
- });
1417
- }
1418
- // register dialog to order
1419
- if (!draft.order.includes(type)) {
1420
- draft.order.push(type);
1421
- }
1422
- },
1423
- unregisterDialog: function unregisterDialog(draft, action) {
1424
- var type = action.payload.type;
1425
- if (draft.dialogs[type]) {
1426
- delete draft.dialogs[type];
1427
- draft.order = draft.order.filter(function (item) {
1428
- return item !== type;
1429
- });
1430
- }
1431
- },
1432
- setActiveMapIdForDialog: function setActiveMapIdForDialog(draft, action) {
1433
- var _action$payload = action.payload,
1434
- type = _action$payload.type,
1435
- mapId = _action$payload.mapId,
1436
- source = _action$payload.source;
1437
- if (!draft.dialogs[type]) {
1438
- return;
1439
- }
1440
- var isOpen = action.payload.setOpen !== undefined ? action.payload.setOpen : draft.dialogs[type].isOpen;
1441
- draft.dialogs[type].activeMapId = mapId;
1442
- draft.dialogs[type].isOpen = isOpen;
1443
- draft.dialogs[type].source = source;
1444
- if (isOpen) {
1445
- draft.order = moveToTop(draft.order, type);
1446
- }
1447
- },
1448
- setToggleOpenDialog: function setToggleOpenDialog(draft, action) {
1449
- var _action$payload2 = action.payload,
1450
- type = _action$payload2.type,
1451
- setOpen = _action$payload2.setOpen,
1452
- sourcePanelId = _action$payload2.sourcePanelId;
1453
- if (!draft.dialogs[type]) {
1454
- return;
1455
- }
1456
- draft.dialogs[type].isOpen = setOpen;
1457
- if (sourcePanelId) {
1458
- draft.dialogs[type].sourcePanelId = sourcePanelId;
1459
- }
1460
- if (setOpen) {
1461
- draft.order = moveToTop(draft.order, type);
1462
- }
1463
- },
1464
- orderDialog: function orderDialog(draft, action) {
1465
- var type = action.payload.type;
1466
- draft.order = moveToTop(draft.order, type);
1467
- },
1468
- setActiveWindowId: function setActiveWindowId(draft, action) {
1469
- var activeWindowId = action.payload.activeWindowId;
1470
- draft.activeWindowId = activeWindowId;
1471
- },
1472
- toggleIsLoadingDialog: function toggleIsLoadingDialog(draft, action) {
1473
- var _action$payload3 = action.payload,
1474
- isLoading = _action$payload3.isLoading,
1475
- type = _action$payload3.type;
1476
- draft.dialogs[type].isLoading = isLoading;
1477
- },
1478
- setErrorDialog: function setErrorDialog(draft, action) {
1479
- var _action$payload4 = action.payload,
1480
- error = _action$payload4.error,
1481
- type = _action$payload4.type;
1482
- draft.dialogs[type].error = error;
1483
- },
1484
- closeDialogsForMapId: function closeDialogsForMapId(draft, action) {
1485
- var mapId = action.payload.mapId;
1486
- Object.keys(draft.dialogs).forEach(function (key) {
1487
- if (draft.dialogs[key].activeMapId === mapId) {
1488
- draft.dialogs[key].isOpen = false;
1489
- }
1490
- });
1491
- }
1492
- }
1493
- });
1494
- var uiReducer = slice$7.reducer,
1495
- uiActions = slice$7.actions;
1496
-
1497
1409
  /* *
1498
1410
  * Licensed under the Apache License, Version 2.0 (the "License");
1499
1411
  * you may not use this file except in compliance with the License.
@@ -1511,13 +1423,13 @@ var uiReducer = slice$7.reducer,
1511
1423
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
1512
1424
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
1513
1425
  * */
1514
- var LayerStatus;
1515
- (function (LayerStatus) {
1426
+
1427
+ var LayerStatus = /*#__PURE__*/function (LayerStatus) {
1516
1428
  LayerStatus["default"] = "default";
1517
1429
  LayerStatus["error"] = "error";
1518
- })(LayerStatus || (LayerStatus = {}));
1519
- var LayerActionOrigin;
1520
- (function (LayerActionOrigin) {
1430
+ return LayerStatus;
1431
+ }({});
1432
+ var LayerActionOrigin = /*#__PURE__*/function (LayerActionOrigin) {
1521
1433
  LayerActionOrigin["layerManager"] = "layerManager";
1522
1434
  LayerActionOrigin["wmsLoader"] = "WMSLayerTreeConnect";
1523
1435
  LayerActionOrigin["ReactMapViewParseLayer"] = "ReactMapViewParseLayer";
@@ -1525,12 +1437,27 @@ var LayerActionOrigin;
1525
1437
  LayerActionOrigin["toggleAutoUpdateListener"] = "toggleAutoUpdateListener";
1526
1438
  LayerActionOrigin["unregisterMapListener"] = "unregisterMapListener";
1527
1439
  LayerActionOrigin["dataExplorer"] = "dataExplorer";
1528
- })(LayerActionOrigin || (LayerActionOrigin = {}));
1440
+ LayerActionOrigin["legend"] = "legend";
1441
+ return LayerActionOrigin;
1442
+ }({});
1529
1443
 
1530
- var types$2 = /*#__PURE__*/Object.freeze({
1444
+ /**
1445
+ * ReduxLayer is used to reflect the shape of the layer in the redux layers store.
1446
+ * It is a subset of Layer since some properties like the styles list now come from the service store.
1447
+ */
1448
+
1449
+ /**
1450
+ * Layer is used to define a layer with all its possible properties.
1451
+ */
1452
+
1453
+ // actions
1454
+
1455
+ // feature layer actions
1456
+
1457
+ var types$4 = /*#__PURE__*/Object.freeze({
1531
1458
  __proto__: null,
1532
- get LayerActionOrigin () { return LayerActionOrigin; },
1533
- get LayerStatus () { return LayerStatus; }
1459
+ LayerActionOrigin: LayerActionOrigin,
1460
+ LayerStatus: LayerStatus
1534
1461
  });
1535
1462
 
1536
1463
  /**
@@ -1597,13 +1524,14 @@ var produceDimensionActionForMapLayer = function produceDimensionActionForMapLay
1597
1524
  validSyncSelection: true
1598
1525
  });
1599
1526
  };
1527
+
1600
1528
  /**
1601
1529
  * For the given dimension, it creates a new draft state for all other (linked or synced) layers inside the map.
1602
1530
  * @param draft
1603
1531
  * @param dimension
1604
1532
  * @param mapId
1605
1533
  */
1606
- var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, mapId, layerIdFromAction /* Layer ID or null if not known */) {
1534
+ var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftStateForAllLayersForDimensionWithinMap(draft, dimension, mapId, layerIdFromAction) {
1607
1535
  if (!mapId) {
1608
1536
  return;
1609
1537
  }
@@ -1648,6 +1576,7 @@ var produceDraftStateForAllLayersForDimensionWithinMap = function produceDraftSt
1648
1576
  }
1649
1577
  });
1650
1578
  };
1579
+
1651
1580
  /**
1652
1581
  * Returns the list of dimensions without the time dimension
1653
1582
  * @param dimensions Dimension[]
@@ -1658,6 +1587,7 @@ var filterNonTimeDimensions = function filterNonTimeDimensions(dimensions) {
1658
1587
  return dim.name !== 'time';
1659
1588
  })) !== null && _dimensions$filter !== void 0 ? _dimensions$filter : [];
1660
1589
  };
1590
+
1661
1591
  /**
1662
1592
  * Returns the list of dimensions without the time dimension
1663
1593
  * @param dimensions Dimension[]
@@ -1670,6 +1600,7 @@ var filterCurrentValueFromDimensions = function filterCurrentValueFromDimensions
1670
1600
  return dim;
1671
1601
  })) !== null && _dimensions$map !== void 0 ? _dimensions$map : [];
1672
1602
  };
1603
+
1673
1604
  /**
1674
1605
  * The timeslider range is depending on values set via reference_time dimension.
1675
1606
  * This code will update minValue and maxValue accordingly based on the value of the reference_time.
@@ -1683,6 +1614,7 @@ var updateMinMaxValueWhenReferenceTimeChanges = function updateMinMaxValueWhenRe
1683
1614
  if (!(draftLayer !== null && draftLayer !== void 0 && draftLayer.id) || !(draftLayer !== null && draftLayer !== void 0 && draftLayer.dimensions) || dimensionValueToUpdate.name !== 'reference_time') {
1684
1615
  return;
1685
1616
  }
1617
+
1686
1618
  // If dimension reference_time is updated, we might have to update the time minValue and maxValue as well.
1687
1619
  var wmLayer = webmapUtils.getWMLayerById(draftLayer.id);
1688
1620
  if (wmLayer && wmLayer.dimensions.length >= 2) {
@@ -1746,7 +1678,7 @@ var createLayer = function createLayer(_ref) {
1746
1678
  useLatestReferenceTime: useLatestReferenceTime
1747
1679
  });
1748
1680
  };
1749
- var initialState$5 = {
1681
+ var initialState$6 = {
1750
1682
  byId: {},
1751
1683
  allIds: [],
1752
1684
  availableBaseLayers: {
@@ -1754,8 +1686,8 @@ var initialState$5 = {
1754
1686
  allIds: []
1755
1687
  }
1756
1688
  };
1757
- var slice$6 = createSlice({
1758
- initialState: initialState$5,
1689
+ var slice$7 = createSlice({
1690
+ initialState: initialState$6,
1759
1691
  name: 'layerReducer',
1760
1692
  reducers: {
1761
1693
  addLayer: function addLayer(draft, action) {
@@ -1902,6 +1834,7 @@ var slice$6 = createSlice({
1902
1834
  if (!checkValidLayersPayload(layers, mapId)) {
1903
1835
  return;
1904
1836
  }
1837
+
1905
1838
  /*
1906
1839
  All layer id's for the specified mapId should be removed.
1907
1840
  This is done by filtering the allId array. Keeping only the layer id's which don't exist in the byId object
@@ -1914,6 +1847,7 @@ var slice$6 = createSlice({
1914
1847
  }
1915
1848
  return true;
1916
1849
  });
1850
+
1917
1851
  /*
1918
1852
  Here we set the layers for the mapId from the action. byId and allIds is updated.
1919
1853
  */
@@ -1932,6 +1866,7 @@ var slice$6 = createSlice({
1932
1866
  var filtererdBaseLayers = layers.filter(function (layer) {
1933
1867
  return layer.layerType === LayerType.baseLayer || layer.layerType === LayerType.overLayer;
1934
1868
  });
1869
+
1935
1870
  // filter for unique layerTypes
1936
1871
  var layerTypes = [];
1937
1872
  filtererdBaseLayers.forEach(function (layer) {
@@ -1942,6 +1877,7 @@ var slice$6 = createSlice({
1942
1877
  layerTypes.push(layer.layerType);
1943
1878
  }
1944
1879
  });
1880
+
1945
1881
  // remove current layers with same type as one of the passed layers
1946
1882
  draft.allIds = draft.allIds.filter(function (layerId) {
1947
1883
  if (draft.byId[layerId] && layerTypes.includes(draft.byId[layerId].layerType) && draft.byId[layerId].mapId === mapId) {
@@ -1996,6 +1932,7 @@ var slice$6 = createSlice({
1996
1932
  },
1997
1933
  addAvailableBaseLayers: function addAvailableBaseLayers(draft, action) {
1998
1934
  var layers = action.payload.layers;
1935
+
1999
1936
  // add new available baselayers
2000
1937
  layers.forEach(function (layer) {
2001
1938
  if (layer.layerType !== LayerType.baseLayer || draft.availableBaseLayers.byId[layer.id] || !layer.mapId) {
@@ -2013,6 +1950,7 @@ var slice$6 = createSlice({
2013
1950
  var _action$payload13 = action.payload,
2014
1951
  layers = _action$payload13.layers,
2015
1952
  mapId = _action$payload13.mapId;
1953
+
2016
1954
  // remove current baselayers for passed map
2017
1955
  draft.availableBaseLayers.allIds = draft.availableBaseLayers.allIds.filter(function (layerId) {
2018
1956
  var _draft$availableBaseL;
@@ -2022,6 +1960,7 @@ var slice$6 = createSlice({
2022
1960
  }
2023
1961
  return true;
2024
1962
  });
1963
+
2025
1964
  // add new available baselayers
2026
1965
  layers.forEach(function (layer) {
2027
1966
  if (layer.layerType !== LayerType.baseLayer || !layer.mapId) {
@@ -2058,6 +1997,7 @@ var slice$6 = createSlice({
2058
1997
  return;
2059
1998
  }
2060
1999
  var layer = draft.byId[layerDimensions.layerId];
2000
+
2061
2001
  /* Find all other layers with the same name and service, and update these at once (atomic update) */
2062
2002
  var layersToUpdate = Object.values(draft.byId).filter(function (otherLayer) {
2063
2003
  return (otherLayer === null || otherLayer === void 0 ? void 0 : otherLayer.name) === (layer === null || layer === void 0 ? void 0 : layer.name) && (otherLayer === null || otherLayer === void 0 ? void 0 : otherLayer.service) === (layer === null || layer === void 0 ? void 0 : layer.service) && (otherLayer === null || otherLayer === void 0 ? void 0 : otherLayer.id);
@@ -2071,10 +2011,12 @@ var slice$6 = createSlice({
2071
2011
  var wmLayer = webmapUtils.getWMLayerById(layerId);
2072
2012
  (_reduxLayer$dimension = reduxLayer.dimensions) !== null && _reduxLayer$dimension !== void 0 ? _reduxLayer$dimension : reduxLayer.dimensions = [];
2073
2013
  var reduxDimensions = reduxLayer.dimensions;
2014
+
2074
2015
  /* Now update or insert the dimension for each layer */
2075
2016
  layerDimensions.dimensions.forEach(function (newLayerDimension) {
2076
2017
  /* Find the wmDimension */
2077
2018
  var wmDimension = wmLayer === null || wmLayer === void 0 ? void 0 : wmLayer.getDimension(newLayerDimension.name);
2019
+
2078
2020
  /* This will set the new range of start/stop values for this dimension, making getClosestValue work properly */
2079
2021
  wmDimension === null || wmDimension === void 0 || wmDimension.reInitializeValues(newLayerDimension.values);
2080
2022
  var existingDimension = reduxDimensions.find(function (dim) {
@@ -2128,6 +2070,7 @@ var slice$6 = createSlice({
2128
2070
  reduxDimensions.push(_objectSpread2({}, newLayerDimension));
2129
2071
  }
2130
2072
  });
2073
+
2131
2074
  // Ensure that the time range is correctly set based on the current reference time value
2132
2075
  var timeDimension = reduxDimensions.find(function (layerDim) {
2133
2076
  return layerDim.name === 'time';
@@ -2142,6 +2085,7 @@ var slice$6 = createSlice({
2142
2085
  if (wmTimeDimension && wmRefTimeDimension) {
2143
2086
  wmTimeDimension === null || wmTimeDimension === void 0 || wmTimeDimension.setTimeValuesForReferenceTime(refTimeDimension.currentValue, wmRefTimeDimension);
2144
2087
  }
2088
+
2145
2089
  // Synchronize the updated redux currentValues back to wmLayers time dim.
2146
2090
  reduxDimensions.forEach(function (dim) {
2147
2091
  dim.name && wmLayer.setDimension(dim.name, dim.currentValue);
@@ -2301,13 +2245,26 @@ var slice$6 = createSlice({
2301
2245
  },
2302
2246
  hideLayerInfo: function hideLayerInfo(draft) {
2303
2247
  delete draft.activeLayerInfo;
2248
+ },
2249
+ SetLayerLegendVisibilityPayload: function SetLayerLegendVisibilityPayload(draft, action) {
2250
+ var _action$payload22 = action.payload,
2251
+ layerId = _action$payload22.layerId,
2252
+ showLayerLegend = _action$payload22.showLayerLegend;
2253
+ var layer = draft.byId[layerId];
2254
+ if (!layer) {
2255
+ return;
2256
+ }
2257
+ if (!layer.showLayerLegend) {
2258
+ layer.showLayerLegend = true;
2259
+ }
2260
+ draft.byId[layerId].showLayerLegend = showLayerLegend;
2304
2261
  }
2305
2262
  },
2306
2263
  extraReducers: function extraReducers(builder) {
2307
2264
  builder.addCase(setTimeSync, function (draft, action) {
2308
- var _action$payload22 = action.payload,
2309
- targetsFromAction = _action$payload22.targets,
2310
- source = _action$payload22.source;
2265
+ var _action$payload23 = action.payload,
2266
+ targetsFromAction = _action$payload23.targets,
2267
+ source = _action$payload23.source;
2311
2268
  /* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
2312
2269
  var targets = [];
2313
2270
  if (source) {
@@ -2337,9 +2294,9 @@ var slice$6 = createSlice({
2337
2294
  * These targets can be used as payloads in new Layer actions.
2338
2295
  * These actions are here handled via the layer reducer, as it is the same logic
2339
2296
  */
2340
- var _action$payload23 = action.payload,
2341
- targets = _action$payload23.targets,
2342
- source = _action$payload23.source;
2297
+ var _action$payload24 = action.payload,
2298
+ targets = _action$payload24.targets,
2299
+ source = _action$payload24.source;
2343
2300
  return targets.reduce(function (prevState, target) {
2344
2301
  var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
2345
2302
  var action = {
@@ -2367,8 +2324,8 @@ var slice$6 = createSlice({
2367
2324
  });
2368
2325
  }
2369
2326
  });
2370
- var layerReducer = slice$6.reducer,
2371
- layerActions = slice$6.actions;
2327
+ var layerReducer = slice$7.reducer,
2328
+ layerActions = slice$7.actions;
2372
2329
 
2373
2330
  /**
2374
2331
  * Checks if the layer id is already taken in one of the maps.
@@ -2387,6 +2344,7 @@ var checkIfMapLayerIdIsAlreadyTaken = function checkIfMapLayerIdIsAlreadyTaken(s
2387
2344
  return doesLayeridExist(map.mapLayers) || doesLayeridExist(map.overLayers) || doesLayeridExist(map.baseLayers) || doesLayeridExist(map.featureLayers);
2388
2345
  });
2389
2346
  };
2347
+
2390
2348
  /**
2391
2349
  * Addes id's to the layer object. All layers need to have an id for referring.
2392
2350
  * @param layers
@@ -2412,12 +2370,18 @@ var createLayersWithIds = function createLayersWithIds(state, layers) {
2412
2370
  }
2413
2371
  });
2414
2372
  };
2415
- var initialState$4 = {
2373
+ var layerHasTimeDimension = function layerHasTimeDimension(layer) {
2374
+ var _layer$dimensions;
2375
+ return !!((_layer$dimensions = layer.dimensions) !== null && _layer$dimensions !== void 0 && _layer$dimensions.some(function (dimension) {
2376
+ return dimension.name === 'time';
2377
+ }));
2378
+ };
2379
+ var initialState$5 = {
2416
2380
  byId: {},
2417
2381
  allIds: []
2418
2382
  };
2419
- var slice$5 = createSlice({
2420
- initialState: initialState$4,
2383
+ var slice$6 = createSlice({
2384
+ initialState: initialState$5,
2421
2385
  name: 'mapReducer',
2422
2386
  reducers: {
2423
2387
  registerMap: function registerMap(draft, action) {
@@ -2472,6 +2436,7 @@ var slice$5 = createSlice({
2472
2436
  return;
2473
2437
  }
2474
2438
  draft.byId[mapId].isAnimating = true;
2439
+
2475
2440
  // Animation is defined by one of the following:
2476
2441
  // - start, end and interval for a continuous animation loop with constant interval
2477
2442
  // - timeList, for a custom timeList
@@ -2763,12 +2728,25 @@ var slice$5 = createSlice({
2763
2728
  return;
2764
2729
  }
2765
2730
  draft.byId[mapId].isClockVisible = isClockVisible;
2731
+ if (!isClockVisible) {
2732
+ // close options menu when clock is closed
2733
+ draft.byId[mapId].isClockOptionsMenuVisible = false;
2734
+ }
2766
2735
  },
2767
- setClockPositionSize: function setClockPositionSize(draft, action) {
2736
+ toggleClockOptions: function toggleClockOptions(draft, action) {
2768
2737
  var _action$payload29 = action.payload,
2769
2738
  mapId = _action$payload29.mapId,
2770
- position = _action$payload29.position,
2771
- size = _action$payload29.size;
2739
+ isClockOptionsMenuVisible = _action$payload29.isClockOptionsMenuVisible;
2740
+ if (!draft.byId[mapId]) {
2741
+ return;
2742
+ }
2743
+ draft.byId[mapId].isClockOptionsMenuVisible = isClockOptionsMenuVisible;
2744
+ },
2745
+ setClockPositionSize: function setClockPositionSize(draft, action) {
2746
+ var _action$payload30 = action.payload,
2747
+ mapId = _action$payload30.mapId,
2748
+ position = _action$payload30.position,
2749
+ size = _action$payload30.size;
2772
2750
  if (!draft.byId[mapId]) {
2773
2751
  return;
2774
2752
  }
@@ -2782,10 +2760,10 @@ var slice$5 = createSlice({
2782
2760
  },
2783
2761
  extraReducers: function extraReducers(builder) {
2784
2762
  builder.addCase(layerActions.addLayer, function (draft, action) {
2785
- var _action$payload30 = action.payload,
2786
- layerId = _action$payload30.layerId,
2787
- mapId = _action$payload30.mapId,
2788
- layer = _action$payload30.layer;
2763
+ var _action$payload31 = action.payload,
2764
+ layerId = _action$payload31.layerId,
2765
+ mapId = _action$payload31.mapId,
2766
+ layer = _action$payload31.layer;
2789
2767
  if (!draft.byId[mapId]) {
2790
2768
  return;
2791
2769
  }
@@ -2793,21 +2771,21 @@ var slice$5 = createSlice({
2793
2771
  console.warn("Warning: Layer id ".concat(layerId, " was already taken"));
2794
2772
  return;
2795
2773
  }
2796
- if (!draft.byId[mapId].mapLayers.length) {
2774
+ var isFeatureLayer = (layer === null || layer === void 0 ? void 0 : layer.layerType) === LayerType.featureLayer;
2775
+ if (!isFeatureLayer && !draft.byId[mapId].autoUpdateLayerId && !draft.byId[mapId].autoTimeStepLayerId && layerHasTimeDimension(layer)) {
2797
2776
  draft.byId[mapId].autoUpdateLayerId = layerId;
2798
2777
  draft.byId[mapId].autoTimeStepLayerId = layerId;
2799
2778
  }
2800
- var isFeatureLayer = (layer === null || layer === void 0 ? void 0 : layer.layerType) === LayerType.featureLayer;
2801
2779
  if (isFeatureLayer) {
2802
2780
  draft.byId[mapId].featureLayers.unshift(layerId);
2803
2781
  } else {
2804
2782
  draft.byId[mapId].mapLayers.unshift(layerId);
2805
2783
  }
2806
2784
  }).addCase(layerActions.duplicateMapLayer, function (draft, action) {
2807
- var _action$payload31 = action.payload,
2808
- newLayerId = _action$payload31.newLayerId,
2809
- oldLayerId = _action$payload31.oldLayerId,
2810
- mapId = _action$payload31.mapId;
2785
+ var _action$payload32 = action.payload,
2786
+ newLayerId = _action$payload32.newLayerId,
2787
+ oldLayerId = _action$payload32.oldLayerId,
2788
+ mapId = _action$payload32.mapId;
2811
2789
  if (!draft.byId[mapId]) {
2812
2790
  return;
2813
2791
  }
@@ -2824,10 +2802,10 @@ var slice$5 = createSlice({
2824
2802
  draft.byId[mapId].featureLayers.unshift(newLayerId);
2825
2803
  }
2826
2804
  }).addCase(layerActions.addBaseLayer, function (draft, action) {
2827
- var _action$payload32 = action.payload,
2828
- layer = _action$payload32.layer,
2829
- layerId = _action$payload32.layerId,
2830
- mapId = _action$payload32.mapId;
2805
+ var _action$payload33 = action.payload,
2806
+ layer = _action$payload33.layer,
2807
+ layerId = _action$payload33.layerId,
2808
+ mapId = _action$payload33.mapId;
2831
2809
  if (!draft.byId[mapId]) {
2832
2810
  return;
2833
2811
  }
@@ -2843,23 +2821,23 @@ var slice$5 = createSlice({
2843
2821
  draft.byId[mapId].overLayers.unshift(layerId);
2844
2822
  }
2845
2823
  }).addCase(layerActions.setLayers, function (draft, action) {
2824
+ var _layersWithIds$find;
2846
2825
  var mapId = action.payload.mapId;
2847
2826
  var layersWithIds = createLayersWithIds(draft, action.payload.layers);
2848
2827
  var layerIds = layersWithIds.map(function (_ref) {
2849
2828
  var id = _ref.id;
2850
2829
  return id;
2851
2830
  });
2852
- var _layerIds = _slicedToArray(layerIds, 1),
2853
- activeLayerId = _layerIds[0];
2831
+ var activeLayerId = (_layersWithIds$find = layersWithIds.find(layerHasTimeDimension)) === null || _layersWithIds$find === void 0 ? void 0 : _layersWithIds$find.id;
2854
2832
  if (draft.byId[mapId]) {
2855
2833
  draft.byId[mapId].mapLayers = layerIds;
2856
2834
  draft.byId[mapId].autoUpdateLayerId = activeLayerId;
2857
2835
  draft.byId[mapId].autoTimeStepLayerId = activeLayerId;
2858
2836
  }
2859
2837
  }).addCase(layerActions.setBaseLayers, function (draft, action) {
2860
- var _action$payload33 = action.payload,
2861
- layers = _action$payload33.layers,
2862
- mapId = _action$payload33.mapId;
2838
+ var _action$payload34 = action.payload,
2839
+ layers = _action$payload34.layers,
2840
+ mapId = _action$payload34.mapId;
2863
2841
  // Split into base and overlayers
2864
2842
  var baseLayers = [];
2865
2843
  var overLayers = [];
@@ -2889,9 +2867,9 @@ var slice$5 = createSlice({
2889
2867
  }
2890
2868
  }
2891
2869
  }).addCase(layerActions.layerDelete, function (draft, action) {
2892
- var _action$payload34 = action.payload,
2893
- mapId = _action$payload34.mapId,
2894
- layerId = _action$payload34.layerId;
2870
+ var _action$payload35 = action.payload,
2871
+ mapId = _action$payload35.mapId,
2872
+ layerId = _action$payload35.layerId;
2895
2873
  var map = draft.byId[mapId];
2896
2874
  if (!map) {
2897
2875
  return;
@@ -2899,6 +2877,7 @@ var slice$5 = createSlice({
2899
2877
  map.mapLayers = map.mapLayers.filter(function (id) {
2900
2878
  return id !== layerId;
2901
2879
  });
2880
+
2902
2881
  // if auto layer is deleted, change auto layer ids
2903
2882
  if (!map.mapLayers.length) {
2904
2883
  map.autoUpdateLayerId = undefined;
@@ -2917,9 +2896,9 @@ var slice$5 = createSlice({
2917
2896
  return id !== layerId;
2918
2897
  });
2919
2898
  }).addCase(layerActions.baseLayerDelete, function (draft, action) {
2920
- var _action$payload35 = action.payload,
2921
- mapId = _action$payload35.mapId,
2922
- layerId = _action$payload35.layerId;
2899
+ var _action$payload36 = action.payload,
2900
+ mapId = _action$payload36.mapId,
2901
+ layerId = _action$payload36.layerId;
2923
2902
  if (!draft.byId[mapId]) {
2924
2903
  return;
2925
2904
  }
@@ -2930,14 +2909,14 @@ var slice$5 = createSlice({
2930
2909
  return id !== layerId;
2931
2910
  });
2932
2911
  }).addCase(layerActions.layerChangeDimension, function (draft, action) {
2933
- var _action$payload36 = action.payload,
2934
- layerId = _action$payload36.layerId,
2935
- dimension = _action$payload36.dimension;
2912
+ var _action$payload37 = action.payload,
2913
+ layerId = _action$payload37.layerId,
2914
+ dimension = _action$payload37.dimension;
2936
2915
  produceDraftStateSetMapDimensionFromLayerChangeDimension(draft, layerId, dimension);
2937
2916
  }).addCase(setTimeSync, function (draft, action) {
2938
- var _action$payload37 = action.payload,
2939
- targetsFromAction = _action$payload37.targets,
2940
- source = _action$payload37.source;
2917
+ var _action$payload38 = action.payload,
2918
+ targetsFromAction = _action$payload38.targets,
2919
+ source = _action$payload38.source;
2941
2920
  /* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
2942
2921
  var targets = [];
2943
2922
  if (source) {
@@ -2956,28 +2935,34 @@ var slice$5 = createSlice({
2956
2935
  if (value !== null && value !== void 0 && value.timeSliderSpan) {
2957
2936
  produceTimeSliderTimeSpan(draft, targetId, value.timeSliderSpan);
2958
2937
  }
2938
+
2959
2939
  // SetTimeSliderCenterTime
2960
2940
  if (value !== null && value !== void 0 && value.timeSliderCenterTime) {
2961
2941
  draft.byId[targetId].timeSliderCenterTime = value.timeSliderCenterTime;
2962
2942
  }
2943
+
2963
2944
  // SetTimeSliderStep
2964
2945
  if (value !== null && value !== void 0 && value.timeSliderStep) {
2965
2946
  draft.byId[targetId].timeStep = value.timeSliderStep;
2966
2947
  // When timestep is synced between slider, isTimestepAuto should be set to false.
2967
2948
  draft.byId[targetId].isTimestepAuto = false;
2968
2949
  }
2950
+
2969
2951
  // SetAnimationStartTime
2970
2952
  if (value !== null && value !== void 0 && value.timeSliderAnimationStartTime) {
2971
2953
  draft.byId[targetId].animationStartTime = value.timeSliderAnimationStartTime;
2972
2954
  }
2955
+
2973
2956
  // SetAnimationEndTime
2974
2957
  if (value !== null && value !== void 0 && value.timeSliderAnimationEndTime) {
2975
2958
  draft.byId[targetId].animationEndTime = value.timeSliderAnimationEndTime;
2976
2959
  }
2960
+
2977
2961
  // SetAnimationDelay
2978
2962
  if (value !== null && value !== void 0 && value.timeSliderAnimationDelay) {
2979
2963
  draft.byId[targetId].animationDelay = value.timeSliderAnimationDelay;
2980
2964
  }
2965
+
2981
2966
  // SetTime / update actual current value
2982
2967
  if (value !== null && value !== void 0 && value.currentTime) {
2983
2968
  var dimension = {
@@ -2990,9 +2975,9 @@ var slice$5 = createSlice({
2990
2975
  }
2991
2976
  });
2992
2977
  }).addCase(setBboxSync, function (draft, action) {
2993
- var _action$payload38 = action.payload,
2994
- targetsFromAction = _action$payload38.targets,
2995
- source = _action$payload38.source;
2978
+ var _action$payload39 = action.payload,
2979
+ targetsFromAction = _action$payload39.targets,
2980
+ source = _action$payload39.source;
2996
2981
  /* Because we want backwards compatibility with the previous code, we also need to listen to the original source action */
2997
2982
  var targets = [];
2998
2983
  if (source) {
@@ -3024,9 +3009,9 @@ var slice$5 = createSlice({
3024
3009
  * These targets can be used as payloads in new Layer actions.
3025
3010
  * These actions are here handled via the layer reducer, as it is the same logic
3026
3011
  */
3027
- var _action$payload39 = action.payload,
3028
- targets = _action$payload39.targets,
3029
- source = _action$payload39.source;
3012
+ var _action$payload40 = action.payload,
3013
+ targets = _action$payload40.targets,
3014
+ source = _action$payload40.source;
3030
3015
  return targets.reduce(function (prevState, target) {
3031
3016
  var actionType = (source === null || source === void 0 ? void 0 : source.type) || 'GENERIC_SYNC_SETLAYERACTIONS';
3032
3017
  var action = {
@@ -3048,9 +3033,9 @@ var slice$5 = createSlice({
3048
3033
  });
3049
3034
  return draft;
3050
3035
  }).addCase(mapChangeDimension, function (draft, action) {
3051
- var _action$payload40 = action.payload,
3052
- mapId = _action$payload40.mapId,
3053
- dimensionFromAction = _action$payload40.dimension;
3036
+ var _action$payload41 = action.payload,
3037
+ mapId = _action$payload41.mapId,
3038
+ dimensionFromAction = _action$payload41.dimension;
3054
3039
  produceDraftStateSetWebMapDimension(draft, mapId, dimensionFromAction, true);
3055
3040
  }).addCase(setMapPreset, function (draft, action) {
3056
3041
  var mapId = action.payload.mapId;
@@ -3069,22 +3054,14 @@ var slice$5 = createSlice({
3069
3054
  draft.byId[mapId].timeStep = undefined;
3070
3055
  draft.byId[mapId].animationDelay = defaultAnimationDelayAtStart;
3071
3056
  draft.byId[mapId].dockedLayerManagerSize = '';
3072
- }).addCase(uiActions.registerDialog, function (draft, action) {
3073
- var _action$payload41 = action.payload,
3074
- mapId = _action$payload41.mapId,
3075
- type = _action$payload41.type;
3076
- if (!draft.byId[mapId]) {
3077
- return;
3078
- }
3079
- draft.byId[mapId].legendId = type;
3080
3057
  });
3081
3058
  }
3082
3059
  });
3083
- var mapActions = _objectSpread2(_objectSpread2({}, slice$5.actions), {}, {
3060
+ var mapActions = _objectSpread2(_objectSpread2({}, slice$6.actions), {}, {
3084
3061
  setMapPreset: setMapPreset,
3085
3062
  mapChangeDimension: mapChangeDimension
3086
3063
  });
3087
- var mapReducer = slice$5.reducer;
3064
+ var mapReducer = slice$6.reducer;
3088
3065
 
3089
3066
  /* *
3090
3067
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -3103,6 +3080,7 @@ var mapReducer = slice$5.reducer;
3103
3080
  * Copyright 2025 - Finnish Meteorological Institute (FMI)
3104
3081
  * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
3105
3082
  * */
3083
+
3106
3084
  var IS_LEGEND_OPEN_BY_DEFAULT = false;
3107
3085
  var SECONDS_IN_DAY = 86400;
3108
3086
  var SECONDS_IN_HOUR = 3600;
@@ -3124,6 +3102,7 @@ var SECONDS_IN_HOUR = 3600;
3124
3102
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
3125
3103
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3126
3104
  * */
3105
+
3127
3106
  /* Type constants */
3128
3107
  var SYNCGROUPS_TYPE_SETTIME = 'SYNCGROUPS_TYPE_SETTIME';
3129
3108
  var SYNCGROUPS_TYPE_SETBBOX = 'SYNCGROUPS_TYPE_SETBBOX';
@@ -3155,6 +3134,7 @@ var constants$2 = /*#__PURE__*/Object.freeze({
3155
3134
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
3156
3135
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3157
3136
  * */
3137
+
3158
3138
  /**
3159
3139
  * The removeInPlace() method modifies an array in place, by removing elements that pass the test implemented by the provided function.
3160
3140
  *
@@ -3174,11 +3154,12 @@ var removeInPlace = function removeInPlace(inDraftArray, condition) {
3174
3154
  index += 1;
3175
3155
  }
3176
3156
  });
3157
+
3177
3158
  // eslint-disable-next-line no-param-reassign
3178
3159
  inDraftArray.length = index;
3179
3160
  };
3180
3161
 
3181
- var initialState$3 = {
3162
+ var initialState$4 = {
3182
3163
  sources: {
3183
3164
  byId: {},
3184
3165
  allIds: []
@@ -3207,8 +3188,8 @@ var initialState$3 = {
3207
3188
  },
3208
3189
  isTimeScrollingEnabled: false
3209
3190
  };
3210
- var slice$4 = createSlice({
3211
- initialState: initialState$3,
3191
+ var slice$5 = createSlice({
3192
+ initialState: initialState$4,
3212
3193
  name: 'synchronizationGroupsReducer',
3213
3194
  reducers: {
3214
3195
  /** Sets the links map.
@@ -3283,6 +3264,7 @@ var slice$4 = createSlice({
3283
3264
  };
3284
3265
  draft.sources.allIds.push(id);
3285
3266
  }
3267
+
3286
3268
  /* Now try to initialize with the correct values from the state */
3287
3269
  draft.groups.allIds.forEach(function (groupId) {
3288
3270
  var syncronizationGroup = draft.groups.byId[groupId];
@@ -3409,7 +3391,7 @@ var slice$4 = createSlice({
3409
3391
  });
3410
3392
  },
3411
3393
  syncGroupClear: function syncGroupClear() {
3412
- return initialState$3;
3394
+ return initialState$4;
3413
3395
  },
3414
3396
  syncGroupSetViewState: function syncGroupSetViewState(draft, action) {
3415
3397
  var viewState = action.payload.viewState;
@@ -3471,7 +3453,7 @@ var setBboxOrTimeSync = function setBboxOrTimeSync(draft, action) {
3471
3453
  });
3472
3454
  }
3473
3455
  };
3474
- var _slice$actions = slice$4.actions,
3456
+ var _slice$actions = slice$5.actions,
3475
3457
  syncGroupAddGroup = _slice$actions.syncGroupAddGroup,
3476
3458
  syncGroupAddSource = _slice$actions.syncGroupAddSource,
3477
3459
  syncGroupAddTarget = _slice$actions.syncGroupAddTarget;
@@ -3481,12 +3463,13 @@ var _slice$actions = slice$4.actions,
3481
3463
  var syncGroupRemoveSource = _slice$actions.syncGroupRemoveSource;
3482
3464
  _slice$actions.syncGroupRemoveTarget;
3483
3465
  _slice$actions.syncGroupSetViewState;
3484
- var syncGroupsReducer = slice$4.reducer,
3485
- syncGroupsActions = slice$4.actions;
3466
+ var syncGroupsReducer = slice$5.reducer,
3467
+ syncGroupsActions = slice$5.actions;
3486
3468
 
3487
3469
  var syncGroupStore = function syncGroupStore(store) {
3488
3470
  return store.syncGroups || null;
3489
3471
  };
3472
+
3490
3473
  /**
3491
3474
  * Gets synchronization group state
3492
3475
  *
@@ -3538,9 +3521,16 @@ var getTargets = createSelector([syncGroupStore, function (syncGroupStore, paylo
3538
3521
  var source = syncronizationGroup.targets.byId[payload.sourceId];
3539
3522
  /* If the source is part of the target list, and is linked, continue syncing the other targets */
3540
3523
  if (source !== null && source !== void 0 && source.linked) {
3524
+ var hasLinkedPeer = syncronizationGroup.targets.allIds.some(function (targetId) {
3525
+ var _syncronizationGroup$;
3526
+ return targetId !== payload.sourceId && ((_syncronizationGroup$ = syncronizationGroup.targets.byId[targetId]) === null || _syncronizationGroup$ === void 0 ? void 0 : _syncronizationGroup$.linked);
3527
+ });
3528
+ if (!hasLinkedPeer) {
3529
+ return;
3530
+ }
3541
3531
  syncronizationGroup.targets.allIds.forEach(function (targetId) {
3542
3532
  var target = syncronizationGroup.targets.byId[targetId];
3543
- if (target.linked && !targetsInActionPayload[targetId]) {
3533
+ if (targetId !== payload.sourceId && target.linked && !targetsInActionPayload[targetId]) {
3544
3534
  /* Remember that we have already added this target in the action payloads, prevents adding it twice */
3545
3535
  targetsInActionPayload[targetId] = true;
3546
3536
  /* Compose the payload */
@@ -3637,6 +3627,45 @@ var selectors$6 = /*#__PURE__*/Object.freeze({
3637
3627
  syncGroupStore: syncGroupStore
3638
3628
  });
3639
3629
 
3630
+ /* *
3631
+ * Licensed under the Apache License, Version 2.0 (the "License");
3632
+ * you may not use this file except in compliance with the License.
3633
+ * You may obtain a copy of the License at
3634
+ *
3635
+ * http://www.apache.org/licenses/LICENSE-2.0
3636
+ *
3637
+ * Unless required by applicable law or agreed to in writing, software
3638
+ * distributed under the License is distributed on an "AS IS" BASIS,
3639
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3640
+ * See the License for the specific language governing permissions and
3641
+ * limitations under the License.
3642
+ *
3643
+ * Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
3644
+ * Copyright 2026 - Finnish Meteorological Institute (FMI)
3645
+ * Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
3646
+ * */
3647
+
3648
+ var constructSyncSourceDisplayName = function constructSyncSourceDisplayName(sourceId, viewMeta, fallbackName) {
3649
+ var _viewMeta$title;
3650
+ var rawTitle = viewMeta === null || viewMeta === void 0 || (_viewMeta$title = viewMeta.title) === null || _viewMeta$title === void 0 ? void 0 : _viewMeta$title.trim();
3651
+ if (rawTitle === sourceId) {
3652
+ return sourceId;
3653
+ }
3654
+ var title = rawTitle && rawTitle !== sourceId ? rawTitle : undefined;
3655
+ if (!title) {
3656
+ return fallbackName;
3657
+ }
3658
+ var isSavedView = !!(viewMeta !== null && viewMeta !== void 0 && viewMeta.id) && viewMeta.id !== sourceId;
3659
+ if (isSavedView) {
3660
+ return title;
3661
+ }
3662
+ var isDefaultUnsavedTitle = /^New .+ preset$/i.test(title);
3663
+ if (isDefaultUnsavedTitle) {
3664
+ return title.includes(sourceId) ? title : "".concat(title, " (").concat(sourceId, ")");
3665
+ }
3666
+ return title;
3667
+ };
3668
+
3640
3669
  /* *
3641
3670
  * Licensed under the Apache License, Version 2.0 (the "License");
3642
3671
  * you may not use this file except in compliance with the License.
@@ -3654,6 +3683,7 @@ var selectors$6 = /*#__PURE__*/Object.freeze({
3654
3683
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
3655
3684
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3656
3685
  * */
3686
+
3657
3687
  var emptyState = {
3658
3688
  timeslider: {
3659
3689
  groups: [],
@@ -3677,12 +3707,13 @@ var groupTypes = [{
3677
3707
  syncType: 'SYNCGROUPS_TYPE_SETBBOX',
3678
3708
  groupType: 'zoompane'
3679
3709
  }];
3710
+
3680
3711
  /*
3681
3712
  _____ Creates viewState _____
3682
3713
  - Runs Each time viewState is created:
3683
3714
  - Fill arrays inside initialState with objects containing new values from Redux
3684
3715
  */
3685
- var createSyncGroupViewState = function createSyncGroupViewState(groups, sources) {
3716
+ var createSyncGroupViewState = function createSyncGroupViewState(groups, sources, viewsById) {
3686
3717
  var initialState = produce(emptyState, function (draft) {
3687
3718
  /*
3688
3719
  _____ 1. Fill groups _____
@@ -3713,7 +3744,7 @@ var createSyncGroupViewState = function createSyncGroupViewState(groups, sources
3713
3744
  if (sources.byId[id].types.includes(syncType)) {
3714
3745
  draft[groupType].sourcesById.push({
3715
3746
  id: id,
3716
- name: id
3747
+ name: constructSyncSourceDisplayName(id, viewsById === null || viewsById === void 0 ? void 0 : viewsById[id], id)
3717
3748
  });
3718
3749
  }
3719
3750
  });
@@ -3727,7 +3758,12 @@ var groups = function groups(store) {
3727
3758
  var sources = function sources(store) {
3728
3759
  return store.syncGroups.sources;
3729
3760
  };
3730
- var createSyncGroupViewStateSelector = createSelector(groups, sources, createSyncGroupViewState);
3761
+ var workspaceViewsById = function workspaceViewsById(store) {
3762
+ var _storeWithWorkspace$w;
3763
+ var storeWithWorkspace = store;
3764
+ return (_storeWithWorkspace$w = storeWithWorkspace.workspace) === null || _storeWithWorkspace$w === void 0 || (_storeWithWorkspace$w = _storeWithWorkspace$w.views) === null || _storeWithWorkspace$w === void 0 ? void 0 : _storeWithWorkspace$w.byId;
3765
+ };
3766
+ var createSyncGroupViewStateSelector = createSelector(groups, sources, workspaceViewsById, createSyncGroupViewState);
3731
3767
 
3732
3768
  var selector = /*#__PURE__*/Object.freeze({
3733
3769
  __proto__: null,
@@ -3741,49 +3777,64 @@ syncGroupsListener.startListening({
3741
3777
  matcher: isAnyOf(syncGroupsActions.syncGroupAddTarget, syncGroupsActions.syncGroupLinkTarget),
3742
3778
  effect: function () {
3743
3779
  var _effect = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref, listenerApi) {
3744
- var payload, groupId, linked, targetToUpdate, group;
3780
+ var payload, type, _ref2, groupId, linked, targetToUpdate, group;
3745
3781
  return _regeneratorRuntime().wrap(function _callee$(_context) {
3746
3782
  while (1) switch (_context.prev = _context.next) {
3747
3783
  case 0:
3748
- payload = _ref.payload;
3784
+ payload = _ref.payload, type = _ref.type;
3749
3785
  listenerApi.cancelActiveListeners();
3750
- groupId = payload.groupId, linked = payload.linked, targetToUpdate = payload.targetId;
3786
+ _ref2 = payload, groupId = _ref2.groupId, linked = _ref2.linked, targetToUpdate = _ref2.targetId;
3751
3787
  group = getSynchronizationGroup(listenerApi.getState(), groupId);
3752
3788
  if (!(!linked && group)) {
3753
- _context.next = 17;
3789
+ _context.next = 21;
3754
3790
  break;
3755
3791
  }
3756
3792
  _context.t0 = group.type;
3757
- _context.next = _context.t0 === SYNCGROUPS_TYPE_SETTIME ? 8 : _context.t0 === SYNCGROUPS_TYPE_SETBBOX ? 12 : 16;
3793
+ _context.next = _context.t0 === SYNCGROUPS_TYPE_SETTIME ? 8 : _context.t0 === SYNCGROUPS_TYPE_SETBBOX ? 16 : 20;
3758
3794
  break;
3759
3795
  case 8:
3760
- if (group.payloadByType[SYNCGROUPS_TYPE_SETTIME]) {
3796
+ if (!(type === syncGroupsActions.syncGroupLinkTarget.type)) {
3761
3797
  _context.next = 10;
3762
3798
  break;
3763
3799
  }
3764
- return _context.abrupt("return");
3800
+ return _context.abrupt("break", 21);
3765
3801
  case 10:
3802
+ if (group.targets.allIds.some(function (targetId) {
3803
+ var _group$targets$byId$t;
3804
+ return targetId !== targetToUpdate && ((_group$targets$byId$t = group.targets.byId[targetId]) === null || _group$targets$byId$t === void 0 ? void 0 : _group$targets$byId$t.linked);
3805
+ })) {
3806
+ _context.next = 12;
3807
+ break;
3808
+ }
3809
+ return _context.abrupt("break", 21);
3810
+ case 12:
3811
+ if (group.payloadByType[SYNCGROUPS_TYPE_SETTIME]) {
3812
+ _context.next = 14;
3813
+ break;
3814
+ }
3815
+ return _context.abrupt("return");
3816
+ case 14:
3766
3817
  listenerApi.dispatch(setTimeSync(group.payloadByType[SYNCGROUPS_TYPE_SETTIME], [{
3767
3818
  targetId: targetToUpdate,
3768
3819
  value: group.payloadByType[SYNCGROUPS_TYPE_SETTIME].value
3769
3820
  }], [groupId]));
3770
- return _context.abrupt("break", 17);
3771
- case 12:
3821
+ return _context.abrupt("break", 21);
3822
+ case 16:
3772
3823
  if (group.payloadByType[SYNCGROUPS_TYPE_SETBBOX]) {
3773
- _context.next = 14;
3824
+ _context.next = 18;
3774
3825
  break;
3775
3826
  }
3776
3827
  return _context.abrupt("return");
3777
- case 14:
3828
+ case 18:
3778
3829
  listenerApi.dispatch(setBboxSync(group.payloadByType[SYNCGROUPS_TYPE_SETBBOX], [{
3779
3830
  targetId: targetToUpdate,
3780
3831
  bbox: group.payloadByType[SYNCGROUPS_TYPE_SETBBOX].bbox,
3781
3832
  srs: group.payloadByType[SYNCGROUPS_TYPE_SETBBOX].srs
3782
3833
  }], [groupId]));
3783
- return _context.abrupt("break", 17);
3784
- case 16:
3785
- return _context.abrupt("break", 17);
3786
- case 17:
3834
+ return _context.abrupt("break", 21);
3835
+ case 20:
3836
+ return _context.abrupt("break", 21);
3837
+ case 21:
3787
3838
  case "end":
3788
3839
  return _context.stop();
3789
3840
  }
@@ -3838,19 +3889,20 @@ syncGroupsListener.startListening({
3838
3889
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
3839
3890
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3840
3891
  * */
3892
+
3841
3893
  var SyncGroupTypeList = [SYNCGROUPS_TYPE_SETBBOX, SYNCGROUPS_TYPE_SETTIME];
3842
- var SyncGroupActionOrigin;
3843
- (function (SyncGroupActionOrigin) {
3894
+ var SyncGroupActionOrigin = /*#__PURE__*/function (SyncGroupActionOrigin) {
3844
3895
  SyncGroupActionOrigin["delete"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_DELETEACTION";
3845
3896
  SyncGroupActionOrigin["layerActions"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_LAYERACTIONS";
3846
3897
  SyncGroupActionOrigin["move"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_MOVEACTION";
3847
3898
  SyncGroupActionOrigin["add"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_ADDACTION";
3848
3899
  SyncGroupActionOrigin["autoLayerId"] = "ORIGIN_GENERIC_SYNCHRONIZATIONGROUP_UTILS_AUTOLAYERIDACTION";
3849
- })(SyncGroupActionOrigin || (SyncGroupActionOrigin = {}));
3900
+ return SyncGroupActionOrigin;
3901
+ }({});
3850
3902
 
3851
- var types$1 = /*#__PURE__*/Object.freeze({
3903
+ var types$3 = /*#__PURE__*/Object.freeze({
3852
3904
  __proto__: null,
3853
- get SyncGroupActionOrigin () { return SyncGroupActionOrigin; },
3905
+ SyncGroupActionOrigin: SyncGroupActionOrigin,
3854
3906
  SyncGroupTypeList: SyncGroupTypeList
3855
3907
  });
3856
3908
 
@@ -3871,12 +3923,14 @@ var types$1 = /*#__PURE__*/Object.freeze({
3871
3923
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
3872
3924
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
3873
3925
  * */
3926
+
3874
3927
  var synchronizationGroupStore = function synchronizationGroupStore(store) {
3875
3928
  return store !== null && store !== void 0 && store.syncGroups ? store.syncGroups : null;
3876
3929
  };
3877
3930
  var getSynchronizationGroupStore = function getSynchronizationGroupStore(store) {
3878
3931
  return store !== null && store !== void 0 && store.syncGroups ? store.syncGroups : null;
3879
3932
  };
3933
+
3880
3934
  /**
3881
3935
  * Returns the synchronization source by id
3882
3936
  * @param store The app store
@@ -3901,11 +3955,19 @@ var selectLinkedState = createSelector(synchronizationGroupStore, function (sync
3901
3955
  sharedData: {}
3902
3956
  };
3903
3957
  });
3904
- var getLinkedMaps = createSelector([selectLinkedState, function (store, panelId) {
3958
+ var getLinkedTargetIds = createSelector([selectLinkedState, function (store, panelId) {
3905
3959
  return panelId;
3906
3960
  }], function (linkedState, panelId) {
3907
3961
  return panelId && linkedState.links[panelId] || [];
3908
3962
  }, selectorMemoizationOptions);
3963
+ var getLinkedMapIds = createSelector([getLinkedTargetIds, function (store) {
3964
+ var _store$webmap;
3965
+ return (store === null || store === void 0 || (_store$webmap = store.webmap) === null || _store$webmap === void 0 ? void 0 : _store$webmap.allIds) || [];
3966
+ }], function (linkedTargets, mapIds) {
3967
+ return linkedTargets.filter(function (targetId) {
3968
+ return mapIds.includes(targetId);
3969
+ });
3970
+ }, selectorMemoizationOptions);
3909
3971
  var getLinkedFeatureProviders = createSelector(function (linkedState) {
3910
3972
  return linkedState;
3911
3973
  }, function (linkedState, props) {
@@ -3927,6 +3989,7 @@ var selectLinkedPanelId = createSelector([selectLinkedState, function (_, mapVie
3927
3989
  if (!(linkedState !== null && linkedState !== void 0 && linkedState.links)) {
3928
3990
  return undefined;
3929
3991
  }
3992
+
3930
3993
  // Find the panelId where mapView(s) is linked
3931
3994
  var panelId = Object.keys(linkedState.links).find(function (panelId) {
3932
3995
  var _linkedState$links$pa;
@@ -4041,7 +4104,8 @@ var getSyncedStartCenterEndStepCurrentTime = createSelector(function (coreAppSto
4041
4104
 
4042
4105
  var selectors$5 = /*#__PURE__*/Object.freeze({
4043
4106
  __proto__: null,
4044
- getLinkedMaps: getLinkedMaps,
4107
+ getLinkedMapIds: getLinkedMapIds,
4108
+ getLinkedTargetIds: getLinkedTargetIds,
4045
4109
  getSelectedFeature: getSelectedFeature,
4046
4110
  getSelectedFeatureAsGeoJSON: getSelectedFeatureAsGeoJSON,
4047
4111
  getSyncedStartCenterEndStepCurrentTime: getSyncedStartCenterEndStepCurrentTime,
@@ -4054,38 +4118,32 @@ var selectors$5 = /*#__PURE__*/Object.freeze({
4054
4118
  selectSharedData: selectSharedData
4055
4119
  });
4056
4120
 
4057
- /* *
4058
- * Licensed under the Apache License, Version 2.0 (the "License");
4059
- * you may not use this file except in compliance with the License.
4060
- * You may obtain a copy of the License at
4061
- *
4062
- * http://www.apache.org/licenses/LICENSE-2.0
4121
+ /**
4122
+ * This registers a new syncgroup source for given panelId. The source is not synced to any group by default.
4123
+ * When the user links the source with a group, this hook returns an object with the timeslider state (start, end, step and current time) for the panel (if effectively linked).
4063
4124
  *
4064
- * Unless required by applicable law or agreed to in writing, software
4065
- * distributed under the License is distributed on an "AS IS" BASIS,
4066
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4067
- * See the License for the specific language governing permissions and
4068
- * limitations under the License.
4125
+ * How it works:
4126
+ * - Registers/unregisters the source on mount/unmount.
4127
+ * - Returns `{ start, end, step, current }` when linked.
4128
+ * - Uses linked map selected time as `current` when available.
4129
+ * - Falls back to sync source "now" timestamp when
4130
+ * synced state is not initialized yet.
4069
4131
  *
4070
- * Copyright 2026 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4071
- * Copyright 2026 - Finnish Meteorological Institute (FMI)
4072
- * Copyright 2026 - The Norwegian Meteorological Institute (MET Norway)
4073
- * */
4074
- /**
4075
- * This registers a new syncgroup souce for given panel id. The source is not synced to any group by default.
4076
- * When the user links the source with a group, this hook returns an object with the timeslider state: start, end, step and current time.
4077
- * @param panelId panelId to register
4078
- * @returns the timeslider state
4132
+ * @param panelId panelId to register as sync source
4133
+ * @returns timeslider state
4079
4134
  */
4080
4135
  var useSyncgroupTimeState = function useSyncgroupTimeState(panelId) {
4136
+ var _ref;
4081
4137
  var debounceMs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100;
4082
4138
  var dispatch = useDispatch();
4139
+ var defaultNowTime = React.useRef(Math.round(Date.now() / 1000));
4083
4140
  var syncGroupsAddSourceCallBack = React.useCallback(function (payload) {
4084
4141
  dispatch(syncGroupAddSource(payload));
4085
4142
  }, [dispatch]);
4086
4143
  var syncGroupRemoveSourceCallback = React.useCallback(function (payload) {
4087
4144
  dispatch(syncGroupRemoveSource(payload));
4088
4145
  }, [dispatch]);
4146
+
4089
4147
  // Register
4090
4148
  useEffect(function () {
4091
4149
  syncGroupsAddSourceCallBack({
@@ -4101,11 +4159,94 @@ var useSyncgroupTimeState = function useSyncgroupTimeState(panelId) {
4101
4159
  var syncGroupTimeSliderCenterStartEndStep = useSelector(function (store) {
4102
4160
  return getSyncedStartCenterEndStepCurrentTime(store, panelId);
4103
4161
  });
4162
+ var syncSourceTime = useSelector(function (store) {
4163
+ return getTime(getSynchronizationGroupStore(store), panelId);
4164
+ });
4104
4165
  var syncTargets = useSelector(function (store) {
4105
4166
  return getAllTargetGroupsForSource(store, panelId);
4106
4167
  });
4107
- var isSyncgroupLinked = syncTargets.length > 0;
4108
- return useDebounce(isSyncgroupLinked ? syncGroupTimeSliderCenterStartEndStep : undefined, debounceMs);
4168
+ var isSyncgroupLinked = useSelector(function (store) {
4169
+ return syncTargets.some(function (groupId) {
4170
+ var group = getSynchronizationGroup(store, groupId);
4171
+ if ((group === null || group === void 0 ? void 0 : group.type) !== SYNCGROUPS_TYPE_SETTIME) {
4172
+ return false;
4173
+ }
4174
+ return group.targets.allIds.some(function (targetId) {
4175
+ var _group$targets$byId$t;
4176
+ return targetId !== panelId && ((_group$targets$byId$t = group.targets.byId[targetId]) === null || _group$targets$byId$t === void 0 ? void 0 : _group$targets$byId$t.linked);
4177
+ });
4178
+ });
4179
+ });
4180
+ var linkedMapIdsInTimeGroup = useSelector(function (store) {
4181
+ var _iterator = _createForOfIteratorHelper(syncTargets),
4182
+ _step;
4183
+ try {
4184
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
4185
+ var groupId = _step.value;
4186
+ var group = getSynchronizationGroup(store, groupId);
4187
+ if ((group === null || group === void 0 ? void 0 : group.type) === SYNCGROUPS_TYPE_SETTIME) {
4188
+ var _iterator2 = _createForOfIteratorHelper(group.targets.allIds),
4189
+ _step2;
4190
+ try {
4191
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
4192
+ var _group$targets$byId$t2, _store$webmap;
4193
+ var targetId = _step2.value;
4194
+ if (targetId !== panelId && (_group$targets$byId$t2 = group.targets.byId[targetId]) !== null && _group$targets$byId$t2 !== void 0 && _group$targets$byId$t2.linked && !!((_store$webmap = store.webmap) !== null && _store$webmap !== void 0 && (_store$webmap = _store$webmap.byId) !== null && _store$webmap !== void 0 && _store$webmap[targetId])) {
4195
+ return targetId;
4196
+ }
4197
+ }
4198
+ } catch (err) {
4199
+ _iterator2.e(err);
4200
+ } finally {
4201
+ _iterator2.f();
4202
+ }
4203
+ }
4204
+ }
4205
+ } catch (err) {
4206
+ _iterator.e(err);
4207
+ } finally {
4208
+ _iterator.f();
4209
+ }
4210
+ return undefined;
4211
+ });
4212
+ var linkedMapSelectedTime = useSelector(function (store) {
4213
+ var _store$webmap2;
4214
+ if (!linkedMapIdsInTimeGroup) {
4215
+ return undefined;
4216
+ }
4217
+ var selectedTime = (_store$webmap2 = store.webmap) === null || _store$webmap2 === void 0 || (_store$webmap2 = _store$webmap2.byId) === null || _store$webmap2 === void 0 || (_store$webmap2 = _store$webmap2[linkedMapIdsInTimeGroup]) === null || _store$webmap2 === void 0 || (_store$webmap2 = _store$webmap2.dimensions) === null || _store$webmap2 === void 0 || (_store$webmap2 = _store$webmap2.find(function (dimension) {
4218
+ return dimension.name === 'time';
4219
+ })) === null || _store$webmap2 === void 0 ? void 0 : _store$webmap2.currentValue;
4220
+ if (!selectedTime) {
4221
+ return undefined;
4222
+ }
4223
+ var selectedTimeAsUnix = Date.parse(selectedTime) / 1000;
4224
+ if (!Number.isFinite(selectedTimeAsUnix)) {
4225
+ return undefined;
4226
+ }
4227
+ return Math.round(selectedTimeAsUnix);
4228
+ });
4229
+ var syncSourceCurrentTime = syncSourceTime !== null && syncSourceTime !== void 0 && syncSourceTime.currentTime ? Date.parse(syncSourceTime.currentTime) / 1000 : undefined;
4230
+ var roundedSyncSourceCurrentTime = syncSourceCurrentTime !== undefined && Number.isFinite(syncSourceCurrentTime) ? Math.round(syncSourceCurrentTime) : undefined;
4231
+ var fallbackCurrentTime = (_ref = linkedMapSelectedTime !== null && linkedMapSelectedTime !== void 0 ? linkedMapSelectedTime : roundedSyncSourceCurrentTime) !== null && _ref !== void 0 ? _ref : defaultNowTime.current;
4232
+ var fallbackState = isSyncgroupLinked ? {
4233
+ start: fallbackCurrentTime - defaultTimeSpan / 2,
4234
+ end: fallbackCurrentTime + defaultTimeSpan / 2,
4235
+ step: defaultTimeStep,
4236
+ current: fallbackCurrentTime
4237
+ } : undefined;
4238
+ var syncedState = isSyncgroupLinked ? syncGroupTimeSliderCenterStartEndStep || fallbackState : undefined;
4239
+ var mapFallbackState = linkedMapSelectedTime !== undefined ? {
4240
+ start: linkedMapSelectedTime - defaultTimeSpan / 2,
4241
+ end: linkedMapSelectedTime + defaultTimeSpan / 2,
4242
+ step: defaultTimeStep,
4243
+ current: linkedMapSelectedTime
4244
+ } : undefined;
4245
+ var baseState = syncedState || mapFallbackState;
4246
+ var stateWithAuthoritativeCurrent = baseState && linkedMapSelectedTime !== undefined ? _objectSpread2(_objectSpread2({}, baseState), {}, {
4247
+ current: linkedMapSelectedTime
4248
+ }) : baseState;
4249
+ return useDebounce(stateWithAuthoritativeCurrent, debounceMs);
4109
4250
  };
4110
4251
 
4111
4252
  var useUpdateSharedData = function useUpdateSharedData(data, panelId) {
@@ -4113,7 +4254,7 @@ var useUpdateSharedData = function useUpdateSharedData(data, panelId) {
4113
4254
  return selectSharedData(state, panelId);
4114
4255
  });
4115
4256
  var linkedMaps = useSelector(function (state) {
4116
- return getLinkedMaps(state, panelId);
4257
+ return getLinkedTargetIds(state, panelId);
4117
4258
  });
4118
4259
  var dispatch = useDispatch();
4119
4260
  useEffect(function () {
@@ -4137,6 +4278,10 @@ var useUpdateSharedData = function useUpdateSharedData(data, panelId) {
4137
4278
  return sharedData;
4138
4279
  };
4139
4280
 
4281
+ var types$2 = /*#__PURE__*/Object.freeze({
4282
+ __proto__: null
4283
+ });
4284
+
4140
4285
  /* *
4141
4286
  * Licensed under the Apache License, Version 2.0 (the "License");
4142
4287
  * you may not use this file except in compliance with the License.
@@ -4154,6 +4299,7 @@ var useUpdateSharedData = function useUpdateSharedData(data, panelId) {
4154
4299
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
4155
4300
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
4156
4301
  * */
4302
+
4157
4303
  var ANY_EDR_SERVICE = 'any_edr';
4158
4304
 
4159
4305
  var constants$1 = /*#__PURE__*/Object.freeze({
@@ -4178,6 +4324,7 @@ var constants$1 = /*#__PURE__*/Object.freeze({
4178
4324
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
4179
4325
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
4180
4326
  * */
4327
+
4181
4328
  var loadingIndicatorAdapter = createEntityAdapter();
4182
4329
  var initLoadingIndicatorStateForId = function initLoadingIndicatorStateForId(draft, id) {
4183
4330
  if (!draft.entities[id]) {
@@ -4189,7 +4336,7 @@ var initLoadingIndicatorStateForId = function initLoadingIndicatorStateForId(dra
4189
4336
  });
4190
4337
  }
4191
4338
  };
4192
- var slice$3 = createSlice({
4339
+ var slice$4 = createSlice({
4193
4340
  initialState: loadingIndicatorAdapter.getInitialState(),
4194
4341
  name: 'loadingIndicatorReducer',
4195
4342
  reducers: {
@@ -4232,8 +4379,8 @@ var slice$3 = createSlice({
4232
4379
  });
4233
4380
  }
4234
4381
  });
4235
- var loadingIndicatorActions = slice$3.actions,
4236
- loadingIndicatorReducer = slice$3.reducer;
4382
+ var loadingIndicatorActions = slice$4.actions,
4383
+ loadingIndicatorReducer = slice$4.reducer;
4237
4384
 
4238
4385
  /* *
4239
4386
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -4252,6 +4399,7 @@ var loadingIndicatorActions = slice$3.actions,
4252
4399
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
4253
4400
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
4254
4401
  * */
4402
+
4255
4403
  var EMPTY_LOADING_INDICATOR = {
4256
4404
  entities: {},
4257
4405
  ids: []
@@ -4292,11 +4440,137 @@ var selectors$4 = /*#__PURE__*/Object.freeze({
4292
4440
  });
4293
4441
 
4294
4442
  var genericActions = _objectSpread2(_objectSpread2({}, syncGroupsActions), {}, {
4295
- initialSyncState: initialState$3,
4443
+ initialSyncState: initialState$4,
4296
4444
  setTime: setTime,
4297
4445
  setBbox: setBbox
4298
4446
  });
4299
4447
 
4448
+ var moveToTop = function moveToTop(list, element) {
4449
+ var filteredList = list.filter(function (item) {
4450
+ return item !== element;
4451
+ });
4452
+ var newOrder = [element].concat(_toConsumableArray(filteredList));
4453
+ return newOrder;
4454
+ };
4455
+ var createUIDialogElement = function createUIDialogElement(_ref) {
4456
+ var activeMapId = _ref.activeMapId,
4457
+ type = _ref.type,
4458
+ setOpen = _ref.setOpen,
4459
+ _ref$source = _ref.source,
4460
+ source = _ref$source === void 0 ? 'app' : _ref$source,
4461
+ sourcePanelId = _ref.sourcePanelId;
4462
+ return {
4463
+ activeMapId: activeMapId,
4464
+ isOpen: setOpen,
4465
+ type: type,
4466
+ source: source,
4467
+ isLoading: false,
4468
+ error: undefined,
4469
+ sourcePanelId: sourcePanelId
4470
+ };
4471
+ };
4472
+ var initialState$3 = {
4473
+ order: [],
4474
+ dialogs: {},
4475
+ activeWindowId: undefined
4476
+ };
4477
+ var slice$3 = createSlice({
4478
+ initialState: initialState$3,
4479
+ name: 'uiReducer',
4480
+ reducers: {
4481
+ registerDialog: function registerDialog(draft, action) {
4482
+ var type = action.payload.type;
4483
+ var activeMapId = action.payload.mapId ? action.payload.mapId : '';
4484
+ var setOpen = action.payload.setOpen ? action.payload.setOpen : false;
4485
+ var source = action.payload.source ? action.payload.source : 'app';
4486
+ if (!Object.keys(draft.dialogs).includes(type)) {
4487
+ draft.dialogs[type] = createUIDialogElement({
4488
+ activeMapId: activeMapId,
4489
+ type: type,
4490
+ setOpen: setOpen,
4491
+ source: source
4492
+ });
4493
+ }
4494
+ // register dialog to order
4495
+ if (!draft.order.includes(type)) {
4496
+ draft.order.push(type);
4497
+ }
4498
+ },
4499
+ unregisterDialog: function unregisterDialog(draft, action) {
4500
+ var type = action.payload.type;
4501
+ if (draft.dialogs[type]) {
4502
+ delete draft.dialogs[type];
4503
+ draft.order = draft.order.filter(function (item) {
4504
+ return item !== type;
4505
+ });
4506
+ }
4507
+ },
4508
+ setActiveMapIdForDialog: function setActiveMapIdForDialog(draft, action) {
4509
+ var _action$payload = action.payload,
4510
+ type = _action$payload.type,
4511
+ mapId = _action$payload.mapId,
4512
+ source = _action$payload.source;
4513
+ if (!draft.dialogs[type]) {
4514
+ return;
4515
+ }
4516
+ var isOpen = action.payload.setOpen !== undefined ? action.payload.setOpen : draft.dialogs[type].isOpen;
4517
+ draft.dialogs[type].activeMapId = mapId;
4518
+ draft.dialogs[type].isOpen = isOpen;
4519
+ draft.dialogs[type].source = source;
4520
+ if (isOpen) {
4521
+ draft.order = moveToTop(draft.order, type);
4522
+ }
4523
+ },
4524
+ setToggleOpenDialog: function setToggleOpenDialog(draft, action) {
4525
+ var _action$payload2 = action.payload,
4526
+ type = _action$payload2.type,
4527
+ setOpen = _action$payload2.setOpen,
4528
+ sourcePanelId = _action$payload2.sourcePanelId;
4529
+ if (!draft.dialogs[type]) {
4530
+ return;
4531
+ }
4532
+ draft.dialogs[type].isOpen = setOpen;
4533
+ if (sourcePanelId) {
4534
+ draft.dialogs[type].sourcePanelId = sourcePanelId;
4535
+ }
4536
+ if (setOpen) {
4537
+ draft.order = moveToTop(draft.order, type);
4538
+ }
4539
+ },
4540
+ orderDialog: function orderDialog(draft, action) {
4541
+ var type = action.payload.type;
4542
+ draft.order = moveToTop(draft.order, type);
4543
+ },
4544
+ setActiveWindowId: function setActiveWindowId(draft, action) {
4545
+ var activeWindowId = action.payload.activeWindowId;
4546
+ draft.activeWindowId = activeWindowId;
4547
+ },
4548
+ toggleIsLoadingDialog: function toggleIsLoadingDialog(draft, action) {
4549
+ var _action$payload3 = action.payload,
4550
+ isLoading = _action$payload3.isLoading,
4551
+ type = _action$payload3.type;
4552
+ draft.dialogs[type].isLoading = isLoading;
4553
+ },
4554
+ setErrorDialog: function setErrorDialog(draft, action) {
4555
+ var _action$payload4 = action.payload,
4556
+ error = _action$payload4.error,
4557
+ type = _action$payload4.type;
4558
+ draft.dialogs[type].error = error;
4559
+ },
4560
+ closeDialogsForMapId: function closeDialogsForMapId(draft, action) {
4561
+ var mapId = action.payload.mapId;
4562
+ Object.keys(draft.dialogs).forEach(function (key) {
4563
+ var dialog = draft.dialogs[key];
4564
+ if ((dialog === null || dialog === void 0 ? void 0 : dialog.activeMapId) === mapId) {
4565
+ dialog.isOpen = false;
4566
+ }
4567
+ });
4568
+ }
4569
+ }
4570
+ });
4571
+ var uiReducer = slice$3.reducer,
4572
+ uiActions = slice$3.actions;
4573
+
4300
4574
  /* *
4301
4575
  * Licensed under the Apache License, Version 2.0 (the "License");
4302
4576
  * you may not use this file except in compliance with the License.
@@ -4314,6 +4588,7 @@ var genericActions = _objectSpread2(_objectSpread2({}, syncGroupsActions), {}, {
4314
4588
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
4315
4589
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
4316
4590
  * */
4591
+
4317
4592
  var useAppSelector$1 = useSelector;
4318
4593
  var getUiStore = function getUiStore(store) {
4319
4594
  if (store !== null && store !== void 0 && store.ui) {
@@ -4321,6 +4596,7 @@ var getUiStore = function getUiStore(store) {
4321
4596
  }
4322
4597
  return null;
4323
4598
  };
4599
+
4324
4600
  /**
4325
4601
  * Gets the active map Id and wether a dialog is open or closed
4326
4602
  *
@@ -4336,6 +4612,7 @@ var getDialogDetailsByType = function getDialogDetailsByType(store, dialogType)
4336
4612
  }
4337
4613
  return null;
4338
4614
  };
4615
+
4339
4616
  /**
4340
4617
  * For a given ui component: gets wether the dialog is open or closed
4341
4618
  *
@@ -4349,6 +4626,7 @@ var getisDialogOpen = createSelector(getDialogDetailsByType, function (details)
4349
4626
  }
4350
4627
  return false;
4351
4628
  }, selectorMemoizationOptions);
4629
+
4352
4630
  /**
4353
4631
  *For a given ui component: gets the active map Id
4354
4632
  *
@@ -4362,6 +4640,7 @@ var getDialogMapId = createSelector(getDialogDetailsByType, function (details) {
4362
4640
  }
4363
4641
  return '';
4364
4642
  }, selectorMemoizationOptions);
4643
+
4365
4644
  /**
4366
4645
  *For a given ui component: gets the order of visible dialog
4367
4646
  *
@@ -4374,8 +4653,8 @@ var getDialogOrder = function getDialogOrder(store, dialogType) {
4374
4653
  if (store !== null && store !== void 0 && (_store$ui2 = store.ui) !== null && _store$ui2 !== void 0 && _store$ui2.order) {
4375
4654
  var order = store.ui.order;
4376
4655
  var visibleOrder = order.filter(function (orderedDialogType) {
4377
- var _store$ui$dialogs$ord;
4378
- return (_store$ui$dialogs$ord = store.ui.dialogs[orderedDialogType]) === null || _store$ui$dialogs$ord === void 0 ? void 0 : _store$ui$dialogs$ord.isOpen;
4656
+ var _dialogs$orderedDialo;
4657
+ return (_dialogs$orderedDialo = store.ui.dialogs[orderedDialogType]) === null || _dialogs$orderedDialo === void 0 ? void 0 : _dialogs$orderedDialo.isOpen;
4379
4658
  });
4380
4659
  if (!visibleOrder.includes(dialogType)) {
4381
4660
  return 0;
@@ -4384,6 +4663,7 @@ var getDialogOrder = function getDialogOrder(store, dialogType) {
4384
4663
  }
4385
4664
  return 0;
4386
4665
  };
4666
+
4387
4667
  /**
4388
4668
  *For a given ui component: returns if ordered on top
4389
4669
  *
@@ -4405,6 +4685,7 @@ var getDialogSource = createSelector(getDialogDetailsByType, function (details)
4405
4685
  }
4406
4686
  return 'app';
4407
4687
  }, selectorMemoizationOptions);
4688
+
4408
4689
  /**
4409
4690
  * Get the active window that should receive keyboard shortcuts
4410
4691
  *
@@ -4415,6 +4696,7 @@ var getDialogSource = createSelector(getDialogDetailsByType, function (details)
4415
4696
  var getActiveWindowId = createSelector(getUiStore, function (store) {
4416
4697
  return store === null || store === void 0 ? void 0 : store.activeWindowId;
4417
4698
  }, selectorMemoizationOptions);
4699
+
4418
4700
  /**
4419
4701
  * Gets the panelId of which the dialog is opened from
4420
4702
  *
@@ -4422,12 +4704,14 @@ var getActiveWindowId = createSelector(getUiStore, function (store) {
4422
4704
  * @param {object} store store object from which the panelId state will be extracted
4423
4705
  * @returns {string} the dialog type
4424
4706
  */
4707
+
4425
4708
  var getSourcePanelId = createSelector(function (store, dialogType) {
4426
4709
  var _store$ui4;
4427
4710
  return (_store$ui4 = store.ui) === null || _store$ui4 === void 0 ? void 0 : _store$ui4.dialogs[dialogType];
4428
4711
  }, function (dialog) {
4429
4712
  return (dialog === null || dialog === void 0 ? void 0 : dialog.sourcePanelId) || '';
4430
4713
  }, selectorMemoizationOptions);
4714
+
4431
4715
  /**
4432
4716
  * Gets if this is the active window
4433
4717
  *
@@ -4501,8 +4785,8 @@ var selectors$3 = /*#__PURE__*/Object.freeze({
4501
4785
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
4502
4786
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
4503
4787
  * */
4504
- var DialogTypes;
4505
- (function (DialogTypes) {
4788
+
4789
+ var DialogTypes = /*#__PURE__*/function (DialogTypes) {
4506
4790
  DialogTypes["LayerInfo"] = "layerInfo";
4507
4791
  DialogTypes["SyncGroups"] = "syncGroups";
4508
4792
  DialogTypes["TimeSeriesSelect"] = "timeSeriesSelect";
@@ -4514,6 +4798,7 @@ var DialogTypes;
4514
4798
  DialogTypes["DimensionSelectElevation"] = "dimensionSelect-elevation";
4515
4799
  DialogTypes["LayerManager"] = "layerManager";
4516
4800
  DialogTypes["LayerSelect"] = "layerSelect";
4801
+ DialogTypes["Legend"] = "legend";
4517
4802
  DialogTypes["DrawingTool"] = "drawingTool";
4518
4803
  DialogTypes["DockedLayerManager"] = "dockedLayerManager";
4519
4804
  DialogTypes["ObjectManager"] = "objectManager";
@@ -4527,11 +4812,13 @@ var DialogTypes;
4527
4812
  DialogTypes["SoundingsLocations"] = "soundingsLocations";
4528
4813
  DialogTypes["SoundingsManager"] = "soundingsManager";
4529
4814
  DialogTypes["TimeseriesLocations"] = "timeseriesLocations";
4530
- })(DialogTypes || (DialogTypes = {}));
4815
+ DialogTypes["Getfeatureinfo"] = "getfeatureinfo";
4816
+ return DialogTypes;
4817
+ }({});
4531
4818
 
4532
- var types = /*#__PURE__*/Object.freeze({
4819
+ var types$1 = /*#__PURE__*/Object.freeze({
4533
4820
  __proto__: null,
4534
- get DialogTypes () { return DialogTypes; }
4821
+ DialogTypes: DialogTypes
4535
4822
  });
4536
4823
 
4537
4824
  /* *
@@ -4572,6 +4859,7 @@ var useSetupDialog = function useSetupDialog(dialogType) {
4572
4859
  type: dialogType
4573
4860
  }));
4574
4861
  }, [dialogType, dispatch]);
4862
+
4575
4863
  // Register this dialog in the store
4576
4864
  useEffect(function () {
4577
4865
  registerDialog();
@@ -4619,6 +4907,7 @@ var useSetupDialog = function useSetupDialog(dialogType) {
4619
4907
  var layerStore = function layerStore(store) {
4620
4908
  return store === null || store === void 0 ? void 0 : store.layers;
4621
4909
  };
4910
+
4622
4911
  /**
4623
4912
  * Gets a layer from the layers part of the store by its Id
4624
4913
  *
@@ -4633,6 +4922,7 @@ var getLayerById = createSelector([layerStore, function (layerStore, layerId) {
4633
4922
  var _layerState$byId;
4634
4923
  return layerState === null || layerState === void 0 || (_layerState$byId = layerState.byId) === null || _layerState$byId === void 0 ? void 0 : _layerState$byId[layerId];
4635
4924
  }, selectorMemoizationOptions);
4925
+
4636
4926
  /**
4637
4927
  * Determines if layer is present
4638
4928
  *
@@ -4643,6 +4933,7 @@ var getLayerById = createSelector([layerStore, function (layerStore, layerId) {
4643
4933
  var getIsLayerPresent = createSelector(getLayerById, function (layer) {
4644
4934
  return !!layer;
4645
4935
  }, selectorMemoizationOptions);
4936
+
4646
4937
  /**
4647
4938
  * Gets a layer from the layers part of the store by its Id, but without the time dimension. (All other dimensions are still included)
4648
4939
  *
@@ -4661,6 +4952,7 @@ var getLayerByIdWithoutTimeDimension = createSelector([layerStore, function (lay
4661
4952
  return draftLayer;
4662
4953
  }) : undefined;
4663
4954
  }, selectorMemoizationOptions);
4955
+
4664
4956
  /**
4665
4957
  * Retrieves all layers indexed by layerId
4666
4958
  *
@@ -4672,6 +4964,7 @@ var getLayersById = createSelector(layerStore, function (store) {
4672
4964
  var _store$byId;
4673
4965
  return (_store$byId = store === null || store === void 0 ? void 0 : store.byId) !== null && _store$byId !== void 0 ? _store$byId : null;
4674
4966
  }, selectorMemoizationOptions);
4967
+
4675
4968
  /**
4676
4969
  * Retrieves all layerIds
4677
4970
  *
@@ -4682,6 +4975,7 @@ var getLayersById = createSelector(layerStore, function (store) {
4682
4975
  var getLayersIds = createSelector(layerStore, function (store) {
4683
4976
  return store ? store.allIds : [];
4684
4977
  }, selectorMemoizationOptions);
4978
+
4685
4979
  /**
4686
4980
  * Retrieves all layers (including base layers and overlayers)
4687
4981
  *
@@ -4694,6 +4988,7 @@ var getAllLayers = createSelector(getLayersIds, getLayersById, function (ids, la
4694
4988
  return layers[layerId];
4695
4989
  });
4696
4990
  }, selectorMemoizationOptions);
4991
+
4697
4992
  /**
4698
4993
  * Retrieves all layers (including base layers and overlayers) for the given mapId
4699
4994
  *
@@ -4709,6 +5004,7 @@ var getLayersByMapId = createSelector(getAllLayers, function (_store, _mapId) {
4709
5004
  return layer.mapId === mapId;
4710
5005
  });
4711
5006
  }, selectorMemoizationOptions);
5007
+
4712
5008
  /**
4713
5009
  * Retrieves all layers that aren't base layers and aren't overlayers
4714
5010
  *
@@ -4721,6 +5017,7 @@ var getLayers = createSelector(getAllLayers, function (layers) {
4721
5017
  return layer.layerType !== LayerType.baseLayer && layer.layerType !== LayerType.overLayer;
4722
5018
  });
4723
5019
  }, selectorMemoizationOptions);
5020
+
4724
5021
  /**
4725
5022
  * Retrieves all baselayers
4726
5023
  *
@@ -4733,6 +5030,7 @@ var getBaseLayers = createSelector(getAllLayers, function (layers) {
4733
5030
  return layer.layerType === LayerType.baseLayer;
4734
5031
  });
4735
5032
  }, selectorMemoizationOptions);
5033
+
4736
5034
  /**
4737
5035
  * Retrieves all overLayers
4738
5036
  *
@@ -4745,6 +5043,7 @@ var getOverLayers = createSelector(getAllLayers, function (layers) {
4745
5043
  return layer.layerType === LayerType.overLayer;
4746
5044
  });
4747
5045
  }, selectorMemoizationOptions);
5046
+
4748
5047
  /**
4749
5048
  * Retrieves all featureLayers
4750
5049
  *
@@ -4757,6 +5056,7 @@ var getFeatureLayers = createSelector(getAllLayers, function (layers) {
4757
5056
  return layer.layerType === LayerType.featureLayer;
4758
5057
  });
4759
5058
  }, selectorMemoizationOptions);
5059
+
4760
5060
  /**
4761
5061
  * Gets dimensions of the passed layer
4762
5062
  *
@@ -4769,6 +5069,7 @@ var getLayerDimensions = createSelector(getLayerById, function (layer) {
4769
5069
  var _layer$dimensions;
4770
5070
  return (_layer$dimensions = layer === null || layer === void 0 ? void 0 : layer.dimensions) !== null && _layer$dimensions !== void 0 ? _layer$dimensions : [];
4771
5071
  }, selectorMemoizationOptions);
5072
+
4772
5073
  /**
4773
5074
  * Gets dimensions of the passed layer, excluding the time dimension
4774
5075
  *
@@ -4780,6 +5081,7 @@ var getLayerDimensions = createSelector(getLayerById, function (layer) {
4780
5081
  var getLayerNonTimeDimensions = createSelector(getLayerDimensions, function (dimensions) {
4781
5082
  return filterNonTimeDimensions(dimensions);
4782
5083
  }, selectorMemoizationOptions);
5084
+
4783
5085
  /**
4784
5086
  * Gets time dimension of the passed layer
4785
5087
  *
@@ -4793,6 +5095,7 @@ var getLayerTimeDimension = createSelector(getLayerDimensions, function (dimensi
4793
5095
  return dimension.name === 'time';
4794
5096
  });
4795
5097
  }, selectorMemoizationOptions);
5098
+
4796
5099
  /**
4797
5100
  * Returns a boolean indicating whether the layer has a time dimension
4798
5101
  *
@@ -4807,6 +5110,7 @@ var getLayerHasTimeDimension = createSelector(getLayerTimeDimension, function (t
4807
5110
  var getLayerCurrentTime = createSelector(getLayerTimeDimension, function (dimension) {
4808
5111
  return dimension === null || dimension === void 0 ? void 0 : dimension.currentValue;
4809
5112
  }, selectorMemoizationOptions);
5113
+
4810
5114
  /**
4811
5115
  * Gets specified dimension of the passed layer
4812
5116
  *
@@ -4823,6 +5127,7 @@ var getLayerDimension = createSelector(getLayerDimensions, function (_store, _la
4823
5127
  return dimension.name === dimensionName;
4824
5128
  });
4825
5129
  }, selectorMemoizationOptions);
5130
+
4826
5131
  /**
4827
5132
  * Gets opacity of the passed layer
4828
5133
  *
@@ -4834,6 +5139,7 @@ var getLayerDimension = createSelector(getLayerDimensions, function (_store, _la
4834
5139
  var getLayerOpacity = createSelector(getLayerById, function (layer) {
4835
5140
  return layer !== null && layer !== void 0 && layer.opacity ? layer.opacity : 0;
4836
5141
  }, selectorMemoizationOptions);
5142
+
4837
5143
  /**
4838
5144
  * Gets whether a layer is enabled or disabled
4839
5145
  *
@@ -4845,6 +5151,7 @@ var getLayerOpacity = createSelector(getLayerById, function (layer) {
4845
5151
  var getLayerEnabled = createSelector(getLayerById, function (layer) {
4846
5152
  return Boolean(layer === null || layer === void 0 ? void 0 : layer.enabled);
4847
5153
  }, selectorMemoizationOptions);
5154
+
4848
5155
  /**
4849
5156
  * Gets layer name
4850
5157
  *
@@ -4863,6 +5170,7 @@ var getLayerName = createSelector(getLayerById, function (layer) {
4863
5170
  }
4864
5171
  return (layer === null || layer === void 0 ? void 0 : layer.name) || '';
4865
5172
  }, selectorMemoizationOptions);
5173
+
4866
5174
  /**
4867
5175
  * Gets layer service
4868
5176
  *
@@ -4875,6 +5183,7 @@ var getLayerService = createSelector(getLayerById, function (layer) {
4875
5183
  var _layer$service;
4876
5184
  return (_layer$service = layer === null || layer === void 0 ? void 0 : layer.service) !== null && _layer$service !== void 0 ? _layer$service : '';
4877
5185
  }, selectorMemoizationOptions);
5186
+
4878
5187
  /**
4879
5188
  * Gets layer service name
4880
5189
  *
@@ -4889,6 +5198,7 @@ var getLayerServiceName = createSelector(function (store) {
4889
5198
  var layerService = getServiceByUrl(store, service);
4890
5199
  return layerService !== null && layerService !== void 0 && layerService.name ? layerService === null || layerService === void 0 ? void 0 : layerService.name : '';
4891
5200
  }, selectorMemoizationOptions);
5201
+
4892
5202
  /**
4893
5203
  * Gets selected style of the passed layer
4894
5204
  *
@@ -4900,6 +5210,7 @@ var getLayerServiceName = createSelector(function (store) {
4900
5210
  var getLayerStyle = createSelector(getLayerById, function (layer) {
4901
5211
  return layer !== null && layer !== void 0 && layer.style ? layer.style : '';
4902
5212
  }, selectorMemoizationOptions);
5213
+
4903
5214
  /**
4904
5215
  * Gets layer status
4905
5216
  *
@@ -4911,6 +5222,7 @@ var getLayerStyle = createSelector(getLayerById, function (layer) {
4911
5222
  var getLayerStatus = createSelector(getLayerById, function (layer) {
4912
5223
  return layer !== null && layer !== void 0 && layer.status ? layer.status : LayerStatus["default"];
4913
5224
  }, selectorMemoizationOptions);
5225
+
4914
5226
  /**
4915
5227
  * Gets all available base layers for a map
4916
5228
  *
@@ -4933,6 +5245,7 @@ var getAvailableBaseLayersForMap = createSelector(layerStore, function (_store,
4933
5245
  }
4934
5246
  return [];
4935
5247
  }, selectorMemoizationOptions);
5248
+
4936
5249
  /**
4937
5250
  * Returns the selected geojson feature for the given layer
4938
5251
  *
@@ -4944,6 +5257,7 @@ var getAvailableBaseLayersForMap = createSelector(layerStore, function (_store,
4944
5257
  var getSelectedFeatureIndex = createSelector(getLayerById, function (layer) {
4945
5258
  return layer === null || layer === void 0 ? void 0 : layer.selectedFeatureIndex;
4946
5259
  }, selectorMemoizationOptions);
5260
+
4947
5261
  /**
4948
5262
  * Returns the layer is in edit mode
4949
5263
  *
@@ -4966,6 +5280,7 @@ var getFeatureLayerGeoJSONProperties = createSelector(getLayerById, getSelectedF
4966
5280
  var selecteFeatureIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
4967
5281
  return (layer === null || layer === void 0 || (_layer$geojson = layer.geojson) === null || _layer$geojson === void 0 || (_layer$geojson = _layer$geojson.features[selecteFeatureIndex]) === null || _layer$geojson === void 0 ? void 0 : _layer$geojson.properties) || {};
4968
5282
  }, selectorMemoizationOptions);
5283
+
4969
5284
  /**
4970
5285
  * Gets layerIds that contain passed dimension
4971
5286
  *
@@ -5017,6 +5332,7 @@ var getLayerIsInsideAcceptanceTime = createSelector(getAcceptanceTimeInMinutes,
5017
5332
  var getUseLatestReferenceTime = createSelector(getLayerById, function (layer) {
5018
5333
  return Boolean(layer === null || layer === void 0 ? void 0 : layer.useLatestReferenceTime);
5019
5334
  }, selectorMemoizationOptions);
5335
+
5020
5336
  /**
5021
5337
  * Returns the timestep for this layerId in seconds, or undefined if it has no time dimension or timeinterval.
5022
5338
  */
@@ -5065,6 +5381,7 @@ var getLayerType = createSelector(getLayerById, function (layer) {
5065
5381
  var getLayerOptions = createSelector(getLayerById, function (layer) {
5066
5382
  return layer === null || layer === void 0 ? void 0 : layer.options;
5067
5383
  }, selectorMemoizationOptions);
5384
+
5068
5385
  /**
5069
5386
  * Gets all overlayers for a given mapId
5070
5387
  * Example: overlayers = getOverlayersForMapId(store, 'mapId123')
@@ -5086,6 +5403,7 @@ var getOverlayersForMapId = createSelector([layerStore, function (_store, mapId)
5086
5403
  });
5087
5404
  return overLayers;
5088
5405
  }, selectorMemoizationOptions);
5406
+
5089
5407
  /**
5090
5408
  * Gets the layer title from the service store using the layerId
5091
5409
  *
@@ -5099,6 +5417,7 @@ var getLayerTitleFromService = createSelector(function (store) {
5099
5417
  }, getLayerService, getLayerName, function (store, service, name) {
5100
5418
  return getLayerTitle(store, service, name);
5101
5419
  }, selectorMemoizationOptions);
5420
+
5102
5421
  /**
5103
5422
  * Gets layer displayname. For EDR layers with multiple parameters, the collectionId is used as displayname. Otherwise the layer title from the service is used.
5104
5423
  *
@@ -5113,6 +5432,7 @@ var getLayerDisplayName = createSelector(getLayerType, getLayerOptions, getLayer
5113
5432
  }
5114
5433
  return layerTitle || layerName;
5115
5434
  }, selectorMemoizationOptions);
5435
+
5116
5436
  /**
5117
5437
  * Gets the layer missing status. A layer is missing if it is not found in the service store or if its status is 'error'.
5118
5438
  *
@@ -5185,6 +5505,7 @@ var _excluded$2 = ["mapId"];
5185
5505
  var getMapStore = function getMapStore(store) {
5186
5506
  return store === null || store === void 0 ? void 0 : store.webmap;
5187
5507
  };
5508
+
5188
5509
  /**
5189
5510
  * Gets the map state by mapId
5190
5511
  *
@@ -5200,6 +5521,7 @@ var getMapById = function getMapById(store, mapId) {
5200
5521
  var getAllMapsByIds = createSelector(getMapStore, function (mapState) {
5201
5522
  return mapState !== null && mapState !== void 0 && mapState.byId ? mapState === null || mapState === void 0 ? void 0 : mapState.byId : {};
5202
5523
  }, selectorMemoizationOptions);
5524
+
5203
5525
  /**
5204
5526
  * Gets all mapIds
5205
5527
  *
@@ -5210,6 +5532,7 @@ var getAllMapsByIds = createSelector(getMapStore, function (mapState) {
5210
5532
  var getAllMapIds = createSelector(getMapStore, function (mapState) {
5211
5533
  return mapState !== null && mapState !== void 0 && mapState.allIds ? mapState.allIds : [];
5212
5534
  }, selectorMemoizationOptions);
5535
+
5213
5536
  /**
5214
5537
  * Gets the map state of the first map in the store
5215
5538
  *
@@ -5220,6 +5543,7 @@ var getAllMapIds = createSelector(getMapStore, function (mapState) {
5220
5543
  var getFirstMap = createSelector(getAllMapIds, getAllMapsByIds, function (allMapIds, mapsById) {
5221
5544
  return allMapIds[0] && mapsById[allMapIds[0]] ? mapsById[allMapIds[0]] : null;
5222
5545
  }, selectorMemoizationOptions);
5546
+
5223
5547
  /**
5224
5548
  * Gets the id of first map in store
5225
5549
  *
@@ -5230,6 +5554,7 @@ var getFirstMap = createSelector(getAllMapIds, getAllMapsByIds, function (allMap
5230
5554
  var getFirstMapId = createSelector(getFirstMap, function (map) {
5231
5555
  return map ? map.id : '';
5232
5556
  }, selectorMemoizationOptions);
5557
+
5233
5558
  /**
5234
5559
  * Determines if map is present
5235
5560
  *
@@ -5240,6 +5565,7 @@ var getFirstMapId = createSelector(getFirstMap, function (map) {
5240
5565
  var getIsMapPresent = createSelector(getMapById, function (map) {
5241
5566
  return !!map;
5242
5567
  }, selectorMemoizationOptions);
5568
+
5243
5569
  /**
5244
5570
  * Gets all layerIds for a map that aren't baselayers or overlayers
5245
5571
  *
@@ -5252,6 +5578,7 @@ var getLayerIds = createSelector(getMapById, function (map) {
5252
5578
  var _map$mapLayers;
5253
5579
  return (_map$mapLayers = map === null || map === void 0 ? void 0 : map.mapLayers) !== null && _map$mapLayers !== void 0 ? _map$mapLayers : [];
5254
5580
  }, selectorMemoizationOptions);
5581
+
5255
5582
  /**
5256
5583
  * Gets all layer states for a map
5257
5584
  *
@@ -5267,6 +5594,7 @@ var getMapLayers = createSelector(getLayerIds, getLayersById, function (layerIds
5267
5594
  var layersWithoutUndefined = compact(layersWithUndefined);
5268
5595
  return layersWithoutUndefined;
5269
5596
  }, selectorMemoizationOptions);
5597
+
5270
5598
  /**
5271
5599
  * Gets all layer states for a map, but where Dimensions have no currentValue set
5272
5600
  *
@@ -5290,6 +5618,7 @@ var getMapLayersWithoutDimensionCurrentValue = createSelector(getLayerIds, getLa
5290
5618
  });
5291
5619
  return layersWithoutTimeDim;
5292
5620
  }, selectorMemoizationOptions);
5621
+
5293
5622
  /**
5294
5623
  * Gets an array of baselayers ids for a map
5295
5624
  *
@@ -5301,6 +5630,7 @@ var getMapLayersWithoutDimensionCurrentValue = createSelector(getLayerIds, getLa
5301
5630
  var getMapBaseLayersIds = createSelector(getMapById, function (store) {
5302
5631
  return store !== null && store !== void 0 && store.baseLayers ? store.baseLayers : [];
5303
5632
  }, selectorMemoizationOptions);
5633
+
5304
5634
  /**
5305
5635
  * Gets all baselayers for a map
5306
5636
  *
@@ -5314,6 +5644,7 @@ var getMapBaseLayers = createSelector(getMapBaseLayersIds, getLayersById, functi
5314
5644
  return layers[layerId];
5315
5645
  });
5316
5646
  }, selectorMemoizationOptions);
5647
+
5317
5648
  /**
5318
5649
  * Gets and array of overLayers ids for a map
5319
5650
  *
@@ -5327,6 +5658,7 @@ var getMapOverLayersIds = createSelector(getMapById, function (store) {
5327
5658
  }, selectorMemoizationOptions);
5328
5659
  var getMapFeatureLayers = createSelector(getMapById, getFeatureLayers, function (store, featureLayers) {
5329
5660
  var featureLayersOnMap = (store === null || store === void 0 ? void 0 : store.featureLayers) || [];
5661
+
5330
5662
  // We want to return the feature layers in the same order as in featureLayersOnMap
5331
5663
  return featureLayersOnMap.map(function (id) {
5332
5664
  return featureLayers.find(function (layer) {
@@ -5336,6 +5668,7 @@ var getMapFeatureLayers = createSelector(getMapById, getFeatureLayers, function
5336
5668
  return !!layer;
5337
5669
  });
5338
5670
  }, selectorMemoizationOptions);
5671
+
5339
5672
  /**
5340
5673
  * Gets all overLayers for a map
5341
5674
  *
@@ -5351,6 +5684,7 @@ var getMapOverLayers = createSelector(getMapOverLayersIds, getLayersById, functi
5351
5684
  return layer === null || layer === void 0 ? void 0 : layer.name;
5352
5685
  });
5353
5686
  }, selectorMemoizationOptions);
5687
+
5354
5688
  /**
5355
5689
  * Gets map dimensions
5356
5690
  *
@@ -5362,6 +5696,7 @@ var getMapOverLayers = createSelector(getMapOverLayersIds, getLayersById, functi
5362
5696
  var getMapDimensions = createSelector(getMapById, function (webMap) {
5363
5697
  return webMap ? webMap.dimensions : [];
5364
5698
  }, selectorMemoizationOptions);
5699
+
5365
5700
  /**
5366
5701
  * Gets the map dimension requested
5367
5702
  *
@@ -5383,6 +5718,7 @@ var getMapDimension = createSelector([getMapById, function (_store, mapId) {
5383
5718
  }
5384
5719
  return undefined;
5385
5720
  }, selectorMemoizationOptions);
5721
+
5386
5722
  /**
5387
5723
  * Returns the current time in unix time for the given map
5388
5724
  *
@@ -5427,6 +5763,7 @@ var getDataLimitsFromLayers = createSelector(getMapLayers, function (layers) {
5427
5763
  */
5428
5764
  [2147483647, 0]);
5429
5765
  }, selectorMemoizationOptions);
5766
+
5430
5767
  /**
5431
5768
  * Gets map srs
5432
5769
  *
@@ -5438,6 +5775,7 @@ var getDataLimitsFromLayers = createSelector(getMapLayers, function (layers) {
5438
5775
  var getSrs = createSelector(getMapById, function (store) {
5439
5776
  return store ? store.srs : '';
5440
5777
  }, selectorMemoizationOptions);
5778
+
5441
5779
  /**
5442
5780
  * Gets map bounding box
5443
5781
  *
@@ -5449,6 +5787,7 @@ var getSrs = createSelector(getMapById, function (store) {
5449
5787
  var getBbox = createSelector(getMapById, function (store) {
5450
5788
  return store ? store.bbox : {};
5451
5789
  }, selectorMemoizationOptions);
5790
+
5452
5791
  /**
5453
5792
  * Gets if map is animating
5454
5793
  *
@@ -5461,6 +5800,7 @@ var isAnimating = function isAnimating(store, mapId) {
5461
5800
  var map = getMapById(store, mapId);
5462
5801
  return map ? map.isAnimating : false;
5463
5802
  };
5803
+
5464
5804
  /**
5465
5805
  * Gets if any linked map is animating
5466
5806
  *
@@ -5469,6 +5809,7 @@ var isAnimating = function isAnimating(store, mapId) {
5469
5809
  * @param {string} mapId mapId: string - Id of the map
5470
5810
  * @returns {object} returnType: object - object containing isAnimating boolean and id string
5471
5811
  */
5812
+
5472
5813
  var linkedMapAnimationInfo = createSelector(getMapStore, getSynchronizationGroupStore, getMapById, function (mapStore, syncStore, mapState) {
5473
5814
  var animationInfo = {
5474
5815
  isAnimating: (mapState === null || mapState === void 0 ? void 0 : mapState.isAnimating) || false,
@@ -5488,6 +5829,7 @@ var linkedMapAnimationInfo = createSelector(getMapStore, getSynchronizationGroup
5488
5829
  });
5489
5830
  return animationInfo;
5490
5831
  }, selectorMemoizationOptions);
5832
+
5491
5833
  /**
5492
5834
  * Gets start time of animation
5493
5835
  *
@@ -5501,6 +5843,7 @@ var getAnimationStartTime = createSelector(getMapById, function (store) {
5501
5843
  hours: 6
5502
5844
  }), dateFormat);
5503
5845
  }, selectorMemoizationOptions);
5846
+
5504
5847
  /**
5505
5848
  * Gets end time of animation
5506
5849
  *
@@ -5514,6 +5857,7 @@ var getAnimationEndTime = createSelector(getMapById, function (store) {
5514
5857
  minutes: 10
5515
5858
  }), dateFormat);
5516
5859
  }, selectorMemoizationOptions);
5860
+
5517
5861
  /**
5518
5862
  * Returns map is auto updating
5519
5863
  *
@@ -5525,6 +5869,7 @@ var getAnimationEndTime = createSelector(getMapById, function (store) {
5525
5869
  var isAutoUpdating = createSelector(getMapById, function (store) {
5526
5870
  return store ? store.isAutoUpdating : false;
5527
5871
  }, selectorMemoizationOptions);
5872
+
5528
5873
  /**
5529
5874
  * Gets if endTime and duration of animationPayload are overriding maxValue and minValue of leading layer
5530
5875
  *
@@ -5536,6 +5881,7 @@ var isAutoUpdating = createSelector(getMapById, function (store) {
5536
5881
  var shouldEndtimeOverride = createSelector(getMapById, function (store) {
5537
5882
  return store ? store.shouldEndtimeOverride : false;
5538
5883
  }, selectorMemoizationOptions);
5884
+
5539
5885
  /**
5540
5886
  * Gets activeLayerId for map
5541
5887
  *
@@ -5549,6 +5895,7 @@ var getActiveLayerId = createSelector(getMapById, function (store) {
5549
5895
  }
5550
5896
  return undefined;
5551
5897
  }, selectorMemoizationOptions);
5898
+
5552
5899
  /**
5553
5900
  * Gets autoUpdateLayerId for map
5554
5901
  *
@@ -5559,6 +5906,7 @@ var getActiveLayerId = createSelector(getMapById, function (store) {
5559
5906
  var getAutoUpdateLayerId = createSelector(getMapById, function (store) {
5560
5907
  return store === null || store === void 0 ? void 0 : store.autoUpdateLayerId;
5561
5908
  }, selectorMemoizationOptions);
5909
+
5562
5910
  /**
5563
5911
  * Gets autoUpdateLayerId for map
5564
5912
  *
@@ -5569,6 +5917,7 @@ var getAutoUpdateLayerId = createSelector(getMapById, function (store) {
5569
5917
  var getAutoTimeStepLayerId = createSelector(getMapById, function (store) {
5570
5918
  return store === null || store === void 0 ? void 0 : store.autoTimeStepLayerId;
5571
5919
  }, selectorMemoizationOptions);
5920
+
5572
5921
  /**
5573
5922
  * Gets span of a time slider of a map
5574
5923
  *
@@ -5580,6 +5929,7 @@ var getAutoTimeStepLayerId = createSelector(getMapById, function (store) {
5580
5929
  var getMapTimeSliderSpan = createSelector(getMapById, function (store) {
5581
5930
  return store ? store.timeSliderSpan : defaultTimeSpan;
5582
5931
  }, selectorMemoizationOptions);
5932
+
5583
5933
  /**
5584
5934
  * Gets time step of a map
5585
5935
  *
@@ -5595,6 +5945,7 @@ var getMapTimeStep = createSelector(getMapById, function (store) {
5595
5945
  var getMapTimeStepWithoutDefault = createSelector(getMapById, function (store) {
5596
5946
  return store === null || store === void 0 ? void 0 : store.timeStep;
5597
5947
  }, selectorMemoizationOptions);
5948
+
5598
5949
  /**
5599
5950
  * Returns the speed of animation
5600
5951
  *
@@ -5606,6 +5957,7 @@ var getMapTimeStepWithoutDefault = createSelector(getMapById, function (store) {
5606
5957
  var getMapAnimationDelay = createSelector(getMapById, function (store) {
5607
5958
  return store ? store.animationDelay : defaultAnimationDelayAtStart;
5608
5959
  }, selectorMemoizationOptions);
5960
+
5609
5961
  /**
5610
5962
  * Returns the width of time slider
5611
5963
  *
@@ -5617,6 +5969,7 @@ var getMapAnimationDelay = createSelector(getMapById, function (store) {
5617
5969
  var getMapTimeSliderWidth = createSelector(getMapById, function (store) {
5618
5970
  return store ? store.timeSliderWidth : 0;
5619
5971
  }, selectorMemoizationOptions);
5972
+
5620
5973
  /**
5621
5974
  * Returns the center time of time slider
5622
5975
  *
@@ -5642,6 +5995,7 @@ var getMapTimeSliderStartCenterEndAndStep = createSelector(getMapById, function
5642
5995
  step: step
5643
5996
  };
5644
5997
  }, selectorMemoizationOptions);
5998
+
5645
5999
  /**
5646
6000
  * Returns the number of seconds per pixel on the time slider
5647
6001
  *
@@ -5653,6 +6007,7 @@ var getMapTimeSliderStartCenterEndAndStep = createSelector(getMapById, function
5653
6007
  var getMapTimeSliderSecondsPerPx = createSelector(getMapById, function (store) {
5654
6008
  return store ? store.timeSliderSecondsPerPx : defaultSecondsPerPx;
5655
6009
  }, selectorMemoizationOptions);
6010
+
5656
6011
  /**
5657
6012
  * Returns map is timestep auto
5658
6013
  *
@@ -5664,6 +6019,7 @@ var getMapTimeSliderSecondsPerPx = createSelector(getMapById, function (store) {
5664
6019
  var isTimestepAuto = createSelector(getMapById, function (store) {
5665
6020
  return store ? store.isTimestepAuto : false;
5666
6021
  }, selectorMemoizationOptions);
6022
+
5667
6023
  /**
5668
6024
  * Returns map is animation auto
5669
6025
  * @param {object} store store: object - store object
@@ -5673,6 +6029,7 @@ var isTimestepAuto = createSelector(getMapById, function (store) {
5673
6029
  var isAnimationLengthAuto = createSelector(getMapById, function (store) {
5674
6030
  return (store === null || store === void 0 ? void 0 : store.isAnimationLengthAuto) || false;
5675
6031
  }, selectorMemoizationOptions);
6032
+
5676
6033
  /**
5677
6034
  * Returns map is timespan auto
5678
6035
  *
@@ -5684,6 +6041,7 @@ var isAnimationLengthAuto = createSelector(getMapById, function (store) {
5684
6041
  var isTimeSpanAuto = createSelector(getMapById, function (store) {
5685
6042
  return store ? store.isTimeSpanAuto : false;
5686
6043
  }, selectorMemoizationOptions);
6044
+
5687
6045
  /**
5688
6046
  * Returns map is time slider hover
5689
6047
  *
@@ -5695,6 +6053,7 @@ var isTimeSpanAuto = createSelector(getMapById, function (store) {
5695
6053
  var isTimeSliderHoverOn = createSelector(getMapById, function (store) {
5696
6054
  return store ? store.isTimeSliderHoverOn : false;
5697
6055
  }, selectorMemoizationOptions);
6056
+
5698
6057
  /**
5699
6058
  * Returns map if zoomcontrols are visible
5700
6059
  *
@@ -5706,6 +6065,7 @@ var isTimeSliderHoverOn = createSelector(getMapById, function (store) {
5706
6065
  var isZoomControlsVisible = createSelector(getMapById, function (store) {
5707
6066
  return store ? store.shouldShowZoomControls : true;
5708
6067
  }, selectorMemoizationOptions);
6068
+
5709
6069
  /**
5710
6070
  * Returns map is time slider visible
5711
6071
  *
@@ -5717,6 +6077,7 @@ var isZoomControlsVisible = createSelector(getMapById, function (store) {
5717
6077
  var isTimeSliderVisible = createSelector(getMapById, function (store) {
5718
6078
  return store ? store.isTimeSliderVisible : true;
5719
6079
  }, selectorMemoizationOptions);
6080
+
5720
6081
  /**
5721
6082
  * Returns is layer is active layer
5722
6083
  *
@@ -5731,6 +6092,7 @@ var getIsLayerActiveLayer = createSelector(getActiveLayerId, function (_store, _
5731
6092
  }, function (activeLayerId, layerId) {
5732
6093
  return activeLayerId === layerId;
5733
6094
  }, selectorMemoizationOptions);
6095
+
5734
6096
  /**
5735
6097
  * Returns the mapId for given layerId
5736
6098
  *
@@ -5744,6 +6106,7 @@ var getMapIdFromLayerId = createSelector(function (store) {
5744
6106
  }, function (_store, layerId) {
5745
6107
  return layerId;
5746
6108
  }, findMapIdFromLayerId, selectorMemoizationOptions);
6109
+
5747
6110
  /**
5748
6111
  * Returns the layerId for given layerName
5749
6112
  *
@@ -5764,6 +6127,7 @@ var getLayerIdByLayerName = createSelector(getMapLayers, function (_store, _mapI
5764
6127
  }
5765
6128
  return null;
5766
6129
  }, selectorMemoizationOptions);
6130
+
5767
6131
  /**
5768
6132
  * Returns the layerIndex in the map for given layerId
5769
6133
  *
@@ -5780,6 +6144,7 @@ var getLayerIndexByLayerId = createSelector(getMapLayers, function (_store, _map
5780
6144
  return layer.id === layerId;
5781
6145
  });
5782
6146
  }, selectorMemoizationOptions);
6147
+
5783
6148
  /**
5784
6149
  * Returns the Layer in the map for given layerIndex
5785
6150
  *
@@ -5797,6 +6162,7 @@ var getLayerByLayerIndex = createSelector(getMapLayers, function (_store, _mapId
5797
6162
  }
5798
6163
  return null;
5799
6164
  }, selectorMemoizationOptions);
6165
+
5800
6166
  /**
5801
6167
  * Returns name of all unique dimensions present in all maps
5802
6168
  *
@@ -5818,6 +6184,7 @@ var getAllUniqueDimensions = createSelector(getAllMapIds, function (store) {
5818
6184
  return uniqueMapDims;
5819
6185
  }, []);
5820
6186
  }, selectorMemoizationOptions);
6187
+
5821
6188
  /**
5822
6189
  * Returns the mapPinLocation for the current map
5823
6190
  *
@@ -5829,6 +6196,7 @@ var getAllUniqueDimensions = createSelector(getAllMapIds, function (store) {
5829
6196
  var getPinLocation = createSelector(getMapById, function (store) {
5830
6197
  return store === null || store === void 0 ? void 0 : store.mapPinLocation;
5831
6198
  }, selectorMemoizationOptions);
6199
+
5832
6200
  /**
5833
6201
  * Returns the disable map pin boolean for the current map
5834
6202
  *
@@ -5840,6 +6208,7 @@ var getPinLocation = createSelector(getMapById, function (store) {
5840
6208
  var getDisableMapPin = createSelector([getMapById], function (map) {
5841
6209
  return map === null || map === void 0 ? void 0 : map.disableMapPin;
5842
6210
  }, selectorMemoizationOptions);
6211
+
5843
6212
  /**
5844
6213
  * Returns the display map pin boolean for the current map
5845
6214
  *
@@ -5851,26 +6220,27 @@ var getDisableMapPin = createSelector([getMapById], function (map) {
5851
6220
  var getDisplayMapPin = createSelector(getMapById, function (store) {
5852
6221
  return store ? store.displayMapPin : false;
5853
6222
  }, selectorMemoizationOptions);
6223
+
5854
6224
  /**
5855
- * Returns the legend id
6225
+ * Returns if clock visible from webmap state
5856
6226
  *
5857
- * Example getLegendId(store, mapId);
5858
- * @param {object} store store: object - store object
5859
- * @param {string} mapId mapId: string - Id of the map
5860
- * @returns {boolean} returnType: id or undefined
6227
+ * @param {CoreAppStore} store - The Redux store from which the map state will be extracted.
6228
+ * @returns {boolean | undefined} returnType: boolean
5861
6229
  */
5862
- var getLegendId = createSelector(getMapById, function (store) {
5863
- return store ? store.legendId : undefined;
6230
+ var getIsClockVisible = createSelector(getMapById, function (store) {
6231
+ return store === null || store === void 0 ? void 0 : store.isClockVisible;
5864
6232
  }, selectorMemoizationOptions);
6233
+
5865
6234
  /**
5866
- * Returns if clock visible from webmap state
6235
+ * Returns if clock options menu is visible from webmap state
5867
6236
  *
5868
6237
  * @param {CoreAppStore} store - The Redux store from which the map state will be extracted.
5869
6238
  * @returns {boolean | undefined} returnType: boolean
5870
6239
  */
5871
- var getIsClockVisible = createSelector(getMapById, function (store) {
5872
- return store === null || store === void 0 ? void 0 : store.isClockVisible;
6240
+ var getIsClockOptionsMenuVisible = createSelector(getMapById, function (store) {
6241
+ return store === null || store === void 0 ? void 0 : store.isClockOptionsMenuVisible;
5873
6242
  }, selectorMemoizationOptions);
6243
+
5874
6244
  /**
5875
6245
  * Returns if clock position from webmap state
5876
6246
  *
@@ -5880,6 +6250,7 @@ var getIsClockVisible = createSelector(getMapById, function (store) {
5880
6250
  var getClockPosition = createSelector(getMapById, function (store) {
5881
6251
  return store === null || store === void 0 ? void 0 : store.clockPosition;
5882
6252
  }, selectorMemoizationOptions);
6253
+
5883
6254
  /**
5884
6255
  * Returns if clock size from webmap state
5885
6256
  *
@@ -5889,6 +6260,7 @@ var getClockPosition = createSelector(getMapById, function (store) {
5889
6260
  var getClockSize = createSelector(getMapById, function (store) {
5890
6261
  return store === null || store === void 0 ? void 0 : store.clockSize;
5891
6262
  }, selectorMemoizationOptions);
6263
+
5892
6264
  /**
5893
6265
  * Creates a MapPreset from mapId
5894
6266
  *
@@ -5898,7 +6270,7 @@ var getClockSize = createSelector(getMapById, function (store) {
5898
6270
  * @param {boolean} keepAllDims? keepAllDims: boolean - default false: whether or not to leave the time and reference_time dimentions
5899
6271
  * @returns {MapPreset} returnType: MapPreset
5900
6272
  */
5901
- var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, getAutoTimeStepLayerId, getAutoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, getAnimationStartTime, getAnimationEndTime, getMapTimeSliderSpan, getMapDimensions, isTimestepAuto, isTimeSpanAuto, getLegendId, function (store, mapId) {
6273
+ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLayers, getBbox, getSrs, getActiveLayerId, getAutoTimeStepLayerId, getAutoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, getDisplayMapPin, isZoomControlsVisible, getMapTimeStep, getMapAnimationDelay, getAnimationStartTime, getAnimationEndTime, getMapTimeSliderSpan, getMapDimensions, isTimestepAuto, isTimeSpanAuto, function (store, mapId) {
5902
6274
  var _getMapById$dockedLay, _getMapById;
5903
6275
  return (_getMapById$dockedLay = (_getMapById = getMapById(store, mapId)) === null || _getMapById === void 0 ? void 0 : _getMapById.dockedLayerManagerSize) !== null && _getMapById$dockedLay !== void 0 ? _getMapById$dockedLay : 'sizeSmall';
5904
6276
  }, function (store, mapId) {
@@ -5910,13 +6282,13 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
5910
6282
  }, function (store, mapId) {
5911
6283
  var _getMapById3;
5912
6284
  return (_getMapById3 = getMapById(store, mapId)) === null || _getMapById3 === void 0 ? void 0 : _getMapById3.dockedLayerManagerDimensions;
5913
- }, getIsClockVisible, getClockPosition, getClockSize, getUiStore, function (_store, mapId) {
6285
+ }, getIsClockVisible, getIsClockOptionsMenuVisible, getClockPosition, getClockSize, getUiStore, function (_store, mapId) {
5914
6286
  return mapId;
5915
6287
  }, function (_store, _mapId) {
5916
6288
  var keepAllDims = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
5917
6289
  return keepAllDims;
5918
- }, function (mapLayers, baseLayers, overLayers, bbox, srs, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, displayMapPin, isZoomControlsVisible, mapTimeStep, mapAnimationDelay, animationStartTime, animationEndTime, timeSliderSpan, mapDimensions, isTimestepAuto, isTimeSpanAuto, legendId, dockedLayerManagerSize, dockedLayerManagerPosition, dockedLayerManagerDimensions, isClockVisible, clockPosition, clockSize, uiStore, mapId, keepAllDims) {
5919
- var _overLayers$, _uiStore$dialogs$lege;
6290
+ }, function (mapLayers, baseLayers, overLayers, bbox, srs, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, isAnimating, isAutoUpdating, isTimeSliderVisible, displayMapPin, isZoomControlsVisible, mapTimeStep, mapAnimationDelay, animationStartTime, animationEndTime, timeSliderSpan, mapDimensions, isTimestepAuto, isTimeSpanAuto, dockedLayerManagerSize, dockedLayerManagerPosition, dockedLayerManagerDimensions, isClockVisible, isClockOptionsMenuVisible, clockPosition, clockSize, uiStore, mapId, keepAllDims) {
6291
+ var _overLayers$, _uiStore$dialogs$isOp, _uiStore$dialogs;
5920
6292
  var defaultOverlayer = arguments.length > 31 && arguments[31] !== undefined ? arguments[31] : ((_overLayers$ = overLayers[0]) === null || _overLayers$ === void 0 ? void 0 : _overLayers$.name) || 'none';
5921
6293
  var allLayers = [].concat(_toConsumableArray(baseLayers), _toConsumableArray(overLayers), _toConsumableArray(mapLayers)).map(function (_ref3) {
5922
6294
  _ref3.mapId;
@@ -5942,7 +6314,7 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
5942
6314
  speed: mapAnimationDelay ? getSpeedFactor(mapAnimationDelay) : 1,
5943
6315
  duration: getAnimationDuration(animationEndTime, animationStartTime)
5944
6316
  };
5945
- var shouldShowLegend = legendId ? uiStore === null || uiStore === void 0 || (_uiStore$dialogs$lege = uiStore.dialogs[legendId]) === null || _uiStore$dialogs$lege === void 0 ? void 0 : _uiStore$dialogs$lege.isOpen : false;
6317
+ var shouldShowLegend = (_uiStore$dialogs$isOp = uiStore === null || uiStore === void 0 || (_uiStore$dialogs = uiStore.dialogs["".concat(DialogTypes.Legend, "-").concat(mapId)]) === null || _uiStore$dialogs === void 0 ? void 0 : _uiStore$dialogs.isOpen) !== null && _uiStore$dialogs$isOp !== void 0 ? _uiStore$dialogs$isOp : false;
5946
6318
  var dataExplorerDialog = uiStore === null || uiStore === void 0 ? void 0 : uiStore.dialogs[DialogTypes.DataExplorer];
5947
6319
  var shouldShowDataExplorer = (dataExplorerDialog === null || dataExplorerDialog === void 0 ? void 0 : dataExplorerDialog.isOpen) && (dataExplorerDialog === null || dataExplorerDialog === void 0 ? void 0 : dataExplorerDialog.activeMapId) === mapId || false;
5948
6320
  var dockedLayerManagerDialog = uiStore === null || uiStore === void 0 ? void 0 : uiStore.dialogs["".concat(DialogTypes.DockedLayerManager, "-").concat(mapId)];
@@ -5957,7 +6329,7 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
5957
6329
  }, dockedLayerManagerDimensions && {
5958
6330
  dockedLayerManagerDimensions: dockedLayerManagerDimensions
5959
6331
  }) : {};
5960
- return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
6332
+ return _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
5961
6333
  layers: allLayers
5962
6334
  }, activeLayerId && {
5963
6335
  activeLayerId: activeLayerId
@@ -5984,6 +6356,8 @@ var getMapPreset = createSelector(getMapLayers, getMapBaseLayers, getMapOverLaye
5984
6356
  defaultOverlayer: defaultOverlayer
5985
6357
  }, dockedLayerManagerPreset), isClockVisible !== undefined && {
5986
6358
  isClockVisible: isClockVisible
6359
+ }), isClockOptionsMenuVisible !== undefined && {
6360
+ isClockOptionsMenuVisible: isClockOptionsMenuVisible
5987
6361
  }), clockPosition !== undefined && {
5988
6362
  clockPosition: clockPosition
5989
6363
  }), clockSize !== undefined && {
@@ -6047,8 +6421,8 @@ var getHarmonieInitialProps = function getHarmonieInitialProps(store, panelId, v
6047
6421
  };
6048
6422
  };
6049
6423
  var getTimeSliderInitialProps = function getTimeSliderInitialProps(store, panelId, viewInitialProps) {
6050
- var _viewInitialProps$sli, _syncGroupsSelectors$2;
6051
- var fromView = viewInitialProps === null || viewInitialProps === void 0 || (_viewInitialProps$sli = viewInitialProps.sliderPreset) === null || _viewInitialProps$sli === void 0 ? void 0 : _viewInitialProps$sli.mapId;
6424
+ var _sliderPreset, _syncGroupsSelectors$2;
6425
+ var fromView = viewInitialProps === null || viewInitialProps === void 0 || (_sliderPreset = viewInitialProps.sliderPreset) === null || _sliderPreset === void 0 ? void 0 : _sliderPreset.mapId;
6052
6426
  var mapId = fromView !== null && fromView !== void 0 ? fromView : panelId;
6053
6427
  var syncGroupsIds = (_syncGroupsSelectors$2 = getAllTargetGroupsForSource(store, panelId)) !== null && _syncGroupsSelectors$2 !== void 0 ? _syncGroupsSelectors$2 : [];
6054
6428
  return {
@@ -6058,6 +6432,7 @@ var getTimeSliderInitialProps = function getTimeSliderInitialProps(store, panelI
6058
6432
  syncGroupsIds: syncGroupsIds
6059
6433
  };
6060
6434
  };
6435
+
6061
6436
  /**
6062
6437
  * Gets all enabled layerIds for map
6063
6438
  *
@@ -6068,13 +6443,14 @@ var getTimeSliderInitialProps = function getTimeSliderInitialProps(store, panelI
6068
6443
  */
6069
6444
  var getMapLayerIdsEnabled = createSelector(getLayerIds, getLayersById, function (mapLayerIds, layers) {
6070
6445
  return mapLayerIds.reduce(function (list, layerId) {
6071
- var _layers$layerId;
6072
- if ((_layers$layerId = layers[layerId]) !== null && _layers$layerId !== void 0 && _layers$layerId.enabled) {
6446
+ var _layerId;
6447
+ if ((_layerId = layers[layerId]) !== null && _layerId !== void 0 && _layerId.enabled) {
6073
6448
  return list.concat(layerId);
6074
6449
  }
6075
6450
  return list;
6076
6451
  }, []);
6077
6452
  }, selectorMemoizationOptions);
6453
+
6078
6454
  /**
6079
6455
  * Returns if a map dimension is used for any enabled layers on that map
6080
6456
  *
@@ -6091,6 +6467,7 @@ var getIsEnabledLayersForMapDimension = createSelector(getMapLayerIdsEnabled, fu
6091
6467
  return enabledMapLayerIds.includes(layerId);
6092
6468
  });
6093
6469
  }, selectorMemoizationOptions);
6470
+
6094
6471
  /**
6095
6472
  * Returns the dockedLayerManagerSize originally set in mapPresets
6096
6473
  *
@@ -6102,6 +6479,7 @@ var getIsEnabledLayersForMapDimension = createSelector(getMapLayerIdsEnabled, fu
6102
6479
  var getDockedLayerManagerSize = createSelector(getMapById, function (store) {
6103
6480
  return store ? store.dockedLayerManagerSize : 'sizeSmall';
6104
6481
  }, selectorMemoizationOptions);
6482
+
6105
6483
  /**
6106
6484
  * Returns the dockedLayerManagerPosition originally set in mapPresets
6107
6485
  *
@@ -6120,17 +6498,20 @@ var getDockedLayerManagerPosition = createSelector(getMapById, function (store)
6120
6498
  var getDockedLayerManagerDimensions = createSelector(getMapById, function (store) {
6121
6499
  return store === null || store === void 0 ? void 0 : store.dockedLayerManagerDimensions;
6122
6500
  }, selectorMemoizationOptions);
6501
+
6123
6502
  /**
6124
6503
  * Returns the animation list for given map id
6125
6504
  * @param {object} store store: object - store object
6126
6505
  * @param {string} mapId mapId: string - Id of the map
6127
6506
  * @returns {animationList} returnType: WebMapAnimationList, list of timesteps to animate for this map.
6128
6507
  */
6508
+
6129
6509
  var getAnimationList = createSelector(getLayersById, getMapById, getAnimationStartTime, getAnimationEndTime, getMapTimeStep, function (layers, mapStore, animationStart, animationEnd, animationInterval) {
6130
6510
  var _mapStore$timeList, _layers$autoTimeStepL;
6131
6511
  // Animation is defined by one of the following:
6132
6512
  // - start, end and interval for a continuous animation loop
6133
6513
  // - timeList, for a custom timeList
6514
+
6134
6515
  // Here the animation is defined by a timeList
6135
6516
  if (mapStore !== null && mapStore !== void 0 && (_mapStore$timeList = mapStore.timeList) !== null && _mapStore$timeList !== void 0 && _mapStore$timeList.length) {
6136
6517
  return mapStore.timeList;
@@ -6144,6 +6525,7 @@ var getAnimationList = createSelector(getLayersById, getMapById, getAnimationSta
6144
6525
  var unixAnimationStart = roundWithTimeStep(Number(animationStart && dateUtils.unix(dateUtils.utc(animationStart))), animationInterval, 'ceil');
6145
6526
  var unixAnimationEnd = roundWithTimeStep(Number(animationEnd && dateUtils.unix(dateUtils.utc(animationEnd))), animationInterval, 'floor');
6146
6527
  var animationList = mapStore !== null && mapStore !== void 0 && mapStore.isTimestepAuto ? generateAnimationList(unixAnimationStart, unixAnimationEnd, values) : generateAnimationList(unixAnimationStart, unixAnimationEnd, values, animationInterval);
6528
+
6147
6529
  // If no animationList is generated, generate a default list using the interval from map
6148
6530
  if (!animationList.length) {
6149
6531
  var timeList = [];
@@ -6163,6 +6545,7 @@ var getAnimationListAsEpochTimes = createSelector(getAnimationList, function (li
6163
6545
  return dateUtils.parseISO(handleDateUtilsISOString(kvp.value)).getTime();
6164
6546
  });
6165
6547
  }, selectorMemoizationOptions);
6548
+
6166
6549
  /**
6167
6550
  * @param {object} store store: object - store object
6168
6551
  * @param {string} mapId mapId: string - Id of the map
@@ -6184,6 +6567,7 @@ var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, ge
6184
6567
  animationEndTime: animationEndTime
6185
6568
  };
6186
6569
  }, selectorMemoizationOptions);
6570
+
6187
6571
  /**
6188
6572
  * Gets intialViewMapPreset from webmap state
6189
6573
  *
@@ -6193,6 +6577,7 @@ var getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, ge
6193
6577
  var getdefaultMapSettings = createSelector(getMapStore, function (state) {
6194
6578
  return state === null || state === void 0 ? void 0 : state.defaultMapSettings;
6195
6579
  }, selectorMemoizationOptions);
6580
+
6196
6581
  /**
6197
6582
  * Gets the layers of intialViewMapPreset from webmap state
6198
6583
  *
@@ -6202,6 +6587,7 @@ var getdefaultMapSettings = createSelector(getMapStore, function (state) {
6202
6587
  var getdefaultMapSettingsLayers = createSelector(getdefaultMapSettings, function (state) {
6203
6588
  return state === null || state === void 0 ? void 0 : state.layers;
6204
6589
  }, selectorMemoizationOptions);
6590
+
6205
6591
  /**
6206
6592
  * Gets the selected overlayer from webmap state
6207
6593
  *
@@ -6211,6 +6597,7 @@ var getdefaultMapSettingsLayers = createSelector(getdefaultMapSettings, function
6211
6597
  var getSelectedOverlayerByMapId = createSelector(getMapById, function (store) {
6212
6598
  return (store === null || store === void 0 ? void 0 : store.overLayers[0]) || null;
6213
6599
  }, selectorMemoizationOptions);
6600
+
6214
6601
  /**
6215
6602
  * Gets the RefTimeDimensionModes of intialViewMapPreset from webmap state
6216
6603
  *
@@ -6246,6 +6633,7 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
6246
6633
  getFirstMap: getFirstMap,
6247
6634
  getFirstMapId: getFirstMapId,
6248
6635
  getHarmonieInitialProps: getHarmonieInitialProps,
6636
+ getIsClockOptionsMenuVisible: getIsClockOptionsMenuVisible,
6249
6637
  getIsClockVisible: getIsClockVisible,
6250
6638
  getIsEnabledLayersForMapDimension: getIsEnabledLayersForMapDimension,
6251
6639
  getIsLayerActiveLayer: getIsLayerActiveLayer,
@@ -6254,7 +6642,6 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
6254
6642
  getLayerIdByLayerName: getLayerIdByLayerName,
6255
6643
  getLayerIds: getLayerIds,
6256
6644
  getLayerIndexByLayerId: getLayerIndexByLayerId,
6257
- getLegendId: getLegendId,
6258
6645
  getMapAnimationDelay: getMapAnimationDelay,
6259
6646
  getMapBaseLayers: getMapBaseLayers,
6260
6647
  getMapBaseLayersIds: getMapBaseLayersIds,
@@ -6314,14 +6701,15 @@ var selectors$1 = /*#__PURE__*/Object.freeze({
6314
6701
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
6315
6702
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
6316
6703
  * */
6317
- var MapActionOrigin;
6318
- (function (MapActionOrigin) {
6704
+
6705
+ var MapActionOrigin = /*#__PURE__*/function (MapActionOrigin) {
6319
6706
  MapActionOrigin["map"] = "map";
6320
- })(MapActionOrigin || (MapActionOrigin = {}));
6707
+ return MapActionOrigin;
6708
+ }({});
6321
6709
 
6322
6710
  var enums = /*#__PURE__*/Object.freeze({
6323
6711
  __proto__: null,
6324
- get MapActionOrigin () { return MapActionOrigin; }
6712
+ MapActionOrigin: MapActionOrigin
6325
6713
  });
6326
6714
 
6327
6715
  var filterLayers = function filterLayers() {
@@ -6405,6 +6793,7 @@ var mapUtils = _objectSpread2(_objectSpread2({}, utils$2), {}, {
6405
6793
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
6406
6794
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
6407
6795
  * */
6796
+
6408
6797
  var WmLayerWithoutTimeDimension = webmapTestSettings.WmLayerWithoutTimeDimension,
6409
6798
  WmMultiDimensionLayer = webmapTestSettings.WmMultiDimensionLayer,
6410
6799
  layerWithoutTimeDimension = webmapTestSettings.layerWithoutTimeDimension;
@@ -6576,6 +6965,7 @@ var getTargetLayerIdFromPayload = function getTargetLayerIdFromPayload(state, ma
6576
6965
  if (!payload) {
6577
6966
  return null;
6578
6967
  }
6968
+
6579
6969
  /* Try to find the layer for the DeleteLayerPayload, it uses layerIndex to reference the layer */
6580
6970
  if ('layerIndex' in payload) {
6581
6971
  var tempLayerIndex = payload.layerIndex;
@@ -6584,6 +6974,7 @@ var getTargetLayerIdFromPayload = function getTargetLayerIdFromPayload(state, ma
6584
6974
  return !targetLayer ? null : targetLayer.id;
6585
6975
  }
6586
6976
  }
6977
+
6587
6978
  /* Try to find the layer for the LayerActionsWithLayerIds, it uses layerId to reference the layer */
6588
6979
  if ('layerId' in payload) {
6589
6980
  var _targetLayer = getLayerByLayerIndex(state, targetMapId, getLayerIndexByLayerId(state, mapId, payload.layerId));
@@ -6592,6 +6983,7 @@ var getTargetLayerIdFromPayload = function getTargetLayerIdFromPayload(state, ma
6592
6983
  /* This payload probably does not reference to a layerId */
6593
6984
  return null;
6594
6985
  };
6986
+
6595
6987
  /**
6596
6988
  * Local helper function used by getLayerDeleteActionsTargets, getLayerActionsTargets, getAddLayerActionsTargets, getTargetLayerIdFromPayload to find the targets
6597
6989
  * @param state
@@ -6631,6 +7023,7 @@ var findTargets = function findTargets(state, payload, actionType, sourceMapId)
6631
7023
  }
6632
7024
  return actionPayloads;
6633
7025
  };
7026
+
6634
7027
  /**
6635
7028
  * These targets are found for layer actions that work with a layerId like: SetLayerName, SetLayerEnabled, SetLayerOpacity, SetLayerDimension and SetLayerStyle
6636
7029
  * @param state
@@ -6653,6 +7046,7 @@ var getLayerActionsTargets = function getLayerActionsTargets(state, payload, act
6653
7046
  });
6654
7047
  });
6655
7048
  };
7049
+
6656
7050
  /**
6657
7051
  * These targets are found for the layer/map action AddLayer. AddLayer does not have a layerId (because it's new)
6658
7052
  * @param state
@@ -6665,7 +7059,8 @@ var getAddLayerActionsTargets = function getAddLayerActionsTargets(state, payloa
6665
7059
  return foundTargets.map(function (_ref) {
6666
7060
  var payload = _ref.payload,
6667
7061
  targetId = _ref.targetId;
6668
- var layer = payload.layer;
7062
+ var _ref2 = payload,
7063
+ layer = _ref2.layer;
6669
7064
  layer.id;
6670
7065
  var layerWithoutId = _objectWithoutProperties(layer, _excluded$1);
6671
7066
  var layerId = webmapUtils.generateLayerId();
@@ -6677,6 +7072,7 @@ var getAddLayerActionsTargets = function getAddLayerActionsTargets(state, payloa
6677
7072
  });
6678
7073
  });
6679
7074
  };
7075
+
6680
7076
  /**
6681
7077
  * These targets are found for the layer/map action DeleteLayer. The layer is already gone, so there is no layerId anymore. Using layerIndex instead.
6682
7078
  * @param state
@@ -6694,6 +7090,7 @@ var getLayerDeleteActionsTargets = function getLayerDeleteActionsTargets(state,
6694
7090
  });
6695
7091
  });
6696
7092
  };
7093
+
6697
7094
  /**
6698
7095
  * These targets are found for the layer/map action MoveLayer. Here layers are referenced by newIndex and oldIndex.
6699
7096
  * @param state
@@ -6710,6 +7107,7 @@ var getLayerMoveActionsTargets = function getLayerMoveActionsTargets(state, payl
6710
7107
  });
6711
7108
  });
6712
7109
  };
7110
+
6713
7111
  /**
6714
7112
  * These targets are found for the map action SetAutoLayerId. It needs both a target mapId and layerId
6715
7113
  * @param state
@@ -6730,6 +7128,7 @@ var getSetAutoLayerIdActionsTargets = function getSetAutoLayerIdActionsTargets(s
6730
7128
  };
6731
7129
  });
6732
7130
  };
7131
+
6733
7132
  /**
6734
7133
  * These targets are found for baselayer actions that work with a mapId like: setBaseLayers
6735
7134
  * @param state
@@ -6795,6 +7194,7 @@ genericListener.startListening({
6795
7194
  return effect;
6796
7195
  }()
6797
7196
  });
7197
+
6798
7198
  // Synchronize timeslider settings for actions 'centertime', 'span' and 'timestep'.
6799
7199
  genericListener.startListening({
6800
7200
  matcher: isAnyOf(mapActions.setTimeSliderCenterTime, mapActions.setTimeSliderSpan, mapActions.setTimeStep, mapActions.setAnimationStartTime, mapActions.setAnimationEndTime, mapActions.setAnimationDelay, mapActions.mapStartAnimation),
@@ -6878,6 +7278,7 @@ genericListener.startListening({
6878
7278
  case 0:
6879
7279
  payload = _ref4.payload, type = _ref4.type;
6880
7280
  listenerApi.cancelActiveListeners();
7281
+
6881
7282
  /* Should not listen to actions from itself */
6882
7283
  if (!((payload === null || payload === void 0 ? void 0 : payload.origin) === LayerActionOrigin.ReactMapViewParseLayer)) {
6883
7284
  _context4.next = 4;
@@ -6911,6 +7312,7 @@ genericListener.startListening({
6911
7312
  case 0:
6912
7313
  payload = _ref5.payload, type = _ref5.type;
6913
7314
  listenerApi.cancelActiveListeners();
7315
+
6914
7316
  /* Should not listen to actions from itself */
6915
7317
  if (!((payload === null || payload === void 0 ? void 0 : payload.origin) === LayerActionOrigin.ReactMapViewParseLayer)) {
6916
7318
  _context5.next = 4;
@@ -6976,6 +7378,7 @@ genericListener.startListening({
6976
7378
  case 0:
6977
7379
  payload = _ref7.payload, type = _ref7.type;
6978
7380
  listenerApi.cancelActiveListeners();
7381
+
6979
7382
  /* Should not listen to actions from itself */
6980
7383
  if (!((payload === null || payload === void 0 ? void 0 : payload.origin) === LayerActionOrigin.ReactMapViewParseLayer)) {
6981
7384
  _context7.next = 4;
@@ -7035,6 +7438,7 @@ genericListener.startListening({
7035
7438
  case 0:
7036
7439
  payload = _ref9.payload, type = _ref9.type;
7037
7440
  listenerApi.cancelActiveListeners();
7441
+
7038
7442
  /* Should not listen to actions from itself */
7039
7443
  if (!((payload === null || payload === void 0 ? void 0 : payload.origin) === LayerActionOrigin.ReactMapViewParseLayer)) {
7040
7444
  _context9.next = 4;
@@ -7068,6 +7472,7 @@ genericListener.startListening({
7068
7472
  case 0:
7069
7473
  payload = _ref0.payload, type = _ref0.type;
7070
7474
  listenerApi.cancelActiveListeners();
7475
+
7071
7476
  /* Should not listen to actions from itself */
7072
7477
  if (!((payload === null || payload === void 0 ? void 0 : payload.origin) === LayerActionOrigin.ReactMapViewParseLayer)) {
7073
7478
  _context0.next = 4;
@@ -7096,6 +7501,7 @@ genericListener.startListening({
7096
7501
  var stepMap = new Map();
7097
7502
  /* A map with a list of timers and their dwell */
7098
7503
  var timerDwellMap = new Map();
7504
+
7099
7505
  /**
7100
7506
  * Returns the next step for given timerId.
7101
7507
  * @param timerId The timer id
@@ -7110,6 +7516,7 @@ var getNextStep = function getNextStep(timerId, numberOfStepsInAnimation) {
7110
7516
  var nextStepClipped = (nextStep % numberOfStepsInAnimation + numberOfStepsInAnimation) % numberOfStepsInAnimation;
7111
7517
  return nextStepClipped;
7112
7518
  };
7519
+
7113
7520
  /**
7114
7521
  * Handles dwell at the end of the animation loop sequence. The number of steps to wait till proceed can be set by the dwell parameter.
7115
7522
  * @param timerId The timer id
@@ -7126,6 +7533,7 @@ var handleTimerDwell = function handleTimerDwell(timerId, numberOfStepsInAnimati
7126
7533
  timerDwellMap.set(timerId, dwell);
7127
7534
  return false;
7128
7535
  }
7536
+
7129
7537
  // We are at the last animation step, check the dwell
7130
7538
  var timerDwell = timerDwellMap.has(timerId) && timerDwellMap.get(timerId) || 0;
7131
7539
  if (currentStep === numberOfStepsInAnimation - 1 && timerDwell > 0) {
@@ -7135,6 +7543,7 @@ var handleTimerDwell = function handleTimerDwell(timerId, numberOfStepsInAnimati
7135
7543
  }
7136
7544
  return false;
7137
7545
  };
7546
+
7138
7547
  /**
7139
7548
  * Set step for the timerId
7140
7549
  * @param timerId
@@ -7143,6 +7552,7 @@ var handleTimerDwell = function handleTimerDwell(timerId, numberOfStepsInAnimati
7143
7552
  var setStep = function setStep(timerId, timerStep) {
7144
7553
  stepMap.set(timerId, timerStep);
7145
7554
  };
7555
+
7146
7556
  /**
7147
7557
  * Gets the current step for the timer
7148
7558
  * @param timerId
@@ -7151,6 +7561,7 @@ var setStep = function setStep(timerId, timerStep) {
7151
7561
  var getCurrentStep = function getCurrentStep(timerId) {
7152
7562
  return stepMap.get(timerId) || 0;
7153
7563
  };
7564
+
7154
7565
  /**
7155
7566
  * Checks if the next step is available for all provided layers
7156
7567
  * @param reduxLayers
@@ -7164,6 +7575,7 @@ var isNextStepAvailable = function isNextStepAvailable(reduxLayers, nextTimeStri
7164
7575
  }).filter(function (layer) {
7165
7576
  return !!layer && layer.enabled;
7166
7577
  });
7578
+
7167
7579
  // Returns a layer which could have an image for the requested time, but which isn't loaded yet.
7168
7580
  var isThereSomethingNotAvailable = wmLayers.map(function (layer) {
7169
7581
  var _layer$getDimension;
@@ -7183,6 +7595,7 @@ var isNextStepAvailable = function isNextStepAvailable(reduxLayers, nextTimeStri
7183
7595
  }
7184
7596
  var olSource = layer.olSource;
7185
7597
  var hasImageAvailableForRequestedTimeStep = olSource.isImageLoadingForTimestep(closestValue);
7598
+
7186
7599
  // If there is no image available for requested timestep, return true and flag that this thing is not ready yet.
7187
7600
  if (hasImageAvailableForRequestedTimeStep) {
7188
7601
  return {
@@ -7199,6 +7612,7 @@ var isNextStepAvailable = function isNextStepAvailable(reduxLayers, nextTimeStri
7199
7612
  }).length === wmLayers.length;
7200
7613
  return nextStepIsAvailable;
7201
7614
  };
7615
+
7202
7616
  /**
7203
7617
  * This handler is triggered by the metronome. An array of timerIds is given as argument.
7204
7618
  * It will update the animation loop of multiple maps and sliders
@@ -7230,7 +7644,18 @@ var olMetronomeHandler = function olMetronomeHandler(timerIds, listenerApi) {
7230
7644
  }
7231
7645
  });
7232
7646
  }
7647
+ if (!targets.some(function (target) {
7648
+ return target.targetId === timerId;
7649
+ })) {
7650
+ targets.push({
7651
+ targetId: timerId,
7652
+ value: {
7653
+ currentTime: ''
7654
+ }
7655
+ });
7656
+ }
7233
7657
  var timerIsInDwell = handleTimerDwell(timerId, animationListValues.length);
7658
+
7234
7659
  // Collect all layers for this syncgroups target
7235
7660
  var reduxLayers = [];
7236
7661
  targets.forEach(function (target) {
@@ -7240,6 +7665,7 @@ var olMetronomeHandler = function olMetronomeHandler(timerIds, listenerApi) {
7240
7665
  });
7241
7666
  var nextStep = getNextStep(timerId, animationListValues.length, 1);
7242
7667
  var timerShouldStepForward = isNextStepAvailable(reduxLayers, animationListValues[nextStep]) && !timerIsInDwell;
7668
+
7243
7669
  // Determine the next step
7244
7670
  var timerStep = timerShouldStepForward ? getNextStep(timerId, animationListValues.length) : getCurrentStep(timerId);
7245
7671
  setStep(timerId, timerStep);
@@ -7258,6 +7684,7 @@ var olMetronomeHandler = function olMetronomeHandler(timerIds, listenerApi) {
7258
7684
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
7259
7685
  _loop();
7260
7686
  }
7687
+
7261
7688
  // Update all targets of all sync groups in one action.
7262
7689
  } catch (err) {
7263
7690
  _iterator.e(err);
@@ -7300,6 +7727,7 @@ mapListener.startListening({
7300
7727
  }
7301
7728
  }
7302
7729
  });
7730
+
7303
7731
  // update layer, synced maps and animation on latest max time if autoupdating
7304
7732
  mapListener.startListening({
7305
7733
  actionCreator: layerActions.onUpdateLayerInformation,
@@ -7324,9 +7752,23 @@ mapListener.startListening({
7324
7752
  return;
7325
7753
  }
7326
7754
  var autoUpdateLayerId = getAutoUpdateLayerId(listenerApi.getState(), mapId);
7755
+ var autoTimeStepLayerId = getAutoTimeStepLayerId(listenerApi.getState(), mapId);
7756
+ var autoUpdateLayerHasTimeDimension = autoUpdateLayerId ? getLayerHasTimeDimension(listenerApi.getState(), autoUpdateLayerId) : false;
7757
+ var autoTimeStepLayerHasTimeDimension = autoTimeStepLayerId ? getLayerHasTimeDimension(listenerApi.getState(), autoTimeStepLayerId) : false;
7327
7758
  var shouldAutoUpdate = isAutoUpdating(listenerApi.getState(), mapId);
7328
7759
  var prevTimeDimension = getLayerTimeDimension(listenerApi.getState(), layerId);
7329
- var isAutoUpdateLayer = layerId === autoUpdateLayerId;
7760
+ var hasAutoLayers = !!autoUpdateLayerId && !!autoTimeStepLayerId;
7761
+ var isAutoLayerValid = hasAutoLayers && autoUpdateLayerHasTimeDimension && autoTimeStepLayerHasTimeDimension;
7762
+ var hasTimeDimension = !!newTimeDimension;
7763
+ var shouldSetAutoLayer = !isAutoLayerValid && hasTimeDimension;
7764
+ if (shouldSetAutoLayer) {
7765
+ listenerApi.dispatch(mapActions.setAutoLayerId({
7766
+ mapId: mapId,
7767
+ layerId: layerId
7768
+ }));
7769
+ }
7770
+ var effectiveAutoUpdateLayerId = shouldSetAutoLayer ? layerId : autoUpdateLayerId;
7771
+ var isAutoUpdateLayer = layerId === effectiveAutoUpdateLayerId;
7330
7772
  var incomingMaxTime = newTimeDimension === null || newTimeDimension === void 0 ? void 0 : newTimeDimension.maxValue;
7331
7773
  var isIncomingMaxTimeLaterThanCurrentLayerTime = incomingMaxTime && (prevTimeDimension === null || prevTimeDimension === void 0 ? void 0 : prevTimeDimension.currentValue) && prevTimeDimension.currentValue !== incomingMaxTime;
7332
7774
  if (isAutoUpdateLayer &&
@@ -7370,6 +7812,7 @@ var updateAnimation = function updateAnimation(mapId, maxValue, listenerApi) {
7370
7812
  return;
7371
7813
  }
7372
7814
  var animationStart = getAnimationStartTime(listenerApi.getState(), mapId);
7815
+
7373
7816
  // Calculate how much time the animation start need to move forwards
7374
7817
  var animationEnd = getAnimationEndTime(listenerApi.getState(), mapId);
7375
7818
  var animationEndUnix = dateUtils.unix(dateUtils.utc(animationEnd));
@@ -7381,6 +7824,7 @@ var updateAnimation = function updateAnimation(mapId, maxValue, listenerApi) {
7381
7824
  if (!newAnimationStartTime || !newAnimationEndTime) {
7382
7825
  return;
7383
7826
  }
7827
+
7384
7828
  // Check if the mapId is part of a syncgroup
7385
7829
  var syncedMapIds = getSyncedMapIdsForTimeslider(listenerApi.getState());
7386
7830
  var isSyncedMap = syncedMapIds.includes(mapId);
@@ -7427,6 +7871,7 @@ mapListener.startListening({
7427
7871
  currentValue: timeDimension.maxValue
7428
7872
  }
7429
7873
  }));
7874
+
7430
7875
  // Change time value for all timesliders that are synced by syncgroups
7431
7876
  if (syncedMapIds.length > 0) {
7432
7877
  syncedMapIds.map(function (syncedMapId) {
@@ -7441,6 +7886,7 @@ mapListener.startListening({
7441
7886
  }
7442
7887
  updateAnimation(mapId, timeDimension.maxValue, listenerApi);
7443
7888
  }
7889
+
7444
7890
  // Toggle autoupdate off for synced timesliders
7445
7891
  payloads = syncedMapIds.reduce(function (syncedMapIdList, syncedMapId) {
7446
7892
  if (syncedMapId !== mapId) {
@@ -7477,18 +7923,21 @@ mapListener.startListening({
7477
7923
  var payload = _ref4.payload;
7478
7924
  var mapId = payload.mapId,
7479
7925
  initialTime = payload.initialTime;
7926
+
7480
7927
  // Check if the mapId is part of a syncgroup
7481
7928
  var syncedMapIds = getSyncedMapIdsForTimeslider(listenerApi.getState());
7482
7929
  var isSyncedMap = syncedMapIds.includes(mapId);
7483
7930
  var autoUpdateMapId = syncedMapIds.find(function (syncedMapId) {
7484
7931
  return isAutoUpdating(listenerApi.getState(), syncedMapId);
7485
7932
  });
7933
+
7486
7934
  // Start animation with the mapId that started the animation or in case of syncgroup, the map that is auto updating
7487
7935
  var useMapId = isSyncedMap ? autoUpdateMapId || mapId : mapId;
7488
7936
  var speedDelay = getMapAnimationDelay(listenerApi.getState(), useMapId);
7489
7937
  var speed = 1000 / (speedDelay || 1);
7490
7938
  metronome.register(null, speed, useMapId);
7491
7939
  var timeList = getAnimationList(listenerApi.getState(), useMapId);
7940
+
7492
7941
  // In case of the timeList
7493
7942
  if (timeList && timeList.length > 0) {
7494
7943
  // Determine animation step based on initialTime and timeList
@@ -7519,11 +7968,13 @@ var handleBaseLayers = function handleBaseLayers(mapId, baseLayers, listenerApi)
7519
7968
  return layer.layerType === 'baseLayer';
7520
7969
  });
7521
7970
  var currentAvailableBaseLayers = getAvailableBaseLayersForMap(listenerApi.getState(), mapId);
7971
+
7522
7972
  // find a availableBaseLayer with the same name, and use that id for the active baselayer
7523
7973
  var activeAvailableBaseLayer = currentAvailableBaseLayers.find(function (availableBaseLayer) {
7524
7974
  return availableBaseLayer.name === baseLayer.name;
7525
7975
  });
7526
7976
  var activeBaseLayerId = activeAvailableBaseLayer ? activeAvailableBaseLayer.id : webmapUtils.generateLayerId();
7977
+
7527
7978
  // if the baseLayer can't be found in a visible available baseLayer list, add it
7528
7979
  // This happens when switching to a preset that has non-default baselayers
7529
7980
  if (!activeAvailableBaseLayer && currentAvailableBaseLayers.length) {
@@ -7548,7 +7999,7 @@ mapListener.startListening({
7548
7999
  actionCreator: mapActions.setMapPreset,
7549
8000
  effect: function () {
7550
8001
  var _effect2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref6, listenerApi) {
7551
- var payload, mapId, initialProps, mapPreset, _mapPreset$dimensions, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, shouldShowDockedLayerManager, shouldShowDataExplorer, dockedLayerManagerSize, dockedLayerManagerPosition, dockedLayerManagerDimensions, timeSliderSpan, toggleTimeSpanAuto, defaultOverlayer, isClockVisible, clockPosition, clockSize, _filterLayers, mapLayers, baseLayers, overLayers, _newLayerIds$layers$f, _newLayerIds$layers$f2, autoTimeStepLayerIdNew, autoUpdateLayerIdNew, onlyActiveLayerIdIsSet, newLayerIds, newAutoTimeStepLayerId, newAutoUpdateLayerId, customLayers, customBaseLayer, customOverLayer, baseLayersWithDefaultLayer, overLayersWithDefaultLayer, allBaseLayers, _overlayersFromStore$, overlayersFromStore, foundOverlayerId, checkIsprojectionSupported, animationLength, animationEndTime, shouldEndtimeOverride, interval, timeAlreadySet, endTime, startTime, centerTimeInSeconds, animationEnd, _startTime, duration, _animationEnd, animationStart, shouldOpenLegend, legendId, dockedLayerManagerType, fiveMinuteDelayForAnimation, _animationEnd2, _animationStart;
8002
+ var payload, mapId, initialProps, mapPreset, _mapPreset$dimensions, layers, activeLayerId, autoTimeStepLayerId, autoUpdateLayerId, proj, shouldAutoUpdate, shouldAnimate, animationPayload, toggleTimestepAuto, showTimeSlider, displayMapPin, shouldShowZoomControls, shouldShowLegend, shouldShowDockedLayerManager, shouldShowDataExplorer, dockedLayerManagerSize, dockedLayerManagerPosition, dockedLayerManagerDimensions, timeSliderSpan, toggleTimeSpanAuto, defaultOverlayer, isClockVisible, isClockOptionsMenuVisible, clockPosition, clockSize, _filterLayers, mapLayers, baseLayers, overLayers, _newLayerIds$layers$f, _newLayerIds$layers$f2, autoTimeStepLayerIdNew, autoUpdateLayerIdNew, onlyActiveLayerIdIsSet, newLayerIds, newAutoTimeStepLayerId, newAutoUpdateLayerId, customLayers, customBaseLayer, customOverLayer, baseLayersWithDefaultLayer, overLayersWithDefaultLayer, allBaseLayers, _overlayersFromStore$, overlayersFromStore, foundOverlayerId, checkIsprojectionSupported, animationLength, animationEndTime, shouldEndtimeOverride, interval, timeAlreadySet, endTime, startTime, centerTimeInSeconds, animationEnd, _startTime, duration, _animationEnd, animationStart, shouldOpenLegend, dockedLayerManagerType, fiveMinuteDelayForAnimation, _animationEnd2, _animationStart;
7552
8003
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
7553
8004
  while (1) switch (_context2.prev = _context2.next) {
7554
8005
  case 0:
@@ -7560,7 +8011,7 @@ mapListener.startListening({
7560
8011
  _context2.next = 61;
7561
8012
  break;
7562
8013
  }
7563
- layers = mapPreset.layers, activeLayerId = mapPreset.activeLayerId, autoTimeStepLayerId = mapPreset.autoTimeStepLayerId, autoUpdateLayerId = mapPreset.autoUpdateLayerId, proj = mapPreset.proj, shouldAutoUpdate = mapPreset.shouldAutoUpdate, shouldAnimate = mapPreset.shouldAnimate, animationPayload = mapPreset.animationPayload, toggleTimestepAuto = mapPreset.toggleTimestepAuto, showTimeSlider = mapPreset.showTimeSlider, displayMapPin = mapPreset.displayMapPin, shouldShowZoomControls = mapPreset.shouldShowZoomControls, shouldShowLegend = mapPreset.shouldShowLegend, shouldShowDockedLayerManager = mapPreset.shouldShowDockedLayerManager, shouldShowDataExplorer = mapPreset.shouldShowDataExplorer, dockedLayerManagerSize = mapPreset.dockedLayerManagerSize, dockedLayerManagerPosition = mapPreset.dockedLayerManagerPosition, dockedLayerManagerDimensions = mapPreset.dockedLayerManagerDimensions, timeSliderSpan = mapPreset.timeSliderSpan, toggleTimeSpanAuto = mapPreset.toggleTimeSpanAuto, defaultOverlayer = mapPreset.defaultOverlayer, isClockVisible = mapPreset.isClockVisible, clockPosition = mapPreset.clockPosition, clockSize = mapPreset.clockSize;
8014
+ layers = mapPreset.layers, activeLayerId = mapPreset.activeLayerId, autoTimeStepLayerId = mapPreset.autoTimeStepLayerId, autoUpdateLayerId = mapPreset.autoUpdateLayerId, proj = mapPreset.proj, shouldAutoUpdate = mapPreset.shouldAutoUpdate, shouldAnimate = mapPreset.shouldAnimate, animationPayload = mapPreset.animationPayload, toggleTimestepAuto = mapPreset.toggleTimestepAuto, showTimeSlider = mapPreset.showTimeSlider, displayMapPin = mapPreset.displayMapPin, shouldShowZoomControls = mapPreset.shouldShowZoomControls, shouldShowLegend = mapPreset.shouldShowLegend, shouldShowDockedLayerManager = mapPreset.shouldShowDockedLayerManager, shouldShowDataExplorer = mapPreset.shouldShowDataExplorer, dockedLayerManagerSize = mapPreset.dockedLayerManagerSize, dockedLayerManagerPosition = mapPreset.dockedLayerManagerPosition, dockedLayerManagerDimensions = mapPreset.dockedLayerManagerDimensions, timeSliderSpan = mapPreset.timeSliderSpan, toggleTimeSpanAuto = mapPreset.toggleTimeSpanAuto, defaultOverlayer = mapPreset.defaultOverlayer, isClockVisible = mapPreset.isClockVisible, isClockOptionsMenuVisible = mapPreset.isClockOptionsMenuVisible, clockPosition = mapPreset.clockPosition, clockSize = mapPreset.clockSize;
7564
8015
  _filterLayers = filterLayers(layers), mapLayers = _filterLayers.mapLayers, baseLayers = _filterLayers.baseLayers, overLayers = _filterLayers.overLayers;
7565
8016
  if (layers) {
7566
8017
  // make sure all layers have a unique id before going forward
@@ -7667,6 +8118,7 @@ mapListener.startListening({
7667
8118
  timeSliderSpan: timeSliderSpan
7668
8119
  }));
7669
8120
  }
8121
+
7670
8122
  // toggle time span auto - defaults to true
7671
8123
  listenerApi.dispatch(mapActions.toggleTimeSpanAuto({
7672
8124
  mapId: mapId,
@@ -7693,6 +8145,13 @@ mapListener.startListening({
7693
8145
  isClockVisible: isClockVisible
7694
8146
  }));
7695
8147
  }
8148
+ if (isClockOptionsMenuVisible) {
8149
+ // toggle clock options menu visibility
8150
+ listenerApi.dispatch(mapActions.toggleClockOptions({
8151
+ mapId: mapId,
8152
+ isClockOptionsMenuVisible: isClockOptionsMenuVisible
8153
+ }));
8154
+ }
7696
8155
  if (clockPosition !== undefined) {
7697
8156
  // set clock position
7698
8157
  listenerApi.dispatch(mapActions.setClockPositionSize({
@@ -7707,6 +8166,7 @@ mapListener.startListening({
7707
8166
  size: clockSize
7708
8167
  }));
7709
8168
  }
8169
+
7710
8170
  // sets timestep by interval of animationPayload
7711
8171
  interval = animationPayload === null || animationPayload === void 0 ? void 0 : animationPayload.interval;
7712
8172
  if (interval) {
@@ -7715,6 +8175,7 @@ mapListener.startListening({
7715
8175
  timeStep: interval
7716
8176
  }));
7717
8177
  }
8178
+
7718
8179
  // Check if time dim already set (this is the case when duplicating view via Shift + split window)
7719
8180
  // If set, don't dispatch setTime action
7720
8181
  timeAlreadySet = (_mapPreset$dimensions = mapPreset.dimensions) === null || _mapPreset$dimensions === void 0 ? void 0 : _mapPreset$dimensions.find(function (dimension) {
@@ -7748,6 +8209,7 @@ mapListener.startListening({
7748
8209
  timeSliderCenterTime: centerTimeInSeconds
7749
8210
  }));
7750
8211
  }
8212
+
7751
8213
  // sets animationStartTime by duration of animationPayload
7752
8214
  if (animationLength) {
7753
8215
  animationEnd = getAnimationEndTime(listenerApi.getState(), mapId);
@@ -7768,6 +8230,7 @@ mapListener.startListening({
7768
8230
  }));
7769
8231
  }
7770
8232
  }
8233
+
7771
8234
  // sets animationDelay by speed of animationPayload
7772
8235
  if (animationPayload !== null && animationPayload !== void 0 && animationPayload.speed) {
7773
8236
  listenerApi.dispatch(mapActions.setAnimationDelay({
@@ -7775,6 +8238,7 @@ mapListener.startListening({
7775
8238
  animationDelay: getSpeedDelay(animationPayload.speed)
7776
8239
  }));
7777
8240
  }
8241
+
7778
8242
  // turn animation on
7779
8243
  if (shouldAnimate === true) {
7780
8244
  duration = animationPayload !== null && animationPayload !== void 0 && animationPayload.duration ? animationPayload.duration : 5 * 60; // set to default of 5 hours
@@ -7788,6 +8252,7 @@ mapListener.startListening({
7788
8252
  end: _animationEnd,
7789
8253
  interval: interval || defaultTimeStep
7790
8254
  }));
8255
+
7791
8256
  // If animation interval set, set the timestep auto property to false
7792
8257
  if (interval) {
7793
8258
  listenerApi.dispatch(mapActions.toggleTimestepAuto({
@@ -7802,15 +8267,15 @@ mapListener.startListening({
7802
8267
  timestepAuto: toggleTimestepAuto
7803
8268
  }));
7804
8269
  }
8270
+
7805
8271
  // show legend
7806
8272
  shouldOpenLegend = shouldShowLegend !== undefined ? shouldShowLegend : IS_LEGEND_OPEN_BY_DEFAULT;
7807
- legendId = getLegendId(listenerApi.getState(), mapId);
7808
- if (legendId) {
7809
- listenerApi.dispatch(uiActions.setToggleOpenDialog({
7810
- type: legendId,
7811
- setOpen: shouldOpenLegend
7812
- }));
7813
- }
8273
+ listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
8274
+ type: "".concat(DialogTypes.Legend, "-").concat(mapId),
8275
+ setOpen: shouldOpenLegend,
8276
+ mapId: mapId
8277
+ }));
8278
+
7814
8279
  // show data explorer
7815
8280
  if (shouldShowDataExplorer) {
7816
8281
  listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
@@ -7932,26 +8397,30 @@ mapListener.startListening({
7932
8397
  _mapSelectors$getData2 = _slicedToArray(_mapSelectors$getData, 2),
7933
8398
  dataStartTime = _mapSelectors$getData2[0],
7934
8399
  dataEndTime = _mapSelectors$getData2[1];
8400
+ var hasValidDataStartTime = Number.isFinite(dataStartTime) && dataStartTime > 0 && dataStartTime < 2147483647;
8401
+ var hasValidDataEndTime = Number.isFinite(dataEndTime) && dataEndTime > 0;
7935
8402
  if (dateUtils.isValid(currentTime)) {
7936
8403
  var makeForwardStep = function makeForwardStep() {
7937
8404
  // timeStep is in minutes, convert to seconds
7938
8405
  var timeStepInSeconds = timeStep * 60;
7939
8406
  var nextTime = currentTime + timeStepInSeconds;
8407
+
7940
8408
  // For large timesteps (>12h), round to nearest hour instead of timestep
7941
8409
  // This ensures 12:07 with 24h step goes to 12:00 next day, not 00:00
7942
8410
  var roundingStep = timeStep > 12 * 60 ? 60 : timeStep; // Use 1 hour for large steps
7943
8411
  var roundedTime = roundWithTimeStep(nextTime, roundingStep, 'round');
7944
- var newTime = Math.min(roundedTime, dataEndTime || roundedTime);
8412
+ var newTime = hasValidDataEndTime ? Math.min(roundedTime, dataEndTime) : roundedTime;
7945
8413
  return dateUtils.fromUnix(newTime).toISOString();
7946
8414
  };
7947
8415
  var makeBackwardStep = function makeBackwardStep() {
7948
8416
  // timeStep is in minutes, convert to seconds
7949
8417
  var timeStepInSeconds = timeStep * 60;
7950
8418
  var nextTime = currentTime - timeStepInSeconds;
8419
+
7951
8420
  // For large timesteps (>12h), round to nearest hour instead of timestep
7952
8421
  var roundingStep = timeStep > 12 * 60 ? 60 : timeStep; // Use 1 hour for large steps
7953
8422
  var roundedTime = roundWithTimeStep(nextTime, roundingStep, 'round');
7954
- var newTime = Math.max(roundedTime, dataStartTime || roundedTime);
8423
+ var newTime = hasValidDataStartTime ? Math.max(roundedTime, dataStartTime) : roundedTime;
7955
8424
  return dateUtils.fromUnix(newTime).toISOString();
7956
8425
  };
7957
8426
  var selectedTimeString = isForwardStep ? makeForwardStep() : makeBackwardStep();
@@ -7980,6 +8449,7 @@ var copyView = function copyView(view) {
7980
8449
  projection: view.getProjection()
7981
8450
  });
7982
8451
  };
8452
+
7983
8453
  /**
7984
8454
  * The StoredView objects keep references to OpenLayers View objects that may be shared
7985
8455
  * between multiple maps (when maps are pan/zoom synced).
@@ -7999,6 +8469,8 @@ var StoredView = /*#__PURE__*/function (_Observable) {
7999
8469
  var _this;
8000
8470
  _classCallCheck(this, StoredView);
8001
8471
  _this = _callSuper(this, StoredView);
8472
+ _this.name = void 0;
8473
+ _this.view = void 0;
8002
8474
  _this.name = name;
8003
8475
  _this.view = view;
8004
8476
  return _this;
@@ -8028,6 +8500,7 @@ var createViewObjectForNewMap = function createViewObjectForNewMap(createFromId,
8028
8500
  if (!orig) {
8029
8501
  return;
8030
8502
  }
8503
+
8031
8504
  // If there already is a view for `newId`, use that one but set the view from createFromId
8032
8505
  // this can happen for example when switching presets
8033
8506
  if (VIEW_PER_MAP[newId] !== undefined) {
@@ -8063,6 +8536,7 @@ var getViewObjectForSyncGroup = function getViewObjectForSyncGroup(id) {
8063
8536
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
8064
8537
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
8065
8538
  * */
8539
+
8066
8540
  var openlayersListener = createListenerMiddleware();
8067
8541
  var getGroupForMap = function getGroupForMap(mapId, state) {
8068
8542
  var syncGroupState = getSynchronizationGroupState(state);
@@ -8071,6 +8545,7 @@ var getGroupForMap = function getGroupForMap(mapId, state) {
8071
8545
  return group.type === SYNCGROUPS_TYPE_SETBBOX && group.targets.allIds.includes(mapId);
8072
8546
  });
8073
8547
  };
8548
+
8074
8549
  // This is fired when the preset is set up and when the projection is changed
8075
8550
  openlayersListener.startListening({
8076
8551
  actionCreator: mapActions.setBbox,
@@ -8087,6 +8562,7 @@ openlayersListener.startListening({
8087
8562
  center: getCenter(extent)
8088
8563
  });
8089
8564
  storedViewForMap.setView(view);
8565
+
8090
8566
  // OpenLayers View need a viewportsize to optimally fit an extent to a map. Try to find it in the following order:
8091
8567
  // 1. Try to find the div element containing the layers and get its clientWidth/clientHeight
8092
8568
  // 2. If that fails try the viewport visualViewport width/height
@@ -8097,16 +8573,19 @@ openlayersListener.startListening({
8097
8573
  var viewPortHeight = (mapElement === null || mapElement === void 0 ? void 0 : mapElement.clientHeight) || ((_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 ? void 0 : _window$visualViewpor2.height) || 1024;
8098
8574
  view.setViewportSize([viewPortWidth, viewPortHeight]);
8099
8575
  view.fit(extent);
8576
+
8100
8577
  // Also: if this map is part of a group => change group view
8101
8578
  var mapSyncGroup = getGroupForMap(mapId, listenerApi.getState());
8102
8579
  if (!mapSyncGroup) {
8103
8580
  return;
8104
8581
  }
8105
8582
  var groupView = getViewObjectForSyncGroup(mapSyncGroup);
8583
+
8106
8584
  // Always update groupView to keep bbox extent in sync
8107
8585
  groupView.setView(copyView(view));
8108
8586
  }
8109
8587
  });
8588
+
8110
8589
  // This is fired when the map view is updated (regardless of if the map is in a group or not)
8111
8590
  // When a map is in a group, this needs to ensure the view of the map is kept up-to-date
8112
8591
  openlayersListener.startListening({
@@ -8136,10 +8615,12 @@ openlayersListener.startListening({
8136
8615
  if (payload.type !== SYNCGROUPS_TYPE_SETBBOX) {
8137
8616
  return;
8138
8617
  }
8618
+
8139
8619
  // Ensure there is an openlayers view for the sync group
8140
8620
  getViewObjectForSyncGroup(payload.groupId);
8141
8621
  }
8142
8622
  });
8623
+
8143
8624
  // Ensure sync group view has contents: when a target is added to a group whose view is undefined, copy the view from the target
8144
8625
  openlayersListener.startListening({
8145
8626
  actionCreator: syncGroupAddTarget,
@@ -8284,6 +8765,7 @@ serviceListener.startListening({
8284
8765
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
8285
8766
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
8286
8767
  * */
8768
+
8287
8769
  var initialState$2 = {};
8288
8770
  var slice$2 = createSlice({
8289
8771
  initialState: initialState$2,
@@ -8313,7 +8795,9 @@ var routerReducer = slice$2.reducer,
8313
8795
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
8314
8796
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
8315
8797
  * */
8798
+
8316
8799
  // stores navigate hook method to object, so it can be used outside components
8800
+
8317
8801
  var historyDict = {
8318
8802
  navigate: null
8319
8803
  };
@@ -8524,6 +9008,7 @@ var drawingToolReducer = slice$1.reducer,
8524
9008
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
8525
9009
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
8526
9010
  * */
9011
+
8527
9012
  var getDrawingtoolStore = function getDrawingtoolStore(store) {
8528
9013
  if (store !== null && store !== void 0 && store.drawingtools) {
8529
9014
  return store.drawingtools;
@@ -8591,6 +9076,7 @@ var selectors = /*#__PURE__*/Object.freeze({
8591
9076
 
8592
9077
  var drawingToolListener = createListenerMiddleware();
8593
9078
  var registerOrigin = 'drawings listener:registerDrawToolListener';
9079
+
8594
9080
  // register draw tool
8595
9081
  drawingToolListener.startListening({
8596
9082
  actionCreator: drawingToolActions.registerDrawTool,
@@ -8615,6 +9101,7 @@ drawingToolListener.startListening({
8615
9101
  origin: registerOrigin
8616
9102
  }));
8617
9103
  }
9104
+
8618
9105
  // create intersection layer
8619
9106
  if (geoJSONIntersectionLayerId && mapId) {
8620
9107
  listenerApi.dispatch(layerActions.addLayer({
@@ -8658,6 +9145,7 @@ drawingToolListener.startListening({
8658
9145
  return effect;
8659
9146
  }()
8660
9147
  });
9148
+
8661
9149
  // change draw tool
8662
9150
  drawingToolListener.startListening({
8663
9151
  actionCreator: drawingToolActions.changeDrawToolMode,
@@ -8717,6 +9205,7 @@ drawingToolListener.startListening({
8717
9205
  layerId: drawingTool.geoJSONLayerId,
8718
9206
  geojson: emptyGeoJSON
8719
9207
  }));
9208
+
8720
9209
  // clear intersection shape
8721
9210
  if (geoJSONIntersectionLayerId) {
8722
9211
  listenerApi.dispatch(layerActions.layerChangeGeojson({
@@ -8783,6 +9272,7 @@ drawingToolListener.startListening({
8783
9272
  return effect;
8784
9273
  }()
8785
9274
  });
9275
+
8786
9276
  // change intersection
8787
9277
  drawingToolListener.startListening({
8788
9278
  actionCreator: drawingToolActions.changeIntersectionBounds,
@@ -8931,6 +9421,7 @@ metronomeListener.startListening({
8931
9421
  * Copyright 2025 - Finnish Meteorological Institute (FMI)
8932
9422
  * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
8933
9423
  * */
9424
+
8934
9425
  var commonListener = createListenerMiddleware();
8935
9426
 
8936
9427
  /* *
@@ -8950,6 +9441,9 @@ var commonListener = createListenerMiddleware();
8950
9441
  * Copyright 2025 - Finnish Meteorological Institute (FMI)
8951
9442
  * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
8952
9443
  * */
9444
+
9445
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
9446
+
8953
9447
  var unifyReducerMaps = function unifyReducerMaps(reducerMaps) {
8954
9448
  var unifiedReducerMaps = {};
8955
9449
  var _iterator = _createForOfIteratorHelper(reducerMaps),
@@ -8993,6 +9487,7 @@ var unifyReducerMaps = function unifyReducerMaps(reducerMaps) {
8993
9487
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
8994
9488
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
8995
9489
  * */
9490
+
8996
9491
  var getSingularDrawtoolDrawLayerId = function getSingularDrawtoolDrawLayerId(mapId) {
8997
9492
  return "drawlayer-".concat(mapId);
8998
9493
  };
@@ -9081,12 +9576,14 @@ var createMapDimensionsState = function createMapDimensionsState(dimensions) {
9081
9576
  };
9082
9577
  var webmapStateWithAddedLayer = function webmapStateWithAddedLayer(layerType, layerId, mapId, dimensions) {
9083
9578
  var webmap = createWebmapState(mapId);
9579
+
9084
9580
  // Add the dimensions to the map state
9085
9581
  if (dimensions !== null && dimensions !== void 0 && dimensions.length) {
9086
9582
  dimensions.forEach(function (dimension) {
9087
9583
  webmap.byId[mapId].dimensions.push(dimension);
9088
9584
  });
9089
9585
  }
9586
+
9090
9587
  // Add the layer to the map state
9091
9588
  switch (layerType) {
9092
9589
  case LayerType.mapLayer:
@@ -9099,6 +9596,7 @@ var webmapStateWithAddedLayer = function webmapStateWithAddedLayer(layerType, la
9099
9596
  webmap.byId[mapId].overLayers.push(layerId);
9100
9597
  break;
9101
9598
  }
9599
+
9102
9600
  // first layer is active layer
9103
9601
  webmap.byId[mapId].autoUpdateLayerId = layerId;
9104
9602
  webmap.byId[mapId].autoTimeStepLayerId = layerId;
@@ -9119,7 +9617,7 @@ var mockStateMapWithLayer = function mockStateMapWithLayer(layer, mapId) {
9119
9617
  dimensions: layer.dimensions,
9120
9618
  status: layer.status
9121
9619
  }),
9122
- syncGroups: _objectSpread2(_objectSpread2({}, initialState$3), {}, {
9620
+ syncGroups: _objectSpread2(_objectSpread2({}, initialState$4), {}, {
9123
9621
  viewState: {
9124
9622
  timeslider: {
9125
9623
  groups: [{
@@ -9142,7 +9640,7 @@ var mockStateMapWithLayer = function mockStateMapWithLayer(layer, mapId) {
9142
9640
  };
9143
9641
  var mockLinkedState = function mockLinkedState() {
9144
9642
  return {
9145
- syncGroups: _objectSpread2(_objectSpread2({}, initialState$3), {}, {
9643
+ syncGroups: _objectSpread2(_objectSpread2({}, initialState$4), {}, {
9146
9644
  viewState: {
9147
9645
  timeslider: {
9148
9646
  groups: [{
@@ -9223,6 +9721,7 @@ var mockLinkedState = function mockLinkedState() {
9223
9721
  };
9224
9722
  var webmapStateWithMultipleLayers = function webmapStateWithMultipleLayers(layers, mapId) {
9225
9723
  var webmap = createWebmapState(mapId);
9724
+
9226
9725
  // Add the layers to the map state
9227
9726
  layers.forEach(function (layer) {
9228
9727
  switch (layer.layerType) {
@@ -9240,6 +9739,7 @@ var webmapStateWithMultipleLayers = function webmapStateWithMultipleLayers(layer
9240
9739
  break;
9241
9740
  }
9242
9741
  });
9742
+
9243
9743
  // first layer is active layer
9244
9744
  if (layers.length) {
9245
9745
  webmap.byId[mapId].autoTimeStepLayerId = layers[0].id;
@@ -9255,7 +9755,7 @@ var mockStateMapWithMultipleLayers = function mockStateMapWithMultipleLayers(lay
9255
9755
  allIds: ['serviceid_1']
9256
9756
  },
9257
9757
  layers: createMultipleLayersState(layers, mapId),
9258
- syncGroups: _objectSpread2(_objectSpread2({}, initialState$3), {}, {
9758
+ syncGroups: _objectSpread2(_objectSpread2({}, initialState$4), {}, {
9259
9759
  viewState: {
9260
9760
  timeslider: {
9261
9761
  groups: [{
@@ -9295,6 +9795,7 @@ var testGeoJSON = {
9295
9795
  };
9296
9796
  var webmapStateWithAnimationDelay = function webmapStateWithAnimationDelay(mapId, animationDelay) {
9297
9797
  var webmap = createWebmapState(mapId);
9798
+
9298
9799
  // Add the dimensions to the map state
9299
9800
  webmap.byId[mapId].animationDelay = animationDelay;
9300
9801
  return webmap;
@@ -9306,6 +9807,7 @@ var mockStateMapWithAnimationDelayWithoutLayers = function mockStateMapWithAnima
9306
9807
  };
9307
9808
  var webmapStateWithTimeSliderSpan = function webmapStateWithTimeSliderSpan(mapId, timeSliderSpan) {
9308
9809
  var webmap = createWebmapState(mapId);
9810
+
9309
9811
  // Add the span to the map state
9310
9812
  webmap.byId[mapId].timeSliderSpan = timeSliderSpan;
9311
9813
  return webmap;
@@ -9334,6 +9836,7 @@ var mockStateMapWithDimensions = function mockStateMapWithDimensions(layer, mapI
9334
9836
  };
9335
9837
  var webmapStateWithTimeStep = function webmapStateWithTimeStep(mapId, timeStep) {
9336
9838
  var webmap = createWebmapState(mapId);
9839
+
9337
9840
  // Add the timeStep to the map state
9338
9841
  webmap.byId[mapId].timeStep = timeStep;
9339
9842
  return webmap;
@@ -9378,17 +9881,18 @@ var storeTestUtils = /*#__PURE__*/Object.freeze({
9378
9881
  * Copyright 2024 - Finnish Meteorological Institute (FMI)
9379
9882
  * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
9380
9883
  * */
9381
- var SupportedComponentTypes;
9382
- (function (SupportedComponentTypes) {
9884
+
9885
+ var SupportedComponentTypes = /*#__PURE__*/function (SupportedComponentTypes) {
9383
9886
  SupportedComponentTypes["WarningList"] = "WarningList";
9384
9887
  SupportedComponentTypes["TimeSeries"] = "TimeSeries";
9385
9888
  SupportedComponentTypes["Soundings"] = "Soundings";
9386
- })(SupportedComponentTypes || (SupportedComponentTypes = {}));
9889
+ return SupportedComponentTypes;
9890
+ }({});
9387
9891
  var supportedComponentTypesForLinking = [SupportedComponentTypes.WarningList, SupportedComponentTypes.TimeSeries, SupportedComponentTypes.Soundings];
9388
9892
 
9389
9893
  var constants = /*#__PURE__*/Object.freeze({
9390
9894
  __proto__: null,
9391
- get SupportedComponentTypes () { return SupportedComponentTypes; },
9895
+ SupportedComponentTypes: SupportedComponentTypes,
9392
9896
  supportedComponentTypesForLinking: supportedComponentTypesForLinking
9393
9897
  });
9394
9898
 
@@ -9409,6 +9913,7 @@ var constants = /*#__PURE__*/Object.freeze({
9409
9913
  * Copyright 2025 - Finnish Meteorological Institute (FMI)
9410
9914
  * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
9411
9915
  * */
9916
+
9412
9917
  var initialState = {
9413
9918
  isLoggedIn: false,
9414
9919
  credentials: undefined
@@ -9449,7 +9954,7 @@ var authReducer = slice.reducer,
9449
9954
  * Copyright 2025 - Finnish Meteorological Institute (FMI)
9450
9955
  * Copyright 2025 - The Norwegian Meteorological Institute (MET Norway)
9451
9956
  * */
9452
- // store/auth/selectors.ts
9957
+
9453
9958
  var useAppSelector = useSelector;
9454
9959
  var getAuthStore = function getAuthStore(store) {
9455
9960
  if (store !== null && store !== void 0 && store.common) {
@@ -9457,6 +9962,7 @@ var getAuthStore = function getAuthStore(store) {
9457
9962
  }
9458
9963
  return null;
9459
9964
  };
9965
+
9460
9966
  /**
9461
9967
  * Gets whether the user is logged in
9462
9968
  *
@@ -9467,6 +9973,7 @@ var getIsLoggedIn = createSelector(getAuthStore, function (auth) {
9467
9973
  var _auth$isLoggedIn;
9468
9974
  return (_auth$isLoggedIn = auth === null || auth === void 0 ? void 0 : auth.isLoggedIn) !== null && _auth$isLoggedIn !== void 0 ? _auth$isLoggedIn : false;
9469
9975
  }, selectorMemoizationOptions);
9976
+
9470
9977
  /**
9471
9978
  * Gets the current auth credentials
9472
9979
  *
@@ -9476,6 +9983,7 @@ var getIsLoggedIn = createSelector(getAuthStore, function (auth) {
9476
9983
  var getCredentials = createSelector(getAuthStore, function (auth) {
9477
9984
  return auth === null || auth === void 0 ? void 0 : auth.credentials;
9478
9985
  }, selectorMemoizationOptions);
9986
+
9479
9987
  /**
9480
9988
  * Gets the current role
9481
9989
  *
@@ -9496,6 +10004,10 @@ var authSelectors = /*#__PURE__*/Object.freeze({
9496
10004
  useAppSelector: useAppSelector
9497
10005
  });
9498
10006
 
10007
+ var types = /*#__PURE__*/Object.freeze({
10008
+ __proto__: null
10009
+ });
10010
+
9499
10011
  var commonActions = _objectSpread2({}, authActions);
9500
10012
  var commonSelectors = _objectSpread2({}, authSelectors);
9501
10013
  var commonReducers = combineReducers({
@@ -9524,6 +10036,7 @@ var createMockStore = function createMockStore(mockState) {
9524
10036
  }
9525
10037
  });
9526
10038
  };
10039
+
9527
10040
  /**
9528
10041
  * This creates an OpenGeoWeb redux store for redux connected components
9529
10042
  *
@@ -9542,8 +10055,10 @@ var configureOpenGeoWebStore = function configureOpenGeoWebStore() {
9542
10055
  var enableDevTools = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
9543
10056
  var allReducers = unifyReducerMaps([storeReducerMap, extraReducers]);
9544
10057
  var openGeoWebReducers = combineReducers(allReducers);
10058
+
9545
10059
  // Combine middlewares
9546
10060
  var middlewares = [mapListener.middleware, serviceListener.middleware, layersListener.middleware, genericListener.middleware, openlayersListener.middleware].concat(_toConsumableArray(extraMiddleWares));
10061
+
9547
10062
  // Ensure we do not add middlewares twice
9548
10063
  var uniqueMiddlewares = Array.from(new Set(middlewares.map(function (obj) {
9549
10064
  return obj;
@@ -9568,4 +10083,4 @@ var configureOpenGeoWebStore = function configureOpenGeoWebStore() {
9568
10083
  });
9569
10084
  };
9570
10085
 
9571
- export { IS_LEGEND_OPEN_BY_DEFAULT, SECONDS_IN_DAY, SECONDS_IN_HOUR, commonActions, commonListener, commonReducers, commonSelectors, configureOpenGeoWebStore, createMockStore, createViewObjectForNewMap, drawingToolActions, drawingToolListener, drawingToolReducer, selectors as drawingToolSelectors, filterLayers$1 as filterLayers, genericActions, genericListener, selectors$5 as genericSelectors, getSingularDrawtoolDrawLayerId, getUserAddedServices, getViewObjectForMapId, getViewObjectForSyncGroup, initialState$3 as initialState, layerActions, layerReducer, selectors$2 as layerSelectors, types$2 as layerTypes, utils$1 as layerUtils, layersListener, constants as linkComponentTypesConstants, loadingIndicatorActions, constants$1 as loadingIndicatorConstants, loadingIndicatorReducer, selectors$4 as loadingIndicatorSelectors, mapActions, enums as mapEnums, mapListener, mapReducer, selectors$1 as mapSelectors, types$3 as mapTypes, mapUtils, metronomeListener, openlayersListener, routerActions, routerListener, routerReducer, utils as routerUtils, selectorMemoizationOptions, serviceActions, serviceListener, serviceReducer, selectors$7 as serviceSelectors, setUserAddedServices, storeMiddlewares, storeReducerMap, storeTestSettings, storeTestUtils, utils$3 as storeUtils, constants$2 as syncConstants, syncGroupsActions, syncGroupsListener, syncGroupsReducer, selector as syncGroupsSelector, selectors$6 as syncGroupsSelectors, types$1 as syncGroupsTypes, types$1 as types, uiActions, uiReducer, selectors$3 as uiSelectors, types as uiTypes, unifyReducerMaps, useSetupDialog, useSyncgroupTimeState, useUpdateSharedData };
10086
+ export { IS_LEGEND_OPEN_BY_DEFAULT, SECONDS_IN_DAY, SECONDS_IN_HOUR, commonActions, commonListener, commonReducers, commonSelectors, types as commonTypes, configureOpenGeoWebStore, constructSyncSourceDisplayName, createMockStore, createViewObjectForNewMap, drawingToolActions, drawingToolListener, drawingToolReducer, selectors as drawingToolSelectors, filterLayers$1 as filterLayers, genericActions, genericListener, selectors$5 as genericSelectors, types$2 as genericTypes, getSingularDrawtoolDrawLayerId, getUserAddedServices, getViewObjectForMapId, getViewObjectForSyncGroup, initialState$4 as initialState, layerActions, layerReducer, selectors$2 as layerSelectors, types$4 as layerTypes, utils$1 as layerUtils, layersListener, constants as linkComponentTypesConstants, loadingIndicatorActions, constants$1 as loadingIndicatorConstants, loadingIndicatorReducer, selectors$4 as loadingIndicatorSelectors, mapActions, enums as mapEnums, mapListener, mapReducer, selectors$1 as mapSelectors, types$5 as mapTypes, mapUtils, metronomeListener, openlayersListener, routerActions, routerListener, routerReducer, utils as routerUtils, selectorMemoizationOptions, serviceActions, serviceListener, serviceReducer, selectors$7 as serviceSelectors, types$6 as serviceTypes, setUserAddedServices, storeMiddlewares, storeReducerMap, storeTestSettings, storeTestUtils, utils$3 as storeUtils, constants$2 as syncConstants, syncGroupsActions, syncGroupsListener, syncGroupsReducer, selector as syncGroupsSelector, selectors$6 as syncGroupsSelectors, types$3 as syncGroupsTypes, types$3 as types, uiActions, uiReducer, selectors$3 as uiSelectors, types$1 as uiTypes, unifyReducerMaps, useSetupDialog, useSyncgroupTimeState, useUpdateSharedData };