@grafana/scenes 4.26.1--canary.770.9381823391.0 → 4.26.1--canary.770.9383024969.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -11,8 +11,8 @@ var uuid = require('uuid');
11
11
  var lodash = require('lodash');
12
12
  var schema = require('@grafana/schema');
13
13
  var ui = require('@grafana/ui');
14
- var css = require('@emotion/css');
15
14
  var e2eSelectors = require('@grafana/e2e-selectors');
15
+ var css = require('@emotion/css');
16
16
  var uFuzzy = require('@leeoniya/ufuzzy');
17
17
  var reactUse = require('react-use');
18
18
  var operators = require('rxjs/operators');
@@ -77,8 +77,8 @@ function renderSceneComponentWithRouteProps(sceneObject, routeProps) {
77
77
  }
78
78
 
79
79
  var __defProp$J = Object.defineProperty;
80
- var __defProps$s = Object.defineProperties;
81
- var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
80
+ var __defProps$t = Object.defineProperties;
81
+ var __getOwnPropDescs$t = Object.getOwnPropertyDescriptors;
82
82
  var __getOwnPropSymbols$J = Object.getOwnPropertySymbols;
83
83
  var __hasOwnProp$J = Object.prototype.hasOwnProperty;
84
84
  var __propIsEnum$J = Object.prototype.propertyIsEnumerable;
@@ -94,13 +94,13 @@ var __spreadValues$J = (a, b) => {
94
94
  }
95
95
  return a;
96
96
  };
97
- var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
97
+ var __spreadProps$t = (a, b) => __defProps$t(a, __getOwnPropDescs$t(b));
98
98
  const runtimePanelPlugins = /* @__PURE__ */ new Map();
99
99
  function registerRuntimePanelPlugin({ pluginId, plugin }) {
100
100
  if (runtimePanelPlugins.has(pluginId)) {
101
101
  throw new Error(`A runtime panel plugin with id ${pluginId} has already been registered`);
102
102
  }
103
- plugin.meta = __spreadProps$s(__spreadValues$J({}, plugin.meta), {
103
+ plugin.meta = __spreadProps$t(__spreadValues$J({}, plugin.meta), {
104
104
  id: pluginId,
105
105
  name: pluginId,
106
106
  module: "runtime plugin",
@@ -129,8 +129,8 @@ function loadPanelPluginSync(pluginId) {
129
129
  }
130
130
 
131
131
  var __defProp$I = Object.defineProperty;
132
- var __defProps$r = Object.defineProperties;
133
- var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
132
+ var __defProps$s = Object.defineProperties;
133
+ var __getOwnPropDescs$s = Object.getOwnPropertyDescriptors;
134
134
  var __getOwnPropSymbols$I = Object.getOwnPropertySymbols;
135
135
  var __hasOwnProp$I = Object.prototype.hasOwnProperty;
136
136
  var __propIsEnum$I = Object.prototype.propertyIsEnumerable;
@@ -146,7 +146,7 @@ var __spreadValues$I = (a, b) => {
146
146
  }
147
147
  return a;
148
148
  };
149
- var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
149
+ var __spreadProps$s = (a, b) => __defProps$s(a, __getOwnPropDescs$s(b));
150
150
  var __objRest$4 = (source, exclude) => {
151
151
  var target = {};
152
152
  for (var prop in source)
@@ -172,7 +172,7 @@ function SceneComponentWrapperWithoutMemo(_a) {
172
172
  if (!model.isActive) {
173
173
  return null;
174
174
  }
175
- return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$r(__spreadValues$I({}, otherProps), {
175
+ return /* @__PURE__ */ React__default["default"].createElement(Component, __spreadProps$s(__spreadValues$I({}, otherProps), {
176
176
  model
177
177
  }));
178
178
  }
@@ -1749,8 +1749,8 @@ function collectAllVariables(sceneObject, record = {}) {
1749
1749
  }
1750
1750
 
1751
1751
  var __defProp$D = Object.defineProperty;
1752
- var __defProps$q = Object.defineProperties;
1753
- var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
1752
+ var __defProps$r = Object.defineProperties;
1753
+ var __getOwnPropDescs$r = Object.getOwnPropertyDescriptors;
1754
1754
  var __getOwnPropSymbols$D = Object.getOwnPropertySymbols;
1755
1755
  var __hasOwnProp$D = Object.prototype.hasOwnProperty;
1756
1756
  var __propIsEnum$D = Object.prototype.propertyIsEnumerable;
@@ -1766,7 +1766,7 @@ var __spreadValues$D = (a, b) => {
1766
1766
  }
1767
1767
  return a;
1768
1768
  };
1769
- var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
1769
+ var __spreadProps$r = (a, b) => __defProps$r(a, __getOwnPropDescs$r(b));
1770
1770
  function getTemplateProxyForField(field, frame, frames) {
1771
1771
  return new Proxy(
1772
1772
  {},
@@ -1782,7 +1782,7 @@ function getTemplateProxyForField(field, frame, frames) {
1782
1782
  if (!field.labels) {
1783
1783
  return "";
1784
1784
  }
1785
- return __spreadProps$q(__spreadValues$D({}, field.labels), {
1785
+ return __spreadProps$r(__spreadValues$D({}, field.labels), {
1786
1786
  __values: Object.values(field.labels).sort().join(", "),
1787
1787
  toString: () => {
1788
1788
  return data.formatLabels(field.labels, "", true);
@@ -2255,7 +2255,13 @@ class VariableValueRecorder {
2255
2255
  }
2256
2256
  }
2257
2257
 
2258
+ function isExtraQueryProvider(obj) {
2259
+ return typeof obj === "object" && "getExtraQueries" in obj;
2260
+ }
2261
+
2258
2262
  var __defProp$C = Object.defineProperty;
2263
+ var __defProps$q = Object.defineProperties;
2264
+ var __getOwnPropDescs$q = Object.getOwnPropertyDescriptors;
2259
2265
  var __getOwnPropSymbols$C = Object.getOwnPropertySymbols;
2260
2266
  var __hasOwnProp$C = Object.prototype.hasOwnProperty;
2261
2267
  var __propIsEnum$C = Object.prototype.propertyIsEnumerable;
@@ -2271,166 +2277,29 @@ var __spreadValues$C = (a, b) => {
2271
2277
  }
2272
2278
  return a;
2273
2279
  };
2274
- const PREVIOUS_PERIOD_VALUE = "__previousPeriod";
2275
- const NO_PERIOD_VALUE = "__noPeriod";
2276
- const PREVIOUS_PERIOD_COMPARE_OPTION = {
2277
- label: "Previous period",
2278
- value: PREVIOUS_PERIOD_VALUE
2279
- };
2280
- const NO_COMPARE_OPTION = {
2281
- label: "No comparison",
2282
- value: NO_PERIOD_VALUE
2283
- };
2284
- const DEFAULT_COMPARE_OPTIONS = [
2285
- { label: "Day before", value: "24h" },
2286
- { label: "Week before", value: "1w" },
2287
- { label: "Month before", value: "1M" }
2288
- ];
2289
- class SceneTimeRangeCompare extends SceneObjectBase {
2290
- constructor(state) {
2291
- super(__spreadValues$C({ compareOptions: DEFAULT_COMPARE_OPTIONS }, state));
2292
- this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["compareWith"] });
2293
- this._onActivate = () => {
2294
- const sceneTimeRange = sceneGraph.getTimeRange(this);
2295
- this.setState({ compareOptions: this.getCompareOptions(sceneTimeRange.state.value) });
2296
- this._subs.add(
2297
- sceneTimeRange.subscribeToState((timeRange) => {
2298
- const compareOptions = this.getCompareOptions(timeRange.value);
2299
- const stateUpdate = { compareOptions };
2300
- if (Boolean(this.state.compareWith) && !compareOptions.find(({ value }) => value === this.state.compareWith)) {
2301
- stateUpdate.compareWith = PREVIOUS_PERIOD_VALUE;
2302
- }
2303
- this.setState(stateUpdate);
2304
- })
2305
- );
2306
- };
2307
- this.getCompareOptions = (timeRange) => {
2308
- const diffDays = Math.ceil(timeRange.to.diff(timeRange.from));
2309
- const matchIndex = DEFAULT_COMPARE_OPTIONS.findIndex(({ value }) => {
2310
- const intervalInMs = data.rangeUtil.intervalToMs(value);
2311
- return intervalInMs >= diffDays;
2280
+ var __spreadProps$q = (a, b) => __defProps$q(a, __getOwnPropDescs$q(b));
2281
+ const passthroughProcessor = (_, secondary) => rxjs.of(secondary);
2282
+ const extraQueryProcessingOperator = (processors) => (data) => {
2283
+ return data.pipe(
2284
+ rxjs.mergeMap(([primary, ...secondaries]) => {
2285
+ const processedSecondaries = secondaries.flatMap((s) => {
2286
+ var _a, _b;
2287
+ return (_b = (_a = processors.get(s.request.requestId)) == null ? void 0 : _a(primary, s)) != null ? _b : rxjs.of(s);
2288
+ });
2289
+ return rxjs.forkJoin([rxjs.of(primary), ...processedSecondaries]);
2290
+ }),
2291
+ rxjs.map(([primary, ...processedSecondaries]) => {
2292
+ var _a;
2293
+ return __spreadProps$q(__spreadValues$C({}, primary), {
2294
+ series: [...primary.series, ...processedSecondaries.flatMap((s) => s.series)],
2295
+ annotations: [...(_a = primary.annotations) != null ? _a : [], ...processedSecondaries.flatMap((s) => {
2296
+ var _a2;
2297
+ return (_a2 = s.annotations) != null ? _a2 : [];
2298
+ })]
2312
2299
  });
2313
- return [
2314
- NO_COMPARE_OPTION,
2315
- PREVIOUS_PERIOD_COMPARE_OPTION,
2316
- ...DEFAULT_COMPARE_OPTIONS.slice(matchIndex).map(({ label, value }) => ({ label, value }))
2317
- ];
2318
- };
2319
- this.onCompareWithChanged = (compareWith) => {
2320
- if (compareWith === NO_PERIOD_VALUE) {
2321
- this.onClearCompare();
2322
- } else {
2323
- this.setState({ compareWith });
2324
- }
2325
- };
2326
- this.onClearCompare = () => {
2327
- this.setState({ compareWith: void 0 });
2328
- };
2329
- this.addActivationHandler(this._onActivate);
2330
- }
2331
- getCompareTimeRange(timeRange) {
2332
- let compareFrom;
2333
- let compareTo;
2334
- if (this.state.compareWith) {
2335
- if (this.state.compareWith === PREVIOUS_PERIOD_VALUE) {
2336
- const diffMs = timeRange.to.diff(timeRange.from);
2337
- compareFrom = data.dateTime(timeRange.from).subtract(diffMs);
2338
- compareTo = data.dateTime(timeRange.to).subtract(diffMs);
2339
- } else {
2340
- compareFrom = data.dateTime(timeRange.from).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
2341
- compareTo = data.dateTime(timeRange.to).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
2342
- }
2343
- return {
2344
- from: compareFrom,
2345
- to: compareTo,
2346
- raw: {
2347
- from: compareFrom,
2348
- to: compareTo
2349
- }
2350
- };
2351
- }
2352
- return void 0;
2353
- }
2354
- getUrlState() {
2355
- return {
2356
- compareWith: this.state.compareWith
2357
- };
2358
- }
2359
- updateFromUrl(values) {
2360
- if (!values.compareWith) {
2361
- return;
2362
- }
2363
- const compareWith = parseUrlParam(values.compareWith);
2364
- if (compareWith) {
2365
- const compareOptions = this.getCompareOptions(sceneGraph.getTimeRange(this).state.value);
2366
- if (compareOptions.find(({ value }) => value === compareWith)) {
2367
- this.setState({
2368
- compareWith
2369
- });
2370
- } else {
2371
- this.setState({
2372
- compareWith: "__previousPeriod"
2373
- });
2374
- }
2375
- }
2376
- }
2377
- }
2378
- SceneTimeRangeCompare.Component = SceneTimeRangeCompareRenderer;
2379
- function SceneTimeRangeCompareRenderer({ model }) {
2380
- var _a;
2381
- const styles = ui.useStyles2(getStyles$9);
2382
- const { compareWith, compareOptions } = model.useState();
2383
- const [previousCompare, setPreviousCompare] = React__default["default"].useState(compareWith);
2384
- const previousValue = (_a = compareOptions.find(({ value: value2 }) => value2 === previousCompare)) != null ? _a : PREVIOUS_PERIOD_COMPARE_OPTION;
2385
- const value = compareOptions.find(({ value: value2 }) => value2 === compareWith);
2386
- const enabled = Boolean(value);
2387
- const onClick = () => {
2388
- if (enabled) {
2389
- setPreviousCompare(compareWith);
2390
- model.onClearCompare();
2391
- } else if (!enabled) {
2392
- model.onCompareWithChanged(previousValue.value);
2393
- }
2394
- };
2395
- return /* @__PURE__ */ React__default["default"].createElement(ui.ButtonGroup, null, /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
2396
- variant: "canvas",
2397
- tooltip: "Enable time frame comparison",
2398
- onClick: (e) => {
2399
- e.stopPropagation();
2400
- e.preventDefault();
2401
- onClick();
2402
- }
2403
- }, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
2404
- label: " ",
2405
- value: enabled,
2406
- onClick
2407
- }), "Comparison"), enabled ? /* @__PURE__ */ React__default["default"].createElement(ui.ButtonSelect, {
2408
- variant: "canvas",
2409
- value,
2410
- options: compareOptions,
2411
- onChange: (v) => {
2412
- model.onCompareWithChanged(v.value);
2413
- }
2414
- }) : /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
2415
- className: styles.previewButton,
2416
- disabled: true,
2417
- variant: "canvas",
2418
- isOpen: false
2419
- }, previousValue.label));
2420
- }
2421
- function getStyles$9(theme) {
2422
- return {
2423
- previewButton: css.css({
2424
- "&:disabled": {
2425
- border: `1px solid ${theme.colors.secondary.border}`,
2426
- color: theme.colors.text.disabled,
2427
- opacity: 1
2428
- }
2429
2300
  })
2430
- };
2431
- }
2432
-
2433
- const getCompareSeriesRefId = (refId) => `${refId}-compare`;
2301
+ );
2302
+ };
2434
2303
 
2435
2304
  var __defProp$B = Object.defineProperty;
2436
2305
  var __defProps$p = Object.defineProperties;
@@ -2451,59 +2320,6 @@ var __spreadValues$B = (a, b) => {
2451
2320
  return a;
2452
2321
  };
2453
2322
  var __spreadProps$p = (a, b) => __defProps$p(a, __getOwnPropDescs$p(b));
2454
- function timeShiftQueryResponseOperator(data$1) {
2455
- return data$1.pipe(
2456
- rxjs.map(([p, s]) => {
2457
- const diff = s.timeRange.from.diff(p.timeRange.from);
2458
- s.series.forEach((series) => {
2459
- series.refId = getCompareSeriesRefId(series.refId || "");
2460
- series.meta = __spreadProps$p(__spreadValues$B({}, series.meta), {
2461
- timeCompare: {
2462
- diffMs: diff,
2463
- isTimeShiftQuery: true
2464
- }
2465
- });
2466
- series.fields.forEach((field) => {
2467
- if (field.type === data.FieldType.time) {
2468
- field.values = field.values.map((v) => {
2469
- return diff < 0 ? v - diff : v + diff;
2470
- });
2471
- }
2472
- field.config = __spreadProps$p(__spreadValues$B({}, field.config), {
2473
- color: {
2474
- mode: "fixed",
2475
- fixedColor: runtime.config.theme.palette.gray60
2476
- }
2477
- });
2478
- return field;
2479
- });
2480
- });
2481
- return __spreadProps$p(__spreadValues$B({}, p), {
2482
- series: [...p.series, ...s.series]
2483
- });
2484
- })
2485
- );
2486
- }
2487
-
2488
- var __defProp$A = Object.defineProperty;
2489
- var __defProps$o = Object.defineProperties;
2490
- var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
2491
- var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
2492
- var __hasOwnProp$A = Object.prototype.hasOwnProperty;
2493
- var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
2494
- var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2495
- var __spreadValues$A = (a, b) => {
2496
- for (var prop in b || (b = {}))
2497
- if (__hasOwnProp$A.call(b, prop))
2498
- __defNormalProp$A(a, prop, b[prop]);
2499
- if (__getOwnPropSymbols$A)
2500
- for (var prop of __getOwnPropSymbols$A(b)) {
2501
- if (__propIsEnum$A.call(b, prop))
2502
- __defNormalProp$A(a, prop, b[prop]);
2503
- }
2504
- return a;
2505
- };
2506
- var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
2507
2323
  function filterAnnotations(data, filters) {
2508
2324
  var _a;
2509
2325
  if (!Array.isArray(data) || data.length === 0) {
@@ -2554,11 +2370,11 @@ function filterAnnotations(data, filters) {
2554
2370
  continue;
2555
2371
  }
2556
2372
  }
2557
- fields.push(__spreadProps$o(__spreadValues$A({}, field), {
2373
+ fields.push(__spreadProps$p(__spreadValues$B({}, field), {
2558
2374
  values: buffer
2559
2375
  }));
2560
2376
  }
2561
- processed.push(__spreadProps$o(__spreadValues$A({}, frame), {
2377
+ processed.push(__spreadProps$p(__spreadValues$B({}, frame), {
2562
2378
  fields,
2563
2379
  length: frameLength
2564
2380
  }));
@@ -2990,33 +2806,33 @@ function getOptionSearcher(options, includeAll, value, text) {
2990
2806
  };
2991
2807
  }
2992
2808
 
2993
- var __defProp$z = Object.defineProperty;
2994
- var __defProps$n = Object.defineProperties;
2995
- var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
2996
- var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
2997
- var __hasOwnProp$z = Object.prototype.hasOwnProperty;
2998
- var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
2999
- var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3000
- var __spreadValues$z = (a, b) => {
2809
+ var __defProp$A = Object.defineProperty;
2810
+ var __defProps$o = Object.defineProperties;
2811
+ var __getOwnPropDescs$o = Object.getOwnPropertyDescriptors;
2812
+ var __getOwnPropSymbols$A = Object.getOwnPropertySymbols;
2813
+ var __hasOwnProp$A = Object.prototype.hasOwnProperty;
2814
+ var __propIsEnum$A = Object.prototype.propertyIsEnumerable;
2815
+ var __defNormalProp$A = (obj, key, value) => key in obj ? __defProp$A(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2816
+ var __spreadValues$A = (a, b) => {
3001
2817
  for (var prop in b || (b = {}))
3002
- if (__hasOwnProp$z.call(b, prop))
3003
- __defNormalProp$z(a, prop, b[prop]);
3004
- if (__getOwnPropSymbols$z)
3005
- for (var prop of __getOwnPropSymbols$z(b)) {
3006
- if (__propIsEnum$z.call(b, prop))
3007
- __defNormalProp$z(a, prop, b[prop]);
2818
+ if (__hasOwnProp$A.call(b, prop))
2819
+ __defNormalProp$A(a, prop, b[prop]);
2820
+ if (__getOwnPropSymbols$A)
2821
+ for (var prop of __getOwnPropSymbols$A(b)) {
2822
+ if (__propIsEnum$A.call(b, prop))
2823
+ __defNormalProp$A(a, prop, b[prop]);
3008
2824
  }
3009
2825
  return a;
3010
2826
  };
3011
- var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
2827
+ var __spreadProps$o = (a, b) => __defProps$o(a, __getOwnPropDescs$o(b));
3012
2828
  var __objRest$3 = (source, exclude) => {
3013
2829
  var target = {};
3014
2830
  for (var prop in source)
3015
- if (__hasOwnProp$z.call(source, prop) && exclude.indexOf(prop) < 0)
2831
+ if (__hasOwnProp$A.call(source, prop) && exclude.indexOf(prop) < 0)
3016
2832
  target[prop] = source[prop];
3017
- if (source != null && __getOwnPropSymbols$z)
3018
- for (var prop of __getOwnPropSymbols$z(source)) {
3019
- if (exclude.indexOf(prop) < 0 && __propIsEnum$z.call(source, prop))
2833
+ if (source != null && __getOwnPropSymbols$A)
2834
+ for (var prop of __getOwnPropSymbols$A(source)) {
2835
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$A.call(source, prop))
3020
2836
  target[prop] = source[prop];
3021
2837
  }
3022
2838
  return target;
@@ -3144,7 +2960,7 @@ const OptionWithCheckbox = ({
3144
2960
  const theme = ui.useTheme2();
3145
2961
  const selectStyles = ui.getSelectStyles(theme);
3146
2962
  const optionStyles = ui.useStyles2(getOptionStyles);
3147
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$n(__spreadValues$z({
2963
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$o(__spreadValues$A({
3148
2964
  ref: innerRef,
3149
2965
  className: css.cx(selectStyles.option, isFocused && selectStyles.optionFocused)
3150
2966
  }, rest), {
@@ -3238,28 +3054,28 @@ function fromUrlValues(urlValues) {
3238
3054
  );
3239
3055
  }
3240
3056
 
3241
- var __defProp$y = Object.defineProperty;
3242
- var __defProps$m = Object.defineProperties;
3243
- var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
3244
- var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
3245
- var __hasOwnProp$y = Object.prototype.hasOwnProperty;
3246
- var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
3247
- var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3248
- var __spreadValues$y = (a, b) => {
3249
- for (var prop in b || (b = {}))
3250
- if (__hasOwnProp$y.call(b, prop))
3251
- __defNormalProp$y(a, prop, b[prop]);
3252
- if (__getOwnPropSymbols$y)
3253
- for (var prop of __getOwnPropSymbols$y(b)) {
3254
- if (__propIsEnum$y.call(b, prop))
3255
- __defNormalProp$y(a, prop, b[prop]);
3057
+ var __defProp$z = Object.defineProperty;
3058
+ var __defProps$n = Object.defineProperties;
3059
+ var __getOwnPropDescs$n = Object.getOwnPropertyDescriptors;
3060
+ var __getOwnPropSymbols$z = Object.getOwnPropertySymbols;
3061
+ var __hasOwnProp$z = Object.prototype.hasOwnProperty;
3062
+ var __propIsEnum$z = Object.prototype.propertyIsEnumerable;
3063
+ var __defNormalProp$z = (obj, key, value) => key in obj ? __defProp$z(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3064
+ var __spreadValues$z = (a, b) => {
3065
+ for (var prop in b || (b = {}))
3066
+ if (__hasOwnProp$z.call(b, prop))
3067
+ __defNormalProp$z(a, prop, b[prop]);
3068
+ if (__getOwnPropSymbols$z)
3069
+ for (var prop of __getOwnPropSymbols$z(b)) {
3070
+ if (__propIsEnum$z.call(b, prop))
3071
+ __defNormalProp$z(a, prop, b[prop]);
3256
3072
  }
3257
3073
  return a;
3258
3074
  };
3259
- var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
3075
+ var __spreadProps$n = (a, b) => __defProps$n(a, __getOwnPropDescs$n(b));
3260
3076
  class GroupByVariable extends MultiValueVariable {
3261
3077
  constructor(initialState) {
3262
- super(__spreadProps$m(__spreadValues$y({
3078
+ super(__spreadProps$n(__spreadValues$z({
3263
3079
  isMulti: true,
3264
3080
  name: "",
3265
3081
  value: [],
@@ -3458,7 +3274,7 @@ function LoadingIndicator(props) {
3458
3274
  }
3459
3275
 
3460
3276
  function ControlsLabel(props) {
3461
- const styles = ui.useStyles2(getStyles$8);
3277
+ const styles = ui.useStyles2(getStyles$9);
3462
3278
  const theme = ui.useTheme2();
3463
3279
  const isVertical = props.layout === "vertical";
3464
3280
  const loadingIndicator = Boolean(props.isLoading) ? /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -3521,7 +3337,7 @@ function ControlsLabel(props) {
3521
3337
  }
3522
3338
  return labelElement;
3523
3339
  }
3524
- const getStyles$8 = (theme) => ({
3340
+ const getStyles$9 = (theme) => ({
3525
3341
  horizontalLabel: css.css({
3526
3342
  background: theme.isDark ? theme.colors.background.primary : theme.colors.background.secondary,
3527
3343
  display: `flex`,
@@ -3564,7 +3380,7 @@ function keyLabelToOption(key, label) {
3564
3380
  }
3565
3381
  function AdHocFilterRenderer({ filter, model }) {
3566
3382
  var _a, _b;
3567
- const styles = ui.useStyles2(getStyles$7);
3383
+ const styles = ui.useStyles2(getStyles$8);
3568
3384
  const [keys, setKeys] = React.useState([]);
3569
3385
  const [values, setValues] = React.useState([]);
3570
3386
  const [isKeysLoading, setIsKeysLoading] = React.useState(false);
@@ -3669,7 +3485,7 @@ function AdHocFilterRenderer({ filter, model }) {
3669
3485
  onClick: () => model._removeFilter(filter)
3670
3486
  }));
3671
3487
  }
3672
- const getStyles$7 = (theme) => ({
3488
+ const getStyles$8 = (theme) => ({
3673
3489
  field: css.css({
3674
3490
  marginBottom: 0
3675
3491
  }),
@@ -3807,29 +3623,29 @@ function isFilter(filter) {
3807
3623
  return filter !== null && typeof filter.key === "string" && typeof filter.value === "string";
3808
3624
  }
3809
3625
 
3810
- var __defProp$x = Object.defineProperty;
3811
- var __defProps$l = Object.defineProperties;
3812
- var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
3813
- var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
3814
- var __hasOwnProp$x = Object.prototype.hasOwnProperty;
3815
- var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
3816
- var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3817
- var __spreadValues$x = (a, b) => {
3626
+ var __defProp$y = Object.defineProperty;
3627
+ var __defProps$m = Object.defineProperties;
3628
+ var __getOwnPropDescs$m = Object.getOwnPropertyDescriptors;
3629
+ var __getOwnPropSymbols$y = Object.getOwnPropertySymbols;
3630
+ var __hasOwnProp$y = Object.prototype.hasOwnProperty;
3631
+ var __propIsEnum$y = Object.prototype.propertyIsEnumerable;
3632
+ var __defNormalProp$y = (obj, key, value) => key in obj ? __defProp$y(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3633
+ var __spreadValues$y = (a, b) => {
3818
3634
  for (var prop in b || (b = {}))
3819
- if (__hasOwnProp$x.call(b, prop))
3820
- __defNormalProp$x(a, prop, b[prop]);
3821
- if (__getOwnPropSymbols$x)
3822
- for (var prop of __getOwnPropSymbols$x(b)) {
3823
- if (__propIsEnum$x.call(b, prop))
3824
- __defNormalProp$x(a, prop, b[prop]);
3635
+ if (__hasOwnProp$y.call(b, prop))
3636
+ __defNormalProp$y(a, prop, b[prop]);
3637
+ if (__getOwnPropSymbols$y)
3638
+ for (var prop of __getOwnPropSymbols$y(b)) {
3639
+ if (__propIsEnum$y.call(b, prop))
3640
+ __defNormalProp$y(a, prop, b[prop]);
3825
3641
  }
3826
3642
  return a;
3827
3643
  };
3828
- var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
3644
+ var __spreadProps$m = (a, b) => __defProps$m(a, __getOwnPropDescs$m(b));
3829
3645
  class AdHocFiltersVariable extends SceneObjectBase {
3830
3646
  constructor(state) {
3831
3647
  var _a, _b;
3832
- super(__spreadValues$x({
3648
+ super(__spreadValues$y({
3833
3649
  type: "adhoc",
3834
3650
  name: (_a = state.name) != null ? _a : "Filters",
3835
3651
  filters: [],
@@ -3866,15 +3682,15 @@ class AdHocFiltersVariable extends SceneObjectBase {
3866
3682
  const propLabelKey = `${prop}Label`;
3867
3683
  if (filter === _wip) {
3868
3684
  if (prop === "value") {
3869
- this.setState({ filters: [...filters, __spreadProps$l(__spreadValues$x({}, _wip), { [prop]: value, [propLabelKey]: label })], _wip: void 0 });
3685
+ this.setState({ filters: [...filters, __spreadProps$m(__spreadValues$y({}, _wip), { [prop]: value, [propLabelKey]: label })], _wip: void 0 });
3870
3686
  } else {
3871
- this.setState({ _wip: __spreadProps$l(__spreadValues$x({}, filter), { [prop]: value, [propLabelKey]: label }) });
3687
+ this.setState({ _wip: __spreadProps$m(__spreadValues$y({}, filter), { [prop]: value, [propLabelKey]: label }) });
3872
3688
  }
3873
3689
  return;
3874
3690
  }
3875
3691
  const updatedFilters = this.state.filters.map((f) => {
3876
3692
  if (f === filter) {
3877
- const updatedFilter = __spreadProps$l(__spreadValues$x({}, f), { [prop]: value, [propLabelKey]: label });
3693
+ const updatedFilter = __spreadProps$m(__spreadValues$y({}, f), { [prop]: value, [propLabelKey]: label });
3878
3694
  if (prop === "key" && filter[prop] !== value) {
3879
3695
  updatedFilter.value = "";
3880
3696
  updatedFilter.valueLabel = "";
@@ -3955,7 +3771,7 @@ function renderExpression(builder, filters) {
3955
3771
  }
3956
3772
  function AdHocFiltersVariableRenderer({ model }) {
3957
3773
  const { filters, readOnly, addFilterButtonText } = model.useState();
3958
- const styles = ui.useStyles2(getStyles$6);
3774
+ const styles = ui.useStyles2(getStyles$7);
3959
3775
  return /* @__PURE__ */ React__default["default"].createElement("div", {
3960
3776
  className: styles.wrapper
3961
3777
  }, filters.map((filter, index) => /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, {
@@ -3969,7 +3785,7 @@ function AdHocFiltersVariableRenderer({ model }) {
3969
3785
  addFilterButtonText
3970
3786
  }));
3971
3787
  }
3972
- const getStyles$6 = (theme) => ({
3788
+ const getStyles$7 = (theme) => ({
3973
3789
  wrapper: css.css({
3974
3790
  display: "flex",
3975
3791
  flexWrap: "wrap",
@@ -4053,25 +3869,25 @@ function areDifferentLayers(a, b) {
4053
3869
  return false;
4054
3870
  }
4055
3871
 
4056
- var __defProp$w = Object.defineProperty;
4057
- var __defProps$k = Object.defineProperties;
4058
- var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
4059
- var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
4060
- var __hasOwnProp$w = Object.prototype.hasOwnProperty;
4061
- var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
4062
- var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4063
- var __spreadValues$w = (a, b) => {
3872
+ var __defProp$x = Object.defineProperty;
3873
+ var __defProps$l = Object.defineProperties;
3874
+ var __getOwnPropDescs$l = Object.getOwnPropertyDescriptors;
3875
+ var __getOwnPropSymbols$x = Object.getOwnPropertySymbols;
3876
+ var __hasOwnProp$x = Object.prototype.hasOwnProperty;
3877
+ var __propIsEnum$x = Object.prototype.propertyIsEnumerable;
3878
+ var __defNormalProp$x = (obj, key, value) => key in obj ? __defProp$x(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3879
+ var __spreadValues$x = (a, b) => {
4064
3880
  for (var prop in b || (b = {}))
4065
- if (__hasOwnProp$w.call(b, prop))
4066
- __defNormalProp$w(a, prop, b[prop]);
4067
- if (__getOwnPropSymbols$w)
4068
- for (var prop of __getOwnPropSymbols$w(b)) {
4069
- if (__propIsEnum$w.call(b, prop))
4070
- __defNormalProp$w(a, prop, b[prop]);
3881
+ if (__hasOwnProp$x.call(b, prop))
3882
+ __defNormalProp$x(a, prop, b[prop]);
3883
+ if (__getOwnPropSymbols$x)
3884
+ for (var prop of __getOwnPropSymbols$x(b)) {
3885
+ if (__propIsEnum$x.call(b, prop))
3886
+ __defNormalProp$x(a, prop, b[prop]);
4071
3887
  }
4072
3888
  return a;
4073
3889
  };
4074
- var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
3890
+ var __spreadProps$l = (a, b) => __defProps$l(a, __getOwnPropDescs$l(b));
4075
3891
  let counter$1 = 100;
4076
3892
  function getNextRequestId$1() {
4077
3893
  return "SQR" + counter$1++;
@@ -4088,70 +3904,6 @@ class SceneQueryRunner extends SceneObjectBase {
4088
3904
  onVariableUpdateCompleted: this.onVariableUpdatesCompleted.bind(this),
4089
3905
  onAnyVariableChanged: this.onAnyVariableChanged.bind(this)
4090
3906
  });
4091
- this.prepareRequests = (timeRange, ds) => {
4092
- const comparer = this.getTimeCompare();
4093
- const { minInterval, queries } = this.state;
4094
- let secondaryRequest;
4095
- let request = __spreadValues$w({
4096
- app: "scenes",
4097
- requestId: getNextRequestId$1(),
4098
- timezone: timeRange.getTimeZone(),
4099
- panelId: 1,
4100
- range: timeRange.state.value,
4101
- interval: "1s",
4102
- intervalMs: 1e3,
4103
- targets: lodash.cloneDeep(queries),
4104
- maxDataPoints: this.getMaxDataPoints(),
4105
- scopedVars: this._scopedVars,
4106
- startTime: Date.now(),
4107
- liveStreaming: this.state.liveStreaming,
4108
- rangeRaw: {
4109
- from: timeRange.state.from,
4110
- to: timeRange.state.to
4111
- },
4112
- cacheTimeout: this.state.cacheTimeout,
4113
- queryCachingTTL: this.state.queryCachingTTL
4114
- }, getEnrichedDataRequest(this));
4115
- if (this._adhocFiltersVar) {
4116
- request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);
4117
- }
4118
- if (this._groupByVar) {
4119
- request.groupByKeys = this._groupByVar.state.value;
4120
- }
4121
- request.targets = request.targets.map((query) => {
4122
- var _a;
4123
- if (!query.datasource || query.datasource.uid !== ds.uid && !((_a = ds.meta) == null ? void 0 : _a.mixed) && runtime.isExpressionReference && !runtime.isExpressionReference(query.datasource)) {
4124
- query.datasource = ds.getRef();
4125
- }
4126
- return query;
4127
- });
4128
- const lowerIntervalLimit = minInterval ? minInterval : ds.interval;
4129
- const norm = data.rangeUtil.calculateInterval(timeRange.state.value, request.maxDataPoints, lowerIntervalLimit);
4130
- request.scopedVars = Object.assign({}, request.scopedVars, {
4131
- __interval: { text: norm.interval, value: norm.interval },
4132
- __interval_ms: { text: norm.intervalMs.toString(), value: norm.intervalMs }
4133
- });
4134
- request.interval = norm.interval;
4135
- request.intervalMs = norm.intervalMs;
4136
- const primaryTimeRange = timeRange.state.value;
4137
- if (comparer) {
4138
- const secondaryTimeRange = comparer.getCompareTimeRange(primaryTimeRange);
4139
- if (secondaryTimeRange) {
4140
- const secondaryTargets = request.targets.filter((query) => query.timeRangeCompare !== false);
4141
- if (secondaryTargets.length) {
4142
- secondaryRequest = __spreadProps$k(__spreadValues$w({}, request), {
4143
- targets: secondaryTargets,
4144
- range: secondaryTimeRange,
4145
- requestId: getNextRequestId$1()
4146
- });
4147
- }
4148
- request = __spreadProps$k(__spreadValues$w({}, request), {
4149
- range: primaryTimeRange
4150
- });
4151
- }
4152
- }
4153
- return [request, secondaryRequest];
4154
- };
4155
3907
  this.onDataReceived = (data$1) => {
4156
3908
  const preProcessedData = data.preProcessPanelData(data$1, this.state.data);
4157
3909
  this._resultAnnotations = data$1.annotations;
@@ -4170,11 +3922,11 @@ class SceneQueryRunner extends SceneObjectBase {
4170
3922
  }
4171
3923
  _onActivate() {
4172
3924
  const timeRange = sceneGraph.getTimeRange(this);
4173
- const comparer = this.getTimeCompare();
4174
- if (comparer) {
3925
+ const providers = this.getClosestExtraQueryProviders();
3926
+ for (const provider of providers) {
4175
3927
  this._subs.add(
4176
- comparer.subscribeToState((n, p) => {
4177
- if (n.compareWith !== p.compareWith) {
3928
+ provider.subscribeToState((n, p) => {
3929
+ if (provider.shouldRerun(p, n)) {
4178
3930
  this.runQueries();
4179
3931
  }
4180
3932
  })
@@ -4233,9 +3985,9 @@ class SceneQueryRunner extends SceneObjectBase {
4233
3985
  return;
4234
3986
  }
4235
3987
  this._layerAnnotations = annotations;
4236
- const baseStateUpdate = this.state.data ? this.state.data : __spreadProps$k(__spreadValues$w({}, emptyPanelData), { timeRange: timeRange.state.value });
3988
+ const baseStateUpdate = this.state.data ? this.state.data : __spreadProps$l(__spreadValues$x({}, emptyPanelData), { timeRange: timeRange.state.value });
4237
3989
  this.setState({
4238
- data: __spreadProps$k(__spreadValues$w({}, baseStateUpdate), {
3990
+ data: __spreadProps$l(__spreadValues$x({}, baseStateUpdate), {
4239
3991
  annotations: [...(_d = this._resultAnnotations) != null ? _d : [], ...annotations],
4240
3992
  alertState: alertState != null ? alertState : (_e = this.state.data) == null ? void 0 : _e.alertState
4241
3993
  })
@@ -4354,7 +4106,7 @@ class SceneQueryRunner extends SceneObjectBase {
4354
4106
  this._dataLayersSub = void 0;
4355
4107
  }
4356
4108
  this.setState({
4357
- data: __spreadProps$k(__spreadValues$w({}, this.state.data), { state: schema.LoadingState.Done })
4109
+ data: __spreadProps$l(__spreadValues$x({}, this.state.data), { state: schema.LoadingState.Done })
4358
4110
  });
4359
4111
  }
4360
4112
  async runWithTimeRange(timeRange) {
@@ -4380,16 +4132,18 @@ class SceneQueryRunner extends SceneObjectBase {
4380
4132
  const ds = await getDataSource(datasource, this._scopedVars);
4381
4133
  this.findAndSubscribeToAdHocFilters(datasource == null ? void 0 : datasource.uid);
4382
4134
  const runRequest = runtime.getRunRequest();
4383
- const [request, secondaryRequest] = this.prepareRequests(timeRange, ds);
4135
+ const { primary, secondaries, processors } = this.prepareRequests(timeRange, ds);
4384
4136
  writeSceneLog("SceneQueryRunner", "Starting runRequest", this.state.key);
4385
- let stream = runRequest(ds, request);
4386
- if (secondaryRequest) {
4387
- stream = rxjs.forkJoin([stream, runRequest(ds, secondaryRequest)]).pipe(timeShiftQueryResponseOperator);
4137
+ let stream = runRequest(ds, primary);
4138
+ if (secondaries.length > 0) {
4139
+ const secondaryStreams = secondaries.map((r) => runRequest(ds, r));
4140
+ const op = extraQueryProcessingOperator(processors);
4141
+ stream = rxjs.forkJoin([stream, ...secondaryStreams]).pipe(op);
4388
4142
  }
4389
4143
  stream = stream.pipe(
4390
4144
  registerQueryWithController({
4391
4145
  type: "data",
4392
- request,
4146
+ request: primary,
4393
4147
  origin: this,
4394
4148
  cancel: () => this.cancelQuery()
4395
4149
  })
@@ -4397,7 +4151,7 @@ class SceneQueryRunner extends SceneObjectBase {
4397
4151
  this._querySub = stream.subscribe(this.onDataReceived);
4398
4152
  } catch (err) {
4399
4153
  console.error("PanelQueryRunner Error", err);
4400
- this.onDataReceived(__spreadProps$k(__spreadValues$w(__spreadValues$w({}, emptyPanelData), this.state.data), {
4154
+ this.onDataReceived(__spreadProps$l(__spreadValues$x(__spreadValues$x({}, emptyPanelData), this.state.data), {
4401
4155
  state: schema.LoadingState.Error,
4402
4156
  errors: [runtime.toDataQueryError(err)]
4403
4157
  }));
@@ -4407,16 +4161,73 @@ class SceneQueryRunner extends SceneObjectBase {
4407
4161
  var _a;
4408
4162
  const clone = super.clone(withState);
4409
4163
  if (this._resultAnnotations) {
4410
- clone["_resultAnnotations"] = this._resultAnnotations.map((frame) => __spreadValues$w({}, frame));
4164
+ clone["_resultAnnotations"] = this._resultAnnotations.map((frame) => __spreadValues$x({}, frame));
4411
4165
  }
4412
4166
  if (this._layerAnnotations) {
4413
- clone["_layerAnnotations"] = this._layerAnnotations.map((frame) => __spreadValues$w({}, frame));
4167
+ clone["_layerAnnotations"] = this._layerAnnotations.map((frame) => __spreadValues$x({}, frame));
4414
4168
  }
4415
4169
  clone["_variableValueRecorder"] = this._variableValueRecorder.cloneAndRecordCurrentValuesForSceneObject(this);
4416
4170
  clone["_containerWidth"] = this._containerWidth;
4417
4171
  clone["_results"].next({ origin: this, data: (_a = this.state.data) != null ? _a : emptyPanelData });
4418
4172
  return clone;
4419
4173
  }
4174
+ prepareRequests(timeRange, ds) {
4175
+ var _a;
4176
+ const { minInterval, queries } = this.state;
4177
+ let request = __spreadValues$x({
4178
+ app: "scenes",
4179
+ requestId: getNextRequestId$1(),
4180
+ timezone: timeRange.getTimeZone(),
4181
+ panelId: 1,
4182
+ range: timeRange.state.value,
4183
+ interval: "1s",
4184
+ intervalMs: 1e3,
4185
+ targets: lodash.cloneDeep(queries),
4186
+ maxDataPoints: this.getMaxDataPoints(),
4187
+ scopedVars: this._scopedVars,
4188
+ startTime: Date.now(),
4189
+ liveStreaming: this.state.liveStreaming,
4190
+ rangeRaw: {
4191
+ from: timeRange.state.from,
4192
+ to: timeRange.state.to
4193
+ },
4194
+ cacheTimeout: this.state.cacheTimeout,
4195
+ queryCachingTTL: this.state.queryCachingTTL
4196
+ }, getEnrichedDataRequest(this));
4197
+ if (this._adhocFiltersVar) {
4198
+ request.filters = this._adhocFiltersVar.state.filters.filter(isFilterComplete);
4199
+ }
4200
+ if (this._groupByVar) {
4201
+ request.groupByKeys = this._groupByVar.state.value;
4202
+ }
4203
+ request.targets = request.targets.map((query) => {
4204
+ var _a2;
4205
+ if (!query.datasource || query.datasource.uid !== ds.uid && !((_a2 = ds.meta) == null ? void 0 : _a2.mixed) && runtime.isExpressionReference && !runtime.isExpressionReference(query.datasource)) {
4206
+ query.datasource = ds.getRef();
4207
+ }
4208
+ return query;
4209
+ });
4210
+ const lowerIntervalLimit = minInterval ? minInterval : ds.interval;
4211
+ const norm = data.rangeUtil.calculateInterval(timeRange.state.value, request.maxDataPoints, lowerIntervalLimit);
4212
+ request.scopedVars = Object.assign({}, request.scopedVars, {
4213
+ __interval: { text: norm.interval, value: norm.interval },
4214
+ __interval_ms: { text: norm.intervalMs.toString(), value: norm.intervalMs }
4215
+ });
4216
+ request.interval = norm.interval;
4217
+ request.intervalMs = norm.intervalMs;
4218
+ const primaryTimeRange = timeRange.state.value;
4219
+ let secondaryRequests = [];
4220
+ let secondaryProcessors = /* @__PURE__ */ new Map();
4221
+ for (const provider of (_a = this.getClosestExtraQueryProviders()) != null ? _a : []) {
4222
+ for (const { req, processor } of provider.getExtraQueries(request)) {
4223
+ const requestId = getNextRequestId$1();
4224
+ secondaryRequests.push(__spreadProps$l(__spreadValues$x({}, req), { requestId }));
4225
+ secondaryProcessors.set(requestId, processor != null ? processor : passthroughProcessor);
4226
+ }
4227
+ }
4228
+ request.range = primaryTimeRange;
4229
+ return { primary: request, secondaries: secondaryRequests, processors: secondaryProcessors };
4230
+ }
4420
4231
  _combineDataLayers(data) {
4421
4232
  if (this._layerAnnotations && this._layerAnnotations.length > 0) {
4422
4233
  data.annotations = (data.annotations || []).concat(this._layerAnnotations);
@@ -4431,22 +4242,23 @@ class SceneQueryRunner extends SceneObjectBase {
4431
4242
  this.setState({ data: emptyPanelData });
4432
4243
  }
4433
4244
  }
4434
- getTimeCompare() {
4245
+ getClosestExtraQueryProviders() {
4246
+ const found = /* @__PURE__ */ new Map();
4435
4247
  if (!this.parent) {
4436
- return null;
4248
+ return [];
4437
4249
  }
4438
- return getClosest(this.parent, (s) => {
4439
- let found = null;
4440
- if (s instanceof SceneTimeRangeCompare) {
4441
- return s;
4250
+ getClosest(this.parent, (s) => {
4251
+ if (isExtraQueryProvider(s) && !found.has(s.constructor)) {
4252
+ found.set(s.constructor, s);
4442
4253
  }
4443
4254
  s.forEachChild((child) => {
4444
- if (child instanceof SceneTimeRangeCompare) {
4445
- found = child;
4255
+ if (isExtraQueryProvider(child) && !found.has(child.constructor)) {
4256
+ found.set(child.constructor, child);
4446
4257
  }
4447
4258
  });
4448
- return found;
4259
+ return null;
4449
4260
  });
4261
+ return Array.from(found.values());
4450
4262
  }
4451
4263
  findAndSubscribeToAdHocFilters(uid) {
4452
4264
  const filtersVar = findActiveAdHocFilterVariableByUid(uid);
@@ -4645,28 +4457,28 @@ class ActWhenVariableChanged extends SceneObjectBase {
4645
4457
  }
4646
4458
  }
4647
4459
 
4648
- var __defProp$v = Object.defineProperty;
4649
- var __defProps$j = Object.defineProperties;
4650
- var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
4651
- var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
4652
- var __hasOwnProp$v = Object.prototype.hasOwnProperty;
4653
- var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
4654
- var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4655
- var __spreadValues$v = (a, b) => {
4460
+ var __defProp$w = Object.defineProperty;
4461
+ var __defProps$k = Object.defineProperties;
4462
+ var __getOwnPropDescs$k = Object.getOwnPropertyDescriptors;
4463
+ var __getOwnPropSymbols$w = Object.getOwnPropertySymbols;
4464
+ var __hasOwnProp$w = Object.prototype.hasOwnProperty;
4465
+ var __propIsEnum$w = Object.prototype.propertyIsEnumerable;
4466
+ var __defNormalProp$w = (obj, key, value) => key in obj ? __defProp$w(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4467
+ var __spreadValues$w = (a, b) => {
4656
4468
  for (var prop in b || (b = {}))
4657
- if (__hasOwnProp$v.call(b, prop))
4658
- __defNormalProp$v(a, prop, b[prop]);
4659
- if (__getOwnPropSymbols$v)
4660
- for (var prop of __getOwnPropSymbols$v(b)) {
4661
- if (__propIsEnum$v.call(b, prop))
4662
- __defNormalProp$v(a, prop, b[prop]);
4469
+ if (__hasOwnProp$w.call(b, prop))
4470
+ __defNormalProp$w(a, prop, b[prop]);
4471
+ if (__getOwnPropSymbols$w)
4472
+ for (var prop of __getOwnPropSymbols$w(b)) {
4473
+ if (__propIsEnum$w.call(b, prop))
4474
+ __defNormalProp$w(a, prop, b[prop]);
4663
4475
  }
4664
4476
  return a;
4665
4477
  };
4666
- var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
4478
+ var __spreadProps$k = (a, b) => __defProps$k(a, __getOwnPropDescs$k(b));
4667
4479
  class CursorSync extends SceneObjectBase {
4668
4480
  constructor(state) {
4669
- super(__spreadProps$j(__spreadValues$v({}, state), {
4481
+ super(__spreadProps$k(__spreadValues$w({}, state), {
4670
4482
  sync: state.sync || schema.DashboardCursorSync.Off
4671
4483
  }));
4672
4484
  this.getEventsBus = (panel) => {
@@ -4930,25 +4742,25 @@ const getAlertStateStyles = (theme) => {
4930
4742
  };
4931
4743
  };
4932
4744
 
4933
- var __defProp$u = Object.defineProperty;
4934
- var __defProps$i = Object.defineProperties;
4935
- var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
4936
- var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
4937
- var __hasOwnProp$u = Object.prototype.hasOwnProperty;
4938
- var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
4939
- var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4940
- var __spreadValues$u = (a, b) => {
4745
+ var __defProp$v = Object.defineProperty;
4746
+ var __defProps$j = Object.defineProperties;
4747
+ var __getOwnPropDescs$j = Object.getOwnPropertyDescriptors;
4748
+ var __getOwnPropSymbols$v = Object.getOwnPropertySymbols;
4749
+ var __hasOwnProp$v = Object.prototype.hasOwnProperty;
4750
+ var __propIsEnum$v = Object.prototype.propertyIsEnumerable;
4751
+ var __defNormalProp$v = (obj, key, value) => key in obj ? __defProp$v(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4752
+ var __spreadValues$v = (a, b) => {
4941
4753
  for (var prop in b || (b = {}))
4942
- if (__hasOwnProp$u.call(b, prop))
4943
- __defNormalProp$u(a, prop, b[prop]);
4944
- if (__getOwnPropSymbols$u)
4945
- for (var prop of __getOwnPropSymbols$u(b)) {
4946
- if (__propIsEnum$u.call(b, prop))
4947
- __defNormalProp$u(a, prop, b[prop]);
4754
+ if (__hasOwnProp$v.call(b, prop))
4755
+ __defNormalProp$v(a, prop, b[prop]);
4756
+ if (__getOwnPropSymbols$v)
4757
+ for (var prop of __getOwnPropSymbols$v(b)) {
4758
+ if (__propIsEnum$v.call(b, prop))
4759
+ __defNormalProp$v(a, prop, b[prop]);
4948
4760
  }
4949
4761
  return a;
4950
4762
  };
4951
- var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
4763
+ var __spreadProps$j = (a, b) => __defProps$j(a, __getOwnPropDescs$j(b));
4952
4764
  const displayOverrideRef = "hideSeriesFrom";
4953
4765
  const isHideSeriesOverride = data.isSystemOverrideWithRef(displayOverrideRef);
4954
4766
  function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
@@ -4958,13 +4770,13 @@ function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
4958
4770
  if (currentIndex < 0) {
4959
4771
  if (mode === ui.SeriesVisibilityChangeMode.ToggleSelection) {
4960
4772
  const override3 = createOverride$1([displayName, ...getNamesOfHiddenFields(overrides, data)]);
4961
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4773
+ return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4962
4774
  overrides: [...fieldConfig.overrides, override3]
4963
4775
  });
4964
4776
  }
4965
4777
  const displayNames = getDisplayNames(data, displayName);
4966
4778
  const override2 = createOverride$1(displayNames);
4967
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4779
+ return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4968
4780
  overrides: [...fieldConfig.overrides, override2]
4969
4781
  });
4970
4782
  }
@@ -4977,22 +4789,22 @@ function seriesVisibilityConfigFactory(label, mode, fieldConfig, data) {
4977
4789
  existing = existing.filter((el) => nameOfHiddenFields.indexOf(el) < 0);
4978
4790
  }
4979
4791
  if (existing[0] === displayName && existing.length === 1) {
4980
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4792
+ return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4981
4793
  overrides: overridesCopy
4982
4794
  });
4983
4795
  }
4984
4796
  const override2 = createOverride$1([displayName, ...nameOfHiddenFields]);
4985
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4797
+ return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4986
4798
  overrides: [...overridesCopy, override2]
4987
4799
  });
4988
4800
  }
4989
4801
  const override = createExtendedOverride(current, displayName);
4990
4802
  if (allFieldsAreExcluded(override, data)) {
4991
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4803
+ return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4992
4804
  overrides: overridesCopy
4993
4805
  });
4994
4806
  }
4995
- return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
4807
+ return __spreadProps$j(__spreadValues$v({}, fieldConfig), {
4996
4808
  overrides: [...overridesCopy, override]
4997
4809
  });
4998
4810
  }
@@ -5017,7 +4829,7 @@ function createOverride$1(names, mode = data.ByNamesMatcherMode.exclude, propert
5017
4829
  }
5018
4830
  },
5019
4831
  properties: [
5020
- __spreadProps$i(__spreadValues$u({}, property), {
4832
+ __spreadProps$j(__spreadValues$v({}, property), {
5021
4833
  value: {
5022
4834
  viz: true,
5023
4835
  legend: false,
@@ -5089,32 +4901,32 @@ const getNamesOfHiddenFields = (overrides, data$1) => {
5089
4901
  return names;
5090
4902
  };
5091
4903
 
5092
- var __defProp$t = Object.defineProperty;
5093
- var __defProps$h = Object.defineProperties;
5094
- var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
5095
- var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
5096
- var __hasOwnProp$t = Object.prototype.hasOwnProperty;
5097
- var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
5098
- var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5099
- var __spreadValues$t = (a, b) => {
4904
+ var __defProp$u = Object.defineProperty;
4905
+ var __defProps$i = Object.defineProperties;
4906
+ var __getOwnPropDescs$i = Object.getOwnPropertyDescriptors;
4907
+ var __getOwnPropSymbols$u = Object.getOwnPropertySymbols;
4908
+ var __hasOwnProp$u = Object.prototype.hasOwnProperty;
4909
+ var __propIsEnum$u = Object.prototype.propertyIsEnumerable;
4910
+ var __defNormalProp$u = (obj, key, value) => key in obj ? __defProp$u(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4911
+ var __spreadValues$u = (a, b) => {
5100
4912
  for (var prop in b || (b = {}))
5101
- if (__hasOwnProp$t.call(b, prop))
5102
- __defNormalProp$t(a, prop, b[prop]);
5103
- if (__getOwnPropSymbols$t)
5104
- for (var prop of __getOwnPropSymbols$t(b)) {
5105
- if (__propIsEnum$t.call(b, prop))
5106
- __defNormalProp$t(a, prop, b[prop]);
4913
+ if (__hasOwnProp$u.call(b, prop))
4914
+ __defNormalProp$u(a, prop, b[prop]);
4915
+ if (__getOwnPropSymbols$u)
4916
+ for (var prop of __getOwnPropSymbols$u(b)) {
4917
+ if (__propIsEnum$u.call(b, prop))
4918
+ __defNormalProp$u(a, prop, b[prop]);
5107
4919
  }
5108
4920
  return a;
5109
4921
  };
5110
- var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
4922
+ var __spreadProps$i = (a, b) => __defProps$i(a, __getOwnPropDescs$i(b));
5111
4923
  const changeSeriesColorConfigFactory = (label, color, fieldConfig) => {
5112
4924
  const { overrides } = fieldConfig;
5113
4925
  const currentIndex = fieldConfig.overrides.findIndex((override) => {
5114
4926
  return override.matcher.id === data.FieldMatcherID.byName && override.matcher.options === label;
5115
4927
  });
5116
4928
  if (currentIndex < 0) {
5117
- return __spreadProps$h(__spreadValues$t({}, fieldConfig), {
4929
+ return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
5118
4930
  overrides: [...fieldConfig.overrides, createOverride(label, color)]
5119
4931
  });
5120
4932
  }
@@ -5122,19 +4934,19 @@ const changeSeriesColorConfigFactory = (label, color, fieldConfig) => {
5122
4934
  const existing = overridesCopy[currentIndex];
5123
4935
  const propertyIndex = existing.properties.findIndex((p) => p.id === "color");
5124
4936
  if (propertyIndex < 0) {
5125
- overridesCopy[currentIndex] = __spreadProps$h(__spreadValues$t({}, existing), {
4937
+ overridesCopy[currentIndex] = __spreadProps$i(__spreadValues$u({}, existing), {
5126
4938
  properties: [...existing.properties, createProperty(color)]
5127
4939
  });
5128
- return __spreadProps$h(__spreadValues$t({}, fieldConfig), {
4940
+ return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
5129
4941
  overrides: overridesCopy
5130
4942
  });
5131
4943
  }
5132
4944
  const propertiesCopy = Array.from(existing.properties);
5133
4945
  propertiesCopy[propertyIndex] = createProperty(color);
5134
- overridesCopy[currentIndex] = __spreadProps$h(__spreadValues$t({}, existing), {
4946
+ overridesCopy[currentIndex] = __spreadProps$i(__spreadValues$u({}, existing), {
5135
4947
  properties: propertiesCopy
5136
4948
  });
5137
- return __spreadProps$h(__spreadValues$t({}, fieldConfig), {
4949
+ return __spreadProps$i(__spreadValues$u({}, fieldConfig), {
5138
4950
  overrides: overridesCopy
5139
4951
  });
5140
4952
  };
@@ -5157,29 +4969,29 @@ const createProperty = (color) => {
5157
4969
  };
5158
4970
  };
5159
4971
 
5160
- var __defProp$s = Object.defineProperty;
5161
- var __defProps$g = Object.defineProperties;
5162
- var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
5163
- var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
5164
- var __hasOwnProp$s = Object.prototype.hasOwnProperty;
5165
- var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
5166
- var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5167
- var __spreadValues$s = (a, b) => {
4972
+ var __defProp$t = Object.defineProperty;
4973
+ var __defProps$h = Object.defineProperties;
4974
+ var __getOwnPropDescs$h = Object.getOwnPropertyDescriptors;
4975
+ var __getOwnPropSymbols$t = Object.getOwnPropertySymbols;
4976
+ var __hasOwnProp$t = Object.prototype.hasOwnProperty;
4977
+ var __propIsEnum$t = Object.prototype.propertyIsEnumerable;
4978
+ var __defNormalProp$t = (obj, key, value) => key in obj ? __defProp$t(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4979
+ var __spreadValues$t = (a, b) => {
5168
4980
  for (var prop in b || (b = {}))
5169
- if (__hasOwnProp$s.call(b, prop))
5170
- __defNormalProp$s(a, prop, b[prop]);
5171
- if (__getOwnPropSymbols$s)
5172
- for (var prop of __getOwnPropSymbols$s(b)) {
5173
- if (__propIsEnum$s.call(b, prop))
5174
- __defNormalProp$s(a, prop, b[prop]);
4981
+ if (__hasOwnProp$t.call(b, prop))
4982
+ __defNormalProp$t(a, prop, b[prop]);
4983
+ if (__getOwnPropSymbols$t)
4984
+ for (var prop of __getOwnPropSymbols$t(b)) {
4985
+ if (__propIsEnum$t.call(b, prop))
4986
+ __defNormalProp$t(a, prop, b[prop]);
5175
4987
  }
5176
4988
  return a;
5177
4989
  };
5178
- var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
4990
+ var __spreadProps$h = (a, b) => __defProps$h(a, __getOwnPropDescs$h(b));
5179
4991
  class VizPanel extends SceneObjectBase {
5180
4992
  constructor(state) {
5181
4993
  var _a;
5182
- super(__spreadValues$s({
4994
+ super(__spreadValues$t({
5183
4995
  options: {},
5184
4996
  fieldConfig: { defaults: {}, overrides: [] },
5185
4997
  title: "Title",
@@ -5292,7 +5104,7 @@ class VizPanel extends SceneObjectBase {
5292
5104
  };
5293
5105
  this._onInstanceStateChange = (state) => {
5294
5106
  if (this._panelContext) {
5295
- this._panelContext = __spreadProps$g(__spreadValues$s({}, this._panelContext), {
5107
+ this._panelContext = __spreadProps$h(__spreadValues$t({}, this._panelContext), {
5296
5108
  instanceState: state
5297
5109
  });
5298
5110
  }
@@ -5316,8 +5128,8 @@ class VizPanel extends SceneObjectBase {
5316
5128
  sortBy = sortKey;
5317
5129
  }
5318
5130
  this.onOptionsChange(
5319
- __spreadProps$g(__spreadValues$s({}, this.state.options), {
5320
- legend: __spreadProps$g(__spreadValues$s({}, legendOptions), { sortBy, sortDesc })
5131
+ __spreadProps$h(__spreadValues$t({}, this.state.options), {
5132
+ legend: __spreadProps$h(__spreadValues$t({}, legendOptions), { sortBy, sortDesc })
5321
5133
  }),
5322
5134
  true
5323
5135
  );
@@ -5424,7 +5236,7 @@ class VizPanel extends SceneObjectBase {
5424
5236
  if (!data.compareArrayValues(newFrames, prevFrames, data.compareDataFrameStructures)) {
5425
5237
  this._structureRev++;
5426
5238
  }
5427
- this._dataWithFieldConfig = __spreadProps$g(__spreadValues$s({}, rawData), {
5239
+ this._dataWithFieldConfig = __spreadProps$h(__spreadValues$t({}, rawData), {
5428
5240
  structureRev: this._structureRev,
5429
5241
  series: newFrames
5430
5242
  });
@@ -5567,25 +5379,25 @@ function getMessageFromError(err) {
5567
5379
  return JSON.stringify(err);
5568
5380
  }
5569
5381
 
5570
- var __defProp$r = Object.defineProperty;
5571
- var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
5572
- var __hasOwnProp$r = Object.prototype.hasOwnProperty;
5573
- var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
5574
- var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5575
- var __spreadValues$r = (a, b) => {
5576
- for (var prop in b || (b = {}))
5577
- if (__hasOwnProp$r.call(b, prop))
5578
- __defNormalProp$r(a, prop, b[prop]);
5579
- if (__getOwnPropSymbols$r)
5580
- for (var prop of __getOwnPropSymbols$r(b)) {
5581
- if (__propIsEnum$r.call(b, prop))
5582
- __defNormalProp$r(a, prop, b[prop]);
5382
+ var __defProp$s = Object.defineProperty;
5383
+ var __getOwnPropSymbols$s = Object.getOwnPropertySymbols;
5384
+ var __hasOwnProp$s = Object.prototype.hasOwnProperty;
5385
+ var __propIsEnum$s = Object.prototype.propertyIsEnumerable;
5386
+ var __defNormalProp$s = (obj, key, value) => key in obj ? __defProp$s(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5387
+ var __spreadValues$s = (a, b) => {
5388
+ for (var prop in b || (b = {}))
5389
+ if (__hasOwnProp$s.call(b, prop))
5390
+ __defNormalProp$s(a, prop, b[prop]);
5391
+ if (__getOwnPropSymbols$s)
5392
+ for (var prop of __getOwnPropSymbols$s(b)) {
5393
+ if (__propIsEnum$s.call(b, prop))
5394
+ __defNormalProp$s(a, prop, b[prop]);
5583
5395
  }
5584
5396
  return a;
5585
5397
  };
5586
5398
  class SceneDataLayerBase extends SceneObjectBase {
5587
5399
  constructor(initialState, variableDependencyStatePaths = []) {
5588
- super(__spreadValues$r({
5400
+ super(__spreadValues$s({
5589
5401
  isEnabled: true
5590
5402
  }, initialState));
5591
5403
  this._results = new rxjs.ReplaySubject(1);
@@ -5707,33 +5519,33 @@ function DataLayerControlSwitch({ layer }) {
5707
5519
  }
5708
5520
  const containerStyle$1 = css.css({ display: "flex" });
5709
5521
 
5710
- var __defProp$q = Object.defineProperty;
5711
- var __defProps$f = Object.defineProperties;
5712
- var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
5713
- var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
5714
- var __hasOwnProp$q = Object.prototype.hasOwnProperty;
5715
- var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
5716
- var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5717
- var __spreadValues$q = (a, b) => {
5522
+ var __defProp$r = Object.defineProperty;
5523
+ var __defProps$g = Object.defineProperties;
5524
+ var __getOwnPropDescs$g = Object.getOwnPropertyDescriptors;
5525
+ var __getOwnPropSymbols$r = Object.getOwnPropertySymbols;
5526
+ var __hasOwnProp$r = Object.prototype.hasOwnProperty;
5527
+ var __propIsEnum$r = Object.prototype.propertyIsEnumerable;
5528
+ var __defNormalProp$r = (obj, key, value) => key in obj ? __defProp$r(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5529
+ var __spreadValues$r = (a, b) => {
5718
5530
  for (var prop in b || (b = {}))
5719
- if (__hasOwnProp$q.call(b, prop))
5720
- __defNormalProp$q(a, prop, b[prop]);
5721
- if (__getOwnPropSymbols$q)
5722
- for (var prop of __getOwnPropSymbols$q(b)) {
5723
- if (__propIsEnum$q.call(b, prop))
5724
- __defNormalProp$q(a, prop, b[prop]);
5531
+ if (__hasOwnProp$r.call(b, prop))
5532
+ __defNormalProp$r(a, prop, b[prop]);
5533
+ if (__getOwnPropSymbols$r)
5534
+ for (var prop of __getOwnPropSymbols$r(b)) {
5535
+ if (__propIsEnum$r.call(b, prop))
5536
+ __defNormalProp$r(a, prop, b[prop]);
5725
5537
  }
5726
5538
  return a;
5727
5539
  };
5728
- var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
5540
+ var __spreadProps$g = (a, b) => __defProps$g(a, __getOwnPropDescs$g(b));
5729
5541
  var __objRest$2 = (source, exclude) => {
5730
5542
  var target = {};
5731
5543
  for (var prop in source)
5732
- if (__hasOwnProp$q.call(source, prop) && exclude.indexOf(prop) < 0)
5544
+ if (__hasOwnProp$r.call(source, prop) && exclude.indexOf(prop) < 0)
5733
5545
  target[prop] = source[prop];
5734
- if (source != null && __getOwnPropSymbols$q)
5735
- for (var prop of __getOwnPropSymbols$q(source)) {
5736
- if (exclude.indexOf(prop) < 0 && __propIsEnum$q.call(source, prop))
5546
+ if (source != null && __getOwnPropSymbols$r)
5547
+ for (var prop of __getOwnPropSymbols$r(source)) {
5548
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$r.call(source, prop))
5737
5549
  target[prop] = source[prop];
5738
5550
  }
5739
5551
  return target;
@@ -5742,7 +5554,7 @@ const standardAnnotationSupport = {
5742
5554
  prepareAnnotation: (json) => {
5743
5555
  if (lodash.isString(json == null ? void 0 : json.query)) {
5744
5556
  const _a = json, { query } = _a, rest = __objRest$2(_a, ["query"]);
5745
- return __spreadProps$f(__spreadValues$q({}, rest), {
5557
+ return __spreadProps$g(__spreadValues$r({}, rest), {
5746
5558
  target: {
5747
5559
  refId: "annotation_query",
5748
5560
  query
@@ -5910,25 +5722,25 @@ function shouldUseLegacyRunner(datasource) {
5910
5722
  return !datasource.annotations || legacyRunner.includes(type);
5911
5723
  }
5912
5724
 
5913
- var __defProp$p = Object.defineProperty;
5914
- var __defProps$e = Object.defineProperties;
5915
- var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
5916
- var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
5917
- var __hasOwnProp$p = Object.prototype.hasOwnProperty;
5918
- var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
5919
- var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5920
- var __spreadValues$p = (a, b) => {
5725
+ var __defProp$q = Object.defineProperty;
5726
+ var __defProps$f = Object.defineProperties;
5727
+ var __getOwnPropDescs$f = Object.getOwnPropertyDescriptors;
5728
+ var __getOwnPropSymbols$q = Object.getOwnPropertySymbols;
5729
+ var __hasOwnProp$q = Object.prototype.hasOwnProperty;
5730
+ var __propIsEnum$q = Object.prototype.propertyIsEnumerable;
5731
+ var __defNormalProp$q = (obj, key, value) => key in obj ? __defProp$q(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5732
+ var __spreadValues$q = (a, b) => {
5921
5733
  for (var prop in b || (b = {}))
5922
- if (__hasOwnProp$p.call(b, prop))
5923
- __defNormalProp$p(a, prop, b[prop]);
5924
- if (__getOwnPropSymbols$p)
5925
- for (var prop of __getOwnPropSymbols$p(b)) {
5926
- if (__propIsEnum$p.call(b, prop))
5927
- __defNormalProp$p(a, prop, b[prop]);
5734
+ if (__hasOwnProp$q.call(b, prop))
5735
+ __defNormalProp$q(a, prop, b[prop]);
5736
+ if (__getOwnPropSymbols$q)
5737
+ for (var prop of __getOwnPropSymbols$q(b)) {
5738
+ if (__propIsEnum$q.call(b, prop))
5739
+ __defNormalProp$q(a, prop, b[prop]);
5928
5740
  }
5929
5741
  return a;
5930
5742
  };
5931
- var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
5743
+ var __spreadProps$f = (a, b) => __defProps$f(a, __getOwnPropDescs$f(b));
5932
5744
  let counter = 100;
5933
5745
  function getNextRequestId() {
5934
5746
  return "AQ" + counter++;
@@ -5951,8 +5763,8 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5951
5763
  }))
5952
5764
  );
5953
5765
  }
5954
- const processor = __spreadValues$p(__spreadValues$p({}, standardAnnotationSupport), datasource.annotations);
5955
- const annotationWithDefaults = __spreadValues$p(__spreadValues$p({}, (_a = processor.getDefaultQuery) == null ? void 0 : _a.call(processor)), query);
5766
+ const processor = __spreadValues$q(__spreadValues$q({}, standardAnnotationSupport), datasource.annotations);
5767
+ const annotationWithDefaults = __spreadValues$q(__spreadValues$q({}, (_a = processor.getDefaultQuery) == null ? void 0 : _a.call(processor)), query);
5956
5768
  const annotation = processor.prepareAnnotation(annotationWithDefaults);
5957
5769
  if (!annotation) {
5958
5770
  return rxjs.of({
@@ -5975,7 +5787,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5975
5787
  __annotation: { text: annotation.name, value: annotation },
5976
5788
  __sceneObject: { text: "__sceneObject", value: layer }
5977
5789
  };
5978
- const queryRequest = __spreadValues$p(__spreadProps$e(__spreadValues$p({
5790
+ const queryRequest = __spreadValues$q(__spreadProps$f(__spreadValues$q({
5979
5791
  startTime: Date.now(),
5980
5792
  requestId: getNextRequestId(),
5981
5793
  range: timeRange.state.value,
@@ -5985,7 +5797,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
5985
5797
  app: data.CoreApp.Dashboard,
5986
5798
  timezone: timeRange.getTimeZone(),
5987
5799
  targets: [
5988
- __spreadProps$e(__spreadValues$p({}, processedQuery), {
5800
+ __spreadProps$f(__spreadValues$q({}, processedQuery), {
5989
5801
  refId: "Anno"
5990
5802
  })
5991
5803
  ]
@@ -6003,7 +5815,7 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
6003
5815
  data$1.forEach((frame) => {
6004
5816
  var _a2;
6005
5817
  if (!((_a2 = frame.meta) == null ? void 0 : _a2.dataTopic)) {
6006
- frame.meta = __spreadProps$e(__spreadValues$p({}, frame.meta || {}), { dataTopic: data.DataTopic.Annotations });
5818
+ frame.meta = __spreadProps$f(__spreadValues$q({}, frame.meta || {}), { dataTopic: data.DataTopic.Annotations });
6007
5819
  }
6008
5820
  });
6009
5821
  return processor.processEvents(annotation, data$1).pipe(
@@ -6018,19 +5830,19 @@ function executeAnnotationQuery(datasource, timeRange, query, layer) {
6018
5830
  );
6019
5831
  }
6020
5832
 
6021
- var __defProp$o = Object.defineProperty;
6022
- var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
6023
- var __hasOwnProp$o = Object.prototype.hasOwnProperty;
6024
- var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
6025
- var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6026
- var __spreadValues$o = (a, b) => {
5833
+ var __defProp$p = Object.defineProperty;
5834
+ var __getOwnPropSymbols$p = Object.getOwnPropertySymbols;
5835
+ var __hasOwnProp$p = Object.prototype.hasOwnProperty;
5836
+ var __propIsEnum$p = Object.prototype.propertyIsEnumerable;
5837
+ var __defNormalProp$p = (obj, key, value) => key in obj ? __defProp$p(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5838
+ var __spreadValues$p = (a, b) => {
6027
5839
  for (var prop in b || (b = {}))
6028
- if (__hasOwnProp$o.call(b, prop))
6029
- __defNormalProp$o(a, prop, b[prop]);
6030
- if (__getOwnPropSymbols$o)
6031
- for (var prop of __getOwnPropSymbols$o(b)) {
6032
- if (__propIsEnum$o.call(b, prop))
6033
- __defNormalProp$o(a, prop, b[prop]);
5840
+ if (__hasOwnProp$p.call(b, prop))
5841
+ __defNormalProp$p(a, prop, b[prop]);
5842
+ if (__getOwnPropSymbols$p)
5843
+ for (var prop of __getOwnPropSymbols$p(b)) {
5844
+ if (__propIsEnum$p.call(b, prop))
5845
+ __defNormalProp$p(a, prop, b[prop]);
6034
5846
  }
6035
5847
  return a;
6036
5848
  };
@@ -6041,7 +5853,7 @@ function postProcessQueryResult(annotation, results) {
6041
5853
  }
6042
5854
  const processed = results.map((item) => {
6043
5855
  var _a;
6044
- const processedItem = __spreadValues$o({}, item);
5856
+ const processedItem = __spreadValues$p({}, item);
6045
5857
  processedItem.source = annotation;
6046
5858
  processedItem.color = runtime.config.theme2.visualization.getColorByName(annotation.iconColor);
6047
5859
  processedItem.type = annotation.name;
@@ -6090,29 +5902,29 @@ function isPanelAlert(event) {
6090
5902
  return event.eventType === "panel-alert";
6091
5903
  }
6092
5904
 
6093
- var __defProp$n = Object.defineProperty;
6094
- var __defProps$d = Object.defineProperties;
6095
- var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
6096
- var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
6097
- var __hasOwnProp$n = Object.prototype.hasOwnProperty;
6098
- var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
6099
- var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6100
- var __spreadValues$n = (a, b) => {
5905
+ var __defProp$o = Object.defineProperty;
5906
+ var __defProps$e = Object.defineProperties;
5907
+ var __getOwnPropDescs$e = Object.getOwnPropertyDescriptors;
5908
+ var __getOwnPropSymbols$o = Object.getOwnPropertySymbols;
5909
+ var __hasOwnProp$o = Object.prototype.hasOwnProperty;
5910
+ var __propIsEnum$o = Object.prototype.propertyIsEnumerable;
5911
+ var __defNormalProp$o = (obj, key, value) => key in obj ? __defProp$o(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5912
+ var __spreadValues$o = (a, b) => {
6101
5913
  for (var prop in b || (b = {}))
6102
- if (__hasOwnProp$n.call(b, prop))
6103
- __defNormalProp$n(a, prop, b[prop]);
6104
- if (__getOwnPropSymbols$n)
6105
- for (var prop of __getOwnPropSymbols$n(b)) {
6106
- if (__propIsEnum$n.call(b, prop))
6107
- __defNormalProp$n(a, prop, b[prop]);
5914
+ if (__hasOwnProp$o.call(b, prop))
5915
+ __defNormalProp$o(a, prop, b[prop]);
5916
+ if (__getOwnPropSymbols$o)
5917
+ for (var prop of __getOwnPropSymbols$o(b)) {
5918
+ if (__propIsEnum$o.call(b, prop))
5919
+ __defNormalProp$o(a, prop, b[prop]);
6108
5920
  }
6109
5921
  return a;
6110
5922
  };
6111
- var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
5923
+ var __spreadProps$e = (a, b) => __defProps$e(a, __getOwnPropDescs$e(b));
6112
5924
  class AnnotationsDataLayer extends SceneDataLayerBase {
6113
5925
  constructor(initialState) {
6114
5926
  super(
6115
- __spreadValues$n({
5927
+ __spreadValues$o({
6116
5928
  isEnabled: true
6117
5929
  }, initialState),
6118
5930
  ["query"]
@@ -6160,7 +5972,7 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
6160
5972
  this.publishResults(stateUpdate);
6161
5973
  });
6162
5974
  } catch (e) {
6163
- this.publishResults(__spreadProps$d(__spreadValues$n({}, emptyPanelData), {
5975
+ this.publishResults(__spreadProps$e(__spreadValues$o({}, emptyPanelData), {
6164
5976
  state: schema.LoadingState.Error,
6165
5977
  errors: [
6166
5978
  {
@@ -6177,9 +5989,9 @@ class AnnotationsDataLayer extends SceneDataLayerBase {
6177
5989
  processEvents(query, events) {
6178
5990
  let processedEvents = postProcessQueryResult(query, events.events || []);
6179
5991
  processedEvents = dedupAnnotations(processedEvents);
6180
- const stateUpdate = __spreadProps$d(__spreadValues$n({}, emptyPanelData), { state: events.state });
5992
+ const stateUpdate = __spreadProps$e(__spreadValues$o({}, emptyPanelData), { state: events.state });
6181
5993
  const df = data.arrayToDataFrame(processedEvents);
6182
- df.meta = __spreadProps$d(__spreadValues$n({}, df.meta), {
5994
+ df.meta = __spreadProps$e(__spreadValues$o({}, df.meta), {
6183
5995
  dataTopic: data.DataTopic.Annotations
6184
5996
  });
6185
5997
  stateUpdate.series = [df];
@@ -6232,28 +6044,28 @@ class SceneTimeRangeTransformerBase extends SceneObjectBase {
6232
6044
  }
6233
6045
  }
6234
6046
 
6235
- var __defProp$m = Object.defineProperty;
6236
- var __defProps$c = Object.defineProperties;
6237
- var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
6238
- var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
6239
- var __hasOwnProp$m = Object.prototype.hasOwnProperty;
6240
- var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
6241
- var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6242
- var __spreadValues$m = (a, b) => {
6047
+ var __defProp$n = Object.defineProperty;
6048
+ var __defProps$d = Object.defineProperties;
6049
+ var __getOwnPropDescs$d = Object.getOwnPropertyDescriptors;
6050
+ var __getOwnPropSymbols$n = Object.getOwnPropertySymbols;
6051
+ var __hasOwnProp$n = Object.prototype.hasOwnProperty;
6052
+ var __propIsEnum$n = Object.prototype.propertyIsEnumerable;
6053
+ var __defNormalProp$n = (obj, key, value) => key in obj ? __defProp$n(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6054
+ var __spreadValues$n = (a, b) => {
6243
6055
  for (var prop in b || (b = {}))
6244
- if (__hasOwnProp$m.call(b, prop))
6245
- __defNormalProp$m(a, prop, b[prop]);
6246
- if (__getOwnPropSymbols$m)
6247
- for (var prop of __getOwnPropSymbols$m(b)) {
6248
- if (__propIsEnum$m.call(b, prop))
6249
- __defNormalProp$m(a, prop, b[prop]);
6056
+ if (__hasOwnProp$n.call(b, prop))
6057
+ __defNormalProp$n(a, prop, b[prop]);
6058
+ if (__getOwnPropSymbols$n)
6059
+ for (var prop of __getOwnPropSymbols$n(b)) {
6060
+ if (__propIsEnum$n.call(b, prop))
6061
+ __defNormalProp$n(a, prop, b[prop]);
6250
6062
  }
6251
6063
  return a;
6252
6064
  };
6253
- var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
6065
+ var __spreadProps$d = (a, b) => __defProps$d(a, __getOwnPropDescs$d(b));
6254
6066
  class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
6255
6067
  constructor(state) {
6256
- super(__spreadProps$c(__spreadValues$m({}, state), {
6068
+ super(__spreadProps$d(__spreadValues$n({}, state), {
6257
6069
  timeZone: state.timeZone,
6258
6070
  from: "now-6h",
6259
6071
  to: "now",
@@ -6261,7 +6073,7 @@ class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
6261
6073
  }));
6262
6074
  }
6263
6075
  ancestorTimeRangeChanged(timeRange) {
6264
- this.setState(__spreadProps$c(__spreadValues$m({}, timeRange), {
6076
+ this.setState(__spreadProps$d(__spreadValues$n({}, timeRange), {
6265
6077
  timeZone: this.state.timeZone,
6266
6078
  value: evaluateTimeRange(
6267
6079
  timeRange.from,
@@ -6289,25 +6101,25 @@ class SceneTimeZoneOverride extends SceneTimeRangeTransformerBase {
6289
6101
  }
6290
6102
  }
6291
6103
 
6292
- var __defProp$l = Object.defineProperty;
6293
- var __defProps$b = Object.defineProperties;
6294
- var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
6295
- var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
6296
- var __hasOwnProp$l = Object.prototype.hasOwnProperty;
6297
- var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
6298
- var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6299
- var __spreadValues$l = (a, b) => {
6104
+ var __defProp$m = Object.defineProperty;
6105
+ var __defProps$c = Object.defineProperties;
6106
+ var __getOwnPropDescs$c = Object.getOwnPropertyDescriptors;
6107
+ var __getOwnPropSymbols$m = Object.getOwnPropertySymbols;
6108
+ var __hasOwnProp$m = Object.prototype.hasOwnProperty;
6109
+ var __propIsEnum$m = Object.prototype.propertyIsEnumerable;
6110
+ var __defNormalProp$m = (obj, key, value) => key in obj ? __defProp$m(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6111
+ var __spreadValues$m = (a, b) => {
6300
6112
  for (var prop in b || (b = {}))
6301
- if (__hasOwnProp$l.call(b, prop))
6302
- __defNormalProp$l(a, prop, b[prop]);
6303
- if (__getOwnPropSymbols$l)
6304
- for (var prop of __getOwnPropSymbols$l(b)) {
6305
- if (__propIsEnum$l.call(b, prop))
6306
- __defNormalProp$l(a, prop, b[prop]);
6113
+ if (__hasOwnProp$m.call(b, prop))
6114
+ __defNormalProp$m(a, prop, b[prop]);
6115
+ if (__getOwnPropSymbols$m)
6116
+ for (var prop of __getOwnPropSymbols$m(b)) {
6117
+ if (__propIsEnum$m.call(b, prop))
6118
+ __defNormalProp$m(a, prop, b[prop]);
6307
6119
  }
6308
6120
  return a;
6309
6121
  };
6310
- var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
6122
+ var __spreadProps$c = (a, b) => __defProps$c(a, __getOwnPropDescs$c(b));
6311
6123
  class SceneDataLayerSetBase extends SceneObjectBase {
6312
6124
  constructor() {
6313
6125
  super(...arguments);
@@ -6331,7 +6143,7 @@ class SceneDataLayerSetBase extends SceneObjectBase {
6331
6143
  series = series.concat(result.data.series);
6332
6144
  }
6333
6145
  }
6334
- const combinedData = __spreadProps$b(__spreadValues$l({}, emptyPanelData), { series });
6146
+ const combinedData = __spreadProps$c(__spreadValues$m({}, emptyPanelData), { series });
6335
6147
  this._results.next({ origin: this, data: combinedData });
6336
6148
  this.setStateHelper({ data: combinedData });
6337
6149
  }
@@ -6380,25 +6192,25 @@ SceneDataLayerSet.Component = ({ model }) => {
6380
6192
  })));
6381
6193
  };
6382
6194
 
6383
- var __defProp$k = Object.defineProperty;
6384
- var __defProps$a = Object.defineProperties;
6385
- var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
6386
- var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
6387
- var __hasOwnProp$k = Object.prototype.hasOwnProperty;
6388
- var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
6389
- var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6390
- var __spreadValues$k = (a, b) => {
6195
+ var __defProp$l = Object.defineProperty;
6196
+ var __defProps$b = Object.defineProperties;
6197
+ var __getOwnPropDescs$b = Object.getOwnPropertyDescriptors;
6198
+ var __getOwnPropSymbols$l = Object.getOwnPropertySymbols;
6199
+ var __hasOwnProp$l = Object.prototype.hasOwnProperty;
6200
+ var __propIsEnum$l = Object.prototype.propertyIsEnumerable;
6201
+ var __defNormalProp$l = (obj, key, value) => key in obj ? __defProp$l(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6202
+ var __spreadValues$l = (a, b) => {
6391
6203
  for (var prop in b || (b = {}))
6392
- if (__hasOwnProp$k.call(b, prop))
6393
- __defNormalProp$k(a, prop, b[prop]);
6394
- if (__getOwnPropSymbols$k)
6395
- for (var prop of __getOwnPropSymbols$k(b)) {
6396
- if (__propIsEnum$k.call(b, prop))
6397
- __defNormalProp$k(a, prop, b[prop]);
6204
+ if (__hasOwnProp$l.call(b, prop))
6205
+ __defNormalProp$l(a, prop, b[prop]);
6206
+ if (__getOwnPropSymbols$l)
6207
+ for (var prop of __getOwnPropSymbols$l(b)) {
6208
+ if (__propIsEnum$l.call(b, prop))
6209
+ __defNormalProp$l(a, prop, b[prop]);
6398
6210
  }
6399
6211
  return a;
6400
6212
  };
6401
- var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
6213
+ var __spreadProps$b = (a, b) => __defProps$b(a, __getOwnPropDescs$b(b));
6402
6214
  class SceneDataTransformer extends SceneObjectBase {
6403
6215
  constructor(state) {
6404
6216
  super(state);
@@ -6475,7 +6287,7 @@ class SceneDataTransformer extends SceneObjectBase {
6475
6287
  const { series, annotations } = this._prevDataFromSource;
6476
6288
  if (data.series === series && data.annotations === annotations) {
6477
6289
  if (this.state.data && data.state !== this.state.data.state) {
6478
- this.setState({ data: __spreadProps$a(__spreadValues$k({}, this.state.data), { state: data.state }) });
6290
+ this.setState({ data: __spreadProps$b(__spreadValues$l({}, this.state.data), { state: data.state }) });
6479
6291
  }
6480
6292
  return true;
6481
6293
  }
@@ -6523,7 +6335,7 @@ class SceneDataTransformer extends SceneObjectBase {
6523
6335
  rxjs.map((values) => {
6524
6336
  const transformedSeries = values[0];
6525
6337
  const transformedAnnotations = values[1];
6526
- return __spreadProps$a(__spreadValues$k({}, data$1), {
6338
+ return __spreadProps$b(__spreadValues$l({}, data$1), {
6527
6339
  series: transformedSeries,
6528
6340
  annotations: transformedAnnotations != null ? transformedAnnotations : data$1.annotations
6529
6341
  });
@@ -6534,7 +6346,7 @@ class SceneDataTransformer extends SceneObjectBase {
6534
6346
  const sourceErr = ((_a2 = this.getSourceData().state.data) == null ? void 0 : _a2.errors) || [];
6535
6347
  const transformationError = runtime.toDataQueryError(err);
6536
6348
  transformationError.message = `Error transforming data: ${transformationError.message}`;
6537
- const result = __spreadProps$a(__spreadValues$k({}, data$1), {
6349
+ const result = __spreadProps$b(__spreadValues$l({}, data$1), {
6538
6350
  state: data.LoadingState.Error,
6539
6351
  errors: [...sourceErr, transformationError]
6540
6352
  });
@@ -6867,28 +6679,28 @@ class SceneVariableSetVariableDependencyHandler {
6867
6679
  }
6868
6680
  }
6869
6681
 
6870
- var __defProp$j = Object.defineProperty;
6871
- var __defProps$9 = Object.defineProperties;
6872
- var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
6873
- var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
6874
- var __hasOwnProp$j = Object.prototype.hasOwnProperty;
6875
- var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
6876
- var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6877
- var __spreadValues$j = (a, b) => {
6682
+ var __defProp$k = Object.defineProperty;
6683
+ var __defProps$a = Object.defineProperties;
6684
+ var __getOwnPropDescs$a = Object.getOwnPropertyDescriptors;
6685
+ var __getOwnPropSymbols$k = Object.getOwnPropertySymbols;
6686
+ var __hasOwnProp$k = Object.prototype.hasOwnProperty;
6687
+ var __propIsEnum$k = Object.prototype.propertyIsEnumerable;
6688
+ var __defNormalProp$k = (obj, key, value) => key in obj ? __defProp$k(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6689
+ var __spreadValues$k = (a, b) => {
6878
6690
  for (var prop in b || (b = {}))
6879
- if (__hasOwnProp$j.call(b, prop))
6880
- __defNormalProp$j(a, prop, b[prop]);
6881
- if (__getOwnPropSymbols$j)
6882
- for (var prop of __getOwnPropSymbols$j(b)) {
6883
- if (__propIsEnum$j.call(b, prop))
6884
- __defNormalProp$j(a, prop, b[prop]);
6691
+ if (__hasOwnProp$k.call(b, prop))
6692
+ __defNormalProp$k(a, prop, b[prop]);
6693
+ if (__getOwnPropSymbols$k)
6694
+ for (var prop of __getOwnPropSymbols$k(b)) {
6695
+ if (__propIsEnum$k.call(b, prop))
6696
+ __defNormalProp$k(a, prop, b[prop]);
6885
6697
  }
6886
6698
  return a;
6887
6699
  };
6888
- var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
6700
+ var __spreadProps$a = (a, b) => __defProps$a(a, __getOwnPropDescs$a(b));
6889
6701
  class ConstantVariable extends SceneObjectBase {
6890
6702
  constructor(initialState) {
6891
- super(__spreadProps$9(__spreadValues$j({
6703
+ super(__spreadProps$a(__spreadValues$k({
6892
6704
  type: "constant",
6893
6705
  value: "",
6894
6706
  name: ""
@@ -6901,25 +6713,25 @@ class ConstantVariable extends SceneObjectBase {
6901
6713
  }
6902
6714
  }
6903
6715
 
6904
- var __defProp$i = Object.defineProperty;
6905
- var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
6906
- var __hasOwnProp$i = Object.prototype.hasOwnProperty;
6907
- var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
6908
- var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6909
- var __spreadValues$i = (a, b) => {
6716
+ var __defProp$j = Object.defineProperty;
6717
+ var __getOwnPropSymbols$j = Object.getOwnPropertySymbols;
6718
+ var __hasOwnProp$j = Object.prototype.hasOwnProperty;
6719
+ var __propIsEnum$j = Object.prototype.propertyIsEnumerable;
6720
+ var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6721
+ var __spreadValues$j = (a, b) => {
6910
6722
  for (var prop in b || (b = {}))
6911
- if (__hasOwnProp$i.call(b, prop))
6912
- __defNormalProp$i(a, prop, b[prop]);
6913
- if (__getOwnPropSymbols$i)
6914
- for (var prop of __getOwnPropSymbols$i(b)) {
6915
- if (__propIsEnum$i.call(b, prop))
6916
- __defNormalProp$i(a, prop, b[prop]);
6723
+ if (__hasOwnProp$j.call(b, prop))
6724
+ __defNormalProp$j(a, prop, b[prop]);
6725
+ if (__getOwnPropSymbols$j)
6726
+ for (var prop of __getOwnPropSymbols$j(b)) {
6727
+ if (__propIsEnum$j.call(b, prop))
6728
+ __defNormalProp$j(a, prop, b[prop]);
6917
6729
  }
6918
6730
  return a;
6919
6731
  };
6920
6732
  class CustomVariable extends MultiValueVariable {
6921
6733
  constructor(initialState) {
6922
- super(__spreadValues$i({
6734
+ super(__spreadValues$j({
6923
6735
  type: "custom",
6924
6736
  query: "",
6925
6737
  value: "",
@@ -6953,25 +6765,25 @@ CustomVariable.Component = ({ model }) => {
6953
6765
  return renderSelectForVariable(model);
6954
6766
  };
6955
6767
 
6956
- var __defProp$h = Object.defineProperty;
6957
- var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
6958
- var __hasOwnProp$h = Object.prototype.hasOwnProperty;
6959
- var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
6960
- var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6961
- var __spreadValues$h = (a, b) => {
6768
+ var __defProp$i = Object.defineProperty;
6769
+ var __getOwnPropSymbols$i = Object.getOwnPropertySymbols;
6770
+ var __hasOwnProp$i = Object.prototype.hasOwnProperty;
6771
+ var __propIsEnum$i = Object.prototype.propertyIsEnumerable;
6772
+ var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6773
+ var __spreadValues$i = (a, b) => {
6962
6774
  for (var prop in b || (b = {}))
6963
- if (__hasOwnProp$h.call(b, prop))
6964
- __defNormalProp$h(a, prop, b[prop]);
6965
- if (__getOwnPropSymbols$h)
6966
- for (var prop of __getOwnPropSymbols$h(b)) {
6967
- if (__propIsEnum$h.call(b, prop))
6968
- __defNormalProp$h(a, prop, b[prop]);
6775
+ if (__hasOwnProp$i.call(b, prop))
6776
+ __defNormalProp$i(a, prop, b[prop]);
6777
+ if (__getOwnPropSymbols$i)
6778
+ for (var prop of __getOwnPropSymbols$i(b)) {
6779
+ if (__propIsEnum$i.call(b, prop))
6780
+ __defNormalProp$i(a, prop, b[prop]);
6969
6781
  }
6970
6782
  return a;
6971
6783
  };
6972
6784
  class DataSourceVariable extends MultiValueVariable {
6973
6785
  constructor(initialState) {
6974
- super(__spreadValues$h({
6786
+ super(__spreadValues$i({
6975
6787
  type: "datasource",
6976
6788
  value: "",
6977
6789
  text: "",
@@ -7055,25 +6867,25 @@ const hasCustomVariableSupport = (datasource) => {
7055
6867
  return "query" in variableSupport && "editor" in variableSupport && Boolean(variableSupport.query) && Boolean(variableSupport.editor);
7056
6868
  };
7057
6869
 
7058
- var __defProp$g = Object.defineProperty;
7059
- var __defProps$8 = Object.defineProperties;
7060
- var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
7061
- var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
7062
- var __hasOwnProp$g = Object.prototype.hasOwnProperty;
7063
- var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
7064
- var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7065
- var __spreadValues$g = (a, b) => {
6870
+ var __defProp$h = Object.defineProperty;
6871
+ var __defProps$9 = Object.defineProperties;
6872
+ var __getOwnPropDescs$9 = Object.getOwnPropertyDescriptors;
6873
+ var __getOwnPropSymbols$h = Object.getOwnPropertySymbols;
6874
+ var __hasOwnProp$h = Object.prototype.hasOwnProperty;
6875
+ var __propIsEnum$h = Object.prototype.propertyIsEnumerable;
6876
+ var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6877
+ var __spreadValues$h = (a, b) => {
7066
6878
  for (var prop in b || (b = {}))
7067
- if (__hasOwnProp$g.call(b, prop))
7068
- __defNormalProp$g(a, prop, b[prop]);
7069
- if (__getOwnPropSymbols$g)
7070
- for (var prop of __getOwnPropSymbols$g(b)) {
7071
- if (__propIsEnum$g.call(b, prop))
7072
- __defNormalProp$g(a, prop, b[prop]);
6879
+ if (__hasOwnProp$h.call(b, prop))
6880
+ __defNormalProp$h(a, prop, b[prop]);
6881
+ if (__getOwnPropSymbols$h)
6882
+ for (var prop of __getOwnPropSymbols$h(b)) {
6883
+ if (__propIsEnum$h.call(b, prop))
6884
+ __defNormalProp$h(a, prop, b[prop]);
7073
6885
  }
7074
6886
  return a;
7075
6887
  };
7076
- var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
6888
+ var __spreadProps$9 = (a, b) => __defProps$9(a, __getOwnPropDescs$9(b));
7077
6889
  class StandardQueryRunner {
7078
6890
  constructor(datasource, _runRequest = runtime.getRunRequest()) {
7079
6891
  this.datasource = datasource;
@@ -7110,7 +6922,7 @@ class LegacyQueryRunner {
7110
6922
  return getEmptyMetricFindValueObservable();
7111
6923
  }
7112
6924
  return rxjs.from(
7113
- this.datasource.metricFindQuery(variable.state.query, __spreadProps$8(__spreadValues$g({}, request), {
6925
+ this.datasource.metricFindQuery(variable.state.query, __spreadProps$9(__spreadValues$h({}, request), {
7114
6926
  variable: {
7115
6927
  name: variable.state.name,
7116
6928
  type: variable.state.type
@@ -7172,7 +6984,7 @@ function ensureVariableQueryModelIsADataQuery(variable) {
7172
6984
  return { query, refId: `variable-${variable.state.name}` };
7173
6985
  }
7174
6986
  if (query.refId == null) {
7175
- return __spreadProps$8(__spreadValues$g({}, query), { refId: `variable-${variable.state.name}` });
6987
+ return __spreadProps$9(__spreadValues$h({}, query), { refId: `variable-${variable.state.name}` });
7176
6988
  }
7177
6989
  return variable.state.query;
7178
6990
  }
@@ -7387,25 +7199,25 @@ function areMetricFindValues(data$1) {
7387
7199
  return false;
7388
7200
  }
7389
7201
 
7390
- var __defProp$f = Object.defineProperty;
7391
- var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
7392
- var __hasOwnProp$f = Object.prototype.hasOwnProperty;
7393
- var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
7394
- var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7395
- var __spreadValues$f = (a, b) => {
7202
+ var __defProp$g = Object.defineProperty;
7203
+ var __getOwnPropSymbols$g = Object.getOwnPropertySymbols;
7204
+ var __hasOwnProp$g = Object.prototype.hasOwnProperty;
7205
+ var __propIsEnum$g = Object.prototype.propertyIsEnumerable;
7206
+ var __defNormalProp$g = (obj, key, value) => key in obj ? __defProp$g(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7207
+ var __spreadValues$g = (a, b) => {
7396
7208
  for (var prop in b || (b = {}))
7397
- if (__hasOwnProp$f.call(b, prop))
7398
- __defNormalProp$f(a, prop, b[prop]);
7399
- if (__getOwnPropSymbols$f)
7400
- for (var prop of __getOwnPropSymbols$f(b)) {
7401
- if (__propIsEnum$f.call(b, prop))
7402
- __defNormalProp$f(a, prop, b[prop]);
7209
+ if (__hasOwnProp$g.call(b, prop))
7210
+ __defNormalProp$g(a, prop, b[prop]);
7211
+ if (__getOwnPropSymbols$g)
7212
+ for (var prop of __getOwnPropSymbols$g(b)) {
7213
+ if (__propIsEnum$g.call(b, prop))
7214
+ __defNormalProp$g(a, prop, b[prop]);
7403
7215
  }
7404
7216
  return a;
7405
7217
  };
7406
7218
  class QueryVariable extends MultiValueVariable {
7407
7219
  constructor(initialState) {
7408
- super(__spreadValues$f({
7220
+ super(__spreadValues$g({
7409
7221
  type: "query",
7410
7222
  name: "",
7411
7223
  value: "",
@@ -7558,25 +7370,25 @@ function queryMetricTree(query) {
7558
7370
  return queryTree(children, query.split("."), 0);
7559
7371
  }
7560
7372
 
7561
- var __defProp$e = Object.defineProperty;
7562
- var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
7563
- var __hasOwnProp$e = Object.prototype.hasOwnProperty;
7564
- var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
7565
- var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7566
- var __spreadValues$e = (a, b) => {
7373
+ var __defProp$f = Object.defineProperty;
7374
+ var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
7375
+ var __hasOwnProp$f = Object.prototype.hasOwnProperty;
7376
+ var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
7377
+ var __defNormalProp$f = (obj, key, value) => key in obj ? __defProp$f(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7378
+ var __spreadValues$f = (a, b) => {
7567
7379
  for (var prop in b || (b = {}))
7568
- if (__hasOwnProp$e.call(b, prop))
7569
- __defNormalProp$e(a, prop, b[prop]);
7570
- if (__getOwnPropSymbols$e)
7571
- for (var prop of __getOwnPropSymbols$e(b)) {
7572
- if (__propIsEnum$e.call(b, prop))
7573
- __defNormalProp$e(a, prop, b[prop]);
7380
+ if (__hasOwnProp$f.call(b, prop))
7381
+ __defNormalProp$f(a, prop, b[prop]);
7382
+ if (__getOwnPropSymbols$f)
7383
+ for (var prop of __getOwnPropSymbols$f(b)) {
7384
+ if (__propIsEnum$f.call(b, prop))
7385
+ __defNormalProp$f(a, prop, b[prop]);
7574
7386
  }
7575
7387
  return a;
7576
7388
  };
7577
7389
  class TestVariable extends MultiValueVariable {
7578
7390
  constructor(initialState, isLazy = false) {
7579
- super(__spreadValues$e({
7391
+ super(__spreadValues$f({
7580
7392
  type: "custom",
7581
7393
  name: "Test",
7582
7394
  value: "Value",
@@ -7685,25 +7497,25 @@ function VariableValueInput({ model }) {
7685
7497
  });
7686
7498
  }
7687
7499
 
7688
- var __defProp$d = Object.defineProperty;
7689
- var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
7690
- var __hasOwnProp$d = Object.prototype.hasOwnProperty;
7691
- var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
7692
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7693
- var __spreadValues$d = (a, b) => {
7500
+ var __defProp$e = Object.defineProperty;
7501
+ var __getOwnPropSymbols$e = Object.getOwnPropertySymbols;
7502
+ var __hasOwnProp$e = Object.prototype.hasOwnProperty;
7503
+ var __propIsEnum$e = Object.prototype.propertyIsEnumerable;
7504
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7505
+ var __spreadValues$e = (a, b) => {
7694
7506
  for (var prop in b || (b = {}))
7695
- if (__hasOwnProp$d.call(b, prop))
7696
- __defNormalProp$d(a, prop, b[prop]);
7697
- if (__getOwnPropSymbols$d)
7698
- for (var prop of __getOwnPropSymbols$d(b)) {
7699
- if (__propIsEnum$d.call(b, prop))
7700
- __defNormalProp$d(a, prop, b[prop]);
7507
+ if (__hasOwnProp$e.call(b, prop))
7508
+ __defNormalProp$e(a, prop, b[prop]);
7509
+ if (__getOwnPropSymbols$e)
7510
+ for (var prop of __getOwnPropSymbols$e(b)) {
7511
+ if (__propIsEnum$e.call(b, prop))
7512
+ __defNormalProp$e(a, prop, b[prop]);
7701
7513
  }
7702
7514
  return a;
7703
7515
  };
7704
7516
  class TextBoxVariable extends SceneObjectBase {
7705
7517
  constructor(initialState) {
7706
- super(__spreadValues$d({
7518
+ super(__spreadValues$e({
7707
7519
  type: "textbox",
7708
7520
  value: "",
7709
7521
  name: ""
@@ -7740,28 +7552,28 @@ TextBoxVariable.Component = ({ model }) => {
7740
7552
  });
7741
7553
  };
7742
7554
 
7743
- var __defProp$c = Object.defineProperty;
7744
- var __defProps$7 = Object.defineProperties;
7745
- var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
7746
- var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
7747
- var __hasOwnProp$c = Object.prototype.hasOwnProperty;
7748
- var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
7749
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7750
- var __spreadValues$c = (a, b) => {
7555
+ var __defProp$d = Object.defineProperty;
7556
+ var __defProps$8 = Object.defineProperties;
7557
+ var __getOwnPropDescs$8 = Object.getOwnPropertyDescriptors;
7558
+ var __getOwnPropSymbols$d = Object.getOwnPropertySymbols;
7559
+ var __hasOwnProp$d = Object.prototype.hasOwnProperty;
7560
+ var __propIsEnum$d = Object.prototype.propertyIsEnumerable;
7561
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7562
+ var __spreadValues$d = (a, b) => {
7751
7563
  for (var prop in b || (b = {}))
7752
- if (__hasOwnProp$c.call(b, prop))
7753
- __defNormalProp$c(a, prop, b[prop]);
7754
- if (__getOwnPropSymbols$c)
7755
- for (var prop of __getOwnPropSymbols$c(b)) {
7756
- if (__propIsEnum$c.call(b, prop))
7757
- __defNormalProp$c(a, prop, b[prop]);
7564
+ if (__hasOwnProp$d.call(b, prop))
7565
+ __defNormalProp$d(a, prop, b[prop]);
7566
+ if (__getOwnPropSymbols$d)
7567
+ for (var prop of __getOwnPropSymbols$d(b)) {
7568
+ if (__propIsEnum$d.call(b, prop))
7569
+ __defNormalProp$d(a, prop, b[prop]);
7758
7570
  }
7759
7571
  return a;
7760
7572
  };
7761
- var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
7573
+ var __spreadProps$8 = (a, b) => __defProps$8(a, __getOwnPropDescs$8(b));
7762
7574
  class LocalValueVariable extends SceneObjectBase {
7763
7575
  constructor(initialState) {
7764
- super(__spreadProps$7(__spreadValues$c({
7576
+ super(__spreadProps$8(__spreadValues$d({
7765
7577
  type: "system",
7766
7578
  value: "",
7767
7579
  text: "",
@@ -7793,25 +7605,25 @@ class LocalValueVariable extends SceneObjectBase {
7793
7605
  }
7794
7606
  }
7795
7607
 
7796
- var __defProp$b = Object.defineProperty;
7797
- var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
7798
- var __hasOwnProp$b = Object.prototype.hasOwnProperty;
7799
- var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
7800
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7801
- var __spreadValues$b = (a, b) => {
7608
+ var __defProp$c = Object.defineProperty;
7609
+ var __getOwnPropSymbols$c = Object.getOwnPropertySymbols;
7610
+ var __hasOwnProp$c = Object.prototype.hasOwnProperty;
7611
+ var __propIsEnum$c = Object.prototype.propertyIsEnumerable;
7612
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7613
+ var __spreadValues$c = (a, b) => {
7802
7614
  for (var prop in b || (b = {}))
7803
- if (__hasOwnProp$b.call(b, prop))
7804
- __defNormalProp$b(a, prop, b[prop]);
7805
- if (__getOwnPropSymbols$b)
7806
- for (var prop of __getOwnPropSymbols$b(b)) {
7807
- if (__propIsEnum$b.call(b, prop))
7808
- __defNormalProp$b(a, prop, b[prop]);
7615
+ if (__hasOwnProp$c.call(b, prop))
7616
+ __defNormalProp$c(a, prop, b[prop]);
7617
+ if (__getOwnPropSymbols$c)
7618
+ for (var prop of __getOwnPropSymbols$c(b)) {
7619
+ if (__propIsEnum$c.call(b, prop))
7620
+ __defNormalProp$c(a, prop, b[prop]);
7809
7621
  }
7810
7622
  return a;
7811
7623
  };
7812
7624
  class IntervalVariable extends SceneObjectBase {
7813
7625
  constructor(initialState) {
7814
- super(__spreadValues$b({
7626
+ super(__spreadValues$c({
7815
7627
  type: "interval",
7816
7628
  value: "",
7817
7629
  intervals: ["1m", "10m", "30m", "1h", "6h", "12h", "1d", "7d", "14d", "30d"],
@@ -8019,7 +7831,7 @@ class EmbeddedScene extends SceneObjectBase {
8019
7831
  EmbeddedScene.Component = EmbeddedSceneRenderer;
8020
7832
  function EmbeddedSceneRenderer({ model }) {
8021
7833
  const { body, controls } = model.useState();
8022
- const styles = ui.useStyles2(getStyles$5);
7834
+ const styles = ui.useStyles2(getStyles$6);
8023
7835
  return /* @__PURE__ */ React__default["default"].createElement("div", {
8024
7836
  className: styles.container
8025
7837
  }, controls && /* @__PURE__ */ React__default["default"].createElement("div", {
@@ -8033,7 +7845,7 @@ function EmbeddedSceneRenderer({ model }) {
8033
7845
  model: body
8034
7846
  })));
8035
7847
  }
8036
- const getStyles$5 = (theme) => {
7848
+ const getStyles$6 = (theme) => {
8037
7849
  return {
8038
7850
  container: css.css({
8039
7851
  flexGrow: 1,
@@ -8136,30 +7948,30 @@ function isSceneGridLayout(child) {
8136
7948
  return child instanceof SceneGridLayout;
8137
7949
  }
8138
7950
 
8139
- var __defProp$a = Object.defineProperty;
8140
- var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
8141
- var __hasOwnProp$a = Object.prototype.hasOwnProperty;
8142
- var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
8143
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8144
- var __spreadValues$a = (a, b) => {
7951
+ var __defProp$b = Object.defineProperty;
7952
+ var __getOwnPropSymbols$b = Object.getOwnPropertySymbols;
7953
+ var __hasOwnProp$b = Object.prototype.hasOwnProperty;
7954
+ var __propIsEnum$b = Object.prototype.propertyIsEnumerable;
7955
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7956
+ var __spreadValues$b = (a, b) => {
8145
7957
  for (var prop in b || (b = {}))
8146
- if (__hasOwnProp$a.call(b, prop))
8147
- __defNormalProp$a(a, prop, b[prop]);
8148
- if (__getOwnPropSymbols$a)
8149
- for (var prop of __getOwnPropSymbols$a(b)) {
8150
- if (__propIsEnum$a.call(b, prop))
8151
- __defNormalProp$a(a, prop, b[prop]);
7958
+ if (__hasOwnProp$b.call(b, prop))
7959
+ __defNormalProp$b(a, prop, b[prop]);
7960
+ if (__getOwnPropSymbols$b)
7961
+ for (var prop of __getOwnPropSymbols$b(b)) {
7962
+ if (__propIsEnum$b.call(b, prop))
7963
+ __defNormalProp$b(a, prop, b[prop]);
8152
7964
  }
8153
7965
  return a;
8154
7966
  };
8155
7967
  var __objRest$1 = (source, exclude) => {
8156
7968
  var target = {};
8157
7969
  for (var prop in source)
8158
- if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
7970
+ if (__hasOwnProp$b.call(source, prop) && exclude.indexOf(prop) < 0)
8159
7971
  target[prop] = source[prop];
8160
- if (source != null && __getOwnPropSymbols$a)
8161
- for (var prop of __getOwnPropSymbols$a(source)) {
8162
- if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
7972
+ if (source != null && __getOwnPropSymbols$b)
7973
+ for (var prop of __getOwnPropSymbols$b(source)) {
7974
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$b.call(source, prop))
8163
7975
  target[prop] = source[prop];
8164
7976
  }
8165
7977
  return target;
@@ -8199,7 +8011,7 @@ const LazyLoader = React__default["default"].forwardRef(
8199
8011
  }
8200
8012
  };
8201
8013
  });
8202
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$a({
8014
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$b({
8203
8015
  id,
8204
8016
  ref: innerRef
8205
8017
  }, rest), loaded && (typeof children === "function" ? children({ isInView }) : children));
@@ -8217,33 +8029,33 @@ LazyLoader.observer = new IntersectionObserver(
8217
8029
  { rootMargin: "100px" }
8218
8030
  );
8219
8031
 
8220
- var __defProp$9 = Object.defineProperty;
8221
- var __defProps$6 = Object.defineProperties;
8222
- var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
8223
- var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
8224
- var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
8225
- var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
8226
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8227
- var __spreadValues$9 = (a, b) => {
8032
+ var __defProp$a = Object.defineProperty;
8033
+ var __defProps$7 = Object.defineProperties;
8034
+ var __getOwnPropDescs$7 = Object.getOwnPropertyDescriptors;
8035
+ var __getOwnPropSymbols$a = Object.getOwnPropertySymbols;
8036
+ var __hasOwnProp$a = Object.prototype.hasOwnProperty;
8037
+ var __propIsEnum$a = Object.prototype.propertyIsEnumerable;
8038
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8039
+ var __spreadValues$a = (a, b) => {
8228
8040
  for (var prop in b || (b = {}))
8229
- if (__hasOwnProp$9.call(b, prop))
8230
- __defNormalProp$9(a, prop, b[prop]);
8231
- if (__getOwnPropSymbols$9)
8232
- for (var prop of __getOwnPropSymbols$9(b)) {
8233
- if (__propIsEnum$9.call(b, prop))
8234
- __defNormalProp$9(a, prop, b[prop]);
8041
+ if (__hasOwnProp$a.call(b, prop))
8042
+ __defNormalProp$a(a, prop, b[prop]);
8043
+ if (__getOwnPropSymbols$a)
8044
+ for (var prop of __getOwnPropSymbols$a(b)) {
8045
+ if (__propIsEnum$a.call(b, prop))
8046
+ __defNormalProp$a(a, prop, b[prop]);
8235
8047
  }
8236
8048
  return a;
8237
8049
  };
8238
- var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
8050
+ var __spreadProps$7 = (a, b) => __defProps$7(a, __getOwnPropDescs$7(b));
8239
8051
  var __objRest = (source, exclude) => {
8240
8052
  var target = {};
8241
8053
  for (var prop in source)
8242
- if (__hasOwnProp$9.call(source, prop) && exclude.indexOf(prop) < 0)
8054
+ if (__hasOwnProp$a.call(source, prop) && exclude.indexOf(prop) < 0)
8243
8055
  target[prop] = source[prop];
8244
- if (source != null && __getOwnPropSymbols$9)
8245
- for (var prop of __getOwnPropSymbols$9(source)) {
8246
- if (exclude.indexOf(prop) < 0 && __propIsEnum$9.call(source, prop))
8056
+ if (source != null && __getOwnPropSymbols$a)
8057
+ for (var prop of __getOwnPropSymbols$a(source)) {
8058
+ if (exclude.indexOf(prop) < 0 && __propIsEnum$a.call(source, prop))
8247
8059
  target[prop] = source[prop];
8248
8060
  }
8249
8061
  return target;
@@ -8302,7 +8114,7 @@ const GridItemWrapper = React__default["default"].forwardRef((props, ref) => {
8302
8114
  key: sceneChild.state.key
8303
8115
  });
8304
8116
  if (isLazy) {
8305
- return /* @__PURE__ */ React__default["default"].createElement(LazyLoader, __spreadProps$6(__spreadValues$9({}, divProps), {
8117
+ return /* @__PURE__ */ React__default["default"].createElement(LazyLoader, __spreadProps$7(__spreadValues$a({}, divProps), {
8306
8118
  key: sceneChild.state.key,
8307
8119
  "data-griditem-key": sceneChild.state.key,
8308
8120
  className: css.cx(className, props.className),
@@ -8310,7 +8122,7 @@ const GridItemWrapper = React__default["default"].forwardRef((props, ref) => {
8310
8122
  ref
8311
8123
  }), innerContent, children);
8312
8124
  }
8313
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$6(__spreadValues$9({}, divProps), {
8125
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$7(__spreadValues$a({}, divProps), {
8314
8126
  ref,
8315
8127
  key: sceneChild.state.key,
8316
8128
  "data-griditem-key": sceneChild.state.key,
@@ -8340,7 +8152,7 @@ function updateAnimationClass(ref, isDraggable, retry) {
8340
8152
  const ResizeHandle = React__default["default"].forwardRef((_a, ref) => {
8341
8153
  var _b = _a, divProps = __objRest(_b, ["handleAxis"]);
8342
8154
  const customCssClass = ui.useStyles2(getResizeHandleStyles);
8343
- return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$6(__spreadValues$9({
8155
+ return /* @__PURE__ */ React__default["default"].createElement("div", __spreadProps$7(__spreadValues$a({
8344
8156
  ref
8345
8157
  }, divProps), {
8346
8158
  className: `${customCssClass} scene-resize-handle`
@@ -8380,60 +8192,60 @@ function getResizeHandleStyles(theme) {
8380
8192
  });
8381
8193
  }
8382
8194
 
8383
- var __defProp$8 = Object.defineProperty;
8384
- var __defProps$5 = Object.defineProperties;
8385
- var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
8386
- var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
8387
- var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
8388
- var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
8389
- var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8390
- var __spreadValues$8 = (a, b) => {
8195
+ var __defProp$9 = Object.defineProperty;
8196
+ var __defProps$6 = Object.defineProperties;
8197
+ var __getOwnPropDescs$6 = Object.getOwnPropertyDescriptors;
8198
+ var __getOwnPropSymbols$9 = Object.getOwnPropertySymbols;
8199
+ var __hasOwnProp$9 = Object.prototype.hasOwnProperty;
8200
+ var __propIsEnum$9 = Object.prototype.propertyIsEnumerable;
8201
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8202
+ var __spreadValues$9 = (a, b) => {
8391
8203
  for (var prop in b || (b = {}))
8392
- if (__hasOwnProp$8.call(b, prop))
8393
- __defNormalProp$8(a, prop, b[prop]);
8394
- if (__getOwnPropSymbols$8)
8395
- for (var prop of __getOwnPropSymbols$8(b)) {
8396
- if (__propIsEnum$8.call(b, prop))
8397
- __defNormalProp$8(a, prop, b[prop]);
8204
+ if (__hasOwnProp$9.call(b, prop))
8205
+ __defNormalProp$9(a, prop, b[prop]);
8206
+ if (__getOwnPropSymbols$9)
8207
+ for (var prop of __getOwnPropSymbols$9(b)) {
8208
+ if (__propIsEnum$9.call(b, prop))
8209
+ __defNormalProp$9(a, prop, b[prop]);
8398
8210
  }
8399
8211
  return a;
8400
8212
  };
8401
- var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
8213
+ var __spreadProps$6 = (a, b) => __defProps$6(a, __getOwnPropDescs$6(b));
8402
8214
  function fitPanelsInHeight(cells, height) {
8403
8215
  const visibleHeight = height - GRID_CELL_VMARGIN * 4;
8404
8216
  const currentGridHeight = Math.max(...cells.map((cell) => cell.h + cell.y));
8405
8217
  const visibleGridHeight = Math.floor(visibleHeight / (GRID_CELL_HEIGHT + GRID_CELL_VMARGIN));
8406
8218
  const scaleFactor = currentGridHeight / visibleGridHeight;
8407
8219
  return cells.map((cell) => {
8408
- return __spreadProps$5(__spreadValues$8({}, cell), {
8220
+ return __spreadProps$6(__spreadValues$9({}, cell), {
8409
8221
  y: Math.round(cell.y / scaleFactor) || 0,
8410
8222
  h: Math.round(cell.h / scaleFactor) || 1
8411
8223
  });
8412
8224
  });
8413
8225
  }
8414
8226
 
8415
- var __defProp$7 = Object.defineProperty;
8416
- var __defProps$4 = Object.defineProperties;
8417
- var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
8418
- var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
8419
- var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
8420
- var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
8421
- var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8422
- var __spreadValues$7 = (a, b) => {
8227
+ var __defProp$8 = Object.defineProperty;
8228
+ var __defProps$5 = Object.defineProperties;
8229
+ var __getOwnPropDescs$5 = Object.getOwnPropertyDescriptors;
8230
+ var __getOwnPropSymbols$8 = Object.getOwnPropertySymbols;
8231
+ var __hasOwnProp$8 = Object.prototype.hasOwnProperty;
8232
+ var __propIsEnum$8 = Object.prototype.propertyIsEnumerable;
8233
+ var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8234
+ var __spreadValues$8 = (a, b) => {
8423
8235
  for (var prop in b || (b = {}))
8424
- if (__hasOwnProp$7.call(b, prop))
8425
- __defNormalProp$7(a, prop, b[prop]);
8426
- if (__getOwnPropSymbols$7)
8427
- for (var prop of __getOwnPropSymbols$7(b)) {
8428
- if (__propIsEnum$7.call(b, prop))
8429
- __defNormalProp$7(a, prop, b[prop]);
8236
+ if (__hasOwnProp$8.call(b, prop))
8237
+ __defNormalProp$8(a, prop, b[prop]);
8238
+ if (__getOwnPropSymbols$8)
8239
+ for (var prop of __getOwnPropSymbols$8(b)) {
8240
+ if (__propIsEnum$8.call(b, prop))
8241
+ __defNormalProp$8(a, prop, b[prop]);
8430
8242
  }
8431
8243
  return a;
8432
8244
  };
8433
- var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
8245
+ var __spreadProps$5 = (a, b) => __defProps$5(a, __getOwnPropDescs$5(b));
8434
8246
  const _SceneGridLayout = class extends SceneObjectBase {
8435
8247
  constructor(state) {
8436
- super(__spreadProps$4(__spreadValues$7({}, state), {
8248
+ super(__spreadProps$5(__spreadValues$8({}, state), {
8437
8249
  children: sortChildrenByPosition(state.children)
8438
8250
  }));
8439
8251
  this._skipOnLayoutChange = false;
@@ -8457,7 +8269,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
8457
8269
  height: item.h
8458
8270
  };
8459
8271
  if (!isItemSizeEqual(child.state, nextSize)) {
8460
- child.setState(__spreadValues$7({}, nextSize));
8272
+ child.setState(__spreadValues$8({}, nextSize));
8461
8273
  }
8462
8274
  }
8463
8275
  this.setState({ children: sortChildrenByPosition(this.state.children) });
@@ -8531,7 +8343,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
8531
8343
  const yDiff = firstPanelYPos - (rowY + 1);
8532
8344
  let yMax = rowY;
8533
8345
  for (const panel of rowChildren) {
8534
- const newSize = __spreadValues$7({}, panel.state);
8346
+ const newSize = __spreadValues$8({}, panel.state);
8535
8347
  newSize.y = (_b = newSize.y) != null ? _b : rowY;
8536
8348
  newSize.y -= yDiff;
8537
8349
  if (newSize.y !== panel.state.y) {
@@ -8658,7 +8470,7 @@ const _SceneGridLayout = class extends SceneObjectBase {
8658
8470
  }
8659
8471
  if (width < 768) {
8660
8472
  this._skipOnLayoutChange = true;
8661
- return cells.map((cell) => __spreadProps$4(__spreadValues$7({}, cell), { w: 24 }));
8473
+ return cells.map((cell) => __spreadProps$5(__spreadValues$8({}, cell), { w: 24 }));
8662
8474
  }
8663
8475
  this._skipOnLayoutChange = false;
8664
8476
  return cells;
@@ -8683,28 +8495,28 @@ function sortGridLayout(layout) {
8683
8495
  return [...layout].sort((a, b) => a.y - b.y || a.x - b.x);
8684
8496
  }
8685
8497
 
8686
- var __defProp$6 = Object.defineProperty;
8687
- var __defProps$3 = Object.defineProperties;
8688
- var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
8689
- var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
8690
- var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
8691
- var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
8692
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8693
- var __spreadValues$6 = (a, b) => {
8498
+ var __defProp$7 = Object.defineProperty;
8499
+ var __defProps$4 = Object.defineProperties;
8500
+ var __getOwnPropDescs$4 = Object.getOwnPropertyDescriptors;
8501
+ var __getOwnPropSymbols$7 = Object.getOwnPropertySymbols;
8502
+ var __hasOwnProp$7 = Object.prototype.hasOwnProperty;
8503
+ var __propIsEnum$7 = Object.prototype.propertyIsEnumerable;
8504
+ var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8505
+ var __spreadValues$7 = (a, b) => {
8694
8506
  for (var prop in b || (b = {}))
8695
- if (__hasOwnProp$6.call(b, prop))
8696
- __defNormalProp$6(a, prop, b[prop]);
8697
- if (__getOwnPropSymbols$6)
8698
- for (var prop of __getOwnPropSymbols$6(b)) {
8699
- if (__propIsEnum$6.call(b, prop))
8700
- __defNormalProp$6(a, prop, b[prop]);
8507
+ if (__hasOwnProp$7.call(b, prop))
8508
+ __defNormalProp$7(a, prop, b[prop]);
8509
+ if (__getOwnPropSymbols$7)
8510
+ for (var prop of __getOwnPropSymbols$7(b)) {
8511
+ if (__propIsEnum$7.call(b, prop))
8512
+ __defNormalProp$7(a, prop, b[prop]);
8701
8513
  }
8702
8514
  return a;
8703
8515
  };
8704
- var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
8516
+ var __spreadProps$4 = (a, b) => __defProps$4(a, __getOwnPropDescs$4(b));
8705
8517
  class SceneGridRow extends SceneObjectBase {
8706
8518
  constructor(state) {
8707
- super(__spreadProps$3(__spreadValues$6({
8519
+ super(__spreadProps$4(__spreadValues$7({
8708
8520
  children: state.children || [],
8709
8521
  isCollapsible: state.isCollapsible || true,
8710
8522
  title: state.title || ""
@@ -8869,7 +8681,7 @@ NestedScene.Component = NestedSceneRenderer;
8869
8681
  function NestedSceneRenderer({ model }) {
8870
8682
  const { title, isCollapsed, canCollapse, canRemove, body, controls } = model.useState();
8871
8683
  const gridRow = ui.useStyles2(getSceneGridRowStyles);
8872
- const styles = ui.useStyles2(getStyles$4);
8684
+ const styles = ui.useStyles2(getStyles$5);
8873
8685
  const toolbarControls = (controls != null ? controls : []).map((action) => /* @__PURE__ */ React__default["default"].createElement(action.Component, {
8874
8686
  key: action.state.key,
8875
8687
  model: action
@@ -8904,7 +8716,7 @@ function NestedSceneRenderer({ model }) {
8904
8716
  model: body
8905
8717
  }));
8906
8718
  }
8907
- const getStyles$4 = (theme) => ({
8719
+ const getStyles$5 = (theme) => ({
8908
8720
  wrapper: css.css({
8909
8721
  display: "flex",
8910
8722
  flexDirection: "column",
@@ -9071,30 +8883,30 @@ function getShiftedTimeRange(dir, timeRange, upperLimit) {
9071
8883
  };
9072
8884
  }
9073
8885
 
9074
- var __defProp$5 = Object.defineProperty;
9075
- var __defProps$2 = Object.defineProperties;
9076
- var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
9077
- var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
9078
- var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
9079
- var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
9080
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9081
- var __spreadValues$5 = (a, b) => {
8886
+ var __defProp$6 = Object.defineProperty;
8887
+ var __defProps$3 = Object.defineProperties;
8888
+ var __getOwnPropDescs$3 = Object.getOwnPropertyDescriptors;
8889
+ var __getOwnPropSymbols$6 = Object.getOwnPropertySymbols;
8890
+ var __hasOwnProp$6 = Object.prototype.hasOwnProperty;
8891
+ var __propIsEnum$6 = Object.prototype.propertyIsEnumerable;
8892
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8893
+ var __spreadValues$6 = (a, b) => {
9082
8894
  for (var prop in b || (b = {}))
9083
- if (__hasOwnProp$5.call(b, prop))
9084
- __defNormalProp$5(a, prop, b[prop]);
9085
- if (__getOwnPropSymbols$5)
9086
- for (var prop of __getOwnPropSymbols$5(b)) {
9087
- if (__propIsEnum$5.call(b, prop))
9088
- __defNormalProp$5(a, prop, b[prop]);
8895
+ if (__hasOwnProp$6.call(b, prop))
8896
+ __defNormalProp$6(a, prop, b[prop]);
8897
+ if (__getOwnPropSymbols$6)
8898
+ for (var prop of __getOwnPropSymbols$6(b)) {
8899
+ if (__propIsEnum$6.call(b, prop))
8900
+ __defNormalProp$6(a, prop, b[prop]);
9089
8901
  }
9090
8902
  return a;
9091
8903
  };
9092
- var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
8904
+ var __spreadProps$3 = (a, b) => __defProps$3(a, __getOwnPropDescs$3(b));
9093
8905
  const DEFAULT_INTERVALS = ["5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"];
9094
8906
  class SceneRefreshPicker extends SceneObjectBase {
9095
8907
  constructor(state) {
9096
8908
  var _a, _b, _c;
9097
- super(__spreadProps$2(__spreadValues$5({
8909
+ super(__spreadProps$3(__spreadValues$6({
9098
8910
  refresh: ""
9099
8911
  }, state), {
9100
8912
  autoValue: void 0,
@@ -9226,6 +9038,234 @@ function useQueryControllerState(model) {
9226
9038
  return queryController.useState().isRunning;
9227
9039
  }
9228
9040
 
9041
+ const getCompareSeriesRefId = (refId) => `${refId}-compare`;
9042
+
9043
+ var __defProp$5 = Object.defineProperty;
9044
+ var __defProps$2 = Object.defineProperties;
9045
+ var __getOwnPropDescs$2 = Object.getOwnPropertyDescriptors;
9046
+ var __getOwnPropSymbols$5 = Object.getOwnPropertySymbols;
9047
+ var __hasOwnProp$5 = Object.prototype.hasOwnProperty;
9048
+ var __propIsEnum$5 = Object.prototype.propertyIsEnumerable;
9049
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9050
+ var __spreadValues$5 = (a, b) => {
9051
+ for (var prop in b || (b = {}))
9052
+ if (__hasOwnProp$5.call(b, prop))
9053
+ __defNormalProp$5(a, prop, b[prop]);
9054
+ if (__getOwnPropSymbols$5)
9055
+ for (var prop of __getOwnPropSymbols$5(b)) {
9056
+ if (__propIsEnum$5.call(b, prop))
9057
+ __defNormalProp$5(a, prop, b[prop]);
9058
+ }
9059
+ return a;
9060
+ };
9061
+ var __spreadProps$2 = (a, b) => __defProps$2(a, __getOwnPropDescs$2(b));
9062
+ const PREVIOUS_PERIOD_VALUE = "__previousPeriod";
9063
+ const NO_PERIOD_VALUE = "__noPeriod";
9064
+ const PREVIOUS_PERIOD_COMPARE_OPTION = {
9065
+ label: "Previous period",
9066
+ value: PREVIOUS_PERIOD_VALUE
9067
+ };
9068
+ const NO_COMPARE_OPTION = {
9069
+ label: "No comparison",
9070
+ value: NO_PERIOD_VALUE
9071
+ };
9072
+ const DEFAULT_COMPARE_OPTIONS = [
9073
+ { label: "Day before", value: "24h" },
9074
+ { label: "Week before", value: "1w" },
9075
+ { label: "Month before", value: "1M" }
9076
+ ];
9077
+ class SceneTimeRangeCompare extends SceneObjectBase {
9078
+ constructor(state) {
9079
+ super(__spreadValues$5({ compareOptions: DEFAULT_COMPARE_OPTIONS }, state));
9080
+ this._urlSync = new SceneObjectUrlSyncConfig(this, { keys: ["compareWith"] });
9081
+ this._onActivate = () => {
9082
+ const sceneTimeRange = sceneGraph.getTimeRange(this);
9083
+ this.setState({ compareOptions: this.getCompareOptions(sceneTimeRange.state.value) });
9084
+ this._subs.add(
9085
+ sceneTimeRange.subscribeToState((timeRange) => {
9086
+ const compareOptions = this.getCompareOptions(timeRange.value);
9087
+ const stateUpdate = { compareOptions };
9088
+ if (Boolean(this.state.compareWith) && !compareOptions.find(({ value }) => value === this.state.compareWith)) {
9089
+ stateUpdate.compareWith = PREVIOUS_PERIOD_VALUE;
9090
+ }
9091
+ this.setState(stateUpdate);
9092
+ })
9093
+ );
9094
+ };
9095
+ this.getCompareOptions = (timeRange) => {
9096
+ const diffDays = Math.ceil(timeRange.to.diff(timeRange.from));
9097
+ const matchIndex = DEFAULT_COMPARE_OPTIONS.findIndex(({ value }) => {
9098
+ const intervalInMs = data.rangeUtil.intervalToMs(value);
9099
+ return intervalInMs >= diffDays;
9100
+ });
9101
+ return [
9102
+ NO_COMPARE_OPTION,
9103
+ PREVIOUS_PERIOD_COMPARE_OPTION,
9104
+ ...DEFAULT_COMPARE_OPTIONS.slice(matchIndex).map(({ label, value }) => ({ label, value }))
9105
+ ];
9106
+ };
9107
+ this.onCompareWithChanged = (compareWith) => {
9108
+ if (compareWith === NO_PERIOD_VALUE) {
9109
+ this.onClearCompare();
9110
+ } else {
9111
+ this.setState({ compareWith });
9112
+ }
9113
+ };
9114
+ this.onClearCompare = () => {
9115
+ this.setState({ compareWith: void 0 });
9116
+ };
9117
+ this.addActivationHandler(this._onActivate);
9118
+ }
9119
+ getExtraQueries(request) {
9120
+ const extraQueries = [];
9121
+ const compareRange = this.getCompareTimeRange(request.range);
9122
+ if (!compareRange) {
9123
+ return extraQueries;
9124
+ }
9125
+ const targets = request.targets.filter((query) => query.timeRangeCompare !== false);
9126
+ if (targets.length) {
9127
+ extraQueries.push({
9128
+ req: __spreadProps$2(__spreadValues$5({}, request), {
9129
+ targets,
9130
+ range: compareRange
9131
+ }),
9132
+ processor: timeShiftAlignmentProcessor
9133
+ });
9134
+ }
9135
+ return extraQueries;
9136
+ }
9137
+ shouldRerun(prev, next) {
9138
+ return prev.compareWith !== next.compareWith;
9139
+ }
9140
+ getCompareTimeRange(timeRange) {
9141
+ let compareFrom;
9142
+ let compareTo;
9143
+ if (this.state.compareWith) {
9144
+ if (this.state.compareWith === PREVIOUS_PERIOD_VALUE) {
9145
+ const diffMs = timeRange.to.diff(timeRange.from);
9146
+ compareFrom = data.dateTime(timeRange.from).subtract(diffMs);
9147
+ compareTo = data.dateTime(timeRange.to).subtract(diffMs);
9148
+ } else {
9149
+ compareFrom = data.dateTime(timeRange.from).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
9150
+ compareTo = data.dateTime(timeRange.to).subtract(data.rangeUtil.intervalToMs(this.state.compareWith));
9151
+ }
9152
+ return {
9153
+ from: compareFrom,
9154
+ to: compareTo,
9155
+ raw: {
9156
+ from: compareFrom,
9157
+ to: compareTo
9158
+ }
9159
+ };
9160
+ }
9161
+ return void 0;
9162
+ }
9163
+ getUrlState() {
9164
+ return {
9165
+ compareWith: this.state.compareWith
9166
+ };
9167
+ }
9168
+ updateFromUrl(values) {
9169
+ if (!values.compareWith) {
9170
+ return;
9171
+ }
9172
+ const compareWith = parseUrlParam(values.compareWith);
9173
+ if (compareWith) {
9174
+ const compareOptions = this.getCompareOptions(sceneGraph.getTimeRange(this).state.value);
9175
+ if (compareOptions.find(({ value }) => value === compareWith)) {
9176
+ this.setState({
9177
+ compareWith
9178
+ });
9179
+ } else {
9180
+ this.setState({
9181
+ compareWith: "__previousPeriod"
9182
+ });
9183
+ }
9184
+ }
9185
+ }
9186
+ }
9187
+ SceneTimeRangeCompare.Component = SceneTimeRangeCompareRenderer;
9188
+ const timeShiftAlignmentProcessor = (primary, secondary) => {
9189
+ const diff = secondary.timeRange.from.diff(primary.timeRange.from);
9190
+ secondary.series.forEach((series) => {
9191
+ series.refId = getCompareSeriesRefId(series.refId || "");
9192
+ series.meta = __spreadProps$2(__spreadValues$5({}, series.meta), {
9193
+ timeCompare: {
9194
+ diffMs: diff,
9195
+ isTimeShiftQuery: true
9196
+ }
9197
+ });
9198
+ series.fields.forEach((field) => {
9199
+ if (field.type === data.FieldType.time) {
9200
+ field.values = field.values.map((v) => {
9201
+ return diff < 0 ? v - diff : v + diff;
9202
+ });
9203
+ }
9204
+ field.config = __spreadProps$2(__spreadValues$5({}, field.config), {
9205
+ color: {
9206
+ mode: "fixed",
9207
+ fixedColor: runtime.config.theme.palette.gray60
9208
+ }
9209
+ });
9210
+ return field;
9211
+ });
9212
+ });
9213
+ return rxjs.of(secondary);
9214
+ };
9215
+ function SceneTimeRangeCompareRenderer({ model }) {
9216
+ var _a;
9217
+ const styles = ui.useStyles2(getStyles$4);
9218
+ const { compareWith, compareOptions } = model.useState();
9219
+ const [previousCompare, setPreviousCompare] = React__default["default"].useState(compareWith);
9220
+ const previousValue = (_a = compareOptions.find(({ value: value2 }) => value2 === previousCompare)) != null ? _a : PREVIOUS_PERIOD_COMPARE_OPTION;
9221
+ const value = compareOptions.find(({ value: value2 }) => value2 === compareWith);
9222
+ const enabled = Boolean(value);
9223
+ const onClick = () => {
9224
+ if (enabled) {
9225
+ setPreviousCompare(compareWith);
9226
+ model.onClearCompare();
9227
+ } else if (!enabled) {
9228
+ model.onCompareWithChanged(previousValue.value);
9229
+ }
9230
+ };
9231
+ return /* @__PURE__ */ React__default["default"].createElement(ui.ButtonGroup, null, /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
9232
+ variant: "canvas",
9233
+ tooltip: "Enable time frame comparison",
9234
+ onClick: (e) => {
9235
+ e.stopPropagation();
9236
+ e.preventDefault();
9237
+ onClick();
9238
+ }
9239
+ }, /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
9240
+ label: " ",
9241
+ value: enabled,
9242
+ onClick
9243
+ }), "Comparison"), enabled ? /* @__PURE__ */ React__default["default"].createElement(ui.ButtonSelect, {
9244
+ variant: "canvas",
9245
+ value,
9246
+ options: compareOptions,
9247
+ onChange: (v) => {
9248
+ model.onCompareWithChanged(v.value);
9249
+ }
9250
+ }) : /* @__PURE__ */ React__default["default"].createElement(ui.ToolbarButton, {
9251
+ className: styles.previewButton,
9252
+ disabled: true,
9253
+ variant: "canvas",
9254
+ isOpen: false
9255
+ }, previousValue.label));
9256
+ }
9257
+ function getStyles$4(theme) {
9258
+ return {
9259
+ previewButton: css.css({
9260
+ "&:disabled": {
9261
+ border: `1px solid ${theme.colors.secondary.border}`,
9262
+ color: theme.colors.text.disabled,
9263
+ opacity: 1
9264
+ }
9265
+ })
9266
+ };
9267
+ }
9268
+
9229
9269
  class SceneByFrameRepeater extends SceneObjectBase {
9230
9270
  constructor(state) {
9231
9271
  super(state);