@northern.tech/store 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/dist/actions.js +183 -129
  2. package/dist/actions.js.map +1 -1
  3. package/dist/actions.mjs +13 -13
  4. package/dist/api/general-api.js +42 -55
  5. package/dist/api/general-api.js.map +1 -1
  6. package/dist/api/general-api.mjs +6 -6
  7. package/dist/api/users-api.js +44 -70
  8. package/dist/api/users-api.js.map +1 -1
  9. package/dist/api/users-api.mjs +7 -7
  10. package/dist/appSlice/constants.js +1 -39
  11. package/dist/appSlice/constants.js.map +1 -1
  12. package/dist/appSlice/constants.mjs +2 -2
  13. package/dist/appSlice/index.js +51 -68
  14. package/dist/appSlice/index.js.map +1 -1
  15. package/dist/appSlice/index.mjs +5 -5
  16. package/dist/appSlice/selectors.js +1 -43
  17. package/dist/appSlice/selectors.js.map +1 -1
  18. package/dist/appSlice/selectors.mjs +2 -2
  19. package/dist/appSlice/thunks.js +563 -544
  20. package/dist/appSlice/thunks.js.map +1 -1
  21. package/dist/appSlice/thunks.mjs +28 -28
  22. package/dist/auth.js +39 -55
  23. package/dist/auth.js.map +1 -1
  24. package/dist/auth.mjs +5 -5
  25. package/dist/{chunk-C2YZYTJ6.mjs → chunk-2Z3RFYW4.mjs} +2 -11
  26. package/dist/{chunk-C2YZYTJ6.mjs.map → chunk-2Z3RFYW4.mjs.map} +1 -1
  27. package/dist/{chunk-OWHFMKTA.mjs → chunk-3ORTTLIB.mjs} +19 -16
  28. package/dist/{chunk-OWHFMKTA.mjs.map → chunk-3ORTTLIB.mjs.map} +1 -1
  29. package/dist/{chunk-NCI6JV5R.mjs → chunk-4SDUITD4.mjs} +6 -12
  30. package/dist/{chunk-NCI6JV5R.mjs.map → chunk-4SDUITD4.mjs.map} +1 -1
  31. package/dist/{chunk-BOSBROA3.mjs → chunk-5VNQCCAQ.mjs} +2 -7
  32. package/dist/{chunk-BOSBROA3.mjs.map → chunk-5VNQCCAQ.mjs.map} +1 -1
  33. package/dist/{chunk-2P4VECEE.mjs → chunk-65YIOCCD.mjs} +6 -11
  34. package/dist/{chunk-2P4VECEE.mjs.map → chunk-65YIOCCD.mjs.map} +1 -1
  35. package/dist/{chunk-QG4PT5WK.mjs → chunk-6CSGHZ3E.mjs} +9 -21
  36. package/dist/{chunk-QG4PT5WK.mjs.map → chunk-6CSGHZ3E.mjs.map} +1 -1
  37. package/dist/{chunk-X65NMDPS.mjs → chunk-AZRVRNXT.mjs} +40 -30
  38. package/dist/{chunk-X65NMDPS.mjs.map → chunk-AZRVRNXT.mjs.map} +1 -1
  39. package/dist/{chunk-M4U5R7A4.mjs → chunk-B42NUKMZ.mjs} +2 -6
  40. package/dist/{chunk-M4U5R7A4.mjs.map → chunk-B42NUKMZ.mjs.map} +1 -1
  41. package/dist/{chunk-BWFTQHNM.mjs → chunk-CHUCIHMY.mjs} +3 -4
  42. package/dist/{chunk-BWFTQHNM.mjs.map → chunk-CHUCIHMY.mjs.map} +1 -1
  43. package/dist/{chunk-UPMSYTWW.mjs → chunk-DIZJVB6M.mjs} +306 -291
  44. package/dist/{chunk-UPMSYTWW.mjs.map → chunk-DIZJVB6M.mjs.map} +1 -1
  45. package/dist/chunk-H5UCKQWK.mjs +41 -0
  46. package/dist/{chunk-ENLZPHTQ.mjs.map → chunk-H5UCKQWK.mjs.map} +1 -1
  47. package/dist/{chunk-MQIKQKSW.mjs → chunk-IFWKT27G.mjs} +37 -33
  48. package/dist/{chunk-MQIKQKSW.mjs.map → chunk-IFWKT27G.mjs.map} +1 -1
  49. package/dist/{chunk-EM2HUGUY.mjs → chunk-JA27QXVB.mjs} +37 -28
  50. package/dist/{chunk-EM2HUGUY.mjs.map → chunk-JA27QXVB.mjs.map} +1 -1
  51. package/dist/{chunk-2HCZYULZ.mjs → chunk-K2NZL5V4.mjs} +3 -6
  52. package/dist/{chunk-2HCZYULZ.mjs.map → chunk-K2NZL5V4.mjs.map} +1 -1
  53. package/dist/{chunk-Y47SYXII.mjs → chunk-KJAZNKV2.mjs} +43 -52
  54. package/dist/{chunk-Y47SYXII.mjs.map → chunk-KJAZNKV2.mjs.map} +1 -1
  55. package/dist/{chunk-U6YTBIDT.mjs → chunk-KPPU6OWF.mjs} +27 -39
  56. package/dist/{chunk-U6YTBIDT.mjs.map → chunk-KPPU6OWF.mjs.map} +1 -1
  57. package/dist/{chunk-EFHEROXZ.mjs → chunk-KZSTW27Q.mjs} +30 -18
  58. package/dist/{chunk-EFHEROXZ.mjs.map → chunk-KZSTW27Q.mjs.map} +1 -1
  59. package/dist/chunk-LZOMFHX3.mjs +38 -0
  60. package/dist/{chunk-RWYS5MKN.mjs → chunk-NJNSCJEY.mjs} +22 -26
  61. package/dist/{chunk-RWYS5MKN.mjs.map → chunk-NJNSCJEY.mjs.map} +1 -1
  62. package/dist/{chunk-ZLRZO4EY.mjs → chunk-O6TYYKSD.mjs} +62 -60
  63. package/dist/chunk-O6TYYKSD.mjs.map +1 -0
  64. package/dist/{chunk-OGAMVFPS.mjs → chunk-QQBUNZHA.mjs} +2 -6
  65. package/dist/{chunk-OGAMVFPS.mjs.map → chunk-QQBUNZHA.mjs.map} +1 -1
  66. package/dist/{chunk-WS3YYLTJ.mjs → chunk-R7LXL3KJ.mjs} +14 -13
  67. package/dist/{chunk-WS3YYLTJ.mjs.map → chunk-R7LXL3KJ.mjs.map} +1 -1
  68. package/dist/{chunk-MJW4632R.mjs → chunk-WCUGLHYM.mjs} +16 -20
  69. package/dist/{chunk-MJW4632R.mjs.map → chunk-WCUGLHYM.mjs.map} +1 -1
  70. package/dist/chunk-WYHJFSMQ.mjs +25 -0
  71. package/dist/{chunk-L4HIW3KB.mjs.map → chunk-WYHJFSMQ.mjs.map} +1 -1
  72. package/dist/{chunk-XJNI62IP.mjs → chunk-XC5UXEIB.mjs} +4 -11
  73. package/dist/{chunk-XJNI62IP.mjs.map → chunk-XC5UXEIB.mjs.map} +1 -1
  74. package/dist/{chunk-4U4X4KAC.mjs → chunk-XD7INCM4.mjs} +11 -17
  75. package/dist/{chunk-4U4X4KAC.mjs.map → chunk-XD7INCM4.mjs.map} +1 -1
  76. package/dist/{chunk-ZZ6VIQ3U.mjs → chunk-ZE7R2XXE.mjs} +10 -12
  77. package/dist/{chunk-ZZ6VIQ3U.mjs.map → chunk-ZE7R2XXE.mjs.map} +1 -1
  78. package/dist/{chunk-4C6IY46N.mjs → chunk-ZK4W5T53.mjs} +7 -11
  79. package/dist/{chunk-4C6IY46N.mjs.map → chunk-ZK4W5T53.mjs.map} +1 -1
  80. package/dist/commonConstants.js +1 -35
  81. package/dist/commonConstants.js.map +1 -1
  82. package/dist/commonConstants.mjs +2 -2
  83. package/dist/commonSelectors.js +73 -135
  84. package/dist/commonSelectors.js.map +1 -1
  85. package/dist/commonSelectors.mjs +12 -12
  86. package/dist/constants.js +36 -153
  87. package/dist/constants.js.map +1 -1
  88. package/dist/constants.mjs +14 -14
  89. package/dist/deploymentsSlice/constants.js +34 -59
  90. package/dist/deploymentsSlice/constants.js.map +1 -1
  91. package/dist/deploymentsSlice/constants.mjs +4 -4
  92. package/dist/deploymentsSlice/index.js +68 -79
  93. package/dist/deploymentsSlice/index.js.map +1 -1
  94. package/dist/deploymentsSlice/index.mjs +5 -5
  95. package/dist/deploymentsSlice/selectors.js +35 -52
  96. package/dist/deploymentsSlice/selectors.js.map +1 -1
  97. package/dist/deploymentsSlice/selectors.mjs +5 -5
  98. package/dist/deploymentsSlice/thunks.js +563 -553
  99. package/dist/deploymentsSlice/thunks.js.map +1 -1
  100. package/dist/deploymentsSlice/thunks.mjs +28 -28
  101. package/dist/devicesSlice/constants.js +34 -58
  102. package/dist/devicesSlice/constants.js.map +1 -1
  103. package/dist/devicesSlice/constants.mjs +4 -4
  104. package/dist/devicesSlice/index.js +71 -81
  105. package/dist/devicesSlice/index.js.map +1 -1
  106. package/dist/devicesSlice/index.mjs +5 -5
  107. package/dist/devicesSlice/selectors.js +40 -89
  108. package/dist/devicesSlice/selectors.js.map +1 -1
  109. package/dist/devicesSlice/selectors.mjs +5 -5
  110. package/dist/devicesSlice/thunks.js +563 -589
  111. package/dist/devicesSlice/thunks.js.map +1 -1
  112. package/dist/devicesSlice/thunks.mjs +28 -28
  113. package/dist/monitorSlice/constants.js +34 -45
  114. package/dist/monitorSlice/constants.js.map +1 -1
  115. package/dist/monitorSlice/constants.mjs +4 -4
  116. package/dist/monitorSlice/index.js +41 -52
  117. package/dist/monitorSlice/index.js.map +1 -1
  118. package/dist/monitorSlice/index.mjs +5 -5
  119. package/dist/monitorSlice/selectors.js +0 -4
  120. package/dist/monitorSlice/selectors.mjs +1 -1
  121. package/dist/monitorSlice/thunks.js +249 -232
  122. package/dist/monitorSlice/thunks.js.map +1 -1
  123. package/dist/monitorSlice/thunks.mjs +25 -25
  124. package/dist/onboardingSlice/constants.js +0 -5
  125. package/dist/onboardingSlice/constants.mjs +1 -1
  126. package/dist/onboardingSlice/index.js +1 -22
  127. package/dist/onboardingSlice/index.js.map +1 -1
  128. package/dist/onboardingSlice/index.mjs +2 -2
  129. package/dist/onboardingSlice/selectors.js +0 -4
  130. package/dist/onboardingSlice/selectors.mjs +1 -1
  131. package/dist/onboardingSlice/thunks.js +563 -547
  132. package/dist/onboardingSlice/thunks.js.map +1 -1
  133. package/dist/onboardingSlice/thunks.mjs +28 -28
  134. package/dist/organizationSlice/constants.js +34 -56
  135. package/dist/organizationSlice/constants.js.map +1 -1
  136. package/dist/organizationSlice/constants.mjs +4 -4
  137. package/dist/organizationSlice/index.js +45 -53
  138. package/dist/organizationSlice/index.js.map +1 -1
  139. package/dist/organizationSlice/index.mjs +5 -5
  140. package/dist/organizationSlice/selectors.js +35 -61
  141. package/dist/organizationSlice/selectors.js.map +1 -1
  142. package/dist/organizationSlice/selectors.mjs +5 -5
  143. package/dist/organizationSlice/thunks.js +563 -572
  144. package/dist/organizationSlice/thunks.js.map +1 -1
  145. package/dist/organizationSlice/thunks.mjs +28 -28
  146. package/dist/releasesSlice/constants.js +0 -7
  147. package/dist/releasesSlice/constants.mjs +1 -1
  148. package/dist/releasesSlice/index.js +38 -64
  149. package/dist/releasesSlice/index.js.map +1 -1
  150. package/dist/releasesSlice/index.mjs +5 -5
  151. package/dist/releasesSlice/selectors.js +37 -57
  152. package/dist/releasesSlice/selectors.js.map +1 -1
  153. package/dist/releasesSlice/selectors.mjs +6 -6
  154. package/dist/releasesSlice/thunks.js +293 -281
  155. package/dist/releasesSlice/thunks.js.map +1 -1
  156. package/dist/releasesSlice/thunks.mjs +25 -25
  157. package/dist/selectors.js +73 -207
  158. package/dist/selectors.js.map +1 -1
  159. package/dist/selectors.mjs +43 -43
  160. package/dist/store.js +194 -151
  161. package/dist/store.js.map +1 -1
  162. package/dist/store.mjs +16 -16
  163. package/dist/storehooks.js +568 -547
  164. package/dist/storehooks.js.map +1 -1
  165. package/dist/storehooks.mjs +38 -41
  166. package/dist/storehooks.mjs.map +1 -1
  167. package/dist/thunks.js +563 -702
  168. package/dist/thunks.js.map +1 -1
  169. package/dist/thunks.mjs +28 -28
  170. package/dist/usersSlice/constants.js +36 -66
  171. package/dist/usersSlice/constants.js.map +1 -1
  172. package/dist/usersSlice/constants.mjs +4 -4
  173. package/dist/usersSlice/index.js +62 -71
  174. package/dist/usersSlice/index.js.map +1 -1
  175. package/dist/usersSlice/index.mjs +5 -5
  176. package/dist/usersSlice/selectors.js +41 -66
  177. package/dist/usersSlice/selectors.js.map +1 -1
  178. package/dist/usersSlice/selectors.mjs +6 -6
  179. package/dist/usersSlice/thunks.js +563 -576
  180. package/dist/usersSlice/thunks.js.map +1 -1
  181. package/dist/usersSlice/thunks.mjs +28 -28
  182. package/dist/utils.js +57 -93
  183. package/dist/utils.js.map +1 -1
  184. package/dist/utils.mjs +5 -5
  185. package/package.json +66 -1
  186. package/dist/chunk-ENLZPHTQ.mjs +0 -35
  187. package/dist/chunk-L4HIW3KB.mjs +0 -36
  188. package/dist/chunk-XWBD7VOK.mjs +0 -93
  189. package/dist/chunk-ZLRZO4EY.mjs.map +0 -1
  190. /package/dist/{chunk-XWBD7VOK.mjs.map → chunk-LZOMFHX3.mjs.map} +0 -0
@@ -1,40 +1,10 @@
1
1
  "use strict";
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
6
  var __getProtoOf = Object.getPrototypeOf;
10
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __restKey = (key) => typeof key === "symbol" ? key : key + "";
26
- var __objRest = (source, exclude) => {
27
- var target = {};
28
- for (var prop in source)
29
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
30
- target[prop] = source[prop];
31
- if (source != null && __getOwnPropSymbols)
32
- for (var prop of __getOwnPropSymbols(source)) {
33
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
34
- target[prop] = source[prop];
35
- }
36
- return target;
37
- };
38
8
  var __commonJS = (cb, mod) => function __require() {
39
9
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
40
10
  };
@@ -59,33 +29,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
59
29
  mod
60
30
  ));
61
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
62
- var __async = (__this, __arguments, generator) => {
63
- return new Promise((resolve, reject) => {
64
- var fulfilled = (value) => {
65
- try {
66
- step(generator.next(value));
67
- } catch (e) {
68
- reject(e);
69
- }
70
- };
71
- var rejected = (value) => {
72
- try {
73
- step(generator.throw(value));
74
- } catch (e) {
75
- reject(e);
76
- }
77
- };
78
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
79
- step((generator = generator.apply(__this, __arguments)).next());
80
- });
81
- };
82
32
 
83
33
  // ../../node_modules/pluralize/pluralize.js
84
34
  var require_pluralize = __commonJS({
85
- "../../node_modules/pluralize/pluralize.js"(exports2, module2) {
35
+ "../../node_modules/pluralize/pluralize.js"(exports, module2) {
86
36
  "use strict";
87
37
  (function(root, pluralize2) {
88
- if (typeof require === "function" && typeof exports2 === "object" && typeof module2 === "object") {
38
+ if (typeof require === "function" && typeof exports === "object" && typeof module2 === "object") {
89
39
  module2.exports = pluralize2();
90
40
  } else if (typeof define === "function" && define.amd) {
91
41
  define(function() {
@@ -94,7 +44,7 @@ var require_pluralize = __commonJS({
94
44
  } else {
95
45
  root.pluralize = pluralize2();
96
46
  }
97
- })(exports2, function() {
47
+ })(exports, function() {
98
48
  var pluralRules = [];
99
49
  var singularRules = [];
100
50
  var uncountables = {};
@@ -467,7 +417,7 @@ var chartTypes = {
467
417
  };
468
418
  var emptyChartSelection = { software: "", group: "", chartType: chartTypes.bar.key, attribute: "artifact_name" };
469
419
  var defaultReportType = "distribution";
470
- var defaultReports = [__spreadProps(__spreadValues({}, emptyChartSelection), { group: null, attribute: "artifact_name", type: defaultReportType })];
420
+ var defaultReports = [{ ...emptyChartSelection, group: null, attribute: "artifact_name", type: defaultReportType }];
471
421
  var locations = {};
472
422
  var PLANS = {
473
423
  os: {
@@ -800,7 +750,7 @@ var emptyRole = Object.freeze({
800
750
  name: void 0,
801
751
  description: "",
802
752
  permissions: [],
803
- uiPermissions: Object.freeze(__spreadValues({}, emptyUiPermissions))
753
+ uiPermissions: Object.freeze({ ...emptyUiPermissions })
804
754
  });
805
755
 
806
756
  // src/deploymentsSlice/constants.ts
@@ -829,11 +779,12 @@ var deploymentStatesToSubstates = {
829
779
  pending: [deploymentSubstates.pending],
830
780
  successes: [deploymentSubstates.success, deploymentSubstates.alreadyInstalled, deploymentSubstates.noartifact]
831
781
  };
832
- var deploymentStatesToSubstatesWithSkipped = __spreadProps(__spreadValues({}, deploymentStatesToSubstates), {
782
+ var deploymentStatesToSubstatesWithSkipped = {
783
+ ...deploymentStatesToSubstates,
833
784
  failures: [deploymentSubstates.failure],
834
785
  skipped: [deploymentSubstates.aborted, deploymentSubstates.noartifact, deploymentSubstates.alreadyInstalled, deploymentSubstates.decommissioned],
835
786
  successes: [deploymentSubstates.success]
836
- });
787
+ };
837
788
  var installationSubstatesMap = {
838
789
  download: {
839
790
  title: "download",
@@ -878,8 +829,8 @@ var DEPLOYMENT_STATES = {
878
829
  var listDefaultsByState = {
879
830
  [DEPLOYMENT_STATES.inprogress]: { page: 1, perPage: 10 },
880
831
  [DEPLOYMENT_STATES.pending]: { page: 1, perPage: 10 },
881
- [DEPLOYMENT_STATES.scheduled]: __spreadValues({}, DEVICE_LIST_DEFAULTS),
882
- [DEPLOYMENT_STATES.finished]: __spreadValues({}, DEVICE_LIST_DEFAULTS),
832
+ [DEPLOYMENT_STATES.scheduled]: { ...DEVICE_LIST_DEFAULTS },
833
+ [DEPLOYMENT_STATES.finished]: { ...DEVICE_LIST_DEFAULTS },
883
834
  sort: { direction: SORTING_OPTIONS.desc }
884
835
  };
885
836
  var DEFAULT_PENDING_INPROGRESS_COUNT = 10;
@@ -1254,7 +1205,7 @@ var uiPermissionsByArea = {
1254
1205
  }
1255
1206
  };
1256
1207
  var permissionMapper = (permission) => permission.value;
1257
- var itemUiPermissionsReducer = (accu, { item, uiPermissions }) => item ? __spreadProps(__spreadValues({}, accu), { [item]: uiPermissions }) : accu;
1208
+ var itemUiPermissionsReducer = (accu, { item, uiPermissions }) => item ? { ...accu, [item]: uiPermissions } : accu;
1258
1209
  var rolesById = Object.freeze({
1259
1210
  [staticRolesByName.admin]: {
1260
1211
  name: "Admin",
@@ -1262,54 +1213,59 @@ var rolesById = Object.freeze({
1262
1213
  description: "Full access",
1263
1214
  permissions: [],
1264
1215
  // permissions refers to the values returned from the backend
1265
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1216
+ uiPermissions: {
1217
+ ...emptyUiPermissions,
1266
1218
  auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),
1267
1219
  deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),
1268
1220
  groups: { [ALL_DEVICES]: uiPermissionsByArea.groups.uiPermissions.map(permissionMapper) },
1269
1221
  releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) },
1270
1222
  userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper)
1271
- })
1223
+ }
1272
1224
  },
1273
1225
  [staticRolesByName.readOnly]: {
1274
1226
  name: "Read Access",
1275
1227
  value: staticRolesByName.readOnly,
1276
1228
  description: "",
1277
1229
  permissions: [],
1278
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1230
+ uiPermissions: {
1231
+ ...emptyUiPermissions,
1279
1232
  deployments: [uiPermissionsById.read.value],
1280
1233
  groups: { [ALL_DEVICES]: [uiPermissionsById.read.value] },
1281
1234
  releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] },
1282
1235
  userManagement: [uiPermissionsById.read.value]
1283
- })
1236
+ }
1284
1237
  },
1285
1238
  [staticRolesByName.ci]: {
1286
1239
  name: "Releases Manager",
1287
1240
  value: staticRolesByName.ci,
1288
1241
  description: "",
1289
1242
  permissions: [],
1290
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1243
+ uiPermissions: {
1244
+ ...emptyUiPermissions,
1291
1245
  releases: { [ALL_RELEASES]: uiPermissionsByArea.releases.uiPermissions.map(permissionMapper) }
1292
- })
1246
+ }
1293
1247
  },
1294
1248
  [staticRolesByName.deploymentsManager]: {
1295
1249
  name: "Deployments Manager",
1296
1250
  value: staticRolesByName.deploymentsManager,
1297
1251
  description: "",
1298
1252
  permissions: [],
1299
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1253
+ uiPermissions: {
1254
+ ...emptyUiPermissions,
1300
1255
  deployments: uiPermissionsByArea.deployments.uiPermissions.map(permissionMapper),
1301
1256
  groups: { [ALL_DEVICES]: [uiPermissionsById.deploy.value, uiPermissionsById.read.value] },
1302
1257
  releases: { [ALL_RELEASES]: [uiPermissionsById.read.value] }
1303
- })
1258
+ }
1304
1259
  },
1305
1260
  [staticRolesByName.terminalAccess]: {
1306
1261
  name: "Troubleshooting",
1307
1262
  value: staticRolesByName.terminalAccess,
1308
1263
  description: "Access to the troubleshooting features: Remote Terminal, File Transfer, Port Forwarding",
1309
1264
  permissions: [],
1310
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1265
+ uiPermissions: {
1266
+ ...emptyUiPermissions,
1311
1267
  groups: { [ALL_DEVICES]: [uiPermissionsById.connect.value] }
1312
- })
1268
+ }
1313
1269
  }
1314
1270
  });
1315
1271
  var serviceProviderRolesById = {
@@ -1318,22 +1274,24 @@ var serviceProviderRolesById = {
1318
1274
  value: staticRolesByName.admin,
1319
1275
  description: "Full access",
1320
1276
  permissions: [],
1321
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1277
+ uiPermissions: {
1278
+ ...emptyUiPermissions,
1322
1279
  auditlog: uiPermissionsByArea.auditlog.uiPermissions.map(permissionMapper),
1323
1280
  userManagement: uiPermissionsByArea.userManagement.uiPermissions.map(permissionMapper),
1324
1281
  tenantManagement: uiPermissionsByArea.tenantManagement.uiPermissions.map(permissionMapper)
1325
- })
1282
+ }
1326
1283
  },
1327
1284
  readOnly: {
1328
1285
  name: "Read access",
1329
1286
  value: staticRolesByName.admin,
1330
1287
  description: "This role can see all linked organizations but cannot make any changes",
1331
1288
  permissions: [],
1332
- uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), {
1289
+ uiPermissions: {
1290
+ ...emptyUiPermissions,
1333
1291
  auditlog: [uiPermissionsById.read.value],
1334
1292
  userManagement: [uiPermissionsById.read.value],
1335
1293
  tenantManagement: [uiPermissionsById.read.value]
1336
- })
1294
+ }
1337
1295
  }
1338
1296
  };
1339
1297
  var defaultPermissionSets = {
@@ -1346,7 +1304,9 @@ var defaultPermissionSets = {
1346
1304
  },
1347
1305
  [permissionSetIds.SuperUser]: {
1348
1306
  name: permissionSetIds.SuperUser,
1349
- result: __spreadValues({}, rolesById[staticRolesByName.admin].uiPermissions)
1307
+ result: {
1308
+ ...rolesById[staticRolesByName.admin].uiPermissions
1309
+ }
1350
1310
  },
1351
1311
  [permissionSetIds.ManageUsers]: {
1352
1312
  name: permissionSetIds.ManageUsers,
@@ -1431,11 +1391,12 @@ var defaultPermissionSets = {
1431
1391
  };
1432
1392
  var USER_LOGOUT = "USER_LOGOUT";
1433
1393
  var OWN_USER_ID = "me";
1434
- var rolesByName = __spreadProps(__spreadValues({}, staticRolesByName), {
1394
+ var rolesByName = {
1395
+ ...staticRolesByName,
1435
1396
  deploymentCreation: { action: "CREATE_DEPLOYMENT", object: { type: "DEVICE_GROUP", value: void 0 } },
1436
1397
  groupAccess: { action: "VIEW_DEVICE", object: { type: "DEVICE_GROUP", value: void 0 } },
1437
1398
  userManagement: { action: "http", object: { type: "any", value: `${useradmApiUrlv1}/.*` } }
1438
- });
1399
+ };
1439
1400
  var twoFAStates = {
1440
1401
  enabled: "enabled",
1441
1402
  disabled: "disabled",
@@ -1523,7 +1484,10 @@ var appSlice = (0, import_toolkit.createSlice)({
1523
1484
  initialState,
1524
1485
  reducers: {
1525
1486
  setFeatures: (state, action) => {
1526
- state.features = __spreadValues(__spreadValues({}, state.features), action.payload);
1487
+ state.features = {
1488
+ ...state.features,
1489
+ ...action.payload
1490
+ };
1527
1491
  },
1528
1492
  setSnackbar: (state, { payload }) => {
1529
1493
  let { message, autoHideDuration, action, children, onClick, onClose } = payload;
@@ -1548,7 +1512,10 @@ var appSlice = (0, import_toolkit.createSlice)({
1548
1512
  state.hostedAnnouncement = action.payload;
1549
1513
  },
1550
1514
  setSearchState: (state, action) => {
1551
- state.searchState = __spreadValues(__spreadValues({}, state.searchState), action.payload);
1515
+ state.searchState = {
1516
+ ...state.searchState,
1517
+ ...action.payload
1518
+ };
1552
1519
  },
1553
1520
  setOfflineThreshold: (state, action) => {
1554
1521
  state.offlineThreshold = action.payload;
@@ -1559,20 +1526,23 @@ var appSlice = (0, import_toolkit.createSlice)({
1559
1526
  },
1560
1527
  uploadProgress: (state, action) => {
1561
1528
  const { id, progress: progress2 } = action.payload;
1562
- state.uploadsById[id] = __spreadProps(__spreadValues({}, state.uploadsById[id]), {
1529
+ state.uploadsById[id] = {
1530
+ ...state.uploadsById[id],
1563
1531
  progress: progress2
1564
- });
1532
+ };
1565
1533
  },
1566
1534
  cleanUpUpload: (state, action) => {
1567
- var _a;
1568
- const _b2 = state.uploadsById, { [_a = action.payload]: current } = _b2, remainder = __objRest(_b2, [__restKey(_a)]);
1535
+ const { [action.payload]: current, ...remainder } = state.uploadsById;
1569
1536
  state.uploadsById = remainder;
1570
1537
  },
1571
1538
  setVersionInformation: (state, action) => {
1572
- state.versionInformation = __spreadValues(__spreadValues({}, state.versionInformation), action.payload);
1539
+ state.versionInformation = {
1540
+ ...state.versionInformation,
1541
+ ...action.payload
1542
+ };
1573
1543
  },
1574
1544
  setEnvironmentData: (state, action) => {
1575
- return __spreadValues(__spreadValues({}, state), action.payload);
1545
+ return { ...state, ...action.payload };
1576
1546
  }
1577
1547
  }
1578
1548
  });
@@ -1604,7 +1574,7 @@ var initialState2 = {
1604
1574
  sourceWindow: -1
1605
1575
  },
1606
1576
  binaryDeltaLimits: {
1607
- timeout: __spreadProps(__spreadValues({}, limitDefault), { default: 60, max: 3600, min: 60 }),
1577
+ timeout: { ...limitDefault, default: 60, max: 3600, min: 60 },
1608
1578
  sourceWindow: limitDefault,
1609
1579
  inputWindow: limitDefault,
1610
1580
  duplicatesWindow: limitDefault,
@@ -1614,10 +1584,10 @@ var initialState2 = {
1614
1584
  deploymentDeviceLimit: 5e3,
1615
1585
  selectedDeviceIds: [],
1616
1586
  selectionState: {
1617
- finished: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { endDate: void 0, search: "", selection: [], startDate: void 0, total: 0, type: "" }),
1618
- inprogress: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] }),
1619
- pending: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] }),
1620
- scheduled: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { selection: [] }),
1587
+ finished: { ...DEVICE_LIST_DEFAULTS, endDate: void 0, search: "", selection: [], startDate: void 0, total: 0, type: "" },
1588
+ inprogress: { ...DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
1589
+ pending: { ...DEVICE_LIST_DEFAULTS, perPage: DEFAULT_PENDING_INPROGRESS_COUNT, selection: [] },
1590
+ scheduled: { ...DEVICE_LIST_DEFAULTS, selection: [] },
1621
1591
  general: {
1622
1592
  state: DEPLOYMENT_ROUTES.active.key,
1623
1593
  showCreationDialog: false,
@@ -1633,40 +1603,55 @@ var deploymentsSlice = (0, import_toolkit2.createSlice)({
1633
1603
  initialState: initialState2,
1634
1604
  reducers: {
1635
1605
  createdDeployment: (state, action) => {
1636
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, deploymentPrototype), action.payload);
1606
+ state.byId[action.payload.id] = {
1607
+ ...deploymentPrototype,
1608
+ ...action.payload
1609
+ };
1637
1610
  state.byStatus[DEPLOYMENT_STATES.pending].total = state.byStatus[DEPLOYMENT_STATES.pending].total + 1;
1638
1611
  state.byStatus[DEPLOYMENT_STATES.pending].deploymentIds = [...state.byStatus.pending.deploymentIds, action.payload.id];
1639
1612
  state.selectionState[DEPLOYMENT_STATES.pending].selection = [action.payload.id, ...state.selectionState[DEPLOYMENT_STATES.pending].selection], state.selectionState[DEPLOYMENT_STATES.pending].total = state.selectionState[DEPLOYMENT_STATES.pending].total + 1;
1640
1613
  },
1641
1614
  removedDeployment: (state, action) => {
1642
- var _a;
1643
- const _b2 = state.byId, { [_a = action.payload]: removedDeployment } = _b2, remainder = __objRest(_b2, [__restKey(_a)]);
1615
+ const { [action.payload]: removedDeployment, ...remainder } = state.byId;
1644
1616
  state.byId = remainder;
1645
1617
  },
1646
1618
  receivedDeployment: (state, action) => {
1647
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id] || {}), action.payload);
1619
+ state.byId[action.payload.id] = {
1620
+ ...state.byId[action.payload.id] || {},
1621
+ ...action.payload
1622
+ };
1648
1623
  },
1649
1624
  receivedDeploymentDeviceLog: (state, action) => {
1650
1625
  const { id, deviceId, log } = action.payload;
1651
- const deployment = __spreadValues(__spreadValues({}, deploymentPrototype), state.byId[id]);
1652
- state.byId[id] = __spreadProps(__spreadValues({}, deployment), {
1653
- devices: __spreadProps(__spreadValues({}, deployment.devices), {
1654
- [deviceId]: __spreadProps(__spreadValues({}, deployment.devices[deviceId]), {
1626
+ const deployment = {
1627
+ ...deploymentPrototype,
1628
+ ...state.byId[id]
1629
+ };
1630
+ state.byId[id] = {
1631
+ ...deployment,
1632
+ devices: {
1633
+ ...deployment.devices,
1634
+ [deviceId]: {
1635
+ ...deployment.devices[deviceId],
1655
1636
  log
1656
- })
1657
- })
1658
- });
1637
+ }
1638
+ }
1639
+ };
1659
1640
  },
1660
1641
  receivedDeploymentDevices: (state, action) => {
1661
1642
  const { id, devices, selectedDeviceIds, totalDeviceCount } = action.payload;
1662
- state.byId[id] = __spreadProps(__spreadValues({}, state.byId[id]), {
1643
+ state.byId[id] = {
1644
+ ...state.byId[id],
1663
1645
  devices,
1664
1646
  totalDeviceCount
1665
- });
1647
+ };
1666
1648
  state.selectedDeviceIds = selectedDeviceIds;
1667
1649
  },
1668
1650
  receivedDeployments: (state, action) => {
1669
- state.byId = __spreadValues(__spreadValues({}, state.byId), action.payload);
1651
+ state.byId = {
1652
+ ...state.byId,
1653
+ ...action.payload
1654
+ };
1670
1655
  },
1671
1656
  receivedDeploymentsForStatus: (state, action) => {
1672
1657
  const { status, deploymentIds, total } = action.payload;
@@ -1708,9 +1693,9 @@ var initialState3 = {
1708
1693
  [DEVICE_STATES.preauth]: { deviceIds: [], total: 0 },
1709
1694
  [DEVICE_STATES.rejected]: { deviceIds: [], total: 0 }
1710
1695
  },
1711
- deviceList: __spreadProps(__spreadValues({
1712
- deviceIds: []
1713
- }, DEVICE_LIST_DEFAULTS), {
1696
+ deviceList: {
1697
+ deviceIds: [],
1698
+ ...DEVICE_LIST_DEFAULTS,
1714
1699
  selectedAttributes: [],
1715
1700
  selectedIssues: [],
1716
1701
  selection: [],
@@ -1721,7 +1706,7 @@ var initialState3 = {
1721
1706
  },
1722
1707
  state: DEVICE_STATES.accepted,
1723
1708
  total: 0
1724
- }),
1709
+ },
1725
1710
  filters: [
1726
1711
  // { key: 'device_type', value: 'raspberry', operator: '$eq', scope: 'inventory' }
1727
1712
  ],
@@ -1756,49 +1741,59 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
1756
1741
  },
1757
1742
  addToGroup: (state, action) => {
1758
1743
  const { group, deviceIds } = action.payload;
1759
- const maybeExistingGroup = __spreadValues({
1744
+ const maybeExistingGroup = {
1760
1745
  filters: [],
1761
- deviceIds: []
1762
- }, state.groups.byId[group]);
1763
- state.groups.byId[group] = __spreadProps(__spreadValues({}, maybeExistingGroup), {
1746
+ deviceIds: [],
1747
+ ...state.groups.byId[group]
1748
+ };
1749
+ state.groups.byId[group] = {
1750
+ ...maybeExistingGroup,
1764
1751
  deviceIds: [...maybeExistingGroup.deviceIds, ...deviceIds].filter(import_helpers.duplicateFilter),
1765
1752
  total: (maybeExistingGroup.total || 0) + 1
1766
- });
1753
+ };
1767
1754
  },
1768
1755
  removeFromGroup: (state, action) => {
1769
1756
  const { group, deviceIds: removedIds } = action.payload;
1770
- const _a = state.groups.byId[group] || {}, { deviceIds = [], total = 0 } = _a, maybeExistingGroup = __objRest(_a, ["deviceIds", "total"]);
1771
- const changedGroup = __spreadProps(__spreadValues({}, maybeExistingGroup), {
1757
+ const { deviceIds = [], total = 0, ...maybeExistingGroup } = state.groups.byId[group] || {};
1758
+ const changedGroup = {
1759
+ ...maybeExistingGroup,
1772
1760
  deviceIds: deviceIds.filter((id) => !removedIds.includes(id)),
1773
1761
  total: Math.max(total - removedIds.length, 0)
1774
- });
1762
+ };
1775
1763
  if (changedGroup.total || changedGroup.deviceIds.length) {
1776
1764
  state.groups.byId[group] = changedGroup;
1777
1765
  return;
1778
1766
  } else if (state.groups.selectedGroup === group) {
1779
1767
  state.groups.selectedGroup = void 0;
1780
1768
  }
1781
- const _b2 = state.groups.byId, { [group]: removal } = _b2, remainingById = __objRest(_b2, [__restKey(group)]);
1769
+ const { [group]: removal, ...remainingById } = state.groups.byId;
1782
1770
  state.groups.byId = remainingById;
1783
1771
  },
1784
1772
  addGroup: (state, action) => {
1785
1773
  const { groupName, group } = action.payload;
1786
- state.groups.byId[groupName] = __spreadValues(__spreadValues({}, state.groups.byId[groupName]), group);
1774
+ state.groups.byId[groupName] = {
1775
+ ...state.groups.byId[groupName],
1776
+ ...group
1777
+ };
1787
1778
  },
1788
1779
  selectGroup: (state, { payload: group }) => {
1789
1780
  state.deviceList.deviceIds = state.groups.byId[group] && state.groups.byId[group].deviceIds.length > 0 ? state.groups.byId[group].deviceIds : [];
1790
1781
  state.groups.selectedGroup = group;
1791
1782
  },
1792
1783
  removeGroup: (state, action) => {
1793
- var _a;
1794
- const _b2 = state.groups.byId, { [_a = action.payload]: removal } = _b2, remainingById = __objRest(_b2, [__restKey(_a)]);
1784
+ const { [action.payload]: removal, ...remainingById } = state.groups.byId;
1795
1785
  state.groups.byId = remainingById;
1796
1786
  state.groups.selectedGroup = state.groups.selectedGroup === action.payload ? void 0 : state.groups.selectedGroup;
1797
1787
  },
1798
1788
  setDeviceListState: (state, action) => {
1799
- state.deviceList = __spreadProps(__spreadValues(__spreadValues({}, state.deviceList), action.payload), {
1800
- sort: __spreadValues(__spreadValues({}, state.deviceList.sort), action.payload.sort)
1801
- });
1789
+ state.deviceList = {
1790
+ ...state.deviceList,
1791
+ ...action.payload,
1792
+ sort: {
1793
+ ...state.deviceList.sort,
1794
+ ...action.payload.sort
1795
+ }
1796
+ };
1802
1797
  },
1803
1798
  setFilterAttributes: (state, action) => {
1804
1799
  state.filteringAttributes = action.payload;
@@ -1807,7 +1802,10 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
1807
1802
  state.filteringAttributesConfig = action.payload;
1808
1803
  },
1809
1804
  receivedDevices: (state, action) => {
1810
- state.byId = __spreadValues(__spreadValues({}, state.byId), action.payload);
1805
+ state.byId = {
1806
+ ...state.byId,
1807
+ ...action.payload
1808
+ };
1811
1809
  },
1812
1810
  setDeviceFilters: (state, action) => {
1813
1811
  if ((0, import_helpers.deepCompare)(action.payload, state.filters)) {
@@ -1838,7 +1836,10 @@ var devicesSlice = (0, import_toolkit3.createSlice)({
1838
1836
  state.limit = action.payload;
1839
1837
  },
1840
1838
  receivedDevice: (state, action) => {
1841
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id]), action.payload);
1839
+ state.byId[action.payload.id] = {
1840
+ ...state.byId[action.payload.id],
1841
+ ...action.payload
1842
+ };
1842
1843
  },
1843
1844
  maybeUpdateDevicesByStatus: (state, action) => {
1844
1845
  const { deviceId, authId } = action.payload;
@@ -1859,15 +1860,17 @@ var import_toolkit4 = require("@reduxjs/toolkit");
1859
1860
  var sliceName4 = "monitor";
1860
1861
  var initialState4 = {
1861
1862
  alerts: {
1862
- alertList: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), { total: 0 }),
1863
+ alertList: { ...DEVICE_LIST_DEFAULTS, total: 0 },
1863
1864
  byDeviceId: {}
1864
1865
  },
1865
1866
  issueCounts: {
1866
- byType: Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { key }) => __spreadProps(__spreadValues({}, accu), { [key]: { filtered: 0, total: 0 } }), {})
1867
+ byType: Object.values(DEVICE_ISSUE_OPTIONS).reduce((accu, { key }) => ({ ...accu, [key]: { filtered: 0, total: 0 } }), {})
1867
1868
  },
1868
1869
  settings: {
1869
1870
  global: {
1870
- channels: __spreadValues({}, Object.keys(alertChannels).reduce((accu, item) => __spreadProps(__spreadValues({}, accu), { [item]: { enabled: true } }), {}))
1871
+ channels: {
1872
+ ...Object.keys(alertChannels).reduce((accu, item) => ({ ...accu, [item]: { enabled: true } }), {})
1873
+ }
1871
1874
  }
1872
1875
  }
1873
1876
  };
@@ -1885,14 +1888,14 @@ var monitorSlice = (0, import_toolkit4.createSlice)({
1885
1888
  },
1886
1889
  receiveLatestDeviceAlerts: (state, action) => {
1887
1890
  const { deviceId, alerts } = action.payload;
1888
- state.alerts.byDeviceId[deviceId] = __spreadProps(__spreadValues({}, state.alerts.byDeviceId[deviceId]), { latest: alerts });
1891
+ state.alerts.byDeviceId[deviceId] = { ...state.alerts.byDeviceId[deviceId], latest: alerts };
1889
1892
  },
1890
1893
  receiveDeviceIssueCounts: (state, action) => {
1891
1894
  const { issueType, counts } = action.payload;
1892
1895
  state.issueCounts.byType[issueType] = counts;
1893
1896
  },
1894
1897
  setAlertListState: (state, action) => {
1895
- state.alerts.alertList = __spreadValues(__spreadValues({}, state.alerts.alertList), action.payload);
1898
+ state.alerts.alertList = { ...state.alerts.alertList, ...action.payload };
1896
1899
  }
1897
1900
  }
1898
1901
  });
@@ -1916,7 +1919,7 @@ var onboardingSlice = (0, import_toolkit5.createSlice)({
1916
1919
  initialState: initialState5,
1917
1920
  reducers: {
1918
1921
  setOnboardingState: (state, action) => {
1919
- return __spreadValues(__spreadValues({}, state), action.payload);
1922
+ return { ...state, ...action.payload };
1920
1923
  },
1921
1924
  setDemoArtifactPort: (state, action) => {
1922
1925
  state.demoArtifactPort = action.payload;
@@ -1954,7 +1957,8 @@ var initialState6 = {
1954
1957
  brand: ""
1955
1958
  },
1956
1959
  intentId: null,
1957
- tenantList: __spreadProps(__spreadValues({}, TENANT_LIST_DEFAULT), {
1960
+ tenantList: {
1961
+ ...TENANT_LIST_DEFAULT,
1958
1962
  total: 0,
1959
1963
  tenants: [],
1960
1964
  selectedTenant: null,
@@ -1962,13 +1966,14 @@ var initialState6 = {
1962
1966
  direction: SORTING_OPTIONS.desc,
1963
1967
  key: "name"
1964
1968
  }
1965
- }),
1969
+ },
1966
1970
  organization: {
1967
1971
  // id, name, status, tenant_token, plan
1968
1972
  },
1969
1973
  auditlog: {
1970
1974
  events: [],
1971
- selectionState: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), {
1975
+ selectionState: {
1976
+ ...DEVICE_LIST_DEFAULTS,
1972
1977
  detail: void 0,
1973
1978
  endDate: void 0,
1974
1979
  selectedIssue: void 0,
@@ -1977,7 +1982,7 @@ var initialState6 = {
1977
1982
  total: 0,
1978
1983
  type: void 0,
1979
1984
  user: void 0
1980
- })
1985
+ }
1981
1986
  },
1982
1987
  externalDeviceIntegrations: [
1983
1988
  // { <connection_string|x509|...>, id, provider }
@@ -2000,7 +2005,10 @@ var organizationSlice = (0, import_toolkit6.createSlice)({
2000
2005
  state.auditlog.selectionState.total = total;
2001
2006
  },
2002
2007
  setAuditLogState: (state, action) => {
2003
- state.auditlog.selectionState = __spreadValues(__spreadValues({}, state.auditlog.selectionState), action.payload);
2008
+ state.auditlog.selectionState = {
2009
+ ...state.auditlog.selectionState,
2010
+ ...action.payload
2011
+ };
2004
2012
  },
2005
2013
  receiveCurrentCard: (state, action) => {
2006
2014
  state.card = action.payload;
@@ -2009,7 +2017,7 @@ var organizationSlice = (0, import_toolkit6.createSlice)({
2009
2017
  state.intentId = action.payload;
2010
2018
  },
2011
2019
  setOrganization: (state, action) => {
2012
- state.organization = __spreadValues(__spreadValues({}, state.organization), action.payload);
2020
+ state.organization = { ...state.organization, ...action.payload };
2013
2021
  },
2014
2022
  setTenantListState: (state, action) => {
2015
2023
  state.tenantList = action.payload;
@@ -2072,7 +2080,8 @@ var initialState7 = {
2072
2080
  }
2073
2081
  */
2074
2082
  },
2075
- releasesList: __spreadProps(__spreadValues({}, DEVICE_LIST_DEFAULTS), {
2083
+ releasesList: {
2084
+ ...DEVICE_LIST_DEFAULTS,
2076
2085
  searchedIds: [],
2077
2086
  releaseIds: [],
2078
2087
  selection: [],
@@ -2086,7 +2095,7 @@ var initialState7 = {
2086
2095
  selectedTags: [],
2087
2096
  total: 0,
2088
2097
  type: ""
2089
- }),
2098
+ },
2090
2099
  tags: [],
2091
2100
  updateTypes: [],
2092
2101
  /*
@@ -2112,8 +2121,7 @@ var releaseSlice = (0, import_toolkit7.createSlice)({
2112
2121
  state.updateTypes = action.payload;
2113
2122
  },
2114
2123
  removeRelease: (state, action) => {
2115
- var _a;
2116
- const _b2 = state.byId, { [_a = action.payload]: toBeRemoved } = _b2, byId = __objRest(_b2, [__restKey(_a)]);
2124
+ const { [action.payload]: toBeRemoved, ...byId } = state.byId;
2117
2125
  state.byId = byId;
2118
2126
  state.selectedRelease = action.payload === state.selectedRelease ? null : state.selectedRelease;
2119
2127
  },
@@ -2146,8 +2154,12 @@ var initialState8 = {
2146
2154
  previousPhases: [],
2147
2155
  retries: 0
2148
2156
  },
2149
- permissionSetsById: __spreadValues({}, defaultPermissionSets),
2150
- rolesById: __spreadValues({}, rolesById),
2157
+ permissionSetsById: {
2158
+ ...defaultPermissionSets
2159
+ },
2160
+ rolesById: {
2161
+ ...rolesById
2162
+ },
2151
2163
  settingsInitialized: false,
2152
2164
  showConnectDeviceDialog: false,
2153
2165
  showFeedbackDialog: false,
@@ -2187,13 +2199,15 @@ var usersSlice = (0, import_toolkit8.createSlice)({
2187
2199
  state.byId[0] = action.payload;
2188
2200
  },
2189
2201
  removedUser: (state, action) => {
2190
- var _a;
2191
- const _b2 = state.byId, { [_a = action.payload]: removedUser } = _b2, byId = __objRest(_b2, [__restKey(_a)]);
2202
+ const { [action.payload]: removedUser, ...byId } = state.byId;
2192
2203
  state.byId = byId;
2193
2204
  state.currentUser = state.currentUser === action.payload ? null : state.currentUser;
2194
2205
  },
2195
2206
  updatedUser: (state, action) => {
2196
- state.byId[action.payload.id] = __spreadValues(__spreadValues({}, state.byId[action.payload.id]), action.payload);
2207
+ state.byId[action.payload.id] = {
2208
+ ...state.byId[action.payload.id],
2209
+ ...action.payload
2210
+ };
2197
2211
  },
2198
2212
  receivedPermissionSets: (state, action) => {
2199
2213
  state.permissionSetsById = action.payload;
@@ -2202,11 +2216,13 @@ var usersSlice = (0, import_toolkit8.createSlice)({
2202
2216
  state.rolesById = action.payload;
2203
2217
  },
2204
2218
  createdRole: (state, action) => {
2205
- state.rolesById[action.payload.name] = __spreadValues(__spreadValues({}, state.rolesById[action.payload.name]), action.payload);
2219
+ state.rolesById[action.payload.name] = {
2220
+ ...state.rolesById[action.payload.name],
2221
+ ...action.payload
2222
+ };
2206
2223
  },
2207
2224
  removedRole: (state, action) => {
2208
- var _a;
2209
- const _b2 = state.rolesById, { [_a = action.payload]: toBeRemoved } = _b2, rolesById2 = __objRest(_b2, [__restKey(_a)]);
2225
+ const { [action.payload]: toBeRemoved, ...rolesById2 } = state.rolesById;
2210
2226
  state.rolesById = rolesById2;
2211
2227
  },
2212
2228
  setCustomColumns: (state, action) => {
@@ -2214,18 +2230,27 @@ var usersSlice = (0, import_toolkit8.createSlice)({
2214
2230
  },
2215
2231
  setGlobalSettings: (state, action) => {
2216
2232
  state.settingsInitialized = true;
2217
- state.globalSettings = __spreadValues(__spreadValues({}, state.globalSettings), action.payload);
2233
+ state.globalSettings = {
2234
+ ...state.globalSettings,
2235
+ ...action.payload
2236
+ };
2218
2237
  },
2219
2238
  setUserSettings: (state, action) => {
2220
2239
  state.userSettingsInitialized = true;
2221
- state.userSettings = __spreadValues(__spreadValues({}, state.userSettings), action.payload);
2240
+ state.userSettings = {
2241
+ ...state.userSettings,
2242
+ ...action.payload
2243
+ };
2222
2244
  },
2223
2245
  setTooltipState: (state, action) => {
2224
2246
  const { id, readState = READ_STATES.read } = action.payload;
2225
2247
  state.tooltips.byId[id].readState = readState;
2226
2248
  },
2227
2249
  setTooltipsState: (state, action) => {
2228
- state.tooltips.byId = __spreadValues(__spreadValues({}, state.tooltips.byId), action.payload);
2250
+ state.tooltips.byId = {
2251
+ ...state.tooltips.byId,
2252
+ ...action.payload
2253
+ };
2229
2254
  },
2230
2255
  setShowFeedbackDialog: (state, action) => {
2231
2256
  state.showFeedbackDialog = action.payload;
@@ -2242,7 +2267,16 @@ var actions8 = usersSlice.actions;
2242
2267
  var usersSlice_default = usersSlice.reducer;
2243
2268
 
2244
2269
  // src/actions.ts
2245
- var actions_default = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, actions), actions2), actions3), actions4), actions5), actions6), actions7), actions8);
2270
+ var actions_default = {
2271
+ ...actions,
2272
+ ...actions2,
2273
+ ...actions3,
2274
+ ...actions4,
2275
+ ...actions5,
2276
+ ...actions6,
2277
+ ...actions7,
2278
+ ...actions8
2279
+ };
2246
2280
 
2247
2281
  // src/auth.ts
2248
2282
  var import_universal_cookie = __toESM(require("universal-cookie"));
@@ -2250,18 +2284,17 @@ var cookies = new import_universal_cookie.default();
2250
2284
  var emptySession = Object.freeze({ token: "", exiresAt: void 0 });
2251
2285
  var tokenCache = "";
2252
2286
  var getSessionInfo = () => {
2253
- var _a, _b2;
2254
- let sessionInfo = __spreadValues({}, emptySession);
2287
+ let sessionInfo = { ...emptySession };
2255
2288
  try {
2256
- sessionInfo = JSON.parse((_a = window.localStorage.getItem("JWT")) != null ? _a : "");
2257
- } catch (e) {
2289
+ sessionInfo = JSON.parse(window.localStorage.getItem("JWT") ?? "");
2290
+ } catch {
2258
2291
  }
2259
2292
  if (sessionInfo.expiresAt && new Date(sessionInfo.expiresAt) < /* @__PURE__ */ new Date()) {
2260
2293
  cleanUp();
2261
- return __spreadValues({}, emptySession);
2294
+ return { ...emptySession };
2262
2295
  }
2263
2296
  if (!sessionInfo.token) {
2264
- let jwtTokenFromCookie = (_b2 = cookies.get("JWT", { doNotParse: true })) != null ? _b2 : "";
2297
+ let jwtTokenFromCookie = cookies.get("JWT", { doNotParse: true }) ?? "";
2265
2298
  if (jwtTokenFromCookie) {
2266
2299
  setSessionInfo({ token: jwtTokenFromCookie, undefined: void 0 });
2267
2300
  sessionInfo.token = jwtTokenFromCookie;
@@ -2301,10 +2334,7 @@ var getSearchState = (state) => state.app.searchState;
2301
2334
  var getSearchedDevices = (0, import_toolkit9.createSelector)([getSearchState], ({ deviceIds }) => deviceIds);
2302
2335
  var getVersionInformation = (0, import_toolkit9.createSelector)(
2303
2336
  [getFullVersionInformation, getFeatures],
2304
- (_a, { isHosted }) => {
2305
- var _b2 = _a, { Integration } = _b2, remainder = __objRest(_b2, ["Integration"]);
2306
- return isHosted && Integration !== "next" ? remainder : __spreadProps(__spreadValues({}, remainder), { Integration });
2307
- }
2337
+ ({ Integration, ...remainder }, { isHosted }) => isHosted && Integration !== "next" ? remainder : { ...remainder, Integration }
2308
2338
  );
2309
2339
  var getIsPreview = (0, import_toolkit9.createSelector)([getFullVersionInformation], ({ Integration }) => (0, import_helpers2.versionCompare)(Integration, "next") > -1);
2310
2340
 
@@ -2321,8 +2351,7 @@ var getDeploymentsSelectionState = (state) => state.deployments.selectionState;
2321
2351
  var getMappedDeploymentSelection = (0, import_toolkit10.createSelector)(
2322
2352
  [getDeploymentsSelectionState, (_, deploymentsState) => deploymentsState, getDeploymentsById],
2323
2353
  (selectionState, deploymentsState, deploymentsById) => {
2324
- var _a;
2325
- const { selection = [] } = (_a = selectionState[deploymentsState]) != null ? _a : {};
2354
+ const { selection = [] } = selectionState[deploymentsState] ?? {};
2326
2355
  return selection.reduce((accu, id) => {
2327
2356
  if (deploymentsById[id]) {
2328
2357
  accu.push(deploymentsById[id]);
@@ -2366,7 +2395,8 @@ var getListedDevices = (state) => state.devices.deviceList.deviceIds;
2366
2395
  var getFilteringAttributes = (state) => state.devices.filteringAttributes;
2367
2396
  var getDeviceFilters = (state) => state.devices.filters || [];
2368
2397
  var getFilteringAttributesFromConfig = (state) => state.devices.filteringAttributesConfig.attributes;
2369
- var getSortedFilteringAttributes = (0, import_toolkit11.createSelector)([getFilteringAttributes], (filteringAttributes) => __spreadProps(__spreadValues({}, filteringAttributes), {
2398
+ var getSortedFilteringAttributes = (0, import_toolkit11.createSelector)([getFilteringAttributes], (filteringAttributes) => ({
2399
+ ...filteringAttributes,
2370
2400
  identityAttributes: [...filteringAttributes.identityAttributes, "id"]
2371
2401
  }));
2372
2402
  var getDeviceLimit = (state) => state.devices.limit;
@@ -2394,10 +2424,7 @@ var getDeviceCountsByStatus = (0, import_toolkit11.createSelector)(
2394
2424
  return accu;
2395
2425
  }, {})
2396
2426
  );
2397
- var getDeviceById = (0, import_toolkit11.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => {
2398
- var _a;
2399
- return (_a = devicesById[deviceId]) != null ? _a : {};
2400
- });
2427
+ var getDeviceById = (0, import_toolkit11.createSelector)([getDevicesById, (_, deviceId) => deviceId], (devicesById, deviceId = "") => devicesById[deviceId] ?? {});
2401
2428
  var getSelectedGroupInfo = (0, import_toolkit11.createSelector)(
2402
2429
  [getAcceptedDevices, getGroupsById, getSelectedGroup],
2403
2430
  ({ total: acceptedDeviceTotal }, groupsById, selectedGroup) => {
@@ -2414,17 +2441,13 @@ var getLimitMaxed = (0, import_toolkit11.createSelector)(
2414
2441
  [getAcceptedDevices, getDeviceLimit],
2415
2442
  ({ total: acceptedDevices = 0 }, deviceLimit) => Boolean(deviceLimit && deviceLimit <= acceptedDevices)
2416
2443
  );
2417
- var _b;
2418
- var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], (_a) => {
2419
- var _c = _a, { [_b = UNGROUPED_GROUP.id]: ungrouped } = _c, groups = __objRest(_c, [__restKey(_b)]);
2420
- return groups;
2421
- });
2444
+ var getGroupsByIdWithoutUngrouped = (0, import_toolkit11.createSelector)([getGroupsById], ({ [UNGROUPED_GROUP.id]: ungrouped, ...groups }) => groups);
2422
2445
  var getGroups = (0, import_toolkit11.createSelector)([getGroupsById], (groupsById) => {
2423
2446
  const groupNames = Object.keys(groupsById).sort();
2424
2447
  const groupedGroups = Object.entries(groupsById).sort((a, b) => a[0].localeCompare(b[0])).reduce(
2425
2448
  (accu, [groupname, group]) => {
2426
2449
  const name = groupname === UNGROUPED_GROUP.id ? UNGROUPED_GROUP.name : groupname;
2427
- const groupItem = __spreadProps(__spreadValues({}, group), { groupId: name, name: groupname });
2450
+ const groupItem = { ...group, groupId: name, name: groupname };
2428
2451
  if (group.filters.length > 0) {
2429
2452
  if (groupname !== UNGROUPED_GROUP.id) {
2430
2453
  accu.dynamic.push(groupItem);
@@ -2438,7 +2461,7 @@ var getGroups = (0, import_toolkit11.createSelector)([getGroupsById], (groupsByI
2438
2461
  },
2439
2462
  { dynamic: [], static: [], ungrouped: [] }
2440
2463
  );
2441
- return __spreadValues({ groupNames }, groupedGroups);
2464
+ return { groupNames, ...groupedGroups };
2442
2465
  });
2443
2466
  var getAttributesList = (0, import_toolkit11.createSelector)(
2444
2467
  [getFilteringAttributes, getFilteringAttributesFromConfig],
@@ -2478,10 +2501,7 @@ var getWebhookEvents = (state) => state.organization.webhooks.events;
2478
2501
  var getWebhookEventTotal = (state) => state.organization.webhooks.eventTotal;
2479
2502
  var getDeviceTwinIntegrations = (0, import_toolkit12.createSelector)(
2480
2503
  [getExternalIntegrations],
2481
- (integrations) => integrations.filter((integration) => {
2482
- var _a;
2483
- return integration.id && ((_a = EXTERNAL_PROVIDER[integration.provider]) == null ? void 0 : _a.deviceTwin);
2484
- })
2504
+ (integrations) => integrations.filter((integration) => integration.id && EXTERNAL_PROVIDER[integration.provider]?.deviceTwin)
2485
2505
  );
2486
2506
  var getIsServiceProvider = (state) => state.organization.organization.service_provider;
2487
2507
  var getWebhooks = (0, import_toolkit12.createSelector)(
@@ -2515,15 +2535,12 @@ var filterProcessors = {
2515
2535
  var filterAliases = {
2516
2536
  $nexists: { alias: DEVICE_FILTERING_OPTIONS.$exists.key, value: false }
2517
2537
  };
2518
- var mapFiltersToTerms = (filters) => filters.map((filter) => {
2519
- var _a;
2520
- return {
2521
- scope: filter.scope,
2522
- attribute: filter.key,
2523
- type: ((_a = filterAliases[filter.operator]) == null ? void 0 : _a.alias) || filter.operator,
2524
- value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
2525
- };
2526
- });
2538
+ var mapFiltersToTerms = (filters) => filters.map((filter) => ({
2539
+ scope: filter.scope,
2540
+ attribute: filter.key,
2541
+ type: filterAliases[filter.operator]?.alias || filter.operator,
2542
+ value: filterProcessors.hasOwnProperty(filter.operator) ? filterProcessors[filter.operator](filter.value) : filter.value
2543
+ }));
2527
2544
  var mapTermsToFilters = (terms) => terms.map((term) => {
2528
2545
  const aliasedFilter = Object.entries(filterAliases).find(
2529
2546
  (aliasDefinition) => aliasDefinition[1].alias === term.type && aliasDefinition[1].value === term.value
@@ -2533,14 +2550,13 @@ var mapTermsToFilters = (terms) => terms.map((term) => {
2533
2550
  });
2534
2551
  var convertIssueOptionsToFilters = (issuesSelection, filtersState = {}) => issuesSelection.map((item) => {
2535
2552
  if (typeof DEVICE_ISSUE_OPTIONS[item].filterRule.value === "function") {
2536
- return __spreadProps(__spreadValues({}, DEVICE_ISSUE_OPTIONS[item].filterRule), { value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) });
2553
+ return { ...DEVICE_ISSUE_OPTIONS[item].filterRule, value: DEVICE_ISSUE_OPTIONS[item].filterRule.value(filtersState) };
2537
2554
  }
2538
2555
  return DEVICE_ISSUE_OPTIONS[item].filterRule;
2539
2556
  });
2540
2557
  var convertDeviceListStateToFilters = ({ filters = [], group, groups = { byId: {} }, offlineThreshold, selectedIssues = [], status }) => {
2541
- var _a;
2542
2558
  let applicableFilters = [...filters];
2543
- if (typeof group === "string" && !(((_a = groups.byId[group]) == null ? void 0 : _a.filters) || applicableFilters).length) {
2559
+ if (typeof group === "string" && !(groups.byId[group]?.filters || applicableFilters).length) {
2544
2560
  applicableFilters.push({ key: "group", value: group, operator: DEVICE_FILTERING_OPTIONS.$eq.key, scope: "system" });
2545
2561
  }
2546
2562
  const nonMonitorFilters = applicableFilters.filter(
@@ -2561,12 +2577,12 @@ var filtersFilter = (item, index, array) => {
2561
2577
  var listItemMapper = (byId, ids, { defaultObject = {}, cutOffSize = DEVICE_LIST_MAXIMUM_LENGTH }) => {
2562
2578
  return ids.slice(0, cutOffSize).reduce((accu, id) => {
2563
2579
  if (id && byId[id]) {
2564
- accu.push(__spreadValues(__spreadValues({}, defaultObject), byId[id]));
2580
+ accu.push({ ...defaultObject, ...byId[id] });
2565
2581
  }
2566
2582
  return accu;
2567
2583
  }, []);
2568
2584
  };
2569
- var mergePermissions = (existingPermissions = __spreadValues({}, emptyUiPermissions), addedPermissions) => Object.entries(existingPermissions).reduce(
2585
+ var mergePermissions = (existingPermissions = { ...emptyUiPermissions }, addedPermissions) => Object.entries(existingPermissions).reduce(
2570
2586
  (accu, [key, value]) => {
2571
2587
  let values;
2572
2588
  if (!accu[key]) {
@@ -2576,12 +2592,12 @@ var mergePermissions = (existingPermissions = __spreadValues({}, emptyUiPermissi
2576
2592
  if (Array.isArray(value)) {
2577
2593
  values = [...value, ...accu[key]].filter(import_helpers4.duplicateFilter);
2578
2594
  } else {
2579
- values = mergePermissions(accu[key], __spreadValues({}, value));
2595
+ values = mergePermissions(accu[key], { ...value });
2580
2596
  }
2581
2597
  accu[key] = values;
2582
2598
  return accu;
2583
2599
  },
2584
- __spreadValues({}, addedPermissions)
2600
+ { ...addedPermissions }
2585
2601
  );
2586
2602
  var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
2587
2603
  (accu, roleId) => {
@@ -2590,20 +2606,17 @@ var mapUserRolesToUiPermissions = (userRoles, roles) => userRoles.reduce(
2590
2606
  }
2591
2607
  return mergePermissions(accu, roles[roleId].uiPermissions);
2592
2608
  },
2593
- __spreadValues({}, emptyUiPermissions)
2609
+ { ...emptyUiPermissions }
2594
2610
  );
2595
2611
  var progress = ({ loaded, total }) => {
2596
2612
  let uploadProgress4 = loaded / total * 100;
2597
2613
  return uploadProgress4 = uploadProgress4 < 50 ? Math.ceil(uploadProgress4) : Math.round(uploadProgress4);
2598
2614
  };
2599
- var extractErrorMessage = (err, fallback = "") => {
2600
- var _a, _b2, _c, _d, _e;
2601
- return ((_c = (_b2 = (_a = err.response) == null ? void 0 : _a.data) == null ? void 0 : _b2.error) == null ? void 0 : _c.message) || ((_e = (_d = err.response) == null ? void 0 : _d.data) == null ? void 0 : _e.error) || err.error || err.message || fallback;
2602
- };
2615
+ var extractErrorMessage = (err, fallback = "") => err.response?.data?.error?.message || err.response?.data?.error || err.error || err.message || fallback;
2603
2616
  var preformatWithRequestID = (res, failMsg) => {
2604
2617
  if (failMsg.length > 100) failMsg = `${failMsg.substring(0, 220)}...`;
2605
2618
  try {
2606
- if ((res == null ? void 0 : res.data) && Object.keys(res.data).includes("request_id")) {
2619
+ if (res?.data && Object.keys(res.data).includes("request_id")) {
2607
2620
  let shortRequestUUID = res.data["request_id"].substring(0, 8);
2608
2621
  return `${failMsg} [Request ID: ${shortRequestUUID}]`;
2609
2622
  }
@@ -2637,9 +2650,10 @@ var mapDeviceAttributes = (attributes = []) => attributes.reduce(
2637
2650
  if (!(attribute.value && attribute.name) && attribute.scope === ATTRIBUTE_SCOPES.inventory) {
2638
2651
  return accu;
2639
2652
  }
2640
- accu[attribute.scope || ATTRIBUTE_SCOPES.inventory] = __spreadProps(__spreadValues({}, accu[attribute.scope || ATTRIBUTE_SCOPES.inventory]), {
2653
+ accu[attribute.scope || ATTRIBUTE_SCOPES.inventory] = {
2654
+ ...accu[attribute.scope || ATTRIBUTE_SCOPES.inventory],
2641
2655
  [attribute.name]: attribute.value
2642
- });
2656
+ };
2643
2657
  if (attribute.name === "device_type" && attribute.scope === ATTRIBUTE_SCOPES.inventory) {
2644
2658
  accu.inventory.device_type = [].concat(attribute.value);
2645
2659
  }
@@ -2658,15 +2672,12 @@ var getReleaseListState = (state) => state.releases.releasesList;
2658
2672
  var getListedReleases = (state) => state.releases.releasesList.releaseIds;
2659
2673
  var getReleaseMappingDefaults = () => ({});
2660
2674
  var getReleasesList = (0, import_toolkit13.createSelector)([getReleasesById, getListedReleases, getReleaseMappingDefaults], listItemMapper);
2661
- var getReleaseTagsById = (0, import_toolkit13.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => __spreadProps(__spreadValues({}, accu), { [key]: key }), {}));
2675
+ var getReleaseTagsById = (0, import_toolkit13.createSelector)([getReleaseTags], (releaseTags) => releaseTags.reduce((accu, key) => ({ ...accu, [key]: key }), {}));
2662
2676
  var getHasReleases = (0, import_toolkit13.createSelector)(
2663
2677
  [getReleaseListState, getReleasesById],
2664
2678
  ({ searchTotal, total }, byId) => !!(Object.keys(byId).length || total || searchTotal)
2665
2679
  );
2666
- var getSelectedRelease = (0, import_toolkit13.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => {
2667
- var _a;
2668
- return (_a = byId[id]) != null ? _a : {};
2669
- });
2680
+ var getSelectedRelease = (0, import_toolkit13.createSelector)([getReleasesById, getSelectedReleaseId], (byId, id) => byId[id] ?? {});
2670
2681
 
2671
2682
  // src/usersSlice/selectors.ts
2672
2683
  var import_toolkit14 = require("@reduxjs/toolkit");
@@ -2675,10 +2686,7 @@ var getTooltipsById = (state) => state.users.tooltips.byId;
2675
2686
  var getGlobalSettings = (state) => state.users.globalSettings;
2676
2687
  var getCurrentUserId = (state) => state.users.currentUser;
2677
2688
  var getUsersById = (state) => state.users.byId;
2678
- var getCurrentUser = (0, import_toolkit14.createSelector)([getUsersById, getCurrentUserId], (usersById, userId) => {
2679
- var _a;
2680
- return (_a = usersById[userId]) != null ? _a : {};
2681
- });
2689
+ var getCurrentUser = (0, import_toolkit14.createSelector)([getUsersById, getCurrentUserId], (usersById, userId) => usersById[userId] ?? {});
2682
2690
  var getUserSettings = (state) => state.users.userSettings;
2683
2691
  var getIsDarkMode = (0, import_toolkit14.createSelector)([getUserSettings], ({ mode }) => isDarkMode(mode));
2684
2692
  var getShowHelptips = (0, import_toolkit14.createSelector)(
@@ -2689,22 +2697,22 @@ var getTooltipsState = (0, import_toolkit14.createSelector)(
2689
2697
  [getTooltipsById, getUserSettings],
2690
2698
  (byId, { tooltips = {} }) => Object.entries(byId).reduce(
2691
2699
  (accu, [id, value]) => {
2692
- accu[id] = __spreadValues(__spreadValues({}, accu[id]), value);
2700
+ accu[id] = { ...accu[id], ...value };
2693
2701
  return accu;
2694
2702
  },
2695
- __spreadValues({}, tooltips)
2703
+ { ...tooltips }
2696
2704
  )
2697
2705
  );
2698
2706
  var getHas2FA = (0, import_toolkit14.createSelector)(
2699
2707
  [getCurrentUser],
2700
2708
  (currentUser) => currentUser.hasOwnProperty("tfa_status") && currentUser.tfa_status === twoFAStates.enabled
2701
2709
  );
2702
- var getIdAttribute = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ id_attribute = __spreadValues({}, defaultIdAttribute) }) => id_attribute);
2710
+ var getIdAttribute = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ id_attribute = { ...defaultIdAttribute } }) => id_attribute);
2703
2711
  var getOfflineThresholdSettings = (0, import_toolkit14.createSelector)([getGlobalSettings], ({ offlineThreshold }) => ({
2704
- interval: (offlineThreshold == null ? void 0 : offlineThreshold.interval) || DEVICE_ONLINE_CUTOFF.interval,
2705
- intervalUnit: (offlineThreshold == null ? void 0 : offlineThreshold.intervalUnit) || DEVICE_ONLINE_CUTOFF.intervalName
2712
+ interval: offlineThreshold?.interval || DEVICE_ONLINE_CUTOFF.interval,
2713
+ intervalUnit: offlineThreshold?.intervalUnit || DEVICE_ONLINE_CUTOFF.intervalName
2706
2714
  }));
2707
- var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([id, role]) => __spreadValues({ id }, role)));
2715
+ var getRolesList = (0, import_toolkit14.createSelector)([getRolesById], (rolesById2) => Object.entries(rolesById2).map(([id, role]) => ({ id, ...role })));
2708
2716
  var getCurrentSession = (state) => state.users.currentSession;
2709
2717
 
2710
2718
  // src/commonSelectors.ts
@@ -2723,8 +2731,7 @@ var getSearchEndpoint = (0, import_toolkit15.createSelector)(
2723
2731
  var getUserRoles = (0, import_toolkit15.createSelector)(
2724
2732
  [getCurrentUser, getRolesById, getIsEnterprise, getFeatures, getOrganization],
2725
2733
  (currentUser, rolesById2, isEnterprise, { isHosted, hasMultitenancy }, { plan = PLANS.os.id }) => {
2726
- var _a;
2727
- const isAdmin = ((_a = currentUser.roles) == null ? void 0 : _a.length) ? currentUser.roles.some((role) => role === rolesByName.admin) : !(hasMultitenancy || isEnterprise || isHosted && plan !== PLANS.os.id);
2734
+ const isAdmin = currentUser.roles?.length ? currentUser.roles.some((role) => role === rolesByName.admin) : !(hasMultitenancy || isEnterprise || isHosted && plan !== PLANS.os.id);
2728
2735
  const uiPermissions = isAdmin ? mapUserRolesToUiPermissions([rolesByName.admin], rolesById2) : mapUserRolesToUiPermissions(currentUser.roles || [], rolesById2);
2729
2736
  return { isAdmin, uiPermissions };
2730
2737
  }
@@ -2793,10 +2800,11 @@ var getFilterAttributes = (0, import_toolkit15.createSelector)(
2793
2800
  const deviceNameAttribute = { key: "name", value: "Name", scope: ATTRIBUTE_SCOPES.tags, category: ATTRIBUTE_SCOPES.tags, priority: 1 };
2794
2801
  const deviceIdAttribute = { key: "id", value: "Device ID", scope: ATTRIBUTE_SCOPES.identity, category: ATTRIBUTE_SCOPES.identity, priority: 1 };
2795
2802
  const checkInAttribute = { key: "check_in_time", value: "Latest activity", scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };
2796
- const updateAttribute = __spreadProps(__spreadValues({}, checkInAttribute), { key: "updated_ts", value: "Last inventory update" });
2803
+ const updateAttribute = { ...checkInAttribute, key: "updated_ts", value: "Last inventory update" };
2797
2804
  const firstRequestAttribute = { key: "created_ts", value: "First request", scope: ATTRIBUTE_SCOPES.system, category: ATTRIBUTE_SCOPES.system, priority: 4 };
2798
2805
  const attributes = [
2799
- ...previousFilters.map((item) => __spreadProps(__spreadValues({}, item), {
2806
+ ...previousFilters.map((item) => ({
2807
+ ...item,
2800
2808
  value: deviceIdAttribute.key === item.key ? deviceIdAttribute.value : item.key,
2801
2809
  category: "recently used",
2802
2810
  priority: 0
@@ -2814,14 +2822,13 @@ var getFilterAttributes = (0, import_toolkit15.createSelector)(
2814
2822
  return (0, import_helpers5.attributeDuplicateFilter)(attributes, "key");
2815
2823
  }
2816
2824
  );
2817
- var getOnboardingState = (0, import_toolkit15.createSelector)([getOnboarding, getUserSettings], (_a, { onboarding = {} }) => {
2818
- var _b2 = _a, { complete, progress: progress2, showTips } = _b2, remainder = __objRest(_b2, ["complete", "progress", "showTips"]);
2819
- return __spreadProps(__spreadValues(__spreadValues({}, remainder), onboarding), {
2820
- complete: onboarding.complete || complete,
2821
- progress: Object.keys(onboardingSteps).findIndex((step) => step === progress2) > Object.keys(onboardingSteps).findIndex((step) => step === onboarding.progress) ? progress2 : onboarding.progress,
2822
- showTips: !onboarding.showTips ? onboarding.showTips : showTips
2823
- });
2824
- });
2825
+ var getOnboardingState = (0, import_toolkit15.createSelector)([getOnboarding, getUserSettings], ({ complete, progress: progress2, showTips, ...remainder }, { onboarding = {} }) => ({
2826
+ ...remainder,
2827
+ ...onboarding,
2828
+ complete: onboarding.complete || complete,
2829
+ progress: Object.keys(onboardingSteps).findIndex((step) => step === progress2) > Object.keys(onboardingSteps).findIndex((step) => step === onboarding.progress) ? progress2 : onboarding.progress,
2830
+ showTips: !onboarding.showTips ? onboarding.showTips : showTips
2831
+ }));
2825
2832
  var getDemoDeviceAddress = (0, import_toolkit15.createSelector)([getDevicesById, getOnboarding], (devicesById, { approach, demoArtifactPort }) => {
2826
2833
  const demoDeviceAddress = `http://${(0, import_helpers5.getDemoDeviceAddress)(Object.values(devicesById), approach)}`;
2827
2834
  return demoArtifactPort ? `${demoDeviceAddress}:${demoArtifactPort}` : demoDeviceAddress;
@@ -2842,12 +2849,11 @@ var getDeploymentRelease = (0, import_toolkit15.createSelector)(
2842
2849
  var getSelectedDeploymentData = (0, import_toolkit15.createSelector)(
2843
2850
  [getDeploymentsById, getDeploymentsSelectionState, getDevicesById, getSelectedDeploymentDeviceIds],
2844
2851
  (deploymentsById, { selectedId }, devicesById, selectedDeviceIds) => {
2845
- var _a;
2846
- const deployment = (_a = deploymentsById[selectedId]) != null ? _a : {};
2852
+ const deployment = deploymentsById[selectedId] ?? {};
2847
2853
  const { devices = {} } = deployment;
2848
2854
  return {
2849
2855
  deployment,
2850
- selectedDevices: selectedDeviceIds.map((deviceId) => __spreadValues(__spreadValues({}, devicesById[deviceId]), devices[deviceId]))
2856
+ selectedDevices: selectedDeviceIds.map((deviceId) => ({ ...devicesById[deviceId], ...devices[deviceId] }))
2851
2857
  };
2852
2858
  }
2853
2859
  );
@@ -2862,8 +2868,7 @@ var getAvailableIssueOptionsByType = (0, import_toolkit15.createSelector)(
2862
2868
  }, {})
2863
2869
  );
2864
2870
  var getGroupNames = (0, import_toolkit15.createSelector)([getGroupsById, getUserRoles, (_, options = {}) => options], (groupsById, { uiPermissions }, { staticOnly }) => {
2865
- var _a;
2866
- const _b2 = groupsById, { [_a = UNGROUPED_GROUP.id]: ungrouped } = _b2, groups = __objRest(_b2, [__restKey(_a)]);
2871
+ const { [UNGROUPED_GROUP.id]: ungrouped, ...groups } = groupsById;
2867
2872
  if (staticOnly) {
2868
2873
  return Object.keys(uiPermissions.groups).sort();
2869
2874
  }
@@ -2897,9 +2902,9 @@ var getAuditlogDevice = (0, import_toolkit15.createSelector)([getAuditLogEntry,
2897
2902
  if (auditlogEvent) {
2898
2903
  const { object = {} } = auditlogEvent;
2899
2904
  const { device = {}, id, type } = object;
2900
- auditlogDevice = type === "device" ? __spreadValues({ id }, device) : auditlogDevice;
2905
+ auditlogDevice = type === "device" ? { id, ...device } : auditlogDevice;
2901
2906
  }
2902
- return __spreadValues(__spreadValues({}, auditlogDevice), devicesById[auditlogDevice.id]);
2907
+ return { ...auditlogDevice, ...devicesById[auditlogDevice.id] };
2903
2908
  });
2904
2909
  var getRelevantRoles = (0, import_toolkit15.createSelector)([getOrganization, getRolesList], ({ service_provider }, roles) => {
2905
2910
  if (service_provider) {
@@ -2921,8 +2926,7 @@ var getRelevantRoles = (0, import_toolkit15.createSelector)([getOrganization, ge
2921
2926
  // src/api/general-api.ts
2922
2927
  var import_axios = __toESM(require("axios"));
2923
2928
  var unauthorizedRedirect = (error) => {
2924
- var _a;
2925
- if (!(0, import_axios.isCancel)(error) && ((_a = error.response) == null ? void 0 : _a.status) === 401 && getToken()) {
2929
+ if (!(0, import_axios.isCancel)(error) && error.response?.status === 401 && getToken()) {
2926
2930
  cleanUp();
2927
2931
  window.location.replace("/ui/");
2928
2932
  }
@@ -2932,7 +2936,7 @@ var commonRequestConfig = { timeout: TIMEOUTS.refreshDefault, headers: { "Conten
2932
2936
  var authenticatedRequest = import_axios.default.create(commonRequestConfig);
2933
2937
  authenticatedRequest.interceptors.response.use((res) => res, unauthorizedRedirect);
2934
2938
  authenticatedRequest.interceptors.request.use(
2935
- (config) => __spreadProps(__spreadValues({}, config), { headers: __spreadProps(__spreadValues({}, config.headers), { Authorization: `Bearer ${getToken()}` }) }),
2939
+ (config) => ({ ...config, headers: { ...config.headers, Authorization: `Bearer ${getToken()}` } }),
2936
2940
  (error) => Promise.reject(error)
2937
2941
  );
2938
2942
  var Api = {
@@ -2940,7 +2944,7 @@ var Api = {
2940
2944
  delete: (url, data) => authenticatedRequest.request({ method: "delete", url, data }),
2941
2945
  patch: authenticatedRequest.patch,
2942
2946
  post: authenticatedRequest.post,
2943
- postUnauthorized: (url, data, config = {}) => import_axios.default.post(url, data, __spreadValues(__spreadValues({}, commonRequestConfig), config)),
2947
+ postUnauthorized: (url, data, config = {}) => import_axios.default.post(url, data, { ...commonRequestConfig, ...config }),
2944
2948
  put: authenticatedRequest.put,
2945
2949
  upload: (url, formData, progress2, cancelSignal) => authenticatedRequest.post(url, formData, {
2946
2950
  headers: { "Content-Type": "multipart/form-data" },
@@ -2971,17 +2975,16 @@ var dateFunctionMap = {
2971
2975
  setDays: "setDate"
2972
2976
  };
2973
2977
  var setOfflineThreshold = (0, import_toolkit16.createAsyncThunk)(`${sliceName}/setOfflineThreshold`, (_, { dispatch, getState }) => {
2974
- var _a, _b2;
2975
2978
  const { interval, intervalUnit } = getOfflineThresholdSettings(getState());
2976
2979
  const today = /* @__PURE__ */ new Date();
2977
2980
  const intervalName = `${intervalUnit.charAt(0).toUpperCase()}${intervalUnit.substring(1)}`;
2978
- const setter = (_a = dateFunctionMap[`set${intervalName}`]) != null ? _a : `set${intervalName}`;
2979
- const getter = (_b2 = dateFunctionMap[`get${intervalName}`]) != null ? _b2 : `get${intervalName}`;
2981
+ const setter = dateFunctionMap[`set${intervalName}`] ?? `set${intervalName}`;
2982
+ const getter = dateFunctionMap[`get${intervalName}`] ?? `get${intervalName}`;
2980
2983
  today[setter](today[getter]() - interval);
2981
2984
  let value;
2982
2985
  try {
2983
2986
  value = today.toISOString();
2984
- } catch (e) {
2987
+ } catch {
2985
2988
  return Promise.resolve(dispatch(actions.setSnackbar("There was an error saving the offline threshold, please check your settings.")));
2986
2989
  }
2987
2990
  return Promise.resolve(dispatch(actions.setOfflineThreshold(value)));
@@ -3022,37 +3025,43 @@ var getLatestReleaseInfo = (0, import_toolkit16.createAsyncThunk)(`${sliceName}/
3022
3025
  accu.latestRepos[item.name] = getComparisonCompatibleVersion(item.version);
3023
3026
  return accu;
3024
3027
  },
3025
- { latestVersions: __spreadValues({}, getState().app.versionInformation), latestRepos: {} }
3028
+ { latestVersions: { ...getState().app.versionInformation }, latestRepos: {} }
3026
3029
  );
3027
3030
  const info = deductSaasState(latestRelease, guiTags, saas);
3028
3031
  return Promise.resolve(
3029
3032
  dispatch(
3030
- actions.setVersionInformation(__spreadProps(__spreadValues({}, latestVersions), {
3033
+ actions.setVersionInformation({
3034
+ ...latestVersions,
3031
3035
  backend: info,
3032
3036
  GUI: info,
3033
3037
  latestRelease: {
3034
3038
  releaseDate: latestRelease.release_date,
3035
3039
  repos: latestRepos
3036
3040
  }
3037
- }))
3041
+ })
3038
3042
  )
3039
3043
  );
3040
3044
  });
3041
3045
  });
3042
3046
  var setSearchState = (0, import_toolkit16.createAsyncThunk)(`${sliceName}/setSearchState`, (searchState, { dispatch, getState }) => {
3043
3047
  const currentState = getSearchState(getState());
3044
- let nextState = __spreadProps(__spreadValues(__spreadValues({}, currentState), searchState), {
3045
- sort: __spreadValues(__spreadValues({}, currentState.sort), searchState.sort)
3046
- });
3048
+ let nextState = {
3049
+ ...currentState,
3050
+ ...searchState,
3051
+ sort: {
3052
+ ...currentState.sort,
3053
+ ...searchState.sort
3054
+ }
3055
+ };
3047
3056
  let tasks = [];
3048
- const _a = currentState, { isSearching: currentSearching, deviceIds: currentDevices, searchTotal: currentTotal } = _a, currentRequestState = __objRest(_a, ["isSearching", "deviceIds", "searchTotal"]);
3049
- const _b2 = nextState, { isSearching: nextSearching, deviceIds: nextDevices, searchTotal: nextTotal } = _b2, nextRequestState = __objRest(_b2, ["isSearching", "deviceIds", "searchTotal"]);
3057
+ const { isSearching: currentSearching, deviceIds: currentDevices, searchTotal: currentTotal, ...currentRequestState } = currentState;
3058
+ const { isSearching: nextSearching, deviceIds: nextDevices, searchTotal: nextTotal, ...nextRequestState } = nextState;
3050
3059
  if (nextRequestState.searchTerm && !(0, import_helpers6.deepCompare)(currentRequestState, nextRequestState)) {
3051
3060
  nextState.isSearching = true;
3052
3061
  tasks.push(
3053
3062
  dispatch(searchDevices(nextState)).unwrap().then((results) => {
3054
3063
  const searchResult = results[results.length - 1];
3055
- return dispatch(actions.setSearchState(__spreadProps(__spreadValues({}, searchResult), { isSearching: false })));
3064
+ return dispatch(actions.setSearchState({ ...searchResult, isSearching: false }));
3056
3065
  }).catch(() => dispatch(actions.setSearchState({ isSearching: false, searchTotal: 0 })))
3057
3066
  );
3058
3067
  }
@@ -3093,8 +3102,9 @@ var sessionReducer = (state, action) => {
3093
3102
  return rootReducer(state, action);
3094
3103
  };
3095
3104
  var getConfiguredStore = (options = {}) => {
3096
- const _a = options, { preloadedState = {} } = _a, config = __objRest(_a, ["preloadedState"]);
3097
- return (0, import_toolkit17.configureStore)(__spreadProps(__spreadValues({}, config), {
3105
+ const { preloadedState = {}, ...config } = options;
3106
+ return (0, import_toolkit17.configureStore)({
3107
+ ...config,
3098
3108
  preloadedState,
3099
3109
  reducer: sessionReducer,
3100
3110
  middleware: (getDefaultMiddleware) => getDefaultMiddleware({
@@ -3107,7 +3117,7 @@ var getConfiguredStore = (options = {}) => {
3107
3117
  ignoredPaths: ["app.uploadsById", "app.snackbar", "organization.externalDeviceIntegrations"]
3108
3118
  }
3109
3119
  })
3110
- }));
3120
+ });
3111
3121
  };
3112
3122
  var store = getConfiguredStore({
3113
3123
  preloadedState: {}
@@ -3122,13 +3132,15 @@ var { page: defaultPage, perPage: defaultPerPage } = DEVICE_LIST_DEFAULTS;
3122
3132
  var deriveDeploymentGroup = ({ filter = {}, group, groups = [], name }) => group || groups.length === 1 && !(0, import_isUUID.default)(name) ? groups[0] : filter.name;
3123
3133
  var transformDeployments = (deployments, deploymentsById) => deployments.sort(import_helpers7.startTimeSort).reduce(
3124
3134
  (accu, item) => {
3125
- var _a, _b2;
3126
- const filter = (_a = item.filter) != null ? _a : {};
3127
- let deployment = __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, deploymentPrototype), deploymentsById[item.id]), item), {
3128
- filter: item.filter ? __spreadProps(__spreadValues({}, filter), { name: (_b2 = filter.name) != null ? _b2 : filter.id, filters: mapTermsToFilters(filter.terms) }) : void 0,
3135
+ const filter = item.filter ?? {};
3136
+ let deployment = {
3137
+ ...deploymentPrototype,
3138
+ ...deploymentsById[item.id],
3139
+ ...item,
3140
+ filter: item.filter ? { ...filter, name: filter.name ?? filter.id, filters: mapTermsToFilters(filter.terms) } : void 0,
3129
3141
  name: decodeURIComponent(item.name)
3130
- });
3131
- deployment = __spreadProps(__spreadValues({}, deployment), { group: deriveDeploymentGroup(deployment) });
3142
+ };
3143
+ deployment = { ...deployment, group: deriveDeploymentGroup(deployment) };
3132
3144
  accu.deployments[item.id] = deployment;
3133
3145
  accu.deploymentIds.push(item.id);
3134
3146
  return accu;
@@ -3182,11 +3194,12 @@ var createDeployment = (0, import_toolkit18.createAsyncThunk)(`${sliceName2}/cre
3182
3194
  return request.catch((err) => commonErrorHandler(err, "Error creating deployment.", dispatch)).then((data) => {
3183
3195
  const lastslashindex = data.headers.location.lastIndexOf("/");
3184
3196
  const deploymentId = data.headers.location.substring(lastslashindex + 1);
3185
- const deployment = __spreadProps(__spreadValues({}, newDeployment), {
3197
+ const deployment = {
3198
+ ...newDeployment,
3186
3199
  id: deploymentId,
3187
3200
  devices: newDeployment.devices ? newDeployment.devices.map((id) => ({ id, status: "pending" })) : [],
3188
3201
  statistics: { status: {} }
3189
- });
3202
+ };
3190
3203
  let tasks = [
3191
3204
  dispatch(actions2.createdDeployment(deployment)),
3192
3205
  dispatch(getSingleDeployment(deploymentId)),
@@ -3329,14 +3342,23 @@ var updateDeploymentControlMap = (0, import_toolkit18.createAsyncThunk)(
3329
3342
  ({ deploymentId, updateControlMap }, { dispatch }) => general_api_default.patch(`${deploymentsApiUrl}/deployments/${deploymentId}`, { update_control_map: updateControlMap }).catch((err) => commonErrorHandler(err, "There was an error while updating the deployment status:", dispatch)).then(() => Promise.resolve(dispatch(getSingleDeployment(deploymentId))))
3330
3343
  );
3331
3344
  var setDeploymentsState = (0, import_toolkit18.createAsyncThunk)(`${sliceName2}/setDeploymentsState`, (selection, { dispatch, getState }) => {
3332
- const _a = selection, { page, perPage } = _a, selectionState = __objRest(_a, ["page", "perPage"]);
3345
+ const { page, perPage, ...selectionState } = selection;
3333
3346
  const currentState = getState().deployments.selectionState;
3334
- let nextState = __spreadProps(__spreadValues(__spreadValues(__spreadValues({}, currentState), selectionState), Object.keys(DEPLOYMENT_STATES).reduce((accu, item) => {
3335
- accu[item] = __spreadValues(__spreadValues({}, currentState[item]), selectionState[item]);
3336
- return accu;
3337
- }, {})), {
3338
- general: __spreadValues(__spreadValues({}, currentState.general), selectionState.general)
3339
- });
3347
+ let nextState = {
3348
+ ...currentState,
3349
+ ...selectionState,
3350
+ ...Object.keys(DEPLOYMENT_STATES).reduce((accu, item) => {
3351
+ accu[item] = {
3352
+ ...currentState[item],
3353
+ ...selectionState[item]
3354
+ };
3355
+ return accu;
3356
+ }, {}),
3357
+ general: {
3358
+ ...currentState.general,
3359
+ ...selectionState.general
3360
+ }
3361
+ };
3340
3362
  let tasks = [dispatch(actions2.setDeploymentsState(nextState))];
3341
3363
  if (nextState.selectedId && currentState.selectedId !== nextState.selectedId) {
3342
3364
  tasks.push(dispatch(getSingleDeployment(nextState.selectedId)));
@@ -3366,15 +3388,20 @@ var getDeploymentsConfig = (0, import_toolkit18.createAsyncThunk)(
3366
3388
  const { binary_delta = {}, binary_delta_limits = {} } = delta;
3367
3389
  const { xdelta_args = {}, timeout: timeoutConfig = oldConfig.binaryDelta.timeout } = binary_delta;
3368
3390
  const { xdelta_args_limits = {}, timeout: timeoutLimit = oldConfig.binaryDeltaLimits.timeout } = binary_delta_limits;
3369
- const config = __spreadProps(__spreadValues({}, oldConfig), {
3391
+ const config = {
3392
+ ...oldConfig,
3370
3393
  hasDelta: Boolean(delta.enabled),
3371
- binaryDelta: __spreadValues(__spreadProps(__spreadValues({}, oldConfig.binaryDelta), {
3372
- timeout: timeoutConfig
3373
- }), mapExternalDeltaConfig(xdelta_args)),
3374
- binaryDeltaLimits: __spreadValues(__spreadProps(__spreadValues({}, oldConfig.binaryDeltaLimits), {
3375
- timeout: timeoutLimit
3376
- }), mapExternalDeltaConfig(xdelta_args_limits))
3377
- });
3394
+ binaryDelta: {
3395
+ ...oldConfig.binaryDelta,
3396
+ timeout: timeoutConfig,
3397
+ ...mapExternalDeltaConfig(xdelta_args)
3398
+ },
3399
+ binaryDeltaLimits: {
3400
+ ...oldConfig.binaryDeltaLimits,
3401
+ timeout: timeoutLimit,
3402
+ ...mapExternalDeltaConfig(xdelta_args_limits)
3403
+ }
3404
+ };
3378
3405
  return Promise.resolve(dispatch(actions2.setDeploymentsConfig(config)));
3379
3406
  })
3380
3407
  );
@@ -3384,7 +3411,7 @@ var deepClean = (source) => Object.entries(source).reduce((accu, [key, value]) =
3384
3411
  if (cleanedValue === void 0 || typeof cleanedValue === "object" && (0, import_helpers7.isEmpty)(cleanedValue)) {
3385
3412
  return accu;
3386
3413
  }
3387
- accu = __spreadProps(__spreadValues({}, accu != null ? accu : {}), { [key]: cleanedValue });
3414
+ accu = { ...accu ?? {}, [key]: cleanedValue };
3388
3415
  }
3389
3416
  return accu;
3390
3417
  }, void 0);
@@ -3404,9 +3431,13 @@ var saveDeltaDeploymentsConfig = (0, import_toolkit18.createAsyncThunk)(`${slice
3404
3431
  }
3405
3432
  return general_api_default.put(`${deploymentsApiUrl}/config/binary_delta`, result).catch((err) => commonErrorHandler(err, "There was a problem storing your delta artifact generation configuration.", dispatch)).then(() => {
3406
3433
  const oldConfig = getState().deployments.config;
3407
- const newConfig = __spreadProps(__spreadValues({}, oldConfig), {
3408
- binaryDelta: __spreadValues(__spreadValues({}, oldConfig.binaryDelta), config)
3409
- });
3434
+ const newConfig = {
3435
+ ...oldConfig,
3436
+ binaryDelta: {
3437
+ ...oldConfig.binaryDelta,
3438
+ ...config
3439
+ }
3440
+ };
3410
3441
  return Promise.all([dispatch(actions2.setDeploymentsConfig(newConfig)), dispatch(setSnackbar2("Settings saved successfully"))]);
3411
3442
  });
3412
3443
  });
@@ -3419,19 +3450,20 @@ var import_toolkit19 = require("@reduxjs/toolkit");
3419
3450
  var import_axios2 = require("axios");
3420
3451
  var import_pluralize = __toESM(require_pluralize());
3421
3452
 
3422
- // ../../node_modules/uuid/dist/esm-node/rng.js
3423
- var import_crypto = __toESM(require("crypto"));
3424
- var rnds8Pool = new Uint8Array(256);
3425
- var poolPtr = rnds8Pool.length;
3453
+ // ../../node_modules/uuid/dist/esm-browser/rng.js
3454
+ var getRandomValues;
3455
+ var rnds8 = new Uint8Array(16);
3426
3456
  function rng() {
3427
- if (poolPtr > rnds8Pool.length - 16) {
3428
- import_crypto.default.randomFillSync(rnds8Pool);
3429
- poolPtr = 0;
3457
+ if (!getRandomValues) {
3458
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
3459
+ if (!getRandomValues) {
3460
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
3461
+ }
3430
3462
  }
3431
- return rnds8Pool.slice(poolPtr, poolPtr += 16);
3463
+ return getRandomValues(rnds8);
3432
3464
  }
3433
3465
 
3434
- // ../../node_modules/uuid/dist/esm-node/stringify.js
3466
+ // ../../node_modules/uuid/dist/esm-browser/stringify.js
3435
3467
  var byteToHex = [];
3436
3468
  for (let i = 0; i < 256; ++i) {
3437
3469
  byteToHex.push((i + 256).toString(16).slice(1));
@@ -3440,13 +3472,13 @@ function unsafeStringify(arr, offset = 0) {
3440
3472
  return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
3441
3473
  }
3442
3474
 
3443
- // ../../node_modules/uuid/dist/esm-node/native.js
3444
- var import_crypto2 = __toESM(require("crypto"));
3475
+ // ../../node_modules/uuid/dist/esm-browser/native.js
3476
+ var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
3445
3477
  var native_default = {
3446
- randomUUID: import_crypto2.default.randomUUID
3478
+ randomUUID
3447
3479
  };
3448
3480
 
3449
- // ../../node_modules/uuid/dist/esm-node/v4.js
3481
+ // ../../node_modules/uuid/dist/esm-browser/v4.js
3450
3482
  function v4(options, buf, offset) {
3451
3483
  if (native_default.randomUUID && !buf && !options) {
3452
3484
  return native_default.randomUUID();
@@ -3488,14 +3520,13 @@ var getGroups2 = (0, import_toolkit19.createAsyncThunk)(
3488
3520
  (_, { dispatch, getState }) => general_api_default.get(`${inventoryApiUrl}/groups`).then((res) => {
3489
3521
  const state = getGroupsById(getState());
3490
3522
  const dynamicGroups = Object.entries(state).reduce((accu, [id, group]) => {
3491
- var _a;
3492
- if (group.id || ((_a = group.filters) == null ? void 0 : _a.length) && id !== UNGROUPED_GROUP.id) {
3523
+ if (group.id || group.filters?.length && id !== UNGROUPED_GROUP.id) {
3493
3524
  accu[id] = group;
3494
3525
  }
3495
3526
  return accu;
3496
3527
  }, {});
3497
3528
  const groups = res.data.reduce((accu, group) => {
3498
- accu[group] = __spreadValues({ deviceIds: [], filters: [], total: 0 }, state[group]);
3529
+ accu[group] = { deviceIds: [], filters: [], total: 0, ...state[group] };
3499
3530
  return accu;
3500
3531
  }, dynamicGroups);
3501
3532
  const filters = [{ key: "group", value: res.data, operator: DEVICE_FILTERING_OPTIONS.$nin.key, scope: "system" }];
@@ -3553,7 +3584,7 @@ var addStaticGroup = (0, import_toolkit19.createAsyncThunk)(
3553
3584
  () => Promise.resolve(
3554
3585
  dispatch(
3555
3586
  actions3.addGroup({
3556
- group: __spreadValues({ deviceIds: [], total: 0, filters: [] }, getState().devices.groups.byId[group]),
3587
+ group: { deviceIds: [], total: 0, filters: [], ...getState().devices.groups.byId[group] },
3557
3588
  groupName: group
3558
3589
  })
3559
3590
  )
@@ -3581,20 +3612,19 @@ var getDynamicGroups = (0, import_toolkit19.createAsyncThunk)(
3581
3612
  (_, { dispatch, getState }) => general_api_default.get(`${inventoryApiUrlV2}/filters?per_page=${MAX_PAGE_SIZE}`).then(({ data: filters }) => {
3582
3613
  const state = getGroupsById(getState());
3583
3614
  const staticGroups = Object.entries(state).reduce((accu, [id, group]) => {
3584
- var _a;
3585
- if (!(group.id || ((_a = group.filters) == null ? void 0 : _a.length))) {
3615
+ if (!(group.id || group.filters?.length)) {
3586
3616
  accu[id] = group;
3587
3617
  }
3588
3618
  return accu;
3589
3619
  }, {});
3590
3620
  const groups = (filters || []).reduce((accu, filter) => {
3591
- accu[filter.name] = __spreadProps(__spreadValues({
3621
+ accu[filter.name] = {
3592
3622
  deviceIds: [],
3593
- total: 0
3594
- }, state[filter.name]), {
3623
+ total: 0,
3624
+ ...state[filter.name],
3595
3625
  id: filter.id,
3596
3626
  filters: mapTermsToFilters(filter.terms)
3597
- });
3627
+ };
3598
3628
  return accu;
3599
3629
  }, staticGroups);
3600
3630
  return Promise.resolve(dispatch(actions3.receivedGroups(groups)));
@@ -3634,10 +3664,9 @@ var removeDynamicGroup = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/r
3634
3664
  );
3635
3665
  });
3636
3666
  var getGroupFilters = (group, groupsState, filters = []) => {
3637
- var _a;
3638
3667
  const groupName = group === UNGROUPED_GROUP.id || group === UNGROUPED_GROUP.name ? UNGROUPED_GROUP.id : group;
3639
3668
  const selectedGroup = groupsState.byId[groupName];
3640
- const groupFilterLength = ((_a = selectedGroup == null ? void 0 : selectedGroup.filters) == null ? void 0 : _a.length) || 0;
3669
+ const groupFilterLength = selectedGroup?.filters?.length || 0;
3641
3670
  const cleanedFilters = groupFilterLength ? [...filters, ...selectedGroup.filters].filter(filtersFilter) : filters;
3642
3671
  return { cleanedFilters, groupName, selectedGroup, groupFilterLength };
3643
3672
  };
@@ -3660,7 +3689,6 @@ var selectGroup = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/selectGr
3660
3689
  var getEarliestTs = (dateA = "", dateB = "") => !dateA || !dateB ? dateA || dateB : dateA < dateB ? dateA : dateB;
3661
3690
  var reduceReceivedDevices = (devices, ids, state, status) => devices.reduce(
3662
3691
  (accu, device) => {
3663
- var _a, _b2, _c;
3664
3692
  const stateDevice = getDeviceById(state, device.id);
3665
3693
  const {
3666
3694
  attributes: storedAttributes = {},
@@ -3670,29 +3698,29 @@ var reduceReceivedDevices = (devices, ids, state, status) => devices.reduce(
3670
3698
  group: storedGroup
3671
3699
  } = stateDevice;
3672
3700
  const { identity, inventory, monitor, system = {}, tags } = mapDeviceAttributes(device.attributes);
3673
- device.tags = __spreadValues(__spreadValues({}, storedTags), tags);
3674
- device.group = (_a = system.group) != null ? _a : storedGroup;
3675
- device.monitor = __spreadValues(__spreadValues({}, storedMonitor), monitor);
3676
- device.identity_data = __spreadValues(__spreadValues(__spreadValues({}, storedIdentity), identity), device.identity_data ? device.identity_data : {});
3701
+ device.tags = { ...storedTags, ...tags };
3702
+ device.group = system.group ?? storedGroup;
3703
+ device.monitor = { ...storedMonitor, ...monitor };
3704
+ device.identity_data = { ...storedIdentity, ...identity, ...device.identity_data ? device.identity_data : {} };
3677
3705
  device.status = status ? status : device.status || identity.status;
3678
- device.check_in_time_rounded = (_b2 = system.check_in_time) != null ? _b2 : stateDevice.check_in_time_rounded;
3679
- device.check_in_time_exact = (_c = device.check_in_time) != null ? _c : stateDevice.check_in_time_exact;
3706
+ device.check_in_time_rounded = system.check_in_time ?? stateDevice.check_in_time_rounded;
3707
+ device.check_in_time_exact = device.check_in_time ?? stateDevice.check_in_time_exact;
3680
3708
  device.created_ts = getEarliestTs(getEarliestTs(system.created_ts, device.created_ts), stateDevice.created_ts);
3681
3709
  device.updated_ts = device.attributes ? device.updated_ts : stateDevice.updated_ts;
3682
3710
  device.isNew = new Date(device.created_ts) > new Date(state.app.newThreshold);
3683
3711
  device.isOffline = new Date(device.check_in_time_rounded) < new Date(state.app.offlineThreshold) || device.check_in_time_rounded === void 0;
3684
- device.attributes = device.attributes ? __spreadValues(__spreadValues({}, storedAttributes), inventory) : storedAttributes;
3685
- accu.devicesById[device.id] = __spreadValues(__spreadValues({}, stateDevice), device);
3712
+ device.attributes = device.attributes ? { ...storedAttributes, ...inventory } : storedAttributes;
3713
+ accu.devicesById[device.id] = { ...stateDevice, ...device };
3686
3714
  accu.ids.push(device.id);
3687
3715
  return accu;
3688
3716
  },
3689
3717
  { ids, devicesById: {} }
3690
3718
  );
3691
3719
  var getGroupDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/getGroupDevices`, (options, { dispatch, getState }) => {
3692
- const _a = options, { group, shouldIncludeAllStates } = _a, remainder = __objRest(_a, ["group", "shouldIncludeAllStates"]);
3720
+ const { group, shouldIncludeAllStates, ...remainder } = options;
3693
3721
  const { cleanedFilters: filterSelection } = getGroupFilters(group, getState().devices.groups);
3694
3722
  return Promise.resolve(
3695
- dispatch(getDevicesByStatus2(__spreadProps(__spreadValues({}, remainder), { filterSelection, group, status: shouldIncludeAllStates ? void 0 : DEVICE_STATES.accepted })))
3723
+ dispatch(getDevicesByStatus2({ ...remainder, filterSelection, group, status: shouldIncludeAllStates ? void 0 : DEVICE_STATES.accepted }))
3696
3724
  ).unwrap().then((results) => {
3697
3725
  if (!group) {
3698
3726
  return Promise.resolve();
@@ -3706,7 +3734,7 @@ var getGroupDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/getG
3706
3734
  dispatch(
3707
3735
  actions3.addGroup({
3708
3736
  group: {
3709
- deviceIds: deviceAccu.ids.length === total || deviceAccu.ids.length > (stateGroup == null ? void 0 : stateGroup.deviceIds) ? deviceAccu.ids : stateGroup.deviceIds,
3737
+ deviceIds: deviceAccu.ids.length === total || deviceAccu.ids.length > stateGroup?.deviceIds ? deviceAccu.ids : stateGroup.deviceIds,
3710
3738
  total
3711
3739
  },
3712
3740
  groupName: group
@@ -3855,27 +3883,26 @@ var getDeviceLimit2 = (0, import_toolkit19.createAsyncThunk)(
3855
3883
  );
3856
3884
  var setDeviceListState = (0, import_toolkit19.createAsyncThunk)(
3857
3885
  `${sliceName3}/setDeviceListState`,
3858
- (_a, { dispatch, getState }) => {
3859
- var _b2 = _a, { shouldSelectDevices = true, forceRefresh, fetchAuth = true } = _b2, selectionState = __objRest(_b2, ["shouldSelectDevices", "forceRefresh", "fetchAuth"]);
3860
- var _c;
3886
+ ({ shouldSelectDevices = true, forceRefresh, fetchAuth = true, ...selectionState }, { dispatch, getState }) => {
3861
3887
  const currentState = getDeviceListState(getState());
3862
3888
  const refreshTrigger = forceRefresh ? !currentState.refreshTrigger : selectionState.refreshTrigger;
3863
- let nextState = __spreadProps(__spreadValues(__spreadProps(__spreadValues({}, currentState), {
3889
+ let nextState = {
3890
+ ...currentState,
3864
3891
  setOnly: false,
3865
- refreshTrigger
3866
- }), selectionState), {
3867
- sort: __spreadValues(__spreadValues({}, currentState.sort), selectionState.sort)
3868
- });
3892
+ refreshTrigger,
3893
+ ...selectionState,
3894
+ sort: { ...currentState.sort, ...selectionState.sort }
3895
+ };
3869
3896
  let tasks = [];
3870
- const _a2 = currentState, { isLoading: currentLoading, deviceIds: currentDevices, selection: currentSelection } = _a2, currentRequestState = __objRest(_a2, ["isLoading", "deviceIds", "selection"]);
3871
- const _b3 = nextState, { isLoading: nextLoading, deviceIds: nextDevices, selection: nextSelection } = _b3, nextRequestState = __objRest(_b3, ["isLoading", "deviceIds", "selection"]);
3897
+ const { isLoading: currentLoading, deviceIds: currentDevices, selection: currentSelection, ...currentRequestState } = currentState;
3898
+ const { isLoading: nextLoading, deviceIds: nextDevices, selection: nextSelection, ...nextRequestState } = nextState;
3872
3899
  if (!nextState.setOnly && !(0, import_helpers8.deepCompare)(currentRequestState, nextRequestState)) {
3873
- const { direction: sortDown = SORTING_OPTIONS.desc, key: sortCol, scope: sortScope } = (_c = nextState.sort) != null ? _c : {};
3900
+ const { direction: sortDown = SORTING_OPTIONS.desc, key: sortCol, scope: sortScope } = nextState.sort ?? {};
3874
3901
  const sortBy = sortCol ? [{ attribute: sortCol, order: sortDown, scope: sortScope }] : void 0;
3875
3902
  const applicableSelectedState = nextState.state === ALL_DEVICE_STATES ? void 0 : nextState.state;
3876
3903
  nextState.isLoading = true;
3877
3904
  tasks.push(
3878
- dispatch(getDevicesByStatus2(__spreadProps(__spreadValues({}, nextState), { status: applicableSelectedState, sortOptions: sortBy, fetchAuth }))).unwrap().then((results) => {
3905
+ dispatch(getDevicesByStatus2({ ...nextState, status: applicableSelectedState, sortOptions: sortBy, fetchAuth })).unwrap().then((results) => {
3879
3906
  const { deviceAccu, total } = results[results.length - 1];
3880
3907
  const devicesState = shouldSelectDevices ? { deviceIds: deviceAccu.ids, total, isLoading: false } : { isLoading: false };
3881
3908
  return Promise.resolve(dispatch(actions3.setDeviceListState(devicesState)));
@@ -3900,8 +3927,8 @@ var getDevicesByStatus2 = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/
3900
3927
  } = options;
3901
3928
  const state = getState();
3902
3929
  const { applicableFilters, filterTerms } = convertDeviceListStateToFilters({
3903
- filters: filterSelection != null ? filterSelection : getDeviceFilters(state),
3904
- group: group != null ? group : getSelectedGroup(state),
3930
+ filters: filterSelection ?? getDeviceFilters(state),
3931
+ group: group ?? getSelectedGroup(state),
3905
3932
  groups: state.devices.groups,
3906
3933
  offlineThreshold: state.app.offlineThreshold,
3907
3934
  selectedIssues,
@@ -3962,7 +3989,7 @@ var getAllDevicesByStatus = (0, import_toolkit19.createAsyncThunk)(`${sliceName3
3962
3989
  });
3963
3990
  var searchDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/searchDevices`, (passedOptions = {}, { dispatch, getState }) => {
3964
3991
  const state = getState();
3965
- let options = __spreadValues(__spreadValues({}, state.app.searchState), passedOptions);
3992
+ let options = { ...state.app.searchState, ...passedOptions };
3966
3993
  const { page = defaultPage2, searchTerm, sortOptions = [] } = options;
3967
3994
  const { columnSelection = [] } = getUserSettings(state);
3968
3995
  const selectedAttributes = columnSelection.map((column) => ({ attribute: column.key, scope: column.scope }));
@@ -4097,8 +4124,7 @@ var getSessionDetails = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/ge
4097
4124
  ({ data: auditLogEntries }) => {
4098
4125
  const { start, end } = auditLogEntries.reduce(
4099
4126
  (accu, item) => {
4100
- var _a, _b2;
4101
- if ((_b2 = (_a = item.meta) == null ? void 0 : _a.session_id) == null ? void 0 : _b2.includes(sessionId)) {
4127
+ if (item.meta?.session_id?.includes(sessionId)) {
4102
4128
  accu.start = new Date(item.action.startsWith("open") ? item.time : accu.start);
4103
4129
  accu.end = new Date(item.action.startsWith("close") ? item.time : accu.end);
4104
4130
  }
@@ -4205,8 +4231,7 @@ var decommissionDevice = (0, import_toolkit19.createAsyncThunk)(
4205
4231
  var getDeviceConfig = (0, import_toolkit19.createAsyncThunk)(
4206
4232
  `${sliceName3}/getDeviceConfig`,
4207
4233
  (deviceId, { dispatch }) => general_api_default.get(`${deviceConfig}/${deviceId}`).then(({ data }) => Promise.all([dispatch(actions3.receivedDevice({ id: deviceId, config: data })), Promise.resolve(data)])).catch((err) => {
4208
- var _a, _b2;
4209
- if (((_b2 = (_a = err.response) == null ? void 0 : _a.data) == null ? void 0 : _b2.error.status_code) !== 404) {
4234
+ if (err.response?.data?.error.status_code !== 404) {
4210
4235
  return commonErrorHandler(err, `There was an error retrieving the configuration for device ${deviceId}.`, dispatch, commonErrorFallback);
4211
4236
  }
4212
4237
  })
@@ -4218,15 +4243,14 @@ var setDeviceConfig = (0, import_toolkit19.createAsyncThunk)(
4218
4243
  var applyDeviceConfig = (0, import_toolkit19.createAsyncThunk)(
4219
4244
  `${sliceName3}/applyDeviceConfig`,
4220
4245
  ({ deviceId, configDeploymentConfiguration, isDefault, config }, { dispatch, getState }) => general_api_default.post(`${deviceConfig}/${deviceId}/deploy`, configDeploymentConfiguration).catch((err) => commonErrorHandler(err, `There was an error deploying the configuration to device ${deviceId}.`, dispatch, commonErrorFallback)).then(({ data }) => {
4221
- var _a;
4222
4246
  const device = getDeviceById(getState(), deviceId);
4223
4247
  const { canManageUsers } = getUserCapabilities(getState());
4224
4248
  let tasks = [
4225
- dispatch(actions3.receivedDevice(__spreadProps(__spreadValues({}, device), { config: __spreadProps(__spreadValues({}, device.config), { deployment_id: data.deployment_id }) }))),
4249
+ dispatch(actions3.receivedDevice({ ...device, config: { ...device.config, deployment_id: data.deployment_id } })),
4226
4250
  new Promise((resolve) => setTimeout(() => resolve(dispatch(getSingleDeployment(data.deployment_id))), TIMEOUTS.oneSecond))
4227
4251
  ];
4228
4252
  if (isDefault && canManageUsers) {
4229
- const { previous } = (_a = getGlobalSettings(getState()).defaultDeviceConfig) != null ? _a : {};
4253
+ const { previous } = getGlobalSettings(getState()).defaultDeviceConfig ?? {};
4230
4254
  tasks.push(dispatch(saveGlobalSettings({ defaultDeviceConfig: { current: config, previous } })));
4231
4255
  }
4232
4256
  return Promise.all(tasks);
@@ -4242,21 +4266,21 @@ var setDeviceTags = (0, import_toolkit19.createAsyncThunk)(
4242
4266
  `${inventoryApiUrl}/devices/${deviceId}/tags`,
4243
4267
  Object.entries(tags).map(([name, value]) => ({ name, value })),
4244
4268
  { headers }
4245
- ).catch((err) => commonErrorHandler(err, `There was an error setting tags for device ${deviceId}.`, dispatch, "Please check your connection.")).then(() => Promise.all([dispatch(actions3.receivedDevice(__spreadProps(__spreadValues({}, device), { id: deviceId, tags }))), dispatch(setSnackbar3("Device name changed"))]));
4269
+ ).catch((err) => commonErrorHandler(err, `There was an error setting tags for device ${deviceId}.`, dispatch, "Please check your connection.")).then(() => Promise.all([dispatch(actions3.receivedDevice({ ...device, id: deviceId, tags })), dispatch(setSnackbar3("Device name changed"))]));
4246
4270
  })
4247
4271
  )
4248
4272
  );
4249
4273
  var getDeviceTwin = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/getDeviceTwin`, ({ deviceId, integration }, { dispatch, getState }) => {
4250
4274
  let providerResult = {};
4251
4275
  return general_api_default.get(`${iotManagerBaseURL}/devices/${deviceId}/state`).then(({ data }) => {
4252
- providerResult = __spreadProps(__spreadValues({}, data), { twinError: "" });
4276
+ providerResult = { ...data, twinError: "" };
4253
4277
  }).catch((err) => {
4254
4278
  providerResult = {
4255
4279
  twinError: `There was an error getting the ${EXTERNAL_PROVIDER[integration.provider].twinTitle.toLowerCase()} for device ${deviceId}. ${err}`
4256
4280
  };
4257
4281
  }).finally(() => {
4258
4282
  const device = getDeviceById(getState(), deviceId);
4259
- Promise.resolve(dispatch(actions3.receivedDevice(__spreadProps(__spreadValues({}, device), { twinsByIntegration: __spreadValues(__spreadValues({}, device.twinsByIntegration), providerResult) }))));
4283
+ Promise.resolve(dispatch(actions3.receivedDevice({ ...device, twinsByIntegration: { ...device.twinsByIntegration, ...providerResult } })));
4260
4284
  });
4261
4285
  });
4262
4286
  var setDeviceTwin = (0, import_toolkit19.createAsyncThunk)(
@@ -4272,7 +4296,7 @@ var setDeviceTwin = (0, import_toolkit19.createAsyncThunk)(
4272
4296
  const { twinsByIntegration = {} } = device;
4273
4297
  const { [integration.id]: currentState = {} } = twinsByIntegration;
4274
4298
  return Promise.resolve(
4275
- dispatch(actions3.receivedDevice(__spreadProps(__spreadValues({}, device), { twinsByIntegration: __spreadProps(__spreadValues({}, twinsByIntegration), { [integration.id]: __spreadProps(__spreadValues({}, currentState), { desired: settings }) }) })))
4299
+ dispatch(actions3.receivedDevice({ ...device, twinsByIntegration: { ...twinsByIntegration, [integration.id]: { ...currentState, desired: settings } } }))
4276
4300
  );
4277
4301
  })
4278
4302
  );
@@ -4293,8 +4317,8 @@ var getSystemDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/get
4293
4317
  const { attributes: deviceAttributes = {} } = getDeviceById(state, id);
4294
4318
  const { mender_gateway_system_id = "" } = deviceAttributes;
4295
4319
  const filters = [
4296
- __spreadProps(__spreadValues({}, emptyFilter), { key: "mender_is_gateway", operator: DEVICE_FILTERING_OPTIONS.$ne.key, value: "true", scope: "inventory" }),
4297
- __spreadProps(__spreadValues({}, emptyFilter), { key: "mender_gateway_system_id", value: mender_gateway_system_id, scope: "inventory" })
4320
+ { ...emptyFilter, key: "mender_is_gateway", operator: DEVICE_FILTERING_OPTIONS.$ne.key, value: "true", scope: "inventory" },
4321
+ { ...emptyFilter, key: "mender_gateway_system_id", value: mender_gateway_system_id, scope: "inventory" }
4298
4322
  ];
4299
4323
  const { attributes, filterTerms } = prepareSearchArguments({ filters, state });
4300
4324
  return general_api_default.post(getSearchEndpoint(getState()), {
@@ -4306,11 +4330,12 @@ var getSystemDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/get
4306
4330
  }).catch((err) => commonErrorHandler(err, `There was an error getting system devices device ${id}.`, dispatch, "Please check your connection.")).then(({ data, headers }) => {
4307
4331
  const state2 = getState();
4308
4332
  const { devicesById, ids } = reduceReceivedDevices(data, [], state2);
4309
- const device = __spreadProps(__spreadValues({}, getDeviceById(state2, id)), {
4333
+ const device = {
4334
+ ...getDeviceById(state2, id),
4310
4335
  systemDeviceIds: ids,
4311
4336
  systemDeviceTotal: Number(headers[headerNames.total])
4312
- });
4313
- return Promise.resolve(dispatch(actions3.receivedDevices(__spreadProps(__spreadValues({}, devicesById), { [id]: device }))));
4337
+ };
4338
+ return Promise.resolve(dispatch(actions3.receivedDevices({ ...devicesById, [id]: device })));
4314
4339
  });
4315
4340
  });
4316
4341
  var getGatewayDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/getGatewayDevices`, (deviceId, { dispatch, getState }) => {
@@ -4318,9 +4343,9 @@ var getGatewayDevices = (0, import_toolkit19.createAsyncThunk)(`${sliceName3}/ge
4318
4343
  const { attributes = {} } = getDeviceById(state, deviceId);
4319
4344
  const { mender_gateway_system_id = "" } = attributes;
4320
4345
  const filters = [
4321
- __spreadProps(__spreadValues({}, emptyFilter), { key: "id", operator: DEVICE_FILTERING_OPTIONS.$ne.key, value: deviceId, scope: "identity" }),
4322
- __spreadProps(__spreadValues({}, emptyFilter), { key: "mender_is_gateway", value: "true", scope: "inventory" }),
4323
- __spreadProps(__spreadValues({}, emptyFilter), { key: "mender_gateway_system_id", value: mender_gateway_system_id, scope: "inventory" })
4346
+ { ...emptyFilter, key: "id", operator: DEVICE_FILTERING_OPTIONS.$ne.key, value: deviceId, scope: "identity" },
4347
+ { ...emptyFilter, key: "mender_is_gateway", value: "true", scope: "inventory" },
4348
+ { ...emptyFilter, key: "mender_gateway_system_id", value: mender_gateway_system_id, scope: "inventory" }
4324
4349
  ];
4325
4350
  const { attributes: attributeSelection, filterTerms } = prepareSearchArguments({ filters, state });
4326
4351
  return general_api_default.post(getSearchEndpoint(getState()), {
@@ -4367,7 +4392,7 @@ var { page: defaultPage3, perPage: defaultPerPage3 } = DEVICE_LIST_DEFAULTS;
4367
4392
  var cutoffLength = 75;
4368
4393
  var ellipsis = "...";
4369
4394
  var longTextTrimmer = (text) => text.length >= cutoffLength + ellipsis.length ? `${text.substring(0, cutoffLength + ellipsis.length)}${ellipsis}` : text;
4370
- var sanitizeDeviceAlerts = (alerts) => alerts.map((alert) => __spreadProps(__spreadValues({}, alert), { fullName: alert.name, name: longTextTrimmer(alert.name) }));
4395
+ var sanitizeDeviceAlerts = (alerts) => alerts.map((alert) => ({ ...alert, fullName: alert.name, name: longTextTrimmer(alert.name) }));
4371
4396
  var getDeviceAlerts = (0, import_toolkit20.createAsyncThunk)(`${sliceName4}/getDeviceAlerts`, ({ id, config = {} }, { dispatch }) => {
4372
4397
  const { page = defaultPage3, perPage = defaultPerPage3, issuedBefore, issuedAfter, sortAscending = false } = config;
4373
4398
  const issued_after = issuedAfter ? `&issued_after=${issuedAfter}` : "";
@@ -4385,14 +4410,15 @@ var getLatestDeviceAlerts = (0, import_toolkit20.createAsyncThunk)(`${sliceName4
4385
4410
  });
4386
4411
  var getIssueCountsByType2 = (0, import_toolkit20.createAsyncThunk)(`${sliceName4}/getIssueCountsByType`, ({ type, options = {} }, { dispatch, getState }) => {
4387
4412
  const state = getState();
4388
- const _a = options, { filters = getDeviceFilters(state), group, status } = _a, remainder = __objRest(_a, ["filters", "group", "status"]);
4389
- const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters(__spreadProps(__spreadValues({}, remainder), {
4413
+ const { filters = getDeviceFilters(state), group, status, ...remainder } = options;
4414
+ const { applicableFilters: nonMonitorFilters, filterTerms } = convertDeviceListStateToFilters({
4415
+ ...remainder,
4390
4416
  filters,
4391
4417
  group,
4392
4418
  offlineThreshold: state.app.offlineThreshold,
4393
4419
  selectedIssues: [type],
4394
4420
  status
4395
- }));
4421
+ });
4396
4422
  return general_api_default.post(getSearchEndpoint(getState()), {
4397
4423
  page: 1,
4398
4424
  per_page: 1,
@@ -4444,21 +4470,21 @@ var determineProgress = (acceptedDevices, pendingDevices, releases, pastDeployme
4444
4470
  return steps[progress2];
4445
4471
  };
4446
4472
  var deductOnboardingState = ({ devicesById, devicesByStatus, onboardingState, pastDeployments, releases, userCapabilities, userId }) => {
4447
- var _a;
4448
4473
  const { canDeploy, canManageDevices, canReadDeployments, canReadDevices, canReadReleases, canUploadReleases } = userCapabilities;
4449
4474
  const userCookie = cookies3.get(`${userId}-onboarded`);
4450
4475
  const acceptedDevices = devicesByStatus[DEVICE_STATES.accepted].deviceIds;
4451
4476
  const pendingDevices = devicesByStatus[DEVICE_STATES.pending].deviceIds;
4452
- let deviceType = (_a = onboardingState.deviceType) != null ? _a : [];
4477
+ let deviceType = onboardingState.deviceType ?? [];
4453
4478
  deviceType = !deviceType.length && acceptedDevices.length && devicesById[acceptedDevices[0]].hasOwnProperty("attributes") ? devicesById[acceptedDevices[0]].attributes.device_type : deviceType;
4454
4479
  const progress2 = applyOnboardingFallbacks(onboardingState.progress || determineProgress(acceptedDevices, pendingDevices, releases, pastDeployments));
4455
- return __spreadProps(__spreadValues({}, onboardingState), {
4480
+ return {
4481
+ ...onboardingState,
4456
4482
  complete: !!(Boolean(userCookie) || onboardingState.complete || acceptedDevices.length > 1 && pendingDevices.length > 0 && releases.length > 1 && pastDeployments.length > 1 || acceptedDevices.length >= 1 && releases.length >= 2 && pastDeployments.length > 2 || acceptedDevices.length >= 1 && pendingDevices.length > 0 && releases.length >= 2 && pastDeployments.length >= 2 || orderedOnboardingSteps.findIndex((step) => step === progress2) >= orderedOnboardingSteps.length - 1 || onboardingState.disable || ![canDeploy, canManageDevices, canReadDeployments, canReadDevices, canReadReleases, canUploadReleases].every((i) => i)),
4457
4483
  showTips: onboardingState.showTips != null ? onboardingState.showTips : true,
4458
4484
  deviceType,
4459
4485
  approach: onboardingState.approach || (deviceType.some((type) => type.startsWith("qemu")) ? "virtual" : "physical"),
4460
4486
  progress: progress2
4461
- });
4487
+ };
4462
4488
  };
4463
4489
  var getOnboardingState2 = (0, import_toolkit21.createAsyncThunk)(`${sliceName5}/getOnboardingState`, (_, { dispatch, getState }) => {
4464
4490
  const state = getState();
@@ -4516,7 +4542,7 @@ var advanceOnboarding = (0, import_toolkit21.createAsyncThunk)(`${sliceName5}/ad
4516
4542
  return;
4517
4543
  }
4518
4544
  const madeProgress = steps[stepIndex + 1];
4519
- const state = __spreadProps(__spreadValues({}, getOnboardingState(getState())), { progress: madeProgress });
4545
+ const state = { ...getOnboardingState(getState()), progress: madeProgress };
4520
4546
  state.complete = stepIndex + 1 >= steps.findIndex((step) => step === onboardingSteps.DEPLOYMENTS_PAST_COMPLETED_FAILURE) ? true : state.complete;
4521
4547
  return Promise.all([dispatch(actions5.setOnboardingProgress(madeProgress)), dispatch(saveUserSettings({ onboarding: state }))]);
4522
4548
  });
@@ -4599,8 +4625,8 @@ var completeUpgrade = (0, import_toolkit22.createAsyncThunk)(
4599
4625
  ({ tenantId, plan }, { dispatch }) => general_api_default.post(`${tenantadmApiUrlv2}/tenants/${tenantId}/upgrade/complete`, { plan }).catch((err) => commonErrorHandler(err, `There was an error upgrading your account:`, dispatch)).then(() => Promise.resolve(dispatch(getUserOrganization())))
4600
4626
  );
4601
4627
  var prepareAuditlogQuery = ({ startDate, endDate, user: userFilter, type, detail: detailFilter, sort = {} }) => {
4602
- const userId = (userFilter == null ? void 0 : userFilter.id) || userFilter;
4603
- const detail = (detailFilter == null ? void 0 : detailFilter.id) || detailFilter;
4628
+ const userId = userFilter?.id || userFilter;
4629
+ const detail = detailFilter?.id || detailFilter;
4604
4630
  const createdAfter = startDate ? `&created_after=${Math.round(Date.parse(startDate) / 1e3)}` : "";
4605
4631
  const createdBefore = endDate ? `&created_before=${Math.round(Date.parse(endDate) / 1e3)}` : "";
4606
4632
  const typeSearch = type ? `&object_type=${type.value}`.toLowerCase() : "";
@@ -4627,12 +4653,14 @@ var getAuditLogsCsvLink = (0, import_toolkit22.createAsyncThunk)(
4627
4653
  );
4628
4654
  var setAuditlogsState = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/setAuditlogsState`, (selectionState, { dispatch, getState }) => {
4629
4655
  const currentState = getAuditlogState(getState());
4630
- let nextState = __spreadProps(__spreadValues(__spreadValues({}, currentState), selectionState), {
4631
- sort: __spreadValues(__spreadValues({}, currentState.sort), selectionState.sort)
4632
- });
4656
+ let nextState = {
4657
+ ...currentState,
4658
+ ...selectionState,
4659
+ sort: { ...currentState.sort, ...selectionState.sort }
4660
+ };
4633
4661
  let tasks = [];
4634
- const _a = currentState, { isLoading: currentLoading, selectedIssue: currentIssue } = _a, currentRequestState = __objRest(_a, ["isLoading", "selectedIssue"]);
4635
- const _b2 = nextState, { isLoading: selectionLoading, selectedIssue: selectionIssue } = _b2, selectionRequestState = __objRest(_b2, ["isLoading", "selectedIssue"]);
4662
+ const { isLoading: currentLoading, selectedIssue: currentIssue, ...currentRequestState } = currentState;
4663
+ const { isLoading: selectionLoading, selectedIssue: selectionIssue, ...selectionRequestState } = nextState;
4636
4664
  if (!(0, import_helpers10.deepCompare)(currentRequestState, selectionRequestState)) {
4637
4665
  nextState.isLoading = true;
4638
4666
  tasks.push(dispatch(getAuditLogs(nextState)).finally(() => dispatch(actions6.setAuditLogState({ isLoading: false }))));
@@ -4644,27 +4672,30 @@ var tenantDataDivergedMessage = "The system detected there is a change in your p
4644
4672
  var addTenant = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/createTenant`, (selectionState, { dispatch }) => {
4645
4673
  return general_api_default.post(`${tenantadmApiUrlv2}/tenants`, selectionState).then(() => Promise.all([dispatch(getTenants()), dispatch(setSnackbar4("Tenant was created successfully."))])).catch((err) => commonErrorHandler(err, "There was an error creating tenant", dispatch, commonErrorFallback));
4646
4674
  });
4647
- var tenantListRetrieval = (config) => __async(void 0, null, function* () {
4675
+ var tenantListRetrieval = async (config) => {
4648
4676
  const { page, perPage } = config;
4649
4677
  const params = new URLSearchParams({ page, per_page: perPage }).toString();
4650
- const tenantList = yield general_api_default.get(`${tenantadmApiUrlv2}/tenants?${params}`);
4678
+ const tenantList = await general_api_default.get(`${tenantadmApiUrlv2}/tenants?${params}`);
4651
4679
  const totalCount = tenantList.headers[headerNames.total] || TENANT_LIST_DEFAULT.perPage;
4652
4680
  return [tenantList.data, Number(totalCount)];
4653
- });
4654
- var getTenants = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/getTenants`, (_0, _1) => __async(void 0, [_0, _1], function* (_, { dispatch, getState }) {
4681
+ };
4682
+ var getTenants = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/getTenants`, async (_, { dispatch, getState }) => {
4655
4683
  const currentState = getTenantsList(getState());
4656
- const [tenants, pageCount] = yield tenantListRetrieval(currentState);
4657
- dispatch(actions6.setTenantListState(__spreadProps(__spreadValues({}, currentState), { total: pageCount, tenants })));
4658
- }));
4659
- var setTenantsListState = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/setTenantsListState`, (_0, _1) => __async(void 0, [_0, _1], function* (selectionState, { dispatch, getState }) {
4684
+ const [tenants, pageCount] = await tenantListRetrieval(currentState);
4685
+ dispatch(actions6.setTenantListState({ ...currentState, total: pageCount, tenants }));
4686
+ });
4687
+ var setTenantsListState = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/setTenantsListState`, async (selectionState, { dispatch, getState }) => {
4660
4688
  const currentState = getTenantsList(getState());
4661
- const nextState = __spreadValues(__spreadValues({}, currentState), selectionState);
4689
+ const nextState = {
4690
+ ...currentState,
4691
+ ...selectionState
4692
+ };
4662
4693
  if (!(0, import_helpers10.deepCompare)(currentState, selectionState)) {
4663
- const [tenants, pageCount] = yield tenantListRetrieval(nextState);
4664
- return dispatch(actions6.setTenantListState(__spreadProps(__spreadValues({}, nextState), { tenants, total: pageCount })));
4694
+ const [tenants, pageCount] = await tenantListRetrieval(nextState);
4695
+ return dispatch(actions6.setTenantListState({ ...nextState, tenants, total: pageCount }));
4665
4696
  }
4666
- return dispatch(actions6.setTenantListState(__spreadValues({}, nextState)));
4667
- }));
4697
+ return dispatch(actions6.setTenantListState({ ...nextState }));
4698
+ });
4668
4699
  var editTenantDeviceLimit = (0, import_toolkit22.createAsyncThunk)(`${sliceName6}/editDeviceLimit`, ({ newLimit, id, name }, { dispatch }) => {
4669
4700
  return general_api_default.put(`${tenantadmApiUrlv2}/tenants/${id}/child`, { device_limit: newLimit, name }).catch((err) => commonErrorHandler(err, `Device Limit cannot be changed`, dispatch)).then(() => {
4670
4701
  const tasks = [Promise.resolve(dispatch(setSnackbar4("Device Limit was changed successfully")))];
@@ -4707,10 +4738,7 @@ var downloadLicenseReport = (0, import_toolkit22.createAsyncThunk)(
4707
4738
  );
4708
4739
  var createIntegration = (0, import_toolkit22.createAsyncThunk)(
4709
4740
  `${sliceName6}/createIntegration`,
4710
- (_a, { dispatch }) => {
4711
- var _b2 = _a, { id } = _b2, integration = __objRest(_b2, ["id"]);
4712
- return general_api_default.post(`${iotManagerBaseURL}/integrations`, integration).catch((err) => commonErrorHandler(err, "There was an error creating the integration", dispatch, commonErrorFallback)).then(() => Promise.all([dispatch(setSnackbar4("The integration was set up successfully")), dispatch(getIntegrations())]));
4713
- }
4741
+ ({ id, ...integration }, { dispatch }) => general_api_default.post(`${iotManagerBaseURL}/integrations`, integration).catch((err) => commonErrorHandler(err, "There was an error creating the integration", dispatch, commonErrorFallback)).then(() => Promise.all([dispatch(setSnackbar4("The integration was set up successfully")), dispatch(getIntegrations())]))
4714
4742
  );
4715
4743
  var changeIntegration = (0, import_toolkit22.createAsyncThunk)(
4716
4744
  `${sliceName6}/changeIntegration`,
@@ -4731,9 +4759,8 @@ var getIntegrations = (0, import_toolkit22.createAsyncThunk)(
4731
4759
  (_, { dispatch, getState }) => general_api_default.get(`${iotManagerBaseURL}/integrations`).catch((err) => commonErrorHandler(err, "There was an error retrieving the integration", dispatch, commonErrorFallback)).then(({ data }) => {
4732
4760
  const existingIntegrations = getState().organization.externalDeviceIntegrations;
4733
4761
  const integrations = data.reduce((accu, item) => {
4734
- var _a;
4735
- const existingIntegration = (_a = existingIntegrations.find((integration2) => item.id === integration2.id)) != null ? _a : {};
4736
- const integration = __spreadValues(__spreadValues({}, existingIntegration), item);
4762
+ const existingIntegration = existingIntegrations.find((integration2) => item.id === integration2.id) ?? {};
4763
+ const integration = { ...existingIntegration, ...item };
4737
4764
  accu.push(integration);
4738
4765
  return accu;
4739
4766
  }, []);
@@ -4785,7 +4812,7 @@ var getSsoConfigById = (0, import_toolkit22.createAsyncThunk)(
4785
4812
  `${sliceName6}/getSsoConfigById`,
4786
4813
  (config, { dispatch }) => general_api_default.get(`${ssoIdpApiUrlv1}/${config.id}`).catch((err) => dispatch(ssoConfigActionErrorHandler(err, "read"))).then(({ data, headers }) => {
4787
4814
  const sso = Object.values(SSO_TYPES).find(({ contentType }) => contentType === headers["content-type"]);
4788
- return sso ? Promise.resolve(__spreadProps(__spreadValues({}, config), { config: data, type: sso.id })) : Promise.reject("Unsupported SSO config content type.");
4815
+ return sso ? Promise.resolve({ ...config, config: data, type: sso.id }) : Promise.reject("Unsupported SSO config content type.");
4789
4816
  })
4790
4817
  );
4791
4818
  var getSsoConfigs = (0, import_toolkit22.createAsyncThunk)(
@@ -4804,20 +4831,21 @@ var { setSnackbar: setSnackbar5, initUpload: initUpload2, uploadProgress: upload
4804
4831
  var { page: defaultPage5, perPage: defaultPerPage5 } = DEVICE_LIST_DEFAULTS;
4805
4832
  var sortingDefaults = { direction: SORTING_OPTIONS.desc, key: "modified" };
4806
4833
  var flattenRelease = (release, stateRelease) => {
4807
- var _a;
4808
- const updatedArtifacts = ((_a = release.artifacts) == null ? void 0 : _a.sort((0, import_helpers11.customSort)(1, "modified"))) || [];
4834
+ const updatedArtifacts = release.artifacts?.sort((0, import_helpers11.customSort)(1, "modified")) || [];
4809
4835
  const { artifacts, deviceTypes, modified } = updatedArtifacts.reduce(
4810
4836
  (accu, item) => {
4811
- var _a2;
4812
4837
  accu.deviceTypes.push(...item.device_types_compatible);
4813
- const stateArtifact = ((_a2 = stateRelease.artifacts) == null ? void 0 : _a2.find((releaseArtifact) => releaseArtifact.id === item.id)) || {};
4838
+ const stateArtifact = stateRelease.artifacts?.find((releaseArtifact) => releaseArtifact.id === item.id) || {};
4814
4839
  accu.modified = accu.modified ? accu.modified : item.modified;
4815
- accu.artifacts.push(__spreadValues(__spreadValues({}, stateArtifact), item));
4840
+ accu.artifacts.push({
4841
+ ...stateArtifact,
4842
+ ...item
4843
+ });
4816
4844
  return accu;
4817
4845
  },
4818
4846
  { artifacts: [], deviceTypes: [], modified: void 0 }
4819
4847
  );
4820
- return __spreadProps(__spreadValues(__spreadValues({}, stateRelease), release), { artifacts, device_types_compatible: deviceTypes.filter(import_helpers11.duplicateFilter), modified });
4848
+ return { ...stateRelease, ...release, artifacts, device_types_compatible: deviceTypes.filter(import_helpers11.duplicateFilter), modified };
4821
4849
  };
4822
4850
  var reduceReceivedReleases = (releases, stateReleasesById) => releases.reduce((accu, release) => {
4823
4851
  const stateRelease = stateReleasesById[release.name] || {};
@@ -4835,17 +4863,16 @@ var findArtifactIndexInRelease = (releases, id) => Object.values(releases).reduc
4835
4863
  { release: null, index: -1 }
4836
4864
  );
4837
4865
  var getArtifactInstallCount = (0, import_toolkit23.createAsyncThunk)(`${sliceName7}/getArtifactInstallCount`, (id, { dispatch, getState }) => {
4838
- var _a;
4839
4866
  let { release, index } = findArtifactIndexInRelease(getReleasesById(getState()), id);
4840
4867
  if (!release || index === -1) {
4841
4868
  return;
4842
4869
  }
4843
4870
  const releaseArtifacts = [...release.artifacts];
4844
4871
  const artifact = releaseArtifacts[index];
4845
- const { key, name, version } = (_a = (0, import_helpers11.extractSoftwareItem)(artifact.artifact_provides)) != null ? _a : {};
4872
+ const { key, name, version } = (0, import_helpers11.extractSoftwareItem)(artifact.artifact_provides) ?? {};
4846
4873
  const attribute = `${key}${name ? `.${name}` : ""}.version`;
4847
4874
  const { filterTerms } = convertDeviceListStateToFilters({
4848
- filters: [__spreadProps(__spreadValues({}, emptyFilter), { key: attribute, value: version, scope: "inventory" })]
4875
+ filters: [{ ...emptyFilter, key: attribute, value: version, scope: "inventory" }]
4849
4876
  });
4850
4877
  return general_api_default.post(getSearchEndpoint(getState()), {
4851
4878
  page: 1,
@@ -4859,10 +4886,11 @@ var getArtifactInstallCount = (0, import_toolkit23.createAsyncThunk)(`${sliceNam
4859
4886
  }
4860
4887
  const installCount = Number(headers[headerNames.total]);
4861
4888
  const releaseArtifacts2 = [...release2.artifacts];
4862
- releaseArtifacts2[index2] = __spreadProps(__spreadValues({}, releaseArtifacts2[index2]), { installCount });
4863
- release2 = __spreadProps(__spreadValues({}, release2), {
4889
+ releaseArtifacts2[index2] = { ...releaseArtifacts2[index2], installCount };
4890
+ release2 = {
4891
+ ...release2,
4864
4892
  artifacts: releaseArtifacts2
4865
- });
4893
+ };
4866
4894
  return dispatch(actions7.receiveRelease(release2));
4867
4895
  });
4868
4896
  });
@@ -4874,12 +4902,14 @@ var getArtifactUrl = (0, import_toolkit23.createAsyncThunk)(
4874
4902
  return dispatch(getReleases());
4875
4903
  }
4876
4904
  const releaseArtifacts = [...release.artifacts];
4877
- releaseArtifacts[index] = __spreadProps(__spreadValues({}, releaseArtifacts[index]), {
4905
+ releaseArtifacts[index] = {
4906
+ ...releaseArtifacts[index],
4878
4907
  url: response.data.uri
4879
- });
4880
- release = __spreadProps(__spreadValues({}, release), {
4908
+ };
4909
+ release = {
4910
+ ...release,
4881
4911
  artifacts: releaseArtifacts
4882
- });
4912
+ };
4883
4913
  return dispatch(actions7.receiveRelease(release));
4884
4914
  })
4885
4915
  );
@@ -5004,12 +5034,14 @@ var selectRelease = (0, import_toolkit23.createAsyncThunk)(`${sliceName7}/select
5004
5034
  });
5005
5035
  var setReleasesListState = (0, import_toolkit23.createAsyncThunk)(`${sliceName7}/setReleasesListState`, (selectionState, { dispatch, getState }) => {
5006
5036
  const currentState = getState().releases.releasesList;
5007
- let nextState = __spreadProps(__spreadValues(__spreadValues({}, currentState), selectionState), {
5008
- sort: __spreadValues(__spreadValues({}, currentState.sort), selectionState.sort)
5009
- });
5037
+ let nextState = {
5038
+ ...currentState,
5039
+ ...selectionState,
5040
+ sort: { ...currentState.sort, ...selectionState.sort }
5041
+ };
5010
5042
  let tasks = [];
5011
- const _a = currentState, { isLoading: currentLoading } = _a, currentRequestState = __objRest(_a, ["isLoading"]);
5012
- const _b2 = nextState, { isLoading: selectionLoading } = _b2, selectionRequestState = __objRest(_b2, ["isLoading"]);
5043
+ const { isLoading: currentLoading, ...currentRequestState } = currentState;
5044
+ const { isLoading: selectionLoading, ...selectionRequestState } = nextState;
5013
5045
  if (!(0, import_helpers11.deepCompare)(currentRequestState, selectionRequestState)) {
5014
5046
  nextState.isLoading = true;
5015
5047
  tasks.push(dispatch(getReleases(nextState)).finally(() => dispatch(setReleasesListState({ isLoading: false }))));
@@ -5028,29 +5060,30 @@ var releaseListRetrieval = (config) => {
5028
5060
  );
5029
5061
  };
5030
5062
  var deductSearchState = (receivedReleases, config, total, state) => {
5031
- let releaseListState = __spreadValues({}, state.releasesList);
5063
+ let releaseListState = { ...state.releasesList };
5032
5064
  const { searchTerm, searchOnly, sort = {}, selectedTags = [], type } = config;
5033
5065
  const flattenedReleases = Object.values(receivedReleases).sort((0, import_helpers11.customSort)(sort.direction === SORTING_OPTIONS.desc, sort.key));
5034
5066
  const releaseIds = flattenedReleases.map((item) => item.name);
5035
5067
  const isFiltering = !!(selectedTags.length || type || searchTerm);
5036
5068
  if (searchOnly) {
5037
- releaseListState = __spreadProps(__spreadValues({}, releaseListState), { searchedIds: releaseIds });
5069
+ releaseListState = { ...releaseListState, searchedIds: releaseIds };
5038
5070
  } else {
5039
- releaseListState = __spreadProps(__spreadValues({}, releaseListState), {
5071
+ releaseListState = {
5072
+ ...releaseListState,
5040
5073
  releaseIds,
5041
5074
  searchTotal: isFiltering ? total : state.releasesList.searchTotal,
5042
5075
  total: !isFiltering ? total : state.releasesList.total
5043
- });
5076
+ };
5044
5077
  }
5045
5078
  return releaseListState;
5046
5079
  };
5047
5080
  var getReleases = (0, import_toolkit23.createAsyncThunk)(`${sliceName7}/getReleases`, (passedConfig = {}, { dispatch, getState }) => {
5048
- const config = __spreadValues(__spreadValues({}, getState().releases.releasesList), passedConfig);
5081
+ const config = { ...getState().releases.releasesList, ...passedConfig };
5049
5082
  return releaseListRetrieval(config).then(({ data: receivedReleases = [], headers = {} }) => {
5050
5083
  const total = headers[headerNames.total] ? Number(headers[headerNames.total]) : 0;
5051
5084
  const state = getState().releases;
5052
5085
  const flatReleases = reduceReceivedReleases(receivedReleases, state.byId);
5053
- const combinedReleases = __spreadValues(__spreadValues({}, state.byId), flatReleases);
5086
+ const combinedReleases = { ...state.byId, ...flatReleases };
5054
5087
  let tasks = [dispatch(actions7.receiveReleases(combinedReleases))];
5055
5088
  const releaseListState = deductSearchState(receivedReleases, config, total, state);
5056
5089
  tasks.push(dispatch(actions7.setReleaseListState(releaseListState)));
@@ -5071,7 +5104,7 @@ var updateReleaseInfo = (0, import_toolkit23.createAsyncThunk)(
5071
5104
  `${sliceName7}/updateReleaseInfo`,
5072
5105
  ({ name, info }, { dispatch, getState }) => general_api_default.patch(`${deploymentsApiUrlV2}/deployments/releases/${name}`, info).catch((err) => commonErrorHandler(err, `Release details couldn't be updated.`, dispatch)).then(() => {
5073
5106
  return Promise.all([
5074
- dispatch(actions7.receiveRelease(__spreadProps(__spreadValues(__spreadValues({}, getReleasesById(getState())[name]), info), { name }))),
5107
+ dispatch(actions7.receiveRelease({ ...getReleasesById(getState())[name], ...info, name })),
5075
5108
  dispatch(setSnackbar5("Release details were updated successfully.", TIMEOUTS.fiveSeconds, ""))
5076
5109
  ]);
5077
5110
  })
@@ -5080,7 +5113,7 @@ var setReleaseTags = (0, import_toolkit23.createAsyncThunk)(
5080
5113
  `${sliceName7}/setReleaseTags`,
5081
5114
  ({ name, tags = [] }, { dispatch, getState }) => general_api_default.put(`${deploymentsApiUrlV2}/deployments/releases/${name}/tags`, tags).catch((err) => commonErrorHandler(err, `Release tags couldn't be set.`, dispatch)).then(() => {
5082
5115
  return Promise.all([
5083
- dispatch(actions7.receiveRelease(__spreadProps(__spreadValues({}, getReleasesById(getState())[name]), { name, tags }))),
5116
+ dispatch(actions7.receiveRelease({ ...getReleasesById(getState())[name], name, tags })),
5084
5117
  dispatch(setSnackbar5("Release tags were set successfully.", TIMEOUTS.fiveSeconds, ""))
5085
5118
  ]);
5086
5119
  })
@@ -5097,19 +5130,13 @@ var getUpdateTypes = (0, import_toolkit23.createAsyncThunk)(
5097
5130
  // src/api/users-api.ts
5098
5131
  var import_axios4 = __toESM(require("axios"));
5099
5132
  var Api2 = {
5100
- postLogin: (url, _a) => {
5101
- var _b2 = _a, { email: username, password } = _b2, body = __objRest(_b2, ["email", "password"]);
5102
- return import_axios4.default.post(url, body, __spreadProps(__spreadValues({}, commonRequestConfig), { auth: { username, password } })).then((res) => {
5103
- var _a2;
5104
- return { text: res.data, code: res.status, contentType: (_a2 = res.headers) == null ? void 0 : _a2["content-type"] };
5105
- });
5106
- },
5133
+ postLogin: (url, { email: username, password, ...body }) => import_axios4.default.post(url, body, { ...commonRequestConfig, auth: { username, password } }).then((res) => ({ text: res.data, code: res.status, contentType: res.headers?.["content-type"] })),
5107
5134
  putVerifyTFA: (url, userData) => {
5108
5135
  let body = {};
5109
5136
  if (userData.hasOwnProperty("token2fa")) {
5110
5137
  body = { token2fa: userData.token2fa };
5111
5138
  }
5112
- return import_axios4.default.put(url, body, __spreadProps(__spreadValues({}, commonRequestConfig), { headers: __spreadProps(__spreadValues({}, commonRequestConfig.headers), { Authorization: `Bearer ${getToken()}` }) }));
5139
+ return import_axios4.default.put(url, body, { ...commonRequestConfig, headers: { ...commonRequestConfig.headers, Authorization: `Bearer ${getToken()}` } });
5113
5140
  }
5114
5141
  };
5115
5142
  var users_api_default = Api2;
@@ -5137,43 +5164,40 @@ var handleLoginError = (err, { token2fa: has2FA, password }, rejectWithValue) =>
5137
5164
  };
5138
5165
  var loginUser = (0, import_toolkit24.createAsyncThunk)(
5139
5166
  `${sliceName8}/loginUser`,
5140
- (_a, { dispatch, rejectWithValue }) => {
5141
- var _b2 = _a, { stayLoggedIn } = _b2, userData = __objRest(_b2, ["stayLoggedIn"]);
5142
- return users_api_default.postLogin(`${useradmApiUrlv1}/auth/login`, __spreadProps(__spreadValues({}, userData), { no_expiry: stayLoggedIn })).catch((err) => {
5143
- cleanUp();
5144
- return Promise.reject(dispatch(handleLoginError(err, userData, rejectWithValue)));
5145
- }).then(({ text: response, contentType }) => {
5146
- if (contentType.includes(APPLICATION_JSON_CONTENT_TYPE)) {
5147
- const { id, kind } = response;
5148
- const type = kind.split("/")[1];
5149
- const ssoLoginUrl = SSO_TYPES[type].getStartUrl(id);
5150
- window.location.replace(ssoLoginUrl);
5151
- return;
5152
- }
5153
- const token = response;
5154
- if (contentType !== APPLICATION_JWT_CONTENT_TYPE || !token) {
5155
- return;
5156
- }
5157
- let now = /* @__PURE__ */ new Date();
5158
- now.setSeconds(now.getSeconds() + maxSessionAge);
5159
- const expiresAt = stayLoggedIn ? void 0 : now.toISOString();
5160
- setSessionInfo({ token, expiresAt });
5161
- cookies5.remove("JWT", { path: "/" });
5162
- return (
5163
- // @ts-ignore
5164
- Promise.resolve(dispatch(getUser(OWN_USER_ID))).unwrap().catch((e) => {
5165
- cleanUp();
5166
- return Promise.reject(dispatch(setSnackbar6(extractErrorMessage(e))));
5167
- }).then(() => {
5168
- window.sessionStorage.removeItem("pendings-redirect");
5169
- if (window.location.pathname !== "/ui/") {
5170
- window.location.replace("/ui/");
5171
- }
5172
- return Promise.resolve(dispatch(actions8.successfullyLoggedIn({ expiresAt, token })));
5173
- })
5174
- );
5175
- });
5176
- }
5167
+ ({ stayLoggedIn, ...userData }, { dispatch, rejectWithValue }) => users_api_default.postLogin(`${useradmApiUrlv1}/auth/login`, { ...userData, no_expiry: stayLoggedIn }).catch((err) => {
5168
+ cleanUp();
5169
+ return Promise.reject(dispatch(handleLoginError(err, userData, rejectWithValue)));
5170
+ }).then(({ text: response, contentType }) => {
5171
+ if (contentType.includes(APPLICATION_JSON_CONTENT_TYPE)) {
5172
+ const { id, kind } = response;
5173
+ const type = kind.split("/")[1];
5174
+ const ssoLoginUrl = SSO_TYPES[type].getStartUrl(id);
5175
+ window.location.replace(ssoLoginUrl);
5176
+ return;
5177
+ }
5178
+ const token = response;
5179
+ if (contentType !== APPLICATION_JWT_CONTENT_TYPE || !token) {
5180
+ return;
5181
+ }
5182
+ let now = /* @__PURE__ */ new Date();
5183
+ now.setSeconds(now.getSeconds() + maxSessionAge);
5184
+ const expiresAt = stayLoggedIn ? void 0 : now.toISOString();
5185
+ setSessionInfo({ token, expiresAt });
5186
+ cookies5.remove("JWT", { path: "/" });
5187
+ return (
5188
+ // @ts-ignore
5189
+ Promise.resolve(dispatch(getUser(OWN_USER_ID))).unwrap().catch((e) => {
5190
+ cleanUp();
5191
+ return Promise.reject(dispatch(setSnackbar6(extractErrorMessage(e))));
5192
+ }).then(() => {
5193
+ window.sessionStorage.removeItem("pendings-redirect");
5194
+ if (window.location.pathname !== "/ui/") {
5195
+ window.location.replace("/ui/");
5196
+ }
5197
+ return Promise.resolve(dispatch(actions8.successfullyLoggedIn({ expiresAt, token })));
5198
+ })
5199
+ );
5200
+ })
5177
5201
  );
5178
5202
  var logoutUser = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/logoutUser`, (_, { dispatch, getState }) => {
5179
5203
  if (Object.keys(getState().app.uploadsById).length) {
@@ -5190,7 +5214,7 @@ var switchUserOrganization = (0, import_toolkit24.createAsyncThunk)(`${sliceName
5190
5214
  return Promise.reject();
5191
5215
  }
5192
5216
  return general_api_default.get(`${useradmApiUrlv1}/users/tenants/${tenantId}/token`).then(({ data: token }) => {
5193
- setSessionInfo(__spreadProps(__spreadValues({}, getSessionInfo()), { token }));
5217
+ setSessionInfo({ ...getSessionInfo(), token });
5194
5218
  window.location.reload();
5195
5219
  });
5196
5220
  });
@@ -5253,13 +5277,13 @@ var getUser = (0, import_toolkit24.createAsyncThunk)(
5253
5277
  );
5254
5278
  var initializeSelf = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/initializeSelf`, (_, { dispatch }) => dispatch(getUser(OWN_USER_ID)));
5255
5279
  var updateUserColumnSettings = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/updateUserColumnSettings`, ({ columns, currentUserId }, { dispatch, getState }) => {
5256
- const userId = currentUserId != null ? currentUserId : getCurrentUser(getState()).id;
5280
+ const userId = currentUserId ?? getCurrentUser(getState()).id;
5257
5281
  const storageKey = `${userId}-column-widths`;
5258
5282
  let customColumns = [];
5259
5283
  if (!columns) {
5260
5284
  try {
5261
5285
  customColumns = JSON.parse(window.localStorage.getItem(storageKey)) || customColumns;
5262
- } catch (e) {
5286
+ } catch {
5263
5287
  }
5264
5288
  } else {
5265
5289
  customColumns = columns;
@@ -5288,10 +5312,7 @@ var userActions = {
5288
5312
  var userActionErrorHandler = (err, type, dispatch) => commonErrorHandler(err, `There was an error ${userActions[type].errorMessage} the user.`, dispatch);
5289
5313
  var createUser = (0, import_toolkit24.createAsyncThunk)(
5290
5314
  `${sliceName8}/createUser`,
5291
- (_a, { dispatch }) => {
5292
- var _b2 = _a, { shouldResetPassword } = _b2, userData = __objRest(_b2, ["shouldResetPassword"]);
5293
- return general_api_default.post(`${useradmApiUrlv1}/users`, __spreadProps(__spreadValues({}, userData), { send_reset_password: shouldResetPassword })).then(() => Promise.all([dispatch(actions8.createdUser(userData)), dispatch(getUserList()), dispatch(setSnackbar6(userActions.create.successMessage))])).catch((err) => userActionErrorHandler(err, "create", dispatch));
5294
- }
5315
+ ({ shouldResetPassword, ...userData }, { dispatch }) => general_api_default.post(`${useradmApiUrlv1}/users`, { ...userData, send_reset_password: shouldResetPassword }).then(() => Promise.all([dispatch(actions8.createdUser(userData)), dispatch(getUserList()), dispatch(setSnackbar6(userActions.create.successMessage))])).catch((err) => userActionErrorHandler(err, "create", dispatch))
5295
5316
  );
5296
5317
  var removeUser = (0, import_toolkit24.createAsyncThunk)(
5297
5318
  `${sliceName8}/removeUser`,
@@ -5302,15 +5323,12 @@ var removeUser = (0, import_toolkit24.createAsyncThunk)(
5302
5323
  );
5303
5324
  var editUser = (0, import_toolkit24.createAsyncThunk)(
5304
5325
  `${sliceName8}/editUser`,
5305
- (_a, { dispatch, getState }) => {
5306
- var _b2 = _a, { id } = _b2, userData = __objRest(_b2, ["id"]);
5307
- return general_api_default.put(`${useradmApiUrlv1}/users/${id}`, userData).then(
5308
- () => Promise.all([
5309
- dispatch(actions8.updatedUser(__spreadProps(__spreadValues({}, userData), { id: id === OWN_USER_ID ? getCurrentUser(getState()).id : id }))),
5310
- dispatch(setSnackbar6(userActions.edit.successMessage))
5311
- ])
5312
- );
5313
- }
5326
+ ({ id, ...userData }, { dispatch, getState }) => general_api_default.put(`${useradmApiUrlv1}/users/${id}`, userData).then(
5327
+ () => Promise.all([
5328
+ dispatch(actions8.updatedUser({ ...userData, id: id === OWN_USER_ID ? getCurrentUser(getState()).id : id })),
5329
+ dispatch(setSnackbar6(userActions.edit.successMessage))
5330
+ ])
5331
+ )
5314
5332
  );
5315
5333
  var addUserToCurrentTenant = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/addUserToTenant`, (userId, { dispatch, getState }) => {
5316
5334
  const { id } = getOrganization(getState());
@@ -5345,7 +5363,7 @@ var mapHttpPermission = (permission) => Object.entries(uiPermissionsByArea).redu
5345
5363
  }
5346
5364
  return accu;
5347
5365
  },
5348
- __spreadValues({}, emptyUiPermissions)
5366
+ { ...emptyUiPermissions }
5349
5367
  );
5350
5368
  var permissionActionTypes = {
5351
5369
  any: mapHttpPermission,
@@ -5368,20 +5386,21 @@ var combinePermissions = (existingPermissions, additionalPermissions = {}) => Ob
5368
5386
  }, existingPermissions);
5369
5387
  var tryParseCustomPermission = (permission) => {
5370
5388
  const uiPermissions = permissionActionTypes[permission.action](permission.object);
5371
- const result = mergePermissions(__spreadValues({}, emptyUiPermissions), uiPermissions);
5389
+ const result = mergePermissions({ ...emptyUiPermissions }, uiPermissions);
5372
5390
  return { isCustom: true, permission, result };
5373
5391
  };
5374
5392
  var customPermissionHandler = (accu, permission) => {
5375
5393
  let processor = tryParseCustomPermission(permission);
5376
- return __spreadProps(__spreadValues({}, accu), {
5394
+ return {
5395
+ ...accu,
5377
5396
  isCustom: accu.isCustom || processor.isCustom,
5378
5397
  uiPermissions: mergePermissions(accu.uiPermissions, processor.result)
5379
- });
5398
+ };
5380
5399
  };
5381
5400
  var mapPermissionSet = (permissionSetName, names, scope, existingGroupsPermissions = {}) => {
5382
5401
  const permission = Object.values(uiPermissionsById).find((permission2) => permission2.permissionSets[scope] === permissionSetName).value;
5383
5402
  const scopedPermissions = names.reduce((accu, name) => combinePermissions(accu, { [name]: [permission] }), existingGroupsPermissions);
5384
- return Object.entries(scopedPermissions).reduce((accu, [key, permissions]) => __spreadProps(__spreadValues({}, accu), { [key]: deriveImpliedAreaPermissions(scope, permissions) }), {});
5403
+ return Object.entries(scopedPermissions).reduce((accu, [key, permissions]) => ({ ...accu, [key]: deriveImpliedAreaPermissions(scope, permissions) }), {});
5385
5404
  };
5386
5405
  var isEmptyPermissionSet = (permissionSet) => !Object.values(permissionSet).reduce((accu, permissions) => {
5387
5406
  if (Array.isArray(permissions)) {
@@ -5396,60 +5415,59 @@ var parseRolePermissions = ({ permission_sets_with_scope = [], permissions = []
5396
5415
  if (!processor) {
5397
5416
  return accu;
5398
5417
  }
5399
- const scope = Object.keys(scopedPermissionAreas).find((scope2) => {
5400
- var _a;
5401
- return uiPermissionsByArea[scope2].scope === ((_a = permissionSet.scope) == null ? void 0 : _a.type);
5402
- });
5418
+ const scope = Object.keys(scopedPermissionAreas).find((scope2) => uiPermissionsByArea[scope2].scope === permissionSet.scope?.type);
5403
5419
  if (scope) {
5404
5420
  const result = mapPermissionSet(permissionSet.name, permissionSet.scope.value, scope, accu.uiPermissions[scope]);
5405
- return __spreadProps(__spreadValues({}, accu), { uiPermissions: __spreadProps(__spreadValues({}, accu.uiPermissions), { [scope]: result }) });
5421
+ return { ...accu, uiPermissions: { ...accu.uiPermissions, [scope]: result } };
5406
5422
  } else if (isEmptyPermissionSet(processor.result)) {
5407
5423
  return processor.permissions.reduce(customPermissionHandler, accu);
5408
5424
  }
5409
- return __spreadProps(__spreadValues({}, accu), {
5425
+ return {
5426
+ ...accu,
5410
5427
  isCustom: accu.isCustom || processor.isCustom,
5411
5428
  uiPermissions: mergePermissions(accu.uiPermissions, processor.result)
5412
- });
5429
+ };
5413
5430
  },
5414
- { isCustom: false, uiPermissions: __spreadProps(__spreadValues({}, emptyUiPermissions), { groups: {}, releases: {} }) }
5431
+ { isCustom: false, uiPermissions: { ...emptyUiPermissions, groups: {}, releases: {} } }
5415
5432
  );
5416
5433
  return permissions.reduce(customPermissionHandler, preliminaryResult);
5417
5434
  };
5418
5435
  var normalizeRbacRoles = (roles, rolesById2, permissionSets) => roles.reduce(
5419
5436
  (accu, role) => {
5420
- var _a;
5421
5437
  let normalizedPermissions;
5422
5438
  let isCustom = false;
5423
5439
  if (rolesById2[role.name]) {
5424
- normalizedPermissions = __spreadProps(__spreadValues({}, rolesById2[role.name].uiPermissions), {
5425
- groups: __spreadValues({}, rolesById2[role.name].uiPermissions.groups),
5426
- releases: __spreadValues({}, rolesById2[role.name].uiPermissions.releases)
5427
- });
5440
+ normalizedPermissions = {
5441
+ ...rolesById2[role.name].uiPermissions,
5442
+ groups: { ...rolesById2[role.name].uiPermissions.groups },
5443
+ releases: { ...rolesById2[role.name].uiPermissions.releases }
5444
+ };
5428
5445
  } else {
5429
5446
  const result = parseRolePermissions(role, permissionSets);
5430
5447
  normalizedPermissions = result.uiPermissions;
5431
5448
  isCustom = result.isCustom;
5432
5449
  }
5433
- const roleState = (_a = accu[role.name]) != null ? _a : __spreadValues({}, emptyRole);
5434
- accu[role.name] = __spreadProps(__spreadValues(__spreadValues({}, roleState), role), {
5450
+ const roleState = accu[role.name] ?? { ...emptyRole };
5451
+ accu[role.name] = {
5452
+ ...roleState,
5453
+ ...role,
5435
5454
  description: roleState.description ? roleState.description : role.description,
5436
5455
  editable: !rolesById[role.name] && !isCustom && (typeof roleState.editable !== "undefined" ? roleState.editable : true),
5437
5456
  isCustom,
5438
5457
  name: roleState.name ? roleState.name : role.name,
5439
5458
  uiPermissions: normalizedPermissions
5440
- });
5459
+ };
5441
5460
  return accu;
5442
5461
  },
5443
- __spreadValues({}, rolesById2)
5462
+ { ...rolesById2 }
5444
5463
  );
5445
5464
  var getPermissionSets = (0, import_toolkit24.createAsyncThunk)(
5446
5465
  `${sliceName8}/getPermissionSets`,
5447
5466
  (_, { dispatch, getState }) => general_api_default.get(`${useradmApiUrlv2}/permission_sets?per_page=500`).then(({ data }) => {
5448
5467
  const permissionSets = data.reduce(
5449
5468
  (accu, permissionSet) => {
5450
- var _a, _b2;
5451
- const permissionSetState = (_a = accu[permissionSet.name]) != null ? _a : {};
5452
- let permissionSetObject = __spreadValues(__spreadValues({}, permissionSetState), permissionSet);
5469
+ const permissionSetState = accu[permissionSet.name] ?? {};
5470
+ let permissionSetObject = { ...permissionSetState, ...permissionSet };
5453
5471
  permissionSetObject.result = Object.values(uiPermissionsById).reduce(
5454
5472
  (accu2, item) => Object.entries(item.permissionSets).reduce((collector, [area, permissionSet2]) => {
5455
5473
  if (scopedPermissionAreas[area]) {
@@ -5460,11 +5478,10 @@ var getPermissionSets = (0, import_toolkit24.createAsyncThunk)(
5460
5478
  }
5461
5479
  return collector;
5462
5480
  }, accu2),
5463
- __spreadValues(__spreadValues({}, emptyUiPermissions), (_b2 = permissionSetObject.result) != null ? _b2 : {})
5481
+ { ...emptyUiPermissions, ...permissionSetObject.result ?? {} }
5464
5482
  );
5465
5483
  const scopes = Object.values(scopedPermissionAreas).reduce((accu2, { key, scopeType }) => {
5466
- var _a2, _b3;
5467
- if (((_a2 = permissionSetObject.supported_scope_types) == null ? void 0 : _a2.includes(key)) || ((_b3 = permissionSetObject.supported_scope_types) == null ? void 0 : _b3.includes(scopeType))) {
5484
+ if (permissionSetObject.supported_scope_types?.includes(key) || permissionSetObject.supported_scope_types?.includes(scopeType)) {
5468
5485
  accu2.push(key);
5469
5486
  }
5470
5487
  return accu2;
@@ -5477,7 +5494,7 @@ var getPermissionSets = (0, import_toolkit24.createAsyncThunk)(
5477
5494
  return accu;
5478
5495
  },
5479
5496
  // @ts-ignore
5480
- __spreadValues({}, getState().users.permissionSetsById)
5497
+ { ...getState().users.permissionSetsById }
5481
5498
  );
5482
5499
  return Promise.all([dispatch(actions8.receivedPermissionSets(permissionSets)), permissionSets]);
5483
5500
  }).catch(() => console.log("Permission set retrieval failed - likely accessing a non-RBAC backend"))
@@ -5510,28 +5527,27 @@ var transformAreaRoleDataToScopedPermissionsSets = (area, areaPermissions, exces
5510
5527
  const skipPermissions = scopedPermissionAreas.releases.key === area && item !== ALL_RELEASES ? [uiPermissionsById.upload.value] : [];
5511
5528
  const impliedPermissions = deriveImpliedAreaPermissions(area, uiPermissions, skipPermissions);
5512
5529
  accu = impliedPermissions.reduce((itemPermissionAccu, impliedPermission) => {
5513
- var _a;
5514
- const permissionSetState = (_a = itemPermissionAccu[uiPermissionsById[impliedPermission].permissionSets[area]]) != null ? _a : {
5530
+ const permissionSetState = itemPermissionAccu[uiPermissionsById[impliedPermission].permissionSets[area]] ?? {
5515
5531
  type: uiPermissionsByArea[area].scope,
5516
5532
  value: []
5517
5533
  };
5518
- itemPermissionAccu[uiPermissionsById[impliedPermission].permissionSets[area]] = __spreadProps(__spreadValues({}, permissionSetState), {
5534
+ itemPermissionAccu[uiPermissionsById[impliedPermission].permissionSets[area]] = {
5535
+ ...permissionSetState,
5519
5536
  value: [...permissionSetState.value, item]
5520
- });
5537
+ };
5521
5538
  return itemPermissionAccu;
5522
5539
  }, accu);
5523
5540
  return accu;
5524
5541
  }, {});
5525
- return Object.entries(permissionSetObject).map((_a) => {
5526
- var [name, _b2] = _a, _c = _b2, { value } = _c, scope = __objRest(_c, ["value"]);
5542
+ return Object.entries(permissionSetObject).map(([name, { value, ...scope }]) => {
5527
5543
  if (value.includes(excessiveAccessSelector)) {
5528
5544
  return { name };
5529
5545
  }
5530
- return { name, scope: __spreadProps(__spreadValues({}, scope), { value: value.filter(import_helpers12.duplicateFilter) }) };
5546
+ return { name, scope: { ...scope, value: value.filter(import_helpers12.duplicateFilter) } };
5531
5547
  });
5532
5548
  };
5533
5549
  var transformRoleDataToRole = (roleData, roleState = {}) => {
5534
- const role = __spreadValues(__spreadValues({}, roleState), roleData);
5550
+ const role = { ...roleState, ...roleData };
5535
5551
  const { description = "", name, uiPermissions = emptyUiPermissions } = role;
5536
5552
  const { maybeUiPermissions, remainderKeys } = Object.entries(emptyUiPermissions).reduce(
5537
5553
  (accu, [key, emptyPermissions]) => {
@@ -5567,12 +5583,17 @@ var transformRoleDataToRole = (roleData, roleState = {}) => {
5567
5583
  }, []);
5568
5584
  return {
5569
5585
  permissionSetsWithScope: [...permissionSetsWithScope, ...scopedPermissionSets],
5570
- role: __spreadProps(__spreadValues({}, emptyRole), {
5586
+ role: {
5587
+ ...emptyRole,
5571
5588
  name,
5572
5589
  // @ts-ignore
5573
5590
  description: description ? description : roleState.description,
5574
- uiPermissions: __spreadValues(__spreadValues(__spreadValues({}, emptyUiPermissions), roleUiPermissions), maybeUiPermissions)
5575
- })
5591
+ uiPermissions: {
5592
+ ...emptyUiPermissions,
5593
+ ...roleUiPermissions,
5594
+ ...maybeUiPermissions
5595
+ }
5596
+ }
5576
5597
  };
5577
5598
  };
5578
5599
  var roleActions = {
@@ -5623,13 +5644,12 @@ var getGlobalSettings2 = (0, import_toolkit24.createAsyncThunk)(
5623
5644
  var saveGlobalSettings = (0, import_toolkit24.createAsyncThunk)(
5624
5645
  `${sliceName8}/saveGlobalSettings`,
5625
5646
  // @ts-ignore
5626
- (_a, { dispatch, getState }) => {
5627
- var _b2 = _a, { beOptimistic = false, notify = false } = _b2, settings = __objRest(_b2, ["beOptimistic", "notify"]);
5647
+ ({ beOptimistic = false, notify = false, ...settings }, { dispatch, getState }) => {
5628
5648
  if (!window.sessionStorage.getItem(settingsKeys.initialized) && !beOptimistic) {
5629
5649
  return;
5630
5650
  }
5631
5651
  return dispatch(getGlobalSettings2()).unwrap().then((result) => {
5632
- let updatedSettings = __spreadValues(__spreadValues({}, getState().users.globalSettings), settings);
5652
+ let updatedSettings = { ...getState().users.globalSettings, ...settings };
5633
5653
  if (getCurrentUser(getState()).verified) {
5634
5654
  updatedSettings["2fa"] = twoFAStates.enabled;
5635
5655
  } else {
@@ -5667,10 +5687,17 @@ var saveUserSettings = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/sav
5667
5687
  const userSettings = getUserSettings(getState());
5668
5688
  const onboardingState = getOnboardingState(getState());
5669
5689
  const tooltipState = getTooltipsState(getState());
5670
- const updatedSettings = __spreadProps(__spreadValues(__spreadValues({}, userSettings), settings), {
5671
- onboarding: __spreadValues(__spreadValues({}, onboardingState), settings.onboarding),
5690
+ const updatedSettings = {
5691
+ ...userSettings,
5692
+ // @ts-ignore
5693
+ ...settings,
5694
+ onboarding: {
5695
+ ...onboardingState,
5696
+ // @ts-ignore
5697
+ ...settings.onboarding
5698
+ },
5672
5699
  tooltips: tooltipState
5673
- });
5700
+ };
5674
5701
  const headers = result[result.length - 1] ? { "If-Match": result[result.length - 1] } : {};
5675
5702
  return Promise.all([
5676
5703
  Promise.resolve(dispatch(actions8.setUserSettings(updatedSettings))),
@@ -5696,9 +5723,10 @@ var getTokens = (0, import_toolkit24.createAsyncThunk)(
5696
5723
  `${sliceName8}/getTokens`,
5697
5724
  (_, { dispatch, getState }) => general_api_default.get(`${useradmApiUrlv1}/settings/tokens`).then(({ data: tokens }) => {
5698
5725
  const user = getCurrentUser(getState());
5699
- const updatedUser = __spreadProps(__spreadValues({}, user), {
5726
+ const updatedUser = {
5727
+ ...user,
5700
5728
  tokens
5701
- });
5729
+ };
5702
5730
  return Promise.resolve(dispatch(actions8.updatedUser(updatedUser)));
5703
5731
  })
5704
5732
  );
@@ -5714,8 +5742,7 @@ var revokeToken = (0, import_toolkit24.createAsyncThunk)(
5714
5742
  general_api_default.delete(`${useradmApiUrlv1}/settings/tokens/${token.id}`).then(() => Promise.resolve(dispatch(getTokens())))
5715
5743
  )
5716
5744
  );
5717
- var setTooltipReadState = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/setTooltipReadState`, (_a, { dispatch }) => {
5718
- var _b2 = _a, { persist } = _b2, remainder = __objRest(_b2, ["persist"]);
5745
+ var setTooltipReadState = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/setTooltipReadState`, ({ persist, ...remainder }, { dispatch }) => {
5719
5746
  let tasks = [dispatch(actions8.setTooltipState(remainder))];
5720
5747
  if (persist) {
5721
5748
  tasks.push(dispatch(saveUserSettings()));
@@ -5723,14 +5750,13 @@ var setTooltipReadState = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/
5723
5750
  return Promise.all(tasks);
5724
5751
  });
5725
5752
  var setAllTooltipsReadState = (0, import_toolkit24.createAsyncThunk)(`${sliceName8}/toggleHelptips`, ({ readState = READ_STATES.read, tooltips }, { dispatch }) => {
5726
- const updatedTips = tooltips.reduce((accu, id) => __spreadProps(__spreadValues({}, accu), { [id]: { readState } }), {});
5753
+ const updatedTips = tooltips.reduce((accu, id) => ({ ...accu, [id]: { readState } }), {});
5727
5754
  return Promise.resolve(dispatch(actions8.setTooltipsState(updatedTips))).then(() => dispatch(saveUserSettings()));
5728
5755
  });
5729
5756
  var submitFeedback = (0, import_toolkit24.createAsyncThunk)(
5730
5757
  `${sliceName8}/submitFeedback`,
5731
5758
  // @ts-ignore
5732
- (_a, { dispatch }) => {
5733
- var _b2 = _a, { satisfaction, feedback } = _b2, meta = __objRest(_b2, ["satisfaction", "feedback"]);
5759
+ ({ satisfaction, feedback, ...meta }, { dispatch }) => {
5734
5760
  return general_api_default.post(`${tenantadmApiUrlv2}/contact/support`, {
5735
5761
  subject: "feedback submission",
5736
5762
  body: JSON.stringify({ feedback, satisfaction, meta })
@@ -5759,9 +5785,8 @@ var featureFlags = [
5759
5785
  ];
5760
5786
  var environmentDatas = ["feedbackProbability", "hostAddress", "hostedAnnouncement", "recaptchaSiteKey", "stripeAPIKey", "trackerCode"];
5761
5787
  var parseEnvironmentInfo = () => (dispatch, getState) => {
5762
- var _a;
5763
5788
  const state = getState();
5764
- let onboardingComplete = state.onboarding.complete || !!JSON.parse((_a = window.localStorage.getItem("onboardingComplete")) != null ? _a : "false");
5789
+ let onboardingComplete = state.onboarding.complete || !!JSON.parse(window.localStorage.getItem("onboardingComplete") ?? "false");
5765
5790
  let demoArtifactPort = 85;
5766
5791
  let environmentData = {};
5767
5792
  let environmentFeatures = {};
@@ -5780,11 +5805,12 @@ var parseEnvironmentInfo = () => (dispatch, getState) => {
5780
5805
  } = mender_environment;
5781
5806
  onboardingComplete = stringToBoolean(features.isEnterprise) || stringToBoolean(disableOnboarding) || onboardingComplete;
5782
5807
  demoArtifactPort = port || demoArtifactPort;
5783
- environmentData = environmentDatas.reduce((accu, flag) => __spreadProps(__spreadValues({}, accu), { [flag]: mender_environment[flag] || state.app[flag] }), {});
5784
- environmentFeatures = __spreadProps(__spreadValues({}, featureFlags.reduce((accu, flag) => __spreadProps(__spreadValues({}, accu), { [flag]: stringToBoolean(features[flag]) }), {})), {
5808
+ environmentData = environmentDatas.reduce((accu, flag) => ({ ...accu, [flag]: mender_environment[flag] || state.app[flag] }), {});
5809
+ environmentFeatures = {
5810
+ ...featureFlags.reduce((accu, flag) => ({ ...accu, [flag]: stringToBoolean(features[flag]) }), {}),
5785
5811
  isHosted: features.isHosted || window.location.hostname.includes("hosted.mender.io"),
5786
5812
  isDemoMode: stringToBoolean(isDemoMode || features.isDemoMode)
5787
- });
5813
+ };
5788
5814
  versionInfo = {
5789
5815
  docs: isNaN(integrationVersion.charAt(0)) ? "" : integrationVersion.split(".").slice(0, 2).join("."),
5790
5816
  remainder: {
@@ -5932,9 +5958,4 @@ var useAppInit = (userId) => {
5932
5958
  }, [initializeAppData, coreInitDone]);
5933
5959
  return { coreInitDone };
5934
5960
  };
5935
- // Annotate the CommonJS export names for ESM import in node:
5936
- 0 && (module.exports = {
5937
- parseEnvironmentInfo,
5938
- useAppInit
5939
- });
5940
5961
  //# sourceMappingURL=storehooks.js.map