@opengeoweb/core 4.19.1 → 4.20.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 (44) hide show
  1. package/index.esm.js +1734 -810
  2. package/index.umd.js +1820 -872
  3. package/lib/components/ComponentsLookUp/componentsLookUp.d.ts +1 -1
  4. package/lib/components/LayerManager/DockedLayerManagerConnect.d.ts +2 -1
  5. package/lib/components/LayerManager/LayerContainerRow/LayerRow/LayerRow.d.ts +1 -0
  6. package/lib/components/LayerManager/LayerManager.d.ts +1 -1
  7. package/lib/components/LayerManager/LayerManagerConnect.d.ts +2 -1
  8. package/lib/components/LayerManager/LayerManagerHeaderOptions.d.ts +21 -0
  9. package/lib/components/LayerManager/LayerManagerHeaderOptionsConnect.d.ts +2 -1
  10. package/lib/components/LayerManager/LayerManagerUtils.d.ts +20 -1
  11. package/lib/components/LayerManager/index.d.ts +1 -0
  12. package/lib/components/MapControls/MapControlButton.d.ts +2 -3
  13. package/lib/components/ReactMapView/ReactMapViewParseLayer.d.ts +1 -2
  14. package/lib/components/TimeSliderLite/TimeSliderLite.d.ts +35 -0
  15. package/lib/components/TimeSliderLite/TimeSliderLite.spec.d.ts +1 -0
  16. package/lib/components/TimeSliderLite/TimeSliderLite.stories.d.ts +9 -0
  17. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderDraggableNeedle.d.ts +20 -0
  18. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderDraggableNeedle.spec.d.ts +1 -0
  19. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackground.d.ts +17 -0
  20. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackgroundSvg.d.ts +12 -0
  21. package/lib/components/TimeSliderLite/TimeSliderLiteBackground/TimeSliderLiteBackgroundSvg.spec.d.ts +1 -0
  22. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/ControlButtonGroup/ControlButtonGroup.d.ts +8 -0
  23. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/HideButton/HideButton.d.ts +9 -0
  24. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/MenuButton/MenuButton.d.ts +9 -0
  25. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/PlayButton/PlayButton.d.ts +10 -0
  26. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/StepButton/StepButton.d.ts +10 -0
  27. package/lib/components/TimeSliderLite/TimeSliderLiteButtons/TimeSliderLiteButtonUtils.d.ts +3 -0
  28. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.d.ts +12 -0
  29. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.spec.d.ts +1 -0
  30. package/lib/components/TimeSliderLite/TimeSliderLiteConnect.stories.d.ts +9 -0
  31. package/lib/components/TimeSliderLite/index.d.ts +3 -0
  32. package/lib/components/TimeSliderLite/timeSliderLiteUtils.d.ts +47 -0
  33. package/lib/components/TimeSliderLite/timeSliderLiteUtils.spec.d.ts +1 -0
  34. package/lib/index.d.ts +5 -4
  35. package/lib/store/generic/synchronizationGroups/selectors.d.ts +2 -1
  36. package/lib/store/generic/synchronizationGroups/types.d.ts +4 -4
  37. package/lib/store/mapStore/layers/reducer.d.ts +2 -2
  38. package/lib/store/mapStore/layers/types.d.ts +0 -2
  39. package/lib/store/mapStore/map/index.d.ts +1 -1
  40. package/lib/store/mapStore/utils/helpers.d.ts +1 -0
  41. package/lib/store/ui/index.d.ts +1 -1
  42. package/lib/utils/sanitizeHTML.d.ts +3 -0
  43. package/lib/utils/sanitizeHTML.spec.d.ts +1 -0
  44. package/package.json +10 -9
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@reduxjs/toolkit'), require('immer'), require('moment'), require('react'), require('lodash'), require('redux-saga/effects'), require('react-redux'), require('@opengeoweb/shared'), require('@opengeoweb/theme'), require('@mui/material'), require('@opengeoweb/webmap'), require('react-sortablejs'), require('sortablejs'), require('react-window'), require('@mui/material/Box'), require('@mui/material/Typography'), require('@mui/material/Grid'), require('@opengeoweb/form-fields'), require('react-hook-form'), require('@mui/system'), require('react-resize-detector'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('@turf/turf'), require('react-draggable'), require('re-resizable'), require('axios'), require('@opengeoweb/api'), require('@redux-eggs/redux-toolkit'), require('@redux-eggs/saga-extension'), require('react-router-dom')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@reduxjs/toolkit', 'immer', 'moment', 'react', 'lodash', 'redux-saga/effects', 'react-redux', '@opengeoweb/shared', '@opengeoweb/theme', '@mui/material', '@opengeoweb/webmap', 'react-sortablejs', 'sortablejs', 'react-window', '@mui/material/Box', '@mui/material/Typography', '@mui/material/Grid', '@opengeoweb/form-fields', 'react-hook-form', '@mui/system', 'react-resize-detector', 'throttle-debounce', 'lodash.clonedeep', 'proj4', '@turf/turf', 'react-draggable', 're-resizable', 'axios', '@opengeoweb/api', '@redux-eggs/redux-toolkit', '@redux-eggs/saga-extension', 'react-router-dom'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.toolkit, global.produce, global.moment, global.React, global._, global.effects, global.reactRedux, global.shared, global.theme, global.material, global.webmap, global.reactSortablejs, global.Sortable, global.reactWindow, global.Box, global.Typography, global.Grid, global.formFields, global.reactHookForm, global.system, global.reactResizeDetector, global.throttleDebounce, global.cloneDeep, global.proj4, global.turf, global.Draggable, global.reResizable, global.axios, global.api, global.reduxToolkit, global.sagaExtension, global.reactRouterDom));
5
- })(this, (function (exports, toolkit, produce, moment, React, _, effects, reactRedux, shared, theme, material, webmap, reactSortablejs, Sortable, reactWindow, Box, Typography, Grid, formFields, reactHookForm, system, reactResizeDetector, throttleDebounce, cloneDeep, proj4, turf, Draggable, reResizable, axios, api, reduxToolkit, sagaExtension, reactRouterDom) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@reduxjs/toolkit'), require('lodash'), require('immer'), require('moment'), require('react'), require('redux-saga/effects'), require('react-redux'), require('@opengeoweb/shared'), require('@opengeoweb/theme'), require('@mui/material'), require('@opengeoweb/webmap'), require('react-sortablejs'), require('sortablejs'), require('react-window'), require('@mui/material/Box'), require('@mui/material/Typography'), require('@mui/material/Grid'), require('@opengeoweb/form-fields'), require('react-hook-form'), require('@mui/system'), require('react-resize-detector'), require('throttle-debounce'), require('lodash.clonedeep'), require('proj4'), require('@turf/turf'), require('react-draggable'), require('re-resizable'), require('axios'), require('@opengeoweb/api'), require('dompurify'), require('@redux-eggs/redux-toolkit'), require('@redux-eggs/saga-extension'), require('react-router-dom')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@reduxjs/toolkit', 'lodash', 'immer', 'moment', 'react', 'redux-saga/effects', 'react-redux', '@opengeoweb/shared', '@opengeoweb/theme', '@mui/material', '@opengeoweb/webmap', 'react-sortablejs', 'sortablejs', 'react-window', '@mui/material/Box', '@mui/material/Typography', '@mui/material/Grid', '@opengeoweb/form-fields', 'react-hook-form', '@mui/system', 'react-resize-detector', 'throttle-debounce', 'lodash.clonedeep', 'proj4', '@turf/turf', 'react-draggable', 're-resizable', 'axios', '@opengeoweb/api', 'dompurify', '@redux-eggs/redux-toolkit', '@redux-eggs/saga-extension', 'react-router-dom'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Core = {}, global.toolkit, global._, global.produce, global.moment, global.React, global.effects, global.reactRedux, global.shared, global.theme, global.material, global.webmap, global.reactSortablejs, global.Sortable, global.reactWindow, global.Box, global.Typography, global.Grid, global.formFields, global.reactHookForm, global.system, global.reactResizeDetector, global.throttleDebounce, global.cloneDeep, global.proj4, global.turf, global.Draggable, global.reResizable, global.axios, global.api, global.DOMPurify, global.reduxToolkit, global.sagaExtension, global.reactRouterDom));
5
+ })(this, (function (exports, toolkit, _, produce, moment, React, effects, reactRedux, shared, theme, material, webmap, reactSortablejs, Sortable, reactWindow, Box, Typography, Grid, formFields, reactHookForm, system, reactResizeDetector, throttleDebounce, cloneDeep, proj4, turf, Draggable, reResizable, axios, api, DOMPurify, reduxToolkit, sagaExtension, reactRouterDom) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -24,11 +24,11 @@
24
24
  return Object.freeze(n);
25
25
  }
26
26
 
27
+ var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
27
28
  var produce__default = /*#__PURE__*/_interopDefaultLegacy(produce);
28
29
  var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
29
30
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
30
31
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
31
- var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
32
32
  var Sortable__default = /*#__PURE__*/_interopDefaultLegacy(Sortable);
33
33
  var Box__default = /*#__PURE__*/_interopDefaultLegacy(Box);
34
34
  var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
@@ -38,6 +38,7 @@
38
38
  var turf__namespace = /*#__PURE__*/_interopNamespace(turf);
39
39
  var Draggable__default = /*#__PURE__*/_interopDefaultLegacy(Draggable);
40
40
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
41
+ var DOMPurify__namespace = /*#__PURE__*/_interopNamespace(DOMPurify);
41
42
 
42
43
  /*! *****************************************************************************
43
44
  Copyright (c) Microsoft Corporation.
@@ -186,38 +187,68 @@
186
187
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
187
188
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
188
189
  * */
189
- var LayerType;
190
-
191
- (function (LayerType) {
192
- LayerType["mapLayer"] = "mapLayer";
193
- LayerType["baseLayer"] = "baseLayer";
194
- LayerType["overLayer"] = "overLayer";
195
- })(LayerType || (LayerType = {}));
196
-
197
- var LayerStatus;
198
-
199
- (function (LayerStatus) {
200
- LayerStatus["default"] = "default";
201
- LayerStatus["error"] = "error";
202
- })(LayerStatus || (LayerStatus = {}));
203
-
204
- var LayerActionOrigin;
190
+ var initialState$8 = {
191
+ byId: {},
192
+ allIds: []
193
+ };
194
+ var slice$8 = toolkit.createSlice({
195
+ initialState: initialState$8,
196
+ name: 'serviceReducer',
197
+ reducers: {
198
+ serviceSetLayers: function serviceSetLayers(draft, action) {
199
+ var id = action.payload.id;
200
+ draft.byId[id] = __assign({}, action.payload);
205
201
 
206
- (function (LayerActionOrigin) {
207
- LayerActionOrigin["layerManager"] = "layerManager";
208
- LayerActionOrigin["wmsLoader"] = "WMSLayerTreeConnect";
209
- LayerActionOrigin["ReactMapViewParseLayer"] = "ReactMapViewParseLayer";
210
- LayerActionOrigin["setLayerDimensionSaga"] = "setLayerDimensionSaga";
211
- LayerActionOrigin["toggleAutoUpdateSaga"] = "toggleAutoUpdateSaga";
212
- LayerActionOrigin["unregisterMapSaga"] = "unregisterMapSaga";
213
- })(LayerActionOrigin || (LayerActionOrigin = {}));
202
+ if (!draft.allIds.includes(id)) {
203
+ draft.allIds.push(id);
204
+ }
205
+ },
206
+ mapStoreRemoveService: function mapStoreRemoveService(draft, action) {
207
+ var foundServiceIndex = draft.allIds.findIndex(function (id) {
208
+ return draft.byId[id].serviceUrl === action.payload.serviceUrl;
209
+ });
214
210
 
215
- var types$3 = /*#__PURE__*/Object.freeze({
216
- __proto__: null,
217
- get LayerType () { return LayerType; },
218
- get LayerStatus () { return LayerStatus; },
219
- get LayerActionOrigin () { return LayerActionOrigin; }
211
+ if (foundServiceIndex !== -1) {
212
+ var serviceId_1 = draft.allIds[foundServiceIndex];
213
+ draft.allIds = draft.allIds.filter(function (id) {
214
+ return id !== serviceId_1;
215
+ });
216
+ delete draft.byId[serviceId_1];
217
+ }
218
+ },
219
+ fetchInitialServices: function fetchInitialServices( // eslint-disable-next-line no-unused-vars
220
+ draft, // eslint-disable-next-line no-unused-vars
221
+ action) {}
222
+ }
220
223
  });
224
+ var reducer$8 = slice$8.reducer;
225
+ var serviceActions = slice$8.actions;
226
+
227
+ /* *
228
+ * Licensed under the Apache License, Version 2.0 (the "License");
229
+ * you may not use this file except in compliance with the License.
230
+ * You may obtain a copy of the License at
231
+ *
232
+ * http://www.apache.org/licenses/LICENSE-2.0
233
+ *
234
+ * Unless required by applicable law or agreed to in writing, software
235
+ * distributed under the License is distributed on an "AS IS" BASIS,
236
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
237
+ * See the License for the specific language governing permissions and
238
+ * limitations under the License.
239
+ *
240
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
241
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
242
+ * */
243
+ var selectorMemoizationOptions = {
244
+ memoizeOptions: {
245
+ maxSize: 1000,
246
+ resultEqualityCheck: _.isEqual
247
+ }
248
+ };
249
+ var isUserAddedService = function isUserAddedService(scope) {
250
+ return scope === 'user';
251
+ };
221
252
 
222
253
  /* *
223
254
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -235,38 +266,123 @@
235
266
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
236
267
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
237
268
  * */
238
- var Scale;
239
269
 
240
- (function (Scale) {
241
- Scale[Scale["Minutes5"] = 0] = "Minutes5";
242
- Scale[Scale["Hour"] = 1] = "Hour";
243
- Scale[Scale["Hours3"] = 2] = "Hours3";
244
- Scale[Scale["Hours6"] = 3] = "Hours6";
245
- Scale[Scale["Day"] = 4] = "Day";
246
- Scale[Scale["Week"] = 5] = "Week";
247
- Scale[Scale["Month"] = 6] = "Month";
248
- Scale[Scale["Year"] = 7] = "Year";
249
- Scale[Scale["DataScale"] = 8] = "DataScale";
250
- })(Scale || (Scale = {}));
270
+ var servicesStore = function servicesStore(store) {
271
+ return store && store.services ? store.services : null;
272
+ };
273
+ /**
274
+ * Retrieves all serviceIds
275
+ *
276
+ * Example: serviceIds = getServiceIds(store)
277
+ * @param {object} store store: object - object from which the service state will be extracted
278
+ * @returns {array} returnType: array - an array of all serviceIds
279
+ */
251
280
 
252
- var AnimationLength;
253
281
 
254
- (function (AnimationLength) {
255
- AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
256
- AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
257
- AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
258
- AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
259
- AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
260
- AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
261
- AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
262
- AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
263
- })(AnimationLength || (AnimationLength = {}));
282
+ var getServiceIds = toolkit.createSelector(servicesStore, function (serviceState) {
283
+ return serviceState ? serviceState.allIds : [];
284
+ }, selectorMemoizationOptions);
285
+ /**
286
+ * Gets map services
287
+ *
288
+ * Example: services = getServices(store)
289
+ * @param {object} store store: object - Store object
290
+ * @returns {object} returnType: ServiceState
291
+ */
264
292
 
265
- var MapActionOrigin;
293
+ var getServices = toolkit.createSelector(servicesStore, function (store) {
294
+ return store ? store.byId : {};
295
+ }, selectorMemoizationOptions);
296
+ /**
297
+ * Gets the service object by its url
298
+ *
299
+ * Example: service = getServiceByName(store, 'serviceName')
300
+ * @param {object} store store: object - Store object
301
+ * @returns {ReduxService} returnType: Service
302
+ */
266
303
 
267
- (function (MapActionOrigin) {
268
- MapActionOrigin["map"] = "map";
269
- })(MapActionOrigin || (MapActionOrigin = {}));
304
+ var getServiceByName = toolkit.createSelector([servicesStore, function (state, serviceUrl) {
305
+ return serviceUrl;
306
+ }], function (serviceState, serviceUrl) {
307
+ var foundServiceIndex = serviceState.allIds.findIndex(function (id) {
308
+ return serviceState.byId[id].serviceUrl === serviceUrl;
309
+ });
310
+ /* Add the service based on a url */
311
+
312
+ var id = foundServiceIndex !== -1 ? serviceState.allIds[foundServiceIndex] : null;
313
+
314
+ if (serviceState && serviceState.byId && serviceState.byId[id]) {
315
+ return serviceState.byId[id];
316
+ }
317
+
318
+ return null;
319
+ }, selectorMemoizationOptions);
320
+ /**
321
+ * Gets the layer from the store using the serviceUrl and layerName
322
+ *
323
+ * Example: layers = getLayersFromService(store, 'https://geoservices.knmi.nl/...')
324
+ * @param {object} store store: object - object from which the layers state will be extracted
325
+ * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
326
+ * @returns {array} returnType: ServiceLayer[] - All layers within the service object.
327
+ */
328
+
329
+ var getLayersFromService$1 = toolkit.createSelector(getServiceByName, function (service) {
330
+ return service && service.layers || null;
331
+ }, selectorMemoizationOptions);
332
+ /**
333
+ * Gets the layer from the store using the serviceUrl and layerName
334
+ *
335
+ * Example: layer = getLayerFromService(store, 'https://geoservices.knmi.nl/...', 'radar')
336
+ * @param {object} store store: object - The application store
337
+ * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
338
+ * @param {string} layerName layerName: string - Name of the layer in the service
339
+ * @returns {ServiceLayer} returnType: ServiceLayer - The layer from the service object.
340
+ */
341
+
342
+ var getLayerFromService = toolkit.createSelector(function (store, serviceUrl) {
343
+ return getLayersFromService$1(store, serviceUrl);
344
+ }, function (store, serviceUrl) {
345
+ return serviceUrl;
346
+ }, function (store, serviceUrl, layerName) {
347
+ return layerName;
348
+ }, function (layers, serviceUrl, layerName) {
349
+ if (!layers) {
350
+ return null;
351
+ }
352
+
353
+ var index = layers.findIndex(function (serviceLayer) {
354
+ return serviceLayer.name === layerName;
355
+ });
356
+
357
+ if (index === -1) {
358
+ return null;
359
+ }
360
+
361
+ return layers[index];
362
+ }, selectorMemoizationOptions);
363
+ /**
364
+ * Gets the layers stylelist from the servicestore using the serviceUrl and layerName
365
+ *
366
+ * Example: layerStyles = getLayerStyles(store, layerService, layerName);
367
+ * @param {object} store store: object - store from which the layers state will be extracted
368
+ * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
369
+ * @param {string} layerName layerName: string - Name of the layer in the service
370
+ * @returns {array} returnType: Style[] - array containing layer styles
371
+ */
372
+
373
+ var getLayerStyles$1 = toolkit.createSelector(getLayerFromService, function (layer) {
374
+ return layer && layer.styles ? layer.styles : [];
375
+ }, selectorMemoizationOptions);
376
+
377
+ var selectors$5 = /*#__PURE__*/Object.freeze({
378
+ __proto__: null,
379
+ getServiceIds: getServiceIds,
380
+ getServices: getServices,
381
+ getServiceByName: getServiceByName,
382
+ getLayersFromService: getLayersFromService$1,
383
+ getLayerFromService: getLayerFromService,
384
+ getLayerStyles: getLayerStyles$1
385
+ });
270
386
 
271
387
  /* *
272
388
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -329,6 +445,16 @@
329
445
  delete registeredWMLayersForReactLayerId[layerId];
330
446
  }
331
447
  };
448
+ var unRegisterAllWMJSLayersAndMaps = function unRegisterAllWMJSLayersAndMaps() {
449
+ var allLayerIds = Object.values(registeredWMLayersForReactLayerId);
450
+ allLayerIds.forEach(function (layerId) {
451
+ unRegisterWMJSLayer(layerId);
452
+ });
453
+ var allMapIds = Object.values(registeredWMMapForReactMapId);
454
+ allMapIds.forEach(function (mapId) {
455
+ unRegisterWMJSMap(mapId);
456
+ });
457
+ };
332
458
  /**
333
459
  * Map for registering wmlayers with their id's
334
460
  */
@@ -509,27 +635,125 @@
509
635
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
510
636
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
511
637
  * */
638
+ var Scale;
512
639
 
513
- var types$2 = /*#__PURE__*/Object.freeze({
514
- __proto__: null,
515
- get Scale () { return Scale; },
516
- get AnimationLength () { return AnimationLength; },
517
- get MapActionOrigin () { return MapActionOrigin; },
518
- get LayerType () { return LayerType; },
519
- get LayerStatus () { return LayerStatus; },
520
- get LayerActionOrigin () { return LayerActionOrigin; }
521
- });
522
-
523
- var millisecondsInSecond = 1000;
524
- var defaultAnimationDelayAtStart = 250;
525
- var defaultDelay = 1000; // [ms]
526
-
527
- var defaultTimeStep = 5;
528
- var speedFactors = [0.1, 0.2, 0.5, 1, 2, 4, 8, 16]; // Declares available animation speed multipliers for default delay
640
+ (function (Scale) {
641
+ Scale[Scale["Minutes5"] = 0] = "Minutes5";
642
+ Scale[Scale["Hour"] = 1] = "Hour";
643
+ Scale[Scale["Hours3"] = 2] = "Hours3";
644
+ Scale[Scale["Hours6"] = 3] = "Hours6";
645
+ Scale[Scale["Day"] = 4] = "Day";
646
+ Scale[Scale["Week"] = 5] = "Week";
647
+ Scale[Scale["Month"] = 6] = "Month";
648
+ Scale[Scale["Year"] = 7] = "Year";
649
+ Scale[Scale["DataScale"] = 8] = "DataScale";
650
+ })(Scale || (Scale = {}));
529
651
 
530
- /**
531
- * Returns speed delay for given speedFactor. For options, see defined above in "speedFactors"
532
- */
652
+ var AnimationLength;
653
+
654
+ (function (AnimationLength) {
655
+ AnimationLength[AnimationLength["Minutes15"] = 15] = "Minutes15";
656
+ AnimationLength[AnimationLength["Minutes30"] = 30] = "Minutes30";
657
+ AnimationLength[AnimationLength["Hours1"] = 60] = "Hours1";
658
+ AnimationLength[AnimationLength["Hours2"] = 120] = "Hours2";
659
+ AnimationLength[AnimationLength["Hours3"] = 180] = "Hours3";
660
+ AnimationLength[AnimationLength["Hours6"] = 360] = "Hours6";
661
+ AnimationLength[AnimationLength["Hours12"] = 720] = "Hours12";
662
+ AnimationLength[AnimationLength["Hours24"] = 1440] = "Hours24";
663
+ })(AnimationLength || (AnimationLength = {}));
664
+
665
+ var MapActionOrigin;
666
+
667
+ (function (MapActionOrigin) {
668
+ MapActionOrigin["map"] = "map";
669
+ })(MapActionOrigin || (MapActionOrigin = {}));
670
+
671
+ /* *
672
+ * Licensed under the Apache License, Version 2.0 (the "License");
673
+ * you may not use this file except in compliance with the License.
674
+ * You may obtain a copy of the License at
675
+ *
676
+ * http://www.apache.org/licenses/LICENSE-2.0
677
+ *
678
+ * Unless required by applicable law or agreed to in writing, software
679
+ * distributed under the License is distributed on an "AS IS" BASIS,
680
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
681
+ * See the License for the specific language governing permissions and
682
+ * limitations under the License.
683
+ *
684
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
685
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
686
+ * */
687
+ var LayerType;
688
+
689
+ (function (LayerType) {
690
+ LayerType["mapLayer"] = "mapLayer";
691
+ LayerType["baseLayer"] = "baseLayer";
692
+ LayerType["overLayer"] = "overLayer";
693
+ })(LayerType || (LayerType = {}));
694
+
695
+ var LayerStatus;
696
+
697
+ (function (LayerStatus) {
698
+ LayerStatus["default"] = "default";
699
+ LayerStatus["error"] = "error";
700
+ })(LayerStatus || (LayerStatus = {}));
701
+
702
+ var LayerActionOrigin;
703
+
704
+ (function (LayerActionOrigin) {
705
+ LayerActionOrigin["layerManager"] = "layerManager";
706
+ LayerActionOrigin["wmsLoader"] = "WMSLayerTreeConnect";
707
+ LayerActionOrigin["ReactMapViewParseLayer"] = "ReactMapViewParseLayer";
708
+ LayerActionOrigin["setLayerDimensionSaga"] = "setLayerDimensionSaga";
709
+ LayerActionOrigin["toggleAutoUpdateSaga"] = "toggleAutoUpdateSaga";
710
+ LayerActionOrigin["unregisterMapSaga"] = "unregisterMapSaga";
711
+ })(LayerActionOrigin || (LayerActionOrigin = {}));
712
+
713
+ var types$3 = /*#__PURE__*/Object.freeze({
714
+ __proto__: null,
715
+ get LayerType () { return LayerType; },
716
+ get LayerStatus () { return LayerStatus; },
717
+ get LayerActionOrigin () { return LayerActionOrigin; }
718
+ });
719
+
720
+ /* *
721
+ * Licensed under the Apache License, Version 2.0 (the "License");
722
+ * you may not use this file except in compliance with the License.
723
+ * You may obtain a copy of the License at
724
+ *
725
+ * http://www.apache.org/licenses/LICENSE-2.0
726
+ *
727
+ * Unless required by applicable law or agreed to in writing, software
728
+ * distributed under the License is distributed on an "AS IS" BASIS,
729
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
730
+ * See the License for the specific language governing permissions and
731
+ * limitations under the License.
732
+ *
733
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
734
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
735
+ * */
736
+
737
+ var types$2 = /*#__PURE__*/Object.freeze({
738
+ __proto__: null,
739
+ get Scale () { return Scale; },
740
+ get AnimationLength () { return AnimationLength; },
741
+ get MapActionOrigin () { return MapActionOrigin; },
742
+ get LayerType () { return LayerType; },
743
+ get LayerStatus () { return LayerStatus; },
744
+ get LayerActionOrigin () { return LayerActionOrigin; }
745
+ });
746
+
747
+ var millisecondsInSecond = 1000;
748
+ var defaultAnimationDelayAtStart = 250;
749
+ var defaultDelay = 1000; // [ms]
750
+
751
+ var defaultTimeStep = 5;
752
+ var speedFactors = [0.1, 0.2, 0.5, 1, 2, 4, 8, 16]; // Declares available animation speed multipliers for default delay
753
+
754
+ /**
755
+ * Returns speed delay for given speedFactor. For options, see defined above in "speedFactors"
756
+ */
533
757
 
534
758
  var getSpeedDelay = function getSpeedDelay(speedFactor) {
535
759
  return defaultDelay / speedFactor;
@@ -1248,6 +1472,129 @@
1248
1472
  getActiveLayerTimeStep: getActiveLayerTimeStep
1249
1473
  });
1250
1474
 
1475
+ /* *
1476
+ * Licensed under the Apache License, Version 2.0 (the "License");
1477
+ * you may not use this file except in compliance with the License.
1478
+ * You may obtain a copy of the License at
1479
+ *
1480
+ * http://www.apache.org/licenses/LICENSE-2.0
1481
+ *
1482
+ * Unless required by applicable law or agreed to in writing, software
1483
+ * distributed under the License is distributed on an "AS IS" BASIS,
1484
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1485
+ * See the License for the specific language governing permissions and
1486
+ * limitations under the License.
1487
+ *
1488
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1489
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1490
+ * */
1491
+ /**
1492
+ * Generic action to set the time.
1493
+ *
1494
+ * @param payload: SetTimePayload;
1495
+ * {
1496
+ * sourceId: string; // Source where the new time value originates from
1497
+ * value: string; // ISO 8601 string time value like "2010-10-01T00:00:00Z"
1498
+ * }
1499
+ */
1500
+
1501
+ var setTime = toolkit.createAction('GENERIC_SETTIME');
1502
+ /**
1503
+ * Generic action to set the bounding box.
1504
+ *
1505
+ * @param payload: SetBboxPayload;
1506
+ *
1507
+ * {
1508
+ * sourceId: string; // Source where the new time value originates from
1509
+ * bbox: { // Bbbox object
1510
+ * left: number;
1511
+ * bottom: number;
1512
+ * right: number;
1513
+ * top: number;
1514
+ * };
1515
+ * srs: string; // Projection string according to EPSG, e.g. (EPSG:3857 == Mercator)
1516
+ * }
1517
+ */
1518
+
1519
+ var setBbox = toolkit.createAction('GENERIC_SETBBOX');
1520
+
1521
+ /* *
1522
+ * Licensed under the Apache License, Version 2.0 (the "License");
1523
+ * you may not use this file except in compliance with the License.
1524
+ * You may obtain a copy of the License at
1525
+ *
1526
+ * http://www.apache.org/licenses/LICENSE-2.0
1527
+ *
1528
+ * Unless required by applicable law or agreed to in writing, software
1529
+ * distributed under the License is distributed on an "AS IS" BASIS,
1530
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1531
+ * See the License for the specific language governing permissions and
1532
+ * limitations under the License.
1533
+ *
1534
+ * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1535
+ * Copyright 2020 - Finnish Meteorological Institute (FMI)
1536
+ * */
1537
+ /**
1538
+ * These actions are fired by the generic/saga.ts, based on generic actions and the synchronizationGroup state.
1539
+ *
1540
+ * These actions should not be used by components directly. Components should only use the generic actions.
1541
+ */
1542
+
1543
+ var setTimeSync = toolkit.createAction('GENERIC_SYNC_SETTIME', function (payload, targets, groups) {
1544
+ return {
1545
+ payload: {
1546
+ source: setTime(payload),
1547
+ groups: groups,
1548
+ targets: targets
1549
+ }
1550
+ };
1551
+ });
1552
+ var setBboxSync = toolkit.createAction('GENERIC_SYNC_SETBBOX', function (payload, targets, groups) {
1553
+ return {
1554
+ payload: {
1555
+ source: setBbox(payload),
1556
+ groups: groups,
1557
+ targets: targets
1558
+ }
1559
+ };
1560
+ });
1561
+ var setLayerActionSync = toolkit.createAction('GENERIC_SYNC_SETLAYERACTIONS', function (payload, targets, type) {
1562
+ return {
1563
+ payload: {
1564
+ source: {
1565
+ type: type,
1566
+ payload: payload
1567
+ },
1568
+ targets: targets
1569
+ }
1570
+ };
1571
+ });
1572
+
1573
+ /* *
1574
+ * Licensed under the Apache License, Version 2.0 (the "License");
1575
+ * you may not use this file except in compliance with the License.
1576
+ * You may obtain a copy of the License at
1577
+ *
1578
+ * http://www.apache.org/licenses/LICENSE-2.0
1579
+ *
1580
+ * Unless required by applicable law or agreed to in writing, software
1581
+ * distributed under the License is distributed on an "AS IS" BASIS,
1582
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1583
+ * See the License for the specific language governing permissions and
1584
+ * limitations under the License.
1585
+ *
1586
+ * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1587
+ * Copyright 2022 - Finnish Meteorological Institute (FMI)
1588
+ * */
1589
+ /**
1590
+ * These actions causes circular dependency if they are defined in the reducer.ts file.
1591
+ * Therefor they are instead added to this file
1592
+ * https://redux-toolkit.js.org/usage/usage-guide#exporting-and-using-slices
1593
+ */
1594
+
1595
+ var mapChangeDimension = toolkit.createAction('MAP_CHANGE_DIMENSION');
1596
+ var setMapPreset = toolkit.createAction('SET_MAP_PRESET');
1597
+
1251
1598
  /* *
1252
1599
  * Licensed under the Apache License, Version 2.0 (the "License");
1253
1600
  * you may not use this file except in compliance with the License.
@@ -1399,129 +1746,6 @@
1399
1746
  }
1400
1747
  };
1401
1748
 
1402
- /* *
1403
- * Licensed under the Apache License, Version 2.0 (the "License");
1404
- * you may not use this file except in compliance with the License.
1405
- * You may obtain a copy of the License at
1406
- *
1407
- * http://www.apache.org/licenses/LICENSE-2.0
1408
- *
1409
- * Unless required by applicable law or agreed to in writing, software
1410
- * distributed under the License is distributed on an "AS IS" BASIS,
1411
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1412
- * See the License for the specific language governing permissions and
1413
- * limitations under the License.
1414
- *
1415
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1416
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
1417
- * */
1418
- /**
1419
- * These actions causes circular dependency if they are defined in the reducer.ts file.
1420
- * Therefor they are instead added to this file
1421
- * https://redux-toolkit.js.org/usage/usage-guide#exporting-and-using-slices
1422
- */
1423
-
1424
- var mapChangeDimension = toolkit.createAction('MAP_CHANGE_DIMENSION');
1425
- var setMapPreset = toolkit.createAction('SET_MAP_PRESET');
1426
-
1427
- /* *
1428
- * Licensed under the Apache License, Version 2.0 (the "License");
1429
- * you may not use this file except in compliance with the License.
1430
- * You may obtain a copy of the License at
1431
- *
1432
- * http://www.apache.org/licenses/LICENSE-2.0
1433
- *
1434
- * Unless required by applicable law or agreed to in writing, software
1435
- * distributed under the License is distributed on an "AS IS" BASIS,
1436
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1437
- * See the License for the specific language governing permissions and
1438
- * limitations under the License.
1439
- *
1440
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1441
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
1442
- * */
1443
- /**
1444
- * Generic action to set the time.
1445
- *
1446
- * @param payload: SetTimePayload;
1447
- * {
1448
- * sourceId: string; // Source where the new time value originates from
1449
- * value: string; // ISO 8601 string time value like "2010-10-01T00:00:00Z"
1450
- * }
1451
- */
1452
-
1453
- var setTime = toolkit.createAction('GENERIC_SETTIME');
1454
- /**
1455
- * Generic action to set the bounding box.
1456
- *
1457
- * @param payload: SetBboxPayload;
1458
- *
1459
- * {
1460
- * sourceId: string; // Source where the new time value originates from
1461
- * bbox: { // Bbbox object
1462
- * left: number;
1463
- * bottom: number;
1464
- * right: number;
1465
- * top: number;
1466
- * };
1467
- * srs: string; // Projection string according to EPSG, e.g. (EPSG:3857 == Mercator)
1468
- * }
1469
- */
1470
-
1471
- var setBbox = toolkit.createAction('GENERIC_SETBBOX');
1472
-
1473
- /* *
1474
- * Licensed under the Apache License, Version 2.0 (the "License");
1475
- * you may not use this file except in compliance with the License.
1476
- * You may obtain a copy of the License at
1477
- *
1478
- * http://www.apache.org/licenses/LICENSE-2.0
1479
- *
1480
- * Unless required by applicable law or agreed to in writing, software
1481
- * distributed under the License is distributed on an "AS IS" BASIS,
1482
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1483
- * See the License for the specific language governing permissions and
1484
- * limitations under the License.
1485
- *
1486
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1487
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
1488
- * */
1489
- /**
1490
- * These actions are fired by the generic/saga.ts, based on generic actions and the synchronizationGroup state.
1491
- *
1492
- * These actions should not be used by components directly. Components should only use the generic actions.
1493
- */
1494
-
1495
- var setTimeSync = toolkit.createAction('GENERIC_SYNC_SETTIME', function (payload, targets, groups) {
1496
- return {
1497
- payload: {
1498
- source: setTime(payload),
1499
- groups: groups,
1500
- targets: targets
1501
- }
1502
- };
1503
- });
1504
- var setBboxSync = toolkit.createAction('GENERIC_SYNC_SETBBOX', function (payload, targets, groups) {
1505
- return {
1506
- payload: {
1507
- source: setBbox(payload),
1508
- groups: groups,
1509
- targets: targets
1510
- }
1511
- };
1512
- });
1513
- var setLayerActionSync = toolkit.createAction('GENERIC_SYNC_SETLAYERACTIONS', function (payload, targets, type) {
1514
- return {
1515
- payload: {
1516
- source: {
1517
- type: type,
1518
- payload: payload
1519
- },
1520
- targets: targets
1521
- }
1522
- };
1523
- });
1524
-
1525
1749
  /* *
1526
1750
  * Licensed under the Apache License, Version 2.0 (the "License");
1527
1751
  * you may not use this file except in compliance with the License.
@@ -1567,7 +1791,7 @@
1567
1791
  status: status
1568
1792
  });
1569
1793
  };
1570
- var initialState$8 = {
1794
+ var initialState$7 = {
1571
1795
  byId: {},
1572
1796
  allIds: [],
1573
1797
  availableBaseLayers: {
@@ -1575,8 +1799,8 @@
1575
1799
  allIds: []
1576
1800
  }
1577
1801
  };
1578
- var slice$8 = toolkit.createSlice({
1579
- initialState: initialState$8,
1802
+ var slice$7 = toolkit.createSlice({
1803
+ initialState: initialState$7,
1580
1804
  name: 'layerReducer',
1581
1805
  reducers: {
1582
1806
  addLayer: function addLayer(draft, action) {
@@ -1842,12 +2066,68 @@
1842
2066
  var _a = action.payload,
1843
2067
  layerStyle = _a.layerStyle,
1844
2068
  layerDimensions = _a.layerDimensions;
1845
- var layerStyleAction = layerActions.layerChangeStyle(layerStyle);
1846
- var state = produce.current(draft);
1847
- var intermediateState = layerStyle === null ? state : reducer$8(state, layerStyleAction);
1848
- var dimensionsAction = layerActions.layerSetDimensions(layerDimensions);
1849
- var newState = layerDimensions === null ? intermediateState : reducer$8(intermediateState, dimensionsAction);
1850
- return newState;
2069
+ /* Set style */
2070
+
2071
+ if (layerStyle && draft.byId[layerStyle.layerId]) {
2072
+ draft.byId[layerStyle.layerId].style = layerStyle === null || layerStyle === void 0 ? void 0 : layerStyle.style;
2073
+ }
2074
+ /* Set layer dimensions */
2075
+
2076
+
2077
+ if (layerDimensions) {
2078
+ /* Find the corresponding layer we want to update */
2079
+ var currentLayer_1 = draft.byId[layerDimensions.layerId];
2080
+ /* Find all other layers with the same name and service, and update these at once (atomic update) */
2081
+
2082
+ Object.values(draft.byId).filter(function (draftLayer) {
2083
+ return draftLayer.name === currentLayer_1.name && draftLayer.service === currentLayer_1.service;
2084
+ }).forEach(function (draftLayer) {
2085
+ var layerId = draftLayer.id;
2086
+
2087
+ if (layerId && draft.byId[layerId]) {
2088
+ if (!draft.byId[layerId].dimensions) {
2089
+ draft.byId[layerId].dimensions = [];
2090
+ }
2091
+
2092
+ var draftLayerDimensions_1 = draft.byId[layerId].dimensions;
2093
+ /* Now update the dimension for each layer */
2094
+
2095
+ layerDimensions.dimensions.forEach(function (newLayerDimension) {
2096
+ /* Find the wmLayer */
2097
+ var wmLayer = getWMLayerById(layerId);
2098
+ /* Find the wmDimension */
2099
+
2100
+ var wmDimension = wmLayer && wmLayer.getDimension(newLayerDimension.name);
2101
+ /* This will set the new range of start/stop values for this dimension, making getClosestValue work properly */
2102
+
2103
+ wmDimension && wmDimension.reInitializeValues(newLayerDimension.values);
2104
+ /* Find corresponding draftLayerDimensions */
2105
+
2106
+ var draftLayerDimension = draftLayerDimensions_1 === null || draftLayerDimensions_1 === void 0 ? void 0 : draftLayerDimensions_1.find(function (d) {
2107
+ return d.name === newLayerDimension.name && d.units === newLayerDimension.units;
2108
+ });
2109
+
2110
+ if (draftLayerDimension) {
2111
+ /* If found update only minValue, maxValue and values */
2112
+ draftLayerDimension.maxValue = newLayerDimension.maxValue;
2113
+ draftLayerDimension.minValue = newLayerDimension.minValue;
2114
+ draftLayerDimension.values = newLayerDimension.values;
2115
+ } else if (layerId === layerDimensions.layerId) {
2116
+ /* Otherwise add a new one, but only for this layer. */
2117
+ draftLayerDimensions_1.push({
2118
+ name: newLayerDimension.name,
2119
+ units: newLayerDimension.units,
2120
+ currentValue: newLayerDimension.currentValue,
2121
+ minValue: newLayerDimension.minValue,
2122
+ maxValue: newLayerDimension.maxValue,
2123
+ validSyncSelection: newLayerDimension.validSyncSelection,
2124
+ values: newLayerDimension.values
2125
+ });
2126
+ }
2127
+ });
2128
+ }
2129
+ });
2130
+ }
1851
2131
  },
1852
2132
  setSelectedFeature: function setSelectedFeature(draft, action) {
1853
2133
  var _a = action.payload,
@@ -1902,7 +2182,7 @@
1902
2182
  };
1903
2183
  /* Handle the Layer action with the same logic, using the same reducer */
1904
2184
 
1905
- return reducer$8(prevState, action);
2185
+ return reducer$7(prevState, action);
1906
2186
  }, state);
1907
2187
  }).addCase(setMapPreset, function (draft, action) {
1908
2188
  var mapId = action.payload.mapId;
@@ -1922,8 +2202,8 @@
1922
2202
  });
1923
2203
  }
1924
2204
  });
1925
- var reducer$8 = slice$8.reducer;
1926
- var layerActions = slice$8.actions;
2205
+ var reducer$7 = slice$7.reducer;
2206
+ var layerActions = slice$7.actions;
1927
2207
 
1928
2208
  /* *
1929
2209
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -1938,312 +2218,96 @@
1938
2218
  * See the License for the specific language governing permissions and
1939
2219
  * limitations under the License.
1940
2220
  *
1941
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1942
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
2221
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2222
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
1943
2223
  * */
1944
- var initialState$7 = {
1945
- byId: {},
1946
- allIds: []
2224
+ var moveToTop = function moveToTop(list, element) {
2225
+ var filteredList = list.filter(function (item) {
2226
+ return item !== element;
2227
+ });
2228
+
2229
+ var newOrder = __spreadArray([element], __read(filteredList));
2230
+
2231
+ return newOrder;
1947
2232
  };
1948
- var slice$7 = toolkit.createSlice({
1949
- initialState: initialState$7,
1950
- name: 'serviceReducer',
2233
+ var createUIDialogElement = function createUIDialogElement(_a) {
2234
+ var activeMapId = _a.activeMapId,
2235
+ type = _a.type,
2236
+ setOpen = _a.setOpen,
2237
+ _b = _a.source,
2238
+ source = _b === void 0 ? 'app' : _b;
2239
+ return {
2240
+ activeMapId: activeMapId,
2241
+ isOpen: setOpen,
2242
+ type: type,
2243
+ source: source,
2244
+ isLoading: false,
2245
+ error: undefined,
2246
+ focused: false
2247
+ };
2248
+ };
2249
+ var initialState$6 = {
2250
+ order: [],
2251
+ dialogs: {},
2252
+ activeWindowId: undefined
2253
+ };
2254
+ var slice$6 = toolkit.createSlice({
2255
+ initialState: initialState$6,
2256
+ name: 'uiReducer',
1951
2257
  reducers: {
1952
- serviceSetLayers: function serviceSetLayers(draft, action) {
1953
- var id = action.payload.id;
1954
- draft.byId[id] = __assign({}, action.payload);
2258
+ registerDialog: function registerDialog(draft, action) {
2259
+ var type = action.payload.type;
2260
+ var activeMapId = action.payload.mapId ? action.payload.mapId : '';
2261
+ var setOpen = action.payload.setOpen ? action.payload.setOpen : false;
2262
+ var source = action.payload.source ? action.payload.source : 'app';
1955
2263
 
1956
- if (!draft.allIds.includes(id)) {
1957
- draft.allIds.push(id);
2264
+ if (!Object.keys(draft.dialogs).includes(type)) {
2265
+ draft.dialogs[type] = createUIDialogElement({
2266
+ activeMapId: activeMapId,
2267
+ type: type,
2268
+ setOpen: setOpen,
2269
+ source: source
2270
+ });
2271
+ } // register dialog to order
2272
+
2273
+
2274
+ if (!draft.order.includes(type)) {
2275
+ draft.order.push(type);
1958
2276
  }
1959
2277
  },
1960
- mapStoreRemoveService: function mapStoreRemoveService(draft, action) {
1961
- var foundServiceIndex = draft.allIds.findIndex(function (id) {
1962
- return draft.byId[id].serviceUrl === action.payload.serviceUrl;
1963
- });
2278
+ unregisterDialog: function unregisterDialog(draft, action) {
2279
+ var type = action.payload.type;
1964
2280
 
1965
- if (foundServiceIndex !== -1) {
1966
- var serviceId_1 = draft.allIds[foundServiceIndex];
1967
- draft.allIds = draft.allIds.filter(function (id) {
1968
- return id !== serviceId_1;
2281
+ if (draft.dialogs[type]) {
2282
+ delete draft.dialogs[type];
2283
+ draft.order = draft.order.filter(function (item) {
2284
+ return item !== type;
1969
2285
  });
1970
- delete draft.byId[serviceId_1];
1971
2286
  }
1972
2287
  },
1973
- fetchInitialServices: function fetchInitialServices( // eslint-disable-next-line no-unused-vars
1974
- draft, // eslint-disable-next-line no-unused-vars
1975
- action) {}
1976
- },
1977
- extraReducers: function extraReducers(builder) {
1978
- return builder.addCase(layerActions.onUpdateLayerInformation, function (draft, action) {
1979
- var serviceLayers = action.payload.serviceLayers;
2288
+ setActiveMapIdForDialog: function setActiveMapIdForDialog(draft, action) {
2289
+ var _a = action.payload,
2290
+ type = _a.type,
2291
+ mapId = _a.mapId,
2292
+ source = _a.source;
1980
2293
 
1981
- if (serviceLayers === null) {
1982
- return draft;
2294
+ if (!draft.dialogs[type]) {
2295
+ return;
1983
2296
  }
1984
2297
 
1985
- var mapAction = serviceActions.serviceSetLayers(serviceLayers);
1986
- var newState = reducer$7(draft, mapAction);
1987
- return newState;
1988
- });
1989
- }
1990
- });
1991
- var reducer$7 = slice$7.reducer;
1992
- var serviceActions = slice$7.actions;
2298
+ var isOpen = action.payload.setOpen !== undefined ? action.payload.setOpen : draft.dialogs[type].isOpen;
2299
+ draft.dialogs[type].activeMapId = mapId;
2300
+ draft.dialogs[type].isOpen = isOpen;
2301
+ draft.dialogs[type].source = source;
1993
2302
 
1994
- /* *
1995
- * Licensed under the Apache License, Version 2.0 (the "License");
1996
- * you may not use this file except in compliance with the License.
1997
- * You may obtain a copy of the License at
1998
- *
1999
- * http://www.apache.org/licenses/LICENSE-2.0
2000
- *
2001
- * Unless required by applicable law or agreed to in writing, software
2002
- * distributed under the License is distributed on an "AS IS" BASIS,
2003
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2004
- * See the License for the specific language governing permissions and
2005
- * limitations under the License.
2006
- *
2007
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2008
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
2009
- * */
2010
- var selectorMemoizationOptions = {
2011
- memoizeOptions: {
2012
- maxSize: 1000,
2013
- resultEqualityCheck: _.isEqual
2014
- }
2015
- };
2016
- var isUserAddedService = function isUserAddedService(scope) {
2017
- return scope === 'user';
2018
- };
2019
-
2020
- /* *
2021
- * Licensed under the Apache License, Version 2.0 (the "License");
2022
- * you may not use this file except in compliance with the License.
2023
- * You may obtain a copy of the License at
2024
- *
2025
- * http://www.apache.org/licenses/LICENSE-2.0
2026
- *
2027
- * Unless required by applicable law or agreed to in writing, software
2028
- * distributed under the License is distributed on an "AS IS" BASIS,
2029
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2030
- * See the License for the specific language governing permissions and
2031
- * limitations under the License.
2032
- *
2033
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2034
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
2035
- * */
2036
-
2037
- var servicesStore = function servicesStore(store) {
2038
- return store && store.services ? store.services : null;
2039
- };
2040
- /**
2041
- * Retrieves all serviceIds
2042
- *
2043
- * Example: serviceIds = getServiceIds(store)
2044
- * @param {object} store store: object - object from which the service state will be extracted
2045
- * @returns {array} returnType: array - an array of all serviceIds
2046
- */
2047
-
2048
-
2049
- toolkit.createSelector(servicesStore, function (serviceState) {
2050
- return serviceState ? serviceState.allIds : [];
2051
- }, selectorMemoizationOptions);
2052
- /**
2053
- * Gets map services
2054
- *
2055
- * Example: services = getServices(store)
2056
- * @param {object} store store: object - Store object
2057
- * @returns {object} returnType: ServiceState
2058
- */
2059
-
2060
- var getServices = toolkit.createSelector(servicesStore, function (store) {
2061
- return store ? store.byId : {};
2062
- }, selectorMemoizationOptions);
2063
- /**
2064
- * Gets the service object by its url
2065
- *
2066
- * Example: service = getServiceByName(store, 'serviceName')
2067
- * @param {object} store store: object - Store object
2068
- * @returns {ReduxService} returnType: Service
2069
- */
2070
-
2071
- var getServiceByName = toolkit.createSelector([servicesStore, function (state, serviceUrl) {
2072
- return serviceUrl;
2073
- }], function (serviceState, serviceUrl) {
2074
- var foundServiceIndex = serviceState.allIds.findIndex(function (id) {
2075
- return serviceState.byId[id].serviceUrl === serviceUrl;
2076
- });
2077
- /* Add the service based on a url */
2078
-
2079
- var id = foundServiceIndex !== -1 ? serviceState.allIds[foundServiceIndex] : null;
2080
-
2081
- if (serviceState && serviceState.byId && serviceState.byId[id]) {
2082
- return serviceState.byId[id];
2083
- }
2084
-
2085
- return null;
2086
- }, selectorMemoizationOptions);
2087
- /**
2088
- * Gets the layer from the store using the serviceUrl and layerName
2089
- *
2090
- * Example: layers = getLayersFromService(store, 'https://geoservices.knmi.nl/...')
2091
- * @param {object} store store: object - object from which the layers state will be extracted
2092
- * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
2093
- * @returns {array} returnType: ServiceLayer[] - All layers within the service object.
2094
- */
2095
-
2096
- var getLayersFromService$1 = toolkit.createSelector(getServiceByName, function (service) {
2097
- return service && service.layers || null;
2098
- }, selectorMemoizationOptions);
2099
- /**
2100
- * Gets the layer from the store using the serviceUrl and layerName
2101
- *
2102
- * Example: layer = getLayerFromService(store, 'https://geoservices.knmi.nl/...', 'radar')
2103
- * @param {object} store store: object - The application store
2104
- * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
2105
- * @param {string} layerName layerName: string - Name of the layer in the service
2106
- * @returns {ServiceLayer} returnType: ServiceLayer - The layer from the service object.
2107
- */
2108
-
2109
- var getLayerFromService = toolkit.createSelector(function (store, serviceUrl) {
2110
- return getLayersFromService$1(store, serviceUrl);
2111
- }, function (store, serviceUrl) {
2112
- return serviceUrl;
2113
- }, function (store, serviceUrl, layerName) {
2114
- return layerName;
2115
- }, function (layers, serviceUrl, layerName) {
2116
- if (!layers) {
2117
- return null;
2118
- }
2119
-
2120
- var index = layers.findIndex(function (serviceLayer) {
2121
- return serviceLayer.name === layerName;
2122
- });
2123
-
2124
- if (index === -1) {
2125
- return null;
2126
- }
2127
-
2128
- return layers[index];
2129
- }, selectorMemoizationOptions);
2130
- /**
2131
- * Gets the layers stylelist from the servicestore using the serviceUrl and layerName
2132
- *
2133
- * Example: layerStyles = getLayerStyles(store, layerService, layerName);
2134
- * @param {object} store store: object - store from which the layers state will be extracted
2135
- * @param {string} serviceUrl serviceUrl: string - Url of the service where the layer belongs to
2136
- * @param {string} layerName layerName: string - Name of the layer in the service
2137
- * @returns {array} returnType: Style[] - array containing layer styles
2138
- */
2139
-
2140
- var getLayerStyles$1 = toolkit.createSelector(getLayerFromService, function (layer) {
2141
- return layer && layer.styles ? layer.styles : [];
2142
- }, selectorMemoizationOptions);
2143
-
2144
- /* *
2145
- * Licensed under the Apache License, Version 2.0 (the "License");
2146
- * you may not use this file except in compliance with the License.
2147
- * You may obtain a copy of the License at
2148
- *
2149
- * http://www.apache.org/licenses/LICENSE-2.0
2150
- *
2151
- * Unless required by applicable law or agreed to in writing, software
2152
- * distributed under the License is distributed on an "AS IS" BASIS,
2153
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2154
- * See the License for the specific language governing permissions and
2155
- * limitations under the License.
2156
- *
2157
- * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2158
- * Copyright 2023 - Finnish Meteorological Institute (FMI)
2159
- * */
2160
- var moveToTop = function moveToTop(list, element) {
2161
- var filteredList = list.filter(function (item) {
2162
- return item !== element;
2163
- });
2164
-
2165
- var newOrder = __spreadArray([element], __read(filteredList));
2166
-
2167
- return newOrder;
2168
- };
2169
- var createUIDialogElement = function createUIDialogElement(_a) {
2170
- var activeMapId = _a.activeMapId,
2171
- type = _a.type,
2172
- setOpen = _a.setOpen,
2173
- _b = _a.source,
2174
- source = _b === void 0 ? 'app' : _b;
2175
- return {
2176
- activeMapId: activeMapId,
2177
- isOpen: setOpen,
2178
- type: type,
2179
- source: source,
2180
- isLoading: false,
2181
- error: undefined,
2182
- focused: false
2183
- };
2184
- };
2185
- var initialState$6 = {
2186
- order: [],
2187
- dialogs: {},
2188
- activeWindowId: undefined
2189
- };
2190
- var slice$6 = toolkit.createSlice({
2191
- initialState: initialState$6,
2192
- name: 'uiReducer',
2193
- reducers: {
2194
- registerDialog: function registerDialog(draft, action) {
2195
- var type = action.payload.type;
2196
- var activeMapId = action.payload.mapId ? action.payload.mapId : '';
2197
- var setOpen = action.payload.setOpen ? action.payload.setOpen : false;
2198
- var source = action.payload.source ? action.payload.source : 'app';
2199
-
2200
- if (!Object.keys(draft.dialogs).includes(type)) {
2201
- draft.dialogs[type] = createUIDialogElement({
2202
- activeMapId: activeMapId,
2203
- type: type,
2204
- setOpen: setOpen,
2205
- source: source
2206
- });
2207
- } // register dialog to order
2208
-
2209
-
2210
- if (!draft.order.includes(type)) {
2211
- draft.order.push(type);
2212
- }
2213
- },
2214
- unregisterDialog: function unregisterDialog(draft, action) {
2215
- var type = action.payload.type;
2216
-
2217
- if (draft.dialogs[type]) {
2218
- delete draft.dialogs[type];
2219
- draft.order = draft.order.filter(function (item) {
2220
- return item !== type;
2221
- });
2222
- }
2223
- },
2224
- setActiveMapIdForDialog: function setActiveMapIdForDialog(draft, action) {
2225
- var _a = action.payload,
2226
- type = _a.type,
2227
- mapId = _a.mapId,
2228
- source = _a.source;
2229
-
2230
- if (!draft.dialogs[type]) {
2231
- return;
2232
- }
2233
-
2234
- var isOpen = action.payload.setOpen !== undefined ? action.payload.setOpen : draft.dialogs[type].isOpen;
2235
- draft.dialogs[type].activeMapId = mapId;
2236
- draft.dialogs[type].isOpen = isOpen;
2237
- draft.dialogs[type].source = source;
2238
-
2239
- if (isOpen) {
2240
- draft.order = moveToTop(draft.order, type);
2241
- }
2242
- },
2243
- setToggleOpenDialog: function setToggleOpenDialog(draft, action) {
2244
- var _a = action.payload,
2245
- type = _a.type,
2246
- setOpen = _a.setOpen;
2303
+ if (isOpen) {
2304
+ draft.order = moveToTop(draft.order, type);
2305
+ }
2306
+ },
2307
+ setToggleOpenDialog: function setToggleOpenDialog(draft, action) {
2308
+ var _a = action.payload,
2309
+ type = _a.type,
2310
+ setOpen = _a.setOpen;
2247
2311
 
2248
2312
  if (!draft.dialogs[type]) {
2249
2313
  return;
@@ -2316,9 +2380,9 @@
2316
2380
  baseLayerDelete = layerActions.baseLayerDelete,
2317
2381
  layerChangeDimension$1 = layerActions.layerChangeDimension,
2318
2382
  layerDelete$1 = layerActions.layerDelete,
2319
- onUpdateLayerInformation = layerActions.onUpdateLayerInformation,
2320
2383
  setBaseLayers$1 = layerActions.setBaseLayers,
2321
- setLayers = layerActions.setLayers;
2384
+ setLayers = layerActions.setLayers,
2385
+ onUpdateLayerInformation = layerActions.onUpdateLayerInformation;
2322
2386
  /**
2323
2387
  * Checks if the layer id is already taken in one of the maps.
2324
2388
  * @param state The WebMapState
@@ -2976,12 +3040,16 @@
2976
3040
  }).addCase(onUpdateLayerInformation, function (draft, action) {
2977
3041
  var mapDimensions = action.payload.mapDimensions;
2978
3042
 
2979
- if (mapDimensions === null) {
3043
+ if (!mapDimensions) {
2980
3044
  return draft;
2981
3045
  }
2982
3046
 
2983
- var mapAction = mapActions$1.mapUpdateAllMapDimensions(mapDimensions);
2984
- return reducer$5(draft, mapAction);
3047
+ var dimensions = mapDimensions.dimensions,
3048
+ mapId = mapDimensions.mapId;
3049
+ dimensions.forEach(function (dimension) {
3050
+ return produceDraftStateSetWebMapDimension(draft, mapId, dimension, false);
3051
+ });
3052
+ return draft;
2985
3053
  }).addCase(mapChangeDimension, function (draft, action) {
2986
3054
  var _a = action.payload,
2987
3055
  mapId = _a.mapId,
@@ -3450,7 +3518,9 @@
3450
3518
  if (store && store.ui && store.ui.order) {
3451
3519
  var order = store.ui.order;
3452
3520
  var visibleOrder = order.filter(function (orderedDialogType) {
3453
- return store.ui.dialogs[orderedDialogType].isOpen;
3521
+ var _a;
3522
+
3523
+ return (_a = store.ui.dialogs[orderedDialogType]) === null || _a === void 0 ? void 0 : _a.isOpen;
3454
3524
  });
3455
3525
 
3456
3526
  if (!visibleOrder.includes(dialogType)) {
@@ -4045,6 +4115,24 @@
4045
4115
  var getSyncedMapIdsForTimeslider = toolkit.createSelector(syncGroupStore, function (store) {
4046
4116
  return store.viewState.timeslider.groups[0].selected;
4047
4117
  }, selectorMemoizationOptions);
4118
+ var getSyncGroupTargets = function getSyncGroupTargets(state) {
4119
+ var syncStore = syncGroupStore(state);
4120
+
4121
+ if (!syncStore || !syncStore.groups) {
4122
+ return [];
4123
+ }
4124
+
4125
+ return syncStore.groups.allIds.reduce(function (targets, groupId) {
4126
+ var group = syncStore.groups.byId[groupId];
4127
+ return targets.concat(group.targets.allIds.map(function (targetId) {
4128
+ return {
4129
+ groupId: groupId,
4130
+ targetId: targetId,
4131
+ linked: group.targets.byId[targetId].linked
4132
+ };
4133
+ }));
4134
+ }, []);
4135
+ };
4048
4136
 
4049
4137
  var selectors$2 = /*#__PURE__*/Object.freeze({
4050
4138
  __proto__: null,
@@ -4056,7 +4144,8 @@
4056
4144
  getTargetGroups: getTargetGroups,
4057
4145
  getAllTargetGroupsForSource: getAllTargetGroupsForSource,
4058
4146
  syncGroupGetViewState: syncGroupGetViewState,
4059
- getSyncedMapIdsForTimeslider: getSyncedMapIdsForTimeslider
4147
+ getSyncedMapIdsForTimeslider: getSyncedMapIdsForTimeslider,
4148
+ getSyncGroupTargets: getSyncGroupTargets
4060
4149
  });
4061
4150
 
4062
4151
  /* *
@@ -6994,11 +7083,11 @@
6994
7083
  * See the License for the specific language governing permissions and
6995
7084
  * limitations under the License.
6996
7085
  *
6997
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
6998
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
7086
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7087
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
6999
7088
  * */
7000
7089
 
7001
- var PlayButton = function PlayButton(_a) {
7090
+ var PlayButton$1 = function PlayButton(_a) {
7002
7091
  var isAnimating = _a.isAnimating,
7003
7092
  isDisabled = _a.isDisabled,
7004
7093
  _b = _a.onTogglePlayButton,
@@ -7008,18 +7097,18 @@
7008
7097
  onTogglePlayButton();
7009
7098
  };
7010
7099
 
7011
- return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
7012
- title: isAnimating ? 'Pause' : 'Play'
7013
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
7100
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
7101
+ variant: "tool",
7102
+ tooltipTitle: isAnimating ? 'Pause' : 'Play',
7014
7103
  onClick: onTogglePlay,
7015
7104
  disabled: isDisabled,
7016
7105
  "data-testid": "playButton",
7017
- active: isAnimating
7106
+ isSelected: isAnimating
7018
7107
  }, isAnimating ? /*#__PURE__*/React__namespace.createElement(theme.Pause, {
7019
7108
  "data-testid": "pause-svg-path"
7020
7109
  }) : /*#__PURE__*/React__namespace.createElement(theme.Play, {
7021
7110
  "data-testid": "play-svg-path"
7022
- }))));
7111
+ }));
7023
7112
  };
7024
7113
 
7025
7114
  /* *
@@ -7078,7 +7167,7 @@
7078
7167
  }
7079
7168
  };
7080
7169
 
7081
- return /*#__PURE__*/React__default["default"].createElement(PlayButton, {
7170
+ return /*#__PURE__*/React__default["default"].createElement(PlayButton$1, {
7082
7171
  isAnimating: linkedMapAnimationInfo.isAnimating,
7083
7172
  isDisabled: isDisabled,
7084
7173
  onTogglePlayButton: function onTogglePlayButton() {
@@ -9896,8 +9985,8 @@
9896
9985
  id: 'webmap-module',
9897
9986
  reducersMap: {
9898
9987
  webmap: reducer$5,
9899
- services: reducer$7,
9900
- layers: reducer$8
9988
+ services: reducer$8,
9989
+ layers: reducer$7
9901
9990
  },
9902
9991
  sagas: [rootSaga$4, rootSaga$3]
9903
9992
  };
@@ -10411,10 +10500,13 @@
10411
10500
  };
10412
10501
 
10413
10502
  var HeaderOptions = function HeaderOptions(_a) {
10503
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
10504
+
10414
10505
  var isDockedLayerManager = _a.isDockedLayerManager,
10415
10506
  shortcutsEnabled = _a.shortcutsEnabled,
10416
10507
  onClickDockButton = _a.onClickDockButton,
10417
- onChangeSize = _a.onChangeSize;
10508
+ onChangeSize = _a.onChangeSize,
10509
+ buttonSettings = _a.buttonSettings;
10418
10510
  React__namespace.useEffect(function () {
10419
10511
  var handleKeyDown = function handleKeyDown(event) {
10420
10512
  if (shortcutsEnabled) {
@@ -10433,28 +10525,28 @@
10433
10525
  document.removeEventListener('keydown', handleKeyDown);
10434
10526
  };
10435
10527
  }, [onChangeSize, shortcutsEnabled]);
10436
- return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10528
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, !((_b = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.small) === null || _b === void 0 ? void 0 : _b.isDisabled) && /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10437
10529
  tooltipTitle: "small",
10438
10530
  "data-testid": "collapseSmall-btn",
10439
10531
  onClick: function onClick() {
10440
10532
  return onChangeSize(sizeSmall);
10441
10533
  },
10442
10534
  className: "collapseSmall-btn"
10443
- }, /*#__PURE__*/React__namespace.createElement(theme.CollapseSmall, null)), /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10535
+ }, (_d = (_c = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.small) === null || _c === void 0 ? void 0 : _c.icon) !== null && _d !== void 0 ? _d : /*#__PURE__*/React__namespace.createElement(theme.CollapseSmall, null)), !((_e = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.medium) === null || _e === void 0 ? void 0 : _e.isDisabled) && /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10444
10536
  tooltipTitle: "medium",
10445
10537
  "data-testid": "collapseMedium-btn",
10446
10538
  onClick: function onClick() {
10447
10539
  return onChangeSize(sizeMedium);
10448
10540
  },
10449
10541
  className: "collapseMedium-btn"
10450
- }, /*#__PURE__*/React__namespace.createElement(theme.CollapseMedium, null)), /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10542
+ }, (_g = (_f = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.medium) === null || _f === void 0 ? void 0 : _f.icon) !== null && _g !== void 0 ? _g : /*#__PURE__*/React__namespace.createElement(theme.CollapseMedium, null)), !((_h = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.large) === null || _h === void 0 ? void 0 : _h.isDisabled) && /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10451
10543
  tooltipTitle: "large",
10452
10544
  "data-testid": "collapseLarge-btn",
10453
10545
  onClick: function onClick() {
10454
10546
  return onChangeSize(sizeLarge);
10455
10547
  },
10456
10548
  className: "collapseLarge-btn"
10457
- }, /*#__PURE__*/React__namespace.createElement(theme.CollapseLarge, null)), /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10549
+ }, (_k = (_j = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.large) === null || _j === void 0 ? void 0 : _j.icon) !== null && _k !== void 0 ? _k : /*#__PURE__*/React__namespace.createElement(theme.CollapseLarge, null)), !((_l = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.dock) === null || _l === void 0 ? void 0 : _l.isDisabled) && /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
10458
10550
  tooltipTitle: isDockedLayerManager ? 'Undock' : 'Dock',
10459
10551
  "data-testid": "dockedBtn",
10460
10552
  disableRipple: true,
@@ -10465,7 +10557,7 @@
10465
10557
  "data-testid": "dockedLayerManager-collapse"
10466
10558
  }) : /*#__PURE__*/React__namespace.createElement(theme.ExpandWindow, {
10467
10559
  "data-testid": "dockedLayerManager-uncollapse"
10468
- })));
10560
+ })), (_m = buttonSettings === null || buttonSettings === void 0 ? void 0 : buttonSettings.divider) === null || _m === void 0 ? void 0 : _m.element);
10469
10561
  };
10470
10562
 
10471
10563
  /* *
@@ -10730,13 +10822,15 @@
10730
10822
  * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
10731
10823
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
10732
10824
  * */
10733
- var styles$4 = {
10734
- text: {
10735
- paddingLeft: '10px',
10736
- fontSize: '12px',
10737
- fontFamily: 'Roboto',
10738
- opacity: 0.67
10739
- }
10825
+ var styles$5 = {
10826
+ text: function text(theme) {
10827
+ return __assign({
10828
+ paddingLeft: '10px',
10829
+ fontSize: '12px',
10830
+ fontFamily: 'Roboto',
10831
+ opacity: 0.67
10832
+ }, theme.palette.geowebColors.layerManager.headerRowText);
10833
+ }
10740
10834
  };
10741
10835
 
10742
10836
  var DescriptionRow = function DescriptionRow(_a) {
@@ -10777,7 +10871,7 @@
10777
10871
  className: columnClasses.column2
10778
10872
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
10779
10873
  className: "header-layer " + (hasMapPresetsModule ? 'mappresetsModule-enabled' : ''),
10780
- sx: styles$4.text
10874
+ sx: styles$5.text
10781
10875
  }, (_e = (_d = settings === null || settings === void 0 ? void 0 : settings.layerName) === null || _d === void 0 ? void 0 : _d.title) !== null && _e !== void 0 ? _e : 'Layer'), /*#__PURE__*/React__namespace.createElement(material.Box, {
10782
10876
  className: "header-mapPresets",
10783
10877
  sx: {
@@ -10786,15 +10880,15 @@
10786
10880
  }, mapPresetsModuleInline)), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10787
10881
  className: columnClasses.column3
10788
10882
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
10789
- sx: styles$4.text
10883
+ sx: styles$5.text
10790
10884
  }, (_g = (_f = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _f === void 0 ? void 0 : _f.title) !== null && _g !== void 0 ? _g : 'Style')), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10791
10885
  className: columnClasses.column4
10792
10886
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
10793
- sx: styles$4.text
10887
+ sx: styles$5.text
10794
10888
  }, (_j = (_h = settings === null || settings === void 0 ? void 0 : settings.opacity) === null || _h === void 0 ? void 0 : _h.title) !== null && _j !== void 0 ? _j : 'Opacity')), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10795
10889
  className: columnClasses.column5
10796
10890
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
10797
- sx: styles$4.text
10891
+ sx: styles$5.text
10798
10892
  }, (_l = (_k = settings === null || settings === void 0 ? void 0 : settings.dimensions) === null || _k === void 0 ? void 0 : _k.title) !== null && _l !== void 0 ? _l : 'Dimensions')), /*#__PURE__*/React__namespace.createElement(material.Grid, {
10799
10893
  className: columnClasses.column6
10800
10894
  }));
@@ -11157,22 +11251,25 @@
11157
11251
  }];
11158
11252
 
11159
11253
  var OpacitySelect = function OpacitySelect(_a) {
11254
+ var _b;
11255
+
11160
11256
  var currentOpacity = _a.currentOpacity,
11161
11257
  onLayerChangeOpacity = _a.onLayerChangeOpacity,
11162
- _b = _a.isEnabled,
11163
- isEnabled = _b === void 0 ? true : _b,
11164
- _c = _a.tooltipPrefix,
11165
- tooltipPrefix = _c === void 0 ? 'Opacity: ' : _c;
11258
+ _c = _a.isEnabled,
11259
+ isEnabled = _c === void 0 ? true : _c,
11260
+ _d = _a.tooltipPrefix,
11261
+ tooltipPrefix = _d === void 0 ? 'Opacity: ' : _d;
11166
11262
 
11167
- var _d = __read(shared.useControlledTooltip(), 2),
11168
- tooltipOpen = _d[0],
11169
- setTooltipOpen = _d[1];
11263
+ var _e = __read(shared.useControlledTooltip(), 2),
11264
+ tooltipOpen = _e[0],
11265
+ setTooltipOpen = _e[1];
11170
11266
 
11171
- var _e = __read(React__namespace.useState(null), 2),
11172
- anchorEl = _e[0],
11173
- setAnchorEl = _e[1];
11267
+ var _f = __read(React__namespace.useState(null), 2),
11268
+ anchorEl = _f[0],
11269
+ setAnchorEl = _f[1];
11174
11270
 
11175
11271
  var isOpen = Boolean(anchorEl);
11272
+ var theme = material.useTheme();
11176
11273
 
11177
11274
  var handleClick = function handleClick(event) {
11178
11275
  setAnchorEl(anchorEl ? null : event.currentTarget);
@@ -11220,10 +11317,10 @@
11220
11317
  onWheel: onWheel,
11221
11318
  className: "opacity-select",
11222
11319
  "data-testid": "scrollOpacity",
11223
- sx: {
11320
+ sx: __assign({
11224
11321
  width: '100%',
11225
11322
  height: 32
11226
- }
11323
+ }, (_b = theme.palette.geowebColors.layerManager.opacitySelect) === null || _b === void 0 ? void 0 : _b.root)
11227
11324
  }, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
11228
11325
  title: "" + tooltipPrefix + currentOpacityText,
11229
11326
  sx: shared.tooltipContainerStyles(isEnabled),
@@ -11238,12 +11335,17 @@
11238
11335
  onMouseLeave: onMouseLeave,
11239
11336
  onFocus: onFocus,
11240
11337
  onBlur: onBlur,
11241
- style: {
11338
+ sx: __assign({
11242
11339
  height: '100%',
11243
11340
  width: '100%',
11244
11341
  borderRadius: '0',
11245
- minWidth: '49px'
11246
- },
11342
+ minWidth: '49px',
11343
+ fontSize: function fontSize(theme) {
11344
+ return theme.palette.geowebColors.layerManager.tableRowDefaultText.fontSize;
11345
+ },
11346
+ color: isEnabled ? 'geowebColors.layerManager.tableRowDefaultText.rgba' : 'geowebColors.layerManager.tableRowDisabledText.rgba'
11347
+ }, theme.palette.geowebColors.layerManager.opacitySelect.button),
11348
+ className: isOpen ? 'open' : '',
11247
11349
  // Safari-based browsers handle focus differently with buttons
11248
11350
  // https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
11249
11351
  // Use div instead to fix onBlur hander's event.relatedTarget below
@@ -11256,14 +11358,14 @@
11256
11358
  },
11257
11359
  placement: "right"
11258
11360
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
11259
- sx: {
11361
+ sx: __assign({
11260
11362
  padding: '0 0 60px 0',
11261
11363
  backgroundColor: 'geowebColors.background.surface',
11262
11364
  width: '82px',
11263
11365
  height: '248px',
11264
11366
  boxSizing: 'initial',
11265
11367
  boxShadow: 8
11266
- }
11368
+ }, theme.palette.geowebColors.layerManager.opacitySelect.popper)
11267
11369
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
11268
11370
  sx: shared.sliderHeaderStyle
11269
11371
  }, "Opacity"), /*#__PURE__*/React__namespace.createElement(shared.CustomSlider, {
@@ -11417,8 +11519,8 @@
11417
11519
  * See the License for the specific language governing permissions and
11418
11520
  * limitations under the License.
11419
11521
  *
11420
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11421
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
11522
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
11523
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
11422
11524
  * */
11423
11525
 
11424
11526
  var getIconColor = function getIconColor(isActive, isEnabled) {
@@ -11508,7 +11610,8 @@
11508
11610
  isEnabled = _a.isEnabled;
11509
11611
  var isActive = current !== AutoOptions.NONE;
11510
11612
  var Icon = getIcon(isActive, isEnabled, current);
11511
- return /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
11613
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
11614
+ variant: "tool",
11512
11615
  "aria-label": current,
11513
11616
  "data-testid": "activateLayer-btn",
11514
11617
  sx: {
@@ -11516,7 +11619,7 @@
11516
11619
  backgroundColor: 'inherit'
11517
11620
  }
11518
11621
  },
11519
- active: isActive
11622
+ isSelected: isActive
11520
11623
  }, Icon);
11521
11624
  };
11522
11625
 
@@ -11608,6 +11711,7 @@
11608
11711
  layerDeleteLayout = _a.layerDeleteLayout,
11609
11712
  layerMenuLayout = _a.layerMenuLayout,
11610
11713
  layerActiveLayout = _a.layerActiveLayout,
11714
+ disableActivateLayer = _a.disableActivateLayer,
11611
11715
  dragHandle = _a.dragHandle;
11612
11716
 
11613
11717
  var onClickRow = function onClickRow() {
@@ -11659,11 +11763,11 @@
11659
11763
  });
11660
11764
  },
11661
11765
  "data-testid": "enableButton-medium"
11662
- }, isEnabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null)), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
11766
+ }, isEnabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null)), !disableActivateLayer && (layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
11663
11767
  current: AutoOptions.BOTH,
11664
11768
  onChange: onClickRow,
11665
11769
  isEnabled: true
11666
- }), /*#__PURE__*/React__default["default"].createElement(material.Typography, {
11770
+ })), /*#__PURE__*/React__default["default"].createElement(material.Typography, {
11667
11771
  sx: {
11668
11772
  fontWeight: '500',
11669
11773
  fontSize: '12px',
@@ -11744,11 +11848,11 @@
11744
11848
  });
11745
11849
  },
11746
11850
  "data-testid": "enableButton"
11747
- }, layer.enabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null)), layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
11851
+ }, layer.enabled ? /*#__PURE__*/React__default["default"].createElement(theme.Visibility, null) : /*#__PURE__*/React__default["default"].createElement(theme.VisibilityOff, null)), !disableActivateLayer && (layerActiveLayout || /*#__PURE__*/React__default["default"].createElement(ActivateLayer, {
11748
11852
  onChange: onClickRow,
11749
11853
  current: AutoOptions.BOTH,
11750
11854
  isEnabled: true
11751
- })), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11855
+ }))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
11752
11856
  item: true,
11753
11857
  className: columnClasses.column2
11754
11858
  }, layerServicesLayout || /*#__PURE__*/React__default["default"].createElement(RenderLayers, {
@@ -12431,7 +12535,7 @@
12431
12535
  * */
12432
12536
 
12433
12537
  var LayerRowConnect = function LayerRowConnect(_a) {
12434
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
12538
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
12435
12539
 
12436
12540
  var layerId = _a.layerId,
12437
12541
  mapId = _a.mapId,
@@ -12475,10 +12579,13 @@
12475
12579
  mapId: mapId,
12476
12580
  tooltipPrefix: (_g = settings === null || settings === void 0 ? void 0 : settings.opacity) === null || _g === void 0 ? void 0 : _g.tooltipPrefix
12477
12581
  }),
12478
- layerServicesLayout: /*#__PURE__*/React__namespace.createElement(RenderLayersConnect, {
12582
+ layerServicesLayout: ((_h = settings === null || settings === void 0 ? void 0 : settings.renderLayer) === null || _h === void 0 ? void 0 : _h.Element) ? /*#__PURE__*/React__namespace.createElement(settings.renderLayer.Element, {
12583
+ layerId: layerId,
12584
+ mapId: mapId
12585
+ }) : /*#__PURE__*/React__namespace.createElement(RenderLayersConnect, {
12479
12586
  layerId: layerId,
12480
12587
  mapId: mapId,
12481
- tooltipPrefix: (_h = settings === null || settings === void 0 ? void 0 : settings.renderLayer) === null || _h === void 0 ? void 0 : _h.tooltipPrefix
12588
+ tooltipPrefix: (_j = settings === null || settings === void 0 ? void 0 : settings.renderLayer) === null || _j === void 0 ? void 0 : _j.tooltipPrefix
12482
12589
  }),
12483
12590
  layerDimensionLayout: /*#__PURE__*/React__namespace.createElement(DimensionSelectConnect, {
12484
12591
  layerId: layerId,
@@ -12487,26 +12594,27 @@
12487
12594
  layerStylesLayout: /*#__PURE__*/React__namespace.createElement(RenderStylesConnect, {
12488
12595
  layerId: layerId,
12489
12596
  mapId: mapId,
12490
- tooltipPrefix: (_j = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _j === void 0 ? void 0 : _j.tooltipPrefix,
12491
- icon: (_k = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _k === void 0 ? void 0 : _k.icon
12597
+ tooltipPrefix: (_k = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _k === void 0 ? void 0 : _k.tooltipPrefix,
12598
+ icon: (_l = settings === null || settings === void 0 ? void 0 : settings.layerStyle) === null || _l === void 0 ? void 0 : _l.icon
12492
12599
  }),
12493
12600
  layerDeleteLayout: /*#__PURE__*/React__namespace.createElement(DeleteLayerConnect, {
12494
12601
  mapId: mapId,
12495
12602
  layerId: layerId,
12496
12603
  layerIndex: layerIndex,
12497
- tooltipTitle: (_l = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _l === void 0 ? void 0 : _l.tooltipTitle,
12498
- icon: (_m = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _m === void 0 ? void 0 : _m.icon
12604
+ tooltipTitle: (_m = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _m === void 0 ? void 0 : _m.tooltipTitle,
12605
+ icon: (_o = settings === null || settings === void 0 ? void 0 : settings.deleteLayer) === null || _o === void 0 ? void 0 : _o.icon
12499
12606
  }),
12500
12607
  layerMenuLayout: /*#__PURE__*/React__namespace.createElement(LayerManagerMenuButtonConnect, {
12501
12608
  mapId: mapId,
12502
12609
  layerId: layerId,
12503
- tooltipTitle: (_o = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _o === void 0 ? void 0 : _o.tooltipTitle,
12504
- icon: (_p = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _p === void 0 ? void 0 : _p.icon
12610
+ tooltipTitle: (_p = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _p === void 0 ? void 0 : _p.tooltipTitle,
12611
+ icon: (_q = settings === null || settings === void 0 ? void 0 : settings.menu) === null || _q === void 0 ? void 0 : _q.icon
12505
12612
  }),
12506
- layerActiveLayout: /*#__PURE__*/React__namespace.createElement(ActivateLayerConnect, {
12613
+ layerActiveLayout: ((_r = settings === null || settings === void 0 ? void 0 : settings.activateLayer) === null || _r === void 0 ? void 0 : _r.isDisabled) ? undefined : /*#__PURE__*/React__namespace.createElement(ActivateLayerConnect, {
12507
12614
  mapId: mapId,
12508
12615
  layerId: layerId
12509
12616
  }),
12617
+ disableActivateLayer: (_s = settings === null || settings === void 0 ? void 0 : settings.activateLayer) === null || _s === void 0 ? void 0 : _s.isDisabled,
12510
12618
  dragHandle: dragHandle
12511
12619
  });
12512
12620
  };
@@ -12554,8 +12662,8 @@
12554
12662
  disabled: isDisabled,
12555
12663
  sx: {
12556
12664
  cursor: isSorting ? 'grabbing' : 'grab',
12557
- '&:hover': {
12558
- backgroundColor: 'inherit!important'
12665
+ '&.handle:hover': function handleHover(theme) {
12666
+ return __assign({}, theme.palette.geowebColors.layerManager.dragHandleHover);
12559
12667
  },
12560
12668
  marginLeft: '3px',
12561
12669
  marginRight: '3px',
@@ -13592,7 +13700,7 @@
13592
13700
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13593
13701
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
13594
13702
  * */
13595
- var styles$3 = {
13703
+ var styles$4 = {
13596
13704
  buttonDiv: {
13597
13705
  position: 'relative'
13598
13706
  },
@@ -13635,7 +13743,7 @@
13635
13743
  }, []);
13636
13744
  return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
13637
13745
  onClick: handleClose,
13638
- sx: styles$3.button,
13746
+ sx: styles$4.button,
13639
13747
  disableRipple: true,
13640
13748
  "data-testid": "addLayersButton",
13641
13749
  ref: ref,
@@ -13667,32 +13775,33 @@
13667
13775
  * */
13668
13776
 
13669
13777
  var BaseLayerRow = function BaseLayerRow(_a) {
13670
- var _b, _c, _d;
13778
+ var _b, _c, _d, _e, _f;
13671
13779
 
13672
13780
  var mapId = _a.mapId,
13673
- _e = _a.preloadedAvailableBaseLayers,
13674
- preloadedAvailableBaseLayers = _e === void 0 ? availableDefaultBaseLayers : _e,
13675
- _f = _a.preloadedServices,
13676
- preloadedServices = _f === void 0 ? preloadedDefaultBaseServices : _f,
13677
- _g = _a.tooltip,
13678
- tooltip = _g === void 0 ? '' : _g,
13781
+ _g = _a.preloadedAvailableBaseLayers,
13782
+ preloadedAvailableBaseLayers = _g === void 0 ? availableDefaultBaseLayers : _g,
13783
+ _h = _a.preloadedServices,
13784
+ preloadedServices = _h === void 0 ? preloadedDefaultBaseServices : _h,
13785
+ _j = _a.tooltip,
13786
+ tooltip = _j === void 0 ? '' : _j,
13679
13787
  settings = _a.settings;
13788
+ var theme = material.useTheme();
13680
13789
  return /*#__PURE__*/React__namespace.createElement(material.Grid, {
13681
13790
  container: true,
13682
13791
  item: true,
13683
13792
  "data-testid": "baseLayerRow",
13684
13793
  className: "addLayer-column",
13685
- sx: {
13794
+ sx: __assign({
13686
13795
  width: '100%',
13687
13796
  height: '36px'
13688
- }
13797
+ }, theme.palette.geowebColors.layerManager.baseLayerRow.root)
13689
13798
  }, /*#__PURE__*/React__namespace.createElement(material.Grid, {
13690
13799
  item: true,
13691
13800
  className: columnClasses.column1,
13692
13801
  sx: {
13693
13802
  marginTop: '-2px'
13694
13803
  }
13695
- }, /*#__PURE__*/React__namespace.createElement(AddLayersButton, {
13804
+ }, !((_c = (_b = settings === null || settings === void 0 ? void 0 : settings.baseLayerRow) === null || _b === void 0 ? void 0 : _b.addLayersButton) === null || _c === void 0 ? void 0 : _c.isDisabled) && /*#__PURE__*/React__namespace.createElement(AddLayersButton, {
13696
13805
  preloadedServices: preloadedServices,
13697
13806
  tooltip: tooltip,
13698
13807
  onRenderTree: function onRenderTree(service) {
@@ -13702,14 +13811,14 @@
13702
13811
  layerType: LayerType.baseLayer
13703
13812
  });
13704
13813
  }
13705
- })), (_b = settings === null || settings === void 0 ? void 0 : settings.baseLayerRow) === null || _b === void 0 ? void 0 : _b.title, /*#__PURE__*/React__namespace.createElement(material.Grid, {
13814
+ }), (_d = settings === null || settings === void 0 ? void 0 : settings.baseLayerRow) === null || _d === void 0 ? void 0 : _d.title), /*#__PURE__*/React__namespace.createElement(material.Grid, {
13706
13815
  item: true,
13707
13816
  className: columnClasses.column2
13708
13817
  }, /*#__PURE__*/React__namespace.createElement(BaseLayersConnect, {
13709
13818
  mapId: mapId,
13710
13819
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
13711
- tooltipPrefix: (_c = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _c === void 0 ? void 0 : _c.tooltipPrefix,
13712
- icon: (_d = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _d === void 0 ? void 0 : _d.icon
13820
+ tooltipPrefix: (_e = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _e === void 0 ? void 0 : _e.tooltipPrefix,
13821
+ icon: (_f = settings === null || settings === void 0 ? void 0 : settings.baseLayerDropdown) === null || _f === void 0 ? void 0 : _f.icon
13713
13822
  })));
13714
13823
  };
13715
13824
 
@@ -13745,7 +13854,8 @@
13745
13854
  var isDockedLayerManager = _a.isDockedLayerManager,
13746
13855
  mapId = _a.mapId,
13747
13856
  onClickDockButton = _a.onClickDockButton,
13748
- onChangeSize = _a.onChangeSize;
13857
+ onChangeSize = _a.onChangeSize,
13858
+ buttonSettings = _a.buttonSettings;
13749
13859
  var activeMapId = reactRedux.useSelector(function (store) {
13750
13860
  return getActiveWindowId(store);
13751
13861
  });
@@ -13757,7 +13867,8 @@
13757
13867
  isDockedLayerManager: isDockedLayerManager,
13758
13868
  shortcutsEnabled: shortcutsEnabled,
13759
13869
  onClickDockButton: onClickDockButton,
13760
- onChangeSize: onChangeSize
13870
+ onChangeSize: onChangeSize,
13871
+ buttonSettings: buttonSettings
13761
13872
  });
13762
13873
  };
13763
13874
 
@@ -13777,7 +13888,7 @@
13777
13888
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
13778
13889
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
13779
13890
  * */
13780
- var styles$2 = {
13891
+ var styles$3 = {
13781
13892
  layerRowContainer: {
13782
13893
  position: 'relative',
13783
13894
  width: '100%',
@@ -13804,37 +13915,40 @@
13804
13915
  };
13805
13916
 
13806
13917
  var LayerManager = function LayerManager(_a) {
13918
+ var _b, _c, _d, _e, _f;
13919
+
13807
13920
  var mapId = _a.mapId,
13808
13921
  preloadedAvailableBaseLayers = _a.preloadedAvailableBaseLayers,
13809
13922
  preloadedBaseServices = _a.preloadedBaseServices,
13810
13923
  bounds = _a.bounds,
13811
13924
  onClose = _a.onClose,
13812
- showTitle = _a.showTitle,
13925
+ _g = _a.title,
13926
+ title = _g === void 0 ? 'Layer Manager' : _g,
13813
13927
  isOpen = _a.isOpen,
13814
- _b = _a.onMouseDown,
13815
- onMouseDown = _b === void 0 ? function () {} : _b,
13816
- _c = _a.order,
13817
- order = _c === void 0 ? 0 : _c,
13818
- _d = _a.source,
13819
- source = _d === void 0 ? 'app' : _d,
13820
- _e = _a.leftHeaderComponent,
13821
- leftHeaderComponent = _e === void 0 ? undefined : _e,
13822
- _f = _a.isLoading,
13823
- isLoading = _f === void 0 ? false : _f,
13928
+ _h = _a.onMouseDown,
13929
+ onMouseDown = _h === void 0 ? function () {} : _h,
13930
+ _j = _a.order,
13931
+ order = _j === void 0 ? 0 : _j,
13932
+ _k = _a.source,
13933
+ source = _k === void 0 ? 'app' : _k,
13934
+ _l = _a.leftHeaderComponent,
13935
+ leftHeaderComponent = _l === void 0 ? undefined : _l,
13936
+ _m = _a.isLoading,
13937
+ isLoading = _m === void 0 ? false : _m,
13824
13938
  error = _a.error,
13825
- _g = _a.isDockedLayerManager,
13826
- isDockedLayerManager = _g === void 0 ? false : _g,
13827
- _h = _a.onToggleDock,
13828
- onToggleDock = _h === void 0 ? function () {} : _h,
13829
- _j = _a.size,
13830
- size = _j === void 0 ? sizeLarge : _j,
13831
- _k = _a.startPosition,
13832
- startPosition = _k === void 0 ? {
13939
+ _o = _a.isDockedLayerManager,
13940
+ isDockedLayerManager = _o === void 0 ? false : _o,
13941
+ _p = _a.onToggleDock,
13942
+ onToggleDock = _p === void 0 ? function () {} : _p,
13943
+ _q = _a.size,
13944
+ size = _q === void 0 ? sizeLarge : _q,
13945
+ _r = _a.startPosition,
13946
+ startPosition = _r === void 0 ? {
13833
13947
  top: 85,
13834
13948
  left: 50
13835
- } : _k,
13836
- _l = _a.setFocused,
13837
- setFocused = _l === void 0 ? function () {} : _l,
13949
+ } : _r,
13950
+ _s = _a.setFocused,
13951
+ setFocused = _s === void 0 ? function () {} : _s,
13838
13952
  settings = _a.settings;
13839
13953
  var minSize = {
13840
13954
  width: 100,
@@ -13842,10 +13956,11 @@
13842
13956
  };
13843
13957
  var startSizeCalc = calculateStartSize(minSize, size, startPosition);
13844
13958
 
13845
- var _m = __read(React__namespace.useState(startSizeCalc), 2),
13846
- sizeInState = _m[0],
13847
- setSizeInState = _m[1];
13959
+ var _t = __read(React__namespace.useState(startSizeCalc), 2),
13960
+ sizeInState = _t[0],
13961
+ setSizeInState = _t[1];
13848
13962
 
13963
+ var theme = material.useTheme();
13849
13964
  React__namespace.useEffect(function () {
13850
13965
  if (size !== sizeInState && isDockedLayerManager && isOpen) {
13851
13966
  setSizeInState(size);
@@ -13853,7 +13968,7 @@
13853
13968
 
13854
13969
  }, [size, isOpen]);
13855
13970
  return /*#__PURE__*/React__namespace.createElement(shared.ToolContainerDraggable, {
13856
- title: showTitle ? "Layer Manager " + mapId : 'Layer Manager',
13971
+ title: title,
13857
13972
  startSize: sizeInState,
13858
13973
  minWidth: minSize.width,
13859
13974
  minHeight: minSize.height,
@@ -13882,10 +13997,13 @@
13882
13997
  setSizeInState(__assign(__assign({}, sizeInState), {
13883
13998
  width: width
13884
13999
  }));
13885
- }
14000
+ },
14001
+ buttonSettings: (_b = settings === null || settings === void 0 ? void 0 : settings.toolbar) === null || _b === void 0 ? void 0 : _b.controlButtonSettings
13886
14002
  }),
14003
+ dragHandleIcon: (_d = (_c = settings === null || settings === void 0 ? void 0 : settings.toolbar) === null || _c === void 0 ? void 0 : _c.dragHandle) === null || _d === void 0 ? void 0 : _d.icon,
14004
+ closeIcon: (_f = (_e = settings === null || settings === void 0 ? void 0 : settings.toolbar) === null || _e === void 0 ? void 0 : _e.closeButton) === null || _f === void 0 ? void 0 : _f.icon,
13887
14005
  className: "layermanager",
13888
- sx: layerManagerStyle,
14006
+ sx: __assign(__assign({}, layerManagerStyle), theme.palette.geowebColors.layerManager.root),
13889
14007
  onResizeStop: function onResizeStop(_event, _direction, node) {
13890
14008
  var width = node.offsetWidth,
13891
14009
  height = node.offsetHeight;
@@ -13922,7 +14040,7 @@
13922
14040
  })), /*#__PURE__*/React__namespace.createElement(material.Grid, {
13923
14041
  container: true,
13924
14042
  "data-testid": "layerManagerRowContainer",
13925
- sx: styles$2.layerRowContainer
14043
+ sx: styles$3.layerRowContainer
13926
14044
  }, /*#__PURE__*/React__namespace.createElement(DescriptionRow, {
13927
14045
  mapPresetsModule: leftHeaderComponent,
13928
14046
  mapId: mapId,
@@ -14136,24 +14254,26 @@
14136
14254
  preloadedMapServices = _a.preloadedMapServices,
14137
14255
  preloadedBaseServices = _a.preloadedBaseServices,
14138
14256
  bounds = _a.bounds,
14139
- _b = _a.showTitle,
14140
- showTitle = _b === void 0 ? false : _b,
14141
- _c = _a.leftHeaderComponent,
14142
- leftHeaderComponent = _c === void 0 ? undefined : _c;
14257
+ _b = _a.title,
14258
+ title = _b === void 0 ? 'Layer Manager' : _b,
14259
+ _c = _a.showMapIdInTitle,
14260
+ showMapIdInTitle = _c === void 0 ? false : _c,
14261
+ _d = _a.leftHeaderComponent,
14262
+ leftHeaderComponent = _d === void 0 ? undefined : _d;
14143
14263
  var dispatch = reactRedux.useDispatch();
14144
14264
  var mapId = reactRedux.useSelector(function (store) {
14145
14265
  return getDialogMapId(store, dialogType);
14146
14266
  });
14147
14267
 
14148
- var _d = useSetupDialog(dialogType),
14149
- dialogOrder = _d.dialogOrder,
14150
- setDialogOrder = _d.setDialogOrder,
14151
- onCloseDialog = _d.onCloseDialog,
14152
- isDialogOpen = _d.isDialogOpen,
14153
- uiSource = _d.uiSource,
14154
- uiIsLoading = _d.uiIsLoading,
14155
- uiError = _d.uiError,
14156
- setFocused = _d.setFocused;
14268
+ var _e = useSetupDialog(dialogType),
14269
+ dialogOrder = _e.dialogOrder,
14270
+ setDialogOrder = _e.setDialogOrder,
14271
+ onCloseDialog = _e.onCloseDialog,
14272
+ isDialogOpen = _e.isDialogOpen,
14273
+ uiSource = _e.uiSource,
14274
+ uiIsLoading = _e.uiIsLoading,
14275
+ uiError = _e.uiError,
14276
+ setFocused = _e.setFocused;
14157
14277
 
14158
14278
  useFetchServices(dialogType, preloadedMapServices);
14159
14279
 
@@ -14166,6 +14286,7 @@
14166
14286
  }));
14167
14287
  };
14168
14288
 
14289
+ var shownTitle = showMapIdInTitle ? title + " " + mapId : title;
14169
14290
  return /*#__PURE__*/React__namespace.createElement(LayerManager, {
14170
14291
  mapId: mapId,
14171
14292
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
@@ -14173,7 +14294,7 @@
14173
14294
  bounds: bounds,
14174
14295
  isOpen: isDialogOpen,
14175
14296
  onClose: onCloseDialog,
14176
- showTitle: showTitle,
14297
+ title: shownTitle,
14177
14298
  onMouseDown: setDialogOrder,
14178
14299
  order: dialogOrder,
14179
14300
  source: uiSource,
@@ -14215,12 +14336,14 @@
14215
14336
  preloadedAvailableBaseLayers = _a.preloadedAvailableBaseLayers,
14216
14337
  preloadedBaseServices = _a.preloadedBaseServices,
14217
14338
  bounds = _a.bounds,
14218
- _b = _a.showTitle,
14219
- showTitle = _b === void 0 ? false : _b,
14220
- _c = _a.leftHeaderComponent,
14221
- leftHeaderComponent = _c === void 0 ? undefined : _c,
14222
- _d = _a.source,
14223
- source = _d === void 0 ? 'app' : _d;
14339
+ _b = _a.title,
14340
+ title = _b === void 0 ? 'Layer Manager' : _b,
14341
+ _c = _a.showMapIdInTitle,
14342
+ showMapIdInTitle = _c === void 0 ? false : _c,
14343
+ _d = _a.leftHeaderComponent,
14344
+ leftHeaderComponent = _d === void 0 ? undefined : _d,
14345
+ _e = _a.source,
14346
+ source = _e === void 0 ? 'app' : _e;
14224
14347
  var dispatch = reactRedux.useDispatch();
14225
14348
  var dockedLayerManagerSize = reactRedux.useSelector(function (store) {
14226
14349
  return getDockedLayerManagerSize(store, mapId);
@@ -14234,11 +14357,11 @@
14234
14357
 
14235
14358
  var dialogType = DialogTypes.DockedLayerManager + "-" + mapId;
14236
14359
 
14237
- var _e = useSetupDialog(dialogType, source),
14238
- dialogOrder = _e.dialogOrder,
14239
- isDialogOpen = _e.isDialogOpen,
14240
- setDialogOrder = _e.setDialogOrder,
14241
- onCloseDialog = _e.onCloseDialog;
14360
+ var _f = useSetupDialog(dialogType, source),
14361
+ dialogOrder = _f.dialogOrder,
14362
+ isDialogOpen = _f.isDialogOpen,
14363
+ setDialogOrder = _f.setDialogOrder,
14364
+ onCloseDialog = _f.onCloseDialog;
14242
14365
 
14243
14366
  var onToggleDock = function onToggleDock() {
14244
14367
  // Close docked layer manager and open the floating layer manager
@@ -14251,6 +14374,7 @@
14251
14374
  }));
14252
14375
  };
14253
14376
 
14377
+ var shownTitle = showMapIdInTitle ? title + " " + mapId : title;
14254
14378
  return /*#__PURE__*/React__namespace.createElement(LayerManager, {
14255
14379
  mapId: mapId,
14256
14380
  preloadedAvailableBaseLayers: preloadedAvailableBaseLayers,
@@ -14258,7 +14382,7 @@
14258
14382
  bounds: bounds,
14259
14383
  isOpen: isDialogOpen,
14260
14384
  onClose: onCloseDialog,
14261
- showTitle: showTitle,
14385
+ title: shownTitle,
14262
14386
  leftHeaderComponent: leftHeaderComponent,
14263
14387
  // isLoading={isMapPresetLoading}
14264
14388
  // error={mapPresetError}
@@ -14288,8 +14412,8 @@
14288
14412
  * See the License for the specific language governing permissions and
14289
14413
  * limitations under the License.
14290
14414
  *
14291
- * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14292
- * Copyright 2021 - Finnish Meteorological Institute (FMI)
14415
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14416
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
14293
14417
  * */
14294
14418
 
14295
14419
  var KeywordFilterButtonConnect = function KeywordFilterButtonConnect(_a) {
@@ -14311,13 +14435,12 @@
14311
14435
  source: source
14312
14436
  }));
14313
14437
  }, [currentActiveMapId, dispatch, isOpenInStore, mapId, source]);
14314
- return /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
14438
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
14439
+ variant: "tool",
14315
14440
  onClick: openFilterResultsDialog,
14316
- active: isOpenInStore,
14441
+ isSelected: isOpenInStore,
14317
14442
  id: "keywordFilterButton",
14318
- "data-testid": "keywordFilterButton",
14319
- disableRipple: true,
14320
- variant: "tool"
14443
+ "data-testid": "keywordFilterButton"
14321
14444
  }, /*#__PURE__*/React__namespace.createElement(theme.Filter, null));
14322
14445
  };
14323
14446
 
@@ -14592,8 +14715,8 @@
14592
14715
  * See the License for the specific language governing permissions and
14593
14716
  * limitations under the License.
14594
14717
  *
14595
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14596
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
14718
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
14719
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
14597
14720
  * */
14598
14721
 
14599
14722
  var LayerInfoButtonConnect = function LayerInfoButtonConnect(_a) {
@@ -14647,9 +14770,9 @@
14647
14770
  }
14648
14771
  };
14649
14772
 
14650
- return /*#__PURE__*/React__default["default"].createElement(shared.ToolButton, {
14651
- variant: "icon",
14652
- active: isActive && isOpenInStore,
14773
+ return /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
14774
+ variant: "flat",
14775
+ isSelected: isActive && isOpenInStore,
14653
14776
  onClick: onClick,
14654
14777
  id: "layerInfoButton",
14655
14778
  "aria-label": "layer info",
@@ -15787,7 +15910,7 @@
15787
15910
  * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
15788
15911
  * Copyright 2023 - Finnish Meteorological Institute (FMI)
15789
15912
  * */
15790
- var styles$1 = {
15913
+ var styles$2 = {
15791
15914
  servicesContainer: {
15792
15915
  width: '360px',
15793
15916
  maxHeight: '412px',
@@ -15854,7 +15977,7 @@
15854
15977
  (_a = dialogRef.current) === null || _a === void 0 ? void 0 : _a.focus();
15855
15978
  }, []);
15856
15979
  return /*#__PURE__*/React__namespace.createElement(material.Box, {
15857
- sx: styles$1.servicesContainer,
15980
+ sx: styles$2.servicesContainer,
15858
15981
  "data-testid": "ServiceDialog",
15859
15982
  onKeyDown: function onKeyDown(event) {
15860
15983
  if (event.key !== 'Escape') {
@@ -15864,9 +15987,9 @@
15864
15987
  tabIndex: -1,
15865
15988
  ref: dialogRef
15866
15989
  }, /*#__PURE__*/React__namespace.createElement(material.Box, {
15867
- sx: styles$1.header
15990
+ sx: styles$2.header
15868
15991
  }, "Services"), /*#__PURE__*/React__namespace.createElement(material.Backdrop, {
15869
- sx: styles$1.loading,
15992
+ sx: styles$2.loading,
15870
15993
  open: isLoading
15871
15994
  }, /*#__PURE__*/React__namespace.createElement(material.CircularProgress, null)), /*#__PURE__*/React__namespace.createElement(Rows, {
15872
15995
  services: services,
@@ -15875,12 +15998,12 @@
15875
15998
  setServicePopupInfo: setServicePopupInfo,
15876
15999
  selectedLayers: selectedLayers
15877
16000
  }), /*#__PURE__*/React__namespace.createElement(material.Box, {
15878
- sx: styles$1.footer
16001
+ sx: styles$2.footer
15879
16002
  }, /*#__PURE__*/React__namespace.createElement(material.Button, {
15880
16003
  onClick: openAddService,
15881
16004
  onKeyDown: stopTabPropagation,
15882
16005
  "data-testid": "openAddServiceButton",
15883
- sx: styles$1.button,
16006
+ sx: styles$2.button,
15884
16007
  variant: "tertiary",
15885
16008
  startIcon: /*#__PURE__*/React__namespace.createElement(theme.Add, null)
15886
16009
  }, "Add a new service")));
@@ -17437,8 +17560,8 @@
17437
17560
  * See the License for the specific language governing permissions and
17438
17561
  * limitations under the License.
17439
17562
  *
17440
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17441
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
17563
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
17564
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
17442
17565
  * */
17443
17566
 
17444
17567
  var MapControlButton = function MapControlButton(_a) {
@@ -17451,13 +17574,15 @@
17451
17574
  isActive = _c === void 0 ? false : _c,
17452
17575
  props = __rest(_a, ["onClick", "children", "title", "placement", "isActive"]);
17453
17576
 
17454
- return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
17455
- placement: placement,
17456
- title: title
17457
- }, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, __assign({
17577
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, __assign({
17578
+ variant: "tool",
17579
+ tooltipProps: {
17580
+ placement: placement,
17581
+ title: title
17582
+ },
17458
17583
  onClick: onClick,
17459
- active: isActive
17460
- }, props), children));
17584
+ isSelected: isActive
17585
+ }, props), children);
17461
17586
  };
17462
17587
 
17463
17588
  /* *
@@ -18254,8 +18379,8 @@
18254
18379
  * See the License for the specific language governing permissions and
18255
18380
  * limitations under the License.
18256
18381
  *
18257
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18258
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
18382
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18383
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
18259
18384
  * */
18260
18385
  var titleOn = 'Auto update on';
18261
18386
  var titleOff = 'Auto update off';
@@ -18267,21 +18392,20 @@
18267
18392
  isAutoUpdating = _c === void 0 ? false : _c,
18268
18393
  _d = _a.disabled,
18269
18394
  disabled = _d === void 0 ? false : _d;
18270
- return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
18271
- title: isAutoUpdating ? titleOn : titleOff,
18272
- "data-testid": "autoUpdateButtonTooltip"
18273
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
18274
- active: isAutoUpdating,
18395
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
18396
+ variant: "tool",
18397
+ isSelected: isAutoUpdating,
18275
18398
  disabled: disabled,
18276
18399
  onClick: function onClick() {
18277
18400
  return toggleAutoUpdate();
18278
18401
  },
18279
- "data-testid": "autoUpdateButton"
18402
+ "data-testid": "autoUpdateButton",
18403
+ tooltipTitle: isAutoUpdating ? titleOn : titleOff
18280
18404
  }, isAutoUpdating ? /*#__PURE__*/React__namespace.createElement(theme.AutoUpdateActive, {
18281
18405
  "data-testid": "auto-update-svg-on"
18282
18406
  }) : /*#__PURE__*/React__namespace.createElement(theme.AutoUpdateInActive, {
18283
18407
  "data-testid": "auto-update-svg-off"
18284
- }))));
18408
+ }));
18285
18409
  };
18286
18410
 
18287
18411
  /* *
@@ -18297,8 +18421,8 @@
18297
18421
  * See the License for the specific language governing permissions and
18298
18422
  * limitations under the License.
18299
18423
  *
18300
- * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18301
- * Copyright 2020 - Finnish Meteorological Institute (FMI)
18424
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18425
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
18302
18426
  * */
18303
18427
  var THROTTLE_WAIT_TIME = 300; // [ms]
18304
18428
 
@@ -18351,20 +18475,24 @@
18351
18475
  onKeyDown: function onKeyDown(event) {
18352
18476
  event.stopPropagation();
18353
18477
  }
18354
- }, /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
18355
- title: title
18356
- }, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
18478
+ }, /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
18479
+ variant: "tool",
18480
+ tooltipTitle: title,
18357
18481
  onClick: function onClick() {
18358
18482
  setOpen(true);
18359
18483
  },
18360
18484
  ref: setAnchorRef,
18361
- active: true,
18362
- width: "100%",
18363
- onWheel: onWheel
18485
+ isSelected: true,
18486
+ onWheel: onWheel,
18487
+ sx: {
18488
+ padding: '11px!important',
18489
+ width: '100%!important'
18490
+ }
18364
18491
  }, icon, /*#__PURE__*/React__namespace.createElement(material.Typography, {
18365
18492
  fontSize: 12,
18366
- fontWeight: 400
18367
- }, displayVariableDuration ? minutesToDescribedDuration(value) : currentMark === null || currentMark === void 0 ? void 0 : currentMark.text))), /*#__PURE__*/React__namespace.createElement(material.Menu, {
18493
+ fontWeight: 400,
18494
+ textTransform: "none"
18495
+ }, displayVariableDuration ? minutesToDescribedDuration(value) : currentMark === null || currentMark === void 0 ? void 0 : currentMark.text)), /*#__PURE__*/React__namespace.createElement(material.Menu, {
18368
18496
  anchorEl: anchorRef,
18369
18497
  open: open,
18370
18498
  onClose: function onClose() {
@@ -18420,12 +18548,19 @@
18420
18548
  minHeight: '30px!important'
18421
18549
  }
18422
18550
  }
18423
- }, "length"), displayVariableDuration && /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
18551
+ }, "length"), displayVariableDuration && /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
18552
+ variant: "tool",
18424
18553
  "data-testid": "menu-animation-length-button",
18425
- active: false,
18426
- disableRipple: true,
18427
- width: "100%"
18428
- }, minutesToDescribedDuration(value))));
18554
+ sx: {
18555
+ padding: '11px!important',
18556
+ width: '100%!important'
18557
+ }
18558
+ }, /*#__PURE__*/React__namespace.createElement(material.Typography, {
18559
+ fontSize: 14,
18560
+ fontWeight: 500,
18561
+ textTransform: "none",
18562
+ lineHeight: 2
18563
+ }, minutesToDescribedDuration(value)))));
18429
18564
  };
18430
18565
 
18431
18566
  /* *
@@ -18724,8 +18859,8 @@
18724
18859
  * See the License for the specific language governing permissions and
18725
18860
  * limitations under the License.
18726
18861
  *
18727
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18728
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
18862
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18863
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
18729
18864
  * */
18730
18865
  var title$1 = 'Now';
18731
18866
 
@@ -18734,18 +18869,18 @@
18734
18869
  onSetNow = _b === void 0 ? function () {} : _b,
18735
18870
  _c = _a.disabled,
18736
18871
  disabled = _c === void 0 ? false : _c;
18737
- return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
18738
- title: title$1,
18739
- "data-testid": "nowButtonTooltip"
18740
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
18872
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
18873
+ variant: "tool",
18874
+ "aria-label": "now",
18875
+ tooltipTitle: title$1,
18876
+ "data-testid": "nowButtonTooltip",
18741
18877
  disabled: disabled,
18742
18878
  onClick: function onClick() {
18743
18879
  return onSetNow();
18744
- },
18745
- "aria-label": "now"
18880
+ }
18746
18881
  }, /*#__PURE__*/React__namespace.createElement(theme.Now, {
18747
18882
  "data-testid": "now-svg"
18748
- }))));
18883
+ }));
18749
18884
  };
18750
18885
 
18751
18886
  /* *
@@ -18900,8 +19035,8 @@
18900
19035
  * See the License for the specific language governing permissions and
18901
19036
  * limitations under the License.
18902
19037
  *
18903
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18904
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
19038
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
19039
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
18905
19040
  * */
18906
19041
 
18907
19042
  var OptionsMenuButton = function OptionsMenuButton(_a) {
@@ -18927,21 +19062,22 @@
18927
19062
  setOpen(true);
18928
19063
  }
18929
19064
  }, [anchorEl, isOpenByDefault]);
18930
- return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(shared.CustomTooltip, {
18931
- title: "Animation options",
18932
- placement: "bottom"
18933
- }, /*#__PURE__*/React__default["default"].createElement("span", {
18934
- ref: function ref(_ref) {
18935
- setAnchorEl(_ref);
18936
- }
18937
- }, /*#__PURE__*/React__default["default"].createElement(shared.ToolButton, {
19065
+ return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
19066
+ variant: "tool",
18938
19067
  onClick: function onClick() {
18939
19068
  setOpen(!open);
18940
19069
  },
18941
19070
  "data-testid": "optionsMenuButton",
18942
- active: open,
18943
- "aria-label": "animation options"
18944
- }, /*#__PURE__*/React__default["default"].createElement(theme.Options, null)))), /*#__PURE__*/React__default["default"].createElement(material.Popper, {
19071
+ isSelected: open,
19072
+ "aria-label": "animation options",
19073
+ tooltipProps: {
19074
+ title: 'Animation options',
19075
+ placement: 'bottom'
19076
+ },
19077
+ ref: function ref(_ref) {
19078
+ setAnchorEl(_ref);
19079
+ }
19080
+ }, /*#__PURE__*/React__default["default"].createElement(theme.Options, null)), /*#__PURE__*/React__default["default"].createElement(material.Popper, {
18945
19081
  sx: {
18946
19082
  zIndex: 3
18947
19083
  },
@@ -18950,7 +19086,11 @@
18950
19086
  "data-testid": "optionsMenuPopOver",
18951
19087
  anchorEl: anchorEl
18952
19088
  }, /*#__PURE__*/React__default["default"].createElement(material.Paper, {
18953
- elevation: 3
19089
+ elevation: 3,
19090
+ sx: {
19091
+ position: 'relative',
19092
+ top: 1
19093
+ }
18954
19094
  }, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
18955
19095
  sx: {
18956
19096
  padding: '0px 10px 10px'
@@ -18980,8 +19120,8 @@
18980
19120
  * See the License for the specific language governing permissions and
18981
19121
  * limitations under the License.
18982
19122
  *
18983
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
18984
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
19123
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
19124
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
18985
19125
  * */
18986
19126
  var forwardTooltipTitle = 'Forward';
18987
19127
  var backwardTooltipTitle = 'Backward';
@@ -18991,17 +19131,17 @@
18991
19131
  isDisabled = _a.isDisabled,
18992
19132
  _b = _a.onClickBFButton,
18993
19133
  onClickBFButton = _b === void 0 ? function () {} : _b;
18994
- return /*#__PURE__*/React__namespace.createElement(shared.CustomTooltip, {
18995
- title: isForwardStep ? forwardTooltipTitle : backwardTooltipTitle
18996
- }, /*#__PURE__*/React__namespace.createElement("span", null, /*#__PURE__*/React__namespace.createElement(shared.ToolButton, {
19134
+ return /*#__PURE__*/React__namespace.createElement(shared.CustomIconButton, {
19135
+ variant: "tool",
18997
19136
  disabled: isDisabled,
18998
19137
  "aria-label": isForwardStep ? 'forward' : 'backward',
18999
- onClick: onClickBFButton
19138
+ onClick: onClickBFButton,
19139
+ tooltipTitle: isForwardStep ? forwardTooltipTitle : backwardTooltipTitle
19000
19140
  }, isForwardStep ? /*#__PURE__*/React__namespace.createElement(theme.StepForward, {
19001
19141
  "data-testid": "step-forward-svg-path"
19002
19142
  }) : /*#__PURE__*/React__namespace.createElement(theme.StepBackward, {
19003
19143
  "data-testid": "step-backward-svg-path"
19004
- }))));
19144
+ }));
19005
19145
  };
19006
19146
 
19007
19147
  /* *
@@ -19034,7 +19174,7 @@
19034
19174
  isForwardStep: true
19035
19175
  })), /*#__PURE__*/React__namespace.createElement(material.Grid, {
19036
19176
  item: true
19037
- }, playBtn || /*#__PURE__*/React__namespace.createElement(PlayButton, null)));
19177
+ }, playBtn || /*#__PURE__*/React__namespace.createElement(PlayButton$1, null)));
19038
19178
  };
19039
19179
 
19040
19180
  /* *
@@ -20073,7 +20213,7 @@
20073
20213
  * Copyright 2022 - Finnish Meteorological Institute (FMI)
20074
20214
  * */
20075
20215
  var TIME_SLIDER_LEGEND_HEIGHT = 24;
20076
- var DRAG_AREA_WIDTH = 24;
20216
+ var DRAG_AREA_WIDTH$1 = 24;
20077
20217
 
20078
20218
  function useAnimationTime(animationStartTime, animationEndTime, onSetAnimationStartTime, onSetAnimationEndTime, leftMarkerDragging, rightMarkerDragging, animationAreaDragging, centerTime, canvasWidth, secondsPerPx, dragTooltipPosition, pixelsToLeft, setTooltipTime, startDraggingPosition) {
20079
20219
  var _a = __read(React__namespace.useState(convertStringTimeToUnix(animationStartTime)), 2),
@@ -20128,7 +20268,7 @@
20128
20268
 
20129
20269
  if (leftMarkerDragging) {
20130
20270
  var mousePosition = leftMarkerPx + x;
20131
- var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH * 2;
20271
+ var rightAnimationPosition = rightMarkerPx - DRAG_AREA_WIDTH$1 * 2;
20132
20272
 
20133
20273
  if (mousePosition >= rightAnimationPosition || mousePosition <= 0) {
20134
20274
  return;
@@ -20144,7 +20284,7 @@
20144
20284
 
20145
20285
  if (rightMarkerDragging) {
20146
20286
  var mousePosition = rightMarkerPx + x;
20147
- var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH * 2;
20287
+ var leftAnimationPosition = leftMarkerPx + DRAG_AREA_WIDTH$1 * 2;
20148
20288
 
20149
20289
  if (leftAnimationPosition >= mousePosition || mousePosition >= canvasWidth) {
20150
20290
  return;
@@ -20333,7 +20473,7 @@
20333
20473
  selectedTimePx = _a[2]; // start dragging selected time.
20334
20474
 
20335
20475
 
20336
- if (isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH)) {
20476
+ if (isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH$1)) {
20337
20477
  setCursorStyle('grabbing');
20338
20478
  setSelectedTimeDragging(true);
20339
20479
  return;
@@ -20342,7 +20482,7 @@
20342
20482
  if (animationStartTime && animationEndTime) {
20343
20483
  dragTooltipPosition.current = pixelsToLeft ? x + pixelsToLeft : x; // start dragging either marker
20344
20484
 
20345
- if (isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH) && !rightMarkerDragging) {
20485
+ if (isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH$1) && !rightMarkerDragging) {
20346
20486
  setCursorStyle('grabbing');
20347
20487
  setLeftMarkerDragging(true);
20348
20488
  setTooltipTime(moment__default["default"].utc(animationStartTime));
@@ -20350,7 +20490,7 @@
20350
20490
  return;
20351
20491
  }
20352
20492
 
20353
- if (isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH) && !leftMarkerDragging) {
20493
+ if (isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH$1) && !leftMarkerDragging) {
20354
20494
  setCursorStyle('grabbing');
20355
20495
  setRightMarkerDragging(true);
20356
20496
  setTooltipTime(moment__default["default"].utc(animationEndTime));
@@ -20396,9 +20536,9 @@
20396
20536
  selectedTimePx = _a[2]; // Adjust mouse cursor while hovering draggable areas
20397
20537
 
20398
20538
 
20399
- var leftAnimationIconArea = isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH);
20400
- var rightAnimationIconArea = isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH);
20401
- var selectedTimeArea = isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH);
20539
+ var leftAnimationIconArea = isLeftAnimationIconArea(x, leftMarkerPx, DRAG_AREA_WIDTH$1);
20540
+ var rightAnimationIconArea = isRightAnimationIconArea(x, rightMarkerPx, DRAG_AREA_WIDTH$1);
20541
+ var selectedTimeArea = isSelectedTimeIconArea(x, selectedTimePx, DRAG_AREA_WIDTH$1);
20402
20542
  var insideAnimationArea = isInsideAnimationArea(x, leftMarkerPx, rightMarkerPx);
20403
20543
  var hoveringLegendHandles = leftAnimationIconArea || rightAnimationIconArea || selectedTimeArea || mouseDownInLegend;
20404
20544
 
@@ -20471,22 +20611,21 @@
20471
20611
  * See the License for the specific language governing permissions and
20472
20612
  * limitations under the License.
20473
20613
  *
20474
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
20475
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
20614
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
20615
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
20476
20616
  * */
20477
20617
 
20478
20618
  var HideSliderButton = function HideSliderButton(_a) {
20479
20619
  var isVisible = _a.isVisible,
20480
20620
  toggleTimeSliderIsVisible = _a.toggleTimeSliderIsVisible;
20481
- return /*#__PURE__*/React__default["default"].createElement(shared.CustomTooltip, {
20482
- title: isVisible ? 'Hide timeslider' : 'Show timeslider',
20483
- "data-testid": "autoUpdateButtonTooltip"
20484
- }, /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(shared.ToolButton, {
20621
+ return /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
20622
+ variant: "tool",
20485
20623
  onClick: function onClick() {
20486
20624
  toggleTimeSliderIsVisible(!isVisible);
20487
20625
  },
20488
- "data-testid": "hideTimeSliderButton"
20489
- }, isVisible ? /*#__PURE__*/React__default["default"].createElement(theme.ChevronDown, null) : /*#__PURE__*/React__default["default"].createElement(theme.ChevronUp, null))));
20626
+ "data-testid": "hideTimeSliderButton",
20627
+ tooltipTitle: isVisible ? 'Hide timeslider' : 'Show timeslider'
20628
+ }, isVisible ? /*#__PURE__*/React__default["default"].createElement(theme.ChevronDown, null) : /*#__PURE__*/React__default["default"].createElement(theme.ChevronUp, null));
20490
20629
  };
20491
20630
 
20492
20631
  /* *
@@ -21856,7 +21995,7 @@
21856
21995
  var tileRenderSettings = {
21857
21996
  WorldMap_Light_Grey_Canvas: {
21858
21997
  'EPSG:3857': {
21859
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap_Light_Grey_Canvas/EPSG3857/',
21998
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap_Light_Grey_Canvas/EPSG3857/',
21860
21999
  minLevel: 0,
21861
22000
  maxLevel: 9,
21862
22001
  tileServerType: 'osm',
@@ -21865,7 +22004,7 @@
21865
22004
  },
21866
22005
  OpenStreetMap_NL: {
21867
22006
  'EPSG:3857': {
21868
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreetMap_NL/EPSG3857/',
22007
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreetMap_NL/EPSG3857/',
21869
22008
  minLevel: 0,
21870
22009
  maxLevel: 16,
21871
22010
  tileServerType: 'osm',
@@ -21874,14 +22013,14 @@
21874
22013
  },
21875
22014
  OpenStreets_NL: {
21876
22015
  'EPSG:3857': {
21877
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreets_NL/EPSG3857/',
22016
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG3857/',
21878
22017
  minLevel: 0,
21879
22018
  maxLevel: 16,
21880
22019
  tileServerType: 'osm',
21881
22020
  copyRight: 'OpenStreetMap - contributors | Ingmapping'
21882
22021
  },
21883
22022
  'EPSG:28992': {
21884
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OpenStreets_NL/EPSG28992/',
22023
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OpenStreets_NL/EPSG28992/',
21885
22024
  minLevel: 0,
21886
22025
  maxLevel: 16,
21887
22026
  tileServerType: 'osm',
@@ -21890,7 +22029,7 @@
21890
22029
  },
21891
22030
  Positron_NL: {
21892
22031
  'EPSG:3857': {
21893
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Positron_NL/EPSG3857/',
22032
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Positron_NL/EPSG3857/',
21894
22033
  minLevel: 0,
21895
22034
  maxLevel: 16,
21896
22035
  tileServerType: 'osm',
@@ -21899,7 +22038,7 @@
21899
22038
  },
21900
22039
  Positron_NL_NoLabels: {
21901
22040
  'EPSG:3857': {
21902
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Positron_NL_NoLabels/EPSG3857/',
22041
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Positron_NL_NoLabels/EPSG3857/',
21903
22042
  minLevel: 0,
21904
22043
  maxLevel: 16,
21905
22044
  tileServerType: 'osm',
@@ -21908,7 +22047,7 @@
21908
22047
  },
21909
22048
  Klokantech_Basic_NL: {
21910
22049
  'EPSG:3857': {
21911
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Klokantech_Basic_NL/EPSG3857/',
22050
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Klokantech_Basic_NL/EPSG3857/',
21912
22051
  minLevel: 0,
21913
22052
  maxLevel: 16,
21914
22053
  tileServerType: 'osm',
@@ -21917,7 +22056,7 @@
21917
22056
  },
21918
22057
  Klokantech_Basic_NL_NoLabels: {
21919
22058
  'EPSG:3857': {
21920
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/Klokantech_Basic_NL_NoLabels/EPSG3857/',
22059
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/Klokantech_Basic_NL_NoLabels/EPSG3857/',
21921
22060
  minLevel: 0,
21922
22061
  maxLevel: 16,
21923
22062
  tileServerType: 'osm',
@@ -21926,7 +22065,7 @@
21926
22065
  },
21927
22066
  OSM_Blossom_NL: {
21928
22067
  'EPSG:3857': {
21929
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OSM_Blossom_NL/EPSG3857/',
22068
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OSM_Blossom_NL/EPSG3857/',
21930
22069
  minLevel: 0,
21931
22070
  maxLevel: 16,
21932
22071
  tileServerType: 'osm',
@@ -21935,14 +22074,14 @@
21935
22074
  },
21936
22075
  WorldMap: {
21937
22076
  'EPSG:3857': {
21938
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3857/',
22077
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3857/',
21939
22078
  minLevel: 0,
21940
22079
  maxLevel: 9,
21941
22080
  tileServerType: 'osm',
21942
22081
  copyRight: 'Natural Earth II | Ingmapping'
21943
22082
  },
21944
22083
  'TODO__EPSG:4326': {
21945
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG4326/',
22084
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG4326/',
21946
22085
  minLevel: 0,
21947
22086
  maxLevel: 9,
21948
22087
  origX: -180,
@@ -21952,42 +22091,42 @@
21952
22091
  copyRight: 'Natural Earth II | Ingmapping'
21953
22092
  },
21954
22093
  'EPSG:3411': {
21955
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3411/',
22094
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3411/',
21956
22095
  minLevel: 3,
21957
22096
  maxLevel: 9,
21958
22097
  tileServerType: 'osm',
21959
22098
  copyRight: 'Natural Earth II | Ingmapping'
21960
22099
  },
21961
22100
  'EPSG:28992': {
21962
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG28992/',
22101
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG28992/',
21963
22102
  minLevel: 5,
21964
22103
  maxLevel: 9,
21965
22104
  tileServerType: 'osm',
21966
22105
  copyRight: 'Natural Earth II | Ingmapping'
21967
22106
  },
21968
22107
  'EPSG:3412': {
21969
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3412/',
22108
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3412/',
21970
22109
  minLevel: 3,
21971
22110
  maxLevel: 9,
21972
22111
  tileServerType: 'osm',
21973
22112
  copyRight: 'Natural Earth II | Ingmapping'
21974
22113
  },
21975
22114
  'EPSG:32661': {
21976
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG32661/',
22115
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG32661/',
21977
22116
  minLevel: 4,
21978
22117
  maxLevel: 9,
21979
22118
  tileServerType: 'osm',
21980
22119
  copyRight: 'Natural Earth II | Ingmapping'
21981
22120
  },
21982
22121
  'EPSG:54030': {
21983
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG54030/',
22122
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG54030/',
21984
22123
  minLevel: 3,
21985
22124
  maxLevel: 9,
21986
22125
  tileServerType: 'osm',
21987
22126
  copyRight: 'Natural Earth II | Ingmapping'
21988
22127
  },
21989
22128
  'EPSG:3575': {
21990
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/WorldMap/EPSG3575/',
22129
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/WorldMap/EPSG3575/',
21991
22130
  minLevel: 5,
21992
22131
  maxLevel: 9,
21993
22132
  tileServerType: 'osm',
@@ -21996,7 +22135,7 @@
21996
22135
  },
21997
22136
  OSM_Antarctica: {
21998
22137
  'EPSG:3412': {
21999
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/OSM_Antarctica/EPSG3412/',
22138
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/OSM_Antarctica/EPSG3412/',
22000
22139
  minLevel: 1,
22001
22140
  maxLevel: 7,
22002
22141
  origX: -3000000,
@@ -22099,7 +22238,7 @@
22099
22238
  },
22100
22239
  NaturalEarth2: {
22101
22240
  'EPSG:3411': {
22102
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3411/',
22241
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3411/',
22103
22242
  minLevel: 1,
22104
22243
  maxLevel: 6,
22105
22244
  origX: -12400000,
@@ -22109,7 +22248,7 @@
22109
22248
  copyRight: 'NPS - Natural Earth II'
22110
22249
  },
22111
22250
  'EPSG:3412': {
22112
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3412/',
22251
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3412/',
22113
22252
  minLevel: 1,
22114
22253
  maxLevel: 6,
22115
22254
  origX: -12400000,
@@ -22119,7 +22258,7 @@
22119
22258
  copyRight: 'NPS - Natural Earth II'
22120
22259
  },
22121
22260
  'EPSG:3575': {
22122
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3575/',
22261
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3575/',
22123
22262
  minLevel: 1,
22124
22263
  maxLevel: 6,
22125
22264
  origX: -13000000,
@@ -22129,14 +22268,14 @@
22129
22268
  copyRight: 'NPS - Natural Earth II'
22130
22269
  },
22131
22270
  'EPSG:3857': {
22132
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG3857/',
22271
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG3857/',
22133
22272
  minLevel: 1,
22134
22273
  maxLevel: 7,
22135
22274
  tileServerType: 'wmst',
22136
22275
  copyRight: 'NPS - Natural Earth II'
22137
22276
  },
22138
22277
  'EPSG:4258': {
22139
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG4326/',
22278
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG4326/',
22140
22279
  minLevel: 1,
22141
22280
  maxLevel: 6,
22142
22281
  origX: -180,
@@ -22146,7 +22285,7 @@
22146
22285
  copyRight: 'NPS - Natural Earth II'
22147
22286
  },
22148
22287
  'EPSG:4326': {
22149
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG4326/',
22288
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG4326/',
22150
22289
  minLevel: 1,
22151
22290
  maxLevel: 6,
22152
22291
  origX: -180,
@@ -22156,7 +22295,7 @@
22156
22295
  copyRight: 'NPS - Natural Earth II'
22157
22296
  },
22158
22297
  'EPSG:28992': {
22159
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG28992/',
22298
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG28992/',
22160
22299
  minLevel: 1,
22161
22300
  maxLevel: 5,
22162
22301
  origX: -2999000,
@@ -22166,7 +22305,7 @@
22166
22305
  copyRight: 'NPS - Natural Earth II'
22167
22306
  },
22168
22307
  'EPSG:32661': {
22169
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG32661/',
22308
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG32661/',
22170
22309
  minLevel: 1,
22171
22310
  maxLevel: 7,
22172
22311
  origX: -5000000,
@@ -22176,7 +22315,7 @@
22176
22315
  copyRight: 'NPS - Natural Earth II'
22177
22316
  },
22178
22317
  'EPSG:54030': {
22179
- home: 'https://knmi-geoweb-assets.s3-eu-west-1.amazonaws.com/NaturalEarth2/EPSG54030/',
22318
+ home: 'https://geoweb-maps-assets.pmc.knmi.cloud/NaturalEarth2/EPSG54030/',
22180
22319
  minLevel: 1,
22181
22320
  maxLevel: 7,
22182
22321
  origX: -17000000,
@@ -22204,88 +22343,50 @@
22204
22343
  * Copyright 2020 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
22205
22344
  * Copyright 2020 - Finnish Meteorological Institute (FMI)
22206
22345
  * */
22207
- var getCurrentDimensionValue = function getCurrentDimensionValue(dimensions, name) {
22208
- if (dimensions === void 0) {
22209
- dimensions = [];
22210
- }
22211
-
22212
- var currentDimension = dimensions.find(function (dim) {
22213
- return dim.name === name;
22214
- });
22215
- return currentDimension === null || currentDimension === void 0 ? void 0 : currentDimension.currentValue;
22216
- };
22217
- var setServiceMetadata = function setServiceMetadata(wmLayer, mapId, mapProperties, onUpdateLayerInformation) {
22346
+ var setLayerInfo = function setLayerInfo(wmLayer, mapId, onUpdateLayerInformation) {
22218
22347
  var origin = LayerActionOrigin.ReactMapViewParseLayer;
22219
- var service = webmap.WMGetServiceFromStore(wmLayer.service);
22220
- var serviceName = mapProperties.services && mapProperties.services[service.id] && mapProperties.services[service.id].name || service.id;
22221
- var webMapJSInstance = getWMJSMapById(mapId);
22348
+ var map = getWMJSMapById(mapId);
22222
22349
  /* Update list of layers for service */
22223
22350
 
22224
- var done = function done(layers) {
22225
- var updateObject = {
22351
+ var updateObject = {
22352
+ origin: origin,
22353
+ layerStyle: {
22226
22354
  origin: origin,
22227
- serviceLayers: {
22228
- name: serviceName,
22229
- id: service.id,
22230
- serviceUrl: wmLayer.service,
22231
- layers: layers,
22232
- scope: 'system'
22233
- },
22234
- layerStyle: {
22235
- origin: origin,
22236
- layerId: wmLayer.ReactWMJSLayerId,
22237
- style: wmLayer.currentStyle
22238
- },
22239
- mapDimensions: {
22240
- origin: origin,
22241
- mapId: mapId,
22242
- dimensions: webMapJSInstance.mapdimensions.map(function (_a) {
22243
- var name = _a.name,
22244
- units = _a.units,
22245
- currentValue = _a.currentValue,
22246
- synced = _a.synced;
22247
- var reactDim = mapProperties.dimensions && mapProperties.dimensions.find(function (dim) {
22248
- return dim.name === name;
22249
- });
22250
- var newDimValue = reactDim && reactDim.currentValue || currentValue;
22251
- var newDimSynced = reactDim && reactDim.synced || synced;
22252
- return {
22253
- name: name,
22254
- units: units,
22255
- currentValue: newDimValue,
22256
- synced: newDimSynced
22257
- };
22258
- })
22259
- },
22260
- layerDimensions: {
22261
- origin: origin,
22262
- layerId: wmLayer.id,
22263
- dimensions: wmLayer.dimensions.map(function (dim) {
22264
- var name = dim.name,
22265
- units = dim.units,
22266
- synced = dim.synced;
22267
- var currentDimensionValue = getCurrentDimensionValue(wmLayer.dimensions, name);
22268
- var newDimensionValue = currentDimensionValue || dim.getValue();
22269
- return {
22270
- name: name,
22271
- units: units,
22272
- currentValue: newDimensionValue,
22273
- minValue: dim.getFirstValue(),
22274
- maxValue: dim.getLastValue(),
22275
- timeInterval: dim.getDimInterval(),
22276
- values: dim.getValues(),
22277
- synced: synced
22278
- };
22279
- })
22280
- }
22281
- };
22282
- onUpdateLayerInformation && onUpdateLayerInformation(updateObject);
22355
+ layerId: wmLayer.ReactWMJSLayerId,
22356
+ style: wmLayer.currentStyle
22357
+ },
22358
+ mapDimensions: {
22359
+ mapId: mapId,
22360
+ origin: origin,
22361
+ dimensions: map && map.mapdimensions.map(function (mapdim) {
22362
+ return {
22363
+ units: mapdim.units,
22364
+ currentValue: mapdim.currentValue,
22365
+ name: mapdim.name
22366
+ };
22367
+ }) || []
22368
+ },
22369
+ layerDimensions: {
22370
+ origin: origin,
22371
+ layerId: wmLayer.id,
22372
+ dimensions: wmLayer.dimensions.map(function (dim) {
22373
+ var name = dim.name,
22374
+ units = dim.units,
22375
+ synced = dim.synced;
22376
+ return {
22377
+ name: name,
22378
+ units: units,
22379
+ currentValue: dim.getValue(),
22380
+ minValue: dim.getFirstValue(),
22381
+ maxValue: dim.getLastValue(),
22382
+ timeInterval: dim.getDimInterval(),
22383
+ values: dim.getValues(),
22384
+ synced: synced
22385
+ };
22386
+ })
22387
+ }
22283
22388
  };
22284
-
22285
- service.getLayerObjectsFlat(done, function () {// do nothing
22286
- }, false, {
22287
- headers: wmLayer.headers
22288
- });
22389
+ onUpdateLayerInformation && onUpdateLayerInformation(updateObject);
22289
22390
  };
22290
22391
 
22291
22392
  /* *
@@ -22384,8 +22485,7 @@
22384
22485
  coordinateIndexInFeature: polygonIndex
22385
22486
  };
22386
22487
  }
22387
- } catch (e) {
22388
- console.warn(e);
22488
+ } catch (e) {// console.warn(e);
22389
22489
  }
22390
22490
  }
22391
22491
  }
@@ -24993,7 +25093,7 @@
24993
25093
  mapId = _a.mapId;
24994
25094
 
24995
25095
  try {
24996
- setServiceMetadata(wmLayer, mapId, _this.props, onUpdateLayerInformation);
25096
+ setLayerInfo(wmLayer, mapId, onUpdateLayerInformation);
24997
25097
  } catch (e) {
24998
25098
  /* Provide a hint on what is going wrong */
24999
25099
  console.error(e);
@@ -25285,7 +25385,6 @@
25285
25385
  mapId_1 = props.mapId;
25286
25386
  onUpdateLayerInformation && onUpdateLayerInformation({
25287
25387
  origin: ORIGIN_REACTMAPVIEW_ONUPDATELAYERINFO,
25288
- serviceLayers: null,
25289
25388
  layerStyle: null,
25290
25389
  layerDimensions: null,
25291
25390
  mapDimensions: {
@@ -26463,8 +26562,8 @@
26463
26562
  * See the License for the specific language governing permissions and
26464
26563
  * limitations under the License.
26465
26564
  *
26466
- * Copyright 2022 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26467
- * Copyright 2022 - Finnish Meteorological Institute (FMI)
26565
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
26566
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
26468
26567
  * */
26469
26568
  var ClockContainer = function ClockContainer(_a) {
26470
26569
  var fontSize = _a.fontSize,
@@ -26497,13 +26596,14 @@
26497
26596
  item: true,
26498
26597
  zIndex: 2,
26499
26598
  ref: setButtonElement
26500
- }, /*#__PURE__*/React__default["default"].createElement(shared.ToolButton, {
26599
+ }, /*#__PURE__*/React__default["default"].createElement(shared.CustomIconButton, {
26600
+ variant: "tool",
26501
26601
  onClick: onButtonClick,
26502
26602
  sx: {
26503
26603
  color: '#fff!important'
26504
26604
  },
26505
26605
  "aria-label": "Animation options",
26506
- active: isPopperOpen
26606
+ isSelected: isPopperOpen
26507
26607
  }, /*#__PURE__*/React__default["default"].createElement(Icon, {
26508
26608
  isPopperOpen: isPopperOpen,
26509
26609
  popperPlacement: popperPlacement
@@ -26942,6 +27042,31 @@
26942
27042
  });
26943
27043
  };
26944
27044
 
27045
+ /* *
27046
+ * Licensed under the Apache License, Version 2.0 (the "License");
27047
+ * you may not use this file except in compliance with the License.
27048
+ * You may obtain a copy of the License at
27049
+ *
27050
+ * http://www.apache.org/licenses/LICENSE-2.0
27051
+ *
27052
+ * Unless required by applicable law or agreed to in writing, software
27053
+ * distributed under the License is distributed on an "AS IS" BASIS,
27054
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27055
+ * See the License for the specific language governing permissions and
27056
+ * limitations under the License.
27057
+ *
27058
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27059
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27060
+ * */
27061
+ var sanitizeHTML = function sanitizeHTML(htmlToBeSanitezed) {
27062
+ return {
27063
+ __html: DOMPurify__namespace.sanitize(htmlToBeSanitezed, {
27064
+ ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a', 'table', 'td', 'tr', 'br', 'hr', 'th'],
27065
+ ALLOWED_ATTR: ['href']
27066
+ })
27067
+ };
27068
+ };
27069
+
26945
27070
  /* *
26946
27071
  * Licensed under the Apache License, Version 2.0 (the "License");
26947
27072
  * you may not use this file except in compliance with the License.
@@ -27146,9 +27271,7 @@
27146
27271
  },
27147
27272
  "data-testid": "layer-result-ready-" + layerId,
27148
27273
  // eslint-disable-next-line react/no-danger
27149
- dangerouslySetInnerHTML: {
27150
- __html: result.data.replace(/<hr\/>/g, '')
27151
- }
27274
+ dangerouslySetInnerHTML: sanitizeHTML(result.data)
27152
27275
  }) : /*#__PURE__*/React__default["default"].createElement("div", {
27153
27276
  "data-testid": "layer-result-loading-" + layerId
27154
27277
  }, /*#__PURE__*/React__default["default"].createElement(material.CircularProgress, {
@@ -27523,17 +27646,27 @@
27523
27646
  var syncGroupAddTarget = React__default["default"].useCallback(function (payload) {
27524
27647
  dispatch(genericActions.syncGroupAddTarget(payload));
27525
27648
  }, [dispatch]);
27649
+ var syncTargets = reactRedux.useSelector(function (store) {
27650
+ return getSyncGroupTargets(store);
27651
+ });
27526
27652
  React__default["default"].useEffect(function () {
27527
27653
  maps.forEach(function (map) {
27528
27654
  map.syncGroupsIds && map.syncGroupsIds.forEach(function (syncGroupsId) {
27529
- syncGroupAddTarget({
27530
- groupId: syncGroupsId,
27531
- targetId: map.id,
27532
- linked: true
27533
- });
27655
+ var alreadySyncedTargetIndex = syncTargets.findIndex(function (target) {
27656
+ return target.targetId === map.id && target.groupId === syncGroupsId && target.linked === true;
27657
+ }); // Only trigger an action if the target was not yet added to the group or was not linked.
27658
+
27659
+ if (alreadySyncedTargetIndex === -1) {
27660
+ syncGroupAddTarget({
27661
+ groupId: syncGroupsId,
27662
+ targetId: map.id,
27663
+ linked: true,
27664
+ origin: 'system'
27665
+ });
27666
+ }
27534
27667
  });
27535
27668
  });
27536
- }, [maps, syncGroupAddTarget]);
27669
+ }, [maps, syncGroupAddTarget, syncTargets]);
27537
27670
  var mapStyle = {
27538
27671
  width: Math.round(100 / cols) + "%",
27539
27672
  height: Math.round(100 / rows) + "%"
@@ -27830,6 +27963,815 @@
27830
27963
  });
27831
27964
  };
27832
27965
 
27966
+ /* *
27967
+ * Licensed under the Apache License, Version 2.0 (the "License");
27968
+ * you may not use this file except in compliance with the License.
27969
+ * You may obtain a copy of the License at
27970
+ *
27971
+ * http://www.apache.org/licenses/LICENSE-2.0
27972
+ *
27973
+ * Unless required by applicable law or agreed to in writing, software
27974
+ * distributed under the License is distributed on an "AS IS" BASIS,
27975
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27976
+ * See the License for the specific language governing permissions and
27977
+ * limitations under the License.
27978
+ *
27979
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
27980
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
27981
+ * */
27982
+ var timeSliderLiteButtonDefaultProps = {
27983
+ sx: {
27984
+ width: '36px',
27985
+ height: '36px'
27986
+ }
27987
+ };
27988
+ var timeSliderLiteTooltipDefaultProps = {
27989
+ placement: 'top'
27990
+ };
27991
+
27992
+ /* *
27993
+ * Licensed under the Apache License, Version 2.0 (the "License");
27994
+ * you may not use this file except in compliance with the License.
27995
+ * You may obtain a copy of the License at
27996
+ *
27997
+ * http://www.apache.org/licenses/LICENSE-2.0
27998
+ *
27999
+ * Unless required by applicable law or agreed to in writing, software
28000
+ * distributed under the License is distributed on an "AS IS" BASIS,
28001
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28002
+ * See the License for the specific language governing permissions and
28003
+ * limitations under the License.
28004
+ *
28005
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28006
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28007
+ * */
28008
+
28009
+ var HideButton = function HideButton(_a) {
28010
+ var _b, _c, _d, _e, _f, _g, _h, _j;
28011
+
28012
+ var isVisible = _a.isVisible,
28013
+ settings = _a.settings,
28014
+ onClick = _a.onClick;
28015
+ var hideTitle = (_c = (_b = settings === null || settings === void 0 ? void 0 : settings.label) === null || _b === void 0 ? void 0 : _b.hide) !== null && _c !== void 0 ? _c : 'Hide timeslider';
28016
+ var showTitle = (_e = (_d = settings === null || settings === void 0 ? void 0 : settings.label) === null || _d === void 0 ? void 0 : _d.show) !== null && _e !== void 0 ? _e : 'Show timeslider';
28017
+ var hideIcon = (_g = (_f = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _f === void 0 ? void 0 : _f.hide) !== null && _g !== void 0 ? _g : /*#__PURE__*/React__default["default"].createElement(theme.ChevronDown, null);
28018
+ var showIcon = (_j = (_h = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _h === void 0 ? void 0 : _h.show) !== null && _j !== void 0 ? _j : /*#__PURE__*/React__default["default"].createElement(theme.ChevronUp, null);
28019
+ return /*#__PURE__*/React__default["default"].createElement(material.Tooltip, __assign({}, timeSliderLiteTooltipDefaultProps, {
28020
+ title: isVisible ? hideTitle : showTitle
28021
+ }), /*#__PURE__*/React__default["default"].createElement(material.IconButton, __assign({}, timeSliderLiteButtonDefaultProps, {
28022
+ "aria-selected": !isVisible,
28023
+ onClick: onClick,
28024
+ "data-testid": "TimeSliderLite-HideButton"
28025
+ }), isVisible ? hideIcon : showIcon));
28026
+ };
28027
+
28028
+ /* *
28029
+ * Licensed under the Apache License, Version 2.0 (the "License");
28030
+ * you may not use this file except in compliance with the License.
28031
+ * You may obtain a copy of the License at
28032
+ *
28033
+ * http://www.apache.org/licenses/LICENSE-2.0
28034
+ *
28035
+ * Unless required by applicable law or agreed to in writing, software
28036
+ * distributed under the License is distributed on an "AS IS" BASIS,
28037
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28038
+ * See the License for the specific language governing permissions and
28039
+ * limitations under the License.
28040
+ *
28041
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28042
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28043
+ * */
28044
+
28045
+ var ControlButtonGroup = function ControlButtonGroup(_a) {
28046
+ var children = _a.children,
28047
+ right = _a.right,
28048
+ left = _a.left;
28049
+ return /*#__PURE__*/React__default["default"].createElement(material.ButtonGroup, {
28050
+ orientation: "horizontal",
28051
+ fullWidth: true,
28052
+ sx: __assign(__assign(__assign({}, right && {
28053
+ borderTopLeftRadius: 0,
28054
+ borderBottomLeftRadius: 0
28055
+ }), left && {
28056
+ borderTopRightRadius: 0,
28057
+ borderBottomRightRadius: 0
28058
+ }), {
28059
+ backgroundColor: 'geowebColors.background.surface',
28060
+ height: '100%',
28061
+ alignItems: 'center',
28062
+ justifyContent: 'center',
28063
+ padding: '4px',
28064
+ gap: '2px'
28065
+ })
28066
+ }, children);
28067
+ };
28068
+
28069
+ /* *
28070
+ * Licensed under the Apache License, Version 2.0 (the "License");
28071
+ * you may not use this file except in compliance with the License.
28072
+ * You may obtain a copy of the License at
28073
+ *
28074
+ * http://www.apache.org/licenses/LICENSE-2.0
28075
+ *
28076
+ * Unless required by applicable law or agreed to in writing, software
28077
+ * distributed under the License is distributed on an "AS IS" BASIS,
28078
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28079
+ * See the License for the specific language governing permissions and
28080
+ * limitations under the License.
28081
+ *
28082
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28083
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28084
+ * */
28085
+ var TICK_HEIGHT = 8;
28086
+ var TIME_SLIDER_LITE_PADDING_RIGHT = 1;
28087
+
28088
+ var TimeSliderLiteBackgroundSvg = function TimeSliderLiteBackgroundSvg(_a) {
28089
+ var width = _a.width,
28090
+ height = _a.height,
28091
+ startTime = _a.startTime,
28092
+ endTime = _a.endTime,
28093
+ style = _a.style,
28094
+ locale = _a.locale;
28095
+ var timeSliderLite = material.useTheme().palette.geowebColors.timeSliderLite;
28096
+
28097
+ if (!width) {
28098
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
28099
+ style: style,
28100
+ height: height
28101
+ });
28102
+ } // Convert start and end time from Unix timestamp to JavaScript Date object
28103
+
28104
+
28105
+ var startDate = new Date(startTime * 1000);
28106
+ var endDate = new Date(endTime * 1000);
28107
+ var totalDays = (endDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24);
28108
+ var tickSpacing = width / totalDays;
28109
+ var tickOffset = (startDate.getHours() + startDate.getMinutes() / 60) / 24 * tickSpacing; // Set up variables for date labels and background colors
28110
+
28111
+ var dayLabels = [];
28112
+ var currentDate = startDate;
28113
+ var lastDayLabelDate = new Date(endDate.getTime() + 2 * 24 * 60 * 60 * 1000); // Append two more days
28114
+
28115
+ while (currentDate < lastDayLabelDate) {
28116
+ var dateString = currentDate.toLocaleDateString(locale, {
28117
+ weekday: 'short',
28118
+ month: 'numeric',
28119
+ day: 'numeric'
28120
+ });
28121
+ var label = dateString.charAt(0).toUpperCase() + dateString.slice(1);
28122
+ dayLabels.push(label);
28123
+ currentDate.setDate(currentDate.getDate() + 1);
28124
+ }
28125
+
28126
+ var backgroundRectangles = dayLabels.map(function (label, index) {
28127
+ return /*#__PURE__*/React__default["default"].createElement("rect", {
28128
+ x: index * tickSpacing - tickOffset,
28129
+ y: 0,
28130
+ width: tickSpacing,
28131
+ height: height,
28132
+ fill: index % 2 === 0 ? timeSliderLite.timelineBackground.fill : timeSliderLite.timelineBackgroundAlternative.fill,
28133
+ key: label + "-color"
28134
+ });
28135
+ });
28136
+ var labels = dayLabels.map(function (label, index) {
28137
+ return /*#__PURE__*/React__default["default"].createElement("text", {
28138
+ x: index * tickSpacing + 8 - tickOffset,
28139
+ y: 14,
28140
+ fill: timeSliderLite.timeline.fill,
28141
+ textAnchor: "left",
28142
+ fontSize: "12px",
28143
+ key: label + "-text",
28144
+ style: {
28145
+ userSelect: 'none'
28146
+ }
28147
+ }, dayLabels[index]);
28148
+ });
28149
+ var ticksPerDay = 4;
28150
+ var tickMarks = dayLabels.map(function (label, index) {
28151
+ return Array.from({
28152
+ length: ticksPerDay + 1
28153
+ }, function (_, value) {
28154
+ return /*#__PURE__*/React__default["default"].createElement("line", {
28155
+ x1: index * tickSpacing + value * (tickSpacing / ticksPerDay) - tickOffset,
28156
+ y1: height,
28157
+ x2: index * tickSpacing + value * (tickSpacing / ticksPerDay) - tickOffset,
28158
+ y2: Math.floor(height - TICK_HEIGHT),
28159
+ stroke: timeSliderLite.timeline.stroke,
28160
+ key: label + "-" + value
28161
+ });
28162
+ });
28163
+ }).flat();
28164
+ return /*#__PURE__*/React__default["default"].createElement("svg", {
28165
+ style: style,
28166
+ width: width + TIME_SLIDER_LITE_PADDING_RIGHT,
28167
+ height: height
28168
+ }, backgroundRectangles, tickMarks, labels);
28169
+ };
28170
+
28171
+ /* *
28172
+ * Licensed under the Apache License, Version 2.0 (the "License");
28173
+ * you may not use this file except in compliance with the License.
28174
+ * You may obtain a copy of the License at
28175
+ *
28176
+ * http://www.apache.org/licenses/LICENSE-2.0
28177
+ *
28178
+ * Unless required by applicable law or agreed to in writing, software
28179
+ * distributed under the License is distributed on an "AS IS" BASIS,
28180
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28181
+ * See the License for the specific language governing permissions and
28182
+ * limitations under the License.
28183
+ *
28184
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28185
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28186
+ * */
28187
+ var MILLISECOND_TO_SECOND = 1 / 1000;
28188
+ /**
28189
+ * Reformats a date that has capitalized first letter and colon separator for time
28190
+ * @param dateString Date string from Date.toLocaleDateString
28191
+ * @returns Reformatted date string
28192
+ */
28193
+
28194
+ var reformatFinnishDateString = function reformatFinnishDateString(dateString) {
28195
+ var charPositionOfTimestamp = -4;
28196
+ return dateString.charAt(0).toUpperCase() + dateString.slice(1, charPositionOfTimestamp) + dateString.slice(charPositionOfTimestamp).replace('.', ':');
28197
+ };
28198
+ var getSelectedTimePx = function getSelectedTimePx(startTime, endTime, selectedTime, width) {
28199
+ var startDate = new Date(startTime * 1000);
28200
+ var startDateX = startDate.getTime() * MILLISECOND_TO_SECOND;
28201
+ var selectedTimeX = selectedTime - startDateX;
28202
+ var needleX = Math.floor(selectedTimeX / (endTime - startTime) * width);
28203
+ return needleX;
28204
+ };
28205
+ var boundedValue = function boundedValue(value, bounds) {
28206
+ var _a = __read(bounds, 2),
28207
+ min = _a[0],
28208
+ max = _a[1];
28209
+
28210
+ return Math.max(min, Math.min(max, value));
28211
+ };
28212
+ var getSelectedTimeFromPx = function getSelectedTimeFromPx(startTime, endTime, selectedTimePx, width) {
28213
+ var startDate = new Date(startTime * 1000);
28214
+ var startDateX = startDate.getTime() * MILLISECOND_TO_SECOND;
28215
+ var selectedTimeX = Math.floor(selectedTimePx / width * (endTime - startTime));
28216
+ var selectedTime = selectedTimeX + startDateX;
28217
+ return selectedTime;
28218
+ };
28219
+
28220
+ /* *
28221
+ * Licensed under the Apache License, Version 2.0 (the "License");
28222
+ * you may not use this file except in compliance with the License.
28223
+ * You may obtain a copy of the License at
28224
+ *
28225
+ * http://www.apache.org/licenses/LICENSE-2.0
28226
+ *
28227
+ * Unless required by applicable law or agreed to in writing, software
28228
+ * distributed under the License is distributed on an "AS IS" BASIS,
28229
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28230
+ * See the License for the specific language governing permissions and
28231
+ * limitations under the License.
28232
+ *
28233
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28234
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28235
+ * */
28236
+ var DRAG_AREA_WIDTH = 10;
28237
+ var NEEDLE_WIDTH = 5;
28238
+ var SHADOW_SPREAD = 2;
28239
+
28240
+ var NeedleShadow = function NeedleShadow(_a) {
28241
+ var x = _a.x,
28242
+ stroke = _a.stroke,
28243
+ height = _a.height,
28244
+ width = _a.width;
28245
+ return /*#__PURE__*/React__default["default"].createElement("line", {
28246
+ x1: x,
28247
+ y1: height - (height - SHADOW_SPREAD / 2),
28248
+ x2: x,
28249
+ y2: height - SHADOW_SPREAD / 2,
28250
+ strokeWidth: width + SHADOW_SPREAD,
28251
+ stroke: stroke,
28252
+ strokeLinecap: "round",
28253
+ filter: "blur(0.5px)",
28254
+ "data-testid": "TimeSliderLite-NeedleShadow"
28255
+ });
28256
+ };
28257
+
28258
+ var NeedleLine = function NeedleLine(_a) {
28259
+ var x = _a.x,
28260
+ stroke = _a.stroke,
28261
+ height = _a.height,
28262
+ width = _a.width;
28263
+ return /*#__PURE__*/React__default["default"].createElement("line", {
28264
+ x1: x,
28265
+ y1: width / 2,
28266
+ x2: x,
28267
+ y2: height - width / 2,
28268
+ strokeWidth: width,
28269
+ strokeLinecap: "round",
28270
+ stroke: stroke,
28271
+ "data-testid": "TimeSliderLite-NeedleLine"
28272
+ });
28273
+ };
28274
+
28275
+ var TimeSliderDraggableNeedle = function TimeSliderDraggableNeedle(_a) {
28276
+ var draggableLabel = _a.draggableLabel,
28277
+ width = _a.width,
28278
+ height = _a.height,
28279
+ locale = _a.locale,
28280
+ startTime = _a.startTime,
28281
+ endTime = _a.endTime,
28282
+ _b = _a.needleDragAreaWidth,
28283
+ needleDragAreaWidth = _b === void 0 ? DRAG_AREA_WIDTH : _b,
28284
+ needleLabelZIndex = _a.needleLabelZIndex,
28285
+ needleLabelOffset = _a.needleLabelOffset,
28286
+ _c = _a.needleWidth,
28287
+ needleWidth = _c === void 0 ? NEEDLE_WIDTH : _c,
28288
+ timeStep = _a.timeStep,
28289
+ selectedTime = _a.selectedTime,
28290
+ setSelectedTime = _a.setSelectedTime,
28291
+ style = _a.style;
28292
+ var draggableRef = React.useRef(null);
28293
+ var timeSliderLite = material.useTheme().palette.geowebColors.timeSliderLite;
28294
+ var x = getSelectedTimePx(startTime, endTime, selectedTime, width) - needleDragAreaWidth / 2;
28295
+ var roundedSelectedTime = Math.floor(selectedTime / timeStep) * timeStep;
28296
+ var dateString = new Date(roundedSelectedTime * 1000).toLocaleDateString(locale, {
28297
+ weekday: 'short',
28298
+ month: 'numeric',
28299
+ day: 'numeric',
28300
+ hour: 'numeric',
28301
+ minute: 'numeric'
28302
+ });
28303
+ var label = locale === 'fi' || locale === 'sv-FI' ? reformatFinnishDateString(dateString) : dateString;
28304
+ return /*#__PURE__*/React__default["default"].createElement(Draggable__default["default"], {
28305
+ handle: ".TimeSliderLite-DraggableNeedle",
28306
+ axis: "x",
28307
+ nodeRef: draggableRef,
28308
+ bounds: {
28309
+ left: -needleDragAreaWidth / 2,
28310
+ right: width - needleDragAreaWidth / 2
28311
+ },
28312
+ position: {
28313
+ x: x,
28314
+ y: 0
28315
+ },
28316
+ onDrag: function onDrag(_, position) {
28317
+ var positionOffsetToCompensateFlooring = 0.5;
28318
+ var newSelectedTime = getSelectedTimeFromPx(startTime, endTime, position.x + needleDragAreaWidth / 2 + positionOffsetToCompensateFlooring, width);
28319
+ setSelectedTime(newSelectedTime);
28320
+ },
28321
+ onStop: function onStop(_, position) {
28322
+ var positionOffsetToCompensateFlooring = 0.5;
28323
+ var newSelectedTime = getSelectedTimeFromPx(startTime, endTime, position.x + needleDragAreaWidth / 2 + positionOffsetToCompensateFlooring, width);
28324
+ var roundedSelectedTime = Math.floor(newSelectedTime / timeStep) * timeStep;
28325
+ setSelectedTime(roundedSelectedTime);
28326
+ }
28327
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
28328
+ className: "TimeSliderLite-DraggableNeedle",
28329
+ ref: draggableRef,
28330
+ "data-testid": "TimeSliderLite-DraggableNeedle"
28331
+ }, /*#__PURE__*/React__default["default"].createElement(material.Tooltip, {
28332
+ title: label,
28333
+ arrow: true,
28334
+ placement: "top",
28335
+ open: true,
28336
+ componentsProps: {
28337
+ tooltip: {
28338
+ sx: {
28339
+ padding: '0 3px 0 3px',
28340
+ fontSize: '12px',
28341
+ backgroundColor: timeSliderLite.needleLabel.backgroundColor,
28342
+ border: "1px solid " + timeSliderLite.needleLabel.borderColor
28343
+ }
28344
+ },
28345
+ arrow: {
28346
+ sx: {
28347
+ color: timeSliderLite.needleLabel.backgroundColor
28348
+ }
28349
+ },
28350
+ popper: {
28351
+ className: draggableLabel ? 'TimeSliderLite-DraggableNeedle' : '',
28352
+ sx: {
28353
+ pointerEvents: draggableLabel ? null : 'none',
28354
+ zIndex: needleLabelZIndex !== null && needleLabelZIndex !== void 0 ? needleLabelZIndex : null,
28355
+ cursor: draggableLabel ? 'ew-resize' : 'default'
28356
+ },
28357
+ modifiers: [{
28358
+ name: 'offset',
28359
+ options: {
28360
+ offset: needleLabelOffset !== null && needleLabelOffset !== void 0 ? needleLabelOffset : [0, 30 - height]
28361
+ }
28362
+ }]
28363
+ }
28364
+ }
28365
+ }, /*#__PURE__*/React__default["default"].createElement("svg", {
28366
+ style: style,
28367
+ cursor: "ew-resize",
28368
+ width: needleDragAreaWidth,
28369
+ height: height,
28370
+ "data-testid": "TimeSliderLite-NeedleSvg"
28371
+ }, /*#__PURE__*/React__default["default"].createElement(NeedleShadow, {
28372
+ x: needleDragAreaWidth / 2,
28373
+ stroke: timeSliderLite.needleShadow.stroke,
28374
+ height: height,
28375
+ width: needleWidth
28376
+ }), /*#__PURE__*/React__default["default"].createElement(NeedleLine, {
28377
+ x: needleDragAreaWidth / 2,
28378
+ stroke: timeSliderLite.needle.stroke,
28379
+ height: height,
28380
+ width: needleWidth
28381
+ })))));
28382
+ };
28383
+
28384
+ /* *
28385
+ * Licensed under the Apache License, Version 2.0 (the "License");
28386
+ * you may not use this file except in compliance with the License.
28387
+ * You may obtain a copy of the License at
28388
+ *
28389
+ * http://www.apache.org/licenses/LICENSE-2.0
28390
+ *
28391
+ * Unless required by applicable law or agreed to in writing, software
28392
+ * distributed under the License is distributed on an "AS IS" BASIS,
28393
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28394
+ * See the License for the specific language governing permissions and
28395
+ * limitations under the License.
28396
+ *
28397
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28398
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28399
+ * */
28400
+
28401
+ var TimeSliderLiteBackground = function TimeSliderLiteBackground(_a) {
28402
+ var height = _a.height,
28403
+ draggableTimeStamp = _a.draggableTimeStamp,
28404
+ locale = _a.locale,
28405
+ startTime = _a.startTime,
28406
+ endTime = _a.endTime,
28407
+ needleWidth = _a.needleWidth,
28408
+ needleDragAreaWidth = _a.needleDragAreaWidth,
28409
+ needleLabelZIndex = _a.needleLabelZIndex,
28410
+ needleLabelOffset = _a.needleLabelOffset,
28411
+ timeStep = _a.timeStep,
28412
+ selectedTime = _a.selectedTime,
28413
+ setSelectedTime = _a.setSelectedTime;
28414
+ var sliderAreaRef = React.useRef(null);
28415
+
28416
+ var _b = __read(React__default["default"].useState(0), 2),
28417
+ areaWidth = _b[0],
28418
+ setAreaWidth = _b[1];
28419
+
28420
+ var drawNeedle = selectedTime && areaWidth;
28421
+ React.useLayoutEffect(function () {
28422
+ var sliderArea = sliderAreaRef.current;
28423
+ setAreaWidth(sliderArea.clientWidth - TIME_SLIDER_LITE_PADDING_RIGHT);
28424
+ var observer = new ResizeObserver(function () {
28425
+ setAreaWidth(sliderArea.clientWidth - TIME_SLIDER_LITE_PADDING_RIGHT);
28426
+ });
28427
+ observer.observe(sliderArea);
28428
+ return function () {
28429
+ observer.disconnect();
28430
+ };
28431
+ }, [sliderAreaRef]);
28432
+ return /*#__PURE__*/React__default["default"].createElement(material.Box, {
28433
+ ref: sliderAreaRef,
28434
+ sx: {
28435
+ position: 'relative',
28436
+ height: height + "px",
28437
+ overflow: 'hidden',
28438
+ width: '100%'
28439
+ },
28440
+ "data-testid": "TimeSliderLite-Background"
28441
+ }, /*#__PURE__*/React__default["default"].createElement(TimeSliderLiteBackgroundSvg, {
28442
+ style: {
28443
+ position: 'absolute',
28444
+ top: 0
28445
+ },
28446
+ width: areaWidth,
28447
+ height: height,
28448
+ startTime: startTime,
28449
+ endTime: endTime,
28450
+ locale: locale
28451
+ }), drawNeedle && /*#__PURE__*/React__default["default"].createElement(TimeSliderDraggableNeedle, {
28452
+ needleWidth: needleWidth,
28453
+ draggableLabel: draggableTimeStamp,
28454
+ style: {
28455
+ position: 'absolute',
28456
+ top: 0
28457
+ },
28458
+ locale: locale,
28459
+ width: areaWidth,
28460
+ needleDragAreaWidth: needleDragAreaWidth,
28461
+ needleLabelZIndex: needleLabelZIndex,
28462
+ needleLabelOffset: needleLabelOffset,
28463
+ height: height,
28464
+ startTime: startTime,
28465
+ endTime: endTime,
28466
+ timeStep: timeStep,
28467
+ selectedTime: selectedTime,
28468
+ setSelectedTime: setSelectedTime
28469
+ }));
28470
+ };
28471
+
28472
+ /* *
28473
+ * Licensed under the Apache License, Version 2.0 (the "License");
28474
+ * you may not use this file except in compliance with the License.
28475
+ * You may obtain a copy of the License at
28476
+ *
28477
+ * http://www.apache.org/licenses/LICENSE-2.0
28478
+ *
28479
+ * Unless required by applicable law or agreed to in writing, software
28480
+ * distributed under the License is distributed on an "AS IS" BASIS,
28481
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28482
+ * See the License for the specific language governing permissions and
28483
+ * limitations under the License.
28484
+ *
28485
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28486
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28487
+ * */
28488
+
28489
+ var StepButton = function StepButton(_a) {
28490
+ var _b, _c, _d, _e, _f, _g, _h, _j;
28491
+
28492
+ var forward = _a.forward,
28493
+ isDisabled = _a.isDisabled,
28494
+ _k = _a.onClick,
28495
+ onClick = _k === void 0 ? function () {} : _k,
28496
+ settings = _a.settings;
28497
+ var forwardTitle = (_c = (_b = settings === null || settings === void 0 ? void 0 : settings.label) === null || _b === void 0 ? void 0 : _b.forward) !== null && _c !== void 0 ? _c : 'Forward';
28498
+ var backwardTitle = (_e = (_d = settings === null || settings === void 0 ? void 0 : settings.label) === null || _d === void 0 ? void 0 : _d.backward) !== null && _e !== void 0 ? _e : 'Backward';
28499
+ var forwardIcon = (_g = (_f = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _f === void 0 ? void 0 : _f.forward) !== null && _g !== void 0 ? _g : /*#__PURE__*/React__namespace.createElement(theme.StepForward, {
28500
+ "data-testid": "step-forward-svg-path"
28501
+ });
28502
+ var backwardIcon = (_j = (_h = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _h === void 0 ? void 0 : _h.backward) !== null && _j !== void 0 ? _j : /*#__PURE__*/React__namespace.createElement(theme.StepBackward, {
28503
+ "data-testid": "step-backward-svg-path"
28504
+ });
28505
+ return /*#__PURE__*/React__namespace.createElement(material.Tooltip, __assign({}, timeSliderLiteTooltipDefaultProps, {
28506
+ title: forward ? forwardTitle : backwardTitle
28507
+ }), /*#__PURE__*/React__namespace.createElement(material.IconButton, __assign({}, timeSliderLiteButtonDefaultProps, {
28508
+ disabled: isDisabled,
28509
+ "aria-label": forward ? forwardTitle : backwardTitle,
28510
+ onClick: onClick,
28511
+ "data-testid": "TimeSliderLite-StepButton" + (forward ? 'Forward' : 'Backward')
28512
+ }), forward ? forwardIcon : backwardIcon));
28513
+ };
28514
+
28515
+ /* *
28516
+ * Licensed under the Apache License, Version 2.0 (the "License");
28517
+ * you may not use this file except in compliance with the License.
28518
+ * You may obtain a copy of the License at
28519
+ *
28520
+ * http://www.apache.org/licenses/LICENSE-2.0
28521
+ *
28522
+ * Unless required by applicable law or agreed to in writing, software
28523
+ * distributed under the License is distributed on an "AS IS" BASIS,
28524
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28525
+ * See the License for the specific language governing permissions and
28526
+ * limitations under the License.
28527
+ *
28528
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28529
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28530
+ * */
28531
+
28532
+ var PlayButton = function PlayButton(_a) {
28533
+ var _b, _c, _d, _e, _f, _g, _h, _j;
28534
+
28535
+ var isAnimating = _a.isAnimating,
28536
+ isDisabled = _a.isDisabled,
28537
+ onTogglePlayButton = _a.onTogglePlayButton,
28538
+ settings = _a.settings;
28539
+ var pauseTitle = (_c = (_b = settings === null || settings === void 0 ? void 0 : settings.label) === null || _b === void 0 ? void 0 : _b.pause) !== null && _c !== void 0 ? _c : 'Pause';
28540
+ var playTitle = (_e = (_d = settings === null || settings === void 0 ? void 0 : settings.label) === null || _d === void 0 ? void 0 : _d.play) !== null && _e !== void 0 ? _e : 'Play';
28541
+ var pauseIcon = (_g = (_f = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _f === void 0 ? void 0 : _f.pause) !== null && _g !== void 0 ? _g : /*#__PURE__*/React__default["default"].createElement(theme.Pause, null);
28542
+ var playIcon = (_j = (_h = settings === null || settings === void 0 ? void 0 : settings.icon) === null || _h === void 0 ? void 0 : _h.play) !== null && _j !== void 0 ? _j : /*#__PURE__*/React__default["default"].createElement(theme.Play, null);
28543
+ return /*#__PURE__*/React__default["default"].createElement(material.Tooltip, __assign({}, timeSliderLiteTooltipDefaultProps, {
28544
+ title: isAnimating ? pauseTitle : playTitle
28545
+ }), /*#__PURE__*/React__default["default"].createElement(material.IconButton, __assign({}, timeSliderLiteButtonDefaultProps, {
28546
+ sx: __assign(__assign({}, isAnimating && {
28547
+ backgroundColor: 'geowebColors.timeSliderLite.selected.backgroundColor'
28548
+ }), timeSliderLiteButtonDefaultProps.sx),
28549
+ onClick: function onClick() {
28550
+ onTogglePlayButton();
28551
+ },
28552
+ disabled: isDisabled,
28553
+ "data-testid": "TimeSliderLite-PlayButton"
28554
+ }), isAnimating ? pauseIcon : playIcon));
28555
+ };
28556
+
28557
+ /* *
28558
+ * Licensed under the Apache License, Version 2.0 (the "License");
28559
+ * you may not use this file except in compliance with the License.
28560
+ * You may obtain a copy of the License at
28561
+ *
28562
+ * http://www.apache.org/licenses/LICENSE-2.0
28563
+ *
28564
+ * Unless required by applicable law or agreed to in writing, software
28565
+ * distributed under the License is distributed on an "AS IS" BASIS,
28566
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28567
+ * See the License for the specific language governing permissions and
28568
+ * limitations under the License.
28569
+ *
28570
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28571
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28572
+ * */
28573
+
28574
+ var MenuButton = function MenuButton(_a) {
28575
+ var _b, _c;
28576
+
28577
+ var menuOpen = _a.menuOpen,
28578
+ onClick = _a.onClick,
28579
+ settings = _a.settings;
28580
+ var title = (_b = settings === null || settings === void 0 ? void 0 : settings.label) !== null && _b !== void 0 ? _b : 'Animation options';
28581
+ var icon = (_c = settings === null || settings === void 0 ? void 0 : settings.icon) !== null && _c !== void 0 ? _c : /*#__PURE__*/React__default["default"].createElement(theme.Options, null);
28582
+ return /*#__PURE__*/React__default["default"].createElement(material.Tooltip, __assign({}, timeSliderLiteTooltipDefaultProps, {
28583
+ title: title
28584
+ }), /*#__PURE__*/React__default["default"].createElement(material.IconButton, __assign({}, timeSliderLiteButtonDefaultProps, {
28585
+ sx: __assign(__assign({}, menuOpen && {
28586
+ backgroundColor: 'geowebColors.timeSliderLite.selected.backgroundColor'
28587
+ }), timeSliderLiteButtonDefaultProps.sx),
28588
+ "aria-selected": menuOpen,
28589
+ onClick: onClick,
28590
+ "data-testid": "TimeSliderLite-MenuButton"
28591
+ }), icon));
28592
+ };
28593
+
28594
+ /* *
28595
+ * Licensed under the Apache License, Version 2.0 (the "License");
28596
+ * you may not use this file except in compliance with the License.
28597
+ * You may obtain a copy of the License at
28598
+ *
28599
+ * http://www.apache.org/licenses/LICENSE-2.0
28600
+ *
28601
+ * Unless required by applicable law or agreed to in writing, software
28602
+ * distributed under the License is distributed on an "AS IS" BASIS,
28603
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28604
+ * See the License for the specific language governing permissions and
28605
+ * limitations under the License.
28606
+ *
28607
+ * Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
28608
+ * Copyright 2023 - Finnish Meteorological Institute (FMI)
28609
+ * */
28610
+ var TIME_SLIDER_LITE_DEFAULT_HEIGHT = 40;
28611
+ var TIME_SLIDER_LITE_DEFAULT_LOCALE = 'en';
28612
+ var TIME_SLIDER_LITE_DEFAULT_TIME_STEP = 5;
28613
+ var styles$1 = {
28614
+ container: {
28615
+ display: 'grid',
28616
+ alignItems: 'center',
28617
+ justifyContent: 'center',
28618
+ borderRadius: '4px'
28619
+ }
28620
+ };
28621
+
28622
+ var TimeSliderLite = function TimeSliderLite(_a) {
28623
+ var controlButtons = _a.controlButtons,
28624
+ endTime = _a.endTime,
28625
+ _b = _a.height,
28626
+ height = _b === void 0 ? TIME_SLIDER_LITE_DEFAULT_HEIGHT : _b,
28627
+ hideButton = _a.hideButton,
28628
+ isAnimating = _a.isAnimating,
28629
+ isVisible = _a.isVisible,
28630
+ _c = _a.locale,
28631
+ locale = _c === void 0 ? TIME_SLIDER_LITE_DEFAULT_LOCALE : _c,
28632
+ mapId = _a.mapId,
28633
+ menuOpen = _a.menuOpen,
28634
+ overrideAnimation = _a.overrideAnimation,
28635
+ onToggleAnimation = _a.onToggleAnimation,
28636
+ onToggleMenu = _a.onToggleMenu,
28637
+ needleWidth = _a.needleWidth,
28638
+ needleDragAreaWidth = _a.needleDragAreaWidth,
28639
+ needleLabelZIndex = _a.needleLabelZIndex,
28640
+ needleLabelOffset = _a.needleLabelOffset,
28641
+ draggableTimeStamp = _a.draggableTimeStamp,
28642
+ onToggleTimeSlider = _a.onToggleTimeSlider,
28643
+ selectedTime = _a.selectedTime,
28644
+ setSelectedTime = _a.setSelectedTime,
28645
+ settings = _a.settings,
28646
+ startTime = _a.startTime,
28647
+ sx = _a.sx,
28648
+ _d = _a.timeStep,
28649
+ timeStep = _d === void 0 ? TIME_SLIDER_LITE_DEFAULT_TIME_STEP : _d;
28650
+
28651
+ var _e = __read(React.useState(selectedTime), 2),
28652
+ rawSelectedTime = _e[0],
28653
+ setRawSelectedTime = _e[1];
28654
+
28655
+ var timeStepSeconds = timeStep * 60;
28656
+ var roundedStartTime = Math.floor(startTime / timeStepSeconds) * timeStepSeconds;
28657
+ var roundedEndTime = Math.floor(endTime / timeStepSeconds) * timeStepSeconds;
28658
+ var runningExternalAnimation = overrideAnimation && isAnimating;
28659
+ var runningInternalAnimation = !overrideAnimation && isAnimating;
28660
+ React.useEffect(function () {
28661
+ if (!runningExternalAnimation) {
28662
+ var roundedSelectedTime = Math.floor(rawSelectedTime / timeStepSeconds) * timeStepSeconds;
28663
+ setSelectedTime(roundedSelectedTime);
28664
+ }
28665
+ }, [setSelectedTime, rawSelectedTime, timeStepSeconds, runningExternalAnimation]);
28666
+ React.useEffect(function () {
28667
+ if (runningInternalAnimation) {
28668
+ var interval_1 = setInterval(function () {
28669
+ setRawSelectedTime(function (prevTime) {
28670
+ if (prevTime + timeStepSeconds > roundedEndTime) {
28671
+ return roundedStartTime;
28672
+ }
28673
+
28674
+ return prevTime + timeStepSeconds;
28675
+ });
28676
+ }, 200);
28677
+ return function () {
28678
+ return clearInterval(interval_1);
28679
+ };
28680
+ }
28681
+
28682
+ if (runningExternalAnimation) {
28683
+ setRawSelectedTime(selectedTime);
28684
+ }
28685
+
28686
+ return function () {};
28687
+ }, [roundedEndTime, isAnimating, roundedStartTime, timeStepSeconds, runningInternalAnimation, runningExternalAnimation, selectedTime]);
28688
+
28689
+ var handleTimeStep = function handleTimeStep(stepSeconds) {
28690
+ var newSteppedTime = Math.floor(rawSelectedTime / timeStepSeconds) * timeStepSeconds + stepSeconds;
28691
+ setRawSelectedTime(boundedValue(newSteppedTime, [roundedStartTime, roundedEndTime]));
28692
+
28693
+ if (isAnimating && onToggleAnimation) {
28694
+ onToggleAnimation();
28695
+ }
28696
+ };
28697
+
28698
+ var handleTimeSelect = function handleTimeSelect(value) {
28699
+ setRawSelectedTime(boundedValue(value, [roundedStartTime, roundedEndTime]));
28700
+
28701
+ if (isAnimating && onToggleAnimation) {
28702
+ onToggleAnimation();
28703
+ }
28704
+ };
28705
+
28706
+ return /*#__PURE__*/React__default["default"].createElement(material.Grid, {
28707
+ container: true,
28708
+ sx: __assign(__assign(__assign({}, styles$1.container), sx), {
28709
+ gridTemplateColumns: isVisible ? 'auto 1fr auto' : "1fr auto"
28710
+ }),
28711
+ "data-testid": "timeSliderLite-" + mapId
28712
+ }, isVisible ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(material.Grid, {
28713
+ item: true,
28714
+ sx: {
28715
+ height: height + "px"
28716
+ }
28717
+ }, controlButtons || /*#__PURE__*/React__default["default"].createElement(ControlButtonGroup, {
28718
+ left: true
28719
+ }, /*#__PURE__*/React__default["default"].createElement(MenuButton, {
28720
+ settings: settings === null || settings === void 0 ? void 0 : settings.menuButton,
28721
+ menuOpen: menuOpen,
28722
+ onClick: onToggleMenu
28723
+ }), /*#__PURE__*/React__default["default"].createElement(material.Divider, {
28724
+ orientation: "vertical",
28725
+ sx: {
28726
+ height: height + "px",
28727
+ margin: '2px'
28728
+ }
28729
+ }), /*#__PURE__*/React__default["default"].createElement(PlayButton, {
28730
+ settings: settings === null || settings === void 0 ? void 0 : settings.playButton,
28731
+ isAnimating: isAnimating,
28732
+ onTogglePlayButton: onToggleAnimation
28733
+ }), /*#__PURE__*/React__default["default"].createElement(StepButton, {
28734
+ settings: settings === null || settings === void 0 ? void 0 : settings.stepButton,
28735
+ onClick: function onClick() {
28736
+ return handleTimeStep(-timeStepSeconds);
28737
+ }
28738
+ }), /*#__PURE__*/React__default["default"].createElement(StepButton, {
28739
+ forward: true,
28740
+ settings: settings === null || settings === void 0 ? void 0 : settings.stepButton,
28741
+ onClick: function onClick() {
28742
+ return handleTimeStep(timeStepSeconds);
28743
+ }
28744
+ }))), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
28745
+ item: true
28746
+ }, /*#__PURE__*/React__default["default"].createElement(TimeSliderLiteBackground, {
28747
+ draggableTimeStamp: draggableTimeStamp,
28748
+ startTime: roundedStartTime,
28749
+ locale: locale,
28750
+ endTime: roundedEndTime,
28751
+ needleWidth: needleWidth,
28752
+ needleDragAreaWidth: needleDragAreaWidth,
28753
+ needleLabelZIndex: needleLabelZIndex,
28754
+ needleLabelOffset: needleLabelOffset,
28755
+ timeStep: timeStepSeconds,
28756
+ selectedTime: runningExternalAnimation ? selectedTime : rawSelectedTime,
28757
+ setSelectedTime: handleTimeSelect,
28758
+ height: height
28759
+ }))) : /*#__PURE__*/React__default["default"].createElement(material.Grid, {
28760
+ item: true
28761
+ }), /*#__PURE__*/React__default["default"].createElement(material.Grid, {
28762
+ item: true,
28763
+ sx: {
28764
+ height: height + "px"
28765
+ }
28766
+ }, hideButton || /*#__PURE__*/React__default["default"].createElement(ControlButtonGroup, {
28767
+ right: isVisible
28768
+ }, /*#__PURE__*/React__default["default"].createElement(HideButton, {
28769
+ settings: settings === null || settings === void 0 ? void 0 : settings.hideButton,
28770
+ onClick: onToggleTimeSlider,
28771
+ isVisible: isVisible
28772
+ }))));
28773
+ };
28774
+
27833
28775
  /* *
27834
28776
  * Licensed under the Apache License, Version 2.0 (the "License");
27835
28777
  * you may not use this file except in compliance with the License.
@@ -28871,6 +29813,7 @@
28871
29813
  exports.TimeSliderBackwardForwardStepButtonConnect = BackwardForwardStepButtonConnect;
28872
29814
  exports.TimeSliderButtonsConnect = TimeSliderButtonsConnect;
28873
29815
  exports.TimeSliderConnect = TimeSliderConnect;
29816
+ exports.TimeSliderLite = TimeSliderLite;
28874
29817
  exports.TimeSliderOptionsMenuButtonConnect = OptionsMenuButtonConnect;
28875
29818
  exports.TimeSliderPlayButtonConnect = PlayButtonConnect;
28876
29819
  exports.ZoomControlConnect = ZoomControlConnect;
@@ -28900,7 +29843,7 @@
28900
29843
  exports.getWMJSTimeDimensionForLayerId = getWMJSTimeDimensionForLayerId;
28901
29844
  exports.getWMLayerById = getWMLayerById;
28902
29845
  exports.layerActions = layerActions;
28903
- exports.layerReducer = reducer$8;
29846
+ exports.layerReducer = reducer$7;
28904
29847
  exports.layerSelectors = selectors$4;
28905
29848
  exports.layerTypes = types$3;
28906
29849
  exports.mapActions = mapActions;
@@ -28916,6 +29859,7 @@
28916
29859
  exports.registerWMJSMap = registerWMJSMap;
28917
29860
  exports.registerWMLayer = registerWMLayer;
28918
29861
  exports.routerActions = routerActions;
29862
+ exports.serviceSelectors = selectors$5;
28919
29863
  exports.snackbarActions = snackbarActions;
28920
29864
  exports.store = store;
28921
29865
  exports.syncGroupActions = genericActions;
@@ -28926,11 +29870,15 @@
28926
29870
  exports.timeSliderUtils = timeSliderUtils;
28927
29871
  exports.uiActions = uiActions;
28928
29872
  exports.uiModuleConfig = uiModuleConfig;
29873
+ exports.uiReducer = reducer$6;
28929
29874
  exports.uiSelectors = selectors$3;
28930
29875
  exports.uiTypes = types;
29876
+ exports.unRegisterAllWMJSLayersAndMaps = unRegisterAllWMJSLayersAndMaps;
28931
29877
  exports.unRegisterWMJSLayer = unRegisterWMJSLayer;
28932
29878
  exports.unRegisterWMJSMap = unRegisterWMJSMap;
29879
+ exports.useFetchServices = useFetchServices;
28933
29880
  exports.useSetupDialog = useSetupDialog;
29881
+ exports.webmapReducer = reducer$5;
28934
29882
 
28935
29883
  Object.defineProperty(exports, '__esModule', { value: true });
28936
29884