@opengeoweb/store 9.25.3 → 9.26.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.
package/index.esm.js CHANGED
@@ -1,16 +1,16 @@
1
- import { webmapUtils, LayerType, getWMJSMapById, WMLayer, webmapTestSettings, isProjectionSupported, handleDateUtilsISOString, getCapabilities, getWMSRequests } from '@opengeoweb/webmap';
1
+ import { webmapUtils, LayerType, getWMJSMapById, WMLayer, webmapTestSettings, handleDateUtilsISOString, getCapabilities, getWMSRequests, isProjectionSupported } from '@opengeoweb/webmap';
2
2
  import { createAction, createSlice, createSelector, createEntityAdapter, createListenerMiddleware, isAnyOf } from '@reduxjs/toolkit';
3
3
  import { getGeoJson, moveFeature, createInterSections, getLastEmptyFeatureIndex, defaultLayers, emptyGeoJSON, addSelectionTypeToGeoJSON, getFeatureCollection, defaultIntersectionStyleProperties } from '@opengeoweb/webmap-react';
4
4
  export { defaultLayers } from '@opengeoweb/webmap-react';
5
- import { dateUtils, defaultDelay, withEggs } from '@opengeoweb/shared';
5
+ import { dateUtils, PROJECTION, defaultDelay, withEggs } from '@opengeoweb/shared';
6
6
  import { defaultTimeSpan, defaultTimeStep, defaultAnimationDelayAtStart, defaultSecondsPerPx, roundWithTimeStep, getSpeedDelay } from '@opengeoweb/timeslider';
7
7
  import { produce } from 'immer';
8
8
  import { isEqual, compact } from 'lodash';
9
9
  import { useSelector, useDispatch, Provider } from 'react-redux';
10
10
  import { useCallback, useEffect } from 'react';
11
- import { createStore as createStore$1 } from '@redux-eggs/redux-toolkit';
11
+ import { createStore } from '@redux-eggs/redux-toolkit';
12
12
  import { getSagaExtension } from '@redux-eggs/saga-extension';
13
- import { takeEvery, call as call$e, put, select, delay, all, takeLatest } from 'redux-saga/effects';
13
+ import { takeEvery, select, put, all, call as call$e, takeLatest } from 'redux-saga/effects';
14
14
  import { metronome } from '@opengeoweb/metronome';
15
15
  import { jsx } from 'react/jsx-runtime';
16
16
 
@@ -21,7 +21,7 @@ var check = function (it) {
21
21
  };
22
22
 
23
23
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
24
- var global$h =
24
+ var global$g =
25
25
  // eslint-disable-next-line es/no-global-this -- safe
26
26
  check(typeof globalThis == 'object' && globalThis) ||
27
27
  check(typeof window == 'object' && window) ||
@@ -34,7 +34,7 @@ var global$h =
34
34
 
35
35
  var objectGetOwnPropertyDescriptor = {};
36
36
 
37
- var fails$n = function (exec) {
37
+ var fails$m = function (exec) {
38
38
  try {
39
39
  return !!exec();
40
40
  } catch (error) {
@@ -42,17 +42,17 @@ var fails$n = function (exec) {
42
42
  }
43
43
  };
44
44
 
45
- var fails$m = fails$n;
45
+ var fails$l = fails$m;
46
46
 
47
47
  // Detect IE8's incomplete defineProperty implementation
48
- var descriptors = !fails$m(function () {
48
+ var descriptors = !fails$l(function () {
49
49
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
50
50
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
51
51
  });
52
52
 
53
- var fails$l = fails$n;
53
+ var fails$k = fails$m;
54
54
 
55
- var functionBindNative = !fails$l(function () {
55
+ var functionBindNative = !fails$k(function () {
56
56
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
57
57
  var test = (function () { /* empty */ }).bind();
58
58
  // eslint-disable-next-line no-prototype-builtins -- safe
@@ -104,24 +104,24 @@ var functionUncurryThis = NATIVE_BIND$1 ? uncurryThisWithBind : function (fn) {
104
104
  };
105
105
  };
106
106
 
107
- var uncurryThis$l = functionUncurryThis;
107
+ var uncurryThis$j = functionUncurryThis;
108
108
 
109
- var toString$b = uncurryThis$l({}.toString);
110
- var stringSlice$4 = uncurryThis$l(''.slice);
109
+ var toString$9 = uncurryThis$j({}.toString);
110
+ var stringSlice$4 = uncurryThis$j(''.slice);
111
111
 
112
112
  var classofRaw$1 = function (it) {
113
- return stringSlice$4(toString$b(it), 8, -1);
113
+ return stringSlice$4(toString$9(it), 8, -1);
114
114
  };
115
115
 
116
- var uncurryThis$k = functionUncurryThis;
117
- var fails$k = fails$n;
116
+ var uncurryThis$i = functionUncurryThis;
117
+ var fails$j = fails$m;
118
118
  var classof$8 = classofRaw$1;
119
119
 
120
120
  var $Object$4 = Object;
121
- var split = uncurryThis$k(''.split);
121
+ var split = uncurryThis$i(''.split);
122
122
 
123
123
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
124
- var indexedObject = fails$k(function () {
124
+ var indexedObject = fails$j(function () {
125
125
  // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
126
126
  // eslint-disable-next-line no-prototype-builtins -- safe
127
127
  return !$Object$4('z').propertyIsEnumerable(0);
@@ -141,17 +141,17 @@ var $TypeError$d = TypeError;
141
141
 
142
142
  // `RequireObjectCoercible` abstract operation
143
143
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
144
- var requireObjectCoercible$7 = function (it) {
144
+ var requireObjectCoercible$6 = function (it) {
145
145
  if (isNullOrUndefined$3(it)) throw new $TypeError$d("Can't call method on " + it);
146
146
  return it;
147
147
  };
148
148
 
149
149
  // toObject with fallback for non-array-like ES3 strings
150
150
  var IndexedObject$2 = indexedObject;
151
- var requireObjectCoercible$6 = requireObjectCoercible$7;
151
+ var requireObjectCoercible$5 = requireObjectCoercible$6;
152
152
 
153
153
  var toIndexedObject$5 = function (it) {
154
- return IndexedObject$2(requireObjectCoercible$6(it));
154
+ return IndexedObject$2(requireObjectCoercible$5(it));
155
155
  };
156
156
 
157
157
  // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
@@ -172,7 +172,7 @@ var isObject$b = function (it) {
172
172
  return typeof it == 'object' ? it !== null : isCallable$j(it);
173
173
  };
174
174
 
175
- var global$g = global$h;
175
+ var global$f = global$g;
176
176
  var isCallable$i = isCallable$k;
177
177
 
178
178
  var aFunction = function (argument) {
@@ -180,20 +180,20 @@ var aFunction = function (argument) {
180
180
  };
181
181
 
182
182
  var getBuiltIn$6 = function (namespace, method) {
183
- return arguments.length < 2 ? aFunction(global$g[namespace]) : global$g[namespace] && global$g[namespace][method];
183
+ return arguments.length < 2 ? aFunction(global$f[namespace]) : global$f[namespace] && global$f[namespace][method];
184
184
  };
185
185
 
186
- var uncurryThis$j = functionUncurryThis;
186
+ var uncurryThis$h = functionUncurryThis;
187
187
 
188
- var objectIsPrototypeOf = uncurryThis$j({}.isPrototypeOf);
188
+ var objectIsPrototypeOf = uncurryThis$h({}.isPrototypeOf);
189
189
 
190
190
  var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
191
191
 
192
- var global$f = global$h;
192
+ var global$e = global$g;
193
193
  var userAgent = engineUserAgent;
194
194
 
195
- var process = global$f.process;
196
- var Deno = global$f.Deno;
195
+ var process = global$e.process;
196
+ var Deno = global$e.Deno;
197
197
  var versions = process && process.versions || Deno && Deno.version;
198
198
  var v8 = versions && versions.v8;
199
199
  var match, version;
@@ -219,13 +219,13 @@ var engineV8Version = version;
219
219
 
220
220
  /* eslint-disable es/no-symbol -- required for testing */
221
221
  var V8_VERSION = engineV8Version;
222
- var fails$j = fails$n;
223
- var global$e = global$h;
222
+ var fails$i = fails$m;
223
+ var global$d = global$g;
224
224
 
225
- var $String$6 = global$e.String;
225
+ var $String$6 = global$d.String;
226
226
 
227
227
  // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
228
- var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$j(function () {
228
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$i(function () {
229
229
  var symbol = Symbol('symbol detection');
230
230
  // Chrome 38 Symbol has incorrect toString conversion
231
231
  // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
@@ -306,20 +306,20 @@ var ordinaryToPrimitive$1 = function (input, pref) {
306
306
 
307
307
  var sharedStore = {exports: {}};
308
308
 
309
- var global$d = global$h;
309
+ var global$c = global$g;
310
310
 
311
311
  // eslint-disable-next-line es/no-object-defineproperty -- safe
312
312
  var defineProperty$6 = Object.defineProperty;
313
313
 
314
314
  var defineGlobalProperty$3 = function (key, value) {
315
315
  try {
316
- defineProperty$6(global$d, key, { value: value, configurable: true, writable: true });
316
+ defineProperty$6(global$c, key, { value: value, configurable: true, writable: true });
317
317
  } catch (error) {
318
- global$d[key] = value;
318
+ global$c[key] = value;
319
319
  } return value;
320
320
  };
321
321
 
322
- var globalThis$1 = global$h;
322
+ var globalThis$1 = global$g;
323
323
  var defineGlobalProperty$2 = defineGlobalProperty$3;
324
324
 
325
325
  var SHARED = '__core-js_shared__';
@@ -341,20 +341,20 @@ var shared$4 = function (key, value) {
341
341
  return store$2[key] || (store$2[key] = value || {});
342
342
  };
343
343
 
344
- var requireObjectCoercible$5 = requireObjectCoercible$7;
344
+ var requireObjectCoercible$4 = requireObjectCoercible$6;
345
345
 
346
346
  var $Object$2 = Object;
347
347
 
348
348
  // `ToObject` abstract operation
349
349
  // https://tc39.es/ecma262/#sec-toobject
350
350
  var toObject$6 = function (argument) {
351
- return $Object$2(requireObjectCoercible$5(argument));
351
+ return $Object$2(requireObjectCoercible$4(argument));
352
352
  };
353
353
 
354
- var uncurryThis$i = functionUncurryThis;
354
+ var uncurryThis$g = functionUncurryThis;
355
355
  var toObject$5 = toObject$6;
356
356
 
357
- var hasOwnProperty = uncurryThis$i({}.hasOwnProperty);
357
+ var hasOwnProperty = uncurryThis$g({}.hasOwnProperty);
358
358
 
359
359
  // `HasOwnProperty` abstract operation
360
360
  // https://tc39.es/ecma262/#sec-hasownproperty
@@ -363,31 +363,31 @@ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
363
363
  return hasOwnProperty(toObject$5(it), key);
364
364
  };
365
365
 
366
- var uncurryThis$h = functionUncurryThis;
366
+ var uncurryThis$f = functionUncurryThis;
367
367
 
368
368
  var id = 0;
369
369
  var postfix = Math.random();
370
- var toString$a = uncurryThis$h(1.0.toString);
370
+ var toString$8 = uncurryThis$f(1.0.toString);
371
371
 
372
372
  var uid$2 = function (key) {
373
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$a(++id + postfix, 36);
373
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id + postfix, 36);
374
374
  };
375
375
 
376
- var global$c = global$h;
376
+ var global$b = global$g;
377
377
  var shared$3 = shared$4;
378
378
  var hasOwn$9 = hasOwnProperty_1;
379
379
  var uid$1 = uid$2;
380
380
  var NATIVE_SYMBOL$1 = symbolConstructorDetection;
381
381
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
382
382
 
383
- var Symbol$2 = global$c.Symbol;
383
+ var Symbol$1 = global$b.Symbol;
384
384
  var WellKnownSymbolsStore = shared$3('wks');
385
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2['for'] || Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$1;
385
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
386
386
 
387
387
  var wellKnownSymbol$c = function (name) {
388
388
  if (!hasOwn$9(WellKnownSymbolsStore, name)) {
389
- WellKnownSymbolsStore[name] = NATIVE_SYMBOL$1 && hasOwn$9(Symbol$2, name)
390
- ? Symbol$2[name]
389
+ WellKnownSymbolsStore[name] = NATIVE_SYMBOL$1 && hasOwn$9(Symbol$1, name)
390
+ ? Symbol$1[name]
391
391
  : createWellKnownSymbol('Symbol.' + name);
392
392
  } return WellKnownSymbolsStore[name];
393
393
  };
@@ -428,10 +428,10 @@ var toPropertyKey$2 = function (argument) {
428
428
  return isSymbol$1(key) ? key : key + '';
429
429
  };
430
430
 
431
- var global$b = global$h;
431
+ var global$a = global$g;
432
432
  var isObject$8 = isObject$b;
433
433
 
434
- var document$1 = global$b.document;
434
+ var document$1 = global$a.document;
435
435
  // typeof document.createElement is 'object' in old IE
436
436
  var EXISTS$1 = isObject$8(document$1) && isObject$8(document$1.createElement);
437
437
 
@@ -440,11 +440,11 @@ var documentCreateElement$2 = function (it) {
440
440
  };
441
441
 
442
442
  var DESCRIPTORS$b = descriptors;
443
- var fails$i = fails$n;
443
+ var fails$h = fails$m;
444
444
  var createElement = documentCreateElement$2;
445
445
 
446
446
  // Thanks to IE8 for its funny defineProperty
447
- var ie8DomDefine = !DESCRIPTORS$b && !fails$i(function () {
447
+ var ie8DomDefine = !DESCRIPTORS$b && !fails$h(function () {
448
448
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
449
449
  return Object.defineProperty(createElement('div'), 'a', {
450
450
  get: function () { return 7; }
@@ -477,11 +477,11 @@ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$a ? $getOwnPropertyDescriptor$1 :
477
477
  var objectDefineProperty = {};
478
478
 
479
479
  var DESCRIPTORS$9 = descriptors;
480
- var fails$h = fails$n;
480
+ var fails$g = fails$m;
481
481
 
482
482
  // V8 ~ Chrome 36-
483
483
  // https://bugs.chromium.org/p/v8/issues/detail?id=3334
484
- var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$h(function () {
484
+ var v8PrototypeDefineBug = DESCRIPTORS$9 && fails$g(function () {
485
485
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
486
486
  return Object.defineProperty(function () { /* empty */ }, 'prototype', {
487
487
  value: 42,
@@ -575,11 +575,11 @@ var functionName = {
575
575
  CONFIGURABLE: CONFIGURABLE
576
576
  };
577
577
 
578
- var uncurryThis$g = functionUncurryThis;
578
+ var uncurryThis$e = functionUncurryThis;
579
579
  var isCallable$e = isCallable$k;
580
580
  var store$1 = sharedStoreExports;
581
581
 
582
- var functionToString = uncurryThis$g(Function.toString);
582
+ var functionToString = uncurryThis$e(Function.toString);
583
583
 
584
584
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
585
585
  if (!isCallable$e(store$1.inspectSource)) {
@@ -590,10 +590,10 @@ if (!isCallable$e(store$1.inspectSource)) {
590
590
 
591
591
  var inspectSource$2 = store$1.inspectSource;
592
592
 
593
- var global$a = global$h;
593
+ var global$9 = global$g;
594
594
  var isCallable$d = isCallable$k;
595
595
 
596
- var WeakMap$1 = global$a.WeakMap;
596
+ var WeakMap$1 = global$9.WeakMap;
597
597
 
598
598
  var weakMapBasicDetection = isCallable$d(WeakMap$1) && /native code/.test(String(WeakMap$1));
599
599
 
@@ -609,7 +609,7 @@ var sharedKey$3 = function (key) {
609
609
  var hiddenKeys$4 = {};
610
610
 
611
611
  var NATIVE_WEAK_MAP = weakMapBasicDetection;
612
- var global$9 = global$h;
612
+ var global$8 = global$g;
613
613
  var isObject$6 = isObject$b;
614
614
  var createNonEnumerableProperty$7 = createNonEnumerableProperty$8;
615
615
  var hasOwn$6 = hasOwnProperty_1;
@@ -618,8 +618,8 @@ var sharedKey$2 = sharedKey$3;
618
618
  var hiddenKeys$3 = hiddenKeys$4;
619
619
 
620
620
  var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
621
- var TypeError$1 = global$9.TypeError;
622
- var WeakMap = global$9.WeakMap;
621
+ var TypeError$1 = global$8.TypeError;
622
+ var WeakMap = global$8.WeakMap;
623
623
  var set, get, has;
624
624
 
625
625
  var enforce = function (it) {
@@ -679,8 +679,8 @@ var internalState = {
679
679
  getterFor: getterFor
680
680
  };
681
681
 
682
- var uncurryThis$f = functionUncurryThis;
683
- var fails$g = fails$n;
682
+ var uncurryThis$d = functionUncurryThis;
683
+ var fails$f = fails$m;
684
684
  var isCallable$c = isCallable$k;
685
685
  var hasOwn$5 = hasOwnProperty_1;
686
686
  var DESCRIPTORS$5 = descriptors;
@@ -693,11 +693,11 @@ var getInternalState$2 = InternalStateModule$1.get;
693
693
  var $String$3 = String;
694
694
  // eslint-disable-next-line es/no-object-defineproperty -- safe
695
695
  var defineProperty$5 = Object.defineProperty;
696
- var stringSlice$3 = uncurryThis$f(''.slice);
697
- var replace$4 = uncurryThis$f(''.replace);
698
- var join = uncurryThis$f([].join);
696
+ var stringSlice$3 = uncurryThis$d(''.slice);
697
+ var replace$3 = uncurryThis$d(''.replace);
698
+ var join = uncurryThis$d([].join);
699
699
 
700
- var CONFIGURABLE_LENGTH = DESCRIPTORS$5 && !fails$g(function () {
700
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$5 && !fails$f(function () {
701
701
  return defineProperty$5(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
702
702
  });
703
703
 
@@ -705,7 +705,7 @@ var TEMPLATE = String(String).split('String');
705
705
 
706
706
  var makeBuiltIn$1 = makeBuiltIn$2.exports = function (value, name, options) {
707
707
  if (stringSlice$3($String$3(name), 0, 7) === 'Symbol(') {
708
- name = '[' + replace$4($String$3(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
708
+ name = '[' + replace$3($String$3(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
709
709
  }
710
710
  if (options && options.getter) name = 'get ' + name;
711
711
  if (options && options.setter) name = 'set ' + name;
@@ -824,7 +824,7 @@ var toAbsoluteIndex = toAbsoluteIndex$1;
824
824
  var lengthOfArrayLike$3 = lengthOfArrayLike$4;
825
825
 
826
826
  // `Array.prototype.{ indexOf, includes }` methods implementation
827
- var createMethod$3 = function (IS_INCLUDES) {
827
+ var createMethod$2 = function (IS_INCLUDES) {
828
828
  return function ($this, el, fromIndex) {
829
829
  var O = toIndexedObject$3($this);
830
830
  var length = lengthOfArrayLike$3(O);
@@ -847,19 +847,19 @@ var createMethod$3 = function (IS_INCLUDES) {
847
847
  var arrayIncludes = {
848
848
  // `Array.prototype.includes` method
849
849
  // https://tc39.es/ecma262/#sec-array.prototype.includes
850
- includes: createMethod$3(true),
850
+ includes: createMethod$2(true),
851
851
  // `Array.prototype.indexOf` method
852
852
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
853
- indexOf: createMethod$3(false)
853
+ indexOf: createMethod$2(false)
854
854
  };
855
855
 
856
- var uncurryThis$e = functionUncurryThis;
856
+ var uncurryThis$c = functionUncurryThis;
857
857
  var hasOwn$4 = hasOwnProperty_1;
858
858
  var toIndexedObject$2 = toIndexedObject$5;
859
859
  var indexOf$1 = arrayIncludes.indexOf;
860
860
  var hiddenKeys$2 = hiddenKeys$4;
861
861
 
862
- var push$2 = uncurryThis$e([].push);
862
+ var push$2 = uncurryThis$c([].push);
863
863
 
864
864
  var objectKeysInternal = function (object, names) {
865
865
  var O = toIndexedObject$2(object);
@@ -903,12 +903,12 @@ var objectGetOwnPropertySymbols = {};
903
903
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
904
904
 
905
905
  var getBuiltIn$4 = getBuiltIn$6;
906
- var uncurryThis$d = functionUncurryThis;
906
+ var uncurryThis$b = functionUncurryThis;
907
907
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
908
908
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
909
909
  var anObject$7 = anObject$9;
910
910
 
911
- var concat$1 = uncurryThis$d([].concat);
911
+ var concat$1 = uncurryThis$b([].concat);
912
912
 
913
913
  // all object keys, includes non-enumerable and symbols
914
914
  var ownKeys$1 = getBuiltIn$4('Reflect', 'ownKeys') || function ownKeys(it) {
@@ -934,7 +934,7 @@ var copyConstructorProperties$2 = function (target, source, exceptions) {
934
934
  }
935
935
  };
936
936
 
937
- var fails$f = fails$n;
937
+ var fails$e = fails$m;
938
938
  var isCallable$a = isCallable$k;
939
939
 
940
940
  var replacement = /#|\.prototype\./;
@@ -943,7 +943,7 @@ var isForced$1 = function (feature, detection) {
943
943
  var value = data[normalize(feature)];
944
944
  return value === POLYFILL ? true
945
945
  : value === NATIVE ? false
946
- : isCallable$a(detection) ? fails$f(detection)
946
+ : isCallable$a(detection) ? fails$e(detection)
947
947
  : !!detection;
948
948
  };
949
949
 
@@ -957,7 +957,7 @@ var POLYFILL = isForced$1.POLYFILL = 'P';
957
957
 
958
958
  var isForced_1 = isForced$1;
959
959
 
960
- var global$8 = global$h;
960
+ var global$7 = global$g;
961
961
  var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
962
962
  var createNonEnumerableProperty$6 = createNonEnumerableProperty$8;
963
963
  var defineBuiltIn$3 = defineBuiltIn$4;
@@ -986,11 +986,11 @@ var _export = function (options, source) {
986
986
  var STATIC = options.stat;
987
987
  var FORCED, target, key, targetProperty, sourceProperty, descriptor;
988
988
  if (GLOBAL) {
989
- target = global$8;
989
+ target = global$7;
990
990
  } else if (STATIC) {
991
- target = global$8[TARGET] || defineGlobalProperty(TARGET, {});
991
+ target = global$7[TARGET] || defineGlobalProperty(TARGET, {});
992
992
  } else {
993
- target = global$8[TARGET] && global$8[TARGET].prototype;
993
+ target = global$7[TARGET] && global$7[TARGET].prototype;
994
994
  }
995
995
  if (target) for (key in source) {
996
996
  sourceProperty = source[key];
@@ -1023,9 +1023,9 @@ var objectKeys$2 = Object.keys || function keys(O) {
1023
1023
  };
1024
1024
 
1025
1025
  var DESCRIPTORS$4 = descriptors;
1026
- var uncurryThis$c = functionUncurryThis;
1026
+ var uncurryThis$a = functionUncurryThis;
1027
1027
  var call$8 = functionCall;
1028
- var fails$e = fails$n;
1028
+ var fails$d = fails$m;
1029
1029
  var objectKeys$1 = objectKeys$2;
1030
1030
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1031
1031
  var propertyIsEnumerableModule = objectPropertyIsEnumerable;
@@ -1036,11 +1036,11 @@ var IndexedObject$1 = indexedObject;
1036
1036
  var $assign = Object.assign;
1037
1037
  // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1038
1038
  var defineProperty$4 = Object.defineProperty;
1039
- var concat = uncurryThis$c([].concat);
1039
+ var concat = uncurryThis$a([].concat);
1040
1040
 
1041
1041
  // `Object.assign` method
1042
1042
  // https://tc39.es/ecma262/#sec-object.assign
1043
- var objectAssign = !$assign || fails$e(function () {
1043
+ var objectAssign = !$assign || fails$d(function () {
1044
1044
  // should have correct order of operations (Edge bug)
1045
1045
  if (DESCRIPTORS$4 && $assign({ b: 1 }, $assign(defineProperty$4({}, 'a', {
1046
1046
  enumerable: true,
@@ -1079,13 +1079,13 @@ var objectAssign = !$assign || fails$e(function () {
1079
1079
  } return T;
1080
1080
  } : $assign;
1081
1081
 
1082
- var $$b = _export;
1082
+ var $$a = _export;
1083
1083
  var assign = objectAssign;
1084
1084
 
1085
1085
  // `Object.assign` method
1086
1086
  // https://tc39.es/ecma262/#sec-object.assign
1087
1087
  // eslint-disable-next-line es/no-object-assign -- required for testing
1088
- $$b({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1088
+ $$a({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1089
1089
  assign: assign
1090
1090
  });
1091
1091
 
@@ -1221,20 +1221,20 @@ var addToUnscopables$2 = function (key) {
1221
1221
  ArrayPrototype[UNSCOPABLES][key] = true;
1222
1222
  };
1223
1223
 
1224
- var $$a = _export;
1224
+ var $$9 = _export;
1225
1225
  var $includes = arrayIncludes.includes;
1226
- var fails$d = fails$n;
1226
+ var fails$c = fails$m;
1227
1227
  var addToUnscopables$1 = addToUnscopables$2;
1228
1228
 
1229
1229
  // FF99+ bug
1230
- var BROKEN_ON_SPARSE = fails$d(function () {
1230
+ var BROKEN_ON_SPARSE = fails$c(function () {
1231
1231
  // eslint-disable-next-line es/no-array-prototype-includes -- detection
1232
1232
  return !Array(1).includes();
1233
1233
  });
1234
1234
 
1235
1235
  // `Array.prototype.includes` method
1236
1236
  // https://tc39.es/ecma262/#sec-array.prototype.includes
1237
- $$a({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
1237
+ $$9({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
1238
1238
  includes: function includes(el /* , fromIndex = 0 */) {
1239
1239
  return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
1240
1240
  }
@@ -1245,9 +1245,9 @@ addToUnscopables$1('includes');
1245
1245
 
1246
1246
  var iterators = {};
1247
1247
 
1248
- var fails$c = fails$n;
1248
+ var fails$b = fails$m;
1249
1249
 
1250
- var correctPrototypeGetter = !fails$c(function () {
1250
+ var correctPrototypeGetter = !fails$b(function () {
1251
1251
  function F() { /* empty */ }
1252
1252
  F.prototype.constructor = null;
1253
1253
  // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
@@ -1276,14 +1276,14 @@ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf :
1276
1276
  } return object instanceof $Object$1 ? ObjectPrototype : null;
1277
1277
  };
1278
1278
 
1279
- var fails$b = fails$n;
1279
+ var fails$a = fails$m;
1280
1280
  var isCallable$8 = isCallable$k;
1281
1281
  var isObject$5 = isObject$b;
1282
1282
  var getPrototypeOf$1 = objectGetPrototypeOf;
1283
1283
  var defineBuiltIn$2 = defineBuiltIn$4;
1284
1284
  var wellKnownSymbol$9 = wellKnownSymbol$c;
1285
1285
 
1286
- var ITERATOR$3 = wellKnownSymbol$9('iterator');
1286
+ var ITERATOR$2 = wellKnownSymbol$9('iterator');
1287
1287
  var BUGGY_SAFARI_ITERATORS$1 = false;
1288
1288
 
1289
1289
  // `%IteratorPrototype%` object
@@ -1301,18 +1301,18 @@ if ([].keys) {
1301
1301
  }
1302
1302
  }
1303
1303
 
1304
- var NEW_ITERATOR_PROTOTYPE = !isObject$5(IteratorPrototype$2) || fails$b(function () {
1304
+ var NEW_ITERATOR_PROTOTYPE = !isObject$5(IteratorPrototype$2) || fails$a(function () {
1305
1305
  var test = {};
1306
1306
  // FF44- legacy iterators case
1307
- return IteratorPrototype$2[ITERATOR$3].call(test) !== test;
1307
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1308
1308
  });
1309
1309
 
1310
1310
  if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1311
1311
 
1312
1312
  // `%IteratorPrototype%[@@iterator]()` method
1313
1313
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1314
- if (!isCallable$8(IteratorPrototype$2[ITERATOR$3])) {
1315
- defineBuiltIn$2(IteratorPrototype$2, ITERATOR$3, function () {
1314
+ if (!isCallable$8(IteratorPrototype$2[ITERATOR$2])) {
1315
+ defineBuiltIn$2(IteratorPrototype$2, ITERATOR$2, function () {
1316
1316
  return this;
1317
1317
  });
1318
1318
  }
@@ -1351,13 +1351,13 @@ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUME
1351
1351
  return IteratorConstructor;
1352
1352
  };
1353
1353
 
1354
- var uncurryThis$b = functionUncurryThis;
1354
+ var uncurryThis$9 = functionUncurryThis;
1355
1355
  var aCallable$1 = aCallable$3;
1356
1356
 
1357
1357
  var functionUncurryThisAccessor = function (object, key, method) {
1358
1358
  try {
1359
1359
  // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1360
- return uncurryThis$b(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
1360
+ return uncurryThis$9(aCallable$1(Object.getOwnPropertyDescriptor(object, key)[method]));
1361
1361
  } catch (error) { /* empty */ }
1362
1362
  };
1363
1363
 
@@ -1380,7 +1380,7 @@ var aPossiblePrototype$1 = function (argument) {
1380
1380
  /* eslint-disable no-proto -- safe */
1381
1381
  var uncurryThisAccessor = functionUncurryThisAccessor;
1382
1382
  var isObject$3 = isObject$b;
1383
- var requireObjectCoercible$4 = requireObjectCoercible$7;
1383
+ var requireObjectCoercible$3 = requireObjectCoercible$6;
1384
1384
  var aPossiblePrototype = aPossiblePrototype$1;
1385
1385
 
1386
1386
  // `Object.setPrototypeOf` method
@@ -1397,7 +1397,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1397
1397
  CORRECT_SETTER = test instanceof Array;
1398
1398
  } catch (error) { /* empty */ }
1399
1399
  return function setPrototypeOf(O, proto) {
1400
- requireObjectCoercible$4(O);
1400
+ requireObjectCoercible$3(O);
1401
1401
  aPossiblePrototype(proto);
1402
1402
  if (!isObject$3(O)) return O;
1403
1403
  if (CORRECT_SETTER) setter(O, proto);
@@ -1406,7 +1406,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1406
1406
  };
1407
1407
  }() : undefined);
1408
1408
 
1409
- var $$9 = _export;
1409
+ var $$8 = _export;
1410
1410
  var call$7 = functionCall;
1411
1411
  var FunctionName = functionName;
1412
1412
  var isCallable$7 = isCallable$k;
@@ -1424,7 +1424,7 @@ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1424
1424
  var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1425
1425
  var IteratorPrototype = IteratorsCore.IteratorPrototype;
1426
1426
  var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1427
- var ITERATOR$2 = wellKnownSymbol$7('iterator');
1427
+ var ITERATOR$1 = wellKnownSymbol$7('iterator');
1428
1428
  var KEYS = 'keys';
1429
1429
  var VALUES = 'values';
1430
1430
  var ENTRIES = 'entries';
@@ -1450,7 +1450,7 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1450
1450
  var TO_STRING_TAG = NAME + ' Iterator';
1451
1451
  var INCORRECT_VALUES_NAME = false;
1452
1452
  var IterablePrototype = Iterable.prototype;
1453
- var nativeIterator = IterablePrototype[ITERATOR$2]
1453
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1454
1454
  || IterablePrototype['@@iterator']
1455
1455
  || DEFAULT && IterablePrototype[DEFAULT];
1456
1456
  var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
@@ -1464,8 +1464,8 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1464
1464
  if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1465
1465
  if (setPrototypeOf$2) {
1466
1466
  setPrototypeOf$2(CurrentIteratorPrototype, IteratorPrototype);
1467
- } else if (!isCallable$7(CurrentIteratorPrototype[ITERATOR$2])) {
1468
- defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$2, returnThis);
1467
+ } else if (!isCallable$7(CurrentIteratorPrototype[ITERATOR$1])) {
1468
+ defineBuiltIn$1(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1469
1469
  }
1470
1470
  }
1471
1471
  // Set @@toStringTag to native iterators
@@ -1494,12 +1494,12 @@ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAUL
1494
1494
  if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1495
1495
  defineBuiltIn$1(IterablePrototype, KEY, methods[KEY]);
1496
1496
  }
1497
- } else $$9({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1497
+ } else $$8({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1498
1498
  }
1499
1499
 
1500
1500
  // define iterator
1501
- if (IterablePrototype[ITERATOR$2] !== defaultIterator) {
1502
- defineBuiltIn$1(IterablePrototype, ITERATOR$2, defaultIterator, { name: DEFAULT });
1501
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1502
+ defineBuiltIn$1(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1503
1503
  }
1504
1504
  Iterators$1[NAME] = defaultIterator;
1505
1505
 
@@ -1617,14 +1617,14 @@ var doesNotExceedSafeInteger$2 = function (it) {
1617
1617
  return it;
1618
1618
  };
1619
1619
 
1620
- var $$8 = _export;
1620
+ var $$7 = _export;
1621
1621
  var toObject$2 = toObject$6;
1622
1622
  var lengthOfArrayLike$2 = lengthOfArrayLike$4;
1623
1623
  var setArrayLength$1 = arraySetLength;
1624
1624
  var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$2;
1625
- var fails$a = fails$n;
1625
+ var fails$9 = fails$m;
1626
1626
 
1627
- var INCORRECT_TO_LENGTH = fails$a(function () {
1627
+ var INCORRECT_TO_LENGTH = fails$9(function () {
1628
1628
  return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
1629
1629
  });
1630
1630
 
@@ -1639,11 +1639,11 @@ var properErrorOnNonWritableLength$1 = function () {
1639
1639
  }
1640
1640
  };
1641
1641
 
1642
- var FORCED$4 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength$1();
1642
+ var FORCED$3 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength$1();
1643
1643
 
1644
1644
  // `Array.prototype.push` method
1645
1645
  // https://tc39.es/ecma262/#sec-array.prototype.push
1646
- $$8({ target: 'Array', proto: true, arity: 1, forced: FORCED$4 }, {
1646
+ $$7({ target: 'Array', proto: true, arity: 1, forced: FORCED$3 }, {
1647
1647
  // eslint-disable-next-line no-unused-vars -- required for `.length`
1648
1648
  push: function push(item) {
1649
1649
  var O = toObject$2(this);
@@ -1669,7 +1669,7 @@ var $TypeError$4 = TypeError;
1669
1669
  var REDUCE_EMPTY = 'Reduce of empty array with no initial value';
1670
1670
 
1671
1671
  // `Array.prototype.{ reduce, reduceRight }` methods implementation
1672
- var createMethod$2 = function (IS_RIGHT) {
1672
+ var createMethod$1 = function (IS_RIGHT) {
1673
1673
  return function (that, callbackfn, argumentsLength, memo) {
1674
1674
  var O = toObject$1(that);
1675
1675
  var self = IndexedObject(O);
@@ -1699,28 +1699,28 @@ var createMethod$2 = function (IS_RIGHT) {
1699
1699
  var arrayReduce = {
1700
1700
  // `Array.prototype.reduce` method
1701
1701
  // https://tc39.es/ecma262/#sec-array.prototype.reduce
1702
- left: createMethod$2(false),
1702
+ left: createMethod$1(false),
1703
1703
  // `Array.prototype.reduceRight` method
1704
1704
  // https://tc39.es/ecma262/#sec-array.prototype.reduceright
1705
- right: createMethod$2(true)
1705
+ right: createMethod$1(true)
1706
1706
  };
1707
1707
 
1708
- var fails$9 = fails$n;
1708
+ var fails$8 = fails$m;
1709
1709
 
1710
1710
  var arrayMethodIsStrict$1 = function (METHOD_NAME, argument) {
1711
1711
  var method = [][METHOD_NAME];
1712
- return !!method && fails$9(function () {
1712
+ return !!method && fails$8(function () {
1713
1713
  // eslint-disable-next-line no-useless-call -- required for testing
1714
1714
  method.call(null, argument || function () { return 1; }, 1);
1715
1715
  });
1716
1716
  };
1717
1717
 
1718
- var global$7 = global$h;
1718
+ var global$6 = global$g;
1719
1719
  var classof$6 = classofRaw$1;
1720
1720
 
1721
- var engineIsNode = classof$6(global$7.process) === 'process';
1721
+ var engineIsNode = classof$6(global$6.process) === 'process';
1722
1722
 
1723
- var $$7 = _export;
1723
+ var $$6 = _export;
1724
1724
  var $reduce = arrayReduce.left;
1725
1725
  var arrayMethodIsStrict = arrayMethodIsStrict$1;
1726
1726
  var CHROME_VERSION = engineV8Version;
@@ -1729,11 +1729,11 @@ var IS_NODE = engineIsNode;
1729
1729
  // Chrome 80-82 has a critical bug
1730
1730
  // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
1731
1731
  var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
1732
- var FORCED$3 = CHROME_BUG || !arrayMethodIsStrict('reduce');
1732
+ var FORCED$2 = CHROME_BUG || !arrayMethodIsStrict('reduce');
1733
1733
 
1734
1734
  // `Array.prototype.reduce` method
1735
1735
  // https://tc39.es/ecma262/#sec-array.prototype.reduce
1736
- $$7({ target: 'Array', proto: true, forced: FORCED$3 }, {
1736
+ $$6({ target: 'Array', proto: true, forced: FORCED$2 }, {
1737
1737
  reduce: function reduce(callbackfn /* , initialValue */) {
1738
1738
  var length = arguments.length;
1739
1739
  return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
@@ -1806,7 +1806,7 @@ var classof$3 = classof$4;
1806
1806
 
1807
1807
  var $String$1 = String;
1808
1808
 
1809
- var toString$9 = function (argument) {
1809
+ var toString$7 = function (argument) {
1810
1810
  if (classof$3(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1811
1811
  return $String$1(argument);
1812
1812
  };
@@ -1827,22 +1827,22 @@ var correctIsRegexpLogic = function (METHOD_NAME) {
1827
1827
  } return false;
1828
1828
  };
1829
1829
 
1830
- var $$6 = _export;
1831
- var uncurryThis$a = functionUncurryThis;
1830
+ var $$5 = _export;
1831
+ var uncurryThis$8 = functionUncurryThis;
1832
1832
  var notARegExp = notARegexp;
1833
- var requireObjectCoercible$3 = requireObjectCoercible$7;
1834
- var toString$8 = toString$9;
1833
+ var requireObjectCoercible$2 = requireObjectCoercible$6;
1834
+ var toString$6 = toString$7;
1835
1835
  var correctIsRegExpLogic = correctIsRegexpLogic;
1836
1836
 
1837
- var stringIndexOf = uncurryThis$a(''.indexOf);
1837
+ var stringIndexOf = uncurryThis$8(''.indexOf);
1838
1838
 
1839
1839
  // `String.prototype.includes` method
1840
1840
  // https://tc39.es/ecma262/#sec-string.prototype.includes
1841
- $$6({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
1841
+ $$5({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }, {
1842
1842
  includes: function includes(searchString /* , position = 0 */) {
1843
1843
  return !!~stringIndexOf(
1844
- toString$8(requireObjectCoercible$3(this)),
1845
- toString$8(notARegExp(searchString)),
1844
+ toString$6(requireObjectCoercible$2(this)),
1845
+ toString$6(notARegExp(searchString)),
1846
1846
  arguments.length > 1 ? arguments[1] : undefined
1847
1847
  );
1848
1848
  }
@@ -1892,7 +1892,7 @@ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.co
1892
1892
 
1893
1893
  var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
1894
1894
 
1895
- var global$6 = global$h;
1895
+ var global$5 = global$g;
1896
1896
  var DOMIterables = domIterables;
1897
1897
  var DOMTokenListPrototype = domTokenListPrototype;
1898
1898
  var ArrayIteratorMethods = es_array_iterator;
@@ -1900,16 +1900,16 @@ var createNonEnumerableProperty$4 = createNonEnumerableProperty$8;
1900
1900
  var setToStringTag = setToStringTag$3;
1901
1901
  var wellKnownSymbol$2 = wellKnownSymbol$c;
1902
1902
 
1903
- var ITERATOR$1 = wellKnownSymbol$2('iterator');
1903
+ var ITERATOR = wellKnownSymbol$2('iterator');
1904
1904
  var ArrayValues = ArrayIteratorMethods.values;
1905
1905
 
1906
1906
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1907
1907
  if (CollectionPrototype) {
1908
1908
  // some Chrome versions have non-configurable methods on DOMTokenList
1909
- if (CollectionPrototype[ITERATOR$1] !== ArrayValues) try {
1910
- createNonEnumerableProperty$4(CollectionPrototype, ITERATOR$1, ArrayValues);
1909
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1910
+ createNonEnumerableProperty$4(CollectionPrototype, ITERATOR, ArrayValues);
1911
1911
  } catch (error) {
1912
- CollectionPrototype[ITERATOR$1] = ArrayValues;
1912
+ CollectionPrototype[ITERATOR] = ArrayValues;
1913
1913
  }
1914
1914
  setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
1915
1915
  if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
@@ -1924,7 +1924,7 @@ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1924
1924
  };
1925
1925
 
1926
1926
  for (var COLLECTION_NAME in DOMIterables) {
1927
- handlePrototype(global$6[COLLECTION_NAME] && global$6[COLLECTION_NAME].prototype, COLLECTION_NAME);
1927
+ handlePrototype(global$5[COLLECTION_NAME] && global$5[COLLECTION_NAME].prototype, COLLECTION_NAME);
1928
1928
  }
1929
1929
 
1930
1930
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
@@ -2002,7 +2002,7 @@ var LayerActionOrigin;
2002
2002
  LayerActionOrigin["ReactMapViewParseLayer"] = "ReactMapViewParseLayer";
2003
2003
  LayerActionOrigin["updateLayerInformationListener"] = "updateLayerInformationListener";
2004
2004
  LayerActionOrigin["toggleAutoUpdateListener"] = "toggleAutoUpdateListener";
2005
- LayerActionOrigin["unregisterMapSaga"] = "unregisterMapSaga";
2005
+ LayerActionOrigin["unregisterMapListener"] = "unregisterMapListener";
2006
2006
  })(LayerActionOrigin || (LayerActionOrigin = {}));
2007
2007
 
2008
2008
  var types$5 = /*#__PURE__*/Object.freeze({
@@ -2029,7 +2029,7 @@ const createMap = ({
2029
2029
  right: 19000000,
2030
2030
  top: 19000000
2031
2031
  },
2032
- srs: _srs = 'EPSG:3857',
2032
+ srs: _srs = PROJECTION.EPSG_3857.value,
2033
2033
  baseLayers: _baseLayers = [],
2034
2034
  overLayers: _overLayers = [],
2035
2035
  mapLayers: _mapLayers = [],
@@ -3588,7 +3588,7 @@ var deletePropertyOrThrow$1 = function (O, P) {
3588
3588
  if (!delete O[P]) throw new $TypeError$2('Cannot delete property ' + tryToString$1(P) + ' of ' + tryToString$1(O));
3589
3589
  };
3590
3590
 
3591
- var $$5 = _export;
3591
+ var $$4 = _export;
3592
3592
  var toObject = toObject$6;
3593
3593
  var lengthOfArrayLike = lengthOfArrayLike$4;
3594
3594
  var setArrayLength = arraySetLength;
@@ -3608,11 +3608,11 @@ var properErrorOnNonWritableLength = function () {
3608
3608
  }
3609
3609
  };
3610
3610
 
3611
- var FORCED$2 = INCORRECT_RESULT || !properErrorOnNonWritableLength();
3611
+ var FORCED$1 = INCORRECT_RESULT || !properErrorOnNonWritableLength();
3612
3612
 
3613
3613
  // `Array.prototype.unshift` method
3614
3614
  // https://tc39.es/ecma262/#sec-array.prototype.unshift
3615
- $$5({ target: 'Array', proto: true, arity: 1, forced: FORCED$2 }, {
3615
+ $$4({ target: 'Array', proto: true, arity: 1, forced: FORCED$1 }, {
3616
3616
  // eslint-disable-next-line no-unused-vars -- required for `.length`
3617
3617
  unshift: function unshift(item) {
3618
3618
  var O = toObject(this);
@@ -6120,8 +6120,9 @@ const getAnimationList = createSelector(getMapById, getAnimationStartTime, getAn
6120
6120
  * @param {string} mapId mapId: string - Id of the map
6121
6121
  * @returns {object} Returns min and max value of time dimension of autoTimeStep-layer. If no autoTimeStep-layer it returns default start/end time from store.
6122
6122
  */
6123
- const getAnimationRange = createSelector(store => store, getAutoTimeStepLayerId, getAnimationStartTime, getAnimationEndTime, isAnimationLengthAuto, getLayerTimeDimension, (store, autoTimeStepLayerId, startTime, endTime, isAnimationLengthAuto) => {
6124
- const layerTimeDimension = getLayerTimeDimension(store, autoTimeStepLayerId);
6123
+ const getAnimationRange = createSelector(getLayersById, getAutoTimeStepLayerId, getAnimationStartTime, getAnimationEndTime, isAnimationLengthAuto, (layers, autoTimeStepLayerId, startTime, endTime, isAnimationLengthAuto) => {
6124
+ var _a, _b;
6125
+ const layerTimeDimension = autoTimeStepLayerId && ((_b = (_a = layers === null || layers === void 0 ? void 0 : layers[autoTimeStepLayerId]) === null || _a === void 0 ? void 0 : _a.dimensions) === null || _b === void 0 ? void 0 : _b.find(dimension => dimension.name === 'time'));
6125
6126
  const {
6126
6127
  minValue,
6127
6128
  maxValue
@@ -6133,7 +6134,7 @@ const getAnimationRange = createSelector(store => store, getAutoTimeStepLayerId,
6133
6134
  animationStartTime,
6134
6135
  animationEndTime
6135
6136
  };
6136
- });
6137
+ }, selectorMemoizationOptions);
6137
6138
 
6138
6139
  var selectors$2 = /*#__PURE__*/Object.freeze({
6139
6140
  __proto__: null,
@@ -6474,17 +6475,17 @@ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND
6474
6475
  return call$6.apply(apply$2, arguments);
6475
6476
  });
6476
6477
 
6477
- var uncurryThis$9 = functionUncurryThis;
6478
+ var uncurryThis$7 = functionUncurryThis;
6478
6479
 
6479
- var arraySlice$1 = uncurryThis$9([].slice);
6480
+ var arraySlice$1 = uncurryThis$7([].slice);
6480
6481
 
6481
- var uncurryThis$8 = functionUncurryThis;
6482
+ var uncurryThis$6 = functionUncurryThis;
6482
6483
  var isArray = isArray$2;
6483
6484
  var isCallable$5 = isCallable$k;
6484
6485
  var classof$2 = classofRaw$1;
6485
- var toString$7 = toString$9;
6486
+ var toString$5 = toString$7;
6486
6487
 
6487
- var push$1 = uncurryThis$8([].push);
6488
+ var push$1 = uncurryThis$6([].push);
6488
6489
 
6489
6490
  var getJsonReplacerFunction = function (replacer) {
6490
6491
  if (isCallable$5(replacer)) return replacer;
@@ -6494,7 +6495,7 @@ var getJsonReplacerFunction = function (replacer) {
6494
6495
  for (var i = 0; i < rawLength; i++) {
6495
6496
  var element = replacer[i];
6496
6497
  if (typeof element == 'string') push$1(keys, element);
6497
- else if (typeof element == 'number' || classof$2(element) === 'Number' || classof$2(element) === 'String') push$1(keys, toString$7(element));
6498
+ else if (typeof element == 'number' || classof$2(element) === 'Number' || classof$2(element) === 'String') push$1(keys, toString$5(element));
6498
6499
  }
6499
6500
  var keysLength = keys.length;
6500
6501
  var root = true;
@@ -6508,12 +6509,12 @@ var getJsonReplacerFunction = function (replacer) {
6508
6509
  };
6509
6510
  };
6510
6511
 
6511
- var $$4 = _export;
6512
+ var $$3 = _export;
6512
6513
  var getBuiltIn$2 = getBuiltIn$6;
6513
6514
  var apply$1 = functionApply;
6514
6515
  var call$5 = functionCall;
6515
- var uncurryThis$7 = functionUncurryThis;
6516
- var fails$8 = fails$n;
6516
+ var uncurryThis$5 = functionUncurryThis;
6517
+ var fails$7 = fails$m;
6517
6518
  var isCallable$4 = isCallable$k;
6518
6519
  var isSymbol = isSymbol$3;
6519
6520
  var arraySlice = arraySlice$1;
@@ -6522,17 +6523,17 @@ var NATIVE_SYMBOL = symbolConstructorDetection;
6522
6523
 
6523
6524
  var $String = String;
6524
6525
  var $stringify = getBuiltIn$2('JSON', 'stringify');
6525
- var exec$3 = uncurryThis$7(/./.exec);
6526
- var charAt$3 = uncurryThis$7(''.charAt);
6527
- var charCodeAt$1 = uncurryThis$7(''.charCodeAt);
6528
- var replace$3 = uncurryThis$7(''.replace);
6529
- var numberToString = uncurryThis$7(1.0.toString);
6526
+ var exec$2 = uncurryThis$5(/./.exec);
6527
+ var charAt$3 = uncurryThis$5(''.charAt);
6528
+ var charCodeAt$1 = uncurryThis$5(''.charCodeAt);
6529
+ var replace$2 = uncurryThis$5(''.replace);
6530
+ var numberToString = uncurryThis$5(1.0.toString);
6530
6531
 
6531
6532
  var tester = /[\uD800-\uDFFF]/g;
6532
6533
  var low = /^[\uD800-\uDBFF]$/;
6533
6534
  var hi = /^[\uDC00-\uDFFF]$/;
6534
6535
 
6535
- var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$8(function () {
6536
+ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$7(function () {
6536
6537
  var symbol = getBuiltIn$2('Symbol')('stringify detection');
6537
6538
  // MS Edge converts symbol values to JSON as {}
6538
6539
  return $stringify([symbol]) !== '[null]'
@@ -6543,7 +6544,7 @@ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$8(function () {
6543
6544
  });
6544
6545
 
6545
6546
  // https://github.com/tc39/proposal-well-formed-stringify
6546
- var ILL_FORMED_UNICODE = fails$8(function () {
6547
+ var ILL_FORMED_UNICODE = fails$7(function () {
6547
6548
  return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
6548
6549
  || $stringify('\uDEAD') !== '"\\udead"';
6549
6550
  });
@@ -6563,7 +6564,7 @@ var stringifyWithSymbolsFix = function (it, replacer) {
6563
6564
  var fixIllFormed = function (match, offset, string) {
6564
6565
  var prev = charAt$3(string, offset - 1);
6565
6566
  var next = charAt$3(string, offset + 1);
6566
- if ((exec$3(low, match) && !exec$3(hi, next)) || (exec$3(hi, match) && !exec$3(low, prev))) {
6567
+ if ((exec$2(low, match) && !exec$2(hi, next)) || (exec$2(hi, match) && !exec$2(low, prev))) {
6567
6568
  return '\\u' + numberToString(charCodeAt$1(match, 0), 16);
6568
6569
  } return match;
6569
6570
  };
@@ -6571,12 +6572,12 @@ var fixIllFormed = function (match, offset, string) {
6571
6572
  if ($stringify) {
6572
6573
  // `JSON.stringify` method
6573
6574
  // https://tc39.es/ecma262/#sec-json.stringify
6574
- $$4({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
6575
+ $$3({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
6575
6576
  // eslint-disable-next-line no-unused-vars -- required for `.length`
6576
6577
  stringify: function stringify(it, replacer, space) {
6577
6578
  var args = arraySlice(arguments);
6578
6579
  var result = apply$1(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
6579
- return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$3(result, tester, fixIllFormed) : result;
6580
+ return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$2(result, tester, fixIllFormed) : result;
6580
6581
  }
6581
6582
  });
6582
6583
  }
@@ -6803,149 +6804,500 @@ var storeTestSettings = /*#__PURE__*/Object.freeze({
6803
6804
  styleListForRADNLOPERR25PCPRRL3KNMILayer: styleListForRADNLOPERR25PCPRRL3KNMILayer
6804
6805
  });
6805
6806
 
6806
- var defineProperty = objectDefineProperty.f;
6807
-
6808
- var proxyAccessor$1 = function (Target, Source, key) {
6809
- key in Target || defineProperty(Target, key, {
6810
- configurable: true,
6811
- get: function () { return Source[key]; },
6812
- set: function (it) { Source[key] = it; }
6813
- });
6814
- };
6815
-
6816
- var isCallable$3 = isCallable$k;
6817
- var isObject$1 = isObject$b;
6818
- var setPrototypeOf$1 = objectSetPrototypeOf;
6819
-
6820
- // makes subclassing work correct for wrapped built-ins
6821
- var inheritIfRequired$1 = function ($this, dummy, Wrapper) {
6822
- var NewTarget, NewTargetPrototype;
6823
- if (
6824
- // it can work only with native `setPrototypeOf`
6825
- setPrototypeOf$1 &&
6826
- // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
6827
- isCallable$3(NewTarget = dummy.constructor) &&
6828
- NewTarget !== Wrapper &&
6829
- isObject$1(NewTargetPrototype = NewTarget.prototype) &&
6830
- NewTargetPrototype !== Wrapper.prototype
6831
- ) setPrototypeOf$1($this, NewTargetPrototype);
6832
- return $this;
6833
- };
6807
+ function* setStepBackwardOrForwardSaga({
6808
+ payload
6809
+ }) {
6810
+ const {
6811
+ mapId,
6812
+ isForwardStep
6813
+ } = payload;
6814
+ const timeStep = yield select(getMapTimeStep, mapId);
6815
+ const currentTime = yield select(getSelectedTime, mapId);
6816
+ const [dataStartTime, dataEndTime] = yield select(getDataLimitsFromLayers, mapId);
6817
+ if (dateUtils.isValid(currentTime)) {
6818
+ const makeForwardStep = () => {
6819
+ const nextTime = currentTime + timeStep;
6820
+ const roundedTime = roundWithTimeStep(nextTime, timeStep, 'ceil');
6821
+ const newTime = Math.min(roundedTime, dataEndTime || roundedTime);
6822
+ return dateUtils.fromUnix(newTime).toISOString();
6823
+ };
6824
+ const makeBackwardStep = () => {
6825
+ const nextTime = currentTime - timeStep;
6826
+ const roundedTime = roundWithTimeStep(nextTime, timeStep, 'floor');
6827
+ const newTime = Math.max(roundedTime, dataStartTime || roundedTime);
6828
+ return dateUtils.fromUnix(newTime).toISOString();
6829
+ };
6830
+ const selectedTimeString = isForwardStep ? makeForwardStep() : makeBackwardStep();
6831
+ const isMapAnimating = yield select(isAnimating, mapId);
6832
+ if (isMapAnimating) {
6833
+ yield put(mapActions.mapStopAnimation({
6834
+ mapId,
6835
+ origin: MapActionOrigin.map
6836
+ }));
6837
+ }
6838
+ const isAutoUpdateOn = yield select(isAutoUpdating, mapId);
6839
+ if (isAutoUpdateOn) {
6840
+ yield put(mapActions.toggleAutoUpdate({
6841
+ mapId,
6842
+ shouldAutoUpdate: false
6843
+ }));
6844
+ }
6845
+ yield put(genericActions.setTime({
6846
+ origin: '',
6847
+ sourceId: mapId,
6848
+ value: handleDateUtilsISOString(selectedTimeString)
6849
+ }));
6850
+ }
6851
+ }
6852
+ function* rootSaga$2() {
6853
+ // resets IWMJSMap state
6854
+ yield takeEvery(mapActions.setStepBackwardOrForward.type, setStepBackwardOrForwardSaga);
6855
+ }
6834
6856
 
6835
- var toString$6 = toString$9;
6857
+ function* fetchServiceSaga(service) {
6858
+ try {
6859
+ const layers = yield call$e(getCapabilities.getLayersFlattenedFromService, service.serviceUrl);
6860
+ yield put(serviceActions.serviceSetLayers(Object.assign(Object.assign({}, service), {
6861
+ layers
6862
+ })));
6863
+ } catch (error) {
6864
+ // not implemented yet
6865
+ }
6866
+ }
6867
+ function* fetchInitialServicesSaga({
6868
+ payload
6869
+ }) {
6870
+ const {
6871
+ services
6872
+ } = payload;
6873
+ yield all(services.map(_a => {
6874
+ var {
6875
+ url
6876
+ } = _a,
6877
+ service = __rest(_a, ["url"]);
6878
+ return call$e(fetchServiceSaga, Object.assign(Object.assign({}, service), {
6879
+ serviceUrl: url
6880
+ }));
6881
+ }));
6882
+ }
6883
+ function* rootSaga$1() {
6884
+ yield takeEvery(serviceActions.fetchInitialServices, fetchInitialServicesSaga);
6885
+ }
6836
6886
 
6837
- var normalizeStringArgument$1 = function (argument, $default) {
6838
- return argument === undefined ? arguments.length < 2 ? '' : $default : toString$6(argument);
6887
+ /* A map with all the timerIds and their current step */
6888
+ const stepMap = new Map();
6889
+ /* A map with a list of timers and their dwell */
6890
+ const timerDwellMap = new Map();
6891
+ /**
6892
+ * Returns the next step for given timerId.
6893
+ * @param timerId The timer id
6894
+ * @param numberOfStepsInAnimation Animation length in steps
6895
+ * @param numStepsToGoForward Amount of steps to go forwards, defaults to 1. Can be positive and negative
6896
+ * @returns
6897
+ */
6898
+ const getNextStep = (timerId, numberOfStepsInAnimation, numStepsToGoForward = 1) => {
6899
+ const currentStep = getCurrentStep(timerId);
6900
+ const nextStep = currentStep + numStepsToGoForward;
6901
+ const nextStepClipped = (nextStep % numberOfStepsInAnimation + numberOfStepsInAnimation) % numberOfStepsInAnimation;
6902
+ return nextStepClipped;
6839
6903
  };
6840
-
6841
- var isObject = isObject$b;
6842
- var createNonEnumerableProperty$3 = createNonEnumerableProperty$8;
6843
-
6844
- // `InstallErrorCause` abstract operation
6845
- // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
6846
- var installErrorCause$1 = function (O, options) {
6847
- if (isObject(options) && 'cause' in options) {
6848
- createNonEnumerableProperty$3(O, 'cause', options.cause);
6904
+ /**
6905
+ * Handles dwell at the end of the animation loop sequence. The number of steps to wait till proceed can be set by the dwell parameter.
6906
+ * @param timerId The timer id
6907
+ * @param numberOfStepsInAnimation Number of steps in the animation
6908
+ * @param dwell The number of steps to wait at the end of the animation sequence before to continue
6909
+ * @returns
6910
+ */
6911
+ const handleTimerDwell = (timerId, numberOfStepsInAnimation, dwell = 8) => {
6912
+ if (dwell > 0) {
6913
+ const currentStep = getCurrentStep(timerId);
6914
+ // Reset the dwell if we are not at the last animation step
6915
+ if (currentStep < numberOfStepsInAnimation - 1) {
6916
+ timerDwellMap.set(timerId, dwell);
6917
+ return false;
6918
+ }
6919
+ // We are at the last animation step, check the dwell
6920
+ const timerDwell = timerDwellMap.has(timerId) && timerDwellMap.get(timerId) || 0;
6921
+ if (currentStep === numberOfStepsInAnimation - 1 && timerDwell > 0) {
6922
+ timerDwellMap.set(timerId, timerDwell - 1);
6923
+ return true;
6924
+ }
6849
6925
  }
6926
+ return false;
6850
6927
  };
6851
-
6852
- var uncurryThis$6 = functionUncurryThis;
6853
-
6854
- var $Error = Error;
6855
- var replace$2 = uncurryThis$6(''.replace);
6856
-
6857
- var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
6858
- // eslint-disable-next-line redos/no-vulnerable -- safe
6859
- var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
6860
- var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
6861
-
6862
- var errorStackClear = function (stack, dropEntries) {
6863
- if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
6864
- while (dropEntries--) stack = replace$2(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
6865
- } return stack;
6928
+ /**
6929
+ * Set step for the timerId
6930
+ * @param timerId
6931
+ * @param timerStep
6932
+ */
6933
+ const setStep = (timerId, timerStep) => {
6934
+ stepMap.set(timerId, timerStep);
6866
6935
  };
6867
-
6868
- var fails$7 = fails$n;
6869
- var createPropertyDescriptor = createPropertyDescriptor$4;
6870
-
6871
- var errorStackInstallable = !fails$7(function () {
6872
- var error = new Error('a');
6873
- if (!('stack' in error)) return true;
6874
- // eslint-disable-next-line es/no-object-defineproperty -- safe
6875
- Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
6876
- return error.stack !== 7;
6877
- });
6878
-
6879
- var createNonEnumerableProperty$2 = createNonEnumerableProperty$8;
6880
- var clearErrorStack = errorStackClear;
6881
- var ERROR_STACK_INSTALLABLE = errorStackInstallable;
6882
-
6883
- // non-standard V8
6884
- var captureStackTrace = Error.captureStackTrace;
6885
-
6886
- var errorStackInstall = function (error, C, stack, dropEntries) {
6887
- if (ERROR_STACK_INSTALLABLE) {
6888
- if (captureStackTrace) captureStackTrace(error, C);
6889
- else createNonEnumerableProperty$2(error, 'stack', clearErrorStack(stack, dropEntries));
6890
- }
6936
+ /**
6937
+ * Gets the current step for the timer
6938
+ * @param timerId
6939
+ * @returns
6940
+ */
6941
+ const getCurrentStep = timerId => {
6942
+ return stepMap.get(timerId) || 0;
6943
+ };
6944
+ const MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH = 2;
6945
+ const MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES = 8;
6946
+ /**
6947
+ * This prefetches all images connected to the same sync group as provided timerId
6948
+ * @param timerId The timerId
6949
+ * @param animationListValues List of animation steps in isostring to animate
6950
+ * @param targets List of targets to check
6951
+ * @returns True if all maps are ready to go forward, false if the map has no data to display yet.
6952
+ */
6953
+ const prefetchAnimationTargetsForMetronome = (timerId, animationListValues, targets) => {
6954
+ let timerShouldStepForward = true;
6955
+ // The following code prefetches/buffers for all maps in the group
6956
+ for (let numPrefetch = 0; numPrefetch < MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH; numPrefetch += 1) {
6957
+ const nextStep = getNextStep(timerId, animationListValues.length, numPrefetch + 1);
6958
+ const nextTimeValueStepToCheck = animationListValues[nextStep];
6959
+ for (const target of targets) {
6960
+ const targetMapId = target.targetId;
6961
+ const wmMap = getWMJSMapById(targetMapId);
6962
+ if (!wmMap) {
6963
+ return true; // Map was not registered so there is nothing to prefetch, do not block going forward
6964
+ }
6965
+ const layersImageUrls = getWMSRequests(wmMap, [{
6966
+ name: 'time',
6967
+ currentValue: nextTimeValueStepToCheck
6968
+ }]);
6969
+ for (const layersImageUrl of layersImageUrls) {
6970
+ const image = wmMap.getMapImageStore.getImage(layersImageUrl.url);
6971
+ if (!image.isLoaded()) {
6972
+ if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
6973
+ image.load();
6974
+ }
6975
+ if (numPrefetch === 0) {
6976
+ const altImage = wmMap.getAlternativeImage(layersImageUrl.url, wmMap.getBBOX(), true);
6977
+ // No alternative image available yet, so skipping animation.
6978
+ if (altImage.length === 0) {
6979
+ // This is useful to indicate that the map is loading and has nothing yet to display.
6980
+ // console.warn('No data available: Not stepping forward');
6981
+ timerShouldStepForward = false;
6982
+ }
6983
+ }
6984
+ } else if (image.isStale()) {
6985
+ if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
6986
+ image.forceReload(true);
6987
+ }
6988
+ }
6989
+ }
6990
+ }
6991
+ }
6992
+ return timerShouldStepForward;
6891
6993
  };
6892
6994
 
6893
- var getBuiltIn$1 = getBuiltIn$6;
6894
- var hasOwn = hasOwnProperty_1;
6895
- var createNonEnumerableProperty$1 = createNonEnumerableProperty$8;
6896
- var isPrototypeOf = objectIsPrototypeOf;
6897
- var setPrototypeOf = objectSetPrototypeOf;
6898
- var copyConstructorProperties = copyConstructorProperties$2;
6899
- var proxyAccessor = proxyAccessor$1;
6900
- var inheritIfRequired = inheritIfRequired$1;
6901
- var normalizeStringArgument = normalizeStringArgument$1;
6902
- var installErrorCause = installErrorCause$1;
6903
- var installErrorStack = errorStackInstall;
6904
- var DESCRIPTORS = descriptors;
6905
-
6906
- var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
6907
- var STACK_TRACE_LIMIT = 'stackTraceLimit';
6908
- var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
6909
- var path = FULL_NAME.split('.');
6910
- var ERROR_NAME = path[path.length - 1];
6911
- var OriginalError = getBuiltIn$1.apply(null, path);
6995
+ /**
6996
+ * This handler is triggered by the metronome. An array of timerIds is given as argument.
6997
+ * It will update the animation loop of multiple maps and sliders
6998
+ * It will prefetch images for maps
6999
+ * @param timerIds string[] array of timerIds
7000
+ * @param listenerApi ListenerEffectAPI<CoreAppStore, Dispatch, unknown> listenerApi as received from listener
7001
+ */
7002
+ const metronomeHandler = (timerIds, listenerApi) => {
7003
+ const targetsWithUpdateValue = [];
7004
+ for (const timerId of timerIds) {
7005
+ const animationListValuesNameAndValue = getAnimationList(listenerApi.getState(), timerId);
7006
+ const animationListValues = animationListValuesNameAndValue.map(nameAndValue => nameAndValue.value);
7007
+ const targets = getTargets(listenerApi.getState(), {
7008
+ sourceId: timerId,
7009
+ origin: timerId
7010
+ }, SYNCGROUPS_TYPE_SETTIME);
7011
+ if (targets.length === 0) {
7012
+ // When there are no targets, default to one
7013
+ targets.push({
7014
+ targetId: timerId,
7015
+ value: ''
7016
+ });
7017
+ }
7018
+ const timerIsInDwell = handleTimerDwell(timerId, animationListValues.length);
7019
+ const timerShouldStepForward = prefetchAnimationTargetsForMetronome(timerId, animationListValues, targets) && !timerIsInDwell;
7020
+ // Determine the next step
7021
+ const timerStep = timerShouldStepForward ? getNextStep(timerId, animationListValues.length) : getCurrentStep(timerId);
7022
+ setStep(timerId, timerStep);
7023
+ const updatedValue = animationListValues[timerStep];
7024
+ targetsWithUpdateValue.push(...targets.map(target => {
7025
+ return Object.assign(Object.assign({}, target), {
7026
+ value: updatedValue
7027
+ });
7028
+ }));
7029
+ const speedDelay = getMapAnimationDelay(listenerApi.getState(), timerId);
7030
+ const speed = 1000 / (speedDelay || 1);
7031
+ metronome.setSpeed(timerId, speed);
7032
+ }
7033
+ // Update all targets of all sync groups in one action.
7034
+ if (targetsWithUpdateValue.length > 0) {
7035
+ listenerApi.dispatch(setTimeSync(null, targetsWithUpdateValue, ['metronomesaga']));
7036
+ }
7037
+ };
7038
+ const metronomeListener = createListenerMiddleware();
7039
+ metronomeListener.startListening({
7040
+ actionCreator: mapActions.mapStartAnimation,
7041
+ effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
7042
+ // register handler with access to listenerApi
7043
+ metronome.handleTimerTicks = timerIds => {
7044
+ metronomeHandler(timerIds, listenerApi);
7045
+ };
7046
+ })
7047
+ });
6912
7048
 
6913
- if (!OriginalError) return;
7049
+ /* *
7050
+ * Licensed under the Apache License, Version 2.0 (the "License");
7051
+ * you may not use this file except in compliance with the License.
7052
+ * You may obtain a copy of the License at
7053
+ *
7054
+ * http://www.apache.org/licenses/LICENSE-2.0
7055
+ *
7056
+ * Unless required by applicable law or agreed to in writing, software
7057
+ * distributed under the License is distributed on an "AS IS" BASIS,
7058
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7059
+ * See the License for the specific language governing permissions and
7060
+ * limitations under the License.
7061
+ *
7062
+ * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
7063
+ * Copyright 2024 - Finnish Meteorological Institute (FMI)
7064
+ * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
7065
+ * */
7066
+ const layersListener = createListenerMiddleware();
7067
+ layersListener.startListening({
7068
+ actionCreator: layerActions.showLayerInfo,
7069
+ effect: ({
7070
+ payload
7071
+ }, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
7072
+ const {
7073
+ mapId,
7074
+ source
7075
+ } = payload;
7076
+ const currentActiveMapId = getDialogMapId(listenerApi.getState(), DialogTypes.LayerInfo);
7077
+ const isOpenInStore = getisDialogOpen(listenerApi.getState(), DialogTypes.LayerInfo);
7078
+ if (currentActiveMapId !== mapId ? true : !isOpenInStore) {
7079
+ listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
7080
+ type: DialogTypes.LayerInfo,
7081
+ mapId,
7082
+ setOpen: true,
7083
+ source
7084
+ }));
7085
+ }
7086
+ })
7087
+ });
7088
+ layersListener.startListening({
7089
+ actionCreator: uiActions.setToggleOpenDialog,
7090
+ effect: ({
7091
+ payload
7092
+ }, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
7093
+ const {
7094
+ setOpen,
7095
+ type
7096
+ } = payload;
7097
+ // close LayerInfo if open and LayerManager is closed
7098
+ if (type === DialogTypes.LayerManager && !setOpen) {
7099
+ const isOpenInStore = getisDialogOpen(listenerApi.getState(), DialogTypes.LayerInfo);
7100
+ if (isOpenInStore) {
7101
+ listenerApi.dispatch(layerActions.hideLayerInfo());
7102
+ }
7103
+ }
7104
+ })
7105
+ });
6914
7106
 
6915
- var OriginalErrorPrototype = OriginalError.prototype;
7107
+ const mapUiListener = createListenerMiddleware();
7108
+ mapUiListener.startListening({
7109
+ actionCreator: mapActions.registerMap,
7110
+ effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
7111
+ const fields = getAllMapIds(listenerApi.getState());
7112
+ if (fields.length === 1) {
7113
+ const source = getDialogSource(listenerApi.getState(), 'legend');
7114
+ listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
7115
+ type: 'legend',
7116
+ mapId: fields[0],
7117
+ setOpen: true,
7118
+ source
7119
+ }));
7120
+ }
7121
+ })
7122
+ });
7123
+ mapUiListener.startListening({
7124
+ actionCreator: mapActions.unregisterMap,
7125
+ effect: ({
7126
+ payload
7127
+ }, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
7128
+ const fields = getAllMapIds(listenerApi.getState());
7129
+ const activeLegendUI = getDialogDetailsByType(listenerApi.getState(), 'legend');
7130
+ if (fields.length && activeLegendUI && !fields.includes(activeLegendUI.activeMapId)) {
7131
+ listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
7132
+ type: 'legend',
7133
+ mapId: fields[0],
7134
+ setOpen: activeLegendUI.isOpen
7135
+ }));
7136
+ } else if (!fields.length) {
7137
+ // if no more maps, we hide the legend
7138
+ listenerApi.dispatch(uiActions.setToggleOpenDialog({
7139
+ type: 'legend',
7140
+ setOpen: false
7141
+ }));
7142
+ }
7143
+ // close any remaining windows with map assigned to it
7144
+ const remainingDialogsConnectedToMap = getUiDialogsByActiveMapId(listenerApi.getState(), payload.mapId);
7145
+ if (remainingDialogsConnectedToMap.length) {
7146
+ remainingDialogsConnectedToMap.forEach(dialog => {
7147
+ if (dialog.isOpen) {
7148
+ listenerApi.dispatch(uiActions.setToggleOpenDialog({
7149
+ type: dialog.type,
7150
+ setOpen: false
7151
+ }));
7152
+ }
7153
+ });
7154
+ }
7155
+ })
7156
+ });
6916
7157
 
6917
- // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
6918
- if (hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
7158
+ var defineProperty = objectDefineProperty.f;
6919
7159
 
6920
- if (!FORCED) return OriginalError;
7160
+ var proxyAccessor$1 = function (Target, Source, key) {
7161
+ key in Target || defineProperty(Target, key, {
7162
+ configurable: true,
7163
+ get: function () { return Source[key]; },
7164
+ set: function (it) { Source[key] = it; }
7165
+ });
7166
+ };
6921
7167
 
6922
- var BaseError = getBuiltIn$1('Error');
7168
+ var isCallable$3 = isCallable$k;
7169
+ var isObject$1 = isObject$b;
7170
+ var setPrototypeOf$1 = objectSetPrototypeOf;
6923
7171
 
6924
- var WrappedError = wrapper(function (a, b) {
6925
- var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
6926
- var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
6927
- if (message !== undefined) createNonEnumerableProperty$1(result, 'message', message);
6928
- installErrorStack(result, WrappedError, result.stack, 2);
6929
- if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
6930
- if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
6931
- return result;
6932
- });
7172
+ // makes subclassing work correct for wrapped built-ins
7173
+ var inheritIfRequired$1 = function ($this, dummy, Wrapper) {
7174
+ var NewTarget, NewTargetPrototype;
7175
+ if (
7176
+ // it can work only with native `setPrototypeOf`
7177
+ setPrototypeOf$1 &&
7178
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
7179
+ isCallable$3(NewTarget = dummy.constructor) &&
7180
+ NewTarget !== Wrapper &&
7181
+ isObject$1(NewTargetPrototype = NewTarget.prototype) &&
7182
+ NewTargetPrototype !== Wrapper.prototype
7183
+ ) setPrototypeOf$1($this, NewTargetPrototype);
7184
+ return $this;
7185
+ };
6933
7186
 
6934
- WrappedError.prototype = OriginalErrorPrototype;
7187
+ var toString$4 = toString$7;
6935
7188
 
6936
- if (ERROR_NAME !== 'Error') {
6937
- if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);
6938
- else copyConstructorProperties(WrappedError, BaseError, { name: true });
6939
- } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {
6940
- proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
6941
- proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
6942
- }
7189
+ var normalizeStringArgument$1 = function (argument, $default) {
7190
+ return argument === undefined ? arguments.length < 2 ? '' : $default : toString$4(argument);
7191
+ };
6943
7192
 
6944
- copyConstructorProperties(WrappedError, OriginalError);
7193
+ var isObject = isObject$b;
7194
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$8;
6945
7195
 
6946
- try {
6947
- // Safari 13- bug: WebAssembly errors does not have a proper `.name`
6948
- if (OriginalErrorPrototype.name !== ERROR_NAME) {
7196
+ // `InstallErrorCause` abstract operation
7197
+ // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
7198
+ var installErrorCause$1 = function (O, options) {
7199
+ if (isObject(options) && 'cause' in options) {
7200
+ createNonEnumerableProperty$3(O, 'cause', options.cause);
7201
+ }
7202
+ };
7203
+
7204
+ var uncurryThis$4 = functionUncurryThis;
7205
+
7206
+ var $Error = Error;
7207
+ var replace$1 = uncurryThis$4(''.replace);
7208
+
7209
+ var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
7210
+ // eslint-disable-next-line redos/no-vulnerable -- safe
7211
+ var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
7212
+ var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
7213
+
7214
+ var errorStackClear = function (stack, dropEntries) {
7215
+ if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
7216
+ while (dropEntries--) stack = replace$1(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
7217
+ } return stack;
7218
+ };
7219
+
7220
+ var fails$6 = fails$m;
7221
+ var createPropertyDescriptor = createPropertyDescriptor$4;
7222
+
7223
+ var errorStackInstallable = !fails$6(function () {
7224
+ var error = new Error('a');
7225
+ if (!('stack' in error)) return true;
7226
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
7227
+ Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
7228
+ return error.stack !== 7;
7229
+ });
7230
+
7231
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$8;
7232
+ var clearErrorStack = errorStackClear;
7233
+ var ERROR_STACK_INSTALLABLE = errorStackInstallable;
7234
+
7235
+ // non-standard V8
7236
+ var captureStackTrace = Error.captureStackTrace;
7237
+
7238
+ var errorStackInstall = function (error, C, stack, dropEntries) {
7239
+ if (ERROR_STACK_INSTALLABLE) {
7240
+ if (captureStackTrace) captureStackTrace(error, C);
7241
+ else createNonEnumerableProperty$2(error, 'stack', clearErrorStack(stack, dropEntries));
7242
+ }
7243
+ };
7244
+
7245
+ var getBuiltIn$1 = getBuiltIn$6;
7246
+ var hasOwn = hasOwnProperty_1;
7247
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$8;
7248
+ var isPrototypeOf = objectIsPrototypeOf;
7249
+ var setPrototypeOf = objectSetPrototypeOf;
7250
+ var copyConstructorProperties = copyConstructorProperties$2;
7251
+ var proxyAccessor = proxyAccessor$1;
7252
+ var inheritIfRequired = inheritIfRequired$1;
7253
+ var normalizeStringArgument = normalizeStringArgument$1;
7254
+ var installErrorCause = installErrorCause$1;
7255
+ var installErrorStack = errorStackInstall;
7256
+ var DESCRIPTORS = descriptors;
7257
+
7258
+ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
7259
+ var STACK_TRACE_LIMIT = 'stackTraceLimit';
7260
+ var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
7261
+ var path = FULL_NAME.split('.');
7262
+ var ERROR_NAME = path[path.length - 1];
7263
+ var OriginalError = getBuiltIn$1.apply(null, path);
7264
+
7265
+ if (!OriginalError) return;
7266
+
7267
+ var OriginalErrorPrototype = OriginalError.prototype;
7268
+
7269
+ // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
7270
+ if (hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
7271
+
7272
+ if (!FORCED) return OriginalError;
7273
+
7274
+ var BaseError = getBuiltIn$1('Error');
7275
+
7276
+ var WrappedError = wrapper(function (a, b) {
7277
+ var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
7278
+ var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
7279
+ if (message !== undefined) createNonEnumerableProperty$1(result, 'message', message);
7280
+ installErrorStack(result, WrappedError, result.stack, 2);
7281
+ if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
7282
+ if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
7283
+ return result;
7284
+ });
7285
+
7286
+ WrappedError.prototype = OriginalErrorPrototype;
7287
+
7288
+ if (ERROR_NAME !== 'Error') {
7289
+ if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);
7290
+ else copyConstructorProperties(WrappedError, BaseError, { name: true });
7291
+ } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {
7292
+ proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
7293
+ proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
7294
+ }
7295
+
7296
+ copyConstructorProperties(WrappedError, OriginalError);
7297
+
7298
+ try {
7299
+ // Safari 13- bug: WebAssembly errors does not have a proper `.name`
7300
+ if (OriginalErrorPrototype.name !== ERROR_NAME) {
6949
7301
  createNonEnumerableProperty$1(OriginalErrorPrototype, 'name', ERROR_NAME);
6950
7302
  }
6951
7303
  OriginalErrorPrototype.constructor = WrappedError;
@@ -6955,28 +7307,28 @@ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_A
6955
7307
  };
6956
7308
 
6957
7309
  /* eslint-disable no-unused-vars -- required for functions `.length` */
6958
- var $$3 = _export;
6959
- var global$5 = global$h;
7310
+ var $$2 = _export;
7311
+ var global$4 = global$g;
6960
7312
  var apply = functionApply;
6961
7313
  var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
6962
7314
 
6963
7315
  var WEB_ASSEMBLY = 'WebAssembly';
6964
- var WebAssembly = global$5[WEB_ASSEMBLY];
7316
+ var WebAssembly = global$4[WEB_ASSEMBLY];
6965
7317
 
6966
7318
  // eslint-disable-next-line es/no-error-cause -- feature detection
6967
- var FORCED$1 = new Error('e', { cause: 7 }).cause !== 7;
7319
+ var FORCED = new Error('e', { cause: 7 }).cause !== 7;
6968
7320
 
6969
7321
  var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
6970
7322
  var O = {};
6971
- O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED$1);
6972
- $$3({ global: true, constructor: true, arity: 1, forced: FORCED$1 }, O);
7323
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
7324
+ $$2({ global: true, constructor: true, arity: 1, forced: FORCED }, O);
6973
7325
  };
6974
7326
 
6975
7327
  var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
6976
7328
  if (WebAssembly && WebAssembly[ERROR_NAME]) {
6977
7329
  var O = {};
6978
- O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED$1);
6979
- $$3({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED$1 }, O);
7330
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);
7331
+ $$2({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);
6980
7332
  }
6981
7333
  };
6982
7334
 
@@ -7012,73 +7364,6 @@ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
7012
7364
  return function RuntimeError(message) { return apply(init, this, arguments); };
7013
7365
  });
7014
7366
 
7015
- // a string of all valid unicode whitespaces
7016
- var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
7017
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
7018
-
7019
- var uncurryThis$5 = functionUncurryThis;
7020
- var requireObjectCoercible$2 = requireObjectCoercible$7;
7021
- var toString$5 = toString$9;
7022
- var whitespaces$1 = whitespaces$2;
7023
-
7024
- var replace$1 = uncurryThis$5(''.replace);
7025
- var ltrim = RegExp('^[' + whitespaces$1 + ']+');
7026
- var rtrim = RegExp('(^|[^' + whitespaces$1 + '])[' + whitespaces$1 + ']+$');
7027
-
7028
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
7029
- var createMethod$1 = function (TYPE) {
7030
- return function ($this) {
7031
- var string = toString$5(requireObjectCoercible$2($this));
7032
- if (TYPE & 1) string = replace$1(string, ltrim, '');
7033
- if (TYPE & 2) string = replace$1(string, rtrim, '$1');
7034
- return string;
7035
- };
7036
- };
7037
-
7038
- var stringTrim = {
7039
- // `String.prototype.{ trimLeft, trimStart }` methods
7040
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
7041
- start: createMethod$1(1),
7042
- // `String.prototype.{ trimRight, trimEnd }` methods
7043
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
7044
- end: createMethod$1(2),
7045
- // `String.prototype.trim` method
7046
- // https://tc39.es/ecma262/#sec-string.prototype.trim
7047
- trim: createMethod$1(3)
7048
- };
7049
-
7050
- var global$4 = global$h;
7051
- var fails$6 = fails$n;
7052
- var uncurryThis$4 = functionUncurryThis;
7053
- var toString$4 = toString$9;
7054
- var trim = stringTrim.trim;
7055
- var whitespaces = whitespaces$2;
7056
-
7057
- var $parseInt$1 = global$4.parseInt;
7058
- var Symbol$1 = global$4.Symbol;
7059
- var ITERATOR = Symbol$1 && Symbol$1.iterator;
7060
- var hex = /^[+-]?0x/i;
7061
- var exec$2 = uncurryThis$4(hex.exec);
7062
- var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
7063
- // MS Edge 18- broken with boxed symbols
7064
- || (ITERATOR && !fails$6(function () { $parseInt$1(Object(ITERATOR)); }));
7065
-
7066
- // `parseInt` method
7067
- // https://tc39.es/ecma262/#sec-parseint-string-radix
7068
- var numberParseInt = FORCED ? function parseInt(string, radix) {
7069
- var S = trim(toString$4(string));
7070
- return $parseInt$1(S, (radix >>> 0) || (exec$2(hex, S) ? 16 : 10));
7071
- } : $parseInt$1;
7072
-
7073
- var $$2 = _export;
7074
- var $parseInt = numberParseInt;
7075
-
7076
- // `parseInt` method
7077
- // https://tc39.es/ecma262/#sec-parseint-string-radix
7078
- $$2({ global: true, forced: parseInt !== $parseInt }, {
7079
- parseInt: $parseInt
7080
- });
7081
-
7082
7367
  var anObject$4 = anObject$9;
7083
7368
 
7084
7369
  // `RegExp.prototype.flags` getter implementation
@@ -7097,8 +7382,8 @@ var regexpFlags$1 = function () {
7097
7382
  return result;
7098
7383
  };
7099
7384
 
7100
- var fails$5 = fails$n;
7101
- var global$3 = global$h;
7385
+ var fails$5 = fails$m;
7386
+ var global$3 = global$g;
7102
7387
 
7103
7388
  // babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
7104
7389
  var $RegExp$2 = global$3.RegExp;
@@ -7128,8 +7413,8 @@ var regexpStickyHelpers = {
7128
7413
  UNSUPPORTED_Y: UNSUPPORTED_Y$2
7129
7414
  };
7130
7415
 
7131
- var fails$4 = fails$n;
7132
- var global$2 = global$h;
7416
+ var fails$4 = fails$m;
7417
+ var global$2 = global$g;
7133
7418
 
7134
7419
  // babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
7135
7420
  var $RegExp$1 = global$2.RegExp;
@@ -7139,8 +7424,8 @@ var regexpUnsupportedDotAll = fails$4(function () {
7139
7424
  return !(re.dotAll && re.test('\n') && re.flags === 's');
7140
7425
  });
7141
7426
 
7142
- var fails$3 = fails$n;
7143
- var global$1 = global$h;
7427
+ var fails$3 = fails$m;
7428
+ var global$1 = global$g;
7144
7429
 
7145
7430
  // babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
7146
7431
  var $RegExp = global$1.RegExp;
@@ -7155,7 +7440,7 @@ var regexpUnsupportedNcg = fails$3(function () {
7155
7440
  /* eslint-disable regexp/no-useless-quantifier -- testing */
7156
7441
  var call$4 = functionCall;
7157
7442
  var uncurryThis$3 = functionUncurryThis;
7158
- var toString$3 = toString$9;
7443
+ var toString$3 = toString$7;
7159
7444
  var regexpFlags = regexpFlags$1;
7160
7445
  var stickyHelpers$1 = regexpStickyHelpers;
7161
7446
  var shared = shared$4;
@@ -7283,7 +7568,7 @@ var $ = _export;
7283
7568
  var call$3 = functionCall;
7284
7569
  var isCallable$2 = isCallable$k;
7285
7570
  var anObject$3 = anObject$9;
7286
- var toString$2 = toString$9;
7571
+ var toString$2 = toString$7;
7287
7572
 
7288
7573
  var DELEGATES_TO_EXEC = function () {
7289
7574
  var execCalled = false;
@@ -7317,7 +7602,7 @@ $({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
7317
7602
  var call$2 = functionCall;
7318
7603
  var defineBuiltIn = defineBuiltIn$4;
7319
7604
  var regexpExec$1 = regexpExec$2;
7320
- var fails$2 = fails$n;
7605
+ var fails$2 = fails$m;
7321
7606
  var wellKnownSymbol$1 = wellKnownSymbol$c;
7322
7607
  var createNonEnumerableProperty = createNonEnumerableProperty$8;
7323
7608
 
@@ -7389,7 +7674,7 @@ var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
7389
7674
  };
7390
7675
 
7391
7676
  var uncurryThis$2 = functionUncurryThis;
7392
- var fails$1 = fails$n;
7677
+ var fails$1 = fails$m;
7393
7678
  var isCallable$1 = isCallable$k;
7394
7679
  var classof$1 = classof$4;
7395
7680
  var getBuiltIn = getBuiltIn$6;
@@ -7468,8 +7753,8 @@ var speciesConstructor$1 = function (O, defaultConstructor) {
7468
7753
 
7469
7754
  var uncurryThis$1 = functionUncurryThis;
7470
7755
  var toIntegerOrInfinity = toIntegerOrInfinity$3;
7471
- var toString$1 = toString$9;
7472
- var requireObjectCoercible$1 = requireObjectCoercible$7;
7756
+ var toString$1 = toString$7;
7757
+ var requireObjectCoercible$1 = requireObjectCoercible$6;
7473
7758
 
7474
7759
  var charAt$1 = uncurryThis$1(''.charAt);
7475
7760
  var charCodeAt = uncurryThis$1(''.charCodeAt);
@@ -7537,15 +7822,15 @@ var uncurryThis = functionUncurryThis;
7537
7822
  var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
7538
7823
  var anObject = anObject$9;
7539
7824
  var isNullOrUndefined = isNullOrUndefined$4;
7540
- var requireObjectCoercible = requireObjectCoercible$7;
7825
+ var requireObjectCoercible = requireObjectCoercible$6;
7541
7826
  var speciesConstructor = speciesConstructor$1;
7542
7827
  var advanceStringIndex = advanceStringIndex$1;
7543
7828
  var toLength = toLength$2;
7544
- var toString = toString$9;
7829
+ var toString = toString$7;
7545
7830
  var getMethod = getMethod$2;
7546
7831
  var regExpExec = regexpExecAbstract;
7547
7832
  var stickyHelpers = regexpStickyHelpers;
7548
- var fails = fails$n;
7833
+ var fails = fails$m;
7549
7834
 
7550
7835
  var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
7551
7836
  var MAX_UINT32 = 0xFFFFFFFF;
@@ -7556,739 +7841,103 @@ var stringSlice = uncurryThis(''.slice);
7556
7841
  // Chrome 51 has a buggy "split" implementation when RegExp#exec !== nativeExec
7557
7842
  // Weex JS has frozen built-in prototypes, so use try / catch wrapper
7558
7843
  var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function () {
7559
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
7560
- var re = /(?:)/;
7561
- var originalExec = re.exec;
7562
- re.exec = function () { return originalExec.apply(this, arguments); };
7563
- var result = 'ab'.split(re);
7564
- return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
7565
- });
7566
-
7567
- var BUGGY = 'abbc'.split(/(b)*/)[1] === 'c' ||
7568
- // eslint-disable-next-line regexp/no-empty-group -- required for testing
7569
- 'test'.split(/(?:)/, -1).length !== 4 ||
7570
- 'ab'.split(/(?:ab)*/).length !== 2 ||
7571
- '.'.split(/(.?)(.?)/).length !== 4 ||
7572
- // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
7573
- '.'.split(/()()/).length > 1 ||
7574
- ''.split(/.?/).length;
7575
-
7576
- // @@split logic
7577
- fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
7578
- var internalSplit = '0'.split(undefined, 0).length ? function (separator, limit) {
7579
- return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
7580
- } : nativeSplit;
7581
-
7582
- return [
7583
- // `String.prototype.split` method
7584
- // https://tc39.es/ecma262/#sec-string.prototype.split
7585
- function split(separator, limit) {
7586
- var O = requireObjectCoercible(this);
7587
- var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);
7588
- return splitter
7589
- ? call(splitter, separator, O, limit)
7590
- : call(internalSplit, toString(O), separator, limit);
7591
- },
7592
- // `RegExp.prototype[@@split]` method
7593
- // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
7594
- //
7595
- // NOTE: This cannot be properly polyfilled in engines that don't support
7596
- // the 'y' flag.
7597
- function (string, limit) {
7598
- var rx = anObject(this);
7599
- var S = toString(string);
7600
-
7601
- if (!BUGGY) {
7602
- var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
7603
- if (res.done) return res.value;
7604
- }
7605
-
7606
- var C = speciesConstructor(rx, RegExp);
7607
- var unicodeMatching = rx.unicode;
7608
- var flags = (rx.ignoreCase ? 'i' : '') +
7609
- (rx.multiline ? 'm' : '') +
7610
- (rx.unicode ? 'u' : '') +
7611
- (UNSUPPORTED_Y ? 'g' : 'y');
7612
- // ^(? + rx + ) is needed, in combination with some S slicing, to
7613
- // simulate the 'y' flag.
7614
- var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
7615
- var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
7616
- if (lim === 0) return [];
7617
- if (S.length === 0) return regExpExec(splitter, S) === null ? [S] : [];
7618
- var p = 0;
7619
- var q = 0;
7620
- var A = [];
7621
- while (q < S.length) {
7622
- splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
7623
- var z = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
7624
- var e;
7625
- if (
7626
- z === null ||
7627
- (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
7628
- ) {
7629
- q = advanceStringIndex(S, q, unicodeMatching);
7630
- } else {
7631
- push(A, stringSlice(S, p, q));
7632
- if (A.length === lim) return A;
7633
- for (var i = 1; i <= z.length - 1; i++) {
7634
- push(A, z[i]);
7635
- if (A.length === lim) return A;
7636
- }
7637
- q = p = e;
7638
- }
7639
- }
7640
- push(A, stringSlice(S, p));
7641
- return A;
7642
- }
7643
- ];
7644
- }, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
7645
-
7646
- const isAnimationEndTimeValid = animationEndTime => {
7647
- const hasValidPrefix = animationEndTime.split(/[-+]/)[0] === 'NOW' || animationEndTime.split(/[-+]/)[0] === 'TODAY';
7648
- const durationString = animationEndTime.substring(animationEndTime.indexOf('PT') + 2);
7649
- const hasValidDate = /^(\d+H)?(\d+M)?$/.test(durationString);
7650
- if (hasValidPrefix && hasValidDate) {
7651
- return true;
7652
- }
7653
- const parsedDate = dateUtils.parseISO(animationEndTime);
7654
- return dateUtils.isValid(parsedDate);
7655
- };
7656
- function* handleBaseLayersSaga(mapId, baseLayers) {
7657
- const baseLayer = baseLayers.find(layer => layer.layerType === 'baseLayer');
7658
- const currentAvailableBaseLayers = yield select(getAvailableBaseLayersForMap, mapId);
7659
- // find a availableBaseLayer with the same name, and use that id for the active baselayer
7660
- const activeAvailableBaseLayer = currentAvailableBaseLayers.find(availableBaseLayer => availableBaseLayer.name === baseLayer.name);
7661
- const activeBaseLayerId = activeAvailableBaseLayer ? activeAvailableBaseLayer.id : webmapUtils.generateLayerId();
7662
- // if the baseLayer can't be found in a visible available baseLayer list, add it
7663
- if (!activeAvailableBaseLayer && currentAvailableBaseLayers.length) {
7664
- yield put(layerActions.addAvailableBaseLayers({
7665
- // TODO: remove type casting in https://gitlab.com/opengeoweb/opengeoweb/-/issues/1884
7666
- layers: [Object.assign(Object.assign({}, baseLayer), {
7667
- mapId,
7668
- id: activeBaseLayerId
7669
- })]
7670
- }));
7671
- }
7672
- const baseLayersWithActiveId = baseLayers.map((layer, index) => index === 0 ? Object.assign(Object.assign({}, layer), {
7673
- id: activeBaseLayerId || layer.id
7674
- }) : layer);
7675
- yield put(layerActions.setBaseLayers({
7676
- mapId,
7677
- // TODO: remove type casting in https://gitlab.com/opengeoweb/opengeoweb/-/issues/1884
7678
- layers: baseLayersWithActiveId
7679
- }));
7680
- }
7681
- function* setMapPresetSaga({
7682
- payload
7683
- }) {
7684
- var _a, _b, _c;
7685
- try {
7686
- const {
7687
- mapId,
7688
- initialProps
7689
- } = payload;
7690
- const {
7691
- mapPreset
7692
- } = initialProps;
7693
- if (mapPreset) {
7694
- const {
7695
- layers,
7696
- activeLayerId,
7697
- autoTimeStepLayerId,
7698
- autoUpdateLayerId,
7699
- proj,
7700
- shouldAutoUpdate,
7701
- shouldAnimate,
7702
- animationPayload,
7703
- toggleTimestepAuto,
7704
- showTimeSlider,
7705
- displayMapPin,
7706
- shouldShowZoomControls,
7707
- shouldShowLegend,
7708
- dockedLayerManagerSize
7709
- } = mapPreset;
7710
- const {
7711
- mapLayers,
7712
- baseLayers,
7713
- overLayers
7714
- } = filterLayers(layers);
7715
- if (layers) {
7716
- // make sure all layers have a unique id before going forward
7717
- let autoTimeStepLayerIdNew = autoTimeStepLayerId;
7718
- let autoUpdateLayerIdNew = autoUpdateLayerId;
7719
- const onlyActiveLayerIdIsSet = !autoTimeStepLayerId && !autoUpdateLayerId && activeLayerId;
7720
- if (onlyActiveLayerIdIsSet) {
7721
- autoTimeStepLayerIdNew = activeLayerId;
7722
- autoUpdateLayerIdNew = activeLayerId;
7723
- }
7724
- const newLayerIds = yield call$e(replaceLayerIdsToEnsureUniqueLayerIdsInStore, {
7725
- layers: mapLayers,
7726
- autoTimeStepLayerId: autoTimeStepLayerIdNew,
7727
- autoUpdateLayerId: autoUpdateLayerIdNew
7728
- });
7729
- // set layers
7730
- yield put(layerActions.setLayers({
7731
- mapId,
7732
- layers: newLayerIds.layers
7733
- }));
7734
- // set active layer if given otherwise to first layer
7735
- const firstLayerId = (_a = newLayerIds.layers[0]) === null || _a === void 0 ? void 0 : _a.id;
7736
- yield put(mapActions.setAutoLayerId({
7737
- mapId,
7738
- autoTimeStepLayerId: (_b = newLayerIds.autoTimeStepLayerId) !== null && _b !== void 0 ? _b : firstLayerId,
7739
- autoUpdateLayerId: (_c = newLayerIds.autoUpdateLayerId) !== null && _c !== void 0 ? _c : firstLayerId
7740
- }));
7741
- }
7742
- // sets (default) baseLayers
7743
- const baseLayersWithDefaultLayer = baseLayers.length ? baseLayers : [defaultLayers.baseLayerGrey];
7744
- // sets (default) overLayers
7745
- const overLayersWithDefaultLayer = overLayers.length ? overLayers : [defaultLayers.overLayer];
7746
- const allBaseLayers = [...baseLayersWithDefaultLayer, ...overLayersWithDefaultLayer].map(layer => Object.assign(Object.assign({}, layer), {
7747
- id: webmapUtils.generateLayerId()
7748
- }));
7749
- yield call$e(handleBaseLayersSaga, mapId, allBaseLayers);
7750
- if (proj) {
7751
- const checkIsprojectionSupported = isProjectionSupported(proj.srs);
7752
- if (!checkIsprojectionSupported) {
7753
- throw new Error(`Projection ${proj.srs} is not supported`);
7754
- }
7755
- // set bbox
7756
- yield put(mapActions.setBbox({
7757
- mapId,
7758
- bbox: proj.bbox,
7759
- srs: proj.srs
7760
- }));
7761
- }
7762
- const animationLength = animationPayload && animationPayload.duration;
7763
- const animationEndTime = animationPayload && animationPayload.endTime && isAnimationEndTimeValid(animationPayload.endTime) && animationPayload.endTime;
7764
- const shouldEndtimeOverride = animationPayload ? animationPayload.shouldEndtimeOverride : false;
7765
- if (shouldEndtimeOverride) {
7766
- // auto update
7767
- yield put(mapActions.setEndTimeOverriding({
7768
- mapId,
7769
- shouldEndtimeOverride
7770
- }));
7771
- }
7772
- if (shouldAutoUpdate !== undefined && !animationEndTime) {
7773
- // auto update
7774
- yield put(mapActions.toggleAutoUpdate({
7775
- mapId,
7776
- shouldAutoUpdate
7777
- }));
7778
- }
7779
- if (showTimeSlider !== undefined) {
7780
- // toggle timeslider
7781
- yield put(mapActions.toggleTimeSliderIsVisible({
7782
- mapId,
7783
- isTimeSliderVisible: showTimeSlider
7784
- }));
7785
- }
7786
- if (shouldShowZoomControls !== undefined) {
7787
- // toggle zoom controls
7788
- yield put(mapActions.toggleZoomControls({
7789
- mapId,
7790
- shouldShowZoomControls
7791
- }));
7792
- }
7793
- if (displayMapPin !== undefined) {
7794
- // display map pin
7795
- yield put(mapActions.toggleMapPinIsVisible({
7796
- mapId,
7797
- displayMapPin
7798
- }));
7799
- }
7800
- // sets timestep by interval of animationPayload
7801
- const interval = animationPayload && animationPayload.interval;
7802
- if (interval) {
7803
- yield put(mapActions.setTimeStep({
7804
- mapId,
7805
- timeStep: interval
7806
- }));
7807
- }
7808
- // sets animationEndTime by endTime of animationPayload
7809
- if (animationEndTime) {
7810
- const endTime = animationEndTime.includes('NOW') || animationEndTime.includes('TODAY') ? dateUtils.convertNOWandTODAYFormatsToUTC(animationEndTime) : animationEndTime;
7811
- yield put(mapActions.setAnimationEndTime({
7812
- mapId,
7813
- animationEndTime: handleDateUtilsISOString(endTime)
7814
- }));
7815
- const startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(endTime), {
7816
- minutes: 5 * 60 // set to default of 5 hours
7817
- }).toISOString());
7818
- yield put(mapActions.setAnimationStartTime({
7819
- mapId,
7820
- animationStartTime: startTime
7821
- }));
7822
- yield put(genericActions.setTime({
7823
- origin: '',
7824
- sourceId: mapId,
7825
- value: startTime
7826
- }));
7827
- const centerTimeInSeconds = new Date(handleDateUtilsISOString(endTime)).getTime();
7828
- yield put(mapActions.setTimeSliderCenterTime({
7829
- mapId,
7830
- timeSliderCenterTime: centerTimeInSeconds
7831
- }));
7832
- }
7833
- // sets animationStartTime by duration of animationPayload
7834
- if (animationLength) {
7835
- const animationEnd = yield select(getAnimationEndTime, mapId);
7836
- const startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(animationEnd), {
7837
- minutes: animationLength
7838
- }).toISOString());
7839
- yield put(mapActions.setAnimationStartTime({
7840
- mapId,
7841
- animationStartTime: startTime
7842
- }));
7843
- yield put(genericActions.setTime({
7844
- origin: '',
7845
- sourceId: mapId,
7846
- value: startTime
7847
- }));
7848
- }
7849
- // sets animationDelay by speed of animationPayload
7850
- if (animationPayload && animationPayload.speed) {
7851
- yield put(mapActions.setAnimationDelay({
7852
- mapId,
7853
- animationDelay: getSpeedDelay(animationPayload.speed)
7854
- }));
7855
- }
7856
- // turn animation on
7857
- if (shouldAnimate === true) {
7858
- const duration = animationPayload && animationPayload.duration ? animationPayload.duration : 5 * 60; // set to default of 5 hours
7859
- const animationEnd = shouldEndtimeOverride && animationEndTime ? yield select(getAnimationEndTime, mapId) : dateUtils.dateToString(dateUtils.utc(), dateFormat);
7860
- const animationStart = shouldEndtimeOverride && animationLength ? yield select(getAnimationStartTime, mapId) : dateUtils.dateToString(dateUtils.sub(dateUtils.utc(animationEnd), {
7861
- minutes: duration
7862
- }), dateFormat);
7863
- yield put(mapActions.mapStartAnimation({
7864
- mapId,
7865
- start: animationStart,
7866
- end: animationEnd,
7867
- interval: interval || defaultTimeStep
7868
- }));
7869
- // If animation interval set, set the timestep auto property to false
7870
- if (interval) {
7871
- yield put(mapActions.toggleTimestepAuto({
7872
- mapId,
7873
- timestepAuto: false
7874
- }));
7875
- }
7876
- } else if (toggleTimestepAuto !== undefined) {
7877
- // Set timestep auto based on preset if animation is off
7878
- yield put(mapActions.toggleTimestepAuto({
7879
- mapId,
7880
- timestepAuto: toggleTimestepAuto
7881
- }));
7882
- }
7883
- // show legend
7884
- const shouldOpenLegend = shouldShowLegend !== undefined ? shouldShowLegend : IS_LEGEND_OPEN_BY_DEFAULT;
7885
- const legendId = yield select(getLegendId, mapId);
7886
- if (legendId) {
7887
- yield put(uiActions.setToggleOpenDialog({
7888
- type: legendId,
7889
- setOpen: shouldOpenLegend
7890
- }));
7891
- }
7892
- if (dockedLayerManagerSize) {
7893
- yield put(mapActions.setDockedLayerManagerSize({
7894
- mapId,
7895
- dockedLayerManagerSize
7896
- }));
7897
- }
7898
- while (animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate))) {
7899
- const fiveMinuteDelayForAnimation = 1000 * 60 * 5;
7900
- yield delay(fiveMinuteDelayForAnimation);
7901
- const animationEnd = yield select(getAnimationEndTime, mapId);
7902
- yield put(mapActions.setAnimationEndTime({
7903
- mapId,
7904
- animationEndTime: dateUtils.add(dateUtils.utc(animationEnd), {
7905
- minutes: 5
7906
- }).toISOString()
7907
- }));
7908
- const animationStart = yield select(getAnimationStartTime, mapId);
7909
- yield put(mapActions.setAnimationStartTime({
7910
- mapId,
7911
- animationStartTime: dateUtils.add(dateUtils.utc(animationStart), {
7912
- minutes: 5
7913
- }).toISOString()
7914
- }));
7915
- }
7916
- }
7917
- } catch (error) {
7918
- yield put(mapActions.setMapPresetError({
7919
- mapId: payload.mapId,
7920
- error: error.message
7921
- }));
7922
- }
7923
- }
7924
- function* unregisterMapSaga({
7925
- payload
7926
- }) {
7927
- const {
7928
- mapId
7929
- } = payload;
7930
- const layerList = yield select(getLayersByMapId, mapId);
7931
- metronome.unregister(mapId);
7932
- yield all(layerList.map(layer => put(layerActions.layerDelete({
7933
- mapId,
7934
- layerId: layer.id,
7935
- origin: LayerActionOrigin.unregisterMapSaga
7936
- }))));
7937
- }
7938
- function* setStepBackwardOrForwardSaga({
7939
- payload
7940
- }) {
7941
- const {
7942
- mapId,
7943
- isForwardStep
7944
- } = payload;
7945
- const timeStep = yield select(getMapTimeStep, mapId);
7946
- const currentTime = yield select(getSelectedTime, mapId);
7947
- const [dataStartTime, dataEndTime] = yield select(getDataLimitsFromLayers, mapId);
7948
- if (dateUtils.isValid(currentTime)) {
7949
- const makeForwardStep = () => {
7950
- const nextTime = currentTime + timeStep;
7951
- const roundedTime = roundWithTimeStep(nextTime, timeStep, 'ceil');
7952
- const newTime = Math.min(roundedTime, dataEndTime || roundedTime);
7953
- return dateUtils.fromUnix(newTime).toISOString();
7954
- };
7955
- const makeBackwardStep = () => {
7956
- const nextTime = currentTime - timeStep;
7957
- const roundedTime = roundWithTimeStep(nextTime, timeStep, 'floor');
7958
- const newTime = Math.max(roundedTime, dataStartTime || roundedTime);
7959
- return dateUtils.fromUnix(newTime).toISOString();
7960
- };
7961
- const selectedTimeString = isForwardStep ? makeForwardStep() : makeBackwardStep();
7962
- const isMapAnimating = yield select(isAnimating, mapId);
7963
- if (isMapAnimating) {
7964
- yield put(mapActions.mapStopAnimation({
7965
- mapId,
7966
- origin: MapActionOrigin.map
7967
- }));
7968
- }
7969
- const isAutoUpdateOn = yield select(isAutoUpdating, mapId);
7970
- if (isAutoUpdateOn) {
7971
- yield put(mapActions.toggleAutoUpdate({
7972
- mapId,
7973
- shouldAutoUpdate: false
7974
- }));
7975
- }
7976
- yield put(genericActions.setTime({
7977
- origin: '',
7978
- sourceId: mapId,
7979
- value: handleDateUtilsISOString(selectedTimeString)
7980
- }));
7981
- }
7982
- }
7983
- function* rootSaga$2() {
7984
- // resets IWMJSMap state
7985
- yield takeEvery(mapActions.setMapPreset.type, setMapPresetSaga);
7986
- yield takeEvery(mapActions.unregisterMap.type, unregisterMapSaga);
7987
- yield takeEvery(mapActions.setStepBackwardOrForward.type, setStepBackwardOrForwardSaga);
7988
- }
7989
-
7990
- function* fetchServiceSaga(service) {
7991
- try {
7992
- const layers = yield call$e(getCapabilities.getLayersFlattenedFromService, service.serviceUrl);
7993
- yield put(serviceActions.serviceSetLayers(Object.assign(Object.assign({}, service), {
7994
- layers
7995
- })));
7996
- } catch (error) {
7997
- // not implemented yet
7998
- }
7999
- }
8000
- function* fetchInitialServicesSaga({
8001
- payload
8002
- }) {
8003
- const {
8004
- services
8005
- } = payload;
8006
- yield all(services.map(_a => {
8007
- var {
8008
- url
8009
- } = _a,
8010
- service = __rest(_a, ["url"]);
8011
- return call$e(fetchServiceSaga, Object.assign(Object.assign({}, service), {
8012
- serviceUrl: url
8013
- }));
8014
- }));
8015
- }
8016
- function* rootSaga$1() {
8017
- yield takeEvery(serviceActions.fetchInitialServices, fetchInitialServicesSaga);
8018
- }
8019
-
8020
- /* A map with all the timerIds and their current step */
8021
- const stepMap = new Map();
8022
- /* A map with a list of timers and their dwell */
8023
- const timerDwellMap = new Map();
8024
- /**
8025
- * Returns the next step for given timerId.
8026
- * @param timerId The timer id
8027
- * @param numberOfStepsInAnimation Animation length in steps
8028
- * @param numStepsToGoForward Amount of steps to go forwards, defaults to 1. Can be positive and negative
8029
- * @returns
8030
- */
8031
- const getNextStep = (timerId, numberOfStepsInAnimation, numStepsToGoForward = 1) => {
8032
- const currentStep = getCurrentStep(timerId);
8033
- const nextStep = currentStep + numStepsToGoForward;
8034
- const nextStepClipped = (nextStep % numberOfStepsInAnimation + numberOfStepsInAnimation) % numberOfStepsInAnimation;
8035
- return nextStepClipped;
8036
- };
8037
- /**
8038
- * Handles dwell at the end of the animation loop sequence. The number of steps to wait till proceed can be set by the dwell parameter.
8039
- * @param timerId The timer id
8040
- * @param numberOfStepsInAnimation Number of steps in the animation
8041
- * @param dwell The number of steps to wait at the end of the animation sequence before to continue
8042
- * @returns
8043
- */
8044
- const handleTimerDwell = (timerId, numberOfStepsInAnimation, dwell = 8) => {
8045
- if (dwell > 0) {
8046
- const currentStep = getCurrentStep(timerId);
8047
- // Reset the dwell if we are not at the last animation step
8048
- if (currentStep < numberOfStepsInAnimation - 1) {
8049
- timerDwellMap.set(timerId, dwell);
8050
- return false;
8051
- }
8052
- // We are at the last animation step, check the dwell
8053
- const timerDwell = timerDwellMap.has(timerId) && timerDwellMap.get(timerId) || 0;
8054
- if (currentStep === numberOfStepsInAnimation - 1 && timerDwell > 0) {
8055
- timerDwellMap.set(timerId, timerDwell - 1);
8056
- return true;
8057
- }
8058
- }
8059
- return false;
8060
- };
8061
- /**
8062
- * Set step for the timerId
8063
- * @param timerId
8064
- * @param timerStep
8065
- */
8066
- const setStep = (timerId, timerStep) => {
8067
- stepMap.set(timerId, timerStep);
8068
- };
8069
- /**
8070
- * Gets the current step for the timer
8071
- * @param timerId
8072
- * @returns
8073
- */
8074
- const getCurrentStep = timerId => {
8075
- return stepMap.get(timerId) || 0;
8076
- };
8077
- const MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH = 2;
8078
- const MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES = 8;
8079
- /**
8080
- * This prefetches all images connected to the same sync group as provided timerId
8081
- * @param timerId The timerId
8082
- * @param animationListValues List of animation steps in isostring to animate
8083
- * @param targets List of targets to check
8084
- * @returns True if all maps are ready to go forward, false if the map has no data to display yet.
8085
- */
8086
- const prefetchAnimationTargetsForMetronome = (timerId, animationListValues, targets) => {
8087
- let timerShouldStepForward = true;
8088
- // The following code prefetches/buffers for all maps in the group
8089
- for (let numPrefetch = 0; numPrefetch < MAX_NUMBER_STEPS_FORWARD_TO_PREFETCH; numPrefetch += 1) {
8090
- const nextStep = getNextStep(timerId, animationListValues.length, numPrefetch + 1);
8091
- const nextTimeValueStepToCheck = animationListValues[nextStep];
8092
- for (const target of targets) {
8093
- const targetMapId = target.targetId;
8094
- const wmMap = getWMJSMapById(targetMapId);
8095
- if (wmMap) {
8096
- const layersImageUrls = getWMSRequests(wmMap, [{
8097
- name: 'time',
8098
- currentValue: nextTimeValueStepToCheck
8099
- }]);
8100
- for (const layersImageUrl of layersImageUrls) {
8101
- const image = wmMap.getMapImageStore.getImage(layersImageUrl.url);
8102
- if (!image.isLoaded()) {
8103
- if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
8104
- image.load();
8105
- }
8106
- if (numPrefetch === 0) {
8107
- const altImage = wmMap.getAlternativeImage(layersImageUrl.url, wmMap.getBBOX(), true);
8108
- // No alternative image available yet, so skipping animation.
8109
- if (altImage.length === 0) {
8110
- // This is useful to indicate that the map is loading and has nothing yet to display.
8111
- // console.warn('No data available: Not stepping forward');
8112
- timerShouldStepForward = false;
8113
- }
8114
- }
8115
- } else if (image.isStale()) {
8116
- if (wmMap.getMapImageStore.getNumImagesLoading() < MAX_NUMBER_OF_PARALLEL_LOADING_IMAGES) {
8117
- image.forceReload(true);
8118
- }
8119
- }
8120
- }
8121
- } else {
8122
- return false; // Map was not registered so there is nothing to prefetch
8123
- }
8124
- }
8125
- }
8126
- return timerShouldStepForward;
8127
- };
8128
-
8129
- /**
8130
- * This handler is triggered by the metronome. An array of timerIds is given as argument.
8131
- * It will update the animation loop of multiple maps and sliders
8132
- * It will prefetch images for maps
8133
- * @param timerIds string[] array of timerIds
8134
- * @param listenerApi ListenerEffectAPI<CoreAppStore, Dispatch, unknown> listenerApi as received from listener
8135
- */
8136
- const metronomeHandler = (timerIds, listenerApi) => {
8137
- const targetsWithUpdateValue = [];
8138
- for (const timerId of timerIds) {
8139
- const animationListValuesNameAndValue = getAnimationList(listenerApi.getState(), timerId);
8140
- const animationListValues = animationListValuesNameAndValue.map(nameAndValue => nameAndValue.value);
8141
- const targets = getTargets(listenerApi.getState(), {
8142
- sourceId: timerId,
8143
- origin: timerId
8144
- }, SYNCGROUPS_TYPE_SETTIME);
8145
- if (targets.length === 0) {
8146
- // When there are no targets, default to one
8147
- targets.push({
8148
- targetId: timerId,
8149
- value: ''
8150
- });
8151
- }
8152
- const timerIsInDwell = handleTimerDwell(timerId, animationListValues.length);
8153
- const timerShouldStepForward = prefetchAnimationTargetsForMetronome(timerId, animationListValues, targets) && !timerIsInDwell;
8154
- // Determine the next step
8155
- const timerStep = timerShouldStepForward ? getNextStep(timerId, animationListValues.length) : getCurrentStep(timerId);
8156
- setStep(timerId, timerStep);
8157
- const updatedValue = animationListValues[timerStep];
8158
- targetsWithUpdateValue.push(...targets.map(target => {
8159
- return Object.assign(Object.assign({}, target), {
8160
- value: updatedValue
8161
- });
8162
- }));
8163
- const speedDelay = getMapAnimationDelay(listenerApi.getState(), timerId);
8164
- const speed = 1000 / (speedDelay || 1);
8165
- metronome.setSpeed(timerId, speed);
8166
- }
8167
- // Update all targets of all sync groups in one action.
8168
- if (targetsWithUpdateValue.length > 0) {
8169
- listenerApi.dispatch(setTimeSync(null, targetsWithUpdateValue, ['metronomesaga']));
8170
- }
8171
- };
8172
- const metronomeListener = createListenerMiddleware();
8173
- metronomeListener.startListening({
8174
- actionCreator: mapActions.mapStartAnimation,
8175
- effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
8176
- // register handler with access to listenerApi
8177
- metronome.handleTimerTicks = timerIds => {
8178
- metronomeHandler(timerIds, listenerApi);
8179
- };
8180
- })
8181
- });
8182
-
8183
- /* *
8184
- * Licensed under the Apache License, Version 2.0 (the "License");
8185
- * you may not use this file except in compliance with the License.
8186
- * You may obtain a copy of the License at
8187
- *
8188
- * http://www.apache.org/licenses/LICENSE-2.0
8189
- *
8190
- * Unless required by applicable law or agreed to in writing, software
8191
- * distributed under the License is distributed on an "AS IS" BASIS,
8192
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
8193
- * See the License for the specific language governing permissions and
8194
- * limitations under the License.
8195
- *
8196
- * Copyright 2024 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
8197
- * Copyright 2024 - Finnish Meteorological Institute (FMI)
8198
- * Copyright 2024 - The Norwegian Meteorological Institute (MET Norway)
8199
- * */
8200
- const layersListener = createListenerMiddleware();
8201
- layersListener.startListening({
8202
- actionCreator: layerActions.showLayerInfo,
8203
- effect: ({
8204
- payload
8205
- }, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
8206
- const {
8207
- mapId,
8208
- source
8209
- } = payload;
8210
- const currentActiveMapId = getDialogMapId(listenerApi.getState(), DialogTypes.LayerInfo);
8211
- const isOpenInStore = getisDialogOpen(listenerApi.getState(), DialogTypes.LayerInfo);
8212
- if (currentActiveMapId !== mapId ? true : !isOpenInStore) {
8213
- listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
8214
- type: DialogTypes.LayerInfo,
8215
- mapId,
8216
- setOpen: true,
8217
- source
8218
- }));
8219
- }
8220
- })
8221
- });
8222
- layersListener.startListening({
8223
- actionCreator: uiActions.setToggleOpenDialog,
8224
- effect: ({
8225
- payload
8226
- }, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
8227
- const {
8228
- setOpen,
8229
- type
8230
- } = payload;
8231
- // close LayerInfo if open and LayerManager is closed
8232
- if (type === DialogTypes.LayerManager && !setOpen) {
8233
- const isOpenInStore = getisDialogOpen(listenerApi.getState(), DialogTypes.LayerInfo);
8234
- if (isOpenInStore) {
8235
- listenerApi.dispatch(layerActions.hideLayerInfo());
8236
- }
8237
- }
8238
- })
7844
+ // eslint-disable-next-line regexp/no-empty-group -- required for testing
7845
+ var re = /(?:)/;
7846
+ var originalExec = re.exec;
7847
+ re.exec = function () { return originalExec.apply(this, arguments); };
7848
+ var result = 'ab'.split(re);
7849
+ return result.length !== 2 || result[0] !== 'a' || result[1] !== 'b';
8239
7850
  });
8240
7851
 
8241
- const mapUiListener = createListenerMiddleware();
8242
- mapUiListener.startListening({
8243
- actionCreator: mapActions.registerMap,
8244
- effect: (_, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
8245
- const fields = getAllMapIds(listenerApi.getState());
8246
- if (fields.length === 1) {
8247
- const source = getDialogSource(listenerApi.getState(), 'legend');
8248
- listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
8249
- type: 'legend',
8250
- mapId: fields[0],
8251
- setOpen: true,
8252
- source
8253
- }));
8254
- }
8255
- })
8256
- });
8257
- mapUiListener.startListening({
8258
- actionCreator: mapActions.unregisterMap,
8259
- effect: ({
8260
- payload
8261
- }, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
8262
- const fields = getAllMapIds(listenerApi.getState());
8263
- const activeLegendUI = getDialogDetailsByType(listenerApi.getState(), 'legend');
8264
- if (fields.length && activeLegendUI && !fields.includes(activeLegendUI.activeMapId)) {
8265
- listenerApi.dispatch(uiActions.setActiveMapIdForDialog({
8266
- type: 'legend',
8267
- mapId: fields[0],
8268
- setOpen: activeLegendUI.isOpen
8269
- }));
8270
- } else if (!fields.length) {
8271
- // if no more maps, we hide the legend
8272
- listenerApi.dispatch(uiActions.setToggleOpenDialog({
8273
- type: 'legend',
8274
- setOpen: false
8275
- }));
8276
- }
8277
- // close any remaining windows with map assigned to it
8278
- const remainingDialogsConnectedToMap = getUiDialogsByActiveMapId(listenerApi.getState(), payload.mapId);
8279
- if (remainingDialogsConnectedToMap.length) {
8280
- remainingDialogsConnectedToMap.forEach(dialog => {
8281
- if (dialog.isOpen) {
8282
- listenerApi.dispatch(uiActions.setToggleOpenDialog({
8283
- type: dialog.type,
8284
- setOpen: false
8285
- }));
7852
+ var BUGGY = 'abbc'.split(/(b)*/)[1] === 'c' ||
7853
+ // eslint-disable-next-line regexp/no-empty-group -- required for testing
7854
+ 'test'.split(/(?:)/, -1).length !== 4 ||
7855
+ 'ab'.split(/(?:ab)*/).length !== 2 ||
7856
+ '.'.split(/(.?)(.?)/).length !== 4 ||
7857
+ // eslint-disable-next-line regexp/no-empty-capturing-group, regexp/no-empty-group -- required for testing
7858
+ '.'.split(/()()/).length > 1 ||
7859
+ ''.split(/.?/).length;
7860
+
7861
+ // @@split logic
7862
+ fixRegExpWellKnownSymbolLogic('split', function (SPLIT, nativeSplit, maybeCallNative) {
7863
+ var internalSplit = '0'.split(undefined, 0).length ? function (separator, limit) {
7864
+ return separator === undefined && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
7865
+ } : nativeSplit;
7866
+
7867
+ return [
7868
+ // `String.prototype.split` method
7869
+ // https://tc39.es/ecma262/#sec-string.prototype.split
7870
+ function split(separator, limit) {
7871
+ var O = requireObjectCoercible(this);
7872
+ var splitter = isNullOrUndefined(separator) ? undefined : getMethod(separator, SPLIT);
7873
+ return splitter
7874
+ ? call(splitter, separator, O, limit)
7875
+ : call(internalSplit, toString(O), separator, limit);
7876
+ },
7877
+ // `RegExp.prototype[@@split]` method
7878
+ // https://tc39.es/ecma262/#sec-regexp.prototype-@@split
7879
+ //
7880
+ // NOTE: This cannot be properly polyfilled in engines that don't support
7881
+ // the 'y' flag.
7882
+ function (string, limit) {
7883
+ var rx = anObject(this);
7884
+ var S = toString(string);
7885
+
7886
+ if (!BUGGY) {
7887
+ var res = maybeCallNative(internalSplit, rx, S, limit, internalSplit !== nativeSplit);
7888
+ if (res.done) return res.value;
7889
+ }
7890
+
7891
+ var C = speciesConstructor(rx, RegExp);
7892
+ var unicodeMatching = rx.unicode;
7893
+ var flags = (rx.ignoreCase ? 'i' : '') +
7894
+ (rx.multiline ? 'm' : '') +
7895
+ (rx.unicode ? 'u' : '') +
7896
+ (UNSUPPORTED_Y ? 'g' : 'y');
7897
+ // ^(? + rx + ) is needed, in combination with some S slicing, to
7898
+ // simulate the 'y' flag.
7899
+ var splitter = new C(UNSUPPORTED_Y ? '^(?:' + rx.source + ')' : rx, flags);
7900
+ var lim = limit === undefined ? MAX_UINT32 : limit >>> 0;
7901
+ if (lim === 0) return [];
7902
+ if (S.length === 0) return regExpExec(splitter, S) === null ? [S] : [];
7903
+ var p = 0;
7904
+ var q = 0;
7905
+ var A = [];
7906
+ while (q < S.length) {
7907
+ splitter.lastIndex = UNSUPPORTED_Y ? 0 : q;
7908
+ var z = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S, q) : S);
7909
+ var e;
7910
+ if (
7911
+ z === null ||
7912
+ (e = min(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q : 0)), S.length)) === p
7913
+ ) {
7914
+ q = advanceStringIndex(S, q, unicodeMatching);
7915
+ } else {
7916
+ push(A, stringSlice(S, p, q));
7917
+ if (A.length === lim) return A;
7918
+ for (var i = 1; i <= z.length - 1; i++) {
7919
+ push(A, z[i]);
7920
+ if (A.length === lim) return A;
7921
+ }
7922
+ q = p = e;
8286
7923
  }
8287
- });
7924
+ }
7925
+ push(A, stringSlice(S, p));
7926
+ return A;
8288
7927
  }
8289
- })
8290
- });
7928
+ ];
7929
+ }, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
8291
7930
 
7931
+ const isAnimationEndTimeValid = animationEndTime => {
7932
+ const hasValidPrefix = animationEndTime.split(/[-+]/)[0] === 'NOW' || animationEndTime.split(/[-+]/)[0] === 'TODAY';
7933
+ const durationString = animationEndTime.substring(animationEndTime.indexOf('PT') + 2);
7934
+ const hasValidDate = /^(\d+H)?(\d+M)?$/.test(durationString);
7935
+ if (hasValidPrefix && hasValidDate) {
7936
+ return true;
7937
+ }
7938
+ const parsedDate = dateUtils.parseISO(animationEndTime);
7939
+ return dateUtils.isValid(parsedDate);
7940
+ };
8292
7941
  const mapListener = createListenerMiddleware();
8293
7942
  mapListener.startListening({
8294
7943
  actionCreator: layerActions.layerDelete,
@@ -8487,9 +8136,297 @@ mapListener.startListening({
8487
8136
  metronome.unregister(mapId);
8488
8137
  }
8489
8138
  });
8139
+ const handleBaseLayers = (mapId, baseLayers, listenerApi) => {
8140
+ const baseLayer = baseLayers.find(layer => layer.layerType === 'baseLayer');
8141
+ const currentAvailableBaseLayers = getAvailableBaseLayersForMap(listenerApi.getState(), mapId);
8142
+ // find a availableBaseLayer with the same name, and use that id for the active baselayer
8143
+ const activeAvailableBaseLayer = currentAvailableBaseLayers.find(availableBaseLayer => availableBaseLayer.name === baseLayer.name);
8144
+ const activeBaseLayerId = activeAvailableBaseLayer ? activeAvailableBaseLayer.id : webmapUtils.generateLayerId();
8145
+ // if the baseLayer can't be found in a visible available baseLayer list, add it
8146
+ // This happens when switching to a preset that has non-default baselayers
8147
+ if (!activeAvailableBaseLayer && currentAvailableBaseLayers.length) {
8148
+ listenerApi.dispatch(layerActions.addAvailableBaseLayers({
8149
+ layers: [Object.assign(Object.assign({}, baseLayer), {
8150
+ mapId,
8151
+ id: activeBaseLayerId
8152
+ })]
8153
+ }));
8154
+ }
8155
+ const baseLayersWithActiveId = baseLayers.map((layer, index) => index === 0 ? Object.assign(Object.assign({}, layer), {
8156
+ id: activeBaseLayerId || layer.id
8157
+ }) : layer);
8158
+ listenerApi.dispatch(layerActions.setBaseLayers({
8159
+ mapId,
8160
+ layers: baseLayersWithActiveId
8161
+ }));
8162
+ };
8163
+ mapListener.startListening({
8164
+ actionCreator: mapActions.setMapPreset,
8165
+ effect: ({
8166
+ payload
8167
+ }, listenerApi) => __awaiter(void 0, void 0, void 0, function* () {
8168
+ var _a, _b, _c;
8169
+ try {
8170
+ const {
8171
+ mapId,
8172
+ initialProps
8173
+ } = payload;
8174
+ const {
8175
+ mapPreset
8176
+ } = initialProps;
8177
+ if (mapPreset) {
8178
+ const {
8179
+ layers,
8180
+ activeLayerId,
8181
+ autoTimeStepLayerId,
8182
+ autoUpdateLayerId,
8183
+ proj,
8184
+ shouldAutoUpdate,
8185
+ shouldAnimate,
8186
+ animationPayload,
8187
+ toggleTimestepAuto,
8188
+ showTimeSlider,
8189
+ displayMapPin,
8190
+ shouldShowZoomControls,
8191
+ shouldShowLegend,
8192
+ dockedLayerManagerSize
8193
+ } = mapPreset;
8194
+ const {
8195
+ mapLayers,
8196
+ baseLayers,
8197
+ overLayers
8198
+ } = filterLayers(layers);
8199
+ if (layers) {
8200
+ // make sure all layers have a unique id before going forward
8201
+ let autoTimeStepLayerIdNew = autoTimeStepLayerId;
8202
+ let autoUpdateLayerIdNew = autoUpdateLayerId;
8203
+ const onlyActiveLayerIdIsSet = !autoTimeStepLayerId && !autoUpdateLayerId && activeLayerId;
8204
+ if (onlyActiveLayerIdIsSet) {
8205
+ autoTimeStepLayerIdNew = activeLayerId;
8206
+ autoUpdateLayerIdNew = activeLayerId;
8207
+ }
8208
+ const newLayerIds = replaceLayerIdsToEnsureUniqueLayerIdsInStore({
8209
+ layers: mapLayers,
8210
+ autoTimeStepLayerId: autoTimeStepLayerIdNew,
8211
+ autoUpdateLayerId: autoUpdateLayerIdNew
8212
+ });
8213
+ // set layers
8214
+ listenerApi.dispatch(layerActions.setLayers({
8215
+ mapId,
8216
+ layers: newLayerIds.layers
8217
+ }));
8218
+ // set active layer if given otherwise to first layer
8219
+ const firstLayerId = (_a = newLayerIds.layers[0]) === null || _a === void 0 ? void 0 : _a.id;
8220
+ listenerApi.dispatch(mapActions.setAutoLayerId({
8221
+ mapId,
8222
+ autoTimeStepLayerId: (_b = newLayerIds.autoTimeStepLayerId) !== null && _b !== void 0 ? _b : firstLayerId,
8223
+ autoUpdateLayerId: (_c = newLayerIds.autoUpdateLayerId) !== null && _c !== void 0 ? _c : firstLayerId
8224
+ }));
8225
+ }
8226
+ // sets (default) baseLayers
8227
+ const baseLayersWithDefaultLayer = baseLayers.length ? baseLayers : [defaultLayers.baseLayerGrey];
8228
+ // sets (default) overLayers
8229
+ const overLayersWithDefaultLayer = overLayers.length ? overLayers : [defaultLayers.overLayer];
8230
+ const allBaseLayers = [...baseLayersWithDefaultLayer, ...overLayersWithDefaultLayer].map(layer => Object.assign(Object.assign({}, layer), {
8231
+ id: webmapUtils.generateLayerId()
8232
+ }));
8233
+ handleBaseLayers(mapId, allBaseLayers, listenerApi);
8234
+ if (proj) {
8235
+ const checkIsprojectionSupported = isProjectionSupported(proj.srs);
8236
+ if (!checkIsprojectionSupported) {
8237
+ throw new Error(`Projection ${proj.srs} is not supported`);
8238
+ }
8239
+ // set bbox
8240
+ listenerApi.dispatch(mapActions.setBbox({
8241
+ mapId,
8242
+ bbox: proj.bbox,
8243
+ srs: proj.srs
8244
+ }));
8245
+ }
8246
+ const animationLength = animationPayload && animationPayload.duration;
8247
+ const animationEndTime = animationPayload && animationPayload.endTime && isAnimationEndTimeValid(animationPayload.endTime) && animationPayload.endTime;
8248
+ const shouldEndtimeOverride = animationPayload ? animationPayload.shouldEndtimeOverride : false;
8249
+ if (shouldEndtimeOverride) {
8250
+ // auto update
8251
+ listenerApi.dispatch(mapActions.setEndTimeOverriding({
8252
+ mapId,
8253
+ shouldEndtimeOverride
8254
+ }));
8255
+ }
8256
+ if (shouldAutoUpdate !== undefined && !animationEndTime) {
8257
+ // auto update
8258
+ listenerApi.dispatch(mapActions.toggleAutoUpdate({
8259
+ mapId,
8260
+ shouldAutoUpdate
8261
+ }));
8262
+ }
8263
+ if (showTimeSlider !== undefined) {
8264
+ // toggle timeslider
8265
+ listenerApi.dispatch(mapActions.toggleTimeSliderIsVisible({
8266
+ mapId,
8267
+ isTimeSliderVisible: showTimeSlider
8268
+ }));
8269
+ }
8270
+ if (shouldShowZoomControls !== undefined) {
8271
+ // toggle zoom controls
8272
+ listenerApi.dispatch(mapActions.toggleZoomControls({
8273
+ mapId,
8274
+ shouldShowZoomControls
8275
+ }));
8276
+ }
8277
+ if (displayMapPin !== undefined) {
8278
+ // display map pin
8279
+ listenerApi.dispatch(mapActions.toggleMapPinIsVisible({
8280
+ mapId,
8281
+ displayMapPin
8282
+ }));
8283
+ }
8284
+ // sets timestep by interval of animationPayload
8285
+ const interval = animationPayload && animationPayload.interval;
8286
+ if (interval) {
8287
+ listenerApi.dispatch(mapActions.setTimeStep({
8288
+ mapId,
8289
+ timeStep: interval
8290
+ }));
8291
+ }
8292
+ // sets animationEndTime by endTime of animationPayload
8293
+ if (animationEndTime) {
8294
+ const endTime = animationEndTime.includes('NOW') || animationEndTime.includes('TODAY') ? dateUtils.convertNOWandTODAYFormatsToUTC(animationEndTime) : animationEndTime;
8295
+ listenerApi.dispatch(mapActions.setAnimationEndTime({
8296
+ mapId,
8297
+ animationEndTime: handleDateUtilsISOString(endTime)
8298
+ }));
8299
+ const startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(endTime), {
8300
+ minutes: 5 * 60 // set to default of 5 hours
8301
+ }).toISOString());
8302
+ listenerApi.dispatch(mapActions.setAnimationStartTime({
8303
+ mapId,
8304
+ animationStartTime: startTime
8305
+ }));
8306
+ listenerApi.dispatch(genericActions.setTime({
8307
+ origin: '',
8308
+ sourceId: mapId,
8309
+ value: startTime
8310
+ }));
8311
+ const centerTimeInSeconds = new Date(handleDateUtilsISOString(endTime)).getTime();
8312
+ listenerApi.dispatch(mapActions.setTimeSliderCenterTime({
8313
+ mapId,
8314
+ timeSliderCenterTime: centerTimeInSeconds
8315
+ }));
8316
+ }
8317
+ // sets animationStartTime by duration of animationPayload
8318
+ if (animationLength) {
8319
+ const animationEnd = getAnimationEndTime(listenerApi.getState(), mapId);
8320
+ const startTime = handleDateUtilsISOString(dateUtils.sub(dateUtils.utc(animationEnd), {
8321
+ minutes: animationLength
8322
+ }).toISOString());
8323
+ listenerApi.dispatch(mapActions.setAnimationStartTime({
8324
+ mapId,
8325
+ animationStartTime: startTime
8326
+ }));
8327
+ listenerApi.dispatch(genericActions.setTime({
8328
+ origin: '',
8329
+ sourceId: mapId,
8330
+ value: startTime
8331
+ }));
8332
+ }
8333
+ // sets animationDelay by speed of animationPayload
8334
+ if (animationPayload && animationPayload.speed) {
8335
+ listenerApi.dispatch(mapActions.setAnimationDelay({
8336
+ mapId,
8337
+ animationDelay: getSpeedDelay(animationPayload.speed)
8338
+ }));
8339
+ }
8340
+ // turn animation on
8341
+ if (shouldAnimate === true) {
8342
+ const duration = animationPayload && animationPayload.duration ? animationPayload.duration : 5 * 60; // set to default of 5 hours
8343
+ const animationEnd = shouldEndtimeOverride && animationEndTime ? getAnimationEndTime(listenerApi.getState(), mapId) : dateUtils.dateToString(dateUtils.utc(), dateFormat);
8344
+ const animationStart = shouldEndtimeOverride && animationLength ? getAnimationStartTime(listenerApi.getState(), mapId) : dateUtils.dateToString(dateUtils.sub(dateUtils.utc(animationEnd), {
8345
+ minutes: duration
8346
+ }), dateFormat);
8347
+ listenerApi.dispatch(mapActions.mapStartAnimation({
8348
+ mapId,
8349
+ start: animationStart,
8350
+ end: animationEnd,
8351
+ interval: interval || defaultTimeStep
8352
+ }));
8353
+ // If animation interval set, set the timestep auto property to false
8354
+ if (interval) {
8355
+ listenerApi.dispatch(mapActions.toggleTimestepAuto({
8356
+ mapId,
8357
+ timestepAuto: false
8358
+ }));
8359
+ }
8360
+ } else if (toggleTimestepAuto !== undefined) {
8361
+ // Set timestep auto based on preset if animation is off
8362
+ listenerApi.dispatch(mapActions.toggleTimestepAuto({
8363
+ mapId,
8364
+ timestepAuto: toggleTimestepAuto
8365
+ }));
8366
+ }
8367
+ // show legend
8368
+ const shouldOpenLegend = shouldShowLegend !== undefined ? shouldShowLegend : IS_LEGEND_OPEN_BY_DEFAULT;
8369
+ const legendId = getLegendId(listenerApi.getState(), mapId);
8370
+ if (legendId) {
8371
+ listenerApi.dispatch(uiActions.setToggleOpenDialog({
8372
+ type: legendId,
8373
+ setOpen: shouldOpenLegend
8374
+ }));
8375
+ }
8376
+ if (dockedLayerManagerSize) {
8377
+ listenerApi.dispatch(mapActions.setDockedLayerManagerSize({
8378
+ mapId,
8379
+ dockedLayerManagerSize
8380
+ }));
8381
+ }
8382
+ while (animationEndTime && (shouldEndtimeOverride || !(shouldAutoUpdate || shouldAnimate))) {
8383
+ const fiveMinuteDelayForAnimation = 1000 * 60 * 5;
8384
+ // eslint-disable-next-line no-await-in-loop
8385
+ yield listenerApi.delay(fiveMinuteDelayForAnimation);
8386
+ const animationEnd = getAnimationEndTime(listenerApi.getState(), mapId);
8387
+ listenerApi.dispatch(mapActions.setAnimationEndTime({
8388
+ mapId,
8389
+ animationEndTime: dateUtils.add(dateUtils.utc(animationEnd), {
8390
+ minutes: 5
8391
+ }).toISOString()
8392
+ }));
8393
+ const animationStart = getAnimationStartTime(listenerApi.getState(), mapId);
8394
+ listenerApi.dispatch(mapActions.setAnimationStartTime({
8395
+ mapId,
8396
+ animationStartTime: dateUtils.add(dateUtils.utc(animationStart), {
8397
+ minutes: 5
8398
+ }).toISOString()
8399
+ }));
8400
+ }
8401
+ }
8402
+ } catch (error) {
8403
+ listenerApi.dispatch(mapActions.setMapPresetError({
8404
+ mapId: payload.mapId,
8405
+ error: error.message
8406
+ }));
8407
+ }
8408
+ })
8409
+ });
8410
+ mapListener.startListening({
8411
+ actionCreator: mapActions.unregisterMap,
8412
+ effect: ({
8413
+ payload
8414
+ }, listenerApi) => {
8415
+ const {
8416
+ mapId
8417
+ } = payload;
8418
+ const layerList = getLayersByMapId(listenerApi.getState(), mapId);
8419
+ metronome.unregister(mapId);
8420
+ layerList.map(layer => listenerApi.dispatch(layerActions.layerDelete({
8421
+ mapId,
8422
+ layerId: layer.id,
8423
+ origin: LayerActionOrigin.unregisterMapListener
8424
+ })));
8425
+ }
8426
+ });
8490
8427
 
8491
8428
  // TODO: This fixes typecheck errors but maybe there is a better way to do that
8492
- createStore$1({
8429
+ createStore({
8493
8430
  extensions: [getSagaExtension()]
8494
8431
  });
8495
8432
  const mapStoreReducers = {
@@ -9827,10 +9764,8 @@ const uiModuleConfig = {
9827
9764
  * */
9828
9765
  const coreModuleConfig = [mapStoreModuleConfig, synchronizationGroupConfig, uiModuleConfig, drawtoolModuleConfig];
9829
9766
 
9830
- const createStore = () => createStore$1({
9831
- extensions: [getSagaExtension({}), {
9832
- middlewares: [metronomeListener.middleware, mapListener.middleware]
9833
- }]
9767
+ const createCustomStore = () => createStore({
9768
+ extensions: [getSagaExtension({})]
9834
9769
  });
9835
9770
  const WrapperWithModules = withEggs(coreModuleConfig)(({
9836
9771
  children
@@ -9852,4 +9787,4 @@ const StoreProvider = ({
9852
9787
  })
9853
9788
  }));
9854
9789
 
9855
- export { IS_LEGEND_OPEN_BY_DEFAULT, StoreProvider, coreModuleConfig, createStore, drawtoolActions, drawtoolModuleConfig, reducer as drawtoolReducer, selectors as drawtoolSelectors, filterLayers$1 as filterLayers, genericActions, genericListener, selectors$4 as genericSelectors, types$1 as genericTypes, getSingularDrawtoolDrawLayerId, getUserAddedServices, initialState$3 as initialState, layerActions, reducer$6 as layerReducer, selectors$7 as layerSelectors, types$5 as layerTypes, utils$2 as layerUtils, loadingIndicatorActions, constants as loadingIndicatorConstants, loadingIndicatorReducer, selectors$3 as loadingIndicatorSelectors, mapActions, enums as mapEnums, rootSaga$2 as mapSaga, selectors$2 as mapSelectors, mapStoreActions, mapStoreModuleConfig, mapStoreReducers, types$4 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, selectorMemoizationOptions, serviceActions, selectors$1 as serviceSelectors, types as serviceTypes, setUserAddedServices, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants$1 as syncConstants, actions as syncGroupsActions, reducer$3 as syncGroupsReducer, selector as syncGroupsSelector, selectors$5 as syncGroupsSelectors, types$2 as syncGroupsTypes, types$2 as types, uiActions, uiModuleConfig, reducer$5 as uiReducer, selectors$6 as uiSelectors, types$3 as uiTypes, useSetupDialog, reducer$4 as webmapReducer };
9790
+ export { IS_LEGEND_OPEN_BY_DEFAULT, StoreProvider, coreModuleConfig, createCustomStore, drawtoolActions, drawtoolModuleConfig, reducer as drawtoolReducer, selectors as drawtoolSelectors, filterLayers$1 as filterLayers, genericActions, genericListener, selectors$4 as genericSelectors, types$1 as genericTypes, getSingularDrawtoolDrawLayerId, getUserAddedServices, initialState$3 as initialState, layerActions, reducer$6 as layerReducer, selectors$7 as layerSelectors, types$5 as layerTypes, utils$2 as layerUtils, loadingIndicatorActions, constants as loadingIndicatorConstants, loadingIndicatorReducer, selectors$3 as loadingIndicatorSelectors, mapActions, enums as mapEnums, rootSaga$2 as mapSaga, selectors$2 as mapSelectors, mapStoreActions, mapStoreModuleConfig, mapStoreReducers, types$4 as mapTypes, mapUtils, routerActions, routerModuleConfig, utils as routerUtils, selectorMemoizationOptions, serviceActions, selectors$1 as serviceSelectors, types as serviceTypes, setUserAddedServices, storeTestSettings, storeTestUtils, utils$1 as storeUtils, constants$1 as syncConstants, actions as syncGroupsActions, reducer$3 as syncGroupsReducer, selector as syncGroupsSelector, selectors$5 as syncGroupsSelectors, types$2 as syncGroupsTypes, types$2 as types, uiActions, uiModuleConfig, reducer$5 as uiReducer, selectors$6 as uiSelectors, types$3 as uiTypes, useSetupDialog, reducer$4 as webmapReducer };