@opengeoweb/sigmet-airmet 1.1.4 → 1.2.3

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.
@@ -1,4 +1,5 @@
1
- import React__default, { useRef, useEffect, createElement, useState } from 'react';
1
+ import * as React from 'react';
2
+ import React__default from 'react';
2
3
  import { makeStyles, FormControlLabel, Radio, Grid, Typography, SvgIcon, Tooltip, Button, Checkbox, MenuItem, FormHelperText, Dialog, DialogTitle, DialogContent, Card, CardContent, List, ListItem, Backdrop, CircularProgress } from '@material-ui/core';
3
4
  import { MuiPickersUtilsProvider } from '@material-ui/pickers';
4
5
  import MomentUtils from '@date-io/moment';
@@ -8,7 +9,8 @@ import { useApiContext, useApi, createApiInstance } from '@opengeoweb/api';
8
9
  import produce, { produce as produce$1 } from 'immer';
9
10
  import { useDispatch, useSelector, shallowEqual } from 'react-redux';
10
11
  import { mapTypes, mapSelectors, generateMapId, generateLayerId, mapActions, MapViewConnect, MapViewLayer } from '@opengeoweb/core';
11
- import { feature, simplify, intersect, polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
12
+ import * as turf from '@turf/turf';
13
+ import { polygonToLineString, booleanClockwise, rewind } from '@turf/turf';
12
14
  import { useDraftFormHelpers, useIsMounted, StatusTag, AlertBanner, usePreventBrowserClose, useConfirmationDialog, isAxiosError, getAxiosErrorMessage, ConfirmationServiceProvider, usePoller } from '@opengeoweb/shared';
13
15
  import { LocationOn, Delete, ArrowBackIos, InfoOutlined, Create, CheckCircle, Schedule } from '@material-ui/icons';
14
16
  import moment from 'moment';
@@ -108,10 +110,10 @@ function __read(o, n) {
108
110
  return ar;
109
111
  }
110
112
 
111
- function __spread() {
112
- for (var ar = [], i = 0; i < arguments.length; i++)
113
- ar = ar.concat(__read(arguments[i]));
114
- return ar;
113
+ function __spreadArray(to, from) {
114
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
115
+ to[j] = from[i];
116
+ return to;
115
117
  }
116
118
 
117
119
  var srsAndBboxDefault = {
@@ -497,8 +499,8 @@ var MapViewGeoJson = function MapViewGeoJson(_a) {
497
499
  var mapDimensions = useSelector(function (store) {
498
500
  return mapSelectors.getMapDimensions(store, 'main-map');
499
501
  }, shallowEqual);
500
- var mapId = useRef("sigmet-" + generateMapId()).current;
501
- useEffect(function () {
502
+ var mapId = React.useRef("sigmet-" + generateMapId()).current;
503
+ React.useEffect(function () {
502
504
  if (mapLayers && mapLayers.length) {
503
505
  // use maplayers, but change layerId and current mapId
504
506
  var layers = mapLayers.map(function (layer) {
@@ -539,18 +541,18 @@ var MapViewGeoJson = function MapViewGeoJson(_a) {
539
541
  srs: srsAndBboxDefault.srs
540
542
  })); // eslint-disable-next-line react-hooks/exhaustive-deps
541
543
  }, []);
542
- return /*#__PURE__*/createElement("div", {
544
+ return /*#__PURE__*/React.createElement("div", {
543
545
  style: {
544
546
  height: '100%'
545
547
  },
546
548
  "data-testid": "MapView"
547
- }, /*#__PURE__*/createElement(MapViewConnect, {
549
+ }, /*#__PURE__*/React.createElement(MapViewConnect, {
548
550
  mapId: mapId
549
- }, /*#__PURE__*/createElement(MapViewLayer, {
551
+ }, /*#__PURE__*/React.createElement(MapViewLayer, {
550
552
  id: "geojsonlayer-fir-" + mapId,
551
553
  isInEditMode: false,
552
554
  geojson: geoJSONs.fir
553
- }), /*#__PURE__*/createElement(MapViewLayer, {
555
+ }), /*#__PURE__*/React.createElement(MapViewLayer, {
554
556
  id: "geojsonlayer-end-" + mapId,
555
557
  isInEditMode: drawMode.end !== null && layerDrawModes.end !== null,
556
558
  geojson: geoJSONs.end,
@@ -569,7 +571,7 @@ var MapViewGeoJson = function MapViewGeoJson(_a) {
569
571
  exitDrawModeCallbackEnd();
570
572
  },
571
573
  featureNrToEdit: 0
572
- }), /*#__PURE__*/createElement(MapViewLayer, {
574
+ }), /*#__PURE__*/React.createElement(MapViewLayer, {
573
575
  id: "geojsonlayer-start-" + mapId,
574
576
  isInEditMode: drawMode.start !== null && layerDrawModes.start !== null,
575
577
  geojson: geoJSONs.start,
@@ -588,11 +590,11 @@ var MapViewGeoJson = function MapViewGeoJson(_a) {
588
590
  exitDrawModeCallbackStart();
589
591
  },
590
592
  featureNrToEdit: 0
591
- }), /*#__PURE__*/createElement(MapViewLayer, {
593
+ }), /*#__PURE__*/React.createElement(MapViewLayer, {
592
594
  id: "geojsonlayer-intersection-end-" + mapId,
593
595
  isInEditMode: false,
594
596
  geojson: geoJSONs.intersectionEnd
595
- }), /*#__PURE__*/createElement(MapViewLayer, {
597
+ }), /*#__PURE__*/React.createElement(MapViewLayer, {
596
598
  id: "geojsonlayer-intersection-start-" + mapId,
597
599
  isInEditMode: false,
598
600
  geojson: geoJSONs.intersectionStart
@@ -828,7 +830,7 @@ var useDrawMode = function useDrawMode(initialGeometry) {
828
830
  /* For the radio buttons */
829
831
 
830
832
 
831
- var _a = __read(useState({
833
+ var _a = __read(React.useState({
832
834
  start: null,
833
835
  end: null
834
836
  }), 2),
@@ -837,7 +839,7 @@ var useDrawMode = function useDrawMode(initialGeometry) {
837
839
  /* Drawmode for the layers */
838
840
 
839
841
 
840
- var _b = __read(useState({
842
+ var _b = __read(React.useState({
841
843
  start: getInitialLayerDrawModes('start'),
842
844
  end: getInitialLayerDrawModes('end')
843
845
  }), 2),
@@ -846,7 +848,7 @@ var useDrawMode = function useDrawMode(initialGeometry) {
846
848
  /* GeoJSONs for the layers */
847
849
 
848
850
 
849
- var _c = __read(useState(function () {
851
+ var _c = __read(React.useState(function () {
850
852
  return {
851
853
  start: addFeatureProperties(initialGeometry && initialGeometry.start, featurePropsStart),
852
854
  end: addFeatureProperties(initialGeometry && initialGeometry.end, featurePropsEnd),
@@ -974,15 +976,15 @@ var useDrawMode = function useDrawMode(initialGeometry) {
974
976
  */
975
977
 
976
978
  var intersectGeoJSONS = function intersectGeoJSONS(a, b) {
977
- var featureA = feature(a.features[0].geometry);
978
- var featureB = feature(b.features[0].geometry);
979
+ var featureA = turf.feature(a.features[0].geometry);
980
+ var featureB = turf.feature(b.features[0].geometry);
979
981
  var options = {
980
982
  tolerance: 0.001,
981
983
  highQuality: true
982
984
  };
983
- var simplifiedA = simplify(featureA, options);
984
- var simplifiedB = simplify(featureB, options);
985
- var intersection = intersect(simplifiedA, simplifiedB);
985
+ var simplifiedA = turf.simplify(featureA, options);
986
+ var simplifiedB = turf.simplify(featureB, options);
987
+ var intersection = turf.intersect(simplifiedA, simplifiedB);
986
988
  return addFeatureProperties({
987
989
  type: 'FeatureCollection',
988
990
  features: intersection === null ? [{
@@ -1036,7 +1038,7 @@ var createInterSections = function createInterSections(geoJSONs) {
1036
1038
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1037
1039
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1038
1040
  * */
1039
- var useStyles = makeStyles({
1041
+ var useStyles$6 = makeStyles({
1040
1042
  productForm: {
1041
1043
  overflowY: 'scroll',
1042
1044
  overflowX: 'hidden',
@@ -1123,7 +1125,7 @@ var Change = function Change(_a) {
1123
1125
  isReadOnly = _a.isReadOnly;
1124
1126
  var watch = useFormContext().watch;
1125
1127
  var isRequired = useDraftFormHelpers().isRequired;
1126
- var classes = useStyles();
1128
+ var classes = useStyles$6();
1127
1129
  return /*#__PURE__*/React__default.createElement(Grid, {
1128
1130
  item: true,
1129
1131
  container: true,
@@ -1216,7 +1218,7 @@ var FIRDraw = function FIRDraw(props) {
1216
1218
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
1217
1219
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
1218
1220
  * */
1219
- var useStyles$1 = makeStyles({
1221
+ var useStyles$5 = makeStyles({
1220
1222
  drawButtons: {
1221
1223
  color: '#0075a9',
1222
1224
  borderRadius: '5px',
@@ -1237,7 +1239,7 @@ var DrawTools = function DrawTools(_a) {
1237
1239
  type = _b === void 0 ? '' : _b,
1238
1240
  drawMode = _a.drawMode,
1239
1241
  setDrawMode = _a.setDrawMode;
1240
- var classes = useStyles$1();
1242
+ var classes = useStyles$5();
1241
1243
  return /*#__PURE__*/React__default.createElement(Grid, {
1242
1244
  item: true,
1243
1245
  xs: 12,
@@ -1556,39 +1558,39 @@ var getProductFormMode = function getProductFormMode(canBeOptions, productListIt
1556
1558
  return canBeOptions.includes('PUBLISHED') ? 'edit' : 'view';
1557
1559
  };
1558
1560
  var getProductFormLifecycleButtons = function getProductFormLifecycleButtons(canBe, onButtonPress) {
1559
- return /*#__PURE__*/createElement(Grid, {
1561
+ return /*#__PURE__*/React.createElement(Grid, {
1560
1562
  container: true,
1561
1563
  spacing: 1,
1562
1564
  justify: "flex-end"
1563
- }, canBe.includes('DISCARDED') && /*#__PURE__*/createElement(Grid, {
1565
+ }, canBe.includes('DISCARDED') && /*#__PURE__*/React.createElement(Grid, {
1564
1566
  item: true
1565
- }, /*#__PURE__*/createElement(Button, {
1567
+ }, /*#__PURE__*/React.createElement(Button, {
1566
1568
  color: "secondary",
1567
1569
  onClick: function onClick() {
1568
1570
  onButtonPress('DISCARDED');
1569
1571
  },
1570
1572
  "data-testid": "productform-dialog-discard"
1571
- }, "Discard")), canBe.includes('DRAFTED') && /*#__PURE__*/createElement(Grid, {
1573
+ }, "Discard")), canBe.includes('DRAFTED') && /*#__PURE__*/React.createElement(Grid, {
1572
1574
  item: true
1573
- }, /*#__PURE__*/createElement(Button, {
1575
+ }, /*#__PURE__*/React.createElement(Button, {
1574
1576
  color: "secondary",
1575
1577
  variant: "outlined",
1576
1578
  onClick: function onClick() {
1577
1579
  onButtonPress('DRAFT');
1578
1580
  },
1579
1581
  "data-testid": "productform-dialog-draft"
1580
- }, "Save")), canBe.includes('CANCELLED') && /*#__PURE__*/createElement(Grid, {
1582
+ }, "Save")), canBe.includes('CANCELLED') && /*#__PURE__*/React.createElement(Grid, {
1581
1583
  item: true
1582
- }, /*#__PURE__*/createElement(Button, {
1584
+ }, /*#__PURE__*/React.createElement(Button, {
1583
1585
  color: "secondary",
1584
1586
  variant: "contained",
1585
1587
  onClick: function onClick() {
1586
1588
  onButtonPress('CANCELLED');
1587
1589
  },
1588
1590
  "data-testid": "productform-dialog-cancel"
1589
- }, "Cancel")), canBe.includes('PUBLISHED') && /*#__PURE__*/createElement(Grid, {
1591
+ }, "Cancel")), canBe.includes('PUBLISHED') && /*#__PURE__*/React.createElement(Grid, {
1590
1592
  item: true
1591
- }, /*#__PURE__*/createElement(Button, {
1593
+ }, /*#__PURE__*/React.createElement(Button, {
1592
1594
  color: "secondary",
1593
1595
  variant: "contained",
1594
1596
  onClick: function onClick() {
@@ -1730,8 +1732,8 @@ var rewindGeometry = function rewindGeometry(geoJSON) {
1730
1732
  });
1731
1733
  };
1732
1734
 
1733
- var location_indicator_mwo = "EHDB";
1734
- var firareas = {
1735
+ var location_indicator_mwo$1 = "EHDB";
1736
+ var firareas$1 = {
1735
1737
  EHAA: {
1736
1738
  firname: "AMSTERDAM FIR",
1737
1739
  location_indicator_atsr: "EHAA",
@@ -1768,17 +1770,17 @@ var firareas = {
1768
1770
  ]
1769
1771
  }
1770
1772
  };
1771
- var active_firs = [
1773
+ var active_firs$1 = [
1772
1774
  "EHAA"
1773
1775
  ];
1774
1776
  var sigmetConfig = {
1775
- location_indicator_mwo: location_indicator_mwo,
1776
- firareas: firareas,
1777
- active_firs: active_firs
1777
+ location_indicator_mwo: location_indicator_mwo$1,
1778
+ firareas: firareas$1,
1779
+ active_firs: active_firs$1
1778
1780
  };
1779
1781
 
1780
- var location_indicator_mwo$1 = "EHDB";
1781
- var firareas$1 = {
1782
+ var location_indicator_mwo = "EHDB";
1783
+ var firareas = {
1782
1784
  EHAA: {
1783
1785
  firname: "AMSTERDAM FIR",
1784
1786
  location_indicator_atsr: "EHAA",
@@ -1814,13 +1816,13 @@ var firareas$1 = {
1814
1816
  ]
1815
1817
  }
1816
1818
  };
1817
- var active_firs$1 = [
1819
+ var active_firs = [
1818
1820
  "EHAA"
1819
1821
  ];
1820
1822
  var airmetConfig = {
1821
- location_indicator_mwo: location_indicator_mwo$1,
1822
- firareas: firareas$1,
1823
- active_firs: active_firs$1
1823
+ location_indicator_mwo: location_indicator_mwo,
1824
+ firareas: firareas,
1825
+ active_firs: active_firs
1824
1826
  };
1825
1827
 
1826
1828
  var invalidLevelsTill4900FTStepsMessage = 'Levels must be rounded to the nearest 100ft';
@@ -1874,7 +1876,7 @@ var Levels = function Levels(_a) {
1874
1876
  clearErrors = _c.clearErrors;
1875
1877
 
1876
1878
  var isRequired = useDraftFormHelpers().isRequired;
1877
- var classes = useStyles();
1879
+ var classes = useStyles$6();
1878
1880
  var config = productType === 'sigmet' ? sigmetConfig : airmetConfig;
1879
1881
  var allowedUnits = useProductSettings(config).allowedUnits;
1880
1882
  var selectedFIR = watch('locationIndicatorATSR'); // Get allowed level units based on selected FIR - if no FIR selected, allow all default units
@@ -2004,7 +2006,8 @@ var Levels = function Levels(_a) {
2004
2006
  }
2005
2007
  }
2006
2008
  },
2007
- disabled: isDisabled
2009
+ disabled: isDisabled,
2010
+ autoFocus: true
2008
2011
  }))) : null, (!isReadOnly || watch('levelInfoMode') === 'BETW' || watch('levelInfoMode') === 'BETW_SFC') && /*#__PURE__*/React__default.createElement(RadioButtonAndLabel, {
2009
2012
  value: "BETW",
2010
2013
  label: "Between",
@@ -2037,7 +2040,7 @@ var Levels = function Levels(_a) {
2037
2040
  disabled: isDisabled,
2038
2041
  defaultValue: 'FL',
2039
2042
  onChange: function onChange() {
2040
- trigger(__spread(getValues('level.value') || getValues('level.value') === 0 ? ['level.value'] : [], getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0 ? ['lowerLevel.value'] : [], ['lowerLevel.unit']));
2043
+ trigger(__spreadArray(__spreadArray(__spreadArray([], __read(getValues('level.value') || getValues('level.value') === 0 ? ['level.value'] : [])), __read(getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0 ? ['lowerLevel.value'] : [])), ['lowerLevel.unit']));
2041
2044
 
2042
2045
  _onChange();
2043
2046
  }
@@ -2074,7 +2077,8 @@ var Levels = function Levels(_a) {
2074
2077
  disabled: isDisabled,
2075
2078
  onChange: function onChange() {
2076
2079
  return (getValues('lowerLevel.value') || getValues('lowerLevel.value') === 0) && trigger('lowerLevel.value');
2077
- }
2080
+ },
2081
+ autoFocus: true
2078
2082
  }))), /*#__PURE__*/React__default.createElement(Grid, {
2079
2083
  item: true,
2080
2084
  xs: 12,
@@ -2233,7 +2237,8 @@ var Levels = function Levels(_a) {
2233
2237
  }
2234
2238
  }
2235
2239
  },
2236
- disabled: isDisabled
2240
+ disabled: isDisabled,
2241
+ autoFocus: true
2237
2242
  }))) : null))));
2238
2243
  };
2239
2244
 
@@ -2331,7 +2336,7 @@ var ObservationForecastTime = function ObservationForecastTime(_a) {
2331
2336
  return null;
2332
2337
  } : _b;
2333
2338
  var watch = useFormContext().watch;
2334
- var classes = useStyles();
2339
+ var classes = useStyles$6();
2335
2340
  return (!isReadOnly || watch('observationOrForecastTime') !== null) && /*#__PURE__*/React__default.createElement(Grid, {
2336
2341
  item: true,
2337
2342
  container: true,
@@ -2383,7 +2388,7 @@ var Phenomenon = function Phenomenon(_a) {
2383
2388
  setValue = _c.setValue,
2384
2389
  trigger = _c.trigger;
2385
2390
 
2386
- var classes = useStyles();
2391
+ var classes = useStyles$6();
2387
2392
  var phenomenaList = productType === 'sigmet' ? SigmetPhenomena : AirmetPhenomena;
2388
2393
  return /*#__PURE__*/React__default.createElement(Grid, {
2389
2394
  item: true,
@@ -2428,7 +2433,7 @@ var Phenomenon = function Phenomenon(_a) {
2428
2433
 
2429
2434
  _onChange();
2430
2435
 
2431
- return trigger(__spread(getValues('validDateStart') ? ['validDateStart'] : [], getValues('validDateEnd') ? ['validDateEnd'] : []));
2436
+ return trigger(__spreadArray(__spreadArray([], __read(getValues('validDateStart') ? ['validDateStart'] : [])), __read(getValues('validDateEnd') ? ['validDateEnd'] : [])));
2432
2437
  },
2433
2438
  autoFocus: true
2434
2439
  }, Object.keys(phenomenaList).map(function (key) {
@@ -2455,8 +2460,8 @@ var Phenomenon = function Phenomenon(_a) {
2455
2460
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
2456
2461
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
2457
2462
  * */
2458
- var noIntersectionMessage = 'The start position needs to be (partly) inside the FIR';
2459
- var maximum6PointsMessage = 'The start position drawing allows a maximum of 6 individual points';
2463
+ var noIntersectionMessage$1 = 'The start position needs to be (partly) inside the FIR';
2464
+ var maximum6PointsMessage$1 = 'The start position drawing allows a maximum of 6 individual points';
2460
2465
  var exitDrawModeMessage = 'Press ESC to exit draw mode';
2461
2466
  var maxFeaturePointsMessage = 'Intersection of the drawn polygon with the FIR-boundary has more than 6 individual points. Check if the TAC in the preview corresponds to the intended area.';
2462
2467
  var multiIntersectionsMessage = 'The drawn polygon has multiple intersections with the FIR-boundary. The drawn polygon will be used for the TAC-code.';
@@ -2467,7 +2472,7 @@ var StartGeometry = function StartGeometry(_a) {
2467
2472
  drawMode = _a.drawMode,
2468
2473
  geoJSONs = _a.geoJSONs,
2469
2474
  setDrawModeType = _a.setDrawModeType;
2470
- var classes = useStyles();
2475
+ var classes = useStyles$6();
2471
2476
 
2472
2477
  var _c = useFormContext(),
2473
2478
  errors = _c.errors,
@@ -2517,13 +2522,13 @@ var StartGeometry = function StartGeometry(_a) {
2517
2522
  return isMaximumOneDrawing(value) || 'Only one start position drawing is allowed';
2518
2523
  },
2519
2524
  intersectWithFIR: function intersectWithFIR(value) {
2520
- return hasIntersectionWithFIR(value, watch('startGeometryIntersect')) || noIntersectionMessage;
2525
+ return hasIntersectionWithFIR(value, watch('startGeometryIntersect')) || noIntersectionMessage$1;
2521
2526
  },
2522
2527
  coordinatesNotEmpty: function coordinatesNotEmpty(value) {
2523
2528
  return isDraft() ? true : isValidGeoJsonCoordinates(value) || 'A start position drawing is required';
2524
2529
  },
2525
2530
  hasMaxFeaturePoints: function hasMaxFeaturePoints$1(value) {
2526
- return isFir(value) ? true : !hasMaxFeaturePoints(value) || maximum6PointsMessage;
2531
+ return isFir(value) ? true : !hasMaxFeaturePoints(value) || maximum6PointsMessage$1;
2527
2532
  }
2528
2533
  }
2529
2534
  }
@@ -2550,8 +2555,8 @@ var StartGeometry = function StartGeometry(_a) {
2550
2555
  * */
2551
2556
  var movementStepValMessageKT = 'Speed should be rounded to the nearest 5kt';
2552
2557
  var movementStepValMessageKMH = 'Speed should be rounded to the nearest 10kmh';
2553
- var noIntersectionMessage$1 = 'The end position needs to be (partly) inside the FIR';
2554
- var maximum6PointsMessage$1 = 'The end position drawing allows a maximum of 6 individual points';
2558
+ var noIntersectionMessage = 'The end position needs to be (partly) inside the FIR';
2559
+ var maximum6PointsMessage = 'The end position drawing allows a maximum of 6 individual points';
2555
2560
 
2556
2561
  var _validateMovementSteps = function validateMovementSteps(value, unit) {
2557
2562
  if (isEmpty(value)) return true; // Parse to integer to check for steps
@@ -2607,7 +2612,7 @@ var Progress = function Progress(_a) {
2607
2612
  return null;
2608
2613
  } : _d;
2609
2614
 
2610
- var classes = useStyles();
2615
+ var classes = useStyles$6();
2611
2616
 
2612
2617
  var _e = useFormContext(),
2613
2618
  watch = _e.watch,
@@ -2687,7 +2692,8 @@ var Progress = function Progress(_a) {
2687
2692
  event.stopPropagation();
2688
2693
 
2689
2694
  _onChange();
2690
- }
2695
+ },
2696
+ autoFocus: true
2691
2697
  }, Object.keys(Direction).map(function (key) {
2692
2698
  return /*#__PURE__*/React__default.createElement(MenuItem, {
2693
2699
  value: key,
@@ -2793,10 +2799,10 @@ var Progress = function Progress(_a) {
2793
2799
  return getValues('movementType') === 'FORECAST_POSITION' && !isDraft() ? isValidGeoJsonCoordinates(value) || 'An end position drawing is required when selecting End position' : true;
2794
2800
  },
2795
2801
  intersectWithFIR: function intersectWithFIR(value) {
2796
- return hasIntersectionWithFIR(value, getValues('endGeometryIntersect')) || noIntersectionMessage$1;
2802
+ return hasIntersectionWithFIR(value, getValues('endGeometryIntersect')) || noIntersectionMessage;
2797
2803
  },
2798
2804
  hasMaxFeaturePoints: function hasMaxFeaturePoints$1(value) {
2799
- return isFir(value) ? true : !hasMaxFeaturePoints(value) || maximum6PointsMessage$1;
2805
+ return isFir(value) ? true : !hasMaxFeaturePoints(value) || maximum6PointsMessage;
2800
2806
  }
2801
2807
  }
2802
2808
  }
@@ -2825,7 +2831,7 @@ var Progress = function Progress(_a) {
2825
2831
  var SelectFIR = function SelectFIR(_a) {
2826
2832
  var productType = _a.productType,
2827
2833
  isDisabled = _a.isDisabled;
2828
- var classes = useStyles();
2834
+ var classes = useStyles$6();
2829
2835
  var setValue = useFormContext().setValue;
2830
2836
  var isRequired = useDraftFormHelpers().isRequired;
2831
2837
  var config = productType === 'sigmet' ? sigmetConfig : airmetConfig;
@@ -2908,7 +2914,7 @@ var Type = function Type(_a) {
2908
2914
  isDisabled = _a.isDisabled;
2909
2915
  var watch = useFormContext().watch;
2910
2916
  var isRequired = useDraftFormHelpers().isRequired;
2911
- var classes = useStyles();
2917
+ var classes = useStyles$6();
2912
2918
  return /*#__PURE__*/React__default.createElement(Grid, {
2913
2919
  item: true,
2914
2920
  container: true,
@@ -2986,7 +2992,7 @@ var ValidFrom = function ValidFrom(_a) {
2986
2992
  getValues = _c.getValues,
2987
2993
  trigger = _c.trigger;
2988
2994
 
2989
- var classes = useStyles();
2995
+ var classes = useStyles$6();
2990
2996
  var isRequired = useDraftFormHelpers().isRequired;
2991
2997
  var config = productType === 'sigmet' ? sigmetConfig : airmetConfig;
2992
2998
  return /*#__PURE__*/React__default.createElement(Grid, {
@@ -3073,7 +3079,7 @@ var ValidUntil = function ValidUntil(_a) {
3073
3079
  trigger = _c.trigger;
3074
3080
 
3075
3081
  var isRequired = useDraftFormHelpers().isRequired;
3076
- var classes = useStyles();
3082
+ var classes = useStyles$6();
3077
3083
  var config = productType === 'sigmet' ? sigmetConfig : airmetConfig;
3078
3084
  var defaultHoursValid = productType === 'sigmet' ? 3 : 1;
3079
3085
  return /*#__PURE__*/React__default.createElement(Grid, {
@@ -3156,7 +3162,7 @@ var VolcanicFields = function VolcanicFields(_a) {
3156
3162
  trigger = _b.trigger,
3157
3163
  getValues = _b.getValues;
3158
3164
 
3159
- var classes = useStyles();
3165
+ var classes = useStyles$6();
3160
3166
  return /*#__PURE__*/React__default.createElement(Grid, {
3161
3167
  item: true,
3162
3168
  container: true,
@@ -3271,7 +3277,7 @@ var SurfaceVisibility = function SurfaceVisibility(_a) {
3271
3277
  return null;
3272
3278
  } : _b;
3273
3279
 
3274
- var classes = useStyles();
3280
+ var classes = useStyles$6();
3275
3281
  var isRequired = useDraftFormHelpers().isRequired;
3276
3282
  return /*#__PURE__*/React__default.createElement(Grid, {
3277
3283
  item: true,
@@ -3374,7 +3380,7 @@ var SurfaceWind = function SurfaceWind(_a) {
3374
3380
  watch = _c.watch;
3375
3381
 
3376
3382
  var isRequired = useDraftFormHelpers().isRequired;
3377
- var classes = useStyles();
3383
+ var classes = useStyles$6();
3378
3384
  var allowedUnits = useProductSettings(airmetConfig).allowedUnits;
3379
3385
  var selectedFIR = watch('locationIndicatorATSR'); // Get allowed speed units based on selected FIR - if no FIR selected, allow all units
3380
3386
 
@@ -3526,7 +3532,7 @@ var CloudLevels = function CloudLevels(_a) {
3526
3532
  getValues = _c.getValues;
3527
3533
 
3528
3534
  var isRequired = useDraftFormHelpers().isRequired;
3529
- var classes = useStyles();
3535
+ var classes = useStyles$6();
3530
3536
  var allowedUnits = useProductSettings(airmetConfig).allowedUnits;
3531
3537
  var selectedFIR = watch('locationIndicatorATSR'); // Get allowed cloud level units based on selected FIR - if no FIR selected, allow all default units
3532
3538
 
@@ -3769,7 +3775,7 @@ var CloudLevels = function CloudLevels(_a) {
3769
3775
  })))))));
3770
3776
  };
3771
3777
 
3772
- var useStyles$2 = makeStyles({
3778
+ var useStyles$4 = makeStyles({
3773
3779
  tacOutput: {
3774
3780
  paddingTop: '16px',
3775
3781
  whiteSpace: 'break-spaces'
@@ -3808,7 +3814,7 @@ var useTAC = function useTAC(initialProduct, getTAC) {
3808
3814
 
3809
3815
  var retrieveTAC = function retrieveTAC(product) {
3810
3816
  return __awaiter(void 0, void 0, void 0, function () {
3811
- var result, error_1;
3817
+ var result;
3812
3818
  return __generator(this, function (_a) {
3813
3819
  switch (_a.label) {
3814
3820
  case 0:
@@ -3830,7 +3836,7 @@ var useTAC = function useTAC(initialProduct, getTAC) {
3830
3836
  , 3];
3831
3837
 
3832
3838
  case 2:
3833
- error_1 = _a.sent();
3839
+ _a.sent();
3834
3840
 
3835
3841
  if (isMounted.current) {
3836
3842
  setTAC(noTAC);
@@ -3871,7 +3877,7 @@ var useTAC = function useTAC(initialProduct, getTAC) {
3871
3877
 
3872
3878
  var ProductFormTAC = function ProductFormTAC(_a) {
3873
3879
  var tac = _a.tac;
3874
- var classes = useStyles$2();
3880
+ var classes = useStyles$4();
3875
3881
  var tacLines = tac.split('\n');
3876
3882
  return /*#__PURE__*/React__default.createElement(Typography, {
3877
3883
  variant: "body2",
@@ -3895,7 +3901,7 @@ var SigmetForm = function SigmetForm(_a) {
3895
3901
  initialSigmet = _c === void 0 ? null : _c,
3896
3902
  _d = _a.initialCancelSigmet,
3897
3903
  initialCancelSigmet = _d === void 0 ? null : _d;
3898
- var classes = useStyles();
3904
+ var classes = useStyles$6();
3899
3905
  var api = useApiContext().api;
3900
3906
 
3901
3907
  var _e = useFormContext(),
@@ -4159,7 +4165,7 @@ var AirmetForm = function AirmetForm(_a) {
4159
4165
  initialAirmet = _c === void 0 ? null : _c,
4160
4166
  _d = _a.initialCancelAirmet,
4161
4167
  initialCancelAirmet = _d === void 0 ? null : _d;
4162
- var classes = useStyles();
4168
+ var classes = useStyles$6();
4163
4169
  var api = useApiContext().api;
4164
4170
 
4165
4171
  var _e = useFormContext(),
@@ -4415,46 +4421,46 @@ var ContentDialog = function ContentDialog(_a) {
4415
4421
  }
4416
4422
  };
4417
4423
 
4418
- return /*#__PURE__*/createElement(Dialog, __assign({
4424
+ return /*#__PURE__*/React.createElement(Dialog, __assign({
4419
4425
  "data-testid": "contentDialog",
4420
4426
  open: open,
4421
4427
  onClose: handleClose,
4422
4428
  maxWidth: other.maxWidth ? other.maxWidth : 'lg',
4423
4429
  disableBackdropClick: true
4424
- }, other), /*#__PURE__*/createElement(DialogTitle, {
4430
+ }, other), /*#__PURE__*/React.createElement(DialogTitle, {
4425
4431
  disableTypography: true,
4426
4432
  className: classes.dialogHeader
4427
- }, /*#__PURE__*/createElement(Grid, {
4433
+ }, /*#__PURE__*/React.createElement(Grid, {
4428
4434
  container: true,
4429
4435
  alignItems: "center"
4430
- }, /*#__PURE__*/createElement(Grid, {
4436
+ }, /*#__PURE__*/React.createElement(Grid, {
4431
4437
  item: true,
4432
4438
  xs: true
4433
- }, /*#__PURE__*/createElement(Button, {
4439
+ }, /*#__PURE__*/React.createElement(Button, {
4434
4440
  onClick: handleClose,
4435
4441
  color: "secondary",
4436
4442
  size: "medium",
4437
- startIcon: /*#__PURE__*/createElement(ArrowBackIos, {
4443
+ startIcon: /*#__PURE__*/React.createElement(ArrowBackIos, {
4438
4444
  fontSize: "small",
4439
4445
  color: "secondary"
4440
4446
  }),
4441
4447
  "data-testid": "contentdialog-close"
4442
- }, /*#__PURE__*/createElement(Typography, {
4448
+ }, /*#__PURE__*/React.createElement(Typography, {
4443
4449
  variant: "subtitle1",
4444
4450
  color: "secondary"
4445
- }, "BACK"))), /*#__PURE__*/createElement(Grid, {
4451
+ }, "BACK"))), /*#__PURE__*/React.createElement(Grid, {
4446
4452
  item: true,
4447
4453
  xs: true,
4448
4454
  className: classes.dialogTitle
4449
- }, /*#__PURE__*/createElement(Typography, {
4455
+ }, /*#__PURE__*/React.createElement(Typography, {
4450
4456
  "data-testid": "dialogTitle",
4451
4457
  variant: "h6"
4452
- }, title)), /*#__PURE__*/createElement(Grid, {
4458
+ }, title)), /*#__PURE__*/React.createElement(Grid, {
4453
4459
  item: true,
4454
4460
  xs: true
4455
- }, /*#__PURE__*/createElement(Grid, {
4461
+ }, /*#__PURE__*/React.createElement(Grid, {
4456
4462
  container: true
4457
- }, options)))), alertBanner !== null && alertBanner, /*#__PURE__*/createElement(DialogContent, {
4463
+ }, options)))), alertBanner !== null && alertBanner, /*#__PURE__*/React.createElement(DialogContent, {
4458
4464
  className: classes.dialogChildren
4459
4465
  }, children));
4460
4466
  };
@@ -4525,7 +4531,7 @@ var getCancelSeqId = function getCancelSeqId(product) {
4525
4531
  return product.cancelsAirmetSequenceId;
4526
4532
  };
4527
4533
 
4528
- var useStyles$4 = makeStyles({
4534
+ var useStyles$2 = makeStyles({
4529
4535
  cardWrapper: {
4530
4536
  width: '100%'
4531
4537
  },
@@ -4556,7 +4562,7 @@ var formatValidTime = function formatValidTime(startDate, endDate, format) {
4556
4562
  var ProductListRow = function ProductListRow(_a) {
4557
4563
  var product = _a.product,
4558
4564
  productType = _a.productType;
4559
- var classes = useStyles$4();
4565
+ var classes = useStyles$2();
4560
4566
  var api = useApiContext().api;
4561
4567
  var isMounted = useIsMounted().isMounted;
4562
4568
 
@@ -4682,7 +4688,7 @@ var ProductListRow = function ProductListRow(_a) {
4682
4688
  * Copyright 2021 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
4683
4689
  * Copyright 2021 - Finnish Meteorological Institute (FMI)
4684
4690
  * */
4685
- var useStyles$5 = makeStyles({
4691
+ var useStyles$1 = makeStyles({
4686
4692
  errorMessage: {
4687
4693
  width: '1200px',
4688
4694
  marginTop: '10px'
@@ -4703,7 +4709,7 @@ var ProductList = function ProductList(_a) {
4703
4709
  error = _a.error,
4704
4710
  onClickProductRow = _a.onClickProductRow,
4705
4711
  onClickNewProduct = _a.onClickNewProduct;
4706
- var classes = useStyles$5();
4712
+ var classes = useStyles$1();
4707
4713
  return /*#__PURE__*/React__default.createElement(Grid, {
4708
4714
  container: true,
4709
4715
  direction: "column",
@@ -4792,7 +4798,7 @@ var CancelSigmetVolcanicMovements = function CancelSigmetVolcanicMovements(_a) {
4792
4798
  })));
4793
4799
  };
4794
4800
 
4795
- var useStyles$6 = makeStyles({
4801
+ var useStyles = makeStyles({
4796
4802
  backdrop: {
4797
4803
  zIndex: 1500,
4798
4804
  color: '#fff'
@@ -4821,7 +4827,7 @@ var ProductFormDialogContent = function ProductFormDialogContent(_a) {
4821
4827
  productType = _a.productType,
4822
4828
  productCanBe = _a.productCanBe,
4823
4829
  product = _a.product;
4824
- var classes = useStyles$6();
4830
+ var classes = useStyles();
4825
4831
  var api = useApiContext().api;
4826
4832
  var apiCall = productType === 'sigmet' ? api.postSigmet : api.postAirmet;
4827
4833
 
@@ -4840,19 +4846,19 @@ var ProductFormDialogContent = function ProductFormDialogContent(_a) {
4840
4846
  usePreventBrowserClose(isDirty);
4841
4847
  var confirmationDialog = useConfirmationDialog();
4842
4848
 
4843
- var _d = __read(useState(false), 2),
4849
+ var _d = __read(React.useState(false), 2),
4844
4850
  showLoader = _d[0],
4845
4851
  setLoader = _d[1];
4846
4852
 
4847
- var _e = __read(useState(false), 2),
4853
+ var _e = __read(React.useState(false), 2),
4848
4854
  errorStoreMessage = _e[0],
4849
4855
  setErrorStoreMessage = _e[1];
4850
4856
 
4851
- var _f = __read(useState(''), 2),
4857
+ var _f = __read(React.useState(''), 2),
4852
4858
  errorStoreMessageText = _f[0],
4853
4859
  setErrorStoreMessageText = _f[1];
4854
4860
 
4855
- useEffect(function () {
4861
+ React.useEffect(function () {
4856
4862
  // set the values of the newly selected product
4857
4863
  reset(product !== null ? __assign({}, product) : {});
4858
4864
  return function () {
@@ -4863,8 +4869,8 @@ var ProductFormDialogContent = function ProductFormDialogContent(_a) {
4863
4869
 
4864
4870
  var postProduct = function postProduct(_productToPost, newStatus) {
4865
4871
  // remove hidden helper fields
4866
- var IS_DRAFT = _productToPost.IS_DRAFT,
4867
- productToPost = __rest(_productToPost, ["IS_DRAFT"]);
4872
+ _productToPost.IS_DRAFT;
4873
+ var productToPost = __rest(_productToPost, ["IS_DRAFT"]);
4868
4874
 
4869
4875
  var uuid = product !== null && product.uuid ? product.uuid : null;
4870
4876
  var postProductParam = productType === 'sigmet' ? createSigmetPostParameter(productToPost, newStatus, uuid) : createAirmetPostParameter(productToPost, newStatus, uuid);
@@ -4896,7 +4902,7 @@ var ProductFormDialogContent = function ProductFormDialogContent(_a) {
4896
4902
  confirmLabel: getConfirmationDialogButtonLabel(action, productType),
4897
4903
  cancelLabel: getConfirmationDialogCancelLabel(action),
4898
4904
  catchOnCancel: action === 'CLOSED',
4899
- content: isVAPhenomenon(product, action) ? /*#__PURE__*/createElement(CancelSigmetVolcanicMovements, {
4905
+ content: isVAPhenomenon(product, action) ? /*#__PURE__*/React.createElement(CancelSigmetVolcanicMovements, {
4900
4906
  sigmet: product
4901
4907
  }) : null
4902
4908
  });
@@ -4965,7 +4971,7 @@ var ProductFormDialogContent = function ProductFormDialogContent(_a) {
4965
4971
  };
4966
4972
 
4967
4973
  var title = getDialogtitle(product, productType);
4968
- return /*#__PURE__*/createElement(ContentDialog, {
4974
+ return /*#__PURE__*/React.createElement(ContentDialog, {
4969
4975
  open: isOpen,
4970
4976
  toggleDialogStatus: function toggleDialogStatus() {
4971
4977
  return onProductButtonPress('CLOSED');
@@ -4978,27 +4984,27 @@ var ProductFormDialogContent = function ProductFormDialogContent(_a) {
4978
4984
  onClose: function onClose() {
4979
4985
  return onProductButtonPress('CLOSED');
4980
4986
  },
4981
- alertBanner: errorStoreMessage ? /*#__PURE__*/createElement(AlertBanner, {
4987
+ alertBanner: errorStoreMessage ? /*#__PURE__*/React.createElement(AlertBanner, {
4982
4988
  severity: "error",
4983
4989
  title: "An error has occurred while saving, please try again",
4984
4990
  info: errorStoreMessageText
4985
4991
  }) : null,
4986
4992
  options: getProductFormLifecycleButtons(productCanBe, onProductButtonPress)
4987
- }, productType === 'sigmet' ? /*#__PURE__*/createElement(SigmetForm, {
4993
+ }, productType === 'sigmet' ? /*#__PURE__*/React.createElement(SigmetForm, {
4988
4994
  mode: mode,
4989
4995
  isCancelSigmet: product !== null && isInstanceOfCancelSigmet(product),
4990
4996
  initialSigmet: product !== null && !isInstanceOfCancelSigmet(product) ? product : null,
4991
4997
  initialCancelSigmet: product !== null && isInstanceOfCancelSigmet(product) ? product : null
4992
- }) : /*#__PURE__*/createElement(AirmetForm, {
4998
+ }) : /*#__PURE__*/React.createElement(AirmetForm, {
4993
4999
  mode: mode,
4994
5000
  isCancelAirmet: product !== null && isInstanceOfCancelAirmet(product),
4995
5001
  initialAirmet: product !== null && !isInstanceOfCancelAirmet(product) ? product : null,
4996
5002
  initialCancelAirmet: product !== null && isInstanceOfCancelAirmet(product) ? product : null
4997
- }), /*#__PURE__*/createElement(DraftFieldHelper, null), /*#__PURE__*/createElement(Backdrop, {
5003
+ }), /*#__PURE__*/React.createElement(DraftFieldHelper, null), /*#__PURE__*/React.createElement(Backdrop, {
4998
5004
  "data-testid": "loader",
4999
5005
  open: showLoader,
5000
5006
  className: classes.backdrop
5001
- }, /*#__PURE__*/createElement(CircularProgress, {
5007
+ }, /*#__PURE__*/React.createElement(CircularProgress, {
5002
5008
  color: "inherit"
5003
5009
  })));
5004
5010
  };
@@ -5034,9 +5040,9 @@ var ProductFormDialog = function ProductFormDialog(_a) {
5034
5040
  return null;
5035
5041
  }
5036
5042
 
5037
- return /*#__PURE__*/createElement(ReactHookFormProvider, {
5043
+ return /*#__PURE__*/React.createElement(ReactHookFormProvider, {
5038
5044
  options: defaultFormOptions
5039
- }, /*#__PURE__*/createElement(ConfirmationServiceProvider, null, /*#__PURE__*/createElement(ProductFormDialogContent, {
5045
+ }, /*#__PURE__*/React.createElement(ConfirmationServiceProvider, null, /*#__PURE__*/React.createElement(ProductFormDialogContent, {
5040
5046
  isOpen: isOpen,
5041
5047
  toggleDialogStatus: toggleDialogStatus,
5042
5048
  mode: mode,